AC_INIT([udev-extras], [20090226], [linux-hotplug@vger.kernel.org]) AC_PREREQ(2.60) AM_INIT_AUTOMAKE([check-news foreign 1.9 subdir-objects dist-bzip2]) AC_DISABLE_STATIC AC_USE_SYSTEM_EXTENSIONS AC_SYS_LARGEFILE AC_CONFIG_HEADERS(config.h) AC_PROG_CC AM_PROG_CC_C_O AC_PROG_INSTALL AC_PROG_LIBTOOL AC_CONFIG_MACRO_DIR([m4]) dnl prefix is /usr, exec_prefix in /, if overridden exec_prefix follows prefix AC_PREFIX_DEFAULT([/usr]) test "$prefix" = NONE && test "$exec_prefix" = NONE && exec_prefix= dnl ensure that when the Automake generated makefile calls aclocal, dnl it honours the $ACLOCAL_FLAGS environment variable ACLOCAL_AMFLAGS="\${ACLOCAL_FLAGS}" if test -n "$ac_macro_dir"; then ACLOCAL_AMFLAGS="-I $ac_macro_dir $ACLOCAL_AMFLAGS" fi AC_SUBST([ACLOCAL_AMFLAGS]) PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.12) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) PKG_CHECK_MODULES(LIBUSB, libusb >= 0.1.12) AC_SUBST(LIBUSB_CFLAGS) AC_SUBST(LIBUSB_LIBS) PKG_CHECK_MODULES(LIBUDEV, libudev) AC_SUBST(LIBUDEV_CFLAGS) AC_SUBST(LIBUDEV_LIBS) AC_PATH_PROG([XSLTPROC], [xsltproc]) AC_ARG_ENABLE(more-warnings, AS_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",set_more_warnings=yes) AC_MSG_CHECKING(for more warnings, including -Werror) if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then AC_MSG_RESULT(yes) CFLAGS="-Wall -Werror $CFLAGS" for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \ -Wdeclaration-after-statement -Wstrict-prototypes \ -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare \ -fno-strict-aliasing; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option" AC_MSG_CHECKING([whether gcc understands $option]) AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) if test $has_option = no; then CFLAGS="$SAVE_CFLAGS" fi AC_MSG_RESULT($has_option) unset has_option unset SAVE_CFLAGS done unset option else AC_MSG_RESULT(no) fi AC_ARG_WITH(udev-prefix, AS_HELP_STRING([--with-udev-prefix=DIR], [add prefix to internal udev path names]), [], [with_udev_prefix='${exec_prefix}']) udev_prefix=$with_udev_prefix AC_SUBST(udev_prefix) AC_DEFINE(LIBUDEV_I_KNOW_THE_API_IS_SUBJECT_TO_CHANGE, 1, [I know the API is subject to change]) AC_CHECK_FILES([/usr/share/usb.ids], [usbids=/usr/share/usb.ids]) AC_CHECK_FILES([/usr/share/hwdata/usb.ids], [usbids=/usr/share/hwdata/usb.ids]) AC_CHECK_FILES([/usr/share/misc/usb.ids], [usbids=/usr/share/misc/usb.ids]) AC_ARG_WITH(usb-ids-path, AS_HELP_STRING([--usb-ids-path=DIR], [Path to usb.ids file]), [USB_DATABASE=${withval}], [if test -n "$usbids" ; then USB_DATABASE="$usbids" else AC_MSG_ERROR([usb.ids not found, try --with-usb-ids-path=]) fi]) AC_SUBST(USB_DATABASE) 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]) AC_ARG_WITH(pci-ids-path, AS_HELP_STRING([--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_SUBST(PCI_DATABASE) AC_CONFIG_FILES([ Makefile rules.d/Makefile modem-probe/Makefile modem-modeswitch/Makefile udev-acl/Makefile usb-db/Makefile ]) AC_OUTPUT echo " udev-extras $VERSION ==================== prefix: ${prefix} exec_prefix: ${exec_prefix} udev_prefix: ${udev_prefix} datarootdir: ${datarootdir} mandir: ${mandir} usb.ids: ${USB_DATABASE} pci.ids: ${PCI_DATABASE} compiler: ${CC} cflags: ${CFLAGS} ldflags: ${LDFLAGS} xsltproc: ${XSLTPROC} "