chiark / gitweb /
coredumpctl: show a useful error on permission problems
[elogind.git] / configure.ac
index 1391d033b4b39db25982564656ad86a13bd03609..2ee73ca08a58353d3169424ab207d016c7e107f6 100644 (file)
@@ -20,7 +20,7 @@
 AC_PREREQ([2.64])
 
 AC_INIT([systemd],
-        [214],
+        [215],
         [http://bugs.freedesktop.org/enter_bug.cgi?product=systemd],
         [systemd],
         [http://www.freedesktop.org/wiki/Software/systemd])
@@ -49,7 +49,29 @@ AS_IF([test "x$enable_static" = "xyes"], [AC_MSG_ERROR([--enable-static is not s
 AS_IF([test "x$enable_largefile" = "xno"], [AC_MSG_ERROR([--disable-largefile is not supported by systemd])])
 
 # i18n stuff for the PolicyKit policy files
+
+# Check whether intltool can be found, disable NLS otherwise
+AC_CHECK_PROG(intltool_found, [intltool-merge], [yes], [no])
+AS_IF([test x"$intltool_found" != xyes],
+      [AS_IF([test x"$enable_nls" = xyes],
+             [AC_MSG_ERROR([--enable-nls requested but intltool not found])],
+             [AS_IF([test x"$enable_nls" != xno],
+                    [AC_MSG_WARN([*** Disabling NLS support because intltool was not found])
+                     enable_nls=no])
+             ])
+      ])
+
+AM_NLS
+AS_IF([test x"$enable_nls" != xno], [
+    # intltoolize greps for '^(AC|IT)_PROG_INTLTOOL', so it needs to be on its own line
 IT_PROG_INTLTOOL([0.40.0])
+])
+
+AS_IF([test -z "$INTLTOOL_POLICY_RULE"], [
+    # If intltool is not available, provide a dummy rule to fail generation of %.policy files with a meaningful error message
+    INTLTOOL_POLICY_RULE='%.policy: %.policy.in ; @echo "  ITMRG   " $@ && echo "*** intltool support required to build target $@" && false'
+    AC_SUBST(INTLTOOL_POLICY_RULE)
+])
 
 GETTEXT_PACKAGE=systemd
 AC_SUBST(GETTEXT_PACKAGE)
@@ -216,9 +238,21 @@ AC_ARG_WITH([python],
 have_lxml=no
 AS_IF([test "x$with_python" != "xno"], [
         AM_PATH_PYTHON(,, [:])
-        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])
+        AS_IF([test "x$PYTHON" != "x:"], [
+                AC_MSG_CHECKING([for python lxml module])
+                AS_IF(["$PYTHON" -c 'import lxml' 2>/dev/null], [have_lxml=yes])
+                AC_MSG_RESULT([$have_lxml])
+                AS_IF([test "x$have_lxml" = "xyes"], [have_python=yes],
+                      [AC_MSG_WARN([*** python support requires python-lxml module installed])])
+        ])
 ])
+AS_IF([test "$have_python" != "yes"], [
+      AS_IF([test "$with_python" = "yes"],
+            [AC_MSG_ERROR([*** python support requested but python support not found])])
+      AS_IF([test "$with_python" != "no"],
+            [AC_MSG_WARN([*** python support not found, some documentation cannot be built])])
+])
+
 AM_CONDITIONAL([HAVE_PYTHON], [test "x$have_python" = "xyes"])
 AS_IF([test "x$PYTHON_BINARY" = "x"],
       [AS_IF([test "x$have_python" = "xyes"],
@@ -266,12 +300,33 @@ 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, setns, LO_FLAGS_PARTSCAN], [], [], [[#include <sys/types.h>
+AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, LO_FLAGS_PARTSCAN],
+               [], [], [[
+#include <sys/types.h>
 #include <unistd.h>
 #include <sys/mount.h>
 #include <fcntl.h>
 #include <sched.h>
-#include <linux/loop.h>]])
+#include <linux/loop.h>
+]])
+
+AC_CHECK_DECLS([IFLA_PHYS_PORT_ID,
+                IFLA_BOND_AD_INFO,
+                IFLA_VLAN_PROTOCOL,
+                IFLA_VXLAN_LOCAL6,
+                IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
+                IFLA_BRIDGE_VLAN_INFO],
+[], [], [[
+#include <inttypes.h>
+#include <netinet/in.h>
+#include <netinet/ether.h>
+#include <linux/rtnetlink.h>
+#include <net/if.h>
+#include <linux/ip.h>
+#include <linux/if_tunnel.h>
+#include <linux/if_link.h>
+#include <linux/if_bridge.h>
+]])
 
 # This makes sure pkg.m4 is available.
 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
@@ -448,13 +503,23 @@ have_xz=no
 AC_ARG_ENABLE(xz, AS_HELP_STRING([--disable-xz], [Disable optional XZ support]))
 if test "x$enable_xz" != "xno"; then
         PKG_CHECK_MODULES(XZ, [ liblzma ],
-                [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes], have_xz=no)
+                [AC_DEFINE(HAVE_XZ, 1, [Define if XZ is available]) have_xz=yes])
         if test "x$have_xz" = xno -a "x$enable_xz" = xyes; then
-                AC_MSG_ERROR([*** Xz support requested but libraries not found])
+                AC_MSG_ERROR([*** XZ support requested but libraries not found])
         fi
 fi
 AM_CONDITIONAL(HAVE_XZ, [test "$have_xz" = "yes"])
 
+# ------------------------------------------------------------------------------
+have_lz4=no
+AC_ARG_ENABLE(lz4, AS_HELP_STRING([--enable-lz4], [Enable optional LZ4 support]))
+AS_IF([test "x$enable_lz4" == "xyes"], [
+        AC_CHECK_HEADERS(lz4.h,
+               [AC_DEFINE(HAVE_LZ4, 1, [Define in LZ4 is available]) have_lz4=yes],
+               [AC_MSG_ERROR([*** LZ4 support requested but headers not found])])
+])
+AM_CONDITIONAL(HAVE_LZ4, [test "$have_lz4" = "yes"])
+
 # ------------------------------------------------------------------------------
 AC_ARG_ENABLE([pam],
         AS_HELP_STRING([--disable-pam],[Disable optional PAM support]),
@@ -639,7 +704,7 @@ AC_ARG_ENABLE([elfutils],
 if test "x${have_elfutils}" != xno ; then
         AC_CHECK_HEADERS(
                 [elfutils/libdwfl.h],
-                [have_elfutils=yes],
+                [],
                 [if test "x$have_elfutils" = xyes ; then
                         AC_MSG_ERROR([*** ELFUTILS headers not found.])
                 fi])
@@ -647,11 +712,19 @@ if test "x${have_elfutils}" != xno ; then
         AC_CHECK_LIB(
                 [dw],
                 [dwfl_begin],
-                [have_elfutils=yes],
+                [],
                 [if test "x$have_elfutils" = xyes ; then
                         AC_MSG_ERROR([*** ELFUTILS libs not found.])
                 fi])
 
+        AC_CHECK_LIB(
+                [dw],
+                [dwfl_core_file_attach],
+                [have_elfutils=yes],
+                [if test "x$have_elfutils" = xyes ; then
+                        AC_MSG_ERROR([*** ELFUTILS >= 158 is required.])
+                fi])
+
         if test "x$have_elfutils" = xyes ; then
                 ELFUTILS_LIBS="-lelf -ldw"
                 AC_DEFINE(HAVE_ELFUTILS, 1, [ELFUTILS available])
@@ -916,10 +989,10 @@ AC_SUBST(DNS_SERVERS)
 # ------------------------------------------------------------------------------
 have_networkd=no
 AC_ARG_ENABLE(networkd, AS_HELP_STRING([--disable-networkd], [disable networkd]))
-if test "x$enable_networkd" != "xno"; then
+AS_IF([test "x$enable_networkd" != "xno"], [
         AC_DEFINE(ENABLE_NETWORKD, 1, [Define if networkd support is to be enabled])
         have_networkd=yes
-fi
+])
 AM_CONDITIONAL(ENABLE_NETWORKD, [test "x$have_networkd" = "xyes"])
 
 # ------------------------------------------------------------------------------
@@ -1203,6 +1276,7 @@ AC_MSG_RESULT([
         SECCOMP:                 ${have_seccomp}
         SMACK:                   ${have_smack}
         XZ:                      ${have_xz}
+        LZ4:                     ${have_lz4}
         ACL:                     ${have_acl}
         GCRYPT:                  ${have_gcrypt}
         QRENCODE:                ${have_qrencode}