4 m4_define([dbus_major_version], [1])
5 m4_define([dbus_minor_version], [10])
6 m4_define([dbus_micro_version], [6])
7 m4_define([dbus_version],
8 [dbus_major_version.dbus_minor_version.dbus_micro_version])
9 AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus])
10 AC_CONFIG_AUX_DIR([build-aux])
14 AC_CONFIG_HEADERS([config.h])
15 AC_CONFIG_MACRO_DIR([m4])
17 AM_INIT_AUTOMAKE([1.13 tar-ustar -Wno-portability subdir-objects])
19 GETTEXT_PACKAGE=dbus-1
20 AC_SUBST(GETTEXT_PACKAGE)
21 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
23 # By default, rebuild autotools files on demand; only use ./missing if the
24 # user says --disable-maintainer-mode (some distributions like to do this)
25 AM_MAINTAINER_MODE([enable])
27 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
29 AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable])
31 # libtool versioning - this applies to libdbus
33 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
36 ## increment if the interface has additions, changes, removals.
39 ## increment any time the source changes; set to
40 ## 0 if you increment CURRENT
43 ## increment if any interfaces have been added; set to 0
44 ## if any interfaces have been changed or removed. removal has
45 ## precedence over adding, so set to 0 if both happened.
51 SOVERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
54 DBUS_MAJOR_VERSION=dbus_major_version
55 DBUS_MINOR_VERSION=dbus_minor_version
56 DBUS_MICRO_VERSION=dbus_micro_version
57 DBUS_VERSION=dbus_major_version.dbus_minor_version.dbus_micro_version
59 AC_SUBST(DBUS_MAJOR_VERSION)
60 AC_SUBST(DBUS_MINOR_VERSION)
61 AC_SUBST(DBUS_MICRO_VERSION)
62 AC_SUBST(DBUS_VERSION)
67 AC_USE_SYSTEM_EXTENSIONS
74 COMPILER_OPTIMISATIONS
77 # TAP test driver support
79 AC_REQUIRE_AUX_FILE([tap-driver.sh])
81 # This must come before we set up compiler warnings because it assumes
82 # non-use of -Werror=missing-prototypes
84 AM_CONDITIONAL([HAVE_VISIBILITY], [test "x$HAVE_VISIBILITY" = x1])
88 LT_LANG([Windows Resource])
90 # Set some internal variables depending on the platform for later use.
111 # Special defines for certain platforms
112 if test "$dbus_win" = yes; then
113 AC_DEFINE(DBUS_WIN,1,[Defined if we run on a W32 API based system])
114 # Yes, on Windows it really does work like this.
115 # http://support.microsoft.com/kb/111855
116 AC_DEFINE(FD_SETSIZE,8192,[The maximum number of connections that can be handled at once])
117 BUILD_TIMESTAMP=`date --iso-8601=minutes`
118 AC_SUBST(BUILD_TIMESTAMP)
119 # Assume DBUS_VERSION is always three numbers
120 BUILD_FILEVERSION=`echo "$DBUS_VERSION" | sed -e 's/\./,/g'`,0
121 AC_SUBST(BUILD_FILEVERSION)
122 AC_CHECK_TOOL(WINDRES, windres, no)
123 if test "$WINDRES" = no; then
124 AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
126 if test "$dbus_wince" = yes; then
127 AC_DEFINE(DBUS_WINCE,1,[Defined if we run on a W32 CE API based system])
128 AC_DEFINE(_WIN32_WCE, 0x0502, [Defined to get newer W32 CE APIs])
131 AC_DEFINE(DBUS_UNIX,1,[Defined if we run on a Unix-based system])
133 if test "$dbus_cygwin" = yes; then
134 AC_DEFINE(DBUS_CYGWIN,1,[Defined if we run on a cygwin API based system])
137 # For best security, assume that all non-Windows platforms can do
138 # credentials-passing.
139 AS_IF([test "$dbus_win" = yes],
140 [DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL="<!--<auth>EXTERNAL</auth>-->"],
141 [DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL="<auth>EXTERNAL</auth>"])
142 AC_SUBST([DBUS_SESSION_CONF_MAYBE_AUTH_EXTERNAL])
144 AM_CONDITIONAL(DBUS_WIN, test "$dbus_win" = yes)
145 AM_CONDITIONAL(DBUS_WINCE, test "$dbus_wince" = yes)
146 AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes)
147 AM_CONDITIONAL(DBUS_CYGWIN, test "$dbus_cygwin" = yes)
149 # this must come first: other options use this to set their defaults
150 AC_ARG_ENABLE([developer],
151 [AS_HELP_STRING([--enable-developer],
152 [set defaults to be appropriate for a D-Bus developer instead of a distribution/end-user])],
154 [enable_developer=no])
156 DBUS_STATIC_BUILD_CPPFLAGS=
157 if test "x$enable_shared" = xno; then
158 # On Windows, linking against the static library requires special effort
159 # to turn off DLL import/export processing. We normally link some things
160 # against the dynamic library, but if we're not building that, we'll
161 # have to link everything statically.
162 DBUS_STATIC_BUILD_CPPFLAGS=-DDBUS_STATIC_BUILD
164 AC_SUBST([DBUS_STATIC_BUILD_CPPFLAGS])
166 AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no)
167 AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$enable_developer)
168 AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$enable_developer)
169 AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes)
170 AC_ARG_ENABLE(xml-docs, AS_HELP_STRING([--enable-xml-docs],[build XML documentation (requires xmlto)]),enable_xml_docs=$enableval,enable_xml_docs=auto)
171 AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGEN documentation (requires Doxygen)]),enable_doxygen_docs=$enableval,enable_doxygen_docs=auto)
172 AC_ARG_ENABLE([ducktype-docs],
173 AS_HELP_STRING([--enable-ducktype-docs],
174 [build Ducktype documentation (requires Ducktype)]),
175 [enable_ducktype_docs=$enableval], [enable_ducktype_docs=auto])
176 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)
177 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto)
178 AC_ARG_ENABLE([apparmor],
179 [AS_HELP_STRING([--enable-apparmor], [build with AppArmor support])],
180 [enable_apparmor=$enableval],
181 [enable_apparmor=auto])
182 AC_ARG_ENABLE(libaudit,AS_HELP_STRING([--enable-libaudit],[build audit daemon support for SELinux]),enable_libaudit=$enableval,enable_libaudit=auto)
183 AC_ARG_ENABLE(inotify, AS_HELP_STRING([--enable-inotify],[build with inotify support (linux only)]),enable_inotify=$enableval,enable_inotify=auto)
184 AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
185 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)
186 AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
187 AC_ARG_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto)
188 AC_ARG_ENABLE(kdbus-transport, AS_HELP_STRING([--enable-kdbus-transport],[build with kdbus transport support]),enable_kdbus_transport=$enableval,enable_kdbus_transport=no)
189 AC_ARG_ENABLE(libdbuspolicy,[AS_HELP_STRING([--enable-libdbuspolicy],[enable libdbuspolicy for kdbus transport [default=no]])],,[enable_libdbuspolicy=no])
190 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])
192 AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
193 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]))
194 AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))
195 AC_ARG_WITH(system-pid-file, AS_HELP_STRING([--with-system-pid-file=[pidfile]],[PID file for systemwide daemon]))
196 AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNIX domain socket for systemwide daemon]))
197 AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip]))
198 AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
199 AC_ARG_WITH(launchd-agent-dir, AS_HELP_STRING([--with-launchd-agent-dir=[dirname]],[directory to put the launchd agent (default: /Library/LaunchAgents)]))
200 AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
201 AC_ARG_WITH([test_user],
202 [AS_HELP_STRING([--with-test-user=<user>],
203 [Unprivileged user for regression tests, other than root and the dbus_user (default: nobody)])])
204 AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
206 AC_ARG_ENABLE([embedded-tests],
207 AS_HELP_STRING([--enable-embedded-tests],
208 [enable unit test code in the library and binaries]),
209 [], [enable_embedded_tests=$enable_developer])
210 AC_ARG_ENABLE([modular-tests],
211 AS_HELP_STRING([--enable-modular-tests],
212 [enable modular regression tests (requires GLib)]),
213 [], [enable_modular_tests=auto])
214 # --enable-tests overrides both --enable-embedded-tests and
215 # --enable-modular-tests
216 AC_ARG_ENABLE([tests],
217 AS_HELP_STRING([--enable-tests],
218 [enable/disable all tests, overriding embedded-tests/modular-tests]),
220 if test "x$enableval" = xyes; then
221 AC_MSG_NOTICE([Full test coverage was requested with --enable-tests=yes])
222 AC_MSG_NOTICE([This has many dependencies (GLib, Python etc.)])
224 enable_embedded_tests=$enableval
225 enable_modular_tests=$enableval
229 # DBUS_ENABLE_EMBEDDED_TESTS controls unit tests built in to .c files
230 # and also some stuff in the test/ subdir.
231 AM_CONDITIONAL([DBUS_ENABLE_EMBEDDED_TESTS],
232 [test "x$enable_embedded_tests" = xyes])
233 if test "x$enable_embedded_tests" = xyes; then
234 AC_DEFINE([DBUS_ENABLE_EMBEDDED_TESTS], [1],
235 [Define to build test code into the library and binaries])
238 # call early to ensure availability
241 # DBUS_ENABLE_MODULAR_TESTS controls tests that work based on public API.
242 # These use GTest, from GLib, because life's too short. They're enabled by
243 # default (unless you don't have GLib), because they don't bloat the library
246 AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_36], [Ignore post-2.36 deprecations])
247 AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_38], [Prevent post-2.38 APIs])
251 AS_IF([test "x$enable_modular_tests" != xno],
253 PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.36, gio-2.0 >= 2.36],
255 [if test "x$enable_modular_tests" = xyes; then
256 AC_MSG_NOTICE([Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires GLib])
257 AC_MSG_ERROR([$GLIB_ERRORS])
258 else # assumed to be "auto"
264 if test "x$enable_modular_tests" != xno; then
265 AC_DEFINE([DBUS_ENABLE_MODULAR_TESTS], [1],
266 [Define to build independent test binaries])
268 AM_CONDITIONAL([DBUS_ENABLE_MODULAR_TESTS],
269 [test "x$enable_modular_tests" != xno])
271 if test "x$with_glib" != xno; then
272 AC_DEFINE([DBUS_WITH_GLIB], [1],
273 [Define if GLib, GObject, GIO are available])
275 AM_CONDITIONAL([DBUS_WITH_GLIB], [test "x$with_glib" != xno])
277 AC_ARG_ENABLE([installed-tests],
278 AS_HELP_STRING([--enable-installed-tests],
279 [enable unit test code in the library and binaries]),
280 [], [enable_installed_tests=no])
281 AM_CONDITIONAL([DBUS_ENABLE_INSTALLED_TESTS],
282 [test "x$enable_installed_tests" = xyes])
284 if test "x$enable_tests" = xyes; then
285 # full test coverage is required, Python is a hard dependency
286 AC_MSG_NOTICE([Full test coverage (--enable-tests=yes) requires Python, dbus-python, pygi])
287 AM_PATH_PYTHON([2.6])
288 AC_MSG_CHECKING([for Python modules for full test coverage])
289 if "$PYTHON" -c "import dbus, gi.repository.GObject, dbus.mainloop.glib"; then
293 AC_MSG_ERROR([cannot import dbus, gi.repository.GObject, dbus.mainloop.glib Python modules])
296 # --enable-tests not given: do not abort if Python is missing
297 AM_PATH_PYTHON([2.6], [], [:])
300 if test x$enable_verbose_mode = xyes; then
301 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
304 if test x$enable_asserts = xno; then
305 AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
306 DISABLE_UNUSED_WARNINGS="unused-label"
308 if test x$enable_embedded_tests = xyes; then
309 DISABLE_UNUSED_WARNINGS="$DISABLE_UNUSED_WARNINGS \
310 unused-but-set-variable unused-variable \
314 # -rdynamic is needed for glibc's backtrace_symbols to work.
315 # No clue how much overhead this adds, but it's useful
316 # to do this on any assertion failure,
317 # so for now it's enabled anytime asserts are (currently not
318 # in production builds).
320 # To get -rdynamic you pass -export-dynamic to libtool.
321 AC_DEFINE(DBUS_BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
322 R_DYNAMIC_LDFLAG=-export-dynamic
324 AC_SUBST(R_DYNAMIC_LDFLAG)
326 if test x$enable_checks = xno; then
327 AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
328 AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
329 DISABLE_UNUSED_WARNINGS="unused-label"
333 /* explicitly define these macros to get less confusing conditions */
334 #ifndef DBUS_DISABLE_ASSERT
335 # define DBUS_ENABLE_ASSERT 1
337 #ifndef DBUS_DISABLE_CHECKS
338 # define DBUS_ENABLE_CHECKS 1
341 if test x$enable_compiler_coverage = xyes; then
342 ## so that config.h changes when you toggle gcov support
343 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
346 # glibc21.m4 serial 3
347 dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
348 dnl This file is free software; the Free Software Foundation
349 dnl gives unlimited permission to copy and/or distribute it,
350 dnl with or without modifications, as long as this notice is preserved.
352 # Test for the GNU C Library, version 2.1 or newer.
355 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
356 ac_cv_gnu_library_2_1,
357 [AC_EGREP_CPP([Lucky GNU user],
359 #include <features.h>
360 #ifdef __GNU_LIBRARY__
361 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
366 ac_cv_gnu_library_2_1=yes,
367 ac_cv_gnu_library_2_1=no)
373 AC_CHECK_SIZEOF(char)
374 AC_CHECK_SIZEOF(short)
375 AC_CHECK_SIZEOF(long)
377 AC_CHECK_SIZEOF(void *)
378 AC_CHECK_SIZEOF(long long)
379 AC_CHECK_SIZEOF(__int64)
381 ### See what our 64 bit type is called
382 AC_MSG_CHECKING([64-bit integer type])
387 dbusint64_constant='(val)'
388 dbusuint64_constant='(val)'
389 dbusint64_printf_modifier='""'
393 dbusint64_constant='(val##L)'
394 dbusuint64_constant='(val##UL)'
395 dbusint64_printf_modifier='"l"'
397 $ac_cv_sizeof_long_long)
398 dbusint64='long long'
399 dbusint64_constant='(val##LL)'
400 dbusuint64_constant='(val##ULL)'
401 # Ideally we discover what the format is, but this is
402 # only used in verbose mode, so eh...
403 if test x"$ac_cv_gnu_library_2_1" = xyes; then
404 dbusint64_printf_modifier='"ll"'
407 $ac_cv_sizeof___int64)
409 dbusint64_constant='(val##i64)'
410 dbusuint64_constant='(val##ui64)'
412 if test x"$ac_cv_gnu_library_2_1" = xyes; then
413 dbusint64_printf_modifier='"ll"'
419 [test -z "$dbusint64"],
420 [AC_MSG_RESULT([not found])
421 AC_MSG_ERROR([Could not find a 64-bit integer type.
423 Please report a bug here with details of your platform and compiler:
425 http://bugs.freedesktop.org/enter_bug.cgi?product=DBus&component=core])
429 DBUS_INT64_TYPE="$dbusint64"
430 DBUS_INT64_CONSTANT="$dbusint64_constant"
431 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
432 if test x"$dbusint64_printf_modifier" != x; then
433 AC_DEFINE_UNQUOTED(DBUS_INT64_PRINTF_MODIFIER, [$dbusint64_printf_modifier], [Define to printf modifier for 64 bit integer type])
435 AC_MSG_RESULT($DBUS_INT64_TYPE)
438 AC_SUBST(DBUS_INT64_TYPE)
439 AC_SUBST(DBUS_INT64_CONSTANT)
440 AC_SUBST(DBUS_UINT64_CONSTANT)
442 ### see what 32-bit int is called
443 AC_MSG_CHECKING([32-bit integer type])
457 if test -z "$dbusint32" ; then
458 DBUS_INT32_TYPE="no_int32_type_detected"
459 AC_MSG_ERROR([No 32-bit integer type found])
461 DBUS_INT32_TYPE="$dbusint32"
462 AC_MSG_RESULT($DBUS_INT32_TYPE)
465 AC_SUBST(DBUS_INT32_TYPE)
467 ### see what 16-bit int is called
468 AC_MSG_CHECKING([16-bit integer type])
479 if test -z "$dbusint16" ; then
480 DBUS_INT16_TYPE="no_int16_type_detected"
481 AC_MSG_ERROR([No 16-bit integer type found])
483 DBUS_INT16_TYPE="$dbusint16"
484 AC_MSG_RESULT($DBUS_INT16_TYPE)
487 AC_SUBST(DBUS_INT16_TYPE)
492 # check at compile-time, so that it is possible to build universal
493 # (with multiple architectures at once on the compile line)
494 AH_VERBATIM([WORDS_BIGENDIAN_DARWIN], [
495 /* Use the compiler-provided endianness defines to allow universal compiling. */
496 #if defined(__BIG_ENDIAN__)
497 #define WORDS_BIGENDIAN 1
506 dnl **********************************
507 dnl *** va_copy checks (from GLib) ***
508 dnl **********************************
509 dnl we currently check for all three va_copy possibilities, so we get
510 dnl all results in config.log for bug reports.
511 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
512 AC_LINK_IFELSE([AC_LANG_SOURCE([#include <stdarg.h>
514 static void f (int i, ...) {
515 va_list args1, args2;
517 va_copy (args2, args1);
518 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
520 va_end (args1); va_end (args2);
526 [dbus_cv_va_copy=yes],
527 [dbus_cv_va_copy=no])
529 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
530 AC_LINK_IFELSE([AC_LANG_SOURCE([#include <stdarg.h>
532 static void f (int i, ...) {
533 va_list args1, args2;
535 __va_copy (args2, args1);
536 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
538 va_end (args1); va_end (args2);
544 [dbus_cv___va_copy=yes],
545 [dbus_cv___va_copy=no])
548 if test "x$dbus_cv_va_copy" = "xyes"; then
549 dbus_va_copy_func=va_copy
550 else if test "x$dbus_cv___va_copy" = "xyes"; then
551 dbus_va_copy_func=__va_copy
555 if test -n "$dbus_va_copy_func"; then
556 AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
560 AC_CACHE_CHECK([whether va_lists can be copied by value],
562 [AC_RUN_IFELSE([AC_LANG_PROGRAM(
568 static void f (int i, ...) {
569 va_list args1, args2;
572 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
574 va_end (args1); va_end (args2);
581 [dbus_cv_va_val_copy=yes],
582 [dbus_cv_va_val_copy=no],
583 [dbus_cv_va_val_copy=yes])
587 if test "x$dbus_cv_va_val_copy" = "xno"; then
588 AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
594 AC_CACHE_CHECK([whether $CC knows __sync_sub_and_fetch()],
595 dbus_cv_sync_sub_and_fetch,
597 AC_LANG_PROGRAM([[]], [[int a = 4; int b = __sync_sub_and_fetch(&a, 4); exit(b); ]])],
598 [dbus_cv_sync_sub_and_fetch=yes],
599 [dbus_cv_sync_sub_and_fetch=no])
602 if test "x$dbus_cv_sync_sub_and_fetch" = "xyes" ; then
608 AC_DEFINE_UNQUOTED([DBUS_USE_SYNC], [$have_sync], [Use the gcc __sync extension])
610 #### Various functions
611 AC_SEARCH_LIBS(socket,[socket network])
612 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
614 AC_CHECK_FUNCS([vsnprintf vasprintf nanosleep usleep setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit poll setlocale localeconv strtoll strtoull issetugid getresuid setresuid getrlimit])
616 AC_CHECK_HEADERS([syslog.h])
617 if test "x$ac_cv_header_syslog_h" = "xyes"; then
618 AC_CHECK_DECLS([LOG_PERROR], [], [], [[#include <syslog.h>]])
621 # For test-segfault.c
622 AC_CHECK_HEADERS_ONCE([sys/prctl.h])
623 AC_CHECK_FUNCS_ONCE([prctl raise])
625 #### Check for broken poll; taken from Glib's configure
627 AC_MSG_CHECKING([for broken poll])
628 AC_RUN_IFELSE([AC_LANG_SOURCE([[
632 #ifdef HAVE_SYS_POLL_H
633 #include <sys/poll.h>
636 struct pollfd fds[1];
638 fd = open("/dev/null", 1);
640 fds[0].events = POLLIN;
642 if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
643 exit(1); /* Does not work for devices -- fail */
649 AC_DEFINE(BROKEN_POLL,1,[poll doesn't work on devices])],
650 [broken_poll="no (cross compiling)"])
651 AC_MSG_RESULT($broken_poll)
653 AC_MSG_CHECKING(for dirfd)
654 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
655 #include <sys/types.h>
663 [dbus_have_dirfd=yes],
664 [dbus_have_dirfd=no])
665 AC_MSG_RESULT($dbus_have_dirfd)
666 if test "$dbus_have_dirfd" = yes; then
667 AC_DEFINE(HAVE_DIRFD,1,[Have dirfd function])
669 AC_MSG_CHECKING(for DIR *dirp->dd_fd)
670 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
671 #include <sys/types.h>
680 [dbus_have_ddfd=yes],
682 AC_MSG_RESULT($dbus_have_ddfd)
683 if test "$dbus_have_ddfd" = yes; then
684 AC_DEFINE(HAVE_DDFD,1,[Have the ddfd member of DIR])
688 AC_CHECK_HEADERS(sys/resource.h)
690 AC_CHECK_HEADERS(dirent.h)
692 AC_CHECK_HEADERS([execinfo.h],
693 [AC_SEARCH_LIBS([backtrace], [execinfo],
694 [AC_DEFINE([HAVE_BACKTRACE], [1],
695 [Define to 1 if you have backtrace().])])])
697 AC_CHECK_HEADERS(errno.h)
699 AC_CHECK_HEADERS(signal.h)
701 AC_CHECK_HEADERS(locale.h)
703 AC_CHECK_HEADERS(byteswap.h)
705 AC_CHECK_HEADERS(unistd.h)
707 AC_CHECK_HEADERS(ws2tcpip.h)
709 AC_CHECK_HEADERS(alloca.h)
711 # Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
715 CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
718 # checking for a posix version of getpwnam_r
719 # if we are cross compiling and can not run the test
720 # assume getpwnam_r is the posix version
721 # it is up to the person cross compiling to change
722 # this behavior if desired
724 AC_CACHE_CHECK([for posix getpwnam_r],
725 ac_cv_func_posix_getpwnam_r,
726 [AC_RUN_IFELSE([AC_LANG_PROGRAM(
733 struct passwd pwd, *pwptr = &pwd;
736 error = getpwnam_r ("", &pwd, buffer,
737 sizeof (buffer), &pwptr);
738 return (error < 0 && errno == ENOSYS)
741 [ac_cv_func_posix_getpwnam_r=yes],
742 [ac_cv_func_posix_getpwnam_r=no],
743 [ac_cv_func_posix_getpwnam_r=yes]
747 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
748 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
749 [Have POSIX function getpwnam_r])
751 AC_CACHE_CHECK([for nonposix getpwnam_r],
752 ac_cv_func_nonposix_getpwnam_r,
753 [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <pwd.h>]], [[char buffer[10000];
755 getpwnam_r ("", &pwd, buffer,
756 sizeof (buffer));]])],
757 [ac_cv_func_nonposix_getpwnam_r=yes],
758 [ac_cv_func_nonposix_getpwnam_r=no])])
759 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
760 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
761 [Have non-POSIX function getpwnam_r])
765 dnl check for socklen_t
766 AC_MSG_CHECKING(whether socklen_t is defined)
767 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
768 #include <sys/types.h>
769 #include <sys/socket.h>
775 [dbus_have_socklen_t=yes],
776 [dbus_have_socklen_t=no])
777 AC_MSG_RESULT($dbus_have_socklen_t)
779 if test "x$dbus_have_socklen_t" = "xyes"; then
780 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
783 dnl check for writev header and writev function so we're
784 dnl good to go if HAVE_WRITEV gets defined.
785 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
787 dnl needed on darwin for NAME_MAX
788 AC_CHECK_HEADERS(sys/syslimits.h)
790 dnl Make it easy to check if we have MSG_NOSIGNAL without actually having to include sys/socket.h
791 AC_CHECK_DECLS([MSG_NOSIGNAL], [], [], [[ #include <sys/types.h>
792 #include <sys/socket.h> ]])
794 dnl check for flavours of varargs macros (test from GLib)
795 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
796 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
797 int a(int p1, int p2, int p3);
798 #define call_a(...) a(1,__VA_ARGS__)
801 [dbus_have_iso_c_varargs=yes],
802 [dbus_have_iso_c_varargs=no])
803 AC_MSG_RESULT($dbus_have_iso_c_varargs)
805 AC_MSG_CHECKING(for GNUC varargs macros)
806 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
807 int a(int p1, int p2, int p3);
808 #define call_a(params...) a(1,params)
811 [dbus_have_gnuc_varargs=yes],
812 [dbus_have_gnuc_varargs=no])
813 AC_MSG_RESULT($dbus_have_gnuc_varargs)
815 dnl Output varargs tests
816 if test x$dbus_have_iso_c_varargs = xyes; then
817 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
819 if test x$dbus_have_gnuc_varargs = xyes; then
820 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
823 dnl Check for various credentials.
824 AC_MSG_CHECKING(for struct cmsgcred)
825 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
826 #include <sys/types.h>
827 #include <sys/socket.h>
829 struct cmsgcred cred;
833 [dbus_have_struct_cmsgcred=yes],
834 [dbus_have_struct_cmsgcred=no])
835 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
837 if test x$dbus_have_struct_cmsgcred = xyes; then
838 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
841 AC_CHECK_MEMBER([struct unpcbid.unp_pid],
842 [AC_DEFINE([HAVE_UNPCBID], 1, [Have unpcbid structure])],
844 [[#include <sys/un.h>]])
846 AC_CHECK_FUNCS(getpeerucred getpeereid)
848 AC_CHECK_FUNCS(pipe2 accept4)
850 #### Abstract sockets
852 if test x$enable_abstract_sockets = xauto; then
855 AC_CACHE_CHECK([abstract socket namespace],
856 ac_cv_have_abstract_sockets,
857 [AC_RUN_IFELSE([AC_LANG_PROGRAM(
859 #include <sys/types.h>
863 #include <sys/socket.h>
870 struct sockaddr_un addr;
872 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
876 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
880 memset (&addr, '\0', sizeof (addr));
881 addr.sun_family = AF_UNIX;
882 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
883 /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the
886 slen = SUN_LEN(&addr);
887 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
889 if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
891 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
898 [ac_cv_have_abstract_sockets=yes],
899 [ac_cv_have_abstract_sockets=no],
901 ac_cv_have_abstract_sockets=no
905 if test x$warn_on_xcompile = xyes ; then
906 AC_MSG_WARN([Cannot check for abstract sockets when cross-compiling, please use --enable-abstract-sockets])
911 if test x$enable_abstract_sockets = xyes; then
912 if test x$ac_cv_have_abstract_sockets = xno; then
913 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
917 if test x$enable_abstract_sockets = xno; then
918 ac_cv_have_abstract_sockets=no;
921 if test x$ac_cv_have_abstract_sockets = xyes ; then
922 DBUS_PATH_OR_ABSTRACT=abstract
923 AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
925 DBUS_PATH_OR_ABSTRACT=path
928 # this is used in addresses to prefer abstract, e.g.
929 # unix:path=/foo or unix:abstract=/foo
930 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
932 #### Sort out XML library
934 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
935 [ AC_CHECK_HEADERS(expat.h, [],
936 [AC_MSG_ERROR([Could not find expat.h, check config.log for failed attempts])]) ],
937 [ AC_MSG_ERROR([Explicitly requested expat but expat not found]) ])
941 AC_SUBST([XML_CFLAGS])
944 # Thread lib detection
945 AC_ARG_VAR([THREAD_LIBS])
947 LIBS="$LIBS $THREAD_LIBS"
949 is_missing_pthread_function="is required when compiling D-Bus on Unix platforms, but is not in your libc or libpthread. Please open a bug on https://bugs.freedesktop.org/enter_bug.cgi?product=dbus with details of your platform."
951 # Don't do these automatic checks if the user set THREAD_LIBS on the
952 # configure command-line. If they did, we assume they're right.
954 # We also don't do these checks on Windows, because you don't need magical
955 # linker flags to have threading support there.
956 AS_IF([test "x$dbus_unix" = xyes && test "x$THREAD_LIBS" = x],
958 # Mandatory pthread functions. In principle, some of these could be made
959 # optional if there are platforms that don't have them.
961 # Currently, we only look in -lpthread.
962 # In principle we might need to look in -lpthreads, -lthreads, ...
963 # as well - please file a bug if your platform needs this.
964 AC_SEARCH_LIBS([pthread_cond_timedwait],
966 [THREAD_LIBS="$LIBS"],
967 [AC_MSG_ERROR([pthread_cond_timedwait $is_missing_pthread_function])],
969 AC_SEARCH_LIBS([pthread_mutexattr_init],
971 [THREAD_LIBS="$LIBS"],
972 [AC_MSG_ERROR([pthread_mutexattr_init $is_missing_pthread_function])],
974 AC_SEARCH_LIBS([pthread_mutexattr_settype],
976 [THREAD_LIBS="$LIBS"],
977 [AC_MSG_ERROR([pthread_mutexattr_settype $is_missing_pthread_function])],
980 # Optional, for monotonic clocks. Because it's optional, this check
981 # is non-fatal if we don't find it.
982 AC_SEARCH_LIBS([pthread_condattr_setclock],
984 [THREAD_LIBS="$LIBS"])
986 AS_IF([test "x$ac_cv_search_pthread_condattr_setclock" != xno],
988 AC_SEARCH_LIBS([clock_getres], [rt], [THREAD_LIBS="$LIBS"])
989 AC_MSG_CHECKING([for CLOCK_MONOTONIC])
990 AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
994 struct timespec monotonic_timer;
995 pthread_condattr_t attr;
996 pthread_condattr_init (&attr);
997 pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
998 clock_getres (CLOCK_MONOTONIC,&monotonic_timer);
1000 [have_clock_monotonic=true],
1001 [have_clock_monotonic=false])
1002 AS_IF([test x$have_clock_monotonic = xtrue],
1004 AC_MSG_RESULT([found])
1005 AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, [Define if we have CLOCK_MONOTONIC])
1007 [AC_MSG_RESULT([not found])])
1008 ]) dnl have pthread_condattr_setclock
1013 AC_SUBST([THREAD_LIBS])
1016 if test x$enable_selinux = xno ; then
1019 # See if we have SELinux library
1020 AC_CHECK_LIB(selinux, is_selinux_enabled,
1021 have_selinux=yes, have_selinux=no)
1023 # see if we have the SELinux header with the new D-Bus stuff in it
1024 if test x$have_selinux = xyes ; then
1025 AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
1026 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <selinux/av_permissions.h>]],
1027 [[#ifdef DBUS__ACQUIRE_SVC return 0;
1029 #error DBUS__ACQUIRE_SVC not defined
1033 AC_MSG_RESULT($have_selinux)
1036 if test x$enable_selinux = xauto ; then
1037 if test x$have_selinux = xno ; then
1038 AC_MSG_WARN([Sufficiently new SELinux library not found])
1041 if test x$have_selinux = xno ; then
1042 AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
1047 AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
1049 if test x$have_selinux = xyes ; then
1050 # the selinux code creates threads
1051 # which requires libpthread even on linux
1052 AC_CHECK_FUNC(pthread_create,,[AC_CHECK_LIB(pthread,pthread_create,
1053 [SELINUX_THREAD_LIBS="-lpthread"])])
1055 SELINUX_LIBS="-lselinux $SELINUX_THREAD_LIBS"
1056 AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
1061 # AppArmor detection
1062 AS_IF([test x$enable_apparmor = xno],
1065 PKG_CHECK_MODULES([APPARMOR], [libapparmor >= 2.8.95],
1066 [have_apparmor=yes], [have_apparmor=no])
1068 AS_IF([test x$enable_apparmor = xauto && test x$have_apparmor = xno],
1069 [AC_MSG_WARN([Sufficiently new AppArmor library not found])])
1070 AS_IF([test x$enable_apparmor != xauto && test x$have_apparmor = xno],
1071 [AC_MSG_ERROR([AppArmor explicitly required, and AppArmor library not found])])
1074 AS_IF([test x$have_apparmor = xyes],
1075 [AC_DEFINE([HAVE_APPARMOR], [1], [AppArmor Support])])
1078 if test x$enable_inotify = xno ; then
1081 AC_CHECK_HEADERS(sys/inotify.h, have_inotify=yes, have_inotify=no)
1084 dnl check if inotify backend is enabled
1085 if test x$have_inotify = xyes; then
1086 AC_DEFINE(DBUS_BUS_ENABLE_INOTIFY,1,[Use inotify])
1087 AC_CHECK_FUNCS(inotify_init1)
1090 AM_CONDITIONAL(DBUS_BUS_ENABLE_INOTIFY, test x$have_inotify = xyes)
1092 # For simplicity, we require the userland API for epoll_create1 at
1093 # compile-time (glibc 2.9), but we'll run on kernels that turn out
1094 # not to have it at runtime.
1095 AC_ARG_ENABLE([epoll],
1096 [AS_HELP_STRING([--enable-epoll],[use epoll(4) on Linux])],
1097 [enable_epoll=$enableval], [enable_epoll=auto])
1098 if test x$enable_epoll = xno; then
1101 AC_MSG_CHECKING([for Linux epoll(4)])
1102 AC_LINK_IFELSE([AC_LANG_PROGRAM(
1105 #error This is not Linux
1107 #include <sys/epoll.h>
1109 [epoll_create1 (EPOLL_CLOEXEC);])],
1110 [have_linux_epoll=yes],
1111 [have_linux_epoll=no])
1112 AC_MSG_RESULT([$have_linux_epoll])
1114 if test x$enable_epoll,$have_linux_epoll = xyes,no; then
1115 AC_MSG_ERROR([epoll support explicitly enabled but not available])
1117 if test x$have_linux_epoll = xyes; then
1118 AC_DEFINE([DBUS_HAVE_LINUX_EPOLL], 1, [Define to use epoll(4) on Linux])
1120 AM_CONDITIONAL([HAVE_LINUX_EPOLL], [test x$have_linux_epoll = xyes])
1123 if test x$enable_kqueue = xno ; then
1127 AC_CHECK_HEADER(sys/event.h, , have_kqueue=no)
1128 AC_CHECK_FUNC(kqueue, , have_kqueue=no)
1130 if test x$enable_kqueue = xyes -a x$have_kqueue = xno; then
1131 AC_MSG_ERROR(kqueue support explicitly enabled but not available)
1135 dnl check if kqueue backend is enabled
1136 if test x$have_kqueue = xyes; then
1137 AC_DEFINE(DBUS_BUS_ENABLE_KQUEUE,1,[Use kqueue])
1140 AM_CONDITIONAL(DBUS_BUS_ENABLE_KQUEUE, test x$have_kqueue = xyes)
1143 if test x$enable_launchd = xno ; then
1147 AC_CHECK_HEADER([launch.h], , have_launchd=no)
1148 AC_PATH_PROG([LAUNCHCTL], [launchctl])
1149 if test "x$LAUNCHCTL" = "x"; then
1153 if test x$enable_launchd = xyes && test x$have_launchd = xno ; then
1154 AC_MSG_ERROR([launchd support explicitly enabled but not available])
1158 dnl check if launchd is enabled
1159 if test x$have_launchd = xyes; then
1160 AC_DEFINE(DBUS_ENABLE_LAUNCHD,1,[Use launchd autolaunch])
1163 AM_CONDITIONAL(DBUS_ENABLE_LAUNCHD, test x$have_launchd = xyes)
1165 #### Directory to place launchd agent file
1166 if test "x$with_launchd_agent_dir" = "x"; then
1167 LAUNCHD_AGENT_DIR="/Library/LaunchAgents"
1169 LAUNCHD_AGENT_DIR="$with_launchd_agent_dir"
1172 AC_SUBST(LAUNCHD_AGENT_DIR)
1174 dnl console owner file
1175 if test x$enable_console_owner_file = xno ; then
1176 have_console_owner_file=no;
1180 have_console_owner_file=yes;
1181 AC_DEFINE(HAVE_CONSOLE_OWNER_FILE,1,[Have console owner file])
1184 have_console_owner_file=no;;
1188 AM_CONDITIONAL(HAVE_CONSOLE_OWNER_FILE, test x$have_console_owner_file = xyes)
1190 dnl systemd detection
1191 if test x$enable_systemd = xno ; then
1194 PKG_CHECK_MODULES([SYSTEMD],
1195 [libsystemd >= 209],
1197 [PKG_CHECK_MODULES([SYSTEMD],
1198 [libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32],
1200 [have_systemd=no])])
1203 if test x$have_systemd = xyes; then
1204 AC_DEFINE(HAVE_SYSTEMD,1,[Have systemd])
1207 if test x$enable_systemd = xyes -a x$have_systemd != xyes ; then
1208 AC_MSG_ERROR([Explicitly requested systemd support, but systemd not found])
1211 # If not found in $PATH, we might still have systemd and systemctl at runtime
1212 # (perhaps dbus is being compiled in a minimal chroot with no systemd).
1213 # Assume the upstream-recommended location. Distributors with split /usr
1214 # can override this with ./configure SYSTEMCTL=/bin/systemctl
1215 AC_PATH_PROG([SYSTEMCTL], [systemctl], [/usr/bin/systemctl])
1217 # libaudit detection
1218 if test x$enable_libaudit = xno ; then
1221 # See if we have audit daemon & capabilities library
1222 AC_CHECK_LIB(audit, audit_log_user_avc_message,
1223 have_libaudit=yes, have_libaudit=no)
1224 if test x$have_libaudit = xyes ; then
1225 AC_CHECK_LIB(cap-ng, capng_clear,
1226 have_libaudit=yes, have_libaudit=no)
1230 AM_CONDITIONAL(HAVE_LIBAUDIT, test x$have_libaudit = xyes)
1232 if test x$have_libaudit = xyes ; then
1233 SELINUX_LIBS="$SELINUX_LIBS -laudit -lcap-ng"
1234 AC_DEFINE(HAVE_LIBAUDIT,1,[audit daemon SELinux support])
1237 AC_SUBST([SELINUX_LIBS])
1239 # Check for ADT API (Solaris Basic Security Mode auditing)
1240 AC_MSG_CHECKING(for ADT API)
1241 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1242 #include <bsm/adt.h>
1243 adt_user_context = ADT_USER;
1244 ]], [[]])], [ check_adt_audit=yes ], [ check_adt_audit=no ])
1246 if test ${check_adt_audit} = yes
1248 AC_DEFINE([HAVE_ADT], [], [Adt audit API])
1255 AC_SUBST([ADT_LIBS])
1257 # Check for SCM_RIGHTS
1258 AC_MSG_CHECKING([for SCM_RIGHTS])
1259 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
1260 #include <sys/types.h>
1261 #include <sys/socket.h>
1263 static int x = SCM_RIGHTS;
1265 [ AC_MSG_RESULT([supported])
1266 AC_DEFINE([HAVE_UNIX_FD_PASSING], [1], [Supports sending UNIX file descriptors]) ],
1267 [ AC_MSG_RESULT([not supported]) ])
1270 if test x$dbus_win = xyes ; then
1271 if test x$dbus_wince = xyes ; then
1272 NETWORK_libs="-lws2"
1274 NETWORK_libs="-lws2_32 -liphlpapi"
1278 AC_SUBST([NETWORK_libs])
1280 AC_ARG_WITH([valgrind],
1281 [AS_HELP_STRING([--with-valgrind],
1282 [Add instrumentation to help valgrind to understand our allocator])],
1286 AS_IF([test "x$with_valgrind" = xauto],
1287 [PKG_CHECK_EXISTS([valgrind >= 3.6],
1288 [with_valgrind=yes], [with_valgrind=no])])
1290 if test x$with_valgrind != xno; then
1291 PKG_CHECK_MODULES([VALGRIND], [valgrind >= 3.6])
1292 AC_DEFINE([WITH_VALGRIND], [1], [Define to add Valgrind instrumentation])
1296 if test x$enable_kdbus_transport = xyes; then
1297 AC_DEFINE(ENABLE_KDBUS_TRANSPORT,1,[Enable kdbus transport support])
1299 AM_CONDITIONAL([ENABLE_KDBUS_TRANSPORT], [test x$enable_kdbus_transport = xyes])
1301 if test x$enable_kdbus_sync_calls = xyes; then
1302 AC_DEFINE(ENABLE_KDBUS_SYNC_CALLS,1,[Enable kdbus sync calls support])
1305 AC_MSG_CHECKING([whether to enable libdbuspolicy for kdbus transport])
1306 AM_CONDITIONAL(LIBDBUSPOLICY, [test "x$enable_libdbuspolicy" = "xyes"])
1307 AS_IF([test "x$enable_libdbuspolicy" = "xyes"], [
1308 PKG_CHECK_MODULES(LIBDBUSPOLICY1, libdbuspolicy1 >= 1)
1309 AC_SUBST(LIBDBUSPOLICY1_CFLAGS)
1310 AC_SUBST(LIBDBUSPOLICY1_LIBS)
1311 AC_DEFINE(LIBDBUSPOLICY, 1, [Whether to enable libdbuspolicy for kdbus transport])
1312 AC_MSG_RESULT([yes])
1313 ], [ AC_MSG_RESULT([no]) ])
1315 #### Set up final flags
1316 LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS $KDBUS_LIBS"
1317 AC_SUBST([LIBDBUS_LIBS])
1323 AC_ARG_ENABLE([x11-autolaunch],
1324 AS_HELP_STRING([--enable-x11-autolaunch], [build with X11 auto-launch support]),
1325 [], [enable_x11_autolaunch=auto])
1327 if test "x$dbus_win" = xyes; then
1328 if test "x$enable_x11_autolaunch" = xyes; then
1329 AC_MSG_ERROR([X11 auto-launch is not supported on Windows])
1332 enable_x11_autolaunch=no
1337 if test "x$no_x" = xyes; then
1341 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1342 DBUS_X_CFLAGS="$X_CFLAGS"
1346 if test "x$enable_x11_autolaunch,$have_x11" = xyes,no; then
1347 AC_MSG_ERROR([X11 auto-launch requires X headers/libraries])
1349 # move from "auto" to "yes" or "no" if necessary
1350 if test "x$enable_x11_autolaunch" != xno; then
1351 enable_x11_autolaunch="$have_x11"
1355 if test "x$have_x11" = xyes ; then
1356 AC_DEFINE([DBUS_BUILD_X11], [1], [Define to build X11 functionality])
1359 if test "x$enable_x11_autolaunch" = xyes ; then
1360 AC_DEFINE([DBUS_ENABLE_X11_AUTOLAUNCH], [1], [Define to enable X11 auto-launch])
1363 AC_SUBST([DBUS_X_CFLAGS])
1364 AC_SUBST([DBUS_X_LIBS])
1366 #### gcc warning flags
1368 cc_supports_flag() {
1369 AC_MSG_CHECKING(whether $CC supports "$*")
1370 save_CFLAGS="$CFLAGS"
1372 AC_TRY_COMPILE([], [], [rc=yes], [rc=no])
1373 CFLAGS="$save_CFLAGS"
1374 AC_MSG_RESULT([$rc])
1378 TP_COMPILER_WARNINGS([WARNING_CFLAGS],
1379 dnl Use -Werror by default if:
1380 dnl - we're not on Windows (too many warnings), and
1381 dnl - we're in developer mode (a D-Bus developer, not a distro or end-user)
1382 dnl Override with --enable-Werror or --disable-Werror
1383 [test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$enable_developer = xyes],
1385 dnl Enable these warnings if possible:
1389 missing-declarations \
1390 missing-prototypes \
1396 declaration-after-statement \
1399 dnl Disable these warnings if possible, make them non-fatal if possible,
1400 dnl and don't enable -Werror unless we succeeded.
1403 dnl - $DISABLE_UNUSED_WARNINGS disables unused-label warnings if not
1404 dnl checking or not asserting
1405 dnl - missing field initializers being 0 is a C feature, not a bug
1406 dnl - unused-parameter is to make writing callbacks less annoying
1408 dnl To be fixed one day:
1409 dnl - pointer-sign is a workaround for fd.o #15522
1410 dnl - type-limits is probably a bug too, but having the rest of -Wextra
1411 dnl is better than nothing
1412 [$DISABLE_UNUSED_WARNINGS \
1413 missing-field-initializers \
1419 if test "x$GCC" = "xyes"; then
1420 # We're treating -fno-common like a warning: it makes the linker more
1421 # strict, because on some systems the linker is *always* this strict
1422 TP_ADD_COMPILER_FLAG([WARNING_CFLAGS], [-fno-common])
1424 # http://bugs.freedesktop.org/show_bug.cgi?id=10599
1425 TP_ADD_COMPILER_FLAG([WARNING_CFLAGS], [-fno-strict-aliasing])
1427 if test "x$enable_ansi" = "xyes"; then
1428 TP_ADD_COMPILER_FLAG([WARNING_CFLAGS],
1429 [-ansi -D_POSIX_C_SOURCE=199309L -D_BSD_SOURCE -pedantic])
1433 dnl In principle we should put WARNING_CFLAGS in each Makefile.am like
1434 dnl telepathy-glib does, since CFLAGS is meant to be reserved for the user...
1435 dnl but prepending to CFLAGS (so the user can override it with later CFLAGS)
1436 dnl is the next best thing
1437 CFLAGS="$WARNING_CFLAGS $CFLAGS"
1441 # Solaris' C library apparently needs these runes to be threadsafe...
1442 CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
1443 # ... this opt-in to get sockaddr_in6 and sockaddr_storage...
1444 CFLAGS="$CFLAGS -D__EXTENSIONS__"
1445 # ... and this opt-in to get file descriptor passing support
1446 CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500"
1450 ### Detect if ld supports --version-script
1452 gl_LD_VERSION_SCRIPT
1453 AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT],
1454 [test "x$have_ld_version_script" = xyes])
1455 ### Doxygen Documentation
1457 AC_PATH_PROG(DOXYGEN, doxygen, no)
1459 AC_MSG_CHECKING([whether to build Doxygen documentation])
1461 if test x$DOXYGEN = xno ; then
1467 if test x$enable_doxygen_docs = xauto ; then
1468 if test x$have_doxygen = xno ; then
1469 enable_doxygen_docs=no
1471 enable_doxygen_docs=yes
1475 if test x$enable_doxygen_docs = xyes; then
1476 if test x$have_doxygen = xno; then
1477 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
1481 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
1482 AC_MSG_RESULT($enable_doxygen_docs)
1484 AC_CHECK_PROGS([XSLTPROC], [xsltproc])
1485 AM_CONDITIONAL([DBUS_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1487 ### Ducktype/Yelp documentation
1489 AC_PATH_PROG([DUCKTYPE],[ducktype],[no])
1490 AC_PATH_PROG([YELP_BUILD],[yelp-build],[no])
1492 AC_MSG_CHECKING([whether to build Ducktype documentation])
1494 AS_IF([test "$DUCKTYPE" = "no"],[have_ducktype=no],[have_ducktype=yes])
1495 AS_IF([test "$YELP_BUILD" = "no"],[have_yelp_build=no],[have_yelp_build=yes])
1497 AS_IF([test "$enable_ducktype_docs" = "auto"],[
1498 AS_IF([test "$have_ducktype" = "no" || test "$have_yelp_build" = "no"],[
1499 enable_ducktype_docs=no
1501 enable_ducktype_docs=yes
1505 AS_IF([test "$enable_ducktype_docs" = "yes"],[
1506 AS_IF([test "$have_ducktype" = "no"],[
1507 AC_MSG_ERROR([Building Ducktype docs explicitly required, but ducktype not found])
1509 AS_IF([test "$have_yelp_build" = "no"],[
1510 AC_MSG_ERROR([Building Ducktype docs explicitly required, but yelp-build not found])
1514 AM_CONDITIONAL([DBUS_DUCKTYPE_DOCS_ENABLED],[test "$enable_ducktype_docs" = "yes"])
1515 AC_MSG_RESULT([$enable_ducktype_docs])
1517 ### XML Documentation
1519 AC_PATH_PROG(XMLTO, xmlto, no)
1521 AC_MSG_CHECKING([whether to build XML documentation])
1523 if test x$XMLTO = xno ; then
1529 if test x$enable_xml_docs = xauto ; then
1530 if test x$have_xmlto = xno ; then
1537 if test x$enable_xml_docs = xyes; then
1538 if test x$have_xmlto = xno; then
1539 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
1543 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
1544 AC_MSG_RESULT($enable_xml_docs)
1546 AM_CONDITIONAL(DBUS_CAN_UPLOAD_DOCS,
1547 [test x$enable_doxygen_docs = xyes && test x$enable_xml_docs = xyes &&
1548 test x$enable_ducktype_docs = xyes])
1550 #### Have to go $localstatedir->$prefix/var->/usr/local/var
1552 #### find the actual value for $prefix that we'll end up with
1553 ## (I know this is broken and should be done in the Makefile, but
1554 ## that's a major pain and almost nobody actually seems to care)
1555 AS_AC_EXPAND(EXPANDED_PREFIX, "$prefix")
1556 AS_AC_EXPAND(EXPANDED_LOCALSTATEDIR, "$localstatedir")
1557 AS_AC_EXPAND(EXPANDED_SYSCONFDIR, "$sysconfdir")
1558 AS_AC_EXPAND(EXPANDED_BINDIR, "$bindir")
1559 AS_AC_EXPAND(EXPANDED_LIBDIR, "$libdir")
1560 AS_AC_EXPAND(EXPANDED_LIBEXECDIR, "$libexecdir")
1561 AS_AC_EXPAND(EXPANDED_DATADIR, "$datadir")
1563 #### Check our operating system
1564 operating_system=unknown
1565 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
1566 operating_system=redhat
1569 if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
1570 operating_system=slackware
1573 if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
1574 operating_system=cygwin
1577 #### Sort out init scripts
1579 if test x$with_init_scripts = x; then
1580 case x$operating_system in
1581 xredhat) with_init_scripts=redhat ;;
1582 xslackware) with_init_scripts=slackware ;;
1583 xcygwin) with_init_scripts=cygwin ;;
1584 *) with_init_scripts=none ;;
1588 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
1589 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
1590 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_CYGWIN, test x$with_init_scripts = xcygwin)
1592 ##### systemd unit files
1593 AC_ARG_WITH([systemdsystemunitdir],
1594 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
1597 PKG_CHECK_EXISTS([systemd],
1598 [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)],
1599 [with_systemdsystemunitdir=no])
1601 if test "x$with_systemdsystemunitdir" != xno; then
1602 AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
1604 AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" != "xno" -a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
1606 AC_ARG_WITH([systemduserunitdir],
1607 AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]),
1610 PKG_CHECK_EXISTS([systemd],
1611 [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)],
1612 [with_systemduserunitdir='${libdir}/systemd/user'])
1614 AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
1616 ##### Set up location for system bus socket
1617 if ! test -z "$with_system_socket"; then
1618 DBUS_SYSTEM_SOCKET=$with_system_socket
1620 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
1623 AC_SUBST(DBUS_SYSTEM_SOCKET)
1624 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
1626 ## System bus only listens on local domain sockets, and never
1627 ## on an abstract socket (so only root can create the socket).
1629 ## This won't work on Windows. It's not meant to - the system bus is
1630 ## meaningless on Windows anyway.
1632 ## This has to be suitable for hard-coding in client libraries as well as
1633 ## in the dbus-daemon's configuration, so it has to be valid to listen on
1634 ## and also to connect to. If this ever changes, it'll need to be split into
1635 ## two variables, one for the listening address and one for the connecting
1637 #AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
1638 if ! test -z "$with_system_default_bus"; then
1639 ## Now system bus can work on kdbus too. It is diffrent situation than
1640 ## described above (daemon working with kdbus doesn't need to listen on
1641 ## any socket), so variable was not splited into two.
1642 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS=$with_system_default_bus
1644 kdbus_address_path=""
1645 if test x$enable_kdbus_transport = xyes; then
1646 kdbus_address_path="kernel:path=/sys/fs/kdbus/0-system/bus;"
1649 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="${kdbus_address_path}unix:path=$DBUS_SYSTEM_SOCKET"
1651 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
1652 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-Bus address of the system bus])
1654 #### Set up the pid file
1655 if ! test -z "$with_system_pid_file"; then
1656 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
1657 elif test x$with_init_scripts = xredhat ; then
1658 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
1660 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
1663 AC_SUBST(DBUS_SYSTEM_PID_FILE)
1665 #### Directory to check for console ownership
1666 if ! test -z "$with_console_auth_dir"; then
1667 DBUS_CONSOLE_AUTH_DIR=$with_console_auth_dir
1669 DBUS_CONSOLE_AUTH_DIR=/var/run/console/
1672 AC_SUBST(DBUS_CONSOLE_AUTH_DIR)
1673 AC_DEFINE_UNQUOTED(DBUS_CONSOLE_AUTH_DIR, "$DBUS_CONSOLE_AUTH_DIR", [Directory to check for console ownerhip])
1675 #### File to check for console ownership
1676 if test x$have_console_owner_file = xyes; then
1677 if ! test -z "$with_console_owner_file"; then
1678 DBUS_CONSOLE_OWNER_FILE=$with_console_owner_file
1680 DBUS_CONSOLE_OWNER_FILE=/dev/console
1683 DBUS_CONSOLE_OWNER_FILE=
1686 AC_SUBST(DBUS_CONSOLE_OWNER_FILE)
1687 AC_DEFINE_UNQUOTED(DBUS_CONSOLE_OWNER_FILE, "$DBUS_CONSOLE_OWNER_FILE", [File to check for console ownerhip])
1689 #### User to start the system bus as
1690 if test -z "$with_dbus_user" ; then
1691 DBUS_USER=messagebus
1693 DBUS_USER=$with_dbus_user
1696 AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
1698 #### User for regression tests
1699 AS_IF([test -z "$with_test_user"], [with_test_user=nobody])
1700 DBUS_TEST_USER="$with_test_user"
1701 AC_SUBST([DBUS_TEST_USER])
1702 AC_DEFINE_UNQUOTED([DBUS_TEST_USER], ["$DBUS_TEST_USER"],
1703 [Unprivileged user used in some regression tests])
1705 #### Prefix to install into
1706 DBUS_PREFIX=$EXPANDED_PREFIX
1707 AC_SUBST(DBUS_PREFIX)
1708 AC_DEFINE_UNQUOTED(DBUS_PREFIX,"$DBUS_PREFIX", [Prefix for installing DBUS])
1710 #### Direcotry to install data files into
1711 DBUS_DATADIR=$EXPANDED_DATADIR
1712 AC_SUBST(DBUS_DATADIR)
1713 AC_DEFINE_UNQUOTED(DBUS_DATADIR,"$DBUS_DATADIR", [Directory for installing DBUS data files])
1715 #### Directory to install dbus-daemon
1716 if test -z "$with_dbus_daemondir" ; then
1717 DBUS_DAEMONDIR=$EXPANDED_BINDIR
1718 dbus_daemondir='$bindir'
1720 DBUS_DAEMONDIR=$with_dbus_daemondir
1721 dbus_daemondir=$with_dbus_daemondir
1723 AC_SUBST(DBUS_DAEMONDIR)
1724 AC_SUBST(dbus_daemondir)
1725 AC_DEFINE_UNQUOTED(DBUS_DAEMONDIR,"$DBUS_DAEMONDIR", [Directory for installing the DBUS daemon])
1727 #### Directory to install the other binaries
1728 DBUS_BINDIR="$EXPANDED_BINDIR"
1729 AC_SUBST(DBUS_BINDIR)
1730 AC_DEFINE_UNQUOTED(DBUS_BINDIR,"$DBUS_BINDIR", [Directory for installing the binaries])
1732 #### Directory to install the libexec binaries
1733 DBUS_LIBEXECDIR="$EXPANDED_LIBEXECDIR"
1734 AC_SUBST(DBUS_LIBEXECDIR)
1735 AC_DEFINE_UNQUOTED(DBUS_LIBEXECDIR,"$DBUS_LIBEXECDIR", [Directory for installing the libexec binaries])
1737 #### Directory to source sysconfdir configuration from
1739 # On Windows this is relative to where we put the bus setup, in
1740 # ${datadir}/dbus-1. For simplicity, we only do this if
1741 # ${sysconfdir} = ${prefix}/etc and ${datadir} = ${prefix}/share.
1743 # On Unix, or on Windows with weird install layouts, it's the absolute path.
1744 AS_IF([test "${dbus_win}" = yes && \
1745 test "$EXPANDED_SYSCONFDIR" = "$EXPANDED_PREFIX/etc" && \
1746 test "$EXPANDED_DATADIR" = "$EXPANDED_PREFIX/share"],
1747 [SYSCONFDIR_FROM_PKGDATADIR="../../etc"
1748 DATADIR_FROM_PKGSYSCONFDIR="../../share"],
1749 [SYSCONFDIR_FROM_PKGDATADIR="$EXPANDED_SYSCONFDIR"
1750 DATADIR_FROM_PKGSYSCONFDIR="$EXPANDED_DATADIR"])
1751 AC_SUBST([SYSCONFDIR_FROM_PKGDATADIR])
1752 AC_SUBST([DATADIR_FROM_PKGSYSCONFDIR])
1754 #### Tell tests where to find certain stuff in builddir
1757 # Useful in a cross-compilation environment, where the tests are run on the host system.
1758 AC_ARG_WITH(dbus-test-dir, AS_HELP_STRING([--with-dbus-test-dir=[dirname]],[path where the tests tools are available]),
1761 DBUS_TEST_EXEC="$DBUS_PWD/test"
1762 DBUS_TEST_DATA="$DBUS_PWD/test/data"
1764 AC_SUBST([DBUS_TEST_DATA])
1765 AC_SUBST([DBUS_TEST_EXEC])
1767 AC_DEFINE_UNQUOTED([DBUS_TEST_EXEC], ["$DBUS_TEST_EXEC"],
1768 [Full path to the daemon in the builddir])
1769 AC_DEFINE_UNQUOTED([DBUS_EXEEXT], ["$EXEEXT"],
1770 [Extension for executables, typically empty or .exe])
1772 AC_DEFINE_UNQUOTED(TEST_BUS_LAUNCH_BINARY, ["$DBUS_PWD/tools/dbus-launch$EXEEXT"],
1773 [Full path to the dbus-launch in the builddir])
1775 ## Export the non-setuid external helper
1776 TEST_LAUNCH_HELPER_BINARY="$DBUS_PWD/bus/dbus-daemon-launch-helper-test$EXEEXT"
1777 AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
1778 AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY",
1779 [Full path to the launch helper test program in the builddir])
1781 #### Find socket directories
1782 if ! test -z "$TMPDIR" ; then
1783 DEFAULT_SOCKET_DIR=$TMPDIR
1784 elif ! test -z "$TEMP" ; then
1785 DEFAULT_SOCKET_DIR=$TEMP
1786 elif ! test -z "$TMP" ; then
1787 DEFAULT_SOCKET_DIR=$TMP
1789 DEFAULT_SOCKET_DIR=/tmp
1792 DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
1794 if ! test -z "$with_test_socket_dir" ; then
1795 TEST_SOCKET_DIR="$with_test_socket_dir"
1797 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1799 AC_SUBST(TEST_SOCKET_DIR)
1800 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1802 if test "x$dbus_unix" = xyes; then
1803 TEST_LISTEN="unix:tmpdir=$TEST_SOCKET_DIR"
1805 TEST_LISTEN="tcp:host=localhost"
1807 AC_SUBST([TEST_LISTEN])
1808 AC_DEFINE_UNQUOTED([TEST_LISTEN], ["$TEST_LISTEN"],
1809 [Listening address for regression tests])
1811 if ! test -z "$with_session_socket_dir" ; then
1812 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1814 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1816 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
1817 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
1819 # This must be a listening address. It doesn't necessarily need to be an
1820 # address you can connect to - it can be something vague like
1823 # The default varies by platform.
1824 AC_ARG_WITH([dbus_session_bus_listen_address],
1825 AS_HELP_STRING([--with-dbus-session-bus-listen-address=[ADDRESS]],
1826 [default address for a session bus to listen on (see configure.ac)]),
1827 [with_dbus_session_bus_listen_address=$withval],
1828 [with_dbus_session_bus_listen_address=])
1830 if test "x$with_dbus_session_bus_listen_address" != "x"; then
1831 # the user specified something, trust them
1832 DBUS_SESSION_BUS_LISTEN_ADDRESS="$with_dbus_session_bus_listen_address"
1833 elif test x$dbus_win = xyes; then
1834 # On Windows, you can (and should) listen on autolaunch addresses,
1835 # because autolaunching is different.
1836 # See https://bugs.freedesktop.org/show_bug.cgi?id=38201
1837 DBUS_SESSION_BUS_LISTEN_ADDRESS="autolaunch:"
1838 elif test x$have_launchd = xyes; then
1839 # Mac OS X default is to use launchd
1840 DBUS_SESSION_BUS_LISTEN_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
1842 # The default on all other Unix platforms (notably Linux)
1843 # is to create a randomly named socket in /tmp or similar
1844 DBUS_SESSION_BUS_LISTEN_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
1846 AC_SUBST([DBUS_SESSION_BUS_LISTEN_ADDRESS])
1848 # This must be an address you can connect to. It doesn't necessarily
1849 # need to be an address you can listen on - it can be "autolaunch:",
1852 # The default varies by platform.
1853 AC_ARG_WITH([dbus_session_bus_connect_address],
1854 AS_HELP_STRING([--with-dbus-session-bus-connect-address=[ADDRESS]],
1855 [fallback address for a session bus client to connect to (see configure.ac)]),
1856 [with_dbus_session_bus_connect_address=$withval],
1857 [with_dbus_session_bus_connect_address=])
1859 if test "x$with_dbus_session_bus_connect_address" != "x"; then
1860 # the user specified something, trust them
1861 DBUS_SESSION_BUS_CONNECT_ADDRESS="$with_dbus_session_bus_connect_address"
1862 elif test x$dbus_win = xyes; then
1863 # Windows autolaunching is a bit different; leaving it in its own
1864 # branch of the conditional because the default might conceivably
1865 # change (see #38201)
1866 DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
1868 # The default on all other Unix platforms (notably Linux)
1869 # is to use auto-launching - this works a bit differently on Mac OS X
1870 # but comes out basically the same in the end
1871 DBUS_SESSION_BUS_CONNECT_ADDRESS="autolaunch:"
1873 AC_SUBST([DBUS_SESSION_BUS_CONNECT_ADDRESS])
1874 AC_DEFINE_UNQUOTED([DBUS_SESSION_BUS_CONNECT_ADDRESS],
1875 ["$DBUS_SESSION_BUS_CONNECT_ADDRESS"],
1876 [Fallback address for session bus clients])
1878 # darwin needs this to initialize the environment
1879 AC_CHECK_HEADERS(crt_externs.h)
1880 AC_CHECK_FUNC(_NSGetEnviron, [AC_DEFINE(HAVE_NSGETENVIRON, 1, [Define if your system needs _NSGetEnviron to set up the environment])])
1881 AH_VERBATIM(_DARWIN_ENVIRON,
1883 #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
1884 # include <sys/time.h>
1885 # include <crt_externs.h>
1886 # define environ (*_NSGetEnviron())
1890 AC_ARG_ENABLE([stats],
1891 [AS_HELP_STRING([--disable-stats],
1892 [disable bus daemon usage statistics])],
1893 [], [enable_stats=yes])
1894 if test "x$enable_stats" = xyes; then
1895 AC_DEFINE([DBUS_ENABLE_STATS], [1],
1896 [Define to enable bus daemon usage statistics])
1899 AC_ARG_ENABLE([user-session],
1900 [AS_HELP_STRING([--enable-user-session],
1901 [enable user-session semantics for session bus under systemd])],
1902 [], [enable_user_session=no])
1903 AM_CONDITIONAL([DBUS_ENABLE_USER_SESSION],
1904 [test "x$enable_user_session" = xyes])
1906 #enable smack label support
1907 AC_ARG_ENABLE([smack], [AS_HELP_STRING([--enable-smack], [enable SMACK security checks])], [], [enable_smack=no])
1908 if test "x$enable_smack" = xyes; then
1909 PKG_CHECK_MODULES([LIBSMACK], [libsmack >= 1.0],
1910 [AC_DEFINE([DBUS_ENABLE_SMACK], [1], [Define to enable SMACK security features])],
1911 [AC_MSG_ERROR([libsmack is required to enable smack support])])
1914 AC_SUBST([LIBSMACK_CFLAGS])
1915 AC_SUBST([LIBSMACK_LIBS])
1917 #enable cynara integration
1918 AC_ARG_ENABLE([cynara], [AS_HELP_STRING([--enable-cynara], [enable Cynara integration])], [], [enable_cynara=no])
1919 if test "x$enable_cynara" = xyes; then
1920 PKG_CHECK_MODULES([CYNARA], [cynara-client-async >= 0.4.2 cynara-session >= 0.4.2],
1921 [AC_DEFINE([DBUS_ENABLE_CYNARA], [1], [Define to enable Cynara privilege checks in dbus-daemon])],
1922 [AC_MSG_ERROR([libcynara-client-async and cynara-session are required to enable Cynara integration])])
1925 AC_SUBST([CYNARA_CFLAGS])
1926 AC_SUBST([CYNARA_LIBS])
1933 dbus/dbus-arch-deps.h
1936 bus/legacy-config/system.conf
1937 bus/legacy-config/session.conf
1938 bus/example-system-enable-stats.conf
1939 bus/example-session-disable-stats.conf
1941 bus/messagebus-config
1942 bus/org.freedesktop.dbus-session.plist
1946 bus/systemd-user/dbus.service
1947 bus/systemd-user/dbus.socket
1953 test/name-test/Makefile
1955 doc/dbus-cleanup-sockets.1.xml
1956 doc/dbus-daemon.1.xml
1957 doc/dbus-launch.1.xml
1958 doc/dbus-monitor.1.xml
1959 doc/dbus-run-session.1.xml
1961 doc/dbus-test-tool.1.xml
1962 doc/dbus-update-activation-environment.1.xml
1963 doc/dbus-uuidgen.1.xml
1965 dbus-1-uninstalled.pc
1966 test/data/valid-config-files/debug-allow-all.conf
1967 test/data/valid-config-files/debug-allow-all-sha1.conf
1968 test/data/valid-config-files/debug-check-some.conf
1969 test/data/valid-config-files/incoming-limit.conf
1970 test/data/valid-config-files-system/debug-allow-all-pass.conf
1971 test/data/valid-config-files-system/debug-allow-all-fail.conf
1972 test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service
1973 test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service
1974 test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service
1975 test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service
1976 test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
1977 test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
1978 test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteEchoService.service
1979 test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteSegfaultService.service
1980 test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
1981 test/data/valid-service-files-system/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
1982 test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.service
1983 test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service
1984 test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service
1988 dnl ==========================================================================
1993 prefix: ${EXPANDED_PREFIX}
1994 exec_prefix: ${exec_prefix}
1995 libdir: ${EXPANDED_LIBDIR}
1996 libexecdir: ${EXPANDED_LIBEXECDIR}
1997 bindir: ${EXPANDED_BINDIR}
1998 sysconfdir: ${EXPANDED_SYSCONFDIR}
1999 localstatedir: ${EXPANDED_LOCALSTATEDIR}
2000 datadir: ${EXPANDED_DATADIR}
2001 source code location: ${srcdir}
2004 cppflags: ${CPPFLAGS}
2005 cxxflags: ${CXXFLAGS}
2006 64-bit int: ${DBUS_INT64_TYPE}
2007 32-bit int: ${DBUS_INT32_TYPE}
2008 16-bit int: ${DBUS_INT16_TYPE}
2009 Doxygen: ${DOXYGEN:-not found}
2010 xmlto: ${XMLTO:-not found}
2011 ducktype: ${DUCKTYPE:-not found}
2012 yelp-build: ${YELP_BUILD:-not found}"
2015 Rebuilding generated files: ${USE_MAINTAINER_MODE}
2016 gcc coverage profiling: ${enable_compiler_coverage}
2017 Building embedded tests: ${enable_embedded_tests}
2018 Building modular tests: ${enable_modular_tests}
2019 - with GLib: ${with_glib}
2020 Installing tests: ${enable_installed_tests}
2021 Building verbose mode: ${enable_verbose_mode}
2022 Building assertions: ${enable_asserts}
2023 Building checks: ${enable_checks}
2024 Building bus stats API: ${enable_stats}
2025 Building SELinux support: ${have_selinux}
2026 Building AppArmor support: ${have_apparmor}
2027 Building SMACK support: ${enable_smack}
2028 Building inotify support: ${have_inotify}
2029 Building kqueue support: ${have_kqueue}
2030 Building systemd support: ${have_systemd}
2031 Building X11 code: ${have_x11}
2032 Building Doxygen docs: ${enable_doxygen_docs}
2033 Building Ducktype docs: ${enable_ducktype_docs}
2034 Building XML docs: ${enable_xml_docs}
2035 Building launchd support: ${have_launchd}
2036 Building kdbus support: ${enable_kdbus_transport}
2037 with libdbuspolicy: ${enable_libdbuspolicy}
2038 with sync calls: ${enable_kdbus_sync_calls}
2039 Init scripts style: ${with_init_scripts}
2040 Abstract socket names: ${ac_cv_have_abstract_sockets}
2041 System bus socket: ${DBUS_SYSTEM_SOCKET}
2042 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
2043 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
2044 Session bus listens on: ${DBUS_SESSION_BUS_LISTEN_ADDRESS}
2045 Session clients connect to: ${DBUS_SESSION_BUS_CONNECT_ADDRESS}
2046 Console auth dir: ${DBUS_CONSOLE_AUTH_DIR}
2047 Console owner file: ${have_console_owner_file}
2048 Console owner file path: ${DBUS_CONSOLE_OWNER_FILE}
2049 System bus user: ${DBUS_USER}
2050 Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services
2051 'make check' socket dir: ${TEST_SOCKET_DIR}
2053 if test x$have_launchd = xyes; then
2054 echo " launchd agent dir: ${LAUNCHD_AGENT_DIR}"
2058 if test x$enable_embedded_tests = xyes; then
2059 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
2061 if test x$enable_embedded_tests = xyes -a x$enable_asserts = xno; then
2062 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)"
2064 if test x$enable_compiler_coverage = xyes; then
2065 echo "NOTE: building with coverage profiling is definitely for developers only."
2067 if test x$enable_verbose_mode = xyes; then
2068 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
2070 if test x$enable_asserts = xyes; then
2071 echo "NOTE: building with assertions increases library size and decreases performance."
2073 if test x$enable_checks = xno; then
2074 echo "NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-Bus, but will slightly decrease D-Bus library size and _very_ slightly improve performance."