patch: bus: Fix timeout restarts
[platform/upstream/dbus.git] / configure.ac
1 dnl -*- mode: m4 -*-
2 AC_PREREQ([2.63])
3
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])
11
12 AC_CANONICAL_HOST
13
14 AC_CONFIG_HEADERS([config.h])
15 AC_CONFIG_MACRO_DIR([m4])
16
17 AM_INIT_AUTOMAKE([1.13 tar-ustar -Wno-portability subdir-objects])
18
19 GETTEXT_PACKAGE=dbus-1
20 AC_SUBST(GETTEXT_PACKAGE)
21 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
22
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])
26
27 m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
28
29 AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable])
30
31 # libtool versioning - this applies to libdbus
32 #
33 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
34 #
35
36 ## increment if the interface has additions, changes, removals.
37 LT_CURRENT=17
38
39 ## increment any time the source changes; set to
40 ##  0 if you increment CURRENT
41 LT_REVISION=6
42
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.
46 LT_AGE=14
47
48 AC_SUBST(LT_CURRENT)
49 AC_SUBST(LT_REVISION)
50 AC_SUBST(LT_AGE)
51 SOVERSION=`expr ${LT_CURRENT} - ${LT_AGE}`
52 AC_SUBST([SOVERSION])
53
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
58
59 AC_SUBST(DBUS_MAJOR_VERSION)
60 AC_SUBST(DBUS_MINOR_VERSION)
61 AC_SUBST(DBUS_MICRO_VERSION)
62 AC_SUBST(DBUS_VERSION)
63
64 AC_PROG_CC
65 AM_PROG_CC_C_O
66 AC_PROG_CXX
67 AC_USE_SYSTEM_EXTENSIONS
68 AC_ISC_POSIX
69 AC_HEADER_STDC
70 AC_C_INLINE
71 AM_PROG_LIBTOOL
72 AC_PROG_MKDIR_P
73 COMPILER_COVERAGE
74 COMPILER_OPTIMISATIONS
75 PKG_PROG_PKG_CONFIG
76
77 # TAP test driver support
78 AC_PROG_AWK
79 AC_REQUIRE_AUX_FILE([tap-driver.sh])
80
81 # This must come before we set up compiler warnings because it assumes
82 # non-use of -Werror=missing-prototypes
83 gl_VISIBILITY
84 AM_CONDITIONAL([HAVE_VISIBILITY], [test "x$HAVE_VISIBILITY" = x1])
85
86 # Initialize libtool
87 LT_INIT([win32-dll])
88 LT_LANG([Windows Resource])
89
90 # Set some internal variables depending on the platform for later use.
91 dbus_win=no
92 dbus_cygwin=no
93 dbus_unix=no
94 case "${host}" in
95     *-mingw32ce*)
96         dbus_win=yes
97         dbus_wince=yes
98         ;;
99     *-mingw32*)
100         dbus_win=yes
101         ;;
102     *-cygwin*)
103         dbus_cygwin=yes
104         dbus_unix=yes
105         ;;
106     *)
107         dbus_unix=yes
108        ;;
109 esac
110
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.])
125     fi
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])
129     fi
130 else
131     AC_DEFINE(DBUS_UNIX,1,[Defined if we run on a Unix-based system])
132 fi
133 if test "$dbus_cygwin" = yes; then
134     AC_DEFINE(DBUS_CYGWIN,1,[Defined if we run on a cygwin API based system])
135 fi
136
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])
143
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)
148
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])],
153   [],
154   [enable_developer=no])
155
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
163 fi
164 AC_SUBST([DBUS_STATIC_BUILD_CPPFLAGS])
165
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])
191
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]))
205
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]),
219   [
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.)])
223   fi
224   enable_embedded_tests=$enableval
225   enable_modular_tests=$enableval
226   ],
227   [])
228
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])
236 fi
237
238 # call early to ensure availability
239 PKG_PROG_PKG_CONFIG
240
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
244 # or binaries.
245
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])
248
249 with_glib=yes
250
251 AS_IF([test "x$enable_modular_tests" != xno],
252   [
253   PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.36, gio-2.0 >= 2.36],
254     [],
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"
259       with_glib=no
260     fi])
261   ],
262   [with_glib=no])
263
264 if test "x$enable_modular_tests" != xno; then
265   AC_DEFINE([DBUS_ENABLE_MODULAR_TESTS], [1],
266     [Define to build independent test binaries])
267 fi
268 AM_CONDITIONAL([DBUS_ENABLE_MODULAR_TESTS],
269   [test "x$enable_modular_tests" != xno])
270
271 if test "x$with_glib" != xno; then
272   AC_DEFINE([DBUS_WITH_GLIB], [1],
273     [Define if GLib, GObject, GIO are available])
274 fi
275 AM_CONDITIONAL([DBUS_WITH_GLIB], [test "x$with_glib" != xno])
276
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])
283
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
290     AC_MSG_RESULT([yes])
291   else
292     AC_MSG_RESULT([no])
293     AC_MSG_ERROR([cannot import dbus, gi.repository.GObject, dbus.mainloop.glib Python modules])
294   fi
295 else
296   # --enable-tests not given: do not abort if Python is missing
297   AM_PATH_PYTHON([2.6], [], [:])
298 fi
299
300 if test x$enable_verbose_mode = xyes; then
301     AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
302 fi
303
304 if test x$enable_asserts = xno; then
305     AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
306     DISABLE_UNUSED_WARNINGS="unused-label"
307     R_DYNAMIC_LDFLAG=""
308     if test x$enable_embedded_tests = xyes; then
309         DISABLE_UNUSED_WARNINGS="$DISABLE_UNUSED_WARNINGS \
310                 unused-but-set-variable unused-variable \
311                 unused-function"
312     fi
313 else
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).
319
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
323 fi
324 AC_SUBST(R_DYNAMIC_LDFLAG)
325
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"
330 fi
331
332 AH_BOTTOM([
333 /* explicitly define these macros to get less confusing conditions */
334 #ifndef DBUS_DISABLE_ASSERT
335 #  define DBUS_ENABLE_ASSERT 1
336 #endif
337 #ifndef DBUS_DISABLE_CHECKS
338 #  define DBUS_ENABLE_CHECKS 1
339 #endif])
340
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])
344 fi
345
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.
351
352 # Test for the GNU C Library, version 2.1 or newer.
353 # From Bruno Haible.
354
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],
358     [
359 #include <features.h>
360 #ifdef __GNU_LIBRARY__
361  #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
362   Lucky GNU user
363  #endif
364 #endif
365     ],
366     ac_cv_gnu_library_2_1=yes,
367     ac_cv_gnu_library_2_1=no)
368   ]
369 )
370
371 #### Integer sizes
372
373 AC_CHECK_SIZEOF(char)
374 AC_CHECK_SIZEOF(short)
375 AC_CHECK_SIZEOF(long)
376 AC_CHECK_SIZEOF(int)
377 AC_CHECK_SIZEOF(void *)
378 AC_CHECK_SIZEOF(long long)
379 AC_CHECK_SIZEOF(__int64)
380
381 ### See what our 64 bit type is called
382 AC_MSG_CHECKING([64-bit integer type])
383
384 case 8 in
385 $ac_cv_sizeof_int)
386   dbusint64=int
387   dbusint64_constant='(val)'
388   dbusuint64_constant='(val)'
389   dbusint64_printf_modifier='""'
390   ;;
391 $ac_cv_sizeof_long)
392   dbusint64=long
393   dbusint64_constant='(val##L)'
394   dbusuint64_constant='(val##UL)'
395   dbusint64_printf_modifier='"l"'
396   ;;
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"'
405   fi
406   ;;
407 $ac_cv_sizeof___int64)
408   dbusint64=__int64
409   dbusint64_constant='(val##i64)'
410   dbusuint64_constant='(val##ui64)'
411   # See above case
412   if test x"$ac_cv_gnu_library_2_1" = xyes; then
413     dbusint64_printf_modifier='"ll"'
414   fi
415   ;;
416 esac
417
418 AS_IF(
419   [test -z "$dbusint64"],
420   [AC_MSG_RESULT([not found])
421   AC_MSG_ERROR([Could not find a 64-bit integer type.
422
423 Please report a bug here with details of your platform and compiler:
424
425     http://bugs.freedesktop.org/enter_bug.cgi?product=DBus&component=core])
426   ],
427   dnl else
428   [
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])
434         fi
435         AC_MSG_RESULT($DBUS_INT64_TYPE)
436   ])
437
438 AC_SUBST(DBUS_INT64_TYPE)
439 AC_SUBST(DBUS_INT64_CONSTANT)
440 AC_SUBST(DBUS_UINT64_CONSTANT)
441
442 ### see what 32-bit int is called
443 AC_MSG_CHECKING([32-bit integer type])
444
445 case 4 in
446 $ac_cv_sizeof_short)
447   dbusint32=short
448   ;;
449 $ac_cv_sizeof_int)
450   dbusint32=int
451   ;;
452 $ac_cv_sizeof_long)
453   dbusint32=long
454   ;;
455 esac
456
457 if test -z "$dbusint32" ; then
458         DBUS_INT32_TYPE="no_int32_type_detected"
459         AC_MSG_ERROR([No 32-bit integer type found])
460 else
461         DBUS_INT32_TYPE="$dbusint32"
462         AC_MSG_RESULT($DBUS_INT32_TYPE)
463 fi
464
465 AC_SUBST(DBUS_INT32_TYPE)
466
467 ### see what 16-bit int is called
468 AC_MSG_CHECKING([16-bit integer type])
469
470 case 2 in
471 $ac_cv_sizeof_short)
472   dbusint16=short
473   ;;
474 $ac_cv_sizeof_int)
475   dbusint16=int
476   ;;
477 esac
478
479 if test -z "$dbusint16" ; then
480         DBUS_INT16_TYPE="no_int16_type_detected"
481         AC_MSG_ERROR([No 16-bit integer type found])
482 else
483         DBUS_INT16_TYPE="$dbusint16"
484         AC_MSG_RESULT($DBUS_INT16_TYPE)
485 fi
486
487 AC_SUBST(DBUS_INT16_TYPE)
488
489 ## byte order
490 case $host_os in
491         darwin*)
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
498                         #endif
499                 ])
500                 ;;
501         *)
502                 AC_C_BIGENDIAN
503                 ;;
504 esac
505
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>
513 #include <stdlib.h>
514         static void f (int i, ...) {
515         va_list args1, args2;
516         va_start (args1, i);
517         va_copy (args2, args1);
518         if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
519           exit (1);
520         va_end (args1); va_end (args2);
521         }
522         int main() {
523           f (0, 42);
524           return 0;
525         }])],
526         [dbus_cv_va_copy=yes],
527         [dbus_cv_va_copy=no])
528 ])
529 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
530         AC_LINK_IFELSE([AC_LANG_SOURCE([#include <stdarg.h>
531 #include <stdlib.h>
532         static void f (int i, ...) {
533         va_list args1, args2;
534         va_start (args1, i);
535         __va_copy (args2, args1);
536         if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
537           exit (1);
538         va_end (args1); va_end (args2);
539         }
540         int main() {
541           f (0, 42);
542           return 0;
543         }])],
544         [dbus_cv___va_copy=yes],
545         [dbus_cv___va_copy=no])
546 ])
547
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
552 fi
553 fi
554
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])
557 fi
558
559 AC_LANG_PUSH(C)
560 AC_CACHE_CHECK([whether va_lists can be copied by value],
561         dbus_cv_va_val_copy,
562         [AC_RUN_IFELSE([AC_LANG_PROGRAM(
563 [[
564         #include <stdarg.h>
565         #include <stdlib.h>
566 ]],
567 [[
568         static void f (int i, ...) {
569         va_list args1, args2;
570         va_start (args1, i);
571         args2 = args1;
572         if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
573           exit (1);
574         va_end (args1); va_end (args2);
575         }
576         int main() {
577           f (0, 42);
578           return 0;
579         }
580 ]])],
581         [dbus_cv_va_val_copy=yes],
582         [dbus_cv_va_val_copy=no],
583         [dbus_cv_va_val_copy=yes])
584 ])
585 AC_LANG_POP(C)
586
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])
589 fi
590
591
592 #### Atomic integers
593
594 AC_CACHE_CHECK([whether $CC knows __sync_sub_and_fetch()],
595   dbus_cv_sync_sub_and_fetch,
596   [AC_LINK_IFELSE([
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])
600   ])
601
602 if test "x$dbus_cv_sync_sub_and_fetch" = "xyes" ; then
603    have_sync=1
604 else
605    have_sync=0
606 fi
607
608 AC_DEFINE_UNQUOTED([DBUS_USE_SYNC], [$have_sync], [Use the gcc __sync extension])
609
610 #### Various functions
611 AC_SEARCH_LIBS(socket,[socket network])
612 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
613
614 AC_CHECK_FUNCS([vsnprintf vasprintf nanosleep usleep setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit poll setlocale localeconv strtoll strtoull issetugid getresuid setresuid getrlimit])
615
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>]])
619 fi
620
621 # For test-segfault.c
622 AC_CHECK_HEADERS_ONCE([sys/prctl.h])
623 AC_CHECK_FUNCS_ONCE([prctl raise])
624
625 #### Check for broken poll; taken from Glib's configure
626
627 AC_MSG_CHECKING([for broken poll])
628 AC_RUN_IFELSE([AC_LANG_SOURCE([[
629     #include <stdlib.h>
630     #include <fcntl.h>
631     #include <poll.h>
632     #ifdef HAVE_SYS_POLL_H
633     #include <sys/poll.h>
634     #endif
635     int main(void) {
636       struct pollfd fds[1];
637       int fd;
638       fd = open("/dev/null", 1);
639       fds[0].fd = fd;
640       fds[0].events = POLLIN;
641       fds[0].revents = 0;
642       if (poll(fds, 1, 0) < 0 || (fds[0].revents & POLLNVAL) != 0) {
643             exit(1);  /* Does not work for devices -- fail */
644       }
645       exit(0);
646     }]])],
647   [broken_poll=no],
648   [broken_poll=yes
649    AC_DEFINE(BROKEN_POLL,1,[poll doesn't work on devices])],
650   [broken_poll="no (cross compiling)"])
651 AC_MSG_RESULT($broken_poll)
652
653 AC_MSG_CHECKING(for dirfd)
654 AC_LINK_IFELSE([AC_LANG_PROGRAM([[
655 #include <sys/types.h>
656 #include <dirent.h>
657 ]], [[
658 DIR *dirp;
659 dirp = opendir(".");
660 dirfd(dirp);
661 closedir(dirp);
662 ]])],
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])
668 else
669         AC_MSG_CHECKING(for DIR *dirp->dd_fd)
670         AC_LINK_IFELSE([AC_LANG_PROGRAM([[
671 #include <sys/types.h>
672 #include <dirent.h>
673         ]], [[
674 DIR *dirp;
675 int fd;
676 dirp = opendir(".");
677 fd = dirp->dd_fd;
678 closedir(dirp);
679         ]])],
680         [dbus_have_ddfd=yes],
681         [dbus_have_ddfd=no])
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])
685         fi
686 fi
687
688 AC_CHECK_HEADERS(sys/resource.h)
689
690 AC_CHECK_HEADERS(dirent.h)
691
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().])])])
696
697 AC_CHECK_HEADERS(errno.h)
698
699 AC_CHECK_HEADERS(signal.h)
700
701 AC_CHECK_HEADERS(locale.h)
702
703 AC_CHECK_HEADERS(byteswap.h)
704
705 AC_CHECK_HEADERS(unistd.h)
706
707 AC_CHECK_HEADERS(ws2tcpip.h)
708
709 AC_CHECK_HEADERS(alloca.h)
710
711 # Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
712 #
713 case $host_os in
714     solaris*)
715        CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
716 esac
717
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
723 AC_LANG_PUSH(C)
724 AC_CACHE_CHECK([for posix getpwnam_r],
725                 ac_cv_func_posix_getpwnam_r,
726                 [AC_RUN_IFELSE([AC_LANG_PROGRAM(
727 [[
728 #include <errno.h>
729 #include <pwd.h>
730 ]],
731 [[
732     char buffer[10000];
733     struct passwd pwd, *pwptr = &pwd;
734     int error;
735     errno = 0;
736     error = getpwnam_r ("", &pwd, buffer,
737                         sizeof (buffer), &pwptr);
738    return (error < 0 && errno == ENOSYS)
739            || error == ENOSYS;
740 ]])],
741         [ac_cv_func_posix_getpwnam_r=yes],
742         [ac_cv_func_posix_getpwnam_r=no],
743         [ac_cv_func_posix_getpwnam_r=yes]
744 )])
745 AC_LANG_POP(C)
746
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])
750 else
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];
754                         struct passwd pwd;
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])
762         fi
763 fi
764
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>
770 #include <netdb.h>
771 ]], [[
772 socklen_t foo;
773 foo = 1;
774 ]])],
775 [dbus_have_socklen_t=yes],
776 [dbus_have_socklen_t=no])
777 AC_MSG_RESULT($dbus_have_socklen_t)
778
779 if test "x$dbus_have_socklen_t" = "xyes"; then
780     AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
781 fi
782
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)])
786
787 dnl needed on darwin for NAME_MAX
788 AC_CHECK_HEADERS(sys/syslimits.h)
789
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> ]])
793
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__)
799 call_a(2,3);
800 ]])],
801 [dbus_have_iso_c_varargs=yes],
802 [dbus_have_iso_c_varargs=no])
803 AC_MSG_RESULT($dbus_have_iso_c_varargs)
804
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)
809 call_a(2,3);
810 ]])],
811 [dbus_have_gnuc_varargs=yes],
812 [dbus_have_gnuc_varargs=no])
813 AC_MSG_RESULT($dbus_have_gnuc_varargs)
814
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])
818 fi
819 if test x$dbus_have_gnuc_varargs = xyes; then
820     AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
821 fi
822
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>
828 ]], [[
829 struct cmsgcred cred;
830
831 cred.cmcred_pid = 0;
832 ]])],
833 [dbus_have_struct_cmsgcred=yes],
834 [dbus_have_struct_cmsgcred=no])
835 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
836
837 if test x$dbus_have_struct_cmsgcred = xyes; then
838     AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
839 fi
840
841 AC_CHECK_MEMBER([struct unpcbid.unp_pid],
842                 [AC_DEFINE([HAVE_UNPCBID], 1, [Have unpcbid structure])],
843                 [],
844                 [[#include <sys/un.h>]])
845
846 AC_CHECK_FUNCS(getpeerucred getpeereid)
847
848 AC_CHECK_FUNCS(pipe2 accept4)
849
850 #### Abstract sockets
851
852 if test x$enable_abstract_sockets = xauto; then
853 AC_LANG_PUSH(C)
854 warn_on_xcompile=no
855 AC_CACHE_CHECK([abstract socket namespace],
856                 ac_cv_have_abstract_sockets,
857                 [AC_RUN_IFELSE([AC_LANG_PROGRAM(
858 [[
859 #include <sys/types.h>
860 #include <stdlib.h>
861 #include <string.h>
862 #include <stdio.h>
863 #include <sys/socket.h>
864 #include <sys/un.h>
865 #include <errno.h>
866 ]],
867 [[
868   size_t slen;
869   int listen_fd;
870   struct sockaddr_un addr;
871
872   listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
873
874   if (listen_fd < 0)
875     {
876       fprintf (stderr, "socket() failed: %s\n", strerror (errno));
877       exit (1);
878     }
879
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
884    * beginning.
885    */
886   slen = SUN_LEN(&addr);
887   addr.sun_path[0] = '\0'; /* this is what makes it abstract */
888
889   if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
890     {
891        fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
892                 strerror (errno));
893        exit (1);
894     }
895   else
896     exit (0);
897 ]])],
898               [ac_cv_have_abstract_sockets=yes],
899               [ac_cv_have_abstract_sockets=no],
900               [
901                 ac_cv_have_abstract_sockets=no
902                 warn_on_xcompile=yes
903               ]
904 )])
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])
907 fi
908 AC_LANG_POP(C)
909 fi
910
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.])
914     fi
915 fi
916
917 if test x$enable_abstract_sockets = xno; then
918    ac_cv_have_abstract_sockets=no;
919 fi
920
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])
924 else
925    DBUS_PATH_OR_ABSTRACT=path
926 fi
927
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)
931
932 #### Sort out XML library
933
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]) ])
938
939 XML_LIBS=-lexpat
940 XML_CFLAGS=
941 AC_SUBST([XML_CFLAGS])
942 AC_SUBST([XML_LIBS])
943
944 # Thread lib detection
945 AC_ARG_VAR([THREAD_LIBS])
946 save_libs="$LIBS"
947 LIBS="$LIBS $THREAD_LIBS"
948
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."
950
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.
953 #
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],
957   [
958     # Mandatory pthread functions. In principle, some of these could be made
959     # optional if there are platforms that don't have them.
960     #
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],
965         [pthread],
966         [THREAD_LIBS="$LIBS"],
967         [AC_MSG_ERROR([pthread_cond_timedwait $is_missing_pthread_function])],
968         [])
969     AC_SEARCH_LIBS([pthread_mutexattr_init],
970         [pthread],
971         [THREAD_LIBS="$LIBS"],
972         [AC_MSG_ERROR([pthread_mutexattr_init $is_missing_pthread_function])],
973         [])
974     AC_SEARCH_LIBS([pthread_mutexattr_settype],
975         [pthread],
976         [THREAD_LIBS="$LIBS"],
977         [AC_MSG_ERROR([pthread_mutexattr_settype $is_missing_pthread_function])],
978         [])
979
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],
983         [pthread],
984         [THREAD_LIBS="$LIBS"])
985
986     AS_IF([test "x$ac_cv_search_pthread_condattr_setclock" != xno],
987       [
988         AC_SEARCH_LIBS([clock_getres], [rt], [THREAD_LIBS="$LIBS"])
989         AC_MSG_CHECKING([for CLOCK_MONOTONIC])
990         AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
991 [[#include <time.h>
992 #include <pthread.h>
993 ]], [[
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);
999 ]])],
1000             [have_clock_monotonic=true],
1001             [have_clock_monotonic=false])
1002         AS_IF([test x$have_clock_monotonic = xtrue],
1003           [
1004             AC_MSG_RESULT([found])
1005             AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, [Define if we have CLOCK_MONOTONIC])
1006           ],
1007           [AC_MSG_RESULT([not found])])
1008       ]) dnl have pthread_condattr_setclock
1009   ]) dnl on Unix
1010
1011 LIBS="$save_libs"
1012
1013 AC_SUBST([THREAD_LIBS])
1014
1015 # SELinux detection
1016 if test x$enable_selinux = xno ; then
1017     have_selinux=no;
1018 else
1019     # See if we have SELinux library
1020     AC_CHECK_LIB(selinux, is_selinux_enabled,
1021                  have_selinux=yes, have_selinux=no)
1022
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;
1028                             #else
1029                             #error DBUS__ACQUIRE_SVC not defined
1030                             #endif]])],
1031                           [have_selinux=yes],
1032                           [have_selinux=no])
1033         AC_MSG_RESULT($have_selinux)
1034     fi
1035
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])
1039         fi
1040     else
1041         if test x$have_selinux = xno ; then
1042                 AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
1043         fi
1044     fi
1045 fi
1046
1047 AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
1048
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"])])
1054
1055     SELINUX_LIBS="-lselinux $SELINUX_THREAD_LIBS"
1056     AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
1057 else
1058     SELINUX_LIBS=
1059 fi
1060
1061 # AppArmor detection
1062 AS_IF([test x$enable_apparmor = xno],
1063   [have_apparmor=no],
1064   [
1065   PKG_CHECK_MODULES([APPARMOR], [libapparmor >= 2.8.95],
1066                     [have_apparmor=yes], [have_apparmor=no])
1067
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])])
1072   ])
1073
1074 AS_IF([test x$have_apparmor = xyes],
1075       [AC_DEFINE([HAVE_APPARMOR], [1], [AppArmor Support])])
1076
1077 # inotify checks
1078 if test x$enable_inotify = xno ; then
1079     have_inotify=no;
1080 else
1081     AC_CHECK_HEADERS(sys/inotify.h, have_inotify=yes, have_inotify=no)
1082 fi
1083
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)
1088 fi
1089
1090 AM_CONDITIONAL(DBUS_BUS_ENABLE_INOTIFY, test x$have_inotify = xyes)
1091
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
1099     have_linux_epoll=no
1100 else
1101     AC_MSG_CHECKING([for Linux epoll(4)])
1102     AC_LINK_IFELSE([AC_LANG_PROGRAM(
1103         [
1104         #ifndef __linux__
1105         #error This is not Linux
1106         #endif
1107         #include <sys/epoll.h>
1108         ],
1109         [epoll_create1 (EPOLL_CLOEXEC);])],
1110         [have_linux_epoll=yes],
1111         [have_linux_epoll=no])
1112     AC_MSG_RESULT([$have_linux_epoll])
1113 fi
1114 if test x$enable_epoll,$have_linux_epoll = xyes,no; then
1115     AC_MSG_ERROR([epoll support explicitly enabled but not available])
1116 fi
1117 if test x$have_linux_epoll = xyes; then
1118   AC_DEFINE([DBUS_HAVE_LINUX_EPOLL], 1, [Define to use epoll(4) on Linux])
1119 fi
1120 AM_CONDITIONAL([HAVE_LINUX_EPOLL], [test x$have_linux_epoll = xyes])
1121
1122 # kqueue checks
1123 if test x$enable_kqueue = xno ; then
1124     have_kqueue=no
1125 else
1126     have_kqueue=yes
1127     AC_CHECK_HEADER(sys/event.h, , have_kqueue=no)
1128     AC_CHECK_FUNC(kqueue, , have_kqueue=no)
1129
1130     if test x$enable_kqueue = xyes -a x$have_kqueue = xno; then
1131         AC_MSG_ERROR(kqueue support explicitly enabled but not available)
1132     fi
1133 fi
1134
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])
1138 fi
1139
1140 AM_CONDITIONAL(DBUS_BUS_ENABLE_KQUEUE, test x$have_kqueue = xyes)
1141
1142 # launchd checks
1143 if test x$enable_launchd = xno ; then
1144     have_launchd=no
1145 else
1146     have_launchd=yes
1147     AC_CHECK_HEADER([launch.h], , have_launchd=no)
1148     AC_PATH_PROG([LAUNCHCTL], [launchctl])
1149     if test "x$LAUNCHCTL" = "x"; then
1150         have_launchd=no
1151     fi
1152
1153     if test x$enable_launchd = xyes && test x$have_launchd = xno ; then
1154         AC_MSG_ERROR([launchd support explicitly enabled but not available])
1155     fi
1156 fi
1157
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])
1161 fi
1162
1163 AM_CONDITIONAL(DBUS_ENABLE_LAUNCHD, test x$have_launchd = xyes)
1164
1165 #### Directory to place launchd agent file
1166 if test "x$with_launchd_agent_dir" = "x"; then
1167    LAUNCHD_AGENT_DIR="/Library/LaunchAgents"
1168 else
1169    LAUNCHD_AGENT_DIR="$with_launchd_agent_dir"
1170 fi
1171
1172 AC_SUBST(LAUNCHD_AGENT_DIR)
1173
1174 dnl console owner file
1175 if test x$enable_console_owner_file = xno ; then
1176     have_console_owner_file=no;
1177 else
1178     case $host_os in
1179     solaris*)
1180         have_console_owner_file=yes;
1181         AC_DEFINE(HAVE_CONSOLE_OWNER_FILE,1,[Have console owner file])
1182         ;;
1183     *)
1184         have_console_owner_file=no;;
1185     esac
1186 fi
1187
1188 AM_CONDITIONAL(HAVE_CONSOLE_OWNER_FILE, test x$have_console_owner_file = xyes)
1189
1190 dnl systemd detection
1191 if test x$enable_systemd = xno ; then
1192     have_systemd=no;
1193 else
1194     PKG_CHECK_MODULES([SYSTEMD],
1195         [libsystemd >= 209],
1196         [have_systemd=yes],
1197         [PKG_CHECK_MODULES([SYSTEMD],
1198             [libsystemd-login >= 32, libsystemd-daemon >= 32, libsystemd-journal >= 32],
1199             [have_systemd=yes],
1200             [have_systemd=no])])
1201 fi
1202
1203 if test x$have_systemd = xyes; then
1204     AC_DEFINE(HAVE_SYSTEMD,1,[Have systemd])
1205 fi
1206
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])
1209 fi
1210
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])
1216
1217 # libaudit detection
1218 if test x$enable_libaudit = xno ; then
1219     have_libaudit=no;
1220 else
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)
1227     fi
1228 fi
1229
1230 AM_CONDITIONAL(HAVE_LIBAUDIT, test x$have_libaudit = xyes)
1231
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])
1235 fi
1236
1237 AC_SUBST([SELINUX_LIBS])
1238
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 ])
1245
1246 if test ${check_adt_audit} = yes
1247 then
1248    AC_DEFINE([HAVE_ADT], [], [Adt audit API])
1249    ADT_LIBS="-lbsm"
1250    LIBS="-lbsm $LIBS"
1251    AC_MSG_RESULT(yes)
1252 else
1253    AC_MSG_RESULT(no)
1254 fi
1255 AC_SUBST([ADT_LIBS])
1256
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>
1262 #include <sys/un.h>
1263 static int x = SCM_RIGHTS;
1264 ]], [[]])],
1265 [ AC_MSG_RESULT([supported])
1266   AC_DEFINE([HAVE_UNIX_FD_PASSING], [1], [Supports sending UNIX file descriptors]) ],
1267 [ AC_MSG_RESULT([not supported]) ])
1268
1269 NETWORK_libs=
1270 if test x$dbus_win = xyes ; then
1271   if test x$dbus_wince = xyes ; then
1272     NETWORK_libs="-lws2"
1273   else
1274     NETWORK_libs="-lws2_32 -liphlpapi"
1275   fi
1276 fi
1277
1278 AC_SUBST([NETWORK_libs])
1279
1280 AC_ARG_WITH([valgrind],
1281   [AS_HELP_STRING([--with-valgrind],
1282      [Add instrumentation to help valgrind to understand our allocator])],
1283   [],
1284   [with_valgrind=no])
1285
1286 AS_IF([test "x$with_valgrind" = xauto],
1287   [PKG_CHECK_EXISTS([valgrind >= 3.6],
1288     [with_valgrind=yes], [with_valgrind=no])])
1289
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])
1293 fi
1294
1295 ### kdbus support
1296 if test x$enable_kdbus_transport = xyes; then
1297     AC_DEFINE(ENABLE_KDBUS_TRANSPORT,1,[Enable kdbus transport support])
1298 fi
1299 AM_CONDITIONAL([ENABLE_KDBUS_TRANSPORT], [test x$enable_kdbus_transport = xyes])
1300
1301 if test x$enable_kdbus_sync_calls = xyes; then
1302     AC_DEFINE(ENABLE_KDBUS_SYNC_CALLS,1,[Enable kdbus sync calls support])
1303 fi
1304
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]) ])
1314
1315 #### Set up final flags
1316 LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $SYSTEMD_LIBS $KDBUS_LIBS"
1317 AC_SUBST([LIBDBUS_LIBS])
1318
1319 ### X11 detection
1320 DBUS_X_LIBS=
1321 DBUS_X_CFLAGS=
1322
1323 AC_ARG_ENABLE([x11-autolaunch],
1324   AS_HELP_STRING([--enable-x11-autolaunch], [build with X11 auto-launch support]),
1325   [], [enable_x11_autolaunch=auto])
1326
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])
1330     fi
1331
1332     enable_x11_autolaunch=no
1333     have_x11=no
1334 else
1335     AC_PATH_XTRA
1336
1337     if test "x$no_x" = xyes; then
1338         have_x11=no
1339     else
1340         have_x11=yes
1341         DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1342         DBUS_X_CFLAGS="$X_CFLAGS"
1343     fi
1344 fi
1345
1346 if test "x$enable_x11_autolaunch,$have_x11" = xyes,no; then
1347     AC_MSG_ERROR([X11 auto-launch requires X headers/libraries])
1348 else
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"
1352     fi
1353 fi
1354
1355 if test "x$have_x11" = xyes ; then
1356    AC_DEFINE([DBUS_BUILD_X11], [1], [Define to build X11 functionality])
1357 fi
1358
1359 if test "x$enable_x11_autolaunch" = xyes ; then
1360    AC_DEFINE([DBUS_ENABLE_X11_AUTOLAUNCH], [1], [Define to enable X11 auto-launch])
1361 fi
1362
1363 AC_SUBST([DBUS_X_CFLAGS])
1364 AC_SUBST([DBUS_X_LIBS])
1365
1366 #### gcc warning flags
1367
1368 cc_supports_flag() {
1369   AC_MSG_CHECKING(whether $CC supports "$*")
1370   save_CFLAGS="$CFLAGS"
1371   CFLAGS="$*"
1372   AC_TRY_COMPILE([], [], [rc=yes], [rc=no])
1373   CFLAGS="$save_CFLAGS"
1374   AC_MSG_RESULT([$rc])
1375   test "x$rc" = xyes
1376 }
1377
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],
1384
1385   dnl Enable these warnings if possible:
1386   [all \
1387    extra \
1388    char-subscripts \
1389    missing-declarations \
1390    missing-prototypes \
1391    nested-externs \
1392    pointer-arith \
1393    cast-align \
1394    no-address \
1395    float-equal \
1396    declaration-after-statement \
1397   ],
1398
1399   dnl Disable these warnings if possible, make them non-fatal if possible,
1400   dnl and don't enable -Werror unless we succeeded.
1401   dnl
1402   dnl Intentional:
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
1407   dnl
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 \
1414    unused-parameter \
1415    pointer-sign \
1416    type-limits \
1417   ])
1418
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])
1423
1424   # http://bugs.freedesktop.org/show_bug.cgi?id=10599
1425   TP_ADD_COMPILER_FLAG([WARNING_CFLAGS], [-fno-strict-aliasing])
1426
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])
1430   fi
1431 fi
1432
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"
1438
1439 case $host_os in
1440     solaris*)
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"
1447         ;;
1448 esac
1449
1450 ### Detect if ld supports --version-script
1451
1452 gl_LD_VERSION_SCRIPT
1453 AM_CONDITIONAL([HAVE_LD_VERSION_SCRIPT],
1454                [test "x$have_ld_version_script" = xyes])
1455 ### Doxygen Documentation
1456
1457 AC_PATH_PROG(DOXYGEN, doxygen, no)
1458
1459 AC_MSG_CHECKING([whether to build Doxygen documentation])
1460
1461 if test x$DOXYGEN = xno ; then
1462     have_doxygen=no
1463 else
1464     have_doxygen=yes
1465 fi
1466
1467 if test x$enable_doxygen_docs = xauto ; then
1468     if test x$have_doxygen = xno ; then
1469         enable_doxygen_docs=no
1470     else
1471         enable_doxygen_docs=yes
1472     fi
1473 fi
1474
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])
1478     fi
1479 fi
1480
1481 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
1482 AC_MSG_RESULT($enable_doxygen_docs)
1483
1484 AC_CHECK_PROGS([XSLTPROC], [xsltproc])
1485 AM_CONDITIONAL([DBUS_HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
1486
1487 ### Ducktype/Yelp documentation
1488
1489 AC_PATH_PROG([DUCKTYPE],[ducktype],[no])
1490 AC_PATH_PROG([YELP_BUILD],[yelp-build],[no])
1491
1492 AC_MSG_CHECKING([whether to build Ducktype documentation])
1493
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])
1496
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
1500     ],[
1501         enable_ducktype_docs=yes
1502     ])
1503 ])
1504
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])
1508     ])
1509     AS_IF([test "$have_yelp_build" = "no"],[
1510         AC_MSG_ERROR([Building Ducktype docs explicitly required, but yelp-build not found])
1511     ])
1512 ])
1513
1514 AM_CONDITIONAL([DBUS_DUCKTYPE_DOCS_ENABLED],[test "$enable_ducktype_docs" = "yes"])
1515 AC_MSG_RESULT([$enable_ducktype_docs])
1516
1517 ### XML Documentation
1518
1519 AC_PATH_PROG(XMLTO, xmlto, no)
1520
1521 AC_MSG_CHECKING([whether to build XML documentation])
1522
1523 if test x$XMLTO = xno ; then
1524     have_xmlto=no
1525 else
1526     have_xmlto=yes
1527 fi
1528
1529 if test x$enable_xml_docs = xauto ; then
1530     if test x$have_xmlto = xno ; then
1531         enable_xml_docs=no
1532     else
1533         enable_xml_docs=yes
1534     fi
1535 fi
1536
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])
1540     fi
1541 fi
1542
1543 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
1544 AC_MSG_RESULT($enable_xml_docs)
1545
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])
1549
1550 #### Have to go $localstatedir->$prefix/var->/usr/local/var
1551
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")
1562
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
1567 fi
1568
1569 if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
1570    operating_system=slackware
1571 fi
1572
1573 if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
1574    operating_system=cygwin
1575 fi
1576
1577 #### Sort out init scripts
1578
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 ;;
1585     esac
1586 fi
1587
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)
1591
1592 ##### systemd unit files
1593 AC_ARG_WITH([systemdsystemunitdir],
1594 AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
1595     [],
1596     [
1597     PKG_CHECK_EXISTS([systemd],
1598       [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)],
1599       [with_systemdsystemunitdir=no])
1600     ])
1601 if test "x$with_systemdsystemunitdir" != xno; then
1602    AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
1603 fi
1604 AM_CONDITIONAL(HAVE_SYSTEMD, [test "x$have_systemd" != "xno" -a -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
1605
1606 AC_ARG_WITH([systemduserunitdir],
1607 AS_HELP_STRING([--with-systemduserunitdir=DIR], [Directory for systemd user service files]),
1608     [],
1609     [
1610     PKG_CHECK_EXISTS([systemd],
1611       [with_systemduserunitdir=$($PKG_CONFIG --variable=systemduserunitdir systemd)],
1612       [with_systemduserunitdir='${libdir}/systemd/user'])
1613     ])
1614 AC_SUBST([systemduserunitdir], [$with_systemduserunitdir])
1615
1616 ##### Set up location for system bus socket
1617 if ! test -z "$with_system_socket"; then
1618    DBUS_SYSTEM_SOCKET=$with_system_socket
1619 else
1620    DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
1621 fi
1622
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])
1625
1626 ## System bus only listens on local domain sockets, and never
1627 ## on an abstract socket (so only root can create the socket).
1628 ##
1629 ## This won't work on Windows. It's not meant to - the system bus is
1630 ## meaningless on Windows anyway.
1631 ##
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
1636 ## address.
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
1643 else
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;"
1647     fi
1648
1649     DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="${kdbus_address_path}unix:path=$DBUS_SYSTEM_SOCKET"
1650 fi
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])
1653
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
1659 else
1660    DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
1661 fi
1662
1663 AC_SUBST(DBUS_SYSTEM_PID_FILE)
1664
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
1668 else
1669    DBUS_CONSOLE_AUTH_DIR=/var/run/console/
1670 fi
1671
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])
1674
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
1679    else
1680       DBUS_CONSOLE_OWNER_FILE=/dev/console
1681    fi
1682 else
1683   DBUS_CONSOLE_OWNER_FILE=
1684 fi
1685
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])
1688
1689 #### User to start the system bus as
1690 if test -z "$with_dbus_user" ; then
1691     DBUS_USER=messagebus
1692 else
1693     DBUS_USER=$with_dbus_user
1694 fi
1695 AC_SUBST(DBUS_USER)
1696 AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
1697
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])
1704
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])
1709
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])
1714
1715 #### Directory to install dbus-daemon
1716 if test -z "$with_dbus_daemondir" ; then
1717     DBUS_DAEMONDIR=$EXPANDED_BINDIR
1718     dbus_daemondir='$bindir'
1719 else
1720     DBUS_DAEMONDIR=$with_dbus_daemondir
1721     dbus_daemondir=$with_dbus_daemondir
1722 fi
1723 AC_SUBST(DBUS_DAEMONDIR)
1724 AC_SUBST(dbus_daemondir)
1725 AC_DEFINE_UNQUOTED(DBUS_DAEMONDIR,"$DBUS_DAEMONDIR", [Directory for installing the DBUS daemon])
1726
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])
1731
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])
1736
1737 #### Directory to source sysconfdir configuration from
1738
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.
1742 #
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])
1753
1754 #### Tell tests where to find certain stuff in builddir
1755
1756 DBUS_PWD=`pwd`
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]),
1759                            DBUS_PWD=$withval)
1760
1761 DBUS_TEST_EXEC="$DBUS_PWD/test"
1762 DBUS_TEST_DATA="$DBUS_PWD/test/data"
1763
1764 AC_SUBST([DBUS_TEST_DATA])
1765 AC_SUBST([DBUS_TEST_EXEC])
1766
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])
1771
1772 AC_DEFINE_UNQUOTED(TEST_BUS_LAUNCH_BINARY, ["$DBUS_PWD/tools/dbus-launch$EXEEXT"],
1773                    [Full path to the dbus-launch in the builddir])
1774
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])
1780
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
1788 else
1789    DEFAULT_SOCKET_DIR=/tmp
1790 fi
1791
1792 DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
1793
1794 if ! test -z "$with_test_socket_dir" ; then
1795    TEST_SOCKET_DIR="$with_test_socket_dir"
1796 else
1797    TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1798 fi
1799 AC_SUBST(TEST_SOCKET_DIR)
1800 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1801
1802 if test "x$dbus_unix" = xyes; then
1803   TEST_LISTEN="unix:tmpdir=$TEST_SOCKET_DIR"
1804 else
1805   TEST_LISTEN="tcp:host=localhost"
1806 fi
1807 AC_SUBST([TEST_LISTEN])
1808 AC_DEFINE_UNQUOTED([TEST_LISTEN], ["$TEST_LISTEN"],
1809   [Listening address for regression tests])
1810
1811 if ! test -z "$with_session_socket_dir" ; then
1812    DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1813 else
1814    DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1815 fi
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)
1818
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
1821 # "nonce-tcp:".
1822 #
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=])
1829
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"
1841 else
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"
1845 fi
1846 AC_SUBST([DBUS_SESSION_BUS_LISTEN_ADDRESS])
1847
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:",
1850 # even on Unix.
1851 #
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=])
1858
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:"
1867 else
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:"
1872 fi
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])
1877
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,
1882 [
1883 #if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
1884 # include <sys/time.h>
1885 # include <crt_externs.h>
1886 # define environ (*_NSGetEnviron())
1887 #endif
1888 ])
1889
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])
1897 fi
1898
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])
1905
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])])
1912 fi
1913
1914 AC_SUBST([LIBSMACK_CFLAGS])
1915 AC_SUBST([LIBSMACK_LIBS])
1916
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])])
1923 fi
1924
1925 AC_SUBST([CYNARA_CFLAGS])
1926 AC_SUBST([CYNARA_LIBS])
1927
1928
1929 AC_CONFIG_FILES([
1930 Doxyfile
1931 dbus/Version
1932 dbus/versioninfo.rc
1933 dbus/dbus-arch-deps.h
1934 bus/system.conf
1935 bus/session.conf
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
1940 bus/messagebus
1941 bus/messagebus-config
1942 bus/org.freedesktop.dbus-session.plist
1943 bus/rc.messagebus
1944 bus/dbus.service
1945 bus/dbus.socket
1946 bus/systemd-user/dbus.service
1947 bus/systemd-user/dbus.socket
1948 Makefile
1949 dbus/Makefile
1950 bus/Makefile
1951 tools/Makefile
1952 test/Makefile
1953 test/name-test/Makefile
1954 doc/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
1960 doc/dbus-send.1.xml
1961 doc/dbus-test-tool.1.xml
1962 doc/dbus-update-activation-environment.1.xml
1963 doc/dbus-uuidgen.1.xml
1964 dbus-1.pc
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
1985 ])
1986 AC_OUTPUT
1987
1988 dnl ==========================================================================
1989 echo "
1990                     D-Bus $VERSION
1991                   ==============
1992
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}
2002         compiler:                 ${CC}
2003         cflags:                   ${CFLAGS}
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}"
2013
2014 echo "
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}
2052 "
2053 if test x$have_launchd = xyes; then
2054         echo "        launchd agent dir:        ${LAUNCHD_AGENT_DIR}"
2055 fi
2056 echo
2057
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."
2060 fi
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)"
2063 fi
2064 if test x$enable_compiler_coverage = xyes; then
2065         echo "NOTE: building with coverage profiling is definitely for developers only."
2066 fi
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."
2069 fi
2070 if test x$enable_asserts = xyes; then
2071         echo "NOTE: building with assertions increases library size and decreases performance."
2072 fi
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."
2075 fi