AC_PREREQ(2.52) AC_INIT(PackageKit, 0.0.1) AC_CONFIG_SRCDIR(src) AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) AM_CONFIG_HEADER(config.h) # libtool versioning - this applies to libpackagekit # # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details # LT_CURRENT=1 LT_REVISION=0 LT_AGE=0 AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) AC_PROG_CC AC_PROG_INSTALL AM_PROG_CC_C_O AM_PROG_LIBTOOL AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) dnl --------------------------------------------------------------------------- dnl - Extra verbose warning switches dnl --------------------------------------------------------------------------- if test "$GCC" = "yes"; then CPPFLAGS="$CPPFLAGS -Werror -Wcast-align -Wno-uninitialized" CPPFLAGS="$CPPFLAGS -Wall" fi dnl --------------------------------------------------------------------------- dnl - gettext stuff dnl --------------------------------------------------------------------------- GETTEXT_PACKAGE=PackageKit AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of default gettext domain]) AM_GLIB_GNU_GETTEXT dnl --------------------------------------------------------------------------- dnl - Library dependencies dnl --------------------------------------------------------------------------- GLIB_REQUIRED=2.14.0 DBUS_REQUIRED=1.1.1 DBUS_GLIB_REQUIRED=0.74 LIBNM_REQUIRED=0.6.4 POLKIT_DBUS_REQUIRED=0.5 POLKIT_GRANT_REQUIRED=0.5 dnl --------------------------------------------------------------------------- dnl - Make above strings available for packaging files (e.g. rpm spec files) dnl --------------------------------------------------------------------------- AC_SUBST(GLIB_REQUIRED) AC_SUBST(DBUS_REQUIRED) AC_SUBST(DBUS_GLIB_REQUIRED) dnl --------------------------------------------------------------------------- dnl - Check library dependencies dnl --------------------------------------------------------------------------- PKG_CHECK_MODULES(GLIB, glib-2.0 >= $GLIB_REQUIRED gobject-2.0) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) PKG_CHECK_MODULES(GMODULE, gmodule-2.0) AC_SUBST(GMODULE_CFLAGS) AC_SUBST(GMODULE_LIBS) PKG_CHECK_MODULES(DBUS, \ dbus-glib-1 >= $DBUS_GLIB_REQUIRED \ dbus-1 >= $DBUS_REQUIRED \ gthread-2.0) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) PKG_CHECK_MODULES(LIBNM, \ libnm_glib >= $LIBNM_REQUIRED) AC_SUBST(LIBNM_CFLAGS) AC_SUBST(LIBNM_LIBS) PKG_CHECK_MODULES(POLKIT, \ polkit-dbus >= $POLKIT_DBUS_REQUIRED \ polkit-grant >= $POLKIT_GRANT_REQUIRED) AC_CHECK_PROG([POLKIT_POLICY_FILE_VALIDATE], [polkit-policy-file-validate], [polkit-policy-file-validate]) if test -z "$POLKIT_POLICY_FILE_VALIDATE"; then AC_MSG_ERROR([polkit-policy-file-validate not found]) fi dnl --------------------------------------------------------------------------- dnl - Is docbook2man available? dnl --------------------------------------------------------------------------- AC_PATH_PROG(DOCBOOK2MAN, docbook2man, no) if test "$DOCBOOK2MAN" = "no" ; then AC_MSG_WARN([docbook2man not found, will not be able to build man documentation]) fi AM_CONDITIONAL(HAVE_DOCBOOK2MAN, [test "$DOCBOOK2MAN" != "no"]) dnl --------------------------------------------------------------------------- dnl - Make paths available for source files dnl --------------------------------------------------------------------------- AC_SUBST(SYSCONFDIR, $sysconfdir) AC_SUBST(DATADIR, $datadir) AC_SUBST(BINDIR, $bindir) AC_SUBST(SBINDIR, $sbindir) AC_ARG_WITH([packagekit_user], AS_HELP_STRING([--with-packagekit-user=], [User for running the PackageKit daemon (root)])) if test -z "$with_packagekit_user" ; then PACKAGEKIT_USER=root else PACKAGEKIT_USER=$with_packagekit_user fi AC_SUBST(PACKAGEKIT_USER) AC_DEFINE_UNQUOTED(PACKAGEKIT_USER,"$PACKAGEKIT_USER", [User for running the PackageKit daemon]) dnl --------------------------------------------------------------------------- dnl - Build self tests dnl --------------------------------------------------------------------------- AC_ARG_ENABLE(tests, [ --enable-tests Build self tests],enable_tests=$enableval,enable_tests=no) AC_MSG_CHECKING([whether to support tests]) have_tests=no if test x$enable_tests = xyes ; then have_tests=yes AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_TESTS, 1, [Define if we want to use the self tests]) else AC_MSG_RESULT([no]) fi AM_CONDITIONAL([HAVE_TESTS], [test $have_tests = yes]) dnl --------------------------------------------------------------------------- dnl - Are we specifying a different dbus root ? dnl --------------------------------------------------------------------------- AC_ARG_WITH(dbus-sys, [AC_HELP_STRING([--with-dbus-sys=], [where D-BUS system.d directory is])]) AC_ARG_WITH(dbus-services, [AC_HELP_STRING([--with-dbus-services=], [where D-BUS system-services directory is])]) if ! test -z "$with_dbus_sys" ; then DBUS_SYS_DIR="$with_dbus_sys" else DBUS_SYS_DIR="$SYSCONFDIR/dbus-1/system.d" fi if ! test -z "$with_dbus_services" ; then DBUS_SERVICES_DIR="$with_dbus_services" else DBUS_SERVICES_DIR="$DATADIR/dbus-1/system-services" fi AC_SUBST(DBUS_SYS_DIR) AC_SUBST(DBUS_SERVICES_DIR) dnl --------------------------------------------------------------------------- dnl - Compile time choice of backend dnl --------------------------------------------------------------------------- AC_ARG_WITH([backend], AS_HELP_STRING([--with-backend=