chiark / gitweb /
autogen.sh: add CFLAGS and print entire line, so that mouse copy/paste works
[elogind.git] / configure.ac
index b8595664b62039489bcd2d4093d38c5909ac223f..4ba9964cbdc21df096294d712e796e835d8b01a5 100644 (file)
@@ -4,7 +4,7 @@ AC_INIT([udev],
        [linux-hotplug@vger.kernel.org],
        [udev],
        [http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html])
-AC_CONFIG_SRCDIR([udev/udevd.c])
+AC_CONFIG_SRCDIR([src/udevd.c])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
 AC_USE_SYSTEM_EXTENSIONS
@@ -21,6 +21,46 @@ AC_PATH_PROG([XSLTPROC], [xsltproc])
 
 AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([POSIX RT library not found])])
 
+PKG_CHECK_MODULES(BLKID, blkid >= 2.20)
+
+PKG_CHECK_MODULES(KMOD, libkmod >= 3)
+
+if test "x$cross_compiling" = "xno" ; then
+       AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
+       AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
+       AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
+fi
+
+AC_ARG_WITH(usb-ids-path,
+       [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
+       [USB_DATABASE=${withval}],
+       [if test -n "$usbids" ; then
+               USB_DATABASE="$usbids"
+       else
+               PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
+               AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+       fi])
+AC_MSG_CHECKING([for USB database location])
+AC_MSG_RESULT([$USB_DATABASE])
+AC_SUBST(USB_DATABASE)
+
+AC_ARG_WITH(pci-ids-path,
+       [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
+       [PCI_DATABASE=${withval}],
+       [if test -n "$pciids" ; then
+               PCI_DATABASE="$pciids"
+       else
+               AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
+       fi])
+AC_MSG_CHECKING([for PCI database location])
+AC_MSG_RESULT([$PCI_DATABASE])
+AC_SUBST(PCI_DATABASE)
+
+AC_ARG_WITH([rootprefix],
+       AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
+       [], [with_rootprefix=${ac_default_prefix}])
+AC_SUBST([rootprefix], [$with_rootprefix])
+
 AC_ARG_WITH([rootlibdir],
        AS_HELP_STRING([--with-rootlibdir=DIR], [rootfs directory to install shared libraries]),
        [], [with_rootlibdir=$libdir])
@@ -54,7 +94,7 @@ AS_IF([test "x$enable_logging" = "xyes"], [ AC_DEFINE(ENABLE_LOGGING, [1], [Syst
 AC_ARG_WITH(firmware-path,
        AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]],
           [Firmware search path (default=/lib/firmware/updates:/lib/firmware)]),
-       [], [with_firmware_path="/lib/firmware/updates:/lib/firmware"])
+       [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"])
 OLD_IFS=$IFS
 IFS=:
 for i in $with_firmware_path; do
@@ -73,8 +113,6 @@ AC_ARG_WITH([systemdsystemunitdir],
 AS_IF([test "x$with_systemdsystemunitdir" != "xno"], [ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir]) ])
 AM_CONDITIONAL(WITH_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != "xno" ])
 
-PKG_CHECK_MODULES(BLKID, blkid >= 2.20)
-
 # ------------------------------------------------------------------------------
 # GUdev - libudev gobject interface
 # ------------------------------------------------------------------------------
@@ -98,46 +136,6 @@ AS_IF([test "x$enable_introspection" = "xyes"], [
 AM_CONDITIONAL([ENABLE_INTROSPECTION], [test "x$enable_introspection" = "xyes"])
 AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"])
 
-# ------------------------------------------------------------------------------
-# usb/pci-db - read vendor/device string database
-# ------------------------------------------------------------------------------
-AC_ARG_ENABLE([hwdb],
-       AS_HELP_STRING([--disable-hwdb], [disable hardware database support @<:@default=enabled@:>@]),
-       [], [enable_hwdb=yes])
-AS_IF([test "x$enable_hwdb" = "xyes"], [
-       if test "x$cross_compiling" = "xno" ; then
-               AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
-               AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
-               AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
-       fi
-
-       AC_ARG_WITH(usb-ids-path,
-               [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
-               [USB_DATABASE=${withval}],
-               [if test -n "$usbids" ; then
-                       USB_DATABASE="$usbids"
-               else
-                       PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
-                       AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
-               fi])
-       AC_MSG_CHECKING([for USB database location])
-       AC_MSG_RESULT([$USB_DATABASE])
-       AC_SUBST(USB_DATABASE)
-
-       AC_ARG_WITH(pci-ids-path,
-               [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
-               [PCI_DATABASE=${withval}],
-               [if test -n "$pciids" ; then
-                       PCI_DATABASE="$pciids"
-               else
-                       AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])
-               fi])
-       AC_MSG_CHECKING([for PCI database location])
-       AC_MSG_RESULT([$PCI_DATABASE])
-       AC_SUBST(PCI_DATABASE)
-])
-AM_CONDITIONAL([ENABLE_HWDB], [test "x$enable_hwdb" = "xyes"])
-
 # ------------------------------------------------------------------------------
 # keymap - map custom hardware's multimedia keys
 # ------------------------------------------------------------------------------
@@ -212,10 +210,10 @@ AC_SUBST([my_CFLAGS])
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_FILES([
        Makefile
-       libudev/docs/Makefile
-       libudev/docs/version.xml
-       extras/gudev/docs/Makefile
-       extras/gudev/docs/version.xml
+       src/docs/Makefile
+       src/docs/version.xml
+       src/extras/gudev/docs/Makefile
+       src/extras/gudev/docs/version.xml
 ])
 
 AC_OUTPUT
@@ -224,6 +222,7 @@ AC_MSG_RESULT([
        ========
 
        prefix:                 ${prefix}
+       rootprefix:             ${rootprefix}
        sysconfdir:             ${sysconfdir}
        bindir:                 ${bindir}
        libdir:                 ${libdir}
@@ -235,6 +234,8 @@ AC_MSG_RESULT([
        include_prefix:         ${INCLUDE_PREFIX}
        systemdsystemunitdir:   ${systemdsystemunitdir}
        firmware path:          ${FIRMWARE_PATH}
+       usb.ids:                ${USB_DATABASE}
+       pci.ids:                ${PCI_DATABASE}
 
        compiler:               ${CC}
        cflags:                 ${CFLAGS}
@@ -249,9 +250,6 @@ AC_MSG_RESULT([
        gudev:                  ${enable_gudev}
        gintrospection:         ${enable_introspection}
        keymap:                 ${enable_keymap}
-       hwdb:                   ${enable_hwdb}
-         usb.ids:              ${USB_DATABASE}
-         pci.ids:              ${PCI_DATABASE}
        mtd_probe:              ${enable_mtd_probe}
        rule_generator:         ${enable_rule_generator}
        udev_acl:               ${enable_udev_acl}