Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 1 | # Process this file with autoconf to produce a configure script. |
| 2 | |
Scott James Remnant | a86d398 | 2007-10-15 17:55:09 +0100 | [diff] [blame] | 3 | AC_PREREQ(2.61) |
Scott James Remnant | de6c4eb | 2011-03-16 18:03:52 -0700 | [diff] [blame] | 4 | AC_INIT([upstart], [1.2], [upstart-devel@lists.ubuntu.com]) |
Scott James Remnant | cef00b8 | 2011-03-16 18:03:01 -0700 | [diff] [blame] | 5 | NIH_COPYRIGHT([[Copyright © 2011 Scott James Remnant, Google Inc., Canonical Ltd.]]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 6 | AC_CONFIG_SRCDIR([init/main.c]) |
| 7 | AC_CONFIG_MACRO_DIR([m4]) |
| 8 | |
Scott James Remnant | 8985dd3 | 2006-10-12 15:26:29 +0100 | [diff] [blame] | 9 | AC_GNU_SOURCE |
| 10 | |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 11 | AM_INIT_AUTOMAKE([1.10 gnu nostdinc check-news color-tests silent-rules]) |
| 12 | AM_SILENT_RULES([yes]) |
| 13 | AM_MAINTAINER_MODE([enable]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 14 | |
Scott James Remnant | 32804e8 | 2009-01-26 15:25:57 +0000 | [diff] [blame] | 15 | LT_PREREQ(2.2.4) |
| 16 | LT_INIT |
| 17 | |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 18 | AM_GNU_GETTEXT_VERSION([0.17]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 19 | AM_GNU_GETTEXT() |
| 20 | |
| 21 | # Checks for programs. |
| 22 | AC_PROG_CC |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 23 | PKG_PROG_PKG_CONFIG([0.22]) |
| 24 | |
| 25 | AC_PATH_PROG([NIH_DBUS_TOOL], [nih-dbus-tool]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 26 | |
| 27 | # Checks for libraries. |
Scott James Remnant | ef97154 | 2010-04-24 23:18:56 -0700 | [diff] [blame] | 28 | NIH_WITH_LOCAL_LIBNIH |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 29 | |
Scott James Remnant | bc23b12 | 2010-04-27 10:10:19 -0700 | [diff] [blame] | 30 | PKG_CHECK_MODULES([NIH], [libnih >= 1.0.2]) |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 31 | PKG_CHECK_MODULES([NIH_DBUS], [libnih-dbus >= 1.0.0]) |
| 32 | PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.2.16]) |
Scott James Remnant | 5e982af | 2010-12-10 04:42:34 +0000 | [diff] [blame] | 33 | PKG_CHECK_MODULES([UDEV], [libudev >= 146], [have_udev=yes], [have_udev=no]) |
| 34 | |
| 35 | AM_CONDITIONAL([HAVE_UDEV], [test "$have_udev" = yes]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 36 | |
Gwendal Grignou | 8c5b529 | 2016-03-07 11:51:37 -0800 | [diff] [blame] | 37 | AC_MSG_CHECKING([wether to add a keyring for ext4 crypto]) |
| 38 | AC_ARG_WITH( |
| 39 | [dircrypto-keyring], |
| 40 | [AS_HELP_STRING( |
| 41 | [--with-dircrypto-keyring], |
| 42 | [add crypto keyring for directory encryption])], |
| 43 | [], |
| 44 | [with_dircrypto_keyring=auto] |
| 45 | ) |
| 46 | |
| 47 | KEYUTILS_LIBS="" |
| 48 | |
| 49 | AS_IF( |
| 50 | [test "$with_dircrypto_keyring" != "no"], |
| 51 | [ |
| 52 | AC_CHECK_HEADER([keyutils.h], |
| 53 | [AC_CHECK_LIB([keyutils], [keyctl_read], [have_keyutils="yes"])] |
| 54 | ) |
| 55 | if test "$have_keyutils" != "yes"; then |
| 56 | if test "$with_dircrypto_keyring" = "yes"; then |
| 57 | AC_MSG_ERROR([The keyutils library (or developer files) was not found]) |
| 58 | fi |
| 59 | else |
| 60 | KEYUTILS_LIBS="-lkeyutils" |
| 61 | AC_DEFINE([ADD_DIRCRYPTO_RING], 1, [Use keyutils and kernel keyring]) |
| 62 | fi |
| 63 | ] |
| 64 | ) |
| 65 | |
| 66 | AC_SUBST(KEYUTILS_LIBS) |
| 67 | |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 68 | # Checks for header files. |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 69 | AC_CHECK_HEADERS([valgrind/valgrind.h]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 70 | |
Luigi Semenzato | 9496496 | 2016-01-29 13:59:20 -0800 | [diff] [blame] | 71 | AC_ARG_ENABLE(selinux, |
| 72 | AS_HELP_STRING([--enable-selinux], [enable SELinux support]), |
| 73 | [], [enable_selinux=no]) |
| 74 | |
| 75 | if test "x$enable_selinux" = "xyes" ; then |
| 76 | PKG_CHECK_MODULES(SELINUX, [libselinux]) |
| 77 | AC_DEFINE(HAVE_SELINUX, 1, [Define if we have SELinux]) |
Qijiang Fan | d677a9c | 2018-07-17 17:52:38 +0900 | [diff] [blame] | 78 | AC_DEFINE(RESTORE_PATHS, [{"/dev"}], [Define restorecon paths]) |
Luigi Semenzato | 9496496 | 2016-01-29 13:59:20 -0800 | [diff] [blame] | 79 | fi |
| 80 | |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 81 | # Checks for typedefs, structures, and compiler characteristics. |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 82 | AC_PROG_CC_C99 |
| 83 | AM_PROG_CC_C_O |
| 84 | NIH_C_THREAD |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 85 | |
| 86 | # Checks for library functions. |
| 87 | |
| 88 | # Other checks |
Scott James Remnant | 680d2fd | 2008-02-29 17:41:38 +0000 | [diff] [blame] | 89 | AC_MSG_CHECKING([whether to include sbindir in PATH]) |
| 90 | eval upstart_sbindir=\"$sbindir\" |
| 91 | case $upstart_sbindir in |
| 92 | /sbin|//sbin|/usr/sbin|/usr/local/sbin) |
| 93 | AC_MSG_RESULT([no]) |
| 94 | ;; |
| 95 | *) |
| 96 | AC_MSG_RESULT([yes]) |
| 97 | AC_DEFINE_UNQUOTED([EXTRA_PATH], ["$upstart_sbindir"], |
| 98 | [Directory to append to path.]) |
| 99 | ;; |
| 100 | esac |
| 101 | |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 102 | NIH_COMPILER_WARNINGS |
| 103 | NIH_COMPILER_OPTIMISATIONS |
| 104 | NIH_COMPILER_COVERAGE |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 105 | |
Scott James Remnant | d235036 | 2010-02-03 19:42:29 -0800 | [diff] [blame] | 106 | NIH_LINKER_OPTIMISATIONS |
| 107 | |
| 108 | |
| 109 | AC_CONFIG_FILES([ Makefile intl/Makefile |
James Hunt | 340d3d9 | 2011-06-06 18:05:11 +0100 | [diff] [blame] | 110 | dbus/Makefile init/Makefile util/Makefile conf/Makefile |
| 111 | extra/Makefile doc/Makefile contrib/Makefile po/Makefile.in ]) |
Scott James Remnant | 8a0cd07 | 2006-05-14 18:28:58 +0100 | [diff] [blame] | 112 | AC_CONFIG_HEADERS([config.h]) |
| 113 | AC_OUTPUT |