AC_PREREQ(2.52) AC_INIT(PackageKit, 0.1.3) 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 # # increment; # CURRENT If the API or ABI interface has changed (reset REVISION to 0) # REVISION If the API and ABI remains the same, but bugs are fixed. # AGE If libpackagekit can be linked into executables which can be # built with previous versions of this library. Don't use. LT_CURRENT=3 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) AM_PATH_PYTHON PYTHON_PACKAGE_DIR=${pythondir}/packagekit AC_SUBST(PYTHON_PACKAGE_DIR) 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.73 LIBNM_GLIB_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(SQLITE, sqlite3) AC_SUBST(SQLITE_CFLAGS) AC_SUBST(SQLITE_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) dnl --------------------------------------------------------------------------- dnl - Is NetworkManager available? dnl --------------------------------------------------------------------------- PKG_CHECK_MODULES(LIBNM, libnm_glib >= $LIBNM_GLIB_REQUIRED, PK_BUILD_NETWORKMANAGER="yes", PK_BUILD_NETWORKMANAGER="no") if test "x$PK_BUILD_NETWORKMANAGER" = "xyes"; then with_networking_stack="NetworkManager" AC_DEFINE(PK_BUILD_NETWORKMANAGER, 1, [define if NetworkManager is installed]) else with_networking_stack="dummy" PK_BUILD_NETWORKMANAGER=no fi AM_CONDITIONAL(PK_BUILD_NETWORKMANAGER, test x$PK_BUILD_NETWORKMANAGER = xyes) AC_SUBST(LIBNM_CFLAGS) AC_SUBST(LIBNM_LIBS) 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_SUBST(LOCALSTATEDIR, $localstatedir) 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, AS_HELP_STRING([--enable-tests],[enable unit test code]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE) AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),enable_gcov=$enableval,enable_gcov=no) AC_ARG_ENABLE(gprof, AS_HELP_STRING([--enable-gprof],[compile with gprof support (gcc only)]),enable_gprof=$enableval,enable_gprof=no) AM_CONDITIONAL(PK_BUILD_TESTS, test x$enable_tests = xyes) if test x$enable_tests = xyes; then AC_DEFINE(PK_BUILD_TESTS,1,[Build test code]) fi if test x$enable_gcov = xyes; then ## so that config.h changes when you toggle gcov support AC_DEFINE_UNQUOTED(PK_BUILD_GCOV, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing]) AC_MSG_CHECKING([for gcc 3.3 version of gcov file format]) have_gcc33_gcov=no AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])], have_gcc33_gcov=yes) if test x$have_gcc33_gcov = xyes ; then AC_DEFINE_UNQUOTED(PK_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format]) fi CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" AC_MSG_RESULT($have_gcc33_gcov) fi AM_CONDITIONAL(PK_BUILD_GCOV, test x$enable_gcov = xyes) if test x$enable_gprof = xyes; then ## so that config.h changes when you toggle gprof support AC_DEFINE_UNQUOTED(PK_BUILD_GPROF, 1, [Defined if gprof is enabled to force a rebuild due to config.h changing]) CPPFLAGS="$CPPFLAGS -pg" LDFLAGS="$LDFLAGS -pg" CFLAGS="$CFLAGS -fprofile-arcs -ftest-coverage" AC_MSG_RESULT($enable_gprof) fi AM_CONDITIONAL(PK_BUILD_GPROF, test x$enable_gprof = xyes) 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 - DocBook Documentation dnl --------------------------------------------------------------------------- AC_ARG_ENABLE(docbook-docs, [ --enable-docbook-docs build documentation (requires xmlto)],enable_docbook_docs=$enableval,enable_docbook_docs=auto) AC_PATH_PROG(XMLTO, xmlto, no) AC_MSG_CHECKING([whether to build DocBook documentation]) if test x$XMLTO = xno ; then have_docbook=no else have_docbook=yes fi if test x$enable_docbook_docs = xauto ; then if test x$have_docbook = xno ; then enable_docbook_docs=no else enable_docbook_docs=yes fi fi if test x$enable_docbook_docs = xyes; then if test x$have_docbook = xno; then AC_MSG_ERROR([Building DocBook docs explicitly required, but DocBook not found]) fi fi AM_CONDITIONAL(DOCBOOK_DOCS_ENABLED, test x$enable_docbook_docs = xyes) AC_MSG_RESULT(yes) dnl --------------------------------------------------------------------------- dnl - Compile time default choice of security framework dnl --------------------------------------------------------------------------- AC_ARG_WITH([security_framework], AS_HELP_STRING([--with-security-framework=