diff --git a/.gitignore b/.gitignore index 2bb7dfd..ef1f450 100644 --- a/.gitignore +++ b/.gitignore @@ -2,26 +2,23 @@ */*~ *.o *.pdf -cups .vscode/ .gdb_history gmon.out -Makefile.in .gitignore aclocal.m4 -Makefile -*/Makefile -depcomp -install-sh -missing aclocal.* -compile -autom4* +autom4te.cache/ +build-aux/ +configure config.guess config.sub config.log config.status -configure -data/org.openprinting.Backend.CUPS.service +Makefile +Makefile.in src/.deps +src/cups +data/org.openprinting.Backend.CUPS.service tmp/ +*/Makefile diff --git a/autogen.sh b/autogen.sh index 52a86ed..ee74085 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,5 +1,6 @@ #! /bin/sh -aclocal \ +mkdir -p build-aux \ +&& aclocal \ && automake --add-missing \ && autoconf diff --git a/configure.ac b/configure.ac index 11c5b47..19c74cc 100644 --- a/configure.ac +++ b/configure.ac @@ -3,15 +3,16 @@ AC_PREREQ([2.69]) AC_INIT([cpdb-backend-cups], [2.0b1], [https://github.com/OpenPrinting/cpdb-backend-cups/issues/], [cpdb-backend-cups], [https://github.com/OpenPrinting/cpdb-backend-cups]) -AM_INIT_AUTOMAKE([-Wall foreign]) +AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR([src/print_backend_cups.c]) +AM_INIT_AUTOMAKE([-Wall foreign]) : ${CFLAGS=""} # Check for a C compiler AC_PROG_CC -# Checks for backend library +# Checks for backend library PKG_CHECK_MODULES([CPDB],[cpdb >= 2]) PKG_CHECK_MODULES([GIO],[gio-2.0]) PKG_CHECK_MODULES([GIOUNIX],[gio-unix-2.0]) @@ -27,15 +28,28 @@ AC_TYPE_SIZE_T AC_FUNC_MALLOC # The Dbus service directory -DBUS_SERVICES_DIR="/usr/share/dbus-1/services" -AC_SUBST(DBUS_SERVICES_DIR) +AC_MSG_CHECKING([dbus service file path]) +PKG_CHECK_VAR([DBUS_SERVICES_DIR], [dbus-1], [session_bus_services_dir], + AC_MSG_RESULT($DBUS_SERVICES_DIR), + AC_MSG_FAILURE([cannot locate session_bus_services_dir]) +) # The info directory which will be read by the frontend -INFO_DIR="/usr/share/print-backends" -AC_SUBST(INFO_DIR) +AC_MSG_CHECKING([CPDB backend info path]) +PKG_CHECK_VAR([INFO_DIR], [cpdb], [cpdb_backend_info_dir], + AC_MSG_RESULT($INFO_DIR), + AC_MSG_FAILURE([cannot locate cpdb_backend_info_dir]) +) # The directory for the backend executables -CPDB_BACKEND_DIR="$libdir/print-backends" -AC_SUBST(CPDB_BACKEND_DIR) +AC_MSG_CHECKING([CPDB backend executables path]) +PKG_CHECK_VAR([CPDB_BACKEND_DIR], [cpdb], [cpdb_backend_exec_dir], + AC_MSG_RESULT($CPDB_BACKEND_DIR), + AC_MSG_FAILURE([cannot locate cpdb_backend_exec_dir]) +) + +AC_CONFIG_FILES([Makefile + src/Makefile + data/Makefile]) -AC_OUTPUT([Makefile src/Makefile data/Makefile]) +AC_OUTPUT