chiark / gitweb /
update TODO
[elogind.git] / configure.ac
index 03644a6d60af8335e4b7a319394aac1f453c2e36..b13249955620eb12c1552cc01d6159cd68b67ba4 100644 (file)
@@ -20,7 +20,7 @@
 AC_PREREQ([2.64])
 
 AC_INIT([systemd],
-        [186],
+        [189],
         [http://bugs.freedesktop.org/enter_bug.cgi?product=systemd],
         [systemd],
         [http://www.freedesktop.org/wiki/Software/systemd])
@@ -62,12 +62,20 @@ AM_PROG_CC_C_O
 AC_PROG_GCC_TRADITIONAL
 
 AC_PATH_PROG([M4], [m4])
+AC_PATH_PROG([XSLTPROC], [xsltproc])
+
+AC_PATH_PROG([QUOTAON], [quotaon], [/sbin/quotaon])
+AC_PATH_PROG([QUOTACHECK], [quotacheck], [/sbin/quotacheck])
 
 # 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])
 ], [AM_CONDITIONAL([ENABLE_GTK_DOC], [false])])
 
+AS_IF([test "x$enable_gtk_doc" = "xyes" -a "x$XSLTPROC" = x], [
+        AC_MSG_ERROR([*** GTK doc requested but xsltproc not found])
+])
+
 m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
 GOBJECT_INTROSPECTION_CHECK([1.31.1])
 ], [AM_CONDITIONAL([HAVE_INTROSPECTION], [false])])
@@ -86,10 +94,8 @@ AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :])
 CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
         -pipe \
         -Wall \
-        -W \
         -Wextra \
         -Wno-inline \
-        -Wvla \
         -Wundef \
         -Wformat=2 \
         -Wlogical-op \
@@ -118,20 +124,27 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
         -Wno-missing-field-initializers \
         -Wno-unused-result \
         -Werror=overflow \
-        -Wp,-D_FORTIFY_SOURCE=2 \
         -ffast-math \
         -fno-common \
         -fdiagnostics-show-option \
         -fno-strict-aliasing \
         -fvisibility=hidden \
         -ffunction-sections \
-        -fdata-sections])
-AC_SUBST([WARNINGFLAGS], $with_cflags)
+        -fdata-sections \
+        -fstack-protector \
+        --param=ssp-buffer-size=4])
+AC_SUBST([OUR_CFLAGS], $with_cflags)
+
+CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
+        -Wp,-D_FORTIFY_SOURCE=2])
+AC_SUBST([OUR_CPPFLAGS], $with_cppflags)
 
 CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
         -Wl,--as-needed \
-        -Wl,--gc-sections])
-AC_SUBST([GCLDFLAGS], $with_ldflags)
+        -Wl,--gc-sections \
+        -Wl,-z,relro \
+        -Wl,-z,now])
+AC_SUBST([OUR_LDFLAGS], $with_ldflags)
 
 AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
@@ -144,6 +157,11 @@ CAP_LIBS="$LIBS"
 LIBS="$save_LIBS"
 AC_SUBST(CAP_LIBS)
 
+AC_CHECK_FUNCS([fanotify_init fanotify_mark name_to_handle_at])
+AC_CHECK_DECLS([gettid, pivot_root], [], [], [[#include <sys/types.h>
+#include <unistd.h>
+#include <sys/mount.h>]])
+
 # This makes sure pkg.m4 is available.
 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
 
@@ -296,6 +314,39 @@ fi
 AC_SUBST(ACL_LIBS)
 AM_CONDITIONAL([HAVE_ACL], [test "x$have_acl" != xno])
 
+# ------------------------------------------------------------------------------
+AC_ARG_ENABLE([gcrypt],
+        AS_HELP_STRING([--disable-gcrypt],[Disable optional GCRYPT support]),
+                [case "${enableval}" in
+                        yes) have_gcrypt=yes ;;
+                        no) have_gcrypt=no ;;
+                        *) AC_MSG_ERROR(bad value ${enableval} for --disable-gcrypt) ;;
+                esac],
+                [have_gcrypt=auto])
+
+if test "x${have_gcrypt}" != xno ; then
+        AM_PATH_LIBGCRYPT(
+                [1.4.5],
+                [have_gcrypt=yes],
+                [if test "x$have_gcrypt" = xyes ; then
+                        AC_MSG_ERROR([*** GCRYPT headers not found.])
+                fi])
+
+        if test "x$have_gcrypt" = xyes ; then
+                GCRYPT_LIBS="$LIBGCRYPT_LIBS"
+                GCRYPT_CFLAGS="$LIBGCRYPT_CFLAGS"
+                AC_DEFINE(HAVE_GCRYPT, 1, [GCRYPT available])
+        else
+                have_gcrypt=no
+        fi
+else
+        GCRYPT_LIBS=
+        GCRYPT_CFLAGS=
+fi
+AC_SUBST(GCRYPT_LIBS)
+AC_SUBST(GCRYPT_CFLAGS)
+AM_CONDITIONAL([HAVE_GCRYPT], [test "x$have_gcrypt" != xno])
+
 # ------------------------------------------------------------------------------
 AC_ARG_ENABLE([audit],
         AS_HELP_STRING([--disable-audit],[Disable optional AUDIT support]),
@@ -345,6 +396,18 @@ if test "x$enable_libcryptsetup" != "xno"; then
 fi
 AM_CONDITIONAL(HAVE_LIBCRYPTSETUP, [test "$have_libcryptsetup" = "yes"])
 
+# ------------------------------------------------------------------------------
+have_qrencode=no
+AC_ARG_ENABLE(qrencode, AS_HELP_STRING([--disable-qrencode], [disable qrencode support]))
+if test "x$enable_qrencode" != "xno"; then
+        PKG_CHECK_MODULES(QRENCODE, [ libqrencode ],
+                [AC_DEFINE(HAVE_QRENCODE, 1, [Define if qrencode is available]) have_qrencode=yes], have_qrencode=no)
+        if test "x$have_qrencode" = xno -a "x$enable_qrencode" = xyes; then
+                AC_MSG_ERROR([*** qrencode support requested but libraries not found])
+        fi
+fi
+AM_CONDITIONAL(HAVE_QRENCODE, [test "$have_qrencode" = "yes"])
+
 # ------------------------------------------------------------------------------
 have_binfmt=no
 AC_ARG_ENABLE(binfmt, AS_HELP_STRING([--disable-binfmt], [disable binfmt tool]))
@@ -495,21 +558,22 @@ AM_CONDITIONAL([ENABLE_KEYMAP], [test "x$enable_keymap" = "xyes"])
 # ------------------------------------------------------------------------------
 have_manpages=no
 AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-manpages], [disable manpages]))
-if test "x$enable_manpages" != "xno"; then
-        have_manpages=yes
-fi
-AM_CONDITIONAL(ENABLE_MANPAGES, [test "$have_manpages" = "yes"])
+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])
+])
+AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
 
 # ------------------------------------------------------------------------------
-AC_PATH_PROG([XSLTPROC], [xsltproc])
-AM_CONDITIONAL(HAVE_XSLTPROC, test x"$XSLTPROC" != x)
 
 AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, ubuntu, arch, gentoo, slackware, altlinux, mandriva, mageia, angstrom or other]))
 if test "z$with_distro" = "z"; then
         if test "$cross_compiling" = yes; then
                 AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
         else
-                with_distro=$($GREP '^ID=' /etc/os-release | $SED 's/ID=//');
+                with_distro=$($GREP '^ID=' /etc/os-release 2>/dev/null | $SED 's/ID=//');
         fi
         if test "z$with_distro" = "z"; then
                 with_distro=other
@@ -721,6 +785,8 @@ AC_MSG_RESULT([
         SELinux:                 ${have_selinux}
         XZ:                      ${have_xz}
         ACL:                     ${have_acl}
+        GCRYPT:                  ${have_gcrypt}
+        QRENCODE:                ${have_qrencode}
         binfmt:                  ${have_binfmt}
         vconsole:                ${have_vconsole}
         readahead:               ${have_readahead}
@@ -753,8 +819,9 @@ AC_MSG_RESULT([
         D-Bus interfaces dir:    ${with_dbusinterfacedir}
         Split /usr:              ${enable_split_usr}
         man pages:               ${have_manpages}
+        gtk-doc:                 ${enable_gtk_doc}
 
-        CFLAGS:                  ${CFLAGS}
-        CPPLAGS:                 ${CPPFLAGS}
-        LDFLAGS:                 ${LDFLAGS}
+        CFLAGS:                  ${OUR_CFLAGS} ${CFLAGS}
+        CPPLAGS:                 ${OUR_CPPFLAGS} ${CPPFLAGS}
+        LDFLAGS:                 ${OUR_LDFLAGS} ${LDFLAGS}
 ])