2003-05-08 Havoc Pennington <hp@pobox.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.10)
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 AM_PROG_LIBTOOL
25
26 AC_ARG_ENABLE(qt,      [  --enable-qt      enable Qt-friendly client library],enable_qt=$enableval,enable_qt=auto)
27 AC_ARG_ENABLE(glib,    [  --enable-glib    enable GLib-friendly client library],enable_glib=$enableval,enable_glib=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(docs,    [  --enable-docs    build documentation (requires Doxygen and jade)],enable_docs=$enableval,enable_docs=auto)
34 AC_ARG_ENABLE(gcov,    [  --enable-gcov    compile with coverage profiling instrumentation (gcc only)],enable_gcov=$enableval,enable_gcov=no)
35
36 AC_ARG_WITH(xml,                [  --with-xml=[libxml/expat]           XML library to use])
37 AC_ARG_WITH(init-scripts,       [  --with-init-scripts=[redhat]        Style of init scripts to install])
38 AC_ARG_WITH(session-socket-dir, [  --with-session-socket-dir=[dirname] Where to put sockets for the per-login-session message bus])
39 AC_ARG_WITH(test-socket-dir,    [  --with-test-socket-dir=[dirname]    Where to put sockets for make check])
40 AC_ARG_WITH(system-pid-file,    [  --with-system-pid-file=[pidfile]    PID file for systemwide daemon])
41 AC_ARG_WITH(system-socket,      [  --with-system-socket=[filename]     UNIX domain socket for systemwide daemon])
42
43 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files 
44 dnl and also some stuff in the test/ subdir
45 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
46 if test x$enable_tests = xyes; then
47     AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
48 fi
49
50 if test x$enable_verbose_mode = xyes; then
51     AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
52 fi
53 if test x$enable_asserts = xno; then
54     AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
55 fi
56 if test x$enable_checks = xno; then
57     AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
58 fi
59
60 #### gcc warning flags
61
62 if test "x$GCC" = "xyes"; then
63   changequote(,)dnl
64   case " $CFLAGS " in
65   *[\ \ ]-Wall[\ \      ]*) ;;
66   *) CFLAGS="$CFLAGS -Wall" ;;
67   esac
68
69   case " $CFLAGS " in
70   *[\ \ ]-Wchar-subscripts[\ \  ]*) ;;
71   *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
72   esac
73
74   case " $CFLAGS " in
75   *[\ \ ]-Wmissing-declarations[\ \     ]*) ;;
76   *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
77   esac
78
79   case " $CFLAGS " in
80   *[\ \ ]-Wmissing-prototypes[\ \       ]*) ;;
81   *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
82   esac
83
84   case " $CFLAGS " in
85   *[\ \ ]-Wnested-externs[\ \   ]*) ;;
86   *) CFLAGS="$CFLAGS -Wnested-externs" ;;
87   esac
88
89   case " $CFLAGS " in
90   *[\ \ ]-Wpointer-arith[\ \    ]*) ;;
91   *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
92   esac
93
94   case " $CFLAGS " in
95   *[\ \ ]-Wcast-align[\ \       ]*) ;;
96   *) CFLAGS="$CFLAGS -Wcast-align" ;;
97   esac
98
99   case " $CFLAGS " in
100   *[\ \ ]-Wsign-compare[\ \     ]*) ;;
101   *) CFLAGS="$CFLAGS -Wsign-compare" ;;
102   esac
103
104   if test "x$enable_ansi" = "xyes"; then
105     case " $CFLAGS " in
106     *[\ \       ]-ansi[\ \      ]*) ;;
107     *) CFLAGS="$CFLAGS -ansi" ;;
108     esac
109
110     case " $CFLAGS " in
111     *[\ \       ]-pedantic[\ \  ]*) ;;
112     *) CFLAGS="$CFLAGS -pedantic" ;;
113     esac
114   fi
115   if test x$enable_gcov = xyes; then
116     case " $CFLAGS " in
117     *[\ \       ]-fprofile-arcs[\ \     ]*) ;;
118     *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
119     esac
120     case " $CFLAGS " in
121     *[\ \       ]-ftest-coverage[\ \    ]*) ;;
122     *) CFLAGS="$CFLAGS -ftest-coverage" ;;
123     esac
124
125     ## remove optimization
126     CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
127   fi
128   changequote([,])dnl
129 else
130   if test x$enable_gcov = xyes; then
131     AC_MSG_ERROR([--enable-gcov can only be used with gcc])
132   fi
133 fi
134
135 changequote(,)dnl
136 # let ourselves use our own unstable API
137 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
138 # compress spaces in flags
139 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
140 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
141 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
142 changequote([,])dnl
143
144 if test x$enable_gcov = xyes; then
145      ## so that config.h changes when you toggle gcov support
146      AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
147 fi
148 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
149
150 #### Integer sizes 
151
152 AC_CHECK_SIZEOF(char)
153 AC_CHECK_SIZEOF(short)
154 AC_CHECK_SIZEOF(long)
155 AC_CHECK_SIZEOF(int)
156 AC_CHECK_SIZEOF(void *)
157 AC_CHECK_SIZEOF(long long)
158 AC_CHECK_SIZEOF(__int64)
159
160 ### See what our 64 bit type is called
161 AC_MSG_CHECKING([64-bit integer type])
162
163 case 8 in
164 $ac_cv_sizeof_int)
165   dbusint64=int
166   dbusint64_constant='(val)'
167   dbusuint64_constant='(val)'
168   ;;
169 $ac_cv_sizeof_long)
170   dbusint64=long
171   dbusint64_constant='(val##L)'
172   dbusuint64_constant='(val##UL)'
173   ;;
174 $ac_cv_sizeof_long_long)
175   dbusint64='long long'
176   dbusint64_constant='(val##LL)'
177   dbusuint64_constant='(val##ULL)'
178   ;;
179 $ac_cv_sizeof___int64)
180   dbusint64=__int64
181   dbusint64_constant='(val##i64)'
182   dbusuint64_constant='(val##ui64)'
183   ;;
184 esac
185
186 if test -z "$dbusint64" ; then
187         DBUS_INT64_TYPE="no_int64_type_detected"
188         DBUS_HAVE_INT64=0
189         DBUS_INT64_CONSTANT=
190         DBUS_UINT64_CONSTANT=
191         AC_MSG_RESULT([none found])
192 else
193         DBUS_INT64_TYPE="$dbusint64"
194         DBUS_HAVE_INT64=1
195         DBUS_INT64_CONSTANT="$dbusint64_constant"
196         DBUS_UINT64_CONSTANT="$dbusuint64_constant"
197         AC_MSG_RESULT($DBUS_INT64_TYPE)
198 fi
199
200 AC_SUBST(DBUS_INT64_TYPE)
201 AC_SUBST(DBUS_INT64_CONSTANT)
202 AC_SUBST(DBUS_UINT64_CONSTANT)
203 AC_SUBST(DBUS_HAVE_INT64)
204
205 ## byte order
206 AC_C_BIGENDIAN
207
208 #### Various functions
209 AC_CHECK_LIB(socket,socket)
210 AC_CHECK_LIB(nsl,gethostbyname)
211
212 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
213
214 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
215
216 AC_CACHE_CHECK([for posix getpwnam_r],
217                 ac_cv_func_posix_getpwnam_r,
218                 [AC_TRY_RUN([
219 #include <errno.h>
220 #include <pwd.h>
221 int main () { 
222     char buffer[10000];
223     struct passwd pwd, *pwptr = &pwd;
224     int error;
225     errno = 0;
226     error = getpwnam_r ("", &pwd, buffer, 
227                         sizeof (buffer), &pwptr);
228    return (error < 0 && errno == ENOSYS) 
229            || error == ENOSYS; 
230 }               ],
231         [ac_cv_func_posix_getpwnam_r=yes],
232         [ac_cv_func_posix_getpwnam_r=no])])
233 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
234         AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
235                 [Have POSIX function getpwnam_r])
236 else
237         AC_CACHE_CHECK([for nonposix getpwnam_r],
238                 ac_cv_func_nonposix_getpwnam_r,
239                 [AC_TRY_LINK([#include <pwd.h>],
240                         [char buffer[10000];
241                         struct passwd pwd;
242                         getpwnam_r ("", &pwd, buffer, 
243                                         sizeof (buffer));],
244                         [ac_cv_func_nonposix_getpwnam_r=yes],
245                         [ac_cv_func_nonposix_getpwnam_r=no])])
246                 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
247                 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
248                         [Have non-POSIX function getpwnam_r])
249         fi
250 fi
251
252 dnl check for writev header and writev function so we're 
253 dnl good to go if HAVE_WRITEV gets defined.
254 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
255
256 dnl check for flavours of varargs macros (test from GLib)
257 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
258 AC_TRY_COMPILE([],[
259 int a(int p1, int p2, int p3);
260 #define call_a(...) a(1,__VA_ARGS__)
261 call_a(2,3);
262 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
263 AC_MSG_RESULT($dbus_have_iso_c_varargs)
264
265 AC_MSG_CHECKING(for GNUC varargs macros)
266 AC_TRY_COMPILE([],[
267 int a(int p1, int p2, int p3);
268 #define call_a(params...) a(1,params)
269 call_a(2,3);
270 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
271 AC_MSG_RESULT($dbus_have_gnuc_varargs)
272
273 dnl Output varargs tests
274 if test x$dbus_have_iso_c_varargs = xyes; then
275     AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
276 fi
277 if test x$dbus_have_gnuc_varargs = xyes; then
278     AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
279 fi
280
281 dnl Check for various credentials.
282 AC_MSG_CHECKING(for struct cmsgcred)
283 AC_TRY_COMPILE([
284 #include <sys/types.h>
285 #include <sys/socket.h>
286 ],[
287 struct cmsgcred cred;
288
289 cred.cmcred_pid = 0;
290 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
291 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
292
293 if test x$dbus_have_struct_cmsgcred = xyes; then
294     AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
295 fi
296
297
298 #### Sort out XML library
299
300 # see what we have
301 AC_CHECK_LIB(expat, XML_ParserCreate_MM, 
302              [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
303              have_expat=false)
304
305 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
306
307 # see what we want to use
308 dbus_use_libxml=false
309 dbus_use_expat=false
310 if test x$with_xml = xexpat; then
311         dbus_use_expat=true
312         if ! $have_expat ; then
313            AC_MSG_ERROR([Explicitly requested expat but expat not found])
314         fi
315 elif test x$with_xml = xlibxml; then
316         dbus_use_libxml=true
317         if ! $have_libxml ; then
318            AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
319         fi
320 else
321         ### expat is the default because libxml can't currently survive 
322         ### our brutal OOM-handling unit test setup.
323         ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
324         if $have_expat ; then
325                 with_xml=expat
326                 dbus_use_expat=true
327         elif $have_libxml ; then
328                 with_xml=libxml
329                 dbus_use_libxml=true
330         else
331                 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
332         fi
333 fi
334
335 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
336 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
337
338 if $dbus_use_expat; then
339    XML_LIBS=-lexpat
340    XML_CFLAGS=
341 fi
342 if $dbus_use_libxml; then
343    XML_LIBS=$LIBXML_LIBS
344    XML_CFLAGS=$LIBXML_CFLAGS
345 fi
346
347 #### Set up final flags
348 DBUS_CLIENT_CFLAGS=
349 DBUS_CLIENT_LIBS=
350 AC_SUBST(DBUS_CLIENT_CFLAGS)
351 AC_SUBST(DBUS_CLIENT_LIBS)
352
353 DBUS_BUS_CFLAGS=$XML_CFLAGS
354 DBUS_BUS_LIBS=$XML_LIBS
355 AC_SUBST(DBUS_BUS_CFLAGS)
356 AC_SUBST(DBUS_BUS_LIBS)
357
358 DBUS_TEST_CFLAGS=
359 DBUS_TEST_LIBS=
360 AC_SUBST(DBUS_TEST_CFLAGS)
361 AC_SUBST(DBUS_TEST_LIBS)
362
363 # Glib detection
364 PKG_CHECK_MODULES(DBUS_GLIB, glib-2.0, have_glib=yes, have_glib=no)
365 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
366
367 if test x$have_glib = xno ; then
368     AC_MSG_WARN([GLib development libraries not found])
369 fi
370
371 if test x$enable_glib = xyes; then
372     if test x$have_glib = xno; then
373         AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
374     fi
375 fi
376
377 if test x$enable_glib = xno; then
378    have_glib=no;
379 fi
380
381 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
382 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
383
384 dnl GLib flags
385 AC_SUBST(DBUS_GLIB_CFLAGS)
386 AC_SUBST(DBUS_GLIB_LIBS)
387 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
388
389 # Qt detection
390 have_qt=no
391 AC_MSG_CHECKING([for qglobal.h])
392 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
393     have_qt=yes
394     DBUS_QT_CXXFLAGS="-I$QTDIR/include"
395 else
396     for dir in "${prefix}/include/qt" "/usr/include/qt-3.1" "/usr/include/qt3" "/usr/include/qt" "/usr/lib/qt/include"; do
397         if test -f "$dir/qglobal.h"; then
398             have_qt=yes
399             DBUS_QT_CXXFLAGS="-I$dir"
400        fi
401     done
402 fi
403 if test x"$have_qt" = x"yes"; then
404    AC_MSG_RESULT([found])
405 else
406    AC_MSG_RESULT([not found])
407 fi
408
409 dnl linking to kdecore will give us a bit of help from libtool
410 if (! kde-config >& /dev/null); then
411     have_qt=no
412 else
413     kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
414     if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
415         have_qt=no
416     else
417         DBUS_QT_LIBS="$kdelibs/libkdecore.la"
418     fi
419 fi
420
421 if test x$have_qt = xno ; then
422     AC_MSG_WARN([Qt development libraries not found])
423 fi
424
425 if test x$enable_qt = xyes; then
426     if test x$have_qt = xno; then
427         AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
428     fi
429 fi
430
431 if test x$enable_qt = xno; then
432    have_qt=no;
433 fi
434
435 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
436
437 dnl Qt flags
438 AC_SUBST(DBUS_QT_CXXFLAGS)
439 AC_SUBST(DBUS_QT_LIBS)
440
441 ### X11 detection
442 AC_PATH_XTRA
443
444 ## for now enable_x11 just tracks have_x11, 
445 ## there's no --enable-x11
446 if test x$no_x = xyes ; then
447    have_x11=no
448    enable_x11=no
449 else
450    have_x11=yes
451    enable_x11=yes
452 fi
453
454 if test x$enable_x11 = xyes ; then
455    AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
456    DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
457    DBUS_X_CFLAGS="$X_CFLAGS"
458 else
459    DBUS_X_LIBS=
460    DBUS_X_CFLAGS=
461 fi
462
463 AC_SUBST(DBUS_X_CFLAGS)
464 AC_SUBST(DBUS_X_LIBS)
465
466 ### Documentation
467
468 AC_PATH_PROG(DOXYGEN, doxygen, no)
469 AC_PATH_PROG(DB2HTML, db2html, no)
470
471 AC_MSG_CHECKING([whether to build documentation])
472
473 if test x$DOXYGEN = xno -o x$DB2HTML = xno ; then
474     have_docs_tools=no
475 else
476     have_docs_tools=yes
477 fi
478
479 if test x$enable_docs = xauto ; then
480     if test x$have_docs_tools = xno ; then
481         enable_docs=no
482     else
483         enable_docs=yes
484     fi
485 fi
486
487 if test x$enable_docs = xyes; then
488     if test x$have_docs_tools = xno; then
489         AC_MSG_ERROR([Building docs explicitly required, but Doxygen or db2html not found])
490     fi
491 fi
492
493 AM_CONDITIONAL(DBUS_DOCS_ENABLED, test x$enable_docs = xyes)
494 AC_MSG_RESULT(yes)
495
496 #### find the actual value for $prefix that we'll end up with
497 ##   (I know this is broken and should be done in the Makefile, but
498 ##    that's a major pain and almost nobody actually seems to care)
499 REAL_PREFIX=
500 if test "x$prefix" = "xNONE"; then
501   REAL_PREFIX=$ac_default_prefix
502 else
503   REAL_PREFIX=$prefix
504 fi
505
506 #### Have to go $localstatedir->$prefix/var->/usr/local/var   
507 #### someone please fix this a better way...
508 LOCALSTATEDIR_TMP="$localstatedir"
509 old_prefix=$prefix
510 prefix=$REAL_PREFIX
511 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
512 prefix=$old_prefix
513 AC_SUBST(EXPANDED_LOCALSTATEDIR)
514
515 SYSCONFDIR_TMP="$sysconfdir"
516 old_prefix=$prefix
517 prefix=$REAL_PREFIX
518 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
519 prefix=$old_prefix
520 AC_SUBST(EXPANDED_SYSCONFDIR)
521
522 BINDIR_TMP="$bindir"
523 old_prefix=$prefix
524 prefix=$REAL_PREFIX
525 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
526 prefix=$old_prefix
527 AC_SUBST(EXPANDED_BINDIR)
528
529 #### Check our operating system
530 operating_system=unknown
531 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
532    operating_system=redhat
533 fi
534
535 #### Sort out init scripts
536
537 if test x$with_init_scripts = x; then
538     if test xredhat = x$operating_system ; then
539         with_init_scripts=redhat
540     else
541         with_init_scripts=none
542     fi
543 fi
544
545 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
546
547
548 ##### Set up location for system bus socket
549 if ! test -z "$with_system_socket"; then
550    DBUS_SYSTEM_SOCKET=$with_system_socket
551 else
552    DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
553 fi
554
555 AC_SUBST(DBUS_SYSTEM_SOCKET)
556
557 #### Set up the pid file
558 if ! test -z "$with_system_pid_file"; then
559    DBUS_SYSTEM_PID_FILE=$with_system_pid_file
560 elif test x$operating_system = xredhat ; then
561    DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
562 else
563    DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
564 fi
565
566 AC_SUBST(DBUS_SYSTEM_PID_FILE)
567
568 #### Tell tests where to find certain stuff in builddir
569 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
570
571 AC_DEFUN(TEST_PATH, [
572 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
573 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
574                    [Full path to test file test/$2 in builddir])
575 AC_SUBST(TEST_$1)
576 ])
577
578 TEST_PATH(SERVICE_DIR, data/valid-service-files)
579 TEST_PATH(SERVICE_BINARY, test-service)
580 TEST_PATH(EXIT_BINARY, test-exit)
581 TEST_PATH(SEGFAULT_BINARY, test-segfault)
582 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
583
584 #### Find socket directories
585 if ! test -z "$TMPDIR" ; then
586    DEFAULT_SOCKET_DIR=$TMPDIR
587 elif ! test -z "$TEMP" ; then
588    DEFAULT_SOCKET_DIR=$TEMP
589 elif ! test -z "$TMP" ; then
590    DEFAULT_SOCKET_DIR=$TMP
591 else
592    DEFAULT_SOCKET_DIR=/tmp
593 fi
594
595 if ! test -z "$with_test_socket_dir" ; then
596    TEST_SOCKET_DIR="$with_test_socket_dir"
597 else
598    TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
599 fi
600 AC_SUBST(TEST_SOCKET_DIR)
601
602 if ! test -z "$with_session_socket_dir" ; then
603    DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
604 else
605    DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
606 fi
607 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
608
609
610 AC_OUTPUT([
611 Doxyfile
612 dbus/dbus-arch-deps.h
613 bus/system.conf
614 bus/session.conf
615 bus/messagebus
616 bus/dbus-daemon-1.1
617 Makefile
618 dbus/Makefile
619 glib/Makefile
620 qt/Makefile
621 bus/Makefile
622 tools/Makefile
623 test/Makefile
624 doc/Makefile
625 dbus-1.pc
626 dbus-glib-1.pc
627 test/data/valid-config-files/debug-allow-all.conf
628 test/data/valid-config-files/debug-allow-all-sha1.conf
629 test/data/valid-service-files/debug-echo.service
630 test/data/valid-service-files/debug-segfault.service
631 ])
632
633 ### FIXME it's bizarre that have_qt and have_glib are used
634 ### instead of enable_ - should fix things so that enable 
635 ### is always whether it's enabled, and have is always whether 
636 ### it was found.
637
638 dnl ==========================================================================
639 echo "
640                     D-BUS $VERSION
641                   ==============
642
643         prefix:                   ${prefix}
644         source code location:     ${srcdir}
645         compiler:                 ${CC}
646         cflags:                   ${CFLAGS}
647         cppflags:                 ${CPPFLAGS}
648         cxxflags:                 ${CXXFLAGS}
649         Doxygen:                  ${DOXYGEN}
650         db2html:                  ${DB2HTML}
651
652         Maintainer mode:          ${USE_MAINTAINER_MODE}
653         gcc coverage profiling:   ${enable_gcov}
654         Building unit tests:      ${enable_tests}
655         Building verbose mode:    ${enable_verbose_mode}
656         Building assertions:      ${enable_asserts}
657         Building checks:          ${enable_checks}
658         Building Qt bindings:     ${have_qt}
659         Building GLib bindings:   ${have_glib}
660         Building X11 code:        ${enable_x11}
661         Building documentation:   ${enable_docs}
662         Using XML parser:         ${with_xml}
663         Init scripts style:       ${with_init_scripts}
664         System bus socket:        ${DBUS_SYSTEM_SOCKET}
665         System bus PID file:      ${DBUS_SYSTEM_PID_FILE}
666         Session bus socket dir:   ${DBUS_SESSION_SOCKET_DIR}
667         'make check' socket dir:  ${TEST_SOCKET_DIR}
668 "
669
670 if test x$enable_tests = xyes; then
671         echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
672 fi
673 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
674         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)"
675 fi
676 if test x$enable_gcov = xyes; then
677         echo "NOTE: building with coverage profiling is definitely for developers only."
678 fi
679 if test x$enable_verbose_mode = xyes; then
680         echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
681 fi
682 if test x$enable_asserts = xyes; then
683         echo "NOTE: building with assertions increases library size and decreases performance."
684 fi
685 if test x$enable_checks = xno; then
686         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."
687 fi