AC_PREREQ([2.63])
m4_define([dbus_major_version], [1])
-m4_define([dbus_minor_version], [11])
-m4_define([dbus_micro_version], [17])
+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_],
+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
#
## increment if the interface has additions, changes, removals.
-LT_CURRENT=21
+LT_CURRENT=22
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=0
+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=18
+LT_AGE=19
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
# 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])
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])],
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]))
# default (unless you don't have GLib), because they don't bloat the library
# or binaries.
+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], [GLIB_VERSION_2_40], [Prevent post-2.40 APIs])
+AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [G_ENCODE_VERSION(2,44)], [Prevent post-2.44 APIs])
with_glib=yes
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])
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
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>
fi
AC_CHECK_HEADERS(sys/resource.h)
+AC_CHECK_HEADERS([sys/time.h])
AC_CHECK_HEADERS(dirent.h)
AC_CHECK_FUNCS(pipe2 accept4)
-#### Abstract sockets
-
-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)
-
PKG_CHECK_MODULES([EXPAT], [expat])
save_cflags="$CFLAGS"
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
AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
AS_AC_EXPAND(EXPANDED_RUNSTATEDIR, "$runstatedir")
-#### 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)
-
##### systemd unit files
AC_ARG_WITH([systemdsystemunitdir],
AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
## 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_RUNSTATEDIR}/messagebus.pid"
else
DBUS_SYSTEM_PID_FILE="${EXPANDED_RUNSTATEDIR}/dbus/pid"
fi
#### 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
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
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
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
])
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}