X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=configure.ac;h=972fc2f6bf83d6141b3315b4ed196cf5a35746e2;hp=db9440d73a7e8ae1ef059a8ffb893883149fa565;hb=127dc4ea9487397b1ab70447e2f44d091e44ab5f;hpb=0b340bcf0e1e52efb4a5ba1bd4eda8e3349baaed diff --git a/configure.ac b/configure.ac index db9440d73..972fc2f6b 100644 --- a/configure.ac +++ b/configure.ac @@ -20,7 +20,7 @@ AC_PREREQ([2.64]) AC_INIT([systemd], - [208], + [212], [http://bugs.freedesktop.org/enter_bug.cgi?product=systemd], [systemd], [http://www.freedesktop.org/wiki/Software/systemd]) @@ -65,16 +65,18 @@ AC_PROG_CC_C99 AC_PATH_PROG([M4], [m4]) AC_PATH_PROG([XSLTPROC], [xsltproc]) -AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon]) -AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck]) +AC_PATH_PROG([QUOTAON], [quotaon], [/usr/sbin/quotaon], [$PATH:/usr/sbin:/sbin]) +AC_PATH_PROG([QUOTACHECK], [quotacheck], [/usr/sbin/quotacheck], [$PATH:/usr/sbin:/sbin]) -AC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap]) +AC_PATH_PROG([SETCAP], [setcap], [/usr/sbin/setcap], [$PATH:/usr/sbin:/sbin]) -AC_PATH_PROG([KILL], [kill], [/usr/bin/kill]) +AC_PATH_PROG([KILL], [kill], [/usr/bin/kill], [$PATH:/usr/sbin:/sbin]) -AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod]) +AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod], [$PATH:/usr/sbin:/sbin]) -AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec]) +AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec], [$PATH:/usr/sbin:/sbin]) + +M4_DEFINES= # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line m4_ifdef([GTK_DOC_CHECK], [ @@ -112,6 +114,23 @@ AS_IF([test "x$enable_address_sanitizer" = "xyes"], [ address_sanitizer_ldflags="-Wc,-fsanitize=address" ]) +undefined_sanitizer_cflags= +undefined_sanitizer_cppflags= +undefined_sanitizer_ldflags= +AC_ARG_ENABLE(undefined-sanitizer, AS_HELP_STRING([--enable-undefined-sanitizer], [enable -fsanitize=undefined])) +AS_IF([test "x$enable_undefined_sanitizer" = "xyes"], [ + CC_CHECK_FLAG_APPEND([with_us_cflags], [CFLAGS], [-fsanitize=undefined]) + AS_IF([test -z "$with_us_cflags"], + [AC_MSG_ERROR([*** -fsanitize=undefined is not supported])]) + undefined_sanitizer_cflags="$with_us_cflags -fno-omit-frame-pointer -DVALGRIND=1" + undefined_sanitizer_cppflags="-DVALGRIND=1" + undefined_sanitizer_ldflags="-Wc,-fsanitize=undefined" + ]) + +sanitizer_cflags="$address_sanitizer_cflags $undefined_sanitizer_cflags" +sanitizer_cppflags="$address_sanitizer_cppflags $undefined_sanitizer_cppflags" +sanitizer_ldflags="$address_sanitizer_ldflags $undefined_sanitizer_ldflags" + CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -pipe \ -Wall \ @@ -125,7 +144,9 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -Wold-style-definition \ -Wpointer-arith \ -Winit-self \ + -Wdeclaration-after-statement \ -Wfloat-equal \ + -Wsuggest-attribute=noreturn \ -Wmissing-prototypes \ -Wstrict-prototypes \ -Wredundant-decls \ @@ -133,7 +154,6 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -Wmissing-noreturn \ -Wshadow \ -Wendif-labels \ - -Wcast-align \ -Wstrict-aliasing=2 \ -Wwrite-strings \ -Wno-long-long \ @@ -142,6 +162,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 \ @@ -151,26 +173,32 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -ffunction-sections \ -fdata-sections \ -fstack-protector \ + -fstack-protector-strong \ --param=ssp-buffer-size=4]) AS_CASE([$CFLAGS], [*-O[[12345\ ]]*], [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ -flto])], [AC_MSG_RESULT([skipping -flto, optimization not enabled])]) -AC_SUBST([OUR_CFLAGS], "$with_cflags $address_sanitizer_cflags") +AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags") AS_CASE([$CFLAGS], [*-O[[12345\ ]]*], [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\ -Wp,-D_FORTIFY_SOURCE=2])], [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])]) -AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $address_sanitizer_cppflags") +AC_SUBST([OUR_CPPFLAGS], "$with_cppflags $sanitizer_cppflags") CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\ -Wl,--as-needed \ -Wl,--no-undefined \ -Wl,--gc-sections \ -Wl,-z,relro \ - -Wl,-z,now]) -AC_SUBST([OUR_LDFLAGS], "$with_ldflags $address_sanitizer_ldflags") + -Wl,-z,now \ + -Wl,-fuse-ld=gold]) +AC_SUBST([OUR_LDFLAGS], "$with_ldflags $sanitizer_ldflags") + +AC_CHECK_SIZEOF(pid_t) +AC_CHECK_SIZEOF(uid_t) +AC_CHECK_SIZEOF(gid_t) # ------------------------------------------------------------------------------ # we use python to build the man page index, and for systemd-python @@ -178,9 +206,11 @@ 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"], @@ -229,19 +259,38 @@ LIBS="$save_LIBS" AC_CHECK_FUNCS([fanotify_init fanotify_mark]) AC_CHECK_FUNCS([__secure_getenv secure_getenv]) -AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at], [], [], [[#include +AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, LO_FLAGS_PARTSCAN], [], [], [[#include #include #include -#include ]]) +#include +#include +#include ]]) # This makes sure pkg.m4 is available. m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) # ------------------------------------------------------------------------------ -PKG_CHECK_MODULES(DBUS, [dbus-1 >= 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])) @@ -293,6 +342,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]), @@ -331,13 +395,31 @@ 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 fi AM_CONDITIONAL(HAVE_SELINUX, [test "$have_selinux" = "yes"]) +have_apparmor=no +AC_ARG_ENABLE(apparmor, AS_HELP_STRING([--disable-apparmor], [Disable optional AppArmor support])) +if test "x$enable_apparmor" != "xno"; then + PKG_CHECK_MODULES([APPARMOR], [libapparmor], + [AC_DEFINE(HAVE_APPARMOR, 1, [Define if AppArmor is available]) + have_apparmor=yes + M4_DEFINES="$M4_DEFINES -DHAVE_APPARMOR"], + [have_apparmor=no]) + if test "x$have_apparmor" = xno -a "x$enable_apparmor" = xyes; then + AC_MSG_ERROR([*** AppArmor support requested but libraries not found]) + fi +fi +AM_CONDITIONAL(HAVE_APPARMOR, [test "$have_apparmor" = "yes"]) + + AC_ARG_WITH(debug-shell, AS_HELP_STRING([--with-debug-shell=PATH], [Path to debug shell binary]), @@ -366,31 +448,6 @@ if test "x$enable_xz" != "xno"; then fi AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"]) -# ------------------------------------------------------------------------------ -AC_ARG_ENABLE([tcpwrap], - AS_HELP_STRING([--disable-tcpwrap],[Disable optional TCP wrappers support]), - [case "${enableval}" in - yes) have_tcpwrap=yes ;; - no) have_tcpwrap=no ;; - *) AC_MSG_ERROR(bad value ${enableval} for --disable-tcpwrap) ;; - esac], - [have_tcpwrap=auto]) - -if test "x${have_tcpwrap}" != xno ; then - ACX_LIBWRAP - if test "x${LIBWRAP_LIBS}" = x ; then - if test "x$have_tcpwrap" = xyes ; then - AC_MSG_ERROR([*** TCP wrappers support not found.]) - fi - have_tcpwrap=no - else - have_tcpwrap=yes - fi -else - LIBWRAP_LIBS= -fi -AC_SUBST(LIBWRAP_LIBS) - # ------------------------------------------------------------------------------ AC_ARG_ENABLE([pam], AS_HELP_STRING([--disable-pam],[Disable optional PAM support]), @@ -420,6 +477,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 @@ -522,6 +580,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 @@ -634,7 +693,7 @@ AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"]) have_microhttpd=no AC_ARG_ENABLE(microhttpd, AS_HELP_STRING([--disable-microhttpd], [disable microhttpd support])) if test "x$enable_microhttpd" != "xno"; then - PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.5], + PKG_CHECK_MODULES(MICROHTTPD, [libmicrohttpd >= 0.9.33], [AC_DEFINE(HAVE_MICROHTTPD, 1, [Define if microhttpd is available]) have_microhttpd=yes], have_microhttpd=no) if test "x$have_microhttpd" = xno -a "x$enable_microhttpd" = xyes; then AC_MSG_ERROR([*** microhttpd support requested but libraries not found]) @@ -642,6 +701,18 @@ if test "x$enable_microhttpd" != "xno"; then fi AM_CONDITIONAL(HAVE_MICROHTTPD, [test "$have_microhttpd" = "yes"]) +# ------------------------------------------------------------------------------ +have_gnutls=no +AC_ARG_ENABLE(gnutls, AS_HELP_STRING([--disable-gnutls], [disable gnutls support])) +if test "x$enable_gnutls" != "xno"; then + PKG_CHECK_MODULES(GNUTLS, [gnutls >= 3.1.4], + [AC_DEFINE(HAVE_GNUTLS, 1, [Define if gnutls is available]) have_gnutls=yes], have_gnutls=no) + if test "x$have_gnutls" = xno -a "x$enable_gnutls" = xyes; then + AC_MSG_ERROR([*** gnutls support requested but libraries not found]) + fi +fi +AM_CONDITIONAL(HAVE_GNUTLS, [test "$have_gnutls" = "yes"]) + # ------------------------------------------------------------------------------ have_binfmt=no AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool])) @@ -748,6 +819,31 @@ if test "x$enable_timedated" != "xno"; then fi AM_CONDITIONAL(ENABLE_TIMEDATED, [test "$have_timedated" = "yes"]) +# ------------------------------------------------------------------------------ +have_timesyncd=no +AC_ARG_ENABLE(timesyncd, AS_HELP_STRING([--disable-timesyncd], [disable timesync daemon])) +if test "x$enable_timesyncd" != "xno"; then + have_timesyncd=yes +fi +AM_CONDITIONAL(ENABLE_TIMESYNCD, [test "$have_timesyncd" = "yes"]) + +AC_ARG_WITH(ntp-servers, + AS_HELP_STRING([--with-ntp-servers=NTPSERVERS], + [Space-separated list of default NTP servers]), + [NTP_SERVERS="$withval"], + [NTP_SERVERS="time1.google.com time2.google.com time3.google.com time4.google.com"]) + +AC_DEFINE_UNQUOTED(NTP_SERVERS, ["$NTP_SERVERS"], [Default NTP Servers]) +AC_SUBST(NTP_SERVERS) + +AC_ARG_WITH(time-epoch, + AS_HELP_STRING([--with-time-epoch=SECONDS], + [TIme epoch for time clients]), + [TIME_EPOCH="$withval"], + [TIME_EPOCH="`stat -c %Y ${srcdir}/NEWS 2>/dev/null || echo 0`"]) + +AC_DEFINE_UNQUOTED(TIME_EPOCH, [$TIME_EPOCH], [Time Epoch]) + # ------------------------------------------------------------------------------ have_localed=no AC_ARG_ENABLE(localed, AS_HELP_STRING([--disable-localed], [disable locale daemon])) @@ -798,6 +894,16 @@ if test "x$enable_multi_seat_x" != "xno"; then fi 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 + 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"]) + # ------------------------------------------------------------------------------ AC_ARG_WITH(rc-local-script-path-start, AS_HELP_STRING([--with-rc-local-script-path-start=PATH], @@ -897,12 +1003,7 @@ AS_IF([test "x$enable_gudev" = "xyes"], [ AC_DEFINE(HAVE_GLIB, 1, [Define if gli # ------------------------------------------------------------------------------ have_manpages=no AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages])) -AS_IF([test "x$enable_manpages" != xno], [ - AS_IF([test "x$enable_manpages" = xyes -a "x$XSLTPROC" = x], [ - AC_MSG_ERROR([*** Manpages requested but xsltproc not found]) - ]) - AS_IF([test "x$XSLTPROC" != x], [have_manpages=yes]) -]) +AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes]) AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"]) # ------------------------------------------------------------------------------ @@ -910,7 +1011,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], @@ -1047,11 +1147,12 @@ AC_MSG_RESULT([ $PACKAGE_NAME $VERSION libcryptsetup: ${have_libcryptsetup} - tcpwrap: ${have_tcpwrap} PAM: ${have_pam} AUDIT: ${have_audit} IMA: ${have_ima} + AppArmor: ${have_apparmor} SELinux: ${have_selinux} + SECCOMP: ${have_seccomp} SMACK: ${have_smack} XZ: ${have_xz} ACL: ${have_acl} @@ -1060,6 +1161,7 @@ AC_MSG_RESULT([ QRENCODE: ${have_qrencode} MICROHTTPD: ${have_microhttpd} CHKCONFIG: ${have_chkconfig} + GNUTLS: ${have_gnutls} binfmt: ${have_binfmt} vconsole: ${have_vconsole} readahead: ${have_readahead} @@ -1073,16 +1175,22 @@ AC_MSG_RESULT([ machined: ${have_machined} hostnamed: ${have_hostnamed} timedated: ${have_timedated} + timesyncd: ${have_timesyncd} + default NTP servers: ${NTP_SERVERS} + time epoch: ${TIME_EPOCH} localed: ${have_localed} + networkd: ${have_networkd} coredump: ${have_coredump} polkit: ${have_polkit} efi: ${have_efi} kmod: ${have_kmod} blkid: ${have_blkid} + dbus: ${have_dbus} nss-myhostname: ${have_myhostname} gudev: ${enable_gudev} gintrospection: ${enable_introspection} multi-seat-x: ${have_multi_seat_x} + kdbus: ${have_kdbus} Python: ${have_python} Python Headers: ${have_python_devel} man pages: ${have_manpages} @@ -1090,6 +1198,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}