BUS_RESULT: fix missed changes of TRUE/FALSE to BUS_RESULT
[platform/upstream/dbus.git] / configure.ac
index cdcad36..e7d8d38 100644 (file)
@@ -2,15 +2,15 @@ dnl -*- mode: m4 -*-
 AC_PREREQ([2.63])
 
 m4_define([dbus_major_version], [1])
-m4_define([dbus_minor_version], [11])
-m4_define([dbus_micro_version], [7])
+m4_define([dbus_minor_version], [12])
+m4_define([dbus_micro_version], [16])
 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_],
+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
@@ -38,16 +38,16 @@ AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable])
 #
 
 ## increment if the interface has additions, changes, removals.
-LT_CURRENT=19
+LT_CURRENT=22
 
 ## increment any time the source changes; set to
 ##  0 if you increment CURRENT
-LT_REVISION=2
+LT_REVISION=11
 
 ## 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=16
+LT_AGE=19
 
 AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
@@ -151,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])
@@ -198,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])],
@@ -210,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]))
@@ -262,14 +261,17 @@ 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],
@@ -327,11 +329,18 @@ 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-unused-parameter
+                  -Wno-cast-function-type"
 
 if test x$enable_asserts = xno; then
     AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
@@ -613,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
@@ -624,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>
@@ -688,6 +669,7 @@ closedir(dirp);
 fi
 
 AC_CHECK_HEADERS(sys/resource.h)
+AC_CHECK_HEADERS([sys/time.h])
 
 AC_CHECK_HEADERS(dirent.h)
 
@@ -851,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])
@@ -1021,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
@@ -1056,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=
@@ -1066,8 +951,10 @@ fi
 AS_IF([test x$enable_apparmor = xno],
   [have_apparmor=no],
   [
-  PKG_CHECK_MODULES([APPARMOR], [libapparmor >= 2.10],
+  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])])
@@ -1077,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
@@ -1296,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
@@ -1359,14 +1269,6 @@ AS_IF([test "x$enable_ansi" = "xyes"],[
     AC_DEFINE([_BSD_SOURCE],[1],[Define to enable BSD features])
   ])
 
-dnl TODO: The compiler flags below disable warnings that the
-dnl       compiler emits while building dbus. Fix the source
-dnl       code and remove these flags.
-DISABLE_WARNINGS="$DISABLE_WARNINGS
-                  -Wno-switch-default
-                  -Wno-switch-enum
-                  "
-
 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
@@ -1512,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
@@ -1524,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],
@@ -1582,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
 
@@ -1599,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
@@ -1667,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
@@ -1686,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
@@ -1716,8 +1635,6 @@ 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])
 
@@ -1852,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
@@ -1863,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
@@ -1889,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
 
@@ -1904,6 +1854,7 @@ echo "
         bindir:                   ${EXPANDED_BINDIR}
         sysconfdir:               ${EXPANDED_SYSCONFDIR}
         localstatedir:            ${EXPANDED_LOCALSTATEDIR}
+        runstatedir:              ${EXPANDED_RUNSTATEDIR}
        datadir:                  ${EXPANDED_DATADIR}
        source code location:     ${srcdir}
        compiler:                 ${CC}
@@ -1940,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}
@@ -1947,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}