dnl Process this file with autoconf to produce a configure script. # If porting the hal tarball to work well on a distribution search # for the string "(distro-tweaks required)" for what to tweak. # # Patches for that is welcome. # AC_PREREQ(2.57) AC_INIT(hal, 0.5.0, david@fubar.dk) AM_INIT_AUTOMAKE(hal, 0.5.0) AM_CONFIG_HEADER(config.h) AM_MAINTAINER_MODE # libtool versioning - this applies to libhal and libhal-storage # # 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_ISC_POSIX AC_PROG_CC AM_PROG_CC_STDC AC_HEADER_STDC AM_PROG_LIBTOOL AC_PROG_MAKE_SET AC_PROG_LN_S AM_PATH_PYTHON AC_SYS_LARGEFILE AC_ARG_WITH(os-type, [ --with-os-type= Distribution or OS (redhat)]) AC_ARG_WITH(pid-file, [ --with-pid-file= PID file for HAL daemon]) AC_ARG_WITH(hwdata,[ --with-hwdata= where PCI and USB IDs are found (auto)]) if ! test -z "$with_hwdata" ; then HWDATA_DIR="$with_hwdata" else for dir in /usr/share/hwdata /usr/share/misc /usr/share /var/lib/misc; do AC_CHECK_FILE($dir/pci.ids,HWDATA_DIR=$dir) done fi if test -z "$HWDATA_DIR"; then AC_ERROR(cannot find pci.ids. Use --with-hwdata to specify location) fi AC_SUBST(HWDATA_DIR) AC_DEFINE_UNQUOTED(HWDATA_DIR,"$HWDATA_DIR", [Where PCI and USB IDs are found]) AC_ARG_WITH(hal_user,[ --with-hal-user= User for running the HAL daemon (haldaemon)]) if test -z "$with_hal_user" ; then HAL_USER=haldaemon else HAL_USER=$with_hal_user fi AC_SUBST(HAL_USER) AC_DEFINE_UNQUOTED(HAL_USER,"$HAL_USER", [User for running the HAL daemon]) AC_ARG_WITH(hal_group,[ --with-hal-group= Group for HAL (haldaemon)]) if test -z "$with_hal_group" ; then HAL_GROUP=haldaemon else HAL_GROUP=$with_hal_group fi AC_SUBST(HAL_GROUP) AC_DEFINE_UNQUOTED(HAL_GROUP,"$HAL_GROUP", [Group for HAL]) # Taken from dbus AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no) AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE) AC_ARG_ENABLE(doxygen-docs, [ --enable-doxygen-docs build DOXYGEN documentation (requires Doxygen)],enable_doxygen_docs=$enableval,enable_doxygen_docs=auto) AC_ARG_ENABLE(docbook-docs, [ --enable-docbook-docs build DocBook documentation (requires docbook2html)],enable_docbook_docs=$enableval,enable_docbook_docs=auto) AC_ARG_ENABLE(selinux, [ --enable-selinux build with SELinux support],enable_selinux=$enableval,enable_selinux=auto) if test x$enable_verbose_mode = xyes; then AC_DEFINE(ENABLE_VERBOSE_MODE,1,[Support a verbose mode]) fi AC_ARG_ENABLE(fstab-sync, [ --enable-fstab-sync Install fstab-sync callout],enable_fstab_sync=yes,enable_fstab_sync=no) if test "x$enable_fstab_sync" = "xyes" ; then # fstab-sync needs popt, so check for it here AC_CHECK_HEADERS(popt.h,, [AC_MSG_ERROR([You need popt to build fstab-sync])]) AC_CHECK_LIB(popt, poptGetContext,, [AC_MSG_ERROR([You need popt to build fstab-sync])]) AC_DEFINE(FSTAB_SYNC_ENABLED,1,[Whether fstab-sync callout should be installed]) fi AC_SUBST(FSTAB_SYNC_ENABLED) AM_CONDITIONAL(FSTAB_SYNC_ENABLED, test x$enable_fstab_sync = xyes) AC_ARG_ENABLE(pcmcia-support, [ --enable-pcmcia-support Extended PCMCIA card support],enable_pcmcia_support=yes,enable_pcmcia_support=no) if test "x$enable_pcmcia_support" = "xyes" ; then AC_DEFINE(PCMCIA_SUPPORT_ENABLE,1,[Whether PCMCIA card workarounds should be used (for kernels that don't have a sysfsized PCMCIA layer)]) fi AC_SUBST(PCMCIA_SUPPORT_ENABLE) AM_CONDITIONAL(PCMCIA_SUPPORT_ENABLE, test x$enable_pcmcia_support = xyes) AC_ARG_WITH(stab_file,[ --with-stab-file= PCMCIA socket table file (/var/lib/pcmcia/stab)]) if test -z "$with_stab_file" ; then PCMCIA_STAB_FILE=/var/lib/pcmcia/stab else PCMCIA_STAB_FILE=$with_stab_file fi AC_SUBST(PCMCIA_STAB_FILE) AC_DEFINE_UNQUOTED(PCMCIA_STAB_FILE,"$PCMCIA_STAB_FILE", [PCMCIA socket table file]) #### gcc warning flags if test "x$GCC" = "xyes"; then changequote(,)dnl case " $CFLAGS " in *[\ \ ]-Wall[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wall" ;; esac case " $CFLAGS " in *[\ \ ]-Wchar-subscripts[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wchar-subscripts" ;; esac case " $CFLAGS " in *[\ \ ]-Wmissing-declarations[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wmissing-declarations" ;; esac case " $CFLAGS " in *[\ \ ]-Wnested-externs[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wnested-externs" ;; esac case " $CFLAGS " in *[\ \ ]-Wpointer-arith[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wpointer-arith" ;; esac case " $CFLAGS " in *[\ \ ]-Wcast-align[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wcast-align" ;; esac case " $CFLAGS " in *[\ \ ]-Wsign-compare[\ \ ]*) ;; *) CFLAGS="$CFLAGS -Wsign-compare" ;; esac if test "x$enable_ansi" = "xyes"; then case " $CFLAGS " in *[\ \ ]-ansi[\ \ ]*) ;; *) CFLAGS="$CFLAGS -ansi" ;; esac case " $CFLAGS " in *[\ \ ]-D_POSIX_C_SOURCE*) ;; *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;; esac case " $CFLAGS " in *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;; *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;; esac case " $CFLAGS " in *[\ \ ]-pedantic[\ \ ]*) ;; *) CFLAGS="$CFLAGS -pedantic" ;; esac fi if test x$enable_gcov = xyes; then case " $CFLAGS " in *[\ \ ]-fprofile-arcs[\ \ ]*) ;; *) CFLAGS="$CFLAGS -fprofile-arcs" ;; esac case " $CFLAGS " in *[\ \ ]-ftest-coverage[\ \ ]*) ;; *) CFLAGS="$CFLAGS -ftest-coverage" ;; esac ## remove optimization CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'` fi changequote([,])dnl else if test x$enable_gcov = xyes; then AC_MSG_ERROR([--enable-gcov can only be used with gcc]) fi fi dbus_module="dbus-1 >= 0.33" pkg_modules="glib-2.0 >= 2.6.0, gobject-2.0 >= 2.6.0, dbus-glib-1 >= 0.33, $dbus_module" PKG_CHECK_MODULES(PACKAGE, [$pkg_modules]) EXPAT_LIB="" AC_ARG_WITH(expat, [ --with-expat= Use expat from here], [ expat=$withval CPPFLAGS="$CPPFLAGS -I$withval/include" LDFLAGS="$LDFLAGS -L$withval/lib" ] ) AC_CHECK_HEADERS(expat.h) AC_CHECK_LIB(expat,XML_ParserCreate, EXPAT_LIB="-lexpat") AC_SUBST(EXPAT_LIB) dnl Check libusb AC_PATH_PROG(LIBUSB_CONFIG, libusb-configxxx) if test -n "${LIBUSB_CONFIG}"; then AM_CONDITIONAL(HAVE_LIBUSB,true) else AM_CONDITIONAL(HAVE_LIBUSB,false) fi AC_ARG_WITH(backend, [ --with-backend= Backend to use (linux2/dummy)], [ backend=$withval ] ) if ! test -z "$with_backend" ; then HALD_BACKEND="$with_backend" else HALD_BACKEND="linux2" fi AC_SUBST(HALD_BACKEND) dnl DBUS API is subject to changes AC_DEFINE_UNQUOTED(DBUS_API_SUBJECT_TO_CHANGE, ,DBUS API is subject to change) AC_SUBST(PACKAGE_CFLAGS) AC_SUBST(PACKAGE_LIBS) # Now just the D-BUS libs PKG_CHECK_MODULES(DBUS, [$dbus_module]) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) ### All this also from dbus ### Doxygen Documentation AC_PATH_PROG(DOXYGEN, doxygen, no) AC_MSG_CHECKING([whether to build Doxygen documentation]) if test x$DOXYGEN = xno ; then have_doxygen=no else have_doxygen=yes fi if test x$enable_doxygen_docs = xauto ; then if test x$have_doxygen = xno ; then enable_doxygen_docs=no else enable_doxygen_docs=yes fi fi if test x$enable_doxygen_docs = xyes; then if test x$have_doxygen = xno; then AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found]) fi fi AM_CONDITIONAL(DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes) AC_MSG_RESULT(yes) # Check for BLKGETSIZE64 AC_MSG_CHECKING(for BLKGETSIZE64) AC_TRY_COMPILE( [#include #include #include ], [int main(int argc, char *argv[]) { int fd = 0; unsigned long long int n; ioctl (fd, BLKGETSIZE64, &n); return 0; } ], have_size64=yes, have_size64=no) AC_MSG_RESULT($have_size64) if test x$have_size64 = xno; then AC_MSG_ERROR([BLKGETSIZE64 is not defined]) fi # DocBook Documentation AC_PATH_PROG(DOCBOOK, docbook2html, no) AC_MSG_CHECKING([whether to build DocBook documentation]) if test x$DOCBOOK = 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) AS_AC_EXPAND(LOCALSTATEDIR, $localstatedir) AS_AC_EXPAND(SYSCONFDIR, $sysconfdir) AS_AC_EXPAND(DATADIR, $datadir) AS_AC_EXPAND(BINDIR, $bindir) AS_AC_EXPAND(SBINDIR, $sbindir) AS_AC_EXPAND(LIBDIR, $libdir) AS_AC_EXPAND(LIBEXECDIR, $libexecdir) AC_ARG_WITH(dbus-sys, [ --with-dbus-sys= where D-BUS system.d 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 AC_SUBST(DBUS_SYS_DIR) AC_DEFINE_UNQUOTED(DBUS_SYSTEMD_DIR, "$DBUS_SYS_DIR", [Where system.d dir for DBUS is]) AC_ARG_WITH(hotplug-dir, [ --with-hotplug= where hotplug.d directory is]) if ! test -z "$with_hotplug" ; then LINUX_HOTPLUG_DIR="$with_hotplug" else # LINUX_HOTPLUG_DIR="$SYSCONFDIR/hotplug.d" # It's quite uncommon to have hotplug.d other places than this, so default # to it LINUX_HOTPLUG_DIR=/etc/hotplug.d fi AC_SUBST(LINUX_HOTPLUG_DIR) AC_DEFINE_UNQUOTED(LINUX_HOTPLUG_DIR, "$LINUX_HOTPLUG_DIR", [where hotplug.d directory is]) #### Check our operating system (distro-tweaks required) operating_system=unknown if test -f /etc/redhat-release || test -f SYSCONFDIR/redhat-release ; then operating_system=redhat fi #### Sort out OS (distro-tweaks required) if test x$with_os_type = x; then if test x$operating_system = xredhat ; then with_os_type=redhat else with_os_type=unknown fi fi # (distro-tweaks required) AM_CONDITIONAL(OS_TYPE_UNKNOWN, test x$with_os_type = xunknown, [Running on unknown OS]) AM_CONDITIONAL(OS_TYPE_RED_HAT, test x$with_os_type = xredhat, [Running on Red Hat OS'es]) #### Set up the pid file (distro-tweaks required) if ! test -z "$with_pid_file"; then HALD_PID_FILE=$with_pid_file elif test x$with_os_type = xredhat ; then HALD_PID_FILE=${LOCALSTATEDIR}/run/haldaemon.pid else HALD_PID_FILE=${LOCALSTATEDIR}/run/hald/pid fi AC_SUBST(HALD_PID_FILE) AC_DEFINE_UNQUOTED(HALD_PID_FILE, "$HALD_PID_FILE", [pid file]) # SELinux detection if test x$enable_selinux = xno ; then have_selinux=no; else # See if we have sufficiently new SELinux library AC_CHECK_LIB(selinux, selinux_removable_context_path, have_selinux=yes, have_selinux=no) if test x$enable_selinux = xauto ; then if test x$have_selinux = xno ; then AC_MSG_WARN([Sufficiently new SELinux library not found]) fi else if test x$have_selinux = xno ; then AC_MSG_ERROR([SELinux explicitly required, and sufficiently new SELinux library not found]) fi fi fi AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes) if test x$have_selinux = xyes ; then SELINUX_LIBS=-lselinux AC_DEFINE(HAVE_SELINUX,1,[SELinux support]) else SELINUX_LIBS= fi ALL_LINGUAS="da fr de nl ru hu pt it zh_TW" AC_SUBST(ALL_LINGUAS) GETTEXT_PACKAGE=AC_PACKAGE_NAME AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE", [Name of the gettext package]) AC_PROG_INTLTOOL([0.22]) AM_GLIB_GNU_GETTEXT AC_OUTPUT([ hal.pc hal-storage.pc hal.conf Makefile hald/Makefile hald/dummy/Makefile hald/linux2/Makefile hald/linux2/probing/Makefile hald/linux2/addons/Makefile hald/haldaemon libhal/Makefile libhal-storage/Makefile tools/Makefile tools/fstab-sync.8 tools/linux/Makefile tools/device-manager/hal-device-manager tools/device-manager/Makefile tools/device-manager/Const.py fdi/Makefile fdi/preprobe/Makefile fdi/preprobe/10osvendor/Makefile fdi/preprobe/20thirdparty/Makefile fdi/preprobe/30user/Makefile fdi/information/Makefile fdi/information/10freedesktop/Makefile fdi/information/20thirdparty/Makefile fdi/information/30user/Makefile fdi/policy/Makefile fdi/policy/10osvendor/Makefile fdi/policy/20thirdparty/Makefile fdi/policy/30user/Makefile doc/Makefile doc/api/Makefile doc/api/Doxyfile doc/conf/Makefile doc/spec/Makefile doc/spec/hal-spec.xml examples/Makefile examples/volumed/Makefile po/Makefile.in drive_id/Makefile volume_id/Makefile ]) dnl ========================================================================== echo " HAL $VERSION ============== prefix: ${prefix} libdir: ${LIBDIR} libexecdir: ${LIBEXECDIR} bindir: ${BINDIR} sbindir: ${SBINDIR} datadir: ${DATADIR} sysconfdir: ${SYSCONFDIR} localstatedir: ${LOCALSTATEDIR} dbus-1 system.d dir: ${DBUS_SYS_DIR} pci.ids, usb.ids dir: ${HWDATA_DIR} linux hotplug.d dir: ${LINUX_HOTPLUG_DIR} compiler: ${CC} cflags: ${CFLAGS} cppflags: ${CPPFLAGS} Doxygen: ${DOXYGEN} DocBook: ${DOCBOOK} User for HAL: ${HAL_USER} Group for HAL: ${HAL_GROUP} hald pidfile: ${HALD_PID_FILE} hald backend: ${HALD_BACKEND} Building SELinux support: ${have_selinux} install fstab-sync: ${enable_fstab_sync} Extended PCMCIA support: ${enable_pcmcia_support} PCMCIA stab file: ${PCMCIA_STAB_FILE} Maintainer mode: ${USE_MAINTAINER_MODE} Building verbose mode: ${enable_verbose_mode} Building Doxygen docs: ${enable_doxygen_docs} Building docs: ${enable_docbook_docs} " if test x$enable_verbose_mode = xyes; then echo "NOTE: building with verbose mode increases library size, may slightly " echo " increase security risk, and decreases performance." echo fi # (distro-tweaks required) if test x$with_os_type = xredhat; then echo "NOTE: Red Hat style init scripts and policy will be installed" else echo "NOTE: You have to install init scripts yourself and tweak your own policy" fi echo echo "NOTE: Remember to create user ${HAL_USER} and group ${HAL_GROUP} before make install" echo echo "NOTE: For development, use run-hald.sh and debug-hald.sh scripts in hald/ to " echo " use programs (callouts, probers, addons) and device information files " echo " from build directories." echo " (You still need 'make install' to set up hotplug.d agent)" echo