dbus: fix 64-bit compiler warnings
[platform/upstream/dbus.git] / configure.ac
index 9ad52ff..20c821a 100644 (file)
@@ -2,13 +2,17 @@ dnl -*- mode: m4 -*-
 AC_PREREQ([2.63])
 
 m4_define([dbus_major_version], [1])
-m4_define([dbus_minor_version], [10])
-m4_define([dbus_micro_version], [16])
+m4_define([dbus_minor_version], [12])
+m4_define([dbus_micro_version], [20])
 m4_define([dbus_version],
           [dbus_major_version.dbus_minor_version.dbus_micro_version])
 AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus])
+
 AC_CONFIG_AUX_DIR([build-aux])
 
+m4_pattern_forbid([^AX_(CHECK_ENABLE_DEBUG|CODE_COVERAGE|COMPILER_FLAGS|COMPILER_FLAGS_(CFLAGS|CXXFLAGS|LDFLAGS))\b],
+  [Unexpanded AX_ macro found. Please install GNU autoconf-archive])
+
 AC_CANONICAL_HOST
 
 AC_CONFIG_HEADERS([config.h])
@@ -34,16 +38,16 @@ AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable])
 #
 
 ## increment if the interface has additions, changes, removals.
-LT_CURRENT=17
+LT_CURRENT=22
 
 ## increment any time the source changes; set to
 ##  0 if you increment CURRENT
-LT_REVISION=10
+LT_REVISION=13
 
 ## increment if any interfaces have been added; set to 0
 ## if any interfaces have been changed or removed. removal has
 ## precedence over adding, so set to 0 if both happened.
-LT_AGE=14
+LT_AGE=19
 
 AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
@@ -61,6 +65,35 @@ AC_SUBST(DBUS_MINOR_VERSION)
 AC_SUBST(DBUS_MICRO_VERSION)
 AC_SUBST(DBUS_VERSION)
 
+dnl
+dnl Build configuration
+dnl
+
+dnl This must come first: other options use this to set their defaults. Don't
+dnl enable developer mode on production builds.
+AC_ARG_ENABLE([developer],
+  [AS_HELP_STRING([--enable-developer],
+    [set defaults to be appropriate for a D-Bus developer instead of a distribution/end-user])],
+  [enable_developer=$enableval],
+  [enable_developer=no])
+
+dnl 'disable_developer' is the negation of 'enable_developer'. If
+dnl 'enable-developer' is set to 'no' (the default), the value of
+dnl 'disable_developer' is set to 'yes', and vice versa. It's used
+dnl for macros that require the opposite of 'enable_developer', such
+dnl as several AX_ macros.
+dnl See https://bugs.freedesktop.org/show_bug.cgi?id=97357
+AS_IF([test "x$enable_developer" = "xyes"],[
+    disable_developer=no
+  ],[
+    disable_developer=yes
+  ])
+
+# The debugging check must run before the compiler tests. Other command-line
+# options also use it to set their defaults. We disable debugging by default,
+# except for developer builds.
+AX_CHECK_ENABLE_DEBUG([$enable_developer])
+
 AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_CXX
@@ -71,8 +104,6 @@ AC_HEADER_STDC
 AC_C_INLINE
 AM_PROG_LIBTOOL
 AC_PROG_MKDIR_P
-COMPILER_COVERAGE
-COMPILER_OPTIMISATIONS
 PKG_PROG_PKG_CONFIG
 
 # TAP test driver support
@@ -120,10 +151,8 @@ if test "$dbus_win" = yes; then
     # Assume DBUS_VERSION is always three numbers
     BUILD_FILEVERSION=`echo "$DBUS_VERSION" | sed -e 's/\./,/g'`,0
     AC_SUBST(BUILD_FILEVERSION)
-    AC_CHECK_TOOL(WINDRES, windres, no)
-    if test "$WINDRES" = no; then
-      AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
-    fi
+    AS_IF([test -z "$RC"],
+        [AC_MSG_ERROR([An implementation of windres is required])])
     if test "$dbus_wince" = yes; then
       AC_DEFINE(DBUS_WINCE,1,[Defined if we run on a W32 CE API based system])
       AC_DEFINE(_WIN32_WCE, 0x0502, [Defined to get newer W32 CE APIs])
@@ -147,13 +176,6 @@ AM_CONDITIONAL(DBUS_WINCE, test "$dbus_wince" = yes)
 AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes)
 AM_CONDITIONAL(DBUS_CYGWIN, test "$dbus_cygwin" = yes)
 
-# this must come first: other options use this to set their defaults
-AC_ARG_ENABLE([developer],
-  [AS_HELP_STRING([--enable-developer],
-    [set defaults to be appropriate for a D-Bus developer instead of a distribution/end-user])],
-  [],
-  [enable_developer=no])
-
 DBUS_STATIC_BUILD_CPPFLAGS=
 if test "x$enable_shared" = xno; then
     # On Windows, linking against the static library requires special effort
@@ -174,7 +196,6 @@ AC_ARG_ENABLE([ducktype-docs],
               AS_HELP_STRING([--enable-ducktype-docs],
                              [build Ducktype documentation (requires Ducktype)]),
               [enable_ducktype_docs=$enableval], [enable_ducktype_docs=auto])
-AC_ARG_ENABLE(abstract-sockets, AS_HELP_STRING([--enable-abstract-sockets],[use abstract socket namespace (linux only)]),enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto)
 AC_ARG_ENABLE([apparmor],
   [AS_HELP_STRING([--enable-apparmor], [build with AppArmor support])],
@@ -186,8 +207,10 @@ AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue suppor
 AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
 AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
 AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)
+AC_ARG_ENABLE(kdbus-transport, AS_HELP_STRING([--enable-kdbus-transport],[build with kdbus transport support]),enable_kdbus_transport=$enableval,enable_kdbus_transport=no)
+AC_ARG_ENABLE(libdbuspolicy,[AS_HELP_STRING([--enable-libdbuspolicy],[enable libdbuspolicy for kdbus transport [default=no]])],,[enable_libdbuspolicy=no])
+AC_ARG_ENABLE(kdbus-sync-calls,[AS_HELP_STRING([--enable-kdbus-sync-calls],[enable native sync calls support for kdbus transport [default=no]])],,[enable_kdbus_sync_calls=no])
 
-AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
 AC_ARG_WITH(session-socket-dir, AS_HELP_STRING([--with-session-socket-dir=[dirname]],[Where to put sockets for the per-login-session message bus]))
 AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))
 AC_ARG_WITH(system-pid-file, AS_HELP_STRING([--with-system-pid-file=[pidfile]],[PID file for systemwide daemon]))
@@ -238,15 +261,22 @@ fi
 # default (unless you don't have GLib), because they don't bloat the library
 # or binaries.
 
-AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_36], [Ignore post-2.36 deprecations])
-AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_38], [Prevent post-2.38 APIs])
+dnl Don't do anything too subtle here, because the CMake build system
+dnl parses these lines with regular expressions. If necessary, adjust
+dnl cmake/modules/MacrosAutotools.cmake to compensate.
+AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_40], [Ignore post-2.40 deprecations])
+AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [G_ENCODE_VERSION(2,44)], [Prevent post-2.44 APIs])
 
 with_glib=yes
 
 AS_IF([test "x$enable_modular_tests" != xno],
   [
-  PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.36, gio-2.0 >= 2.36],
-    [],
+  PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.40, gio-2.0 >= 2.40],
+    [
+      AS_IF([test "x$dbus_unix" = xyes],
+        [PKG_CHECK_MODULES([GIO_UNIX], [gio-unix-2.0],
+           [AC_DEFINE([HAVE_GIO_UNIX], [1], [Define if you have gio-unix-2.0])], [])])
+    ],
     [if test "x$enable_modular_tests" = xyes; then
       AC_MSG_NOTICE([Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires GLib])
       AC_MSG_ERROR([$GLIB_ERRORS])
@@ -296,14 +326,31 @@ if test x$enable_verbose_mode = xyes; then
     AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
 fi
 
+dnl Intentional:
+dnl - $DISABLE_WARNINGS disables unused-label warnings if not
+dnl   checking or not asserting (tested further below)
+dnl - we are not going to stop using deprecated functions on a stable
+dnl   branch
+dnl - missing field initializers being 0 is a C feature, not a bug
+dnl - unused-parameter is to make writing callbacks less annoying
+dnl - cast-function-type is for the
+dnl   foreach(list, (DBusForeachFunction) free, NULL) idiom which would
+dnl   be too intrusive to replace in a stable branch
+DISABLE_WARNINGS="$DISABLE_WARNINGS
+                  -Wno-deprecated-declarations
+                  -Wno-missing-field-initializers
+                  -Wno-unused-parameter
+                  -Wno-cast-function-type"
+
 if test x$enable_asserts = xno; then
     AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
-    DISABLE_UNUSED_WARNINGS="unused-label"
+    DISABLE_WARNINGS="$DISABLE_WARNINGS -Wno-unused-label"
     R_DYNAMIC_LDFLAG=""
     if test x$enable_embedded_tests = xyes; then
-        DISABLE_UNUSED_WARNINGS="$DISABLE_UNUSED_WARNINGS \
-                unused-but-set-variable unused-variable \
-                unused-function"
+        DISABLE_WARNINGS="$DISABLE_WARNINGS
+                          -Wno-unused-but-set-variable
+                          -Wno-unused-variable
+                          -Wno-unused-function"
     fi
 else
     # -rdynamic is needed for glibc's backtrace_symbols to work.
@@ -321,7 +368,7 @@ AC_SUBST(R_DYNAMIC_LDFLAG)
 if test x$enable_checks = xno; then
     AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
     AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
-    DISABLE_UNUSED_WARNINGS="unused-label"
+    DISABLE_WARNINGS="$DISABLE_WARNINGS -Wno-unused-label"
 fi
 
 AH_BOTTOM([
@@ -333,35 +380,14 @@ AH_BOTTOM([
 #  define DBUS_ENABLE_CHECKS 1
 #endif])
 
-if test x$enable_compiler_coverage = xyes; then
-     ## so that config.h changes when you toggle gcov support
-     AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
-fi
-
-# glibc21.m4 serial 3
-dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-# Test for the GNU C Library, version 2.1 or newer.
-# From Bruno Haible.
+# Test for code-coverage tools if --enable-code-coverage
+AX_CODE_COVERAGE
 
-AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
-  ac_cv_gnu_library_2_1,
-  [AC_EGREP_CPP([Lucky GNU user],
-    [
-#include <features.h>
-#ifdef __GNU_LIBRARY__
- #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
-  Lucky GNU user
- #endif
-#endif
-    ],
-    ac_cv_gnu_library_2_1=yes,
-    ac_cv_gnu_library_2_1=no)
-  ]
-)
+AS_IF([test x$enable_code_coverage = xyes],[
+    AC_DEFINE_UNQUOTED(
+      [DBUS_GCOV_ENABLED], [1],
+      [Defined if gcov is enabled to force a rebuild due to config.h changing])
+  ])
 
 #### Integer sizes
 
@@ -381,32 +407,21 @@ $ac_cv_sizeof_int)
   dbusint64=int
   dbusint64_constant='(val)'
   dbusuint64_constant='(val)'
-  dbusint64_printf_modifier='""'
   ;;
 $ac_cv_sizeof_long)
   dbusint64=long
   dbusint64_constant='(val##L)'
   dbusuint64_constant='(val##UL)'
-  dbusint64_printf_modifier='"l"'
   ;;
 $ac_cv_sizeof_long_long)
   dbusint64='long long'
   dbusint64_constant='(val##LL)'
   dbusuint64_constant='(val##ULL)'
-  # Ideally we discover what the format is, but this is
-  # only used in verbose mode, so eh...
-  if test x"$ac_cv_gnu_library_2_1" = xyes; then
-    dbusint64_printf_modifier='"ll"'
-  fi
   ;;
 $ac_cv_sizeof___int64)
   dbusint64=__int64
   dbusint64_constant='(val##i64)'
   dbusuint64_constant='(val##ui64)'
-  # See above case
-  if test x"$ac_cv_gnu_library_2_1" = xyes; then
-    dbusint64_printf_modifier='"ll"'
-  fi
   ;;
 esac
 
@@ -424,9 +439,6 @@ Please report a bug here with details of your platform and compiler:
         DBUS_INT64_TYPE="$dbusint64"
         DBUS_INT64_CONSTANT="$dbusint64_constant"
         DBUS_UINT64_CONSTANT="$dbusuint64_constant"
-       if test x"$dbusint64_printf_modifier" != x; then
-               AC_DEFINE_UNQUOTED(DBUS_INT64_PRINTF_MODIFIER, [$dbusint64_printf_modifier], [Define to printf modifier for 64 bit integer type])
-       fi
         AC_MSG_RESULT($DBUS_INT64_TYPE)
   ])
 
@@ -498,6 +510,10 @@ case $host_os in
                ;;
 esac
 
+# As a GNU extension, glibc declares environ in unistd.h, which is one of
+# the AC_INCLUDES_DEFAULT.
+AC_CHECK_DECLS([environ])
+
 dnl **********************************
 dnl *** va_copy checks (from GLib) ***
 dnl **********************************
@@ -606,7 +622,7 @@ AC_DEFINE_UNQUOTED([DBUS_USE_SYNC], [$have_sync], [Use the gcc __sync extension]
 AC_SEARCH_LIBS(socket,[socket network])
 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
 
-AC_CHECK_FUNCS([vsnprintf vasprintf nanosleep usleep setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit poll setlocale localeconv strtoll strtoull issetugid getresuid setresuid getrlimit])
+AC_CHECK_FUNCS([vsnprintf vasprintf nanosleep usleep setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit poll setlocale localeconv strtoll strtoull issetugid getresuid setresuid getrlimit prlimit])
 
 AC_CHECK_HEADERS([syslog.h])
 if test "x$ac_cv_header_syslog_h" = "xyes"; then
@@ -617,34 +633,6 @@ fi
 AC_CHECK_HEADERS_ONCE([sys/prctl.h])
 AC_CHECK_FUNCS_ONCE([prctl raise])
 
-#### Check for broken poll; taken from Glib's configure
-
-AC_MSG_CHECKING([for broken poll])
-AC_RUN_IFELSE([AC_LANG_SOURCE([[
-    #include <stdlib.h>
-    #include <fcntl.h>
-    #include <poll.h>
-    #ifdef HAVE_SYS_POLL_H
-    #include <sys/poll.h>
-    #endif
-    int main(void) {
-      struct pollfd fds[1];
-      int fd;
-      fd = open("/dev/null", 1);
-      fds[0].fd = fd;
-      fds[0].events = POLLIN;
-      fds[0].revents = 0;
-      if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
-            exit(1);  /* Does not work for devices -- fail */
-      }
-      exit(0);
-    }]])],
-  [broken_poll=no],
-  [broken_poll=yes
-   AC_DEFINE(BROKEN_POLL,1,[poll doesn't work on devices])],
-  [broken_poll="no (cross compiling)"])
-AC_MSG_RESULT($broken_poll)
-
 AC_MSG_CHECKING(for dirfd)
 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
 #include <sys/types.h>
@@ -681,6 +669,7 @@ closedir(dirp);
 fi
 
 AC_CHECK_HEADERS(sys/resource.h)
+AC_CHECK_HEADERS([sys/time.h])
 
 AC_CHECK_HEADERS(dirent.h)
 
@@ -844,99 +833,15 @@ AC_CHECK_FUNCS(getpeerucred getpeereid)
 
 AC_CHECK_FUNCS(pipe2 accept4)
 
-#### Abstract sockets
+PKG_CHECK_MODULES([EXPAT], [expat])
 
-if test x$enable_abstract_sockets = xauto; then
-AC_LANG_PUSH(C)
-warn_on_xcompile=no
-AC_CACHE_CHECK([abstract socket namespace],
-               ac_cv_have_abstract_sockets,
-               [AC_RUN_IFELSE([AC_LANG_PROGRAM(
-[[
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <errno.h>
-]],
-[[
-  size_t slen;
-  int listen_fd;
-  struct sockaddr_un addr;
-
-  listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
-
-  if (listen_fd < 0)
-    {
-      fprintf (stderr, "socket() failed: %s\n", strerror (errno));
-      exit (1);
-    }
-
-  memset (&addr, '\0', sizeof (addr));
-  addr.sun_family = AF_UNIX;
-  strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
-  /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the
-   * beginning.
-   */
-  slen = SUN_LEN(&addr);
-  addr.sun_path[0] = '\0'; /* this is what makes it abstract */
-
-  if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
-    {
-       fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
-                strerror (errno));
-       exit (1);
-    }
-  else
-    exit (0);
-]])],
-              [ac_cv_have_abstract_sockets=yes],
-              [ac_cv_have_abstract_sockets=no],
-              [
-                ac_cv_have_abstract_sockets=no
-                warn_on_xcompile=yes
-              ]
-)])
-if test x$warn_on_xcompile = xyes ; then
-  AC_MSG_WARN([Cannot check for abstract sockets when cross-compiling, please use --enable-abstract-sockets])
-fi
-AC_LANG_POP(C)
-fi
-
-if test x$enable_abstract_sockets = xyes; then
-    if test x$ac_cv_have_abstract_sockets = xno; then
-       AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
-    fi
-fi
-
-if test x$enable_abstract_sockets = xno; then
-   ac_cv_have_abstract_sockets=no;
-fi
-
-if test x$ac_cv_have_abstract_sockets = xyes ; then
-   DBUS_PATH_OR_ABSTRACT=abstract
-   AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
-else
-   DBUS_PATH_OR_ABSTRACT=path
-fi
-
-# this is used in addresses to prefer abstract, e.g.
-# unix:path=/foo or unix:abstract=/foo
-AC_SUBST(DBUS_PATH_OR_ABSTRACT)
-
-#### Sort out XML library
-
-AC_CHECK_LIB(expat, XML_ParserCreate_MM,
-             [ AC_CHECK_HEADERS(expat.h, [],
-                                [AC_MSG_ERROR([Could not find expat.h, check config.log for failed attempts])]) ],
-             [ AC_MSG_ERROR([Explicitly requested expat but expat not found]) ])
-
-XML_LIBS=-lexpat
-XML_CFLAGS=
-AC_SUBST([XML_CFLAGS])
-AC_SUBST([XML_LIBS])
+save_cflags="$CFLAGS"
+save_libs="$LIBS"
+CFLAGS="$CFLAGS $EXPAT_CFLAGS"
+LIBS="$LIBS $EXPAT_LIBS"
+AC_CHECK_FUNCS([XML_SetHashSalt])
+CFLAGS="$save_cflags"
+LIBS="$save_libs"
 
 # Thread lib detection
 AC_ARG_VAR([THREAD_LIBS])
@@ -1014,21 +919,8 @@ if test x$enable_selinux = xno ; then
     have_selinux=no;
 else
     # See if we have SELinux library
-    AC_CHECK_LIB(selinux, is_selinux_enabled,
-                 have_selinux=yes, have_selinux=no)
-
-    # see if we have the SELinux header with the new D-Bus stuff in it
-    if test x$have_selinux = xyes ; then
-        AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
-        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <selinux/av_permissions.h>]],
-                          [[#ifdef DBUS__ACQUIRE_SVC return 0;
-                           #else
-                           #error DBUS__ACQUIRE_SVC not defined
-                           #endif]])],
-                          [have_selinux=yes],
-                          [have_selinux=no])
-       AC_MSG_RESULT($have_selinux)
-    fi
+    PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0.86],
+                 [have_selinux=yes], [have_selinux=no])
 
     if test x$enable_selinux = xauto ; then
         if test x$have_selinux = xno ; then
@@ -1049,7 +941,7 @@ if test x$have_selinux = xyes ; then
     AC_CHECK_FUNC(pthread_create,,[AC_CHECK_LIB(pthread,pthread_create,
                                                 [SELINUX_THREAD_LIBS="-lpthread"])])
 
-    SELINUX_LIBS="-lselinux $SELINUX_THREAD_LIBS"
+    SELINUX_LIBS="$SELINUX_LIBS $SELINUX_THREAD_LIBS"
     AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
 else
     SELINUX_LIBS=
@@ -1061,6 +953,8 @@ AS_IF([test x$enable_apparmor = xno],
   [
   PKG_CHECK_MODULES([APPARMOR], [libapparmor >= 2.8.95],
                     [have_apparmor=yes], [have_apparmor=no])
+  PKG_CHECK_MODULES([APPARMOR_2_10], [libapparmor >= 2.10],
+                    [have_apparmor_2_10=yes], [have_apparmor_2_10=no])
 
   AS_IF([test x$enable_apparmor = xauto && test x$have_apparmor = xno],
         [AC_MSG_WARN([Sufficiently new AppArmor library not found])])
@@ -1070,6 +964,9 @@ AS_IF([test x$enable_apparmor = xno],
 
 AS_IF([test x$have_apparmor = xyes],
       [AC_DEFINE([HAVE_APPARMOR], [1], [AppArmor Support])])
+AS_IF([test x$have_apparmor_2_10 = xyes],
+      [AC_DEFINE([HAVE_APPARMOR_2_10], [1],
+                 [Define if libapparmor is version 2.10 or later])])
 
 # inotify checks
 if test x$enable_inotify = xno ; then
@@ -1268,7 +1165,7 @@ if test x$dbus_win = xyes ; then
   if test x$dbus_wince = xyes ; then
     NETWORK_libs="-lws2"
   else
-    NETWORK_libs="-lws2_32 -liphlpapi"
+    NETWORK_libs="-lws2_32 -liphlpapi -ldbghelp"
   fi
 fi
 
@@ -1289,8 +1186,28 @@ if test x$with_valgrind != xno; then
   AC_DEFINE([WITH_VALGRIND], [1], [Define to add Valgrind instrumentation])
 fi
 
+### kdbus support
+if test x$enable_kdbus_transport = xyes; then
+    AC_DEFINE(ENABLE_KDBUS_TRANSPORT,1,[Enable kdbus transport support])
+fi
+AM_CONDITIONAL([ENABLE_KDBUS_TRANSPORT], [test x$enable_kdbus_transport = xyes])
+
+if test x$enable_kdbus_sync_calls = xyes; then
+    AC_DEFINE(ENABLE_KDBUS_SYNC_CALLS,1,[Enable kdbus sync calls support])
+fi
+
+AC_MSG_CHECKING([whether to enable libdbuspolicy for kdbus transport])
+AM_CONDITIONAL(LIBDBUSPOLICY, [test "x$enable_libdbuspolicy" = "xyes"])
+AS_IF([test "x$enable_libdbuspolicy" = "xyes"], [
+  PKG_CHECK_MODULES(LIBDBUSPOLICY1, libdbuspolicy1 >= 1)
+  AC_SUBST(LIBDBUSPOLICY1_CFLAGS)
+  AC_SUBST(LIBDBUSPOLICY1_LIBS)
+  AC_DEFINE(LIBDBUSPOLICY, 1, [Whether to enable libdbuspolicy for kdbus transport])
+  AC_MSG_RESULT([yes])
+], [ AC_MSG_RESULT([no]) ])
+
 #### Set up final flags
-LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS"
+LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS $KDBUS_LIBS"
 AC_SUBST([LIBDBUS_LIBS])
 
 ### X11 detection
@@ -1342,82 +1259,49 @@ AM_CONDITIONAL([DBUS_ENABLE_X11_AUTOLAUNCH],
 AC_SUBST([DBUS_X_CFLAGS])
 AC_SUBST([DBUS_X_LIBS])
 
-#### gcc warning flags
-
-cc_supports_flag() {
-  AC_MSG_CHECKING(whether $CC supports "$*")
-  save_CFLAGS="$CFLAGS"
-  CFLAGS="$*"
-  AC_TRY_COMPILE([], [], [rc=yes], [rc=no])
-  CFLAGS="$save_CFLAGS"
-  AC_MSG_RESULT([$rc])
-  test "x$rc" = xyes
-}
-
-TP_COMPILER_WARNINGS([WARNING_CFLAGS],
-  dnl Use -Werror by default if:
-  dnl - we're not on Windows (too many warnings), and
-  dnl - we're in developer mode (a D-Bus developer, not a distro or end-user)
-  dnl Override with --enable-Werror or --disable-Werror
-  [test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$enable_developer = xyes],
-
-  dnl Enable these warnings if possible:
-  [all \
-   extra \
-   char-subscripts \
-   missing-declarations \
-   missing-prototypes \
-   nested-externs \
-   pointer-arith \
-   cast-align \
-   no-address \
-   float-equal \
-   declaration-after-statement \
-  ],
+# We're treating -fno-common like a warning: it makes the linker more
+# strict, because on some systems the linker is *always* this strict
+TEST_CFLAGS="$TEST_CFLAGS -fno-common"
 
-  dnl Disable these warnings if possible, make them non-fatal if possible,
-  dnl and don't enable -Werror unless we succeeded.
-  dnl
-  dnl Intentional:
-  dnl - $DISABLE_UNUSED_WARNINGS disables unused-label warnings if not
-  dnl   checking or not asserting
-  dnl - missing field initializers being 0 is a C feature, not a bug
-  dnl - unused-parameter is to make writing callbacks less annoying
-  dnl - misleading-indentation is disabled for this stable branch because
-  dnl   gcc can't cope with inconsistent tab/space indentation
-  dnl
-  dnl To be fixed one day:
-  dnl - pointer-sign is a workaround for fd.o #15522
-  dnl - type-limits is probably a bug too, but having the rest of -Wextra
-  dnl   is better than nothing
-  [$DISABLE_UNUSED_WARNINGS \
-   deprecated-declarations \
-   missing-field-initializers \
-   misleading-indentation \
-   unused-parameter \
-   pointer-sign \
-   type-limits \
+AS_IF([test "x$enable_ansi" = "xyes"],[
+    TEST_CFLAGS="$TEST_CFLAGS -ansi -pedantic"
+    AC_DEFINE([_POSIX_C_SOURCE],[199309L],[Define to enable POSIX features])
+    AC_DEFINE([_BSD_SOURCE],[1],[Define to enable BSD features])
   ])
 
-if test "x$GCC" = "xyes"; then
-  # We're treating -fno-common like a warning: it makes the linker more
-  # strict, because on some systems the linker is *always* this strict
-  TP_ADD_COMPILER_FLAG([WARNING_CFLAGS], [-fno-common])
-
-  # http://bugs.freedesktop.org/show_bug.cgi?id=10599
-  TP_ADD_COMPILER_FLAG([WARNING_CFLAGS], [-fno-strict-aliasing])
-
-  if test "x$enable_ansi" = "xyes"; then
-    TP_ADD_COMPILER_FLAG([WARNING_CFLAGS],
-      [-ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic])
-  fi
-fi
-
-dnl In principle we should put WARNING_CFLAGS in each Makefile.am like
+dnl We are only calling this for its side-effect of setting up
+dnl --enable-compile-warnings; the WARN_CFLAGS, etc. are ignored,
+dnl to work around https://github.com/peti/autoconf-archive/pull/96
+AX_COMPILER_FLAGS([], [], [$disable_developer])
+
+dnl Work around https://github.com/peti/autoconf-archive/pull/96 by using
+dnl a non-default variable name here (in particular there is no way to tell
+dnl AX_COMPILER_FLAGS to not use WARN_CXXFLAGS)
+AX_COMPILER_FLAGS_CFLAGS([EXTRA_CFLAGS],
+                         [$disable_developer],
+                         [$TEST_CFLAGS],
+                         [-Wchar-subscripts \
+                          -Wfloat-equal \
+                          -Wpointer-sign \
+                          $DISABLE_WARNINGS])
+dnl cc1plus: warning: command line option ‘-Wpointer-sign’ is valid for
+dnl C/ObjC but not for C++
+AX_COMPILER_FLAGS_CXXFLAGS([EXTRA_CXXFLAGS],
+                           [$disable_developer],
+                           [],
+                           [-Wchar-subscripts \
+                            -Wfloat-equal \
+                            $DISABLE_WARNINGS])
+AX_COMPILER_FLAGS_LDFLAGS([EXTRA_LDFLAGS],
+                          [$disable_developer])
+
+dnl TODO: In principle we should put EXTRA_CFLAGS in each Makefile.am like
 dnl telepathy-glib does, since CFLAGS is meant to be reserved for the user...
 dnl but prepending to CFLAGS (so the user can override it with later CFLAGS)
-dnl is the next best thing
-CFLAGS="$WARNING_CFLAGS $CFLAGS"
+dnl is the next best thing.
+CFLAGS="$EXTRA_CFLAGS $CFLAGS"
+CXXFLAGS="$EXTRA_CXXFLAGS $CXXFLAGS"
+LDFLAGS="$EXTRA_LDFLAGS $LDFLAGS"
 
 case $host_os in
     solaris*)
@@ -1530,6 +1414,11 @@ AM_CONDITIONAL(DBUS_CAN_UPLOAD_DOCS,
     [test x$enable_doxygen_docs = xyes && test x$enable_xml_docs = xyes &&
      test x$enable_ducktype_docs = xyes])
 
+# Autoconf 2.70 will support this, and many distros patch this option in,
+# but Autoconf 2.70 hasn't actually been released yet.
+AS_IF([test -z "${runstatedir}"], [runstatedir='${localstatedir}/run'])
+AC_SUBST([runstatedir])
+
 #### Have to go $localstatedir->$prefix/var->/usr/local/var
 
 #### find the actual value for $prefix that we'll end up with
@@ -1542,35 +1431,7 @@ AS_AC_EXPAND(EXPANDED_BINDIR, "$bindir")
 AS_AC_EXPAND(EXPANDED_LIBDIR, "$libdir")
 AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
 AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
-
-#### Check our operating system
-operating_system=unknown
-if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
-   operating_system=redhat
-fi
-
-if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
-   operating_system=slackware
-fi
-
-if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
-   operating_system=cygwin
-fi
-
-#### Sort out init scripts
-
-if test x$with_init_scripts = x; then
-    case x$operating_system in
-        xredhat)       with_init_scripts=redhat ;;
-        xslackware)    with_init_scripts=slackware ;;
-        xcygwin)       with_init_scripts=cygwin ;;
-        *)                     with_init_scripts=none ;;
-    esac
-fi
-
-AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
-AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
-AM_CONDITIONAL(DBUS_INIT_SCRIPTS_CYGWIN, test x$with_init_scripts = xcygwin)
+AS_AC_EXPAND(EXPANDED_RUNSTATEDIR, "$runstatedir")
 
 ##### systemd unit files
 AC_ARG_WITH([systemdsystemunitdir],
@@ -1600,6 +1461,9 @@ AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
 if ! test -z "$with_system_socket"; then
    DBUS_SYSTEM_SOCKET=$with_system_socket
 else
+   # We don't use runstatedir for this (yet?), because /var/run has been the
+   # interoperable system bus socket for 10+ years.
+   # See https://bugs.freedesktop.org/show_bug.cgi?id=101628
    DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
 fi
 
@@ -1617,30 +1481,28 @@ AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the soc
 ## and also to connect to. If this ever changes, it'll need to be split into
 ## two variables, one for the listening address and one for the connecting
 ## address.
-DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
+kdbus_address_path=""
+if test x$enable_kdbus_transport = xyes; then
+   kdbus_address_path="kernel:path=/sys/fs/kdbus/0-system/bus;"
+fi
+DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="${kdbus_address_path}unix:path=$DBUS_SYSTEM_SOCKET"
 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-Bus address of the system bus])
 
 #### Set up the pid file
 if ! test -z "$with_system_pid_file"; then
    DBUS_SYSTEM_PID_FILE=$with_system_pid_file
-elif test x$with_init_scripts = xredhat ; then
-   DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
 else
-   DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
+   DBUS_SYSTEM_PID_FILE="${EXPANDED_RUNSTATEDIR}/dbus/pid"
 fi
 
 AC_SUBST(DBUS_SYSTEM_PID_FILE)
 
 #### Directory to check for console ownership
-if ! test -z "$with_console_auth_dir"; then
-   DBUS_CONSOLE_AUTH_DIR=$with_console_auth_dir
-else
-   DBUS_CONSOLE_AUTH_DIR=/var/run/console/
-fi
-
-AC_SUBST(DBUS_CONSOLE_AUTH_DIR)
-AC_DEFINE_UNQUOTED(DBUS_CONSOLE_AUTH_DIR, "$DBUS_CONSOLE_AUTH_DIR", [Directory to check for console ownerhip])
+AS_IF([test -n "$with_console_auth_dir" && test "x$with_console_auth_dir" != xno],
+    [AC_DEFINE_UNQUOTED([DBUS_CONSOLE_AUTH_DIR], ["$with_console_auth_dir"],
+        [Directory to check for pam_console/pam_foreground flag files, or undefined])],
+    [with_console_auth_dir=])
 
 #### File to check for console ownership
 if test x$have_console_owner_file = xyes; then
@@ -1685,7 +1547,7 @@ AC_DEFINE_UNQUOTED(DBUS_DATADIR,"$DBUS_DATADIR", [Directory for installing DBUS
 #### Directory to install dbus-daemon
 if test -z "$with_dbus_daemondir" ; then
     DBUS_DAEMONDIR=$EXPANDED_BINDIR
-    dbus_daemondir='$bindir'
+    dbus_daemondir='${bindir}'
 else
     DBUS_DAEMONDIR=$with_dbus_daemondir
     dbus_daemondir=$with_dbus_daemondir
@@ -1704,6 +1566,45 @@ DBUS_LIBEXECDIR="$EXPANDED_LIBEXECDIR"
 AC_SUBST(DBUS_LIBEXECDIR)
 AC_DEFINE_UNQUOTED(DBUS_LIBEXECDIR,"$DBUS_LIBEXECDIR", [Directory for installing the libexec binaries])
 
+AC_ARG_ENABLE([relocation],
+  [AS_HELP_STRING([--enable-relocation[=yes/no/auto]],
+    [Make pkg-config metadata relocatable [default=auto]])],
+  [], [enable_relocation=auto])
+
+can_relocate=yes
+
+AS_CASE(["${exec_prefix}"],
+  ['NONE'|'${prefix}'],
+    [:],
+  [*],
+    [can_relocate=no])
+
+AS_CASE(["${libdir}"],
+  ['${prefix}/lib'|'${prefix}/lib64'|'${exec_prefix}/lib'|'${exec_prefix}/lib64'],
+    [:],
+  [*],
+    [can_relocate=no])
+
+# If the user said --enable-relocation but we can't do it, error out
+AS_IF([test "x$can_relocate" = xno && test "x$enable_relocation" = xyes],
+  [AC_MSG_ERROR([Relocatable pkg-config metadata requires --exec-prefix='\${prefix}' and the default libdir])])
+
+# By default, on Windows we are relocatable if possible
+AS_IF([test "x$enable_relocation" = xauto && test "x$dbus_win" = xyes],
+  [enable_relocation="$can_relocate"])
+
+# By default, on non-Windows we are not relocatable because it can interfere
+# with pkg-config's ability to filter out system include directories,
+# resulting in linking an outdated system-wide library in preference to a
+# newer version installed elsewhere
+AS_IF([test "x$enable_relocation" = xauto],
+  [enable_relocation="no"])
+
+
+AS_IF([test "x$enable_relocation" = xyes],
+  [AC_SUBST([pkgconfig_prefix], ['${pcfiledir}/../../'])],
+  [AC_SUBST([pkgconfig_prefix], ['${original_prefix}'])])
+
 #### Directory to source sysconfdir configuration from
 
 # On Windows this is relative to where we put the bus setup, in
@@ -1734,14 +1635,9 @@ DBUS_TEST_DATA="$DBUS_PWD/test/data"
 AC_SUBST([DBUS_TEST_DATA])
 AC_SUBST([DBUS_TEST_EXEC])
 
-AC_DEFINE_UNQUOTED([DBUS_TEST_EXEC], ["$DBUS_TEST_EXEC"],
-                   [Full path to the daemon in the builddir])
 AC_DEFINE_UNQUOTED([DBUS_EXEEXT], ["$EXEEXT"],
                    [Extension for executables, typically empty or .exe])
 
-AC_DEFINE_UNQUOTED(TEST_BUS_LAUNCH_BINARY, ["$DBUS_PWD/tools/dbus-launch$EXEEXT"],
-                   [Full path to the dbus-launch in the builddir])
-
 ## Export the non-setuid external helper
 TEST_LAUNCH_HELPER_BINARY="$DBUS_PWD/bus/dbus-daemon-launch-helper-test$EXEEXT"
 AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
@@ -1873,6 +1769,19 @@ AC_ARG_ENABLE([user-session],
 AM_CONDITIONAL([DBUS_ENABLE_USER_SESSION],
   [test "x$enable_user_session" = xyes])
 
+
+#enable cynara integration
+AC_ARG_ENABLE([cynara], [AS_HELP_STRING([--enable-cynara], [enable Cynara integration])], [], [enable_cynara=no])
+if test "x$enable_cynara" = xyes; then
+  PKG_CHECK_MODULES([CYNARA], [cynara-client-async >= 0.4.2 cynara-session >= 0.4.2],
+     [AC_DEFINE([DBUS_ENABLE_CYNARA], [1], [Define to enable Cynara privilege checks in dbus-daemon])],
+     [AC_MSG_ERROR([libcynara-client-async and cynara-session are required to enable Cynara integration])])
+fi
+
+AC_SUBST([CYNARA_CFLAGS])
+AC_SUBST([CYNARA_LIBS])
+
+
 AC_CONFIG_FILES([
 Doxyfile
 dbus/Version
@@ -1884,14 +1793,13 @@ bus/legacy-config/system.conf
 bus/legacy-config/session.conf
 bus/example-system-enable-stats.conf
 bus/example-session-disable-stats.conf
-bus/messagebus
-bus/messagebus-config
 bus/org.freedesktop.dbus-session.plist
-bus/rc.messagebus
 bus/dbus.service
 bus/dbus.socket
 bus/systemd-user/dbus.service
 bus/systemd-user/dbus.socket
+bus/sysusers.d/dbus.conf
+bus/tmpfiles.d/dbus.conf
 Makefile
 dbus/Makefile
 bus/Makefile
@@ -1910,6 +1818,27 @@ doc/dbus-update-activation-environment.1.xml
 doc/dbus-uuidgen.1.xml
 dbus-1.pc
 dbus-1-uninstalled.pc
+test/data/valid-config-files/debug-allow-all.conf
+test/data/valid-config-files/debug-allow-all-sha1.conf
+test/data/valid-config-files/debug-check-some.conf
+test/data/valid-config-files/incoming-limit.conf
+test/data/valid-config-files-system/debug-allow-all-pass.conf
+test/data/valid-config-files-system/debug-allow-all-fail.conf
+test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service
+test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service
+test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service
+test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service
+test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
+test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
+test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service
+test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service
+test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
+test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
+test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service
+test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service
+test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service
+cmake/DBus1Config.cmake:cmake/DBus1Config.pkgconfig.in
+cmake/DBus1ConfigVersion.cmake
 ])
 AC_OUTPUT
 
@@ -1925,12 +1854,14 @@ echo "
         bindir:                   ${EXPANDED_BINDIR}
         sysconfdir:               ${EXPANDED_SYSCONFDIR}
         localstatedir:            ${EXPANDED_LOCALSTATEDIR}
+        runstatedir:              ${EXPANDED_RUNSTATEDIR}
        datadir:                  ${EXPANDED_DATADIR}
        source code location:     ${srcdir}
        compiler:                 ${CC}
        cflags:                   ${CFLAGS}
        cppflags:                 ${CPPFLAGS}
        cxxflags:                 ${CXXFLAGS}
+       ldflags:                  ${LDFLAGS}
        64-bit int:               ${DBUS_INT64_TYPE}
        32-bit int:               ${DBUS_INT32_TYPE}
        16-bit int:               ${DBUS_INT16_TYPE}
@@ -1941,7 +1872,7 @@ echo "
 
 echo "
         Rebuilding generated files: ${USE_MAINTAINER_MODE}
-        gcc coverage profiling:   ${enable_compiler_coverage}
+        gcc coverage profiling:   ${enable_code_coverage}
         Building embedded tests:  ${enable_embedded_tests}
         Building modular tests:   ${enable_modular_tests}
             - with GLib:          ${with_glib}
@@ -1960,6 +1891,9 @@ echo "
         Building Ducktype docs:   ${enable_ducktype_docs}
         Building XML docs:        ${enable_xml_docs}
         Building launchd support: ${have_launchd}
+        Building kdbus support:   ${enable_kdbus_transport}
+          with libdbuspolicy:     ${enable_libdbuspolicy}
+          with sync calls:        ${enable_kdbus_sync_calls}
         Init scripts style:       ${with_init_scripts}
         Abstract socket names:    ${ac_cv_have_abstract_sockets}
         System bus socket:        ${DBUS_SYSTEM_SOCKET}
@@ -1967,7 +1901,7 @@ echo "
         System bus PID file:      ${DBUS_SYSTEM_PID_FILE}
         Session bus listens on:   ${DBUS_SESSION_BUS_LISTEN_ADDRESS}
         Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS}
-        Console auth dir:         ${DBUS_CONSOLE_AUTH_DIR}
+        pam_console auth dir:     ${with_console_auth_dir:-(none)}
         Console owner file:       ${have_console_owner_file}
         Console owner file path:  ${DBUS_CONSOLE_OWNER_FILE}
        System bus user:          ${DBUS_USER}
@@ -1985,9 +1919,9 @@ fi
 if test x$enable_embedded_tests = xyes -a x$enable_asserts = xno; then
         echo "NOTE: building with embedded tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
 fi
-if test x$enable_compiler_coverage = xyes; then
-        echo "NOTE: building with coverage profiling is definitely for developers only."
-fi
+AS_IF([test x$enable_code_coverage = xyes],[
+    AC_MSG_WARN([Building with coverage profiling is definitely for developers only.])
+  ])
 if test x$enable_verbose_mode = xyes; then
         echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
 fi