b36aeba999e81ff477966f150283410868b38ec4
[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 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
444 DBUS_X_CFLAGS="$X_CFLAGS"
445 AC_SUBST(DBUS_X_CFLAGS)
446 AC_SUBST(DBUS_X_LIBS)
447
448 ## for now enable_x11 just tracks have_x11, 
449 ## there's no --enable-x11
450 if test x$no_x = xyes ; then
451    have_x11=no
452    enable_x11=no
453 else
454    have_x11=yes
455    enable_x11=yes
456 fi
457
458 if test x$enable_x11 = xyes ; then
459    AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
460 fi
461
462 ### Documentation
463
464 AC_PATH_PROG(DOXYGEN, doxygen, no)
465 AC_PATH_PROG(DB2HTML, db2html, no)
466
467 AC_MSG_CHECKING([whether to build documentation])
468
469 if test x$DOXYGEN = xno -o x$DB2HTML = xno ; then
470     have_docs_tools=no
471 else
472     have_docs_tools=yes
473 fi
474
475 if test x$enable_docs = xauto ; then
476     if test x$have_docs_tools = xno ; then
477         enable_docs=no
478     else
479         enable_docs=yes
480     fi
481 fi
482
483 if test x$enable_docs = xyes; then
484     if test x$have_docs_tools = xno; then
485         AC_MSG_ERROR([Building docs explicitly required, but Doxygen or db2html not found])
486     fi
487 fi
488
489 AM_CONDITIONAL(DBUS_DOCS_ENABLED, test x$enable_docs = xyes)
490 AC_MSG_RESULT(yes)
491
492 #### find the actual value for $prefix that we'll end up with
493 ##   (I know this is broken and should be done in the Makefile, but
494 ##    that's a major pain and almost nobody actually seems to care)
495 REAL_PREFIX=
496 if test "x$prefix" = "xNONE"; then
497   REAL_PREFIX=$ac_default_prefix
498 else
499   REAL_PREFIX=$prefix
500 fi
501
502 #### Have to go $localstatedir->$prefix/var->/usr/local/var   
503 #### someone please fix this a better way...
504 LOCALSTATEDIR_TMP="$localstatedir"
505 old_prefix=$prefix
506 prefix=$REAL_PREFIX
507 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
508 prefix=$old_prefix
509 AC_SUBST(EXPANDED_LOCALSTATEDIR)
510
511 SYSCONFDIR_TMP="$sysconfdir"
512 old_prefix=$prefix
513 prefix=$REAL_PREFIX
514 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
515 prefix=$old_prefix
516 AC_SUBST(EXPANDED_SYSCONFDIR)
517
518 BINDIR_TMP="$bindir"
519 old_prefix=$prefix
520 prefix=$REAL_PREFIX
521 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
522 prefix=$old_prefix
523 AC_SUBST(EXPANDED_BINDIR)
524
525 #### Check our operating system
526 operating_system=unknown
527 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
528    operating_system=redhat
529 fi
530
531 #### Sort out init scripts
532
533 if test x$with_init_scripts = x; then
534     if test xredhat = x$operating_system ; then
535         with_init_scripts=redhat
536     else
537         with_init_scripts=none
538     fi
539 fi
540
541 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
542
543
544 ##### Set up location for system bus socket
545 if ! test -z "$with_system_socket"; then
546    DBUS_SYSTEM_SOCKET=$with_system_socket
547 else
548    DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
549 fi
550
551 AC_SUBST(DBUS_SYSTEM_SOCKET)
552
553 #### Set up the pid file
554 if ! test -z "$with_system_pid_file"; then
555    DBUS_SYSTEM_PID_FILE=$with_system_pid_file
556 elif test x$operating_system = xredhat ; then
557    DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
558 else
559    DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
560 fi
561
562 AC_SUBST(DBUS_SYSTEM_PID_FILE)
563
564 #### Tell tests where to find certain stuff in builddir
565 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
566
567 AC_DEFUN(TEST_PATH, [
568 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
569 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
570                    [Full path to test file test/$2 in builddir])
571 AC_SUBST(TEST_$1)
572 ])
573
574 TEST_PATH(SERVICE_DIR, data/valid-service-files)
575 TEST_PATH(SERVICE_BINARY, test-service)
576 TEST_PATH(EXIT_BINARY, test-exit)
577 TEST_PATH(SEGFAULT_BINARY, test-segfault)
578 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
579
580 #### Find socket directories
581 if ! test -z "$TMPDIR" ; then
582    DEFAULT_SOCKET_DIR=$TMPDIR
583 elif ! test -z "$TEMP" ; then
584    DEFAULT_SOCKET_DIR=$TEMP
585 elif ! test -z "$TMP" ; then
586    DEFAULT_SOCKET_DIR=$TMP
587 else
588    DEFAULT_SOCKET_DIR=/tmp
589 fi
590
591 if ! test -z "$with_test_socket_dir" ; then
592    TEST_SOCKET_DIR="$with_test_socket_dir"
593 else
594    TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
595 fi
596 AC_SUBST(TEST_SOCKET_DIR)
597
598 if ! test -z "$with_session_socket_dir" ; then
599    DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
600 else
601    DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
602 fi
603 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
604
605
606 AC_OUTPUT([
607 Doxyfile
608 dbus/dbus-arch-deps.h
609 bus/system.conf
610 bus/session.conf
611 bus/messagebus
612 bus/dbus-daemon-1.1
613 Makefile
614 dbus/Makefile
615 glib/Makefile
616 qt/Makefile
617 bus/Makefile
618 tools/Makefile
619 test/Makefile
620 doc/Makefile
621 dbus-1.pc
622 dbus-glib-1.pc
623 test/data/valid-config-files/debug-allow-all.conf
624 test/data/valid-config-files/debug-allow-all-sha1.conf
625 test/data/valid-service-files/debug-echo.service
626 test/data/valid-service-files/debug-segfault.service
627 ])
628
629 ### FIXME it's bizarre that have_qt and have_glib are used
630 ### instead of enable_ - should fix things so that enable 
631 ### is always whether it's enabled, and have is always whether 
632 ### it was found.
633
634 dnl ==========================================================================
635 echo "
636                     D-BUS $VERSION
637                   ==============
638
639         prefix:                   ${prefix}
640         source code location:     ${srcdir}
641         compiler:                 ${CC}
642         cflags:                   ${CFLAGS}
643         cppflags:                 ${CPPFLAGS}
644         cxxflags:                 ${CXXFLAGS}
645         Doxygen:                  ${DOXYGEN}
646         db2html:                  ${DB2HTML}
647
648         Maintainer mode:          ${USE_MAINTAINER_MODE}
649         gcc coverage profiling:   ${enable_gcov}
650         Building unit tests:      ${enable_tests}
651         Building verbose mode:    ${enable_verbose_mode}
652         Building assertions:      ${enable_asserts}
653         Building checks:          ${enable_checks}
654         Building Qt bindings:     ${have_qt}
655         Building GLib bindings:   ${have_glib}
656         Building X11 code:        ${enable_x11}
657         Building documentation:   ${enable_docs}
658         Using XML parser:         ${with_xml}
659         Init scripts style:       ${with_init_scripts}
660         System bus socket:        ${DBUS_SYSTEM_SOCKET}
661         System bus PID file:      ${DBUS_SYSTEM_PID_FILE}
662         Session bus socket dir:   ${DBUS_SESSION_SOCKET_DIR}
663         'make check' socket dir:  ${TEST_SOCKET_DIR}
664 "
665
666 if test x$enable_tests = xyes; then
667         echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
668 fi
669 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
670         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)"
671 fi
672 if test x$enable_gcov = xyes; then
673         echo "NOTE: building with coverage profiling is definitely for developers only."
674 fi
675 if test x$enable_verbose_mode = xyes; then
676         echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
677 fi
678 if test x$enable_asserts = xyes; then
679         echo "NOTE: building with assertions increases library size and decreases performance."
680 fi
681 if test x$enable_checks = xno; then
682         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."
683 fi