5 kx AC_PREREQ([2.68])
5 kx AC_INIT([eudev],[3.2.10],[https://github.com/gentoo/eudev/issues])
5 kx AC_SUBST(UDEV_VERSION, 243)
5 kx AC_CONFIG_SRCDIR([src/udev/udevd.c])
5 kx
5 kx AC_USE_SYSTEM_EXTENSIONS
5 kx AC_SYS_LARGEFILE
5 kx AC_PREFIX_DEFAULT([/usr])
5 kx
5 kx AC_CONFIG_MACRO_DIR([m4])
5 kx AC_CONFIG_HEADERS([config.h])
5 kx
5 kx AM_INIT_AUTOMAKE([foreign 1.11])
5 kx AM_SILENT_RULES([yes])
5 kx
5 kx LT_PREREQ(2.2)
5 kx LT_INIT
5 kx
5 kx # Checks for programs.
5 kx AC_PROG_MKDIR_P
5 kx AC_PROG_LN_S
5 kx AC_PROG_SED
5 kx AC_PROG_GREP
5 kx AC_PROG_AWK
5 kx
5 kx AC_PROG_CC_C99
5 kx AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], [
5 kx AC_MSG_ERROR([no C99 compiler found, $PACKAGE requires a C99 compiler.])
5 kx ])
5 kx
5 kx AC_PROG_CXX
5 kx AC_PROG_CPP
5 kx AC_PROG_INSTALL
5 kx AC_PROG_LN_S
5 kx AC_PROG_MAKE_SET
5 kx
5 kx AC_PATH_PROG([M4], [m4])
5 kx
5 kx # Checks for header files.
5 kx AC_CHECK_HEADERS(
5 kx [arpa/inet.h fcntl.h inttypes.h limits.h locale.h \
5 kx netinet/in.h sys/ioctl.h sys/mount.h \
5 kx sys/param.h sys/socket.h sys/statvfs.h sys/time.h sys/vfs.h syslog.h \
5 kx termios.h unistd.h],
5 kx [],
5 kx [AC_MSG_ERROR([*** POSIX header not found])]
5 kx )
5 kx
5 kx AC_CHECK_HEADERS(
5 kx [mtd/mtd-user.h],
5 kx [],
5 kx [AC_MSG_ERROR([*** KERNEL header not found])]
5 kx )
5 kx
5 kx AC_CHECK_HEADERS(
5 kx [linux/btrfs.h],
5 kx [],
5 kx [AC_MSG_WARN([*** KERNEL header not found])]
5 kx )
5 kx
5 kx # Checks for typedefs, structures, and compiler characteristics.
5 kx AC_TYPE_UID_T
5 kx AC_C_INLINE
5 kx AC_TYPE_MODE_T
5 kx AC_TYPE_PID_T
5 kx AC_CHECK_MEMBERS([struct stat.st_rdev])
5 kx AC_CHECK_DECLS([getrandom, gettid, name_to_handle_at, accept4, mkostemp, ppoll, strndupa], [], [],
5 kx [[#include <fcntl.h>
5 kx #include <linux/random.h>
5 kx #include <poll.h>
5 kx #include <signal.h>
5 kx #include <stdlib.h>
5 kx #include <string.h>
5 kx #include <sys/mount.h>
5 kx #include <sys/socket.h>
5 kx #include <sys/types.h>
5 kx #include <unistd.h>]])
5 kx
5 kx AC_CHECK_SIZEOF(pid_t)
5 kx AC_CHECK_SIZEOF(uid_t)
5 kx AC_CHECK_SIZEOF(gid_t)
5 kx AC_CHECK_SIZEOF(dev_t)
5 kx AC_CHECK_SIZEOF(time_t)
5 kx AC_CHECK_SIZEOF(rlim_t,,[[
5 kx #include <sys/time.h>
5 kx #include <sys/resource.h>]])
5 kx
5 kx # Checks for library functions.
5 kx AC_FUNC_CHOWN
5 kx AC_FUNC_FORK
5 kx AC_FUNC_FSEEKO
5 kx AC_FUNC_GETGROUPS
5 kx AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
5 kx AC_HEADER_MAJOR
5 kx AC_FUNC_MMAP
5 kx
5 kx AC_CHECK_FUNCS(
5 kx [alarm dup2 ftruncate localtime_r mempcpy \
5 kx mkdir munmap nl_langinfo rmdir setlocale socket stpcpy \
5 kx uname],
5 kx [],
5 kx [AC_MSG_ERROR([*** POSIX function not found])]
5 kx )
5 kx AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX librt not found])])
5 kx LT_LIB_M
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx
5 kx # TODO: the old python checks are irrelevant, but we do need python and perl for tests
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx # Set paths here
5 kx
5 kx AC_ARG_WITH(
5 kx [rootprefix],
5 kx [AS_HELP_STRING(
5 kx [--with-rootprefix=DIR],
5 kx [rootfs directory prefix for config files and kernel modules])],
5 kx [],
5 kx [with_rootprefix="\${prefix}"]
5 kx )
5 kx
5 kx AC_ARG_WITH(
5 kx [rootlibdir],
5 kx [AS_HELP_STRING(
5 kx [--with-rootlibdir=DIR],
5 kx [Root directory for libraries necessary for boot])],
5 kx [],
5 kx [with_rootlibdir=${libdir}]
5 kx )
5 kx
5 kx AC_ARG_WITH(
5 kx [rootlibexecdir],
5 kx [AS_HELP_STRING(
5 kx [--with-rootlibexecdir=DIR],
5 kx [Root directory for libexecs necessary for boot])],
5 kx [],
5 kx [with_rootlibexecdir=${with_rootlibdir}/udev]
5 kx )
5 kx
5 kx AC_ARG_WITH(
5 kx [rootrundir],
5 kx [AS_HELP_STRING(
5 kx [--with-rootrundir=DIR],
5 kx [Configurable path for /run])],
5 kx [],
5 kx [with_rootrundir=/run]
5 kx )
5 kx
5 kx AC_ARG_ENABLE(
5 kx [split-usr],
5 kx [AS_HELP_STRING(
5 kx [--enable-split-usr],
5 kx [Include hard-coded default search paths in / and /usr])],
5 kx [],
5 kx [AS_IF(
5 kx [test "x${ac_default_prefix}" != "x${with_rootprefix}" && test "x${with_rootprefix}" != "x\${prefix}"],
5 kx [enable_split_usr=yes],
5 kx [enable_split_usr=no])]
5 kx )
5 kx
5 kx AS_IF(
5 kx [test "x${enable_split_usr}" = "xyes"],
5 kx [AC_DEFINE(HAVE_SPLIT_USR, 1, [Define to include hard-coded default search paths in / and /usr])]
5 kx )
5 kx
5 kx # Configured paths
5 kx AC_SUBST([rootprefix], [${with_rootprefix}])
5 kx AC_SUBST([rootlibdir], [${with_rootlibdir}])
5 kx AC_SUBST([rootlibexecdir], [${with_rootlibexecdir}])
5 kx AC_SUBST([udevlibexecdir], [${rootlibexecdir}])
5 kx
5 kx # sysconfdir paths
5 kx AC_SUBST([udevconfdir],[${sysconfdir}/udev])
5 kx AC_SUBST([udevconffile],[${udevconfdir}/udev.conf])
5 kx AC_SUBST([udevhwdbdir],[${udevconfdir}/hwdb.d])
5 kx AC_SUBST([udevhwdbbin],[${udevconfdir}/hwdb.bin])
5 kx
5 kx # udevlibexecdir paths
5 kx AC_SUBST([udevkeymapdir],[${udevlibexecdir}/keymaps])
5 kx AC_SUBST([udevkeymapforceredir],[${udevkeymapdir}/force-release])
5 kx AC_SUBST([udevrulesdir],[${udevlibexecdir}/rules.d])
5 kx
5 kx # pkgconfigdir paths
5 kx AC_SUBST([pkgconfiglibdir], [${libdir}/pkgconfig])
5 kx AC_SUBST([sharepkgconfigdir],[${datadir}/pkgconfig])
5 kx
5 kx AC_SUBST([rootrundir],[${with_rootrundir}])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx AC_ARG_ENABLE([programs],
5 kx AS_HELP_STRING([--disable-programs], [disable programs (udevd, udevadm and helpers)]),
5 kx [], [enable_programs="yes"])
5 kx AM_CONDITIONAL([ENABLE_PROGRAMS], [test "x$enable_programs" = "xyes"])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx have_blkid=no
5 kx AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [Disable optional blkid support]))
5 kx if test "x$enable_blkid" != "xno"; then
5 kx PKG_CHECK_MODULES([BLKID], [blkid >= 2.20],
5 kx [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
5 kx if test "x$have_blkid" = xno && test "x$enable_blkid" = xyes; then
5 kx AC_MSG_ERROR([*** blkid support requested but not found])
5 kx fi
5 kx fi
5 kx AM_CONDITIONAL(HAVE_BLKID, [test "x$have_blkid" = "xyes"])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx have_selinux=no
5 kx AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
5 kx if test "x$enable_selinux" != "xno"; then
5 kx PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
5 kx [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no)
5 kx if test "x$have_selinux" = xno && test "x$enable_selinux" = xyes; then
5 kx AC_MSG_ERROR([*** SELinux support requested but libraries not found])
5 kx fi
5 kx fi
5 kx AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
5 kx if test "x${have_selinux}" != xno ; then
5 kx sushell=/sbin/sushell
5 kx else
5 kx sushell=/bin/bash
5 kx fi
5 kx AC_SUBST(sushell)
5 kx
5 kx # selinux-util.c uses struct mallinfo which is not available for all C libraries (musl).
5 kx AC_CHECK_FUNCS([mallinfo])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx
5 kx AC_CHECK_DECL([unshare],
5 kx [AC_DEFINE(HAVE_UNSHARE, 1, [Define if unshare is declared])],
5 kx [AC_CHECK_DECL([SYS_unshare],
5 kx [ ] ,
5 kx [AC_MSG_ERROR([*** unshare nor SYS_unshare found.])],
5 kx [#include <syscall.h>])],
5 kx [#include <sched.h>])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx AC_PATH_TOOL(GPERF, gperf)
5 kx if test -z "$GPERF" ; then
5 kx AC_MSG_ERROR([*** gperf not found])
5 kx fi
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx AC_ARG_ENABLE([manpages], AS_HELP_STRING([--disable-manpages],[disable manpages]),[],[enable_manpages=no])
5 kx AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$enable_manpages" = "xyes"])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx if test "x$cross_compiling" = "xno" ; then
5 kx AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
5 kx AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
5 kx AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
5 kx fi
5 kx
5 kx AC_ARG_WITH(usb-ids-path,
5 kx [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
5 kx [USB_IDS_PATH=${withval} ; USB_IDS="${USB_IDS_PATH}/usb.ids" ],
5 kx [if test -n "$usdids" ; then
5 kx USB_IDS="$usbids"
5 kx else
5 kx PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
5 kx AC_SUBST([USB_IDS], [$($PKG_CONFIG --variable=usbids usbutils)])
5 kx fi])
5 kx if test -z "$USB_IDS" ; then
5 kx USB_IDS_PATH="${udevhwdbdir}"
5 kx USB_IDS="usb.ids"
5 kx fi
5 kx AC_MSG_CHECKING([for USB IDs database location])
5 kx AC_MSG_RESULT([$USB_IDS])
5 kx AC_SUBST(USB_IDS)
5 kx
5 kx AC_ARG_WITH(pci-ids-path,
5 kx [AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
5 kx [PCI_IDS_PATH=${withval} ; PCI_IDS="${PCI_IDS_PATH}/pci.ids" ],
5 kx [if test -n "$pciids" ; then
5 kx PCI_IDS="$pciids"
5 kx else
5 kx PCI_IDS="pci.ids"
5 kx fi])
5 kx AC_MSG_CHECKING([for PCI IDs database location])
5 kx AC_MSG_RESULT([$PCI_IDS])
5 kx AC_SUBST(PCI_IDS)
5 kx
5 kx AC_ARG_WITH(misc-ids-path,
5 kx [AS_HELP_STRING([--with-misc-ids-path=DIR], [Path to unique ids files])],
5 kx [MISC_IDS_PATH=${withval}], [MISC_IDS_PATH="/usr/share/hwdata"])
5 kx AC_MSG_CHECKING([for MISC IDs database location])
5 kx AC_MSG_RESULT([$MISC_IDS_PATH])
5 kx AC_SUBST(MISC_IDS_PATH)
5 kx
5 kx AC_ARG_ENABLE(update-ids-script,
5 kx AS_HELP_STRING(--disable-update-ids-script, [disable installing update-udev-ids.pl @<:@default=install@:>@]))
5 kx AM_CONDITIONAL([INSTALL_UPDATE_IDS_SCRIPT], [test "x$enable_update_ids_script" != "xno"])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx have_kmod=no
5 kx AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
5 kx if test "x$enable_kmod" != "xno"; then
5 kx PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
5 kx if test "x$have_kmod" = "xyes"; then
5 kx PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
5 kx [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
5 kx AC_MSG_ERROR([*** kmod version >= 15 not found]))
5 kx fi
5 kx if test "x$have_kmod" = xno && test "x$enable_kmod" = xyes; then
5 kx AC_MSG_ERROR([*** kmod support requested, but libraries not found])
5 kx fi
5 kx fi
5 kx AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx
5 kx AC_ARG_ENABLE([hwdb], AS_HELP_STRING([--enable-hwdb],[install hwdb.d files]),[],[enable_hwdb=yes])
5 kx AM_CONDITIONAL(ENABLE_HWDB, [test "x$enable_hwdb" = "xyes"])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx # rule-generator - persistent network and optical device rule generator
5 kx # ------------------------------------------------------------------------------
5 kx AC_ARG_ENABLE([rule-generator],
5 kx AS_HELP_STRING([--enable-rule-generator], [enable legacy persistent network, cdrom support]),
5 kx [], [enable_rule_generator=no])
5 kx
5 kx if test "x${enable_rule_generator}" != xno; then
5 kx AC_DEFINE([ENABLE_RULE_GENERATOR], [1], [Define if we are enabling rule generator])
5 kx fi
5 kx
5 kx AM_CONDITIONAL([ENABLE_RULE_GENERATOR], [test "x$enable_rule_generator" = xyes])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx # mtd_probe - autoloads FTL module for mtd devices
5 kx # ------------------------------------------------------------------------------
5 kx AC_ARG_ENABLE([mtd_probe],
5 kx AS_HELP_STRING([--disable-mtd_probe], [disable MTD support]),
5 kx [], [enable_mtd_probe=yes])
5 kx AM_CONDITIONAL([ENABLE_MTD_PROBE], [test "x$enable_mtd_probe" = xyes])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx
5 kx AC_CONFIG_FILES([Makefile
5 kx hwdb/Makefile
5 kx hwdb/ids-update.pl
5 kx man/Makefile
5 kx rule_generator/Makefile
5 kx rule_generator/write_net_rules
5 kx rules/Makefile
5 kx src/Makefile
5 kx src/ata_id/Makefile
5 kx src/cdrom_id/Makefile
5 kx src/collect/Makefile
5 kx src/mtd_probe/Makefile
5 kx src/scsi_id/Makefile
5 kx src/v4l_id/Makefile
5 kx src/shared/Makefile
5 kx src/libudev/Makefile
5 kx src/libudev/libudev.pc
5 kx src/udev/Makefile
5 kx src/udev/udev.pc
5 kx test/Makefile], [chmod a+x hwdb/ids-update.pl])
5 kx
5 kx AC_OUTPUT
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx
5 kx AC_MSG_RESULT([
5 kx prefix: ${prefix}
5 kx exec_prefix: ${exec_prefix}
5 kx sysconfdir: ${sysconfdir}
5 kx datadir: ${datadir}
5 kx includedir: ${includedir}
5 kx bindir: ${bindir}
5 kx libdir: ${libdir}
5 kx
5 kx rootprefix: ${rootprefix}
5 kx rootlibdir: ${rootlibdir}
5 kx rootlibexecdir: ${rootlibexecdir}
5 kx datarootdir: ${datarootdir}
5 kx rootrundir: ${rootrundir}
5 kx
5 kx udevconfdir: ${udevconfdir}
5 kx udevconffile: ${udevconffile}
5 kx udevhwdbdir: ${udevhwdbdir}
5 kx udevhwdbbin: ${udevhwdbbin}
5 kx udevlibexecdir: ${udevlibexecdir}
5 kx udevkeymapdir: ${udevkeymapdir}
5 kx udevkeymapforceredir: ${udevkeymapforceredir}
5 kx udevrulesdir: ${udevrulesdir}
5 kx
5 kx pkgconfiglibdir: ${libdir}/pkgconfig
5 kx sharepkgconfigdir ${datadir}/pkgconfig
5 kx ])
5 kx
5 kx # ------------------------------------------------------------------------------
5 kx
5 kx dnl Set configured scripts executable
5 kx if test -f src/keymap/check-keymaps.sh; then
5 kx chmod +x src/keymap/check-keymaps.sh
5 kx fi
5 kx
5 kx if test -f src/keymap/keyboard-force-release.sh; then
5 kx chmod +x src/keymap/keyboard-force-release.sh
5 kx fi
5 kx