2006-10-21 Havoc Pennington <hp@redhat.com>
[platform/upstream/dbus.git] / configure.in
1 dnl -*- mode: m4 -*-
2 AC_PREREQ(2.52)
3
4 AC_INIT(dbus/dbus.h)
5
6 AC_CANONICAL_TARGET
7
8 AM_INIT_AUTOMAKE(dbus, 0.95)
9
10 AM_CONFIG_HEADER(config.h)
11
12 # Honor aclocal flags
13 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
14
15 GETTEXT_PACKAGE=dbus-1
16 AC_SUBST(GETTEXT_PACKAGE)
17 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
18
19  ## must come before we use the $USE_MAINTAINER_MODE variable later
20 AM_MAINTAINER_MODE
21
22 # libtool versioning - this applies to libdbus
23 #
24 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
25 #
26
27 ## increment if the interface has additions, changes, removals.
28 LT_CURRENT=5
29
30 ## increment any time the source changes; set to
31 ##  0 if you increment CURRENT
32 LT_REVISION=0
33
34 ## increment if any interfaces have been added; set to 0
35 ## if any interfaces have been changed or removed. removal has
36 ## precedence over adding, so set to 0 if both happened.
37 LT_AGE=2
38
39 AC_SUBST(LT_CURRENT)
40 AC_SUBST(LT_REVISION)
41 AC_SUBST(LT_AGE)
42
43
44 AC_PROG_CC
45 AC_PROG_CXX
46 AC_ISC_POSIX
47 AC_HEADER_STDC
48
49 AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
50 AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no)
51 AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
52 AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
53 AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes)
54 AC_ARG_ENABLE(xml-docs, AS_HELP_STRING([--enable-xml-docs],[build XML documentation (requires xmlto)]),enable_xml_docs=$enableval,enable_xml_docs=auto)
55 AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGEN documentation (requires Doxygen)]),enable_doxygen_docs=$enableval,enable_doxygen_docs=auto)
56 AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),enable_gcov=$enableval,enable_gcov=no)
57 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)
58 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto)
59 AC_ARG_ENABLE(dnotify, AS_HELP_STRING([--enable-dnotify],[build with dnotify support (linux only)]),enable_dnotify=$enableval,enable_dnotify=auto)
60 AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
61 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)
62
63 AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use]))
64 AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
65 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]))
66 AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))
67 AC_ARG_WITH(system-pid-file, AS_HELP_STRING([--with-system-pid-file=[pidfile]],[PID file for systemwide daemon]))
68 AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNIX domain socket for systemwide daemon]))
69 AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip]))
70 AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
71 AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
72 AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
73
74
75 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files 
76 dnl and also some stuff in the test/ subdir
77 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
78 if test x$enable_tests = xyes; then
79     AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
80 fi
81
82 if test x$enable_verbose_mode = xyes; then
83     AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
84 fi
85
86 if test x$enable_asserts = xno; then
87     AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
88     AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
89     R_DYNAMIC_LDFLAG=""
90 else
91     # -rdynamic is needed for glibc's backtrace_symbols to work.
92     # No clue how much overhead this adds, but it's useful 
93     # to do this on any assertion failure,
94     # so for now it's enabled anytime asserts are (currently not
95     # in production builds).
96
97     # To get -rdynamic you pass -export-dynamic to libtool.
98     AC_DEFINE(DBUS_BUILT_R_DYNAMIC,1,[whether -export-dynamic was passed to libtool])
99     R_DYNAMIC_LDFLAG=-export-dynamic
100 fi
101 AC_SUBST(R_DYNAMIC_LDFLAG)
102
103 if test x$enable_checks = xno; then
104     AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
105     AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
106 fi
107
108 #### gcc warning flags
109
110 cc_supports_flag() {
111   AC_MSG_CHECKING(whether $CC supports "$@")
112   Cfile=/tmp/foo${$}
113   touch ${Cfile}.c
114   $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
115   rc=$?
116   rm -f ${Cfile}.c ${Cfile}.o
117   case $rc in
118     0) AC_MSG_RESULT(yes);;
119     *) AC_MSG_RESULT(no);;
120   esac
121   return $rc
122 }
123
124 if test "x$GCC" = "xyes"; then
125   changequote(,)dnl
126   case " $CFLAGS " in
127   *[\ \ ]-Wall[\ \      ]*) ;;
128   *) CFLAGS="$CFLAGS -Wall" ;;
129   esac
130
131   case " $CFLAGS " in
132   *[\ \ ]-Wchar-subscripts[\ \  ]*) ;;
133   *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
134   esac
135
136   case " $CFLAGS " in
137   *[\ \ ]-Wmissing-declarations[\ \     ]*) ;;
138   *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
139   esac
140
141   case " $CFLAGS " in
142   *[\ \ ]-Wmissing-prototypes[\ \       ]*) ;;
143   *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
144   esac
145
146   case " $CFLAGS " in
147   *[\ \ ]-Wnested-externs[\ \   ]*) ;;
148   *) CFLAGS="$CFLAGS -Wnested-externs" ;;
149   esac
150
151   case " $CFLAGS " in
152   *[\ \ ]-Wpointer-arith[\ \    ]*) ;;
153   *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
154   esac
155
156   case " $CFLAGS " in
157   *[\ \ ]-Wcast-align[\ \       ]*) ;;
158   *) CFLAGS="$CFLAGS -Wcast-align" ;;
159   esac
160
161   case " $CFLAGS " in
162   *[\ \ ]-Wfloat-equal[\ \      ]*) ;;
163   *) if cc_supports_flag -Wfloat-equals; then
164         CFLAGS="$CFLAGS -Wfloat-equal" 
165      fi
166      ;;
167   esac
168
169   case " $CFLAGS " in
170   *[\ \ ]-Wsign-compare[\ \     ]*) ;;
171   *) CFLAGS="$CFLAGS -Wsign-compare" ;;
172   esac
173
174   case " $CFLAGS " in
175   *[\ \ ]-Wdeclaration-after-statement[\ \      ]*) ;;
176   *) if cc_supports_flag -Wdeclaration-after-statement; then
177         CFLAGS="$CFLAGS -Wdeclaration-after-statement"
178      fi
179      ;;
180   esac
181
182   case " $CFLAGS " in
183   *[\ \ ]-fno-common[\ \        ]*) ;;
184   *) if cc_supports_flag -fno-common; then
185         CFLAGS="$CFLAGS -fno-common"
186      fi
187      ;;
188   esac
189
190   case " $CFLAGS " in
191   *[\ \ ]-fPIC[\ \      ]*) ;;
192   *) if cc_supports_flag -fPIC; then
193         CFLAGS="$CFLAGS -fPIC"
194      fi
195      ;;
196   esac
197
198   if test "x$enable_ansi" = "xyes"; then
199     case " $CFLAGS " in
200     *[\ \       ]-ansi[\ \      ]*) ;;
201     *) CFLAGS="$CFLAGS -ansi" ;;
202     esac
203
204     case " $CFLAGS " in
205     *[\ \       ]-D_POSIX_C_SOURCE*) ;;
206     *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
207     esac
208
209     case " $CFLAGS " in
210     *[\ \       ]-D_BSD_SOURCE[\ \      ]*) ;;
211     *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
212     esac
213
214     case " $CFLAGS " in
215     *[\ \       ]-pedantic[\ \  ]*) ;;
216     *) CFLAGS="$CFLAGS -pedantic" ;;
217     esac
218   fi
219   if test x$enable_gcov = xyes; then
220     case " $CFLAGS " in
221     *[\ \       ]-fprofile-arcs[\ \     ]*) ;;
222     *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
223     esac
224     case " $CFLAGS " in
225     *[\ \       ]-ftest-coverage[\ \    ]*) ;;
226     *) CFLAGS="$CFLAGS -ftest-coverage" ;;
227     esac
228
229     ## remove optimization
230     CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
231   fi
232   changequote([,])dnl
233 else
234   if test x$enable_gcov = xyes; then
235     AC_MSG_ERROR([--enable-gcov can only be used with gcc])
236   fi
237 fi
238
239 # Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
240 #
241 case $target_os in
242     solaris*)
243        CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
244 esac
245     
246 AM_PROG_LIBTOOL
247
248 changequote(,)dnl
249 # compress spaces in flags
250 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
251 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
252 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
253 changequote([,])dnl
254
255 if test x$enable_gcov = xyes; then
256      ## so that config.h changes when you toggle gcov support
257      AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
258
259      AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
260      have_gcc33_gcov=no
261      AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],  
262                    have_gcc33_gcov=yes)
263      if test x$have_gcc33_gcov = xyes ; then
264          AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
265      fi
266      AC_MSG_RESULT($have_gcc33_gcov)
267 fi
268 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
269
270 #### Integer sizes 
271
272 AC_CHECK_SIZEOF(char)
273 AC_CHECK_SIZEOF(short)
274 AC_CHECK_SIZEOF(long)
275 AC_CHECK_SIZEOF(int)
276 AC_CHECK_SIZEOF(void *)
277 AC_CHECK_SIZEOF(long long)
278 AC_CHECK_SIZEOF(__int64)
279
280 ### See what our 64 bit type is called
281 AC_MSG_CHECKING([64-bit integer type])
282
283 case 8 in
284 $ac_cv_sizeof_int)
285   dbusint64=int
286   dbusint64_constant='(val)'
287   dbusuint64_constant='(val)'
288   ;;
289 $ac_cv_sizeof_long)
290   dbusint64=long
291   dbusint64_constant='(val##L)'
292   dbusuint64_constant='(val##UL)'
293   ;;
294 $ac_cv_sizeof_long_long)
295   dbusint64='long long'
296   dbusint64_constant='(val##LL)'
297   dbusuint64_constant='(val##ULL)'
298   ;;
299 $ac_cv_sizeof___int64)
300   dbusint64=__int64
301   dbusint64_constant='(val##i64)'
302   dbusuint64_constant='(val##ui64)'
303   ;;
304 esac
305
306 if test -z "$dbusint64" ; then
307         DBUS_INT64_TYPE="no_int64_type_detected"
308         DBUS_HAVE_INT64=0
309         DBUS_INT64_CONSTANT=
310         DBUS_UINT64_CONSTANT=
311         AC_MSG_RESULT([none found])
312 else
313         DBUS_INT64_TYPE="$dbusint64"
314         DBUS_HAVE_INT64=1
315         DBUS_INT64_CONSTANT="$dbusint64_constant"
316         DBUS_UINT64_CONSTANT="$dbusuint64_constant"
317         AC_MSG_RESULT($DBUS_INT64_TYPE)
318 fi
319
320 AC_SUBST(DBUS_INT64_TYPE)
321 AC_SUBST(DBUS_INT64_CONSTANT)
322 AC_SUBST(DBUS_UINT64_CONSTANT)
323 AC_SUBST(DBUS_HAVE_INT64)
324
325 ### see what 32-bit int is called
326 AC_MSG_CHECKING([32-bit integer type])
327
328 case 4 in
329 $ac_cv_sizeof_short)
330   dbusint32=int
331   ;;
332 $ac_cv_sizeof_int)
333   dbusint32=int
334   ;;
335 $ac_cv_sizeof_long)
336   dbusint32=long
337   ;;
338 esac
339
340 if test -z "$dbusint32" ; then
341         DBUS_INT32_TYPE="no_int32_type_detected"
342         AC_MSG_ERROR([No 32-bit integer type found])
343 else
344         DBUS_INT32_TYPE="$dbusint32"
345         AC_MSG_RESULT($DBUS_INT32_TYPE)
346 fi
347
348 AC_SUBST(DBUS_INT32_TYPE)
349
350 ### see what 16-bit int is called
351 AC_MSG_CHECKING([16-bit integer type])
352
353 case 2 in
354 $ac_cv_sizeof_short)
355   dbusint16=short
356   ;;
357 $ac_cv_sizeof_int)
358   dbusint16=int
359   ;;
360 esac
361
362 if test -z "$dbusint16" ; then
363         DBUS_INT16_TYPE="no_int16_type_detected"
364         AC_MSG_ERROR([No 16-bit integer type found])
365 else
366         DBUS_INT16_TYPE="$dbusint16"
367         AC_MSG_RESULT($DBUS_INT16_TYPE)
368 fi
369
370 AC_SUBST(DBUS_INT16_TYPE)
371
372 ## byte order
373 case $host_os in
374         darwin*)
375                 # check at compile-time, so that it is possible to build universal
376                 # (with multiple architectures at once on the compile line)
377                 AH_VERBATIM([WORDS_BIGENDIAN_DARWIN], [
378                         /* Use the compiler-provided endianness defines to allow universal compiling. */
379                         #if defined(__BIG_ENDIAN__)
380                         #define WORDS_BIGENDIAN 1
381                         #endif
382                 ])
383                 ;;
384         *)
385                 AC_C_BIGENDIAN
386                 ;;
387 esac
388
389 dnl **********************************
390 dnl *** va_copy checks (from GLib) ***
391 dnl **********************************
392 dnl we currently check for all three va_copy possibilities, so we get
393 dnl all results in config.log for bug reports.
394 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
395         AC_LINK_IFELSE([#include <stdarg.h>
396         void f (int i, ...) {
397         va_list args1, args2;
398         va_start (args1, i);
399         va_copy (args2, args1);
400         if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
401           exit (1);
402         va_end (args1); va_end (args2);
403         }
404         int main() {
405           f (0, 42);
406           return 0;
407         }],
408         [dbus_cv_va_copy=yes],
409         [dbus_cv_va_copy=no])
410 ])
411 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
412         AC_LINK_IFELSE([#include <stdarg.h>
413         void f (int i, ...) {
414         va_list args1, args2;
415         va_start (args1, i);
416         __va_copy (args2, args1);
417         if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
418           exit (1);
419         va_end (args1); va_end (args2);
420         }
421         int main() {
422           f (0, 42);
423           return 0;
424         }],
425         [dbus_cv___va_copy=yes],
426         [dbus_cv___va_copy=no])
427 ])
428
429 if test "x$dbus_cv_va_copy" = "xyes"; then
430   dbus_va_copy_func=va_copy
431 else if test "x$dbus_cv___va_copy" = "xyes"; then
432   dbus_va_copy_func=__va_copy
433 fi
434 fi
435
436 if test -n "$dbus_va_copy_func"; then
437   AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
438 fi
439
440 AC_LANG_PUSH(C)
441 AC_CACHE_CHECK([whether va_lists can be copied by value],
442         dbus_cv_va_val_copy,
443         [AC_RUN_IFELSE([AC_LANG_PROGRAM(
444 [[
445         #include <stdarg.h>
446 ]],
447 [[
448         void f (int i, ...) {
449         va_list args1, args2;
450         va_start (args1, i);
451         args2 = args1;
452         if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
453           exit (1);
454         va_end (args1); va_end (args2);
455         }
456         int main() {
457           f (0, 42);
458           return 0;
459         }
460 ]])],
461         [dbus_cv_va_val_copy=yes],
462         [dbus_cv_va_val_copy=no],
463         [dbus_cv_va_val_copy=yes])
464 ])
465 AC_LANG_POP(C)
466
467 if test "x$dbus_cv_va_val_copy" = "xno"; then
468   AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
469 fi
470
471
472 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
473 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
474 have_atomic_inc=no
475 if test x"$GCC" = xyes; then
476   if test "x$enable_ansi" = "xyes"; then
477     AC_MSG_RESULT([no])
478   else
479     case $host_cpu in
480       i386)
481         AC_MSG_RESULT([no])
482         ;;
483       i?86)
484         case $host_os in
485           darwin*)
486             AC_MSG_RESULT([darwin])
487             # check at compile-time, so that it is possible to build universal
488             # (with multiple architectures at once on the compile line)
489             AH_VERBATIM([DBUS_USE_ATOMIC_INT_486_DARWIN], [
490               #if (defined(__i386__) || defined(__x86_64__))
491               # define DBUS_USE_ATOMIC_INT_486 1
492               #endif
493             ])
494             ;;
495           *)
496             AC_MSG_RESULT([i486])
497             AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
498             ;;
499         esac
500         have_atomic_inc=yes
501         ;;
502       *)
503         AC_MSG_RESULT([no])
504         ;;
505     esac
506   fi
507 fi
508 if test x$have_atomic_inc = xyes ; then
509   case $host_os in
510     darwin*)
511       AH_VERBATIM([DBUS_HAVE_ATOMIC_INT_DARWIN], [
512         #if (defined(__i386__) || defined(__x86_64__))
513         # define DBUS_HAVE_ATOMIC_INT 1
514         #endif
515       ])
516       ;;
517     *)
518       AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
519       ;;
520   esac
521 fi
522
523 #### Various functions
524 AC_CHECK_LIB(socket,socket)
525 AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
526
527 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist fpathconf)
528
529 AC_MSG_CHECKING(for dirfd)
530 AC_TRY_COMPILE([
531 #include <sys/types.h>
532 #include <dirent.h>
533 ],[
534 DIR *dirp;
535 dirp = opendir(".");
536 dirfd(dirp);
537 closedir(dirp);
538 ], 
539 dbus_have_dirfd=yes, dbus_have_dirfd=no)
540 AC_MSG_RESULT($dbus_have_dirfd)
541 if test "$dbus_have_dirfd" = yes; then
542         AC_DEFINE(HAVE_DIRFD,1,[Have dirfd function])
543 fi
544
545 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
546
547 AC_CHECK_HEADERS(errno.h)
548
549 # checking for a posix version of getpwnam_r
550 # if we are cross compiling and can not run the test
551 # assume getpwnam_r is the posix version
552 # it is up to the person cross compiling to change
553 # this behavior if desired
554 AC_LANG_PUSH(C)
555 AC_CACHE_CHECK([for posix getpwnam_r],
556                 ac_cv_func_posix_getpwnam_r,
557                 [AC_RUN_IFELSE([AC_LANG_PROGRAM(
558 [[
559 #include <errno.h>
560 #include <pwd.h>
561 ]],
562 [[
563     char buffer[10000];
564     struct passwd pwd, *pwptr = &pwd;
565     int error;
566     errno = 0;
567     error = getpwnam_r ("", &pwd, buffer, 
568                         sizeof (buffer), &pwptr);
569    return (error < 0 && errno == ENOSYS) 
570            || error == ENOSYS; 
571 ]])],
572         [ac_cv_func_posix_getpwnam_r=yes],
573         [ac_cv_func_posix_getpwnam_r=no],
574         [ac_cv_func_posix_getpwnam_r=yes]
575 )])
576 AC_LANG_POP(C)
577
578 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
579         AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
580                 [Have POSIX function getpwnam_r])
581 else
582         AC_CACHE_CHECK([for nonposix getpwnam_r],
583                 ac_cv_func_nonposix_getpwnam_r,
584                 [AC_TRY_LINK([#include <pwd.h>],
585                         [char buffer[10000];
586                         struct passwd pwd;
587                         getpwnam_r ("", &pwd, buffer, 
588                                         sizeof (buffer));],
589                         [ac_cv_func_nonposix_getpwnam_r=yes],
590                         [ac_cv_func_nonposix_getpwnam_r=no])])
591                 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
592                 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
593                         [Have non-POSIX function getpwnam_r])
594         fi
595 fi
596
597 dnl check for socklen_t
598 AC_MSG_CHECKING(whether socklen_t is defined)
599 AC_TRY_COMPILE([
600 #include <sys/types.h>
601 #include <sys/socket.h>
602 #include <netdb.h>
603 ],[
604 socklen_t foo;
605 foo = 1;
606 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
607 AC_MSG_RESULT($dbus_have_socklen_t)
608
609 if test "x$dbus_have_socklen_t" = "xyes"; then
610     AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
611 fi
612
613 dnl check for writev header and writev function so we're 
614 dnl good to go if HAVE_WRITEV gets defined.
615 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
616
617 dnl needed on darwin for NAME_MAX
618 AC_CHECK_HEADERS(sys/syslimits.h)
619
620 dnl check for flavours of varargs macros (test from GLib)
621 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
622 AC_TRY_COMPILE([],[
623 int a(int p1, int p2, int p3);
624 #define call_a(...) a(1,__VA_ARGS__)
625 call_a(2,3);
626 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
627 AC_MSG_RESULT($dbus_have_iso_c_varargs)
628
629 AC_MSG_CHECKING(for GNUC varargs macros)
630 AC_TRY_COMPILE([],[
631 int a(int p1, int p2, int p3);
632 #define call_a(params...) a(1,params)
633 call_a(2,3);
634 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
635 AC_MSG_RESULT($dbus_have_gnuc_varargs)
636
637 dnl Output varargs tests
638 if test x$dbus_have_iso_c_varargs = xyes; then
639     AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
640 fi
641 if test x$dbus_have_gnuc_varargs = xyes; then
642     AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
643 fi
644
645 dnl Check for various credentials.
646 AC_MSG_CHECKING(for struct cmsgcred)
647 AC_TRY_COMPILE([
648 #include <sys/types.h>
649 #include <sys/socket.h>
650 ],[
651 struct cmsgcred cred;
652
653 cred.cmcred_pid = 0;
654 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
655 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
656
657 if test x$dbus_have_struct_cmsgcred = xyes; then
658     AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
659 fi
660
661 AC_CHECK_FUNCS(getpeerucred getpeereid)
662
663 #### Abstract sockets
664
665 AC_LANG_PUSH(C)
666 AC_CACHE_CHECK([abstract socket namespace],
667                 ac_cv_have_abstract_sockets,
668                 [AC_RUN_IFELSE([AC_LANG_PROGRAM(
669 [[
670 #include <sys/types.h>
671 #include <stdlib.h>
672 #include <string.h>
673 #include <stdio.h>
674 #include <sys/socket.h>
675 #include <sys/un.h>
676 #include <errno.h>
677 ]],
678 [[
679   int listen_fd;
680   struct sockaddr_un addr;
681   
682   listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
683   
684   if (listen_fd < 0)
685     {
686       fprintf (stderr, "socket() failed: %s\n", strerror (errno));
687       exit (1);
688     }
689
690   memset (&addr, '\0', sizeof (addr));
691   addr.sun_family = AF_UNIX;
692   strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
693   addr.sun_path[0] = '\0'; /* this is what makes it abstract */
694   
695   if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
696     {
697        fprintf (stderr, "Abstract socket namespace bind() failed: %s\n", 
698                 strerror (errno));
699        exit (1);
700     }
701   else 
702     exit (0);
703 ]])],
704               [ac_cv_have_abstract_sockets=yes],
705               [ac_cv_have_abstract_sockets=no]
706 )])
707 AC_LANG_POP(C)
708
709 if test x$enable_abstract_sockets = xyes; then
710     if test x$ac_cv_have_abstract_sockets = xno; then
711         AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
712     fi
713 fi
714
715 if test x$enable_abstract_sockets = xno; then
716    ac_cv_have_abstract_sockets=no;
717 fi
718
719 if test x$ac_cv_have_abstract_sockets = xyes ; then
720    DBUS_PATH_OR_ABSTRACT=abstract
721    AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
722 else
723    DBUS_PATH_OR_ABSTRACT=path
724 fi
725
726 # this is used in addresses to prefer abstract, e.g. 
727 # unix:path=/foo or unix:abstract=/foo 
728 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
729
730 #### Sort out XML library
731
732 # see what we have
733 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
734              [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
735              have_expat=false)
736
737 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0, have_libxml=true, have_libxml=false)
738
739 # see what we want to use
740 dbus_use_libxml=false
741 dbus_use_expat=false
742 if test x$with_xml = xexpat; then
743         dbus_use_expat=true
744         if ! $have_expat ; then
745            AC_MSG_ERROR([Explicitly requested expat but expat not found])
746         fi
747 elif test x$with_xml = xlibxml; then
748         dbus_use_libxml=true
749         if ! $have_libxml ; then
750            AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
751         fi
752 else
753         ### expat is the default because libxml can't currently survive 
754         ### our brutal OOM-handling unit test setup.
755         ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
756         if $have_expat ; then
757                 with_xml=expat
758                 dbus_use_expat=true
759         elif $have_libxml ; then
760                 with_xml=libxml
761                 dbus_use_libxml=true
762         else
763                 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
764         fi
765 fi
766
767 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
768 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
769
770 if $dbus_use_expat; then
771    XML_LIBS=-lexpat
772    XML_CFLAGS=
773 fi
774 if $dbus_use_libxml; then
775    XML_LIBS=$LIBXML_LIBS
776    XML_CFLAGS=$LIBXML_CFLAGS
777 fi
778
779 # SELinux detection
780 if test x$enable_selinux = xno ; then
781     have_selinux=no;
782 else
783     # See if we have SELinux library
784     AC_CHECK_LIB(selinux, is_selinux_enabled, 
785                  have_selinux=yes, have_selinux=no)
786
787     # see if we have the SELinux header with the new D-Bus stuff in it
788     if test x$have_selinux = xyes ; then
789         AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
790         AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
791                         [#ifdef DBUS__ACQUIRE_SVC return 0;
792                          #else
793                          #error DBUS__ACQUIRE_SVC not defined
794                          #endif],
795                         have_selinux=yes, have_selinux=no)
796         AC_MSG_RESULT($have_selinux)
797     fi
798
799     if test x$enable_selinux = xauto ; then
800         if test x$have_selinux = xno ; then
801                 AC_MSG_WARN([Sufficiently new SELinux library not found])
802         fi
803     else 
804         if test x$have_selinux = xno ; then
805                 AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
806         fi
807     fi
808 fi
809
810 AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
811
812 if test x$have_selinux = xyes ; then
813     SELINUX_LIBS="-lselinux -lpthread"
814     AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
815 else
816     SELINUX_LIBS=
817 fi
818
819 # dnotify checks
820 if test x$enable_dnotify = xno ; then
821     have_dnotify=no;
822 else
823     if test x$target_os = xlinux-gnu -o x$target_os = xlinux; then
824         have_dnotify=yes;       
825     else
826         have_dnotify=no;
827     fi
828 fi
829
830 dnl check if dnotify backend is enabled
831 if test x$have_dnotify = xyes; then
832    AC_DEFINE(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX,1,[Use dnotify on Linux])
833 fi
834
835 AM_CONDITIONAL(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX, test x$have_dnotify = xyes)
836
837 # kqueue checks
838 if test x$enable_kqueue = xno ; then
839     have_kqueue=no
840 else
841     have_kqueue=yes
842     AC_CHECK_HEADER(sys/event.h, , have_kqueue=no)
843     AC_CHECK_FUNC(kqueue, , have_kqueue=no)
844
845     if test x$enable_kqueue = xyes -a x$have_kqueue = xno; then
846         AC_MSG_ERROR(kqueue support explicitly enabled but not available)
847     fi
848 fi
849
850 dnl check if kqueue backend is enabled
851 if test x$have_kqueue = xyes; then
852    AC_DEFINE(DBUS_BUS_ENABLE_KQUEUE,1,[Use kqueue])
853 fi
854
855 AM_CONDITIONAL(DBUS_BUS_ENABLE_KQUEUE, test x$have_kqueue = xyes) 
856
857 dnl console owner file
858 if test x$enable_console_owner_file = xno ; then
859     have_console_owner_file=no;
860 else
861     case $target_os in
862     solaris*)
863         have_console_owner_file=yes;
864         AC_DEFINE(HAVE_CONSOLE_OWNER_FILE,1,[Have console owner file])
865         ;;
866     *)
867         have_console_owner_file=no;;
868     esac
869 fi
870
871 AM_CONDITIONAL(HAVE_CONSOLE_OWNER_FILE, test x$have_console_owner_file = xyes)
872
873 #### Set up final flags
874 DBUS_CLIENT_CFLAGS=
875 DBUS_CLIENT_LIBS=
876 AC_SUBST(DBUS_CLIENT_CFLAGS)
877 AC_SUBST(DBUS_CLIENT_LIBS)
878
879 DBUS_BUS_CFLAGS=$XML_CFLAGS
880 DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS"
881 AC_SUBST(DBUS_BUS_CFLAGS)
882 AC_SUBST(DBUS_BUS_LIBS)
883
884 DBUS_TEST_CFLAGS=
885 DBUS_TEST_LIBS=
886 AC_SUBST(DBUS_TEST_CFLAGS)
887 AC_SUBST(DBUS_TEST_LIBS)
888
889 ### X11 detection
890 AC_PATH_XTRA
891
892 ## for now enable_x11 just tracks have_x11, 
893 ## there's no --enable-x11
894 if test x$no_x = xyes ; then
895    have_x11=no
896    enable_x11=no
897 else
898    have_x11=yes
899    enable_x11=yes
900 fi
901
902 if test x$enable_x11 = xyes ; then
903    AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
904    DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
905    DBUS_X_CFLAGS="$X_CFLAGS"
906 else
907    DBUS_X_LIBS=
908    DBUS_X_CFLAGS=
909 fi
910
911 AC_SUBST(DBUS_X_CFLAGS)
912 AC_SUBST(DBUS_X_LIBS)
913
914 ### Doxygen Documentation
915
916 AC_PATH_PROG(DOXYGEN, doxygen, no)
917
918 AC_MSG_CHECKING([whether to build Doxygen documentation])
919
920 if test x$DOXYGEN = xno ; then
921     have_doxygen=no
922 else
923     have_doxygen=yes
924 fi
925
926 if test x$enable_doxygen_docs = xauto ; then
927     if test x$have_doxygen = xno ; then
928         enable_doxygen_docs=no
929     else
930         enable_doxygen_docs=yes
931     fi
932 fi
933
934 if test x$enable_doxygen_docs = xyes; then
935     if test x$have_doxygen = xno; then
936         AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
937     fi
938 fi
939
940 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
941 AC_MSG_RESULT(yes)
942
943 ### XML Documentation
944
945 AC_PATH_PROG(XMLTO, xmlto, no)
946
947 AC_MSG_CHECKING([whether to build XML documentation])
948
949 if test x$XMLTO = xno ; then
950     have_xmlto=no
951 else
952     have_xmlto=yes
953 fi
954
955 if test x$enable_xml_docs = xauto ; then
956     if test x$have_xmlto = xno ; then
957         enable_xml_docs=no
958     else
959         enable_xml_docs=yes
960     fi
961 fi
962
963 if test x$enable_xml_docs = xyes; then
964     if test x$have_xmlto = xno; then
965         AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
966     fi
967 fi
968
969 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
970 AC_MSG_RESULT(yes)
971
972 #### Have to go $localstatedir->$prefix/var->/usr/local/var   
973 #### someone please fix this a better way...
974
975 #### find the actual value for $prefix that we'll end up with
976 ##   (I know this is broken and should be done in the Makefile, but
977 ##    that's a major pain and almost nobody actually seems to care)
978 REAL_PREFIX=
979 if test "x$prefix" = "xNONE"; then
980   REAL_PREFIX=$ac_default_prefix
981 else
982   REAL_PREFIX=$prefix
983 fi
984
985 ## temporarily change prefix and exec_prefix
986 old_prefix=$prefix
987 prefix=$REAL_PREFIX
988
989 if test "x$exec_prefix" = xNONE ; then
990    REAL_EXEC_PREFIX=$REAL_PREFIX
991 else
992    REAL_EXEC_PREFIX=$exec_prefix
993 fi
994 old_exec_prefix=$exec_prefix
995 exec_prefix=$REAL_EXEC_PREFIX
996
997 ## eval everything
998 LOCALSTATEDIR_TMP="$localstatedir"
999 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
1000 AC_SUBST(EXPANDED_LOCALSTATEDIR)
1001
1002 SYSCONFDIR_TMP="$sysconfdir"
1003 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
1004 AC_SUBST(EXPANDED_SYSCONFDIR)
1005
1006 BINDIR_TMP="$bindir"
1007 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
1008 AC_SUBST(EXPANDED_BINDIR)
1009
1010 LIBDIR_TMP="$libdir"
1011 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
1012 AC_SUBST(EXPANDED_LIBDIR)
1013
1014 DATADIR_TMP="$datadir"
1015 EXPANDED_DATADIR=`eval echo $DATADIR_TMP`
1016 AC_SUBST(EXPANDED_DATADIR)
1017
1018 ## put prefix and exec_prefix back
1019 prefix=$old_prefix
1020 exec_prefix=$old_exec_prefix
1021
1022 #### Check our operating system
1023 operating_system=unknown
1024 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
1025    operating_system=redhat
1026 fi
1027
1028 if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
1029    operating_system=slackware
1030 fi
1031
1032 #### Sort out init scripts
1033
1034 if test x$with_init_scripts = x; then
1035     if test xredhat = x$operating_system ; then
1036         with_init_scripts=redhat
1037     else
1038         if test xslackware = x$operating_system ; then
1039                 with_init_scripts=slackware
1040             else
1041                 with_init_scripts=none
1042         fi
1043     fi
1044 fi
1045
1046 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
1047
1048 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
1049
1050 ##### Set up location for system bus socket
1051 if ! test -z "$with_system_socket"; then
1052    DBUS_SYSTEM_SOCKET=$with_system_socket
1053 else
1054    DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
1055 fi
1056
1057 AC_SUBST(DBUS_SYSTEM_SOCKET)
1058 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
1059
1060 ## system bus only listens on local domain sockets, and never 
1061 ## on an abstract socket (so only root can create the socket)
1062 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
1063 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
1064 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-Bus address of the system bus])
1065
1066 #### Set up the pid file
1067 if ! test -z "$with_system_pid_file"; then
1068    DBUS_SYSTEM_PID_FILE=$with_system_pid_file
1069 elif test x$with_init_scripts = xredhat ; then
1070    DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
1071 else
1072    DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
1073 fi
1074
1075 AC_SUBST(DBUS_SYSTEM_PID_FILE)
1076
1077 #### Directory to check for console ownership
1078 if ! test -z "$with_console_auth_dir"; then
1079    DBUS_CONSOLE_AUTH_DIR=$with_console_auth_dir
1080 else
1081    DBUS_CONSOLE_AUTH_DIR=/var/run/console/
1082 fi
1083
1084 AC_SUBST(DBUS_CONSOLE_AUTH_DIR)
1085 AC_DEFINE_UNQUOTED(DBUS_CONSOLE_AUTH_DIR, "$DBUS_CONSOLE_AUTH_DIR", [Directory to check for console ownerhip])
1086
1087 #### File to check for console ownership
1088 if test x$have_console_owner_file = xyes; then
1089    if ! test -z "$with_console_owner_file"; then
1090       DBUS_CONSOLE_OWNER_FILE=$with_console_owner_file
1091    else
1092       DBUS_CONSOLE_OWNER_FILE=/dev/console
1093    fi
1094 else
1095   DBUS_CONSOLE_OWNER_FILE=
1096 fi
1097
1098 AC_SUBST(DBUS_CONSOLE_OWNER_FILE)
1099 AC_DEFINE_UNQUOTED(DBUS_CONSOLE_OWNER_FILE, "$DBUS_CONSOLE_OWNER_FILE", [File to check for console ownerhip])
1100
1101 #### User to start the system bus as
1102 if test -z "$with_dbus_user" ; then
1103     DBUS_USER=messagebus
1104 else
1105     DBUS_USER=$with_dbus_user
1106 fi
1107 AC_SUBST(DBUS_USER)
1108 AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
1109
1110 #### Directory to install dbus-daemon
1111 if test -z "$with_dbus_daemondir" ; then
1112     DBUS_DAEMONDIR=$EXPANDED_BINDIR
1113 else
1114     DBUS_DAEMONDIR=$with_dbus_daemondir
1115 fi
1116 AC_SUBST(DBUS_DAEMONDIR)
1117 AC_DEFINE_UNQUOTED(DBUS_DAEMONDIR,"$DBUS_DAEMONDIR", [Directory for installing the DBUS daemon])
1118
1119 #### Directory to install the other binaries
1120 DBUS_BINDIR=$EXPANDED_BINDIR
1121 AC_SUBST(DBUS_BINDIR)
1122 AC_DEFINE_UNQUOTED(DBUS_BINDIR,"$DBUS_BINDIR", [Directory for installing the binaries])
1123
1124 #### Tell tests where to find certain stuff in builddir
1125
1126 DBUS_PWD=`pwd`
1127 AC_DEFUN([TEST_PATH], [
1128 TEST_$1=${DBUS_PWD}/test/$2
1129 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
1130                    [Full path to test file test/$2 in builddir])
1131 AC_SUBST(TEST_$1)
1132 ])
1133
1134 TEST_PATH(SERVICE_DIR, data/valid-service-files)
1135 TEST_PATH(SERVICE_BINARY, test-service)
1136 TEST_PATH(SHELL_SERVICE_BINARY, test-shell-service)
1137 TEST_PATH(EXIT_BINARY, test-exit)
1138 TEST_PATH(SEGFAULT_BINARY, test-segfault)
1139 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
1140
1141 #### Find socket directories
1142 if ! test -z "$TMPDIR" ; then
1143    DEFAULT_SOCKET_DIR=$TMPDIR
1144 elif ! test -z "$TEMP" ; then
1145    DEFAULT_SOCKET_DIR=$TEMP
1146 elif ! test -z "$TMP" ; then
1147    DEFAULT_SOCKET_DIR=$TMP
1148 else
1149    DEFAULT_SOCKET_DIR=/tmp
1150 fi
1151
1152 if ! test -z "$with_test_socket_dir" ; then
1153    TEST_SOCKET_DIR="$with_test_socket_dir"
1154 else
1155    TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1156 fi
1157 AC_SUBST(TEST_SOCKET_DIR)
1158 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1159
1160 if ! test -z "$with_session_socket_dir" ; then
1161    DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1162 else
1163    DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1164 fi
1165 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
1166 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
1167
1168 AC_OUTPUT([
1169 Doxyfile
1170 dbus/dbus-arch-deps.h
1171 bus/system.conf
1172 bus/session.conf
1173 bus/messagebus
1174 bus/rc.messagebus
1175 bus/dbus-daemon.1
1176 Makefile
1177 dbus/Makefile
1178 bus/Makefile
1179 tools/Makefile
1180 test/Makefile
1181 test/name-test/Makefile
1182 doc/Makefile
1183 dbus-1.pc
1184 test/data/valid-config-files/debug-allow-all.conf
1185 test/data/valid-config-files/debug-allow-all-sha1.conf
1186 test/data/valid-service-files/debug-echo.service
1187 test/data/valid-service-files/debug-segfault.service
1188 test/data/valid-service-files/debug-shell-echo-success.service
1189 test/data/valid-service-files/debug-shell-echo-fail.service
1190 ])
1191
1192 dnl ==========================================================================
1193 echo "
1194                     D-Bus $VERSION
1195                   ==============
1196
1197         prefix:                   ${prefix}
1198         exec_prefix:              ${exec_prefix}
1199         libdir:                   ${EXPANDED_LIBDIR}
1200         bindir:                   ${EXPANDED_BINDIR}
1201         sysconfdir:               ${EXPANDED_SYSCONFDIR}
1202         localstatedir:            ${EXPANDED_LOCALSTATEDIR}
1203         datadir:                  ${EXPANDED_DATADIR}
1204         source code location:     ${srcdir}
1205         compiler:                 ${CC}
1206         cflags:                   ${CFLAGS}
1207         cppflags:                 ${CPPFLAGS}
1208         cxxflags:                 ${CXXFLAGS}
1209         64-bit int:               ${DBUS_INT64_TYPE}
1210         32-bit int:               ${DBUS_INT32_TYPE}
1211         16-bit int:               ${DBUS_INT16_TYPE}
1212         Doxygen:                  ${DOXYGEN}
1213         xmlto:                    ${XMLTO}"
1214
1215 echo "
1216         Maintainer mode:          ${USE_MAINTAINER_MODE}
1217         gcc coverage profiling:   ${enable_gcov}
1218         Building unit tests:      ${enable_tests}
1219         Building verbose mode:    ${enable_verbose_mode}
1220         Building assertions:      ${enable_asserts}
1221         Building checks:          ${enable_checks}
1222         Building SELinux support: ${have_selinux}
1223         Building dnotify support: ${have_dnotify}
1224         Building X11 code:        ${enable_x11}
1225         Building Doxygen docs:    ${enable_doxygen_docs}
1226         Building XML docs:        ${enable_xml_docs}
1227         Gettext libs (empty OK):  ${INTLLIBS}
1228         Using XML parser:         ${with_xml}
1229         Init scripts style:       ${with_init_scripts}
1230         Abstract socket names:    ${ac_cv_have_abstract_sockets}
1231         System bus socket:        ${DBUS_SYSTEM_SOCKET}
1232         System bus address:       ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1233         System bus PID file:      ${DBUS_SYSTEM_PID_FILE}
1234         Session bus socket dir:   ${DBUS_SESSION_SOCKET_DIR}
1235         Console auth dir:         ${DBUS_CONSOLE_AUTH_DIR}
1236         Console owner file:       ${have_console_owner_file}
1237         Console owner file path:  ${DBUS_CONSOLE_OWNER_FILE}
1238         System bus user:          ${DBUS_USER}
1239         Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services
1240         'make check' socket dir:  ${TEST_SOCKET_DIR}
1241 "
1242
1243 if test x$enable_tests = xyes; then
1244         echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1245 fi
1246 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1247         echo "NOTE: building with unit tests but without assertions means tests may not properly report failures (this configuration is only useful when doing something like profiling the tests)"
1248 fi
1249 if test x$enable_gcov = xyes; then
1250         echo "NOTE: building with coverage profiling is definitely for developers only."
1251 fi
1252 if test x$enable_verbose_mode = xyes; then
1253         echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1254 fi
1255 if test x$enable_asserts = xyes; then
1256         echo "NOTE: building with assertions increases library size and decreases performance."
1257 fi
1258 if test x$enable_checks = xno; then
1259         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."
1260 fi