You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

369 lines
12 KiB

  1. AC_PREREQ([2.68])
  2. AC_INIT([eudev],[3.2.7],[https://github.com/gentoo/eudev/issues])
  3. AC_SUBST(UDEV_VERSION, 220)
  4. AC_CONFIG_SRCDIR([src/udev/udevd.c])
  5. AC_USE_SYSTEM_EXTENSIONS
  6. AC_SYS_LARGEFILE
  7. AC_PREFIX_DEFAULT([/usr])
  8. AC_CONFIG_MACRO_DIR([m4])
  9. AC_CONFIG_HEADERS([config.h])
  10. AM_INIT_AUTOMAKE([foreign 1.11])
  11. AM_SILENT_RULES([yes])
  12. LT_PREREQ(2.2)
  13. LT_INIT
  14. # Checks for programs.
  15. AC_PROG_MKDIR_P
  16. AC_PROG_LN_S
  17. AC_PROG_SED
  18. AC_PROG_GREP
  19. AC_PROG_AWK
  20. AC_PROG_CC_C99
  21. AS_IF([test "x$ac_cv_prog_cc_c99" = "xno"], [
  22. AC_MSG_ERROR([no C99 compiler found, $PACKAGE requires a C99 compiler.])
  23. ])
  24. AC_PROG_CXX
  25. AC_PROG_CPP
  26. AC_PROG_INSTALL
  27. AC_PROG_LN_S
  28. AC_PROG_MAKE_SET
  29. AC_PATH_PROG([M4], [m4])
  30. # Checks for header files.
  31. AC_CHECK_HEADERS(
  32. [arpa/inet.h fcntl.h inttypes.h langinfo.h limits.h locale.h \
  33. netinet/in.h sys/ioctl.h sys/mount.h \
  34. sys/param.h sys/socket.h sys/statvfs.h sys/time.h sys/vfs.h syslog.h \
  35. termios.h unistd.h],
  36. [],
  37. [AC_MSG_ERROR([*** POSIX header not found])]
  38. )
  39. AC_CHECK_HEADERS(
  40. [mtd/mtd-user.h],
  41. [],
  42. [AC_MSG_ERROR([*** KERNEL header not found])]
  43. )
  44. AC_CHECK_HEADERS(
  45. [linux/btrfs.h],
  46. [],
  47. [AC_MSG_WARN([*** KERNEL header not found])]
  48. )
  49. # Checks for typedefs, structures, and compiler characteristics.
  50. AC_TYPE_UID_T
  51. AC_C_INLINE
  52. AC_TYPE_MODE_T
  53. AC_TYPE_PID_T
  54. AC_CHECK_MEMBERS([struct stat.st_rdev])
  55. AC_CHECK_DECLS([getrandom, gettid, name_to_handle_at, accept4, mkostemp, ppoll, strndupa], [], [],
  56. [[#include <fcntl.h>
  57. #include <linux/random.h>
  58. #include <poll.h>
  59. #include <signal.h>
  60. #include <stdlib.h>
  61. #include <string.h>
  62. #include <sys/mount.h>
  63. #include <sys/socket.h>
  64. #include <sys/types.h>
  65. #include <unistd.h>]])
  66. AC_CHECK_SIZEOF(pid_t)
  67. AC_CHECK_SIZEOF(uid_t)
  68. AC_CHECK_SIZEOF(gid_t)
  69. AC_CHECK_SIZEOF(dev_t)
  70. AC_CHECK_SIZEOF(time_t)
  71. AC_CHECK_SIZEOF(rlim_t,,[[
  72. #include <sys/time.h>
  73. #include <sys/resource.h>]])
  74. # Checks for library functions.
  75. AC_FUNC_CHOWN
  76. AC_FUNC_FORK
  77. AC_FUNC_FSEEKO
  78. AC_FUNC_GETGROUPS
  79. AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
  80. AC_HEADER_MAJOR
  81. AC_FUNC_MMAP
  82. AC_CHECK_FUNCS(
  83. [alarm dup2 ftruncate localtime_r mempcpy \
  84. mkdir munmap nl_langinfo rmdir setlocale socket stpcpy \
  85. uname],
  86. [],
  87. [AC_MSG_ERROR([*** POSIX function not found])]
  88. )
  89. AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX librt not found])])
  90. LT_LIB_M
  91. # ------------------------------------------------------------------------------
  92. # TODO: the old python checks are irrelevant, but we do need python and perl for tests
  93. # ------------------------------------------------------------------------------
  94. # Set paths here
  95. AC_ARG_WITH(
  96. [rootprefix],
  97. [AS_HELP_STRING(
  98. [--with-rootprefix=DIR],
  99. [rootfs directory prefix for config files and kernel modules])],
  100. [],
  101. [with_rootprefix="\${prefix}"]
  102. )
  103. AC_ARG_WITH(
  104. [rootlibdir],
  105. [AS_HELP_STRING(
  106. [--with-rootlibdir=DIR],
  107. [Root directory for libraries necessary for boot])],
  108. [],
  109. [with_rootlibdir=${libdir}]
  110. )
  111. AC_ARG_WITH(
  112. [rootlibexecdir],
  113. [AS_HELP_STRING(
  114. [--with-rootlibexecdir=DIR],
  115. [Root directory for libexecs necessary for boot])],
  116. [],
  117. [with_rootlibexecdir=${with_rootlibdir}/udev]
  118. )
  119. AC_ARG_WITH(
  120. [rootrundir],
  121. [AS_HELP_STRING(
  122. [--with-rootrundir=DIR],
  123. [Configurable path for /run])],
  124. [],
  125. [with_rootrundir=/run]
  126. )
  127. AC_ARG_ENABLE(
  128. [split-usr],
  129. [AS_HELP_STRING(
  130. [--enable-split-usr],
  131. [Include hard-coded default search paths in / and /usr])],
  132. [],
  133. [AS_IF(
  134. [test "x${ac_default_prefix}" != "x${with_rootprefix}" && test "x${with_rootprefix}" != "x\${prefix}"],
  135. [enable_split_usr=yes],
  136. [enable_split_usr=no])]
  137. )
  138. AS_IF(
  139. [test "x${enable_split_usr}" = "xyes"],
  140. [AC_DEFINE(HAVE_SPLIT_USR, 1, [Define to include hard-coded default search paths in / and /usr])]
  141. )
  142. # Configured paths
  143. AC_SUBST([rootprefix], [${with_rootprefix}])
  144. AC_SUBST([rootlibdir], [${with_rootlibdir}])
  145. AC_SUBST([rootlibexecdir], [${with_rootlibexecdir}])
  146. AC_SUBST([udevlibexecdir], [${rootlibexecdir}])
  147. # sysconfdir paths
  148. AC_SUBST([udevconfdir],[${sysconfdir}/udev])
  149. AC_SUBST([udevconffile],[${udevconfdir}/udev.conf])
  150. AC_SUBST([udevhwdbdir],[${udevconfdir}/hwdb.d])
  151. AC_SUBST([udevhwdbbin],[${udevconfdir}/hwdb.bin])
  152. # udevlibexecdir paths
  153. AC_SUBST([udevkeymapdir],[${udevlibexecdir}/keymaps])
  154. AC_SUBST([udevkeymapforceredir],[${udevkeymapdir}/force-release])
  155. AC_SUBST([udevrulesdir],[${udevlibexecdir}/rules.d])
  156. # pkgconfigdir paths
  157. AC_SUBST([pkgconfiglibdir], [${libdir}/pkgconfig])
  158. AC_SUBST([sharepkgconfigdir],[${datadir}/pkgconfig])
  159. # introspection paths
  160. AC_SUBST([girdir], [${datadir}/gir-1.0])
  161. AC_SUBST([typelibsdir], [${libdir}/girepository-1.0])
  162. AC_SUBST([rootrundir],[${with_rootrundir}])
  163. # ------------------------------------------------------------------------------
  164. GOBJECT_INTROSPECTION_CHECK([1.31.1])
  165. AM_CONDITIONAL([HAVE_INTROSPECTION], [test "$enable_introspection" = "yes"])
  166. # ------------------------------------------------------------------------------
  167. AC_ARG_ENABLE([programs],
  168. AS_HELP_STRING([--disable-programs], [disable programs (udevd, udevadm and helpers)]),
  169. [], [enable_programs="yes"])
  170. AM_CONDITIONAL([ENABLE_PROGRAMS], [test "x$enable_programs" = "xyes"])
  171. # ------------------------------------------------------------------------------
  172. have_blkid=no
  173. AC_ARG_ENABLE(blkid, AS_HELP_STRING([--disable-blkid], [Disable optional blkid support]))
  174. if test "x$enable_blkid" != "xno"; then
  175. PKG_CHECK_MODULES([BLKID], [blkid >= 2.20],
  176. [AC_DEFINE(HAVE_BLKID, 1, [Define if blkid is available]) have_blkid=yes], have_blkid=no)
  177. if test "x$have_blkid" = xno -a "x$enable_blkid" = xyes; then
  178. AC_MSG_ERROR([*** blkid support requested but not found])
  179. fi
  180. fi
  181. AM_CONDITIONAL(HAVE_BLKID, [test "x$have_blkid" = "xyes"])
  182. # ------------------------------------------------------------------------------
  183. have_selinux=no
  184. AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support]))
  185. if test "x$enable_selinux" != "xno"; then
  186. PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9],
  187. [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no)
  188. if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then
  189. AC_MSG_ERROR([*** SELinux support requested but libraries not found])
  190. fi
  191. fi
  192. AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"])
  193. if test "x${have_selinux}" != xno ; then
  194. sushell=/sbin/sushell
  195. else
  196. sushell=/bin/bash
  197. fi
  198. AC_SUBST(sushell)
  199. # selinux-util.c uses struct mallinfo which is not available for all C libraries (musl).
  200. AC_CHECK_FUNCS([mallinfo])
  201. # ------------------------------------------------------------------------------
  202. AC_CHECK_DECL([unshare],
  203. [AC_DEFINE(HAVE_UNSHARE, 1, [Define if unshare is declared])],
  204. [AC_CHECK_DECL([SYS_unshare],
  205. [ ] ,
  206. [AC_MSG_ERROR([*** unshare nor SYS_unshare found.])],
  207. [#include <syscall.h>])],
  208. [#include <sched.h>])
  209. # ------------------------------------------------------------------------------
  210. AC_PATH_TOOL(GPERF, gperf)
  211. if test -z "$GPERF" ; then
  212. AC_MSG_ERROR([*** gperf not found])
  213. fi
  214. # ------------------------------------------------------------------------------
  215. AC_ARG_ENABLE([manpages], AS_HELP_STRING([--disable-manpages],[disable manpages]),[],[enable_manpages=no])
  216. AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$enable_manpages" = "xyes"])
  217. # ------------------------------------------------------------------------------
  218. have_kmod=no
  219. AC_ARG_ENABLE(kmod, AS_HELP_STRING([--disable-kmod], [disable loadable modules support]))
  220. if test "x$enable_kmod" != "xno"; then
  221. PKG_CHECK_EXISTS([ libkmod ], have_kmod=yes, have_kmod=no)
  222. if test "x$have_kmod" = "xyes"; then
  223. PKG_CHECK_MODULES(KMOD, [ libkmod >= 15 ],
  224. [AC_DEFINE(HAVE_KMOD, 1, [Define if kmod is available])],
  225. AC_MSG_ERROR([*** kmod version >= 15 not found]))
  226. fi
  227. if test "x$have_kmod" = xno -a "x$enable_kmod" = xyes; then
  228. AC_MSG_ERROR([*** kmod support requested, but libraries not found])
  229. fi
  230. fi
  231. AM_CONDITIONAL(HAVE_KMOD, [test "$have_kmod" = "yes"])
  232. # ------------------------------------------------------------------------------
  233. AC_ARG_ENABLE([hwdb], AS_HELP_STRING([--enable-hwdb],[install hwdb.d files]),[],[enable_hwdb=yes])
  234. AM_CONDITIONAL(ENABLE_HWDB, [test "x$enable_hwdb" = "xyes"])
  235. # ------------------------------------------------------------------------------
  236. # rule-generator - persistent network and optical device rule generator
  237. # ------------------------------------------------------------------------------
  238. AC_ARG_ENABLE([rule-generator],
  239. AS_HELP_STRING([--enable-rule-generator], [enable legacy persistent network, cdrom support]),
  240. [], [enable_rule_generator=no])
  241. if test "x${enable_rule_generator}" != xno; then
  242. AC_DEFINE([ENABLE_RULE_GENERATOR], [1], [Define if we are enabling rule generator])
  243. fi
  244. AM_CONDITIONAL([ENABLE_RULE_GENERATOR], [test "x$enable_rule_generator" = xyes])
  245. # ------------------------------------------------------------------------------
  246. # mtd_probe - autoloads FTL module for mtd devices
  247. # ------------------------------------------------------------------------------
  248. AC_ARG_ENABLE([mtd_probe],
  249. AS_HELP_STRING([--disable-mtd_probe], [disable MTD support]),
  250. [], [enable_mtd_probe=yes])
  251. AM_CONDITIONAL([ENABLE_MTD_PROBE], [test "x$enable_mtd_probe" = xyes])
  252. # ------------------------------------------------------------------------------
  253. AC_CONFIG_FILES([Makefile
  254. hwdb/Makefile
  255. man/Makefile
  256. rule_generator/Makefile
  257. rule_generator/write_net_rules
  258. rules/Makefile
  259. rules/64-btrfs.rules
  260. src/Makefile
  261. src/ata_id/Makefile
  262. src/cdrom_id/Makefile
  263. src/collect/Makefile
  264. src/mtd_probe/Makefile
  265. src/scsi_id/Makefile
  266. src/v4l_id/Makefile
  267. src/shared/Makefile
  268. src/libudev/Makefile
  269. src/libudev/libudev.pc
  270. src/udev/Makefile
  271. src/udev/udev.pc
  272. test/Makefile])
  273. AC_OUTPUT
  274. # ------------------------------------------------------------------------------
  275. AC_MSG_RESULT([
  276. prefix: ${prefix}
  277. exec_prefix: ${exec_prefix}
  278. sysconfdir: ${sysconfdir}
  279. datadir: ${datadir}
  280. includedir: ${includedir}
  281. bindir: ${bindir}
  282. libdir: ${libdir}
  283. rootprefix: ${rootprefix}
  284. rootlibdir: ${rootlibdir}
  285. rootlibexecdir: ${rootlibexecdir}
  286. datarootdir: ${datarootdir}
  287. rootrundir: ${rootrundir}
  288. udevconfdir: ${udevconfdir}
  289. udevconffile: ${udevconffile}
  290. udevhwdbdir: ${udevhwdbdir}
  291. udevhwdbbin: ${udevhwdbbin}
  292. udevlibexecdir: ${udevlibexecdir}
  293. udevkeymapdir: ${udevkeymapdir}
  294. udevkeymapforceredir: ${udevkeymapforceredir}
  295. udevrulesdir: ${udevrulesdir}
  296. pkgconfiglibdir: ${libdir}/pkgconfig
  297. sharepkgconfigdir ${datadir}/pkgconfig
  298. girdir ${datadir}/gir-1.0
  299. typelibsdir ${libdir}/girepository-1.0
  300. ])
  301. # ------------------------------------------------------------------------------
  302. dnl Set configured scripts executable
  303. if test -f src/keymap/check-keymaps.sh; then
  304. chmod +x src/keymap/check-keymaps.sh
  305. fi
  306. if test -f src/keymap/keyboard-force-release.sh; then
  307. chmod +x src/keymap/keyboard-force-release.sh
  308. fi