X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=configure.ac;h=9e5a6817023b0676027abffcc5a3d968bb419a90;hp=f85e86e52bf8b68cceac1cf3c5af536e7a14490a;hb=c305c32580a1d7689a401e8cf673ec7936c12bbe;hpb=c97a6dbcf10990bcc2455e842a41bf14b01f358d diff --git a/configure.ac b/configure.ac index f85e86e52..9e5a68170 100644 --- a/configure.ac +++ b/configure.ac @@ -76,6 +76,8 @@ AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod]) AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec]) +M4_DEFINES= + # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line m4_ifdef([GTK_DOC_CHECK], [ GTK_DOC_CHECK([1.18],[--flavour no-tmpl])], @@ -127,6 +129,7 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -Winit-self \ -Wdeclaration-after-statement \ -Wfloat-equal \ + -Wsuggest-attribute=noreturn \ -Wmissing-prototypes \ -Wstrict-prototypes \ -Wredundant-decls \ @@ -143,6 +146,8 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -Wno-missing-field-initializers \ -Wno-unused-result \ -Werror=overflow \ + -Wdate-time \ + -Wnested-externs \ -ffast-math \ -fno-common \ -fdiagnostics-show-option \ @@ -170,18 +175,24 @@ CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\ -Wl,--no-undefined \ -Wl,--gc-sections \ -Wl,-z,relro \ - -Wl,-z,now]) + -Wl,-z,now \ + -Wl,-fuse-ld=gold]) AC_SUBST([OUR_LDFLAGS], "$with_ldflags $address_sanitizer_ldflags") +AC_CHECK_SIZEOF(pid_t) +AC_CHECK_SIZEOF(uid_t) + # ------------------------------------------------------------------------------ # we use python to build the man page index, and for systemd-python have_python=no AC_ARG_WITH([python], [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])]) +have_lxml=no AS_IF([test "x$with_python" != "xno"], [ AM_PATH_PYTHON(,, [:]) - AS_IF([test "$PYTHON" != :], [have_python=yes]) + AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes], [have_lxml=no]) + AS_IF([test "$PYTHON" != : -a $have_lxml = yes], [have_python=yes]) ]) AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"]) AS_IF([test "x$PYTHON_BINARY" = "x"], @@ -239,10 +250,27 @@ AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include = 1.3.2], have_dbus=yes, have_dbus=no]) -AS_IF([test "$have_dbus" = "yes"], [ AC_DEFINE(HAVE_DBUS, [1], [Define if dbus-1 is available]) ]) +have_dbus=no +AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests])) +AS_IF([test "x$enable_dbus" != "xno"], [ + PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2], + [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes], + [have_dbus=no]) + AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"], + [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])]) AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"]) +# ------------------------------------------------------------------------------ +have_compat_libs=no +AC_ARG_ENABLE([compat_libs], AS_HELP_STRING([--enable-compat-libs],[Enable creation of compatibility libraries]), + [case "${enableval}" in + yes) have_compat_libs=yes ;; + no) have_compat_libs=no ;; + *) AC_MSG_ERROR(bad value ${enableval} for --enable-compat-libs) ;; + esac], + [have_compat_libs=no]) +AM_CONDITIONAL([ENABLE_COMPAT_LIBS], [test "$have_compat_libs" = "yes"]) + # ------------------------------------------------------------------------------ have_coverage=no AC_ARG_ENABLE(coverage, AS_HELP_STRING([--enable-coverage], [enable test coverage])) @@ -294,6 +322,21 @@ if test "x$enable_blkid" != "xno"; then fi AM_CONDITIONAL(HAVE_BLKID, [test "$have_blkid" = "yes"]) +# ------------------------------------------------------------------------------ +have_seccomp=no +AC_ARG_ENABLE(seccomp, AS_HELP_STRING([--disable-seccomp], [Disable optional SECCOMP support])) +if test "x$enable_seccomp" != "xno"; then + PKG_CHECK_MODULES(SECCOMP, [libseccomp >= 1.0.0], + [AC_DEFINE(HAVE_SECCOMP, 1, [Define if seccomp is available]) + have_seccomp=yes + M4_DEFINES="$M4_DEFINES -DHAVE_SECCOMP"], + [have_seccomp=no]) + if test "x$have_seccomp" = "xno" -a "x$enable_seccomp" = "xyes"; then + AC_MSG_ERROR([*** seccomp support requested but libraries not found]) + fi +fi +AM_CONDITIONAL(HAVE_SECCOMP, [test "$have_seccomp" = "yes"]) + # ------------------------------------------------------------------------------ have_ima=yes AC_ARG_ENABLE([ima], AS_HELP_STRING([--disable-ima],[Disable optional IMA support]), @@ -332,7 +375,10 @@ have_selinux=no AC_ARG_ENABLE(selinux, AS_HELP_STRING([--disable-selinux], [Disable optional SELINUX support])) if test "x$enable_selinux" != "xno"; then PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.1.9], - [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) have_selinux=yes], have_selinux=no) + [AC_DEFINE(HAVE_SELINUX, 1, [Define if SELinux is available]) + have_selinux=yes + M4_DEFINES="$M4_DEFINES -DHAVE_SELINUX"], + [have_selinux=no]) if test "x$have_selinux" = xno -a "x$enable_selinux" = xyes; then AC_MSG_ERROR([*** SELinux support requested but libraries not found]) fi @@ -385,6 +431,7 @@ if test "x${have_tcpwrap}" != xno ; then fi have_tcpwrap=no else + M4_DEFINES="$M4_DEFINES -DHAVE_LIBWRAP" have_tcpwrap=yes fi else @@ -421,6 +468,7 @@ if test "x${have_pam}" != xno ; then if test "x$have_pam" = xyes ; then PAM_LIBS="-lpam -lpam_misc" AC_DEFINE(HAVE_PAM, 1, [PAM available]) + M4_DEFINES="$M4_DEFINES -DHAVE_PAM" else have_pam=no fi @@ -523,6 +571,7 @@ if test "x${have_xattr}" = xno; then fi else if test "x${have_smack}" = xauto; then + M4_DEFINES="$M4_DEFINES -DHAVE_SMACK" have_smack=yes fi fi @@ -802,9 +851,10 @@ AM_CONDITIONAL(ENABLE_MULTI_SEAT_X, [test "$have_multi_seat_x" = "yes"]) # ------------------------------------------------------------------------------ have_kdbus=no AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--enable-kdbus], [do connect to kdbus by default])) -if test "x$enable_kdbus" == "xyes"; then +if test "x$enable_kdbus" = "xyes"; then AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus support is to be enabled]) have_kdbus=yes + M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS" fi AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"]) @@ -920,7 +970,6 @@ AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"]) # Location of the init scripts as mandated by LSB SYSTEM_SYSVINIT_PATH=/etc/init.d SYSTEM_SYSVRCND_PATH=/etc/rc.d -M4_DEFINES= AC_ARG_WITH([sysvinit-path], [AS_HELP_STRING([--with-sysvinit-path=PATH], @@ -1062,6 +1111,7 @@ AC_MSG_RESULT([ AUDIT: ${have_audit} IMA: ${have_ima} SELinux: ${have_selinux} + SECCOMP: ${have_seccomp} SMACK: ${have_smack} XZ: ${have_xz} ACL: ${have_acl} @@ -1089,6 +1139,7 @@ AC_MSG_RESULT([ efi: ${have_efi} kmod: ${have_kmod} blkid: ${have_blkid} + dbus: ${have_dbus} nss-myhostname: ${have_myhostname} gudev: ${enable_gudev} gintrospection: ${enable_introspection} @@ -1101,6 +1152,7 @@ AC_MSG_RESULT([ test coverage: ${have_coverage} Split /usr: ${enable_split_usr} SysV compatibility: ${SYSTEM_SYSV_COMPAT} + compatibility libraries: ${have_compat_libs} prefix: ${prefix} rootprefix: ${with_rootprefix}