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