6 AM_INIT_AUTOMAKE(dbus, 0.21)
8 AM_CONFIG_HEADER(config.h)
11 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
13 GETTEXT_PACKAGE=dbus-1
14 AC_SUBST(GETTEXT_PACKAGE)
15 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
17 ## must come before we use the $USE_MAINTAINER_MODE variable later
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=no)
39 AC_ARG_ENABLE(python, [ --enable-python build python bindings],enable_python=$enableval,enable_python=auto)
42 AC_ARG_WITH(xml, [ --with-xml=[libxml/expat] XML library to use])
43 AC_ARG_WITH(init-scripts, [ --with-init-scripts=[redhat] Style of init scripts to install])
44 AC_ARG_WITH(session-socket-dir, [ --with-session-socket-dir=[dirname] Where to put sockets for the per-login-session message bus])
45 AC_ARG_WITH(test-socket-dir, [ --with-test-socket-dir=[dirname] Where to put sockets for make check])
46 AC_ARG_WITH(system-pid-file, [ --with-system-pid-file=[pidfile] PID file for systemwide daemon])
47 AC_ARG_WITH(system-socket, [ --with-system-socket=[filename] UNIX domain socket for systemwide daemon])
49 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
50 dnl and also some stuff in the test/ subdir
51 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
52 if test x$enable_tests = xyes; then
53 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
56 if test x$enable_verbose_mode = xyes; then
57 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
59 if test x$enable_asserts = xno; then
60 AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
61 AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
63 if test x$enable_checks = xno; then
64 AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
65 AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
68 #### gcc warning flags
70 if test "x$GCC" = "xyes"; then
73 *[\ \ ]-Wall[\ \ ]*) ;;
74 *) CFLAGS="$CFLAGS -Wall" ;;
78 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
79 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
83 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
84 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
88 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
89 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
93 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
94 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
98 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
99 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
103 *[\ \ ]-Wcast-align[\ \ ]*) ;;
104 *) CFLAGS="$CFLAGS -Wcast-align" ;;
108 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
109 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
112 if test "x$enable_ansi" = "xyes"; then
114 *[\ \ ]-ansi[\ \ ]*) ;;
115 *) CFLAGS="$CFLAGS -ansi" ;;
119 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
120 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
124 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
125 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
129 *[\ \ ]-pedantic[\ \ ]*) ;;
130 *) CFLAGS="$CFLAGS -pedantic" ;;
133 if test x$enable_gcov = xyes; then
135 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
136 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
139 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
140 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
143 ## remove optimization
144 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
148 if test x$enable_gcov = xyes; then
149 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
153 #### can't use AM_PROG_GCJ since it fails fatally if no gcj found
154 AC_CHECK_PROGS(GCJ, gcj, gcj)
155 if test -z "$GCJ" ; then
158 # Needs to be here so libtool wont get confused
162 if test "x${GCJFLAGS-unset}" = xunset; then
163 GCJFLAGS="-g -O2 -Wall"
168 if test x$enable_gcj = xauto ; then
169 if test x$have_gcj = xno ; then
176 if test x$enable_gcj = xyes; then
177 if test x$have_gcj = xno ; then
178 AC_MSG_ERROR([Building gcj explicitly required, but gcj not found])
182 AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
187 AC_CHECK_TOOL(MCS, mcs, mcs)
188 if test -z "$MCS" ; then
192 if test "x${MCSFLAGS-unset}" = xunset; then
193 MCSFLAGS="" ### put default MCSFLAGS here
198 if test x$enable_mono = xauto ; then
199 if test x$have_mcs = xno ; then
206 if test x$enable_mono = xyes; then
207 if test x$have_mcs = xno ; then
208 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
212 AM_CONDITIONAL(DBUS_USE_MCS, test x$enable_mono = xyes)
215 # let ourselves use our own unstable API
216 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
217 # compress spaces in flags
218 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
219 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
220 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
223 if test x$enable_gcov = xyes; then
224 ## so that config.h changes when you toggle gcov support
225 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
227 AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
229 AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
231 if test x$have_gcc33_gcov = xyes ; then
232 AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
234 AC_MSG_RESULT($have_gcc33_gcov)
236 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
240 AC_CHECK_SIZEOF(char)
241 AC_CHECK_SIZEOF(short)
242 AC_CHECK_SIZEOF(long)
244 AC_CHECK_SIZEOF(void *)
245 AC_CHECK_SIZEOF(long long)
246 AC_CHECK_SIZEOF(__int64)
248 ### See what our 64 bit type is called
249 AC_MSG_CHECKING([64-bit integer type])
254 dbusint64_constant='(val)'
255 dbusuint64_constant='(val)'
259 dbusint64_constant='(val##L)'
260 dbusuint64_constant='(val##UL)'
262 $ac_cv_sizeof_long_long)
263 dbusint64='long long'
264 dbusint64_constant='(val##LL)'
265 dbusuint64_constant='(val##ULL)'
267 $ac_cv_sizeof___int64)
269 dbusint64_constant='(val##i64)'
270 dbusuint64_constant='(val##ui64)'
274 if test -z "$dbusint64" ; then
275 DBUS_INT64_TYPE="no_int64_type_detected"
278 DBUS_UINT64_CONSTANT=
279 AC_MSG_RESULT([none found])
281 DBUS_INT64_TYPE="$dbusint64"
283 DBUS_INT64_CONSTANT="$dbusint64_constant"
284 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
285 AC_MSG_RESULT($DBUS_INT64_TYPE)
288 AC_SUBST(DBUS_INT64_TYPE)
289 AC_SUBST(DBUS_INT64_CONSTANT)
290 AC_SUBST(DBUS_UINT64_CONSTANT)
291 AC_SUBST(DBUS_HAVE_INT64)
297 dnl **********************************
298 dnl *** va_copy checks (from GLib) ***
299 dnl **********************************
300 dnl we currently check for all three va_copy possibilities, so we get
301 dnl all results in config.log for bug reports.
302 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
303 AC_LINK_IFELSE([#include <stdarg.h>
304 void f (int i, ...) {
305 va_list args1, args2;
307 va_copy (args2, args1);
308 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
310 va_end (args1); va_end (args2);
316 [dbus_cv_va_copy=yes],
317 [dbus_cv_va_copy=no])
319 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
320 AC_LINK_IFELSE([#include <stdarg.h>
321 void f (int i, ...) {
322 va_list args1, args2;
324 __va_copy (args2, args1);
325 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
327 va_end (args1); va_end (args2);
333 [dbus_cv___va_copy=yes],
334 [dbus_cv___va_copy=no])
337 if test "x$dbus_cv_va_copy" = "xyes"; then
338 dbus_va_copy_func=va_copy
339 else if test "x$dbus_cv___va_copy" = "xyes"; then
340 dbus_va_copy_func=__va_copy
344 if test -n "$dbus_va_copy_func"; then
345 AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
348 AC_CACHE_CHECK([whether va_lists can be copied by value],dbus_cv_va_val_copy,[
349 AC_TRY_RUN([#include <stdarg.h>
350 void f (int i, ...) {
351 va_list args1, args2;
354 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
356 va_end (args1); va_end (args2);
362 [dbus_cv_va_val_copy=yes],
363 [dbus_cv_va_val_copy=no],
364 [dbus_cv_va_val_copy=yes])
367 if test "x$dbus_cv_va_val_copy" = "xno"; then
368 AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
372 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
373 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
375 if test x"$GCC" = xyes; then
376 if test "x$enable_ansi" = "xyes"; then
384 AC_MSG_RESULT([i486])
385 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
394 if test x$have_atomic_inc = xyes ; then
395 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
398 #### Various functions
399 AC_CHECK_LIB(socket,socket)
400 AC_CHECK_LIB(nsl,gethostbyname)
402 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
404 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
406 AC_CACHE_CHECK([for posix getpwnam_r],
407 ac_cv_func_posix_getpwnam_r,
413 struct passwd pwd, *pwptr = &pwd;
416 error = getpwnam_r ("", &pwd, buffer,
417 sizeof (buffer), &pwptr);
418 return (error < 0 && errno == ENOSYS)
421 [ac_cv_func_posix_getpwnam_r=yes],
422 [ac_cv_func_posix_getpwnam_r=no])])
423 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
424 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
425 [Have POSIX function getpwnam_r])
427 AC_CACHE_CHECK([for nonposix getpwnam_r],
428 ac_cv_func_nonposix_getpwnam_r,
429 [AC_TRY_LINK([#include <pwd.h>],
432 getpwnam_r ("", &pwd, buffer,
434 [ac_cv_func_nonposix_getpwnam_r=yes],
435 [ac_cv_func_nonposix_getpwnam_r=no])])
436 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
437 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
438 [Have non-POSIX function getpwnam_r])
442 dnl check for socklen_t
443 AC_MSG_CHECKING(whether socklen_t is defined)
445 #include <sys/types.h>
446 #include <sys/socket.h>
451 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
452 AC_MSG_RESULT($dbus_have_socklen_t)
454 if test "x$dbus_have_socklen_t" = "xyes"; then
455 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
458 dnl check for writev header and writev function so we're
459 dnl good to go if HAVE_WRITEV gets defined.
460 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
462 dnl check for flavours of varargs macros (test from GLib)
463 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
465 int a(int p1, int p2, int p3);
466 #define call_a(...) a(1,__VA_ARGS__)
468 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
469 AC_MSG_RESULT($dbus_have_iso_c_varargs)
471 AC_MSG_CHECKING(for GNUC varargs macros)
473 int a(int p1, int p2, int p3);
474 #define call_a(params...) a(1,params)
476 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
477 AC_MSG_RESULT($dbus_have_gnuc_varargs)
479 dnl Output varargs tests
480 if test x$dbus_have_iso_c_varargs = xyes; then
481 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
483 if test x$dbus_have_gnuc_varargs = xyes; then
484 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
487 dnl Check for various credentials.
488 AC_MSG_CHECKING(for struct cmsgcred)
490 #include <sys/types.h>
491 #include <sys/socket.h>
493 struct cmsgcred cred;
496 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
497 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
499 if test x$dbus_have_struct_cmsgcred = xyes; then
500 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
504 #### Abstract sockets
506 AC_MSG_CHECKING(abstract socket namespace)
508 AC_RUN_IFELSE([AC_LANG_PROGRAM(
510 #include <sys/types.h>
514 #include <sys/socket.h>
520 struct sockaddr_un addr;
522 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
526 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
530 memset (&addr, '\0', sizeof (addr));
531 addr.sun_family = AF_UNIX;
532 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
533 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
535 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
537 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
544 [have_abstract_sockets=yes],
545 [have_abstract_sockets=no])
547 AC_MSG_RESULT($have_abstract_sockets)
549 if test x$enable_abstract_sockets = xyes; then
550 if test x$have_abstract_sockets = xno; then
551 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
555 if test x$enable_abstract_sockets = xno; then
556 have_abstract_sockets=no;
559 if test x$have_abstract_sockets = xyes ; then
561 DBUS_PATH_OR_ABSTRACT=abstract
564 DBUS_PATH_OR_ABSTRACT=path
567 AC_DEFINE_UNQUOTED(HAVE_ABSTRACT_SOCKETS, $abstract_sockets, [Have abstract socket namespace])
569 # this is used in addresses to prefer abstract, e.g.
570 # unix:path=/foo or unix:abstract=/foo
571 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
573 #### Sort out XML library
576 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
577 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
580 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
582 # see what we want to use
583 dbus_use_libxml=false
585 if test x$with_xml = xexpat; then
587 if ! $have_expat ; then
588 AC_MSG_ERROR([Explicitly requested expat but expat not found])
590 elif test x$with_xml = xlibxml; then
592 if ! $have_libxml ; then
593 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
596 ### expat is the default because libxml can't currently survive
597 ### our brutal OOM-handling unit test setup.
598 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
599 if $have_expat ; then
602 elif $have_libxml ; then
606 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
610 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
611 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
613 if $dbus_use_expat; then
617 if $dbus_use_libxml; then
618 XML_LIBS=$LIBXML_LIBS
619 XML_CFLAGS=$LIBXML_CFLAGS
622 #### Set up final flags
625 AC_SUBST(DBUS_CLIENT_CFLAGS)
626 AC_SUBST(DBUS_CLIENT_LIBS)
628 DBUS_BUS_CFLAGS=$XML_CFLAGS
629 DBUS_BUS_LIBS=$XML_LIBS
630 AC_SUBST(DBUS_BUS_CFLAGS)
631 AC_SUBST(DBUS_BUS_LIBS)
635 AC_SUBST(DBUS_TEST_CFLAGS)
636 AC_SUBST(DBUS_TEST_LIBS)
639 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
640 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
642 if test x$have_glib = xno ; then
643 AC_MSG_WARN([GLib development libraries not found])
646 if test x$enable_glib = xyes; then
647 if test x$have_glib = xno; then
648 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
652 if test x$enable_glib = xno; then
656 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
657 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
660 AC_SUBST(DBUS_GLIB_CFLAGS)
661 AC_SUBST(DBUS_GLIB_LIBS)
662 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
664 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
665 DBUS_GLIB_TOOL_LIBS=$XML_LIBS
666 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
667 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
670 if test x$have_glib = xno ; then
671 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
674 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0, have_gtk=yes, have_gtk=no)
677 if test x$have_gtk = xno ; then
678 AC_MSG_WARN([GTK+ development libraries not found])
681 if test x$enable_gtk = xyes; then
682 if test x$have_gtk = xno; then
683 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
687 if test x$enable_gtk = xno; then
691 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
694 AC_SUBST(DBUS_GTK_CFLAGS)
695 AC_SUBST(DBUS_GTK_LIBS)
698 AC_PATH_PROG(QT_MOC, moc, no)
701 AC_MSG_CHECKING([for qglobal.h])
702 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
704 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
706 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
707 if test -f "$dir/qglobal.h"; then
709 DBUS_QT_CXXFLAGS="-I$dir"
713 if test x"$have_qt" = x"yes"; then
714 AC_MSG_RESULT([found])
716 AC_MSG_RESULT([not found])
719 dnl linking to kdecore will give us a bit of help from libtool
720 if (! kde-config >& /dev/null); then
723 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
724 if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
727 DBUS_QT_LIBS="$kdelibs/libkdecore.la"
731 if test x$have_qt = xno ; then
732 AC_MSG_WARN([Qt development libraries not found])
735 if test x$enable_qt = xyes; then
736 if test x$have_qt = xno; then
737 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
741 if test x$enable_qt = xno; then
745 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
748 AC_SUBST(DBUS_QT_CXXFLAGS)
749 AC_SUBST(DBUS_QT_LIBS)
754 ## for now enable_x11 just tracks have_x11,
755 ## there's no --enable-x11
756 if test x$no_x = xyes ; then
764 if test x$enable_x11 = xyes ; then
765 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
766 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
767 DBUS_X_CFLAGS="$X_CFLAGS"
773 AC_SUBST(DBUS_X_CFLAGS)
774 AC_SUBST(DBUS_X_LIBS)
776 ### Doxygen Documentation
778 AC_PATH_PROG(DOXYGEN, doxygen, no)
780 AC_MSG_CHECKING([whether to build Doxygen documentation])
782 if test x$DOXYGEN = xno ; then
788 if test x$enable_doxygen_docs = xauto ; then
789 if test x$have_doxygen = xno ; then
790 enable_doxygen_docs=no
792 enable_doxygen_docs=yes
796 if test x$enable_doxygen_docs = xyes; then
797 if test x$have_doxygen = xno; then
798 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
802 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
805 ### XML Documentation
807 AC_PATH_PROG(XMLTO, xmlto, no)
809 AC_MSG_CHECKING([whether to build XML documentation])
811 if test x$XMLTO = xno ; then
817 if test x$enable_xml_docs = xauto ; then
818 if test x$have_xmlto = xno ; then
825 if test x$enable_xml_docs = xyes; then
826 if test x$have_xmlto = xno; then
827 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
831 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
834 #### Have to go $localstatedir->$prefix/var->/usr/local/var
835 #### someone please fix this a better way...
837 #### find the actual value for $prefix that we'll end up with
838 ## (I know this is broken and should be done in the Makefile, but
839 ## that's a major pain and almost nobody actually seems to care)
841 if test "x$prefix" = "xNONE"; then
842 REAL_PREFIX=$ac_default_prefix
847 ## temporarily change prefix and exec_prefix
851 if test "x$exec_prefix" = xNONE ; then
852 REAL_EXEC_PREFIX=$REAL_PREFIX
854 REAL_EXEC_PREFIX=$exec_prefix
856 old_exec_prefix=$exec_prefix
857 exec_prefix=$REAL_EXEC_PREFIX
860 LOCALSTATEDIR_TMP="$localstatedir"
861 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
862 AC_SUBST(EXPANDED_LOCALSTATEDIR)
864 SYSCONFDIR_TMP="$sysconfdir"
865 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
866 AC_SUBST(EXPANDED_SYSCONFDIR)
869 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
870 AC_SUBST(EXPANDED_BINDIR)
873 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
874 AC_SUBST(EXPANDED_LIBDIR)
876 ## put prefix and exec_prefix back
878 exec_prefix=$old_exec_prefix
880 #### Check our operating system
881 operating_system=unknown
882 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
883 operating_system=redhat
886 #### Sort out init scripts
888 if test x$with_init_scripts = x; then
889 if test xredhat = x$operating_system ; then
890 with_init_scripts=redhat
892 with_init_scripts=none
896 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
899 ##### Set up location for system bus socket
900 if ! test -z "$with_system_socket"; then
901 DBUS_SYSTEM_SOCKET=$with_system_socket
903 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
906 AC_SUBST(DBUS_SYSTEM_SOCKET)
907 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
909 ## system bus only listens on local domain sockets, and never
910 ## on an abstract socket (so only root can create the socket)
911 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
912 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
913 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-BUS address of the system bus])
915 #### Set up the pid file
916 if ! test -z "$with_system_pid_file"; then
917 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
918 elif test x$operating_system = xredhat ; then
919 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
921 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
924 AC_SUBST(DBUS_SYSTEM_PID_FILE)
926 #### Tell tests where to find certain stuff in builddir
927 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
929 AC_DEFUN(TEST_PATH, [
930 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
931 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
932 [Full path to test file test/$2 in builddir])
936 TEST_PATH(SERVICE_DIR, data/valid-service-files)
937 TEST_PATH(SERVICE_BINARY, test-service)
938 TEST_PATH(GLIB_SERVICE_BINARY, test-service-glib)
939 TEST_PATH(EXIT_BINARY, test-exit)
940 TEST_PATH(SEGFAULT_BINARY, test-segfault)
941 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
943 #### Find socket directories
944 if ! test -z "$TMPDIR" ; then
945 DEFAULT_SOCKET_DIR=$TMPDIR
946 elif ! test -z "$TEMP" ; then
947 DEFAULT_SOCKET_DIR=$TEMP
948 elif ! test -z "$TMP" ; then
949 DEFAULT_SOCKET_DIR=$TMP
951 DEFAULT_SOCKET_DIR=/tmp
954 if ! test -z "$with_test_socket_dir" ; then
955 TEST_SOCKET_DIR="$with_test_socket_dir"
957 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
959 AC_SUBST(TEST_SOCKET_DIR)
960 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
962 if ! test -z "$with_session_socket_dir" ; then
963 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
965 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
967 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
968 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
970 # Detect if we can build Python bindings (need python, python headers, and pyrex)
971 if test x$enable_python = xno; then
974 AC_MSG_NOTICE([Checking to see if we can build Python bindings])
978 if test -z "$PYTHON" ; then
979 AC_MSG_WARN([Python not found])
981 AC_CHECK_PROGS(PYREX, pyrexc)
983 if test -z "$PYREX" ; then
989 AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
991 if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
996 if test x$have_python = xno ; then
997 if test x$enable_python = xyes ; then
998 AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
1000 AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings])
1005 AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
1010 dbus/dbus-arch-deps.h
1022 gcj/org/freedesktop/Makefile
1023 gcj/org/freedesktop/dbus/Makefile
1032 test/data/valid-config-files/debug-allow-all.conf
1033 test/data/valid-config-files/debug-allow-all-sha1.conf
1034 test/data/valid-service-files/debug-echo.service
1035 test/data/valid-service-files/debug-segfault.service
1038 ### FIXME it's bizarre that have_qt and have_glib are used
1039 ### instead of enable_ - should fix things so that enable
1040 ### is always whether it's enabled, and have is always whether
1043 dnl ==========================================================================
1049 exec_prefix: ${exec_prefix}
1050 libdir: ${EXPANDED_LIBDIR}
1051 bindir: ${EXPANDED_BINDIR}
1052 sysconfdir: ${EXPANDED_SYSCONFDIR}
1053 localstatedir: ${EXPANDED_LOCALSTATEDIR}
1054 source code location: ${srcdir}
1057 cppflags: ${CPPFLAGS}
1058 cxxflags: ${CXXFLAGS}
1059 64-bit int: ${DBUS_INT64_TYPE}
1063 if test x$enable_gcj = xyes ; then
1066 gcjflags: ${GCJFLAGS}"
1069 " gcj: (not enabled)"
1072 if test x$enable_mono = xyes ; then
1075 mcsflags: ${MCSFLAGS}
1079 " mcs: (not enabled)
1084 Maintainer mode: ${USE_MAINTAINER_MODE}
1085 gcc coverage profiling: ${enable_gcov}
1086 Building unit tests: ${enable_tests}
1087 Building verbose mode: ${enable_verbose_mode}
1088 Building assertions: ${enable_asserts}
1089 Building checks: ${enable_checks}
1090 Building Qt bindings: ${have_qt}
1091 Building GLib bindings: ${have_glib}
1092 Building Python bindings: ${have_python}
1093 Building GTK+ tools: ${have_gtk}
1094 Building X11 code: ${enable_x11}
1095 Building Doxygen docs: ${enable_doxygen_docs}
1096 Building XML docs: ${enable_xml_docs}
1097 Using XML parser: ${with_xml}
1098 Init scripts style: ${with_init_scripts}
1099 Abstract socket names: ${have_abstract_sockets}
1100 System bus socket: ${DBUS_SYSTEM_SOCKET}
1101 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1102 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
1103 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
1104 'make check' socket dir: ${TEST_SOCKET_DIR}
1107 if test x$enable_tests = xyes; then
1108 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1110 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1111 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)"
1113 if test x$enable_gcov = xyes; then
1114 echo "NOTE: building with coverage profiling is definitely for developers only."
1116 if test x$enable_verbose_mode = xyes; then
1117 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1119 if test x$enable_asserts = xyes; then
1120 echo "NOTE: building with assertions increases library size and decreases performance."
1122 if test x$enable_checks = xno; then
1123 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."