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=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)
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])
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])
57 if test x$enable_verbose_mode = xyes; then
58 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
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])
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])
69 #### gcc warning flags
71 if test "x$GCC" = "xyes"; then
74 *[\ \ ]-Wall[\ \ ]*) ;;
75 *) CFLAGS="$CFLAGS -Wall" ;;
79 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
80 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
84 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
85 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
89 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
90 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
94 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
95 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
99 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
100 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
104 *[\ \ ]-Wcast-align[\ \ ]*) ;;
105 *) CFLAGS="$CFLAGS -Wcast-align" ;;
109 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
110 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
113 if test "x$enable_ansi" = "xyes"; then
115 *[\ \ ]-ansi[\ \ ]*) ;;
116 *) CFLAGS="$CFLAGS -ansi" ;;
120 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
121 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
125 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
126 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
130 *[\ \ ]-pedantic[\ \ ]*) ;;
131 *) CFLAGS="$CFLAGS -pedantic" ;;
134 if test x$enable_gcov = xyes; then
136 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
137 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
140 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
141 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
144 ## remove optimization
145 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
149 if test x$enable_gcov = xyes; then
150 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
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
159 # Needs to be here so libtool wont get confused
163 if test "x${GCJFLAGS-unset}" = xunset; then
164 GCJFLAGS="-g -O2 -Wall"
169 if test x$enable_gcj = xauto ; then
170 if test x$have_gcj = xno ; then
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])
183 AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
188 MONO_REQUIRED_VERSION=0.91
189 AC_SUBST(MONO_REQUIRED_VERSION)
190 PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, have_mono=true, have_mono=false)
192 if test "x$have_mono" = "xtrue"; then
193 if test `uname -s` = "Darwin"; then
194 AC_PATH_PROG(RUNTIME, mint, no)
195 AC_PATH_PROG(CSC, mcs, no)
199 AC_PATH_PROG(RUNTIME, mono, no)
200 AC_PATH_PROG(CSC, mcs, no)
205 AC_PATH_PROG(CSC, csc.exe, no)
211 if test x$enable_mono = xyes; then
212 if test x$have_mcs = xno ; then
213 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
217 AC_PATH_PROG(GACUTIL, gacutil, no)
218 if test "x$GACUTIL" = "xno" ; then
219 AC_MSG_ERROR([No gacutil tool found])
225 if test x$enable_mono = xauto ; then
226 if test x$CSC = xno ; then
230 AC_PATH_PROG(GACUTIL, gacutil, no)
231 if test "x$GACUTIL" = "xno" ; then
245 AM_CONDITIONAL(DBUS_USE_CSC, test x$enable_mono = xyes)
247 #### Look for monodoc
248 MONODOC_REQUIRED_VERSION=0.15
249 AC_SUBST(MONODOC_REQUIRED_VERSION)
250 PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, have_monodoc=yes, have_monodoc=no)
252 if test x$enable_mono_docs = xyes; then
253 if test x$have_monodoc = xno ; then
254 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
256 AC_PATH_PROG(MONODOC, monodoc, no)
257 if test x$MONODOC = xno; then
258 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
263 if test x$enable_mono_docs = xauto ; then
264 if test x$have_monodoc = xno ; then
268 AC_PATH_PROG(MONODOC, monodoc, no)
269 if test x$MONODOC = xno; then
280 AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_mono_docs" = "xyes")
283 # let ourselves use our own unstable API
284 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
285 # compress spaces in flags
286 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
287 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
288 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
291 if test x$enable_gcov = xyes; then
292 ## so that config.h changes when you toggle gcov support
293 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
295 AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
297 AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
299 if test x$have_gcc33_gcov = xyes ; then
300 AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
302 AC_MSG_RESULT($have_gcc33_gcov)
304 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
308 AC_CHECK_SIZEOF(char)
309 AC_CHECK_SIZEOF(short)
310 AC_CHECK_SIZEOF(long)
312 AC_CHECK_SIZEOF(void *)
313 AC_CHECK_SIZEOF(long long)
314 AC_CHECK_SIZEOF(__int64)
316 ### See what our 64 bit type is called
317 AC_MSG_CHECKING([64-bit integer type])
322 dbusint64_constant='(val)'
323 dbusuint64_constant='(val)'
327 dbusint64_constant='(val##L)'
328 dbusuint64_constant='(val##UL)'
330 $ac_cv_sizeof_long_long)
331 dbusint64='long long'
332 dbusint64_constant='(val##LL)'
333 dbusuint64_constant='(val##ULL)'
335 $ac_cv_sizeof___int64)
337 dbusint64_constant='(val##i64)'
338 dbusuint64_constant='(val##ui64)'
342 if test -z "$dbusint64" ; then
343 DBUS_INT64_TYPE="no_int64_type_detected"
346 DBUS_UINT64_CONSTANT=
347 AC_MSG_RESULT([none found])
349 DBUS_INT64_TYPE="$dbusint64"
351 DBUS_INT64_CONSTANT="$dbusint64_constant"
352 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
353 AC_MSG_RESULT($DBUS_INT64_TYPE)
356 AC_SUBST(DBUS_INT64_TYPE)
357 AC_SUBST(DBUS_INT64_CONSTANT)
358 AC_SUBST(DBUS_UINT64_CONSTANT)
359 AC_SUBST(DBUS_HAVE_INT64)
365 dnl **********************************
366 dnl *** va_copy checks (from GLib) ***
367 dnl **********************************
368 dnl we currently check for all three va_copy possibilities, so we get
369 dnl all results in config.log for bug reports.
370 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
371 AC_LINK_IFELSE([#include <stdarg.h>
372 void f (int i, ...) {
373 va_list args1, args2;
375 va_copy (args2, args1);
376 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
378 va_end (args1); va_end (args2);
384 [dbus_cv_va_copy=yes],
385 [dbus_cv_va_copy=no])
387 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
388 AC_LINK_IFELSE([#include <stdarg.h>
389 void f (int i, ...) {
390 va_list args1, args2;
392 __va_copy (args2, args1);
393 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
395 va_end (args1); va_end (args2);
401 [dbus_cv___va_copy=yes],
402 [dbus_cv___va_copy=no])
405 if test "x$dbus_cv_va_copy" = "xyes"; then
406 dbus_va_copy_func=va_copy
407 else if test "x$dbus_cv___va_copy" = "xyes"; then
408 dbus_va_copy_func=__va_copy
412 if test -n "$dbus_va_copy_func"; then
413 AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
416 AC_CACHE_CHECK([whether va_lists can be copied by value],dbus_cv_va_val_copy,[
417 AC_TRY_RUN([#include <stdarg.h>
418 void f (int i, ...) {
419 va_list args1, args2;
422 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
424 va_end (args1); va_end (args2);
430 [dbus_cv_va_val_copy=yes],
431 [dbus_cv_va_val_copy=no],
432 [dbus_cv_va_val_copy=yes])
435 if test "x$dbus_cv_va_val_copy" = "xno"; then
436 AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
440 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
441 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
443 if test x"$GCC" = xyes; then
444 if test "x$enable_ansi" = "xyes"; then
452 AC_MSG_RESULT([i486])
453 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
462 if test x$have_atomic_inc = xyes ; then
463 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
466 #### Various functions
467 AC_CHECK_LIB(socket,socket)
468 AC_CHECK_LIB(nsl,gethostbyname)
470 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
472 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
474 AC_CACHE_CHECK([for posix getpwnam_r],
475 ac_cv_func_posix_getpwnam_r,
481 struct passwd pwd, *pwptr = &pwd;
484 error = getpwnam_r ("", &pwd, buffer,
485 sizeof (buffer), &pwptr);
486 return (error < 0 && errno == ENOSYS)
489 [ac_cv_func_posix_getpwnam_r=yes],
490 [ac_cv_func_posix_getpwnam_r=no])])
491 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
492 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
493 [Have POSIX function getpwnam_r])
495 AC_CACHE_CHECK([for nonposix getpwnam_r],
496 ac_cv_func_nonposix_getpwnam_r,
497 [AC_TRY_LINK([#include <pwd.h>],
500 getpwnam_r ("", &pwd, buffer,
502 [ac_cv_func_nonposix_getpwnam_r=yes],
503 [ac_cv_func_nonposix_getpwnam_r=no])])
504 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
505 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
506 [Have non-POSIX function getpwnam_r])
510 dnl check for socklen_t
511 AC_MSG_CHECKING(whether socklen_t is defined)
513 #include <sys/types.h>
514 #include <sys/socket.h>
519 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
520 AC_MSG_RESULT($dbus_have_socklen_t)
522 if test "x$dbus_have_socklen_t" = "xyes"; then
523 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
526 dnl check for writev header and writev function so we're
527 dnl good to go if HAVE_WRITEV gets defined.
528 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
530 dnl check for flavours of varargs macros (test from GLib)
531 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
533 int a(int p1, int p2, int p3);
534 #define call_a(...) a(1,__VA_ARGS__)
536 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
537 AC_MSG_RESULT($dbus_have_iso_c_varargs)
539 AC_MSG_CHECKING(for GNUC varargs macros)
541 int a(int p1, int p2, int p3);
542 #define call_a(params...) a(1,params)
544 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
545 AC_MSG_RESULT($dbus_have_gnuc_varargs)
547 dnl Output varargs tests
548 if test x$dbus_have_iso_c_varargs = xyes; then
549 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
551 if test x$dbus_have_gnuc_varargs = xyes; then
552 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
555 dnl Check for various credentials.
556 AC_MSG_CHECKING(for struct cmsgcred)
558 #include <sys/types.h>
559 #include <sys/socket.h>
561 struct cmsgcred cred;
564 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
565 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
567 if test x$dbus_have_struct_cmsgcred = xyes; then
568 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
572 #### Abstract sockets
574 AC_MSG_CHECKING(abstract socket namespace)
576 AC_RUN_IFELSE([AC_LANG_PROGRAM(
578 #include <sys/types.h>
582 #include <sys/socket.h>
588 struct sockaddr_un addr;
590 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
594 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
598 memset (&addr, '\0', sizeof (addr));
599 addr.sun_family = AF_UNIX;
600 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
601 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
603 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
605 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
612 [have_abstract_sockets=yes],
613 [have_abstract_sockets=no])
615 AC_MSG_RESULT($have_abstract_sockets)
617 if test x$enable_abstract_sockets = xyes; then
618 if test x$have_abstract_sockets = xno; then
619 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
623 if test x$enable_abstract_sockets = xno; then
624 have_abstract_sockets=no;
627 if test x$have_abstract_sockets = xyes ; then
629 DBUS_PATH_OR_ABSTRACT=abstract
632 DBUS_PATH_OR_ABSTRACT=path
635 AC_DEFINE_UNQUOTED(HAVE_ABSTRACT_SOCKETS, $abstract_sockets, [Have abstract socket namespace])
637 # this is used in addresses to prefer abstract, e.g.
638 # unix:path=/foo or unix:abstract=/foo
639 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
641 #### Sort out XML library
644 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
645 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
648 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
650 # see what we want to use
651 dbus_use_libxml=false
653 if test x$with_xml = xexpat; then
655 if ! $have_expat ; then
656 AC_MSG_ERROR([Explicitly requested expat but expat not found])
658 elif test x$with_xml = xlibxml; then
660 if ! $have_libxml ; then
661 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
664 ### expat is the default because libxml can't currently survive
665 ### our brutal OOM-handling unit test setup.
666 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
667 if $have_expat ; then
670 elif $have_libxml ; then
674 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
678 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
679 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
681 if $dbus_use_expat; then
685 if $dbus_use_libxml; then
686 XML_LIBS=$LIBXML_LIBS
687 XML_CFLAGS=$LIBXML_CFLAGS
690 #### Set up final flags
693 AC_SUBST(DBUS_CLIENT_CFLAGS)
694 AC_SUBST(DBUS_CLIENT_LIBS)
696 DBUS_BUS_CFLAGS=$XML_CFLAGS
697 DBUS_BUS_LIBS=$XML_LIBS
698 AC_SUBST(DBUS_BUS_CFLAGS)
699 AC_SUBST(DBUS_BUS_LIBS)
703 AC_SUBST(DBUS_TEST_CFLAGS)
704 AC_SUBST(DBUS_TEST_LIBS)
707 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
708 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
710 if test x$have_glib = xno ; then
711 AC_MSG_WARN([GLib development libraries not found])
714 if test x$enable_glib = xyes; then
715 if test x$have_glib = xno; then
716 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
720 if test x$enable_glib = xno; then
724 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
725 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
728 AC_SUBST(DBUS_GLIB_CFLAGS)
729 AC_SUBST(DBUS_GLIB_LIBS)
730 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
732 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
733 DBUS_GLIB_TOOL_LIBS=$XML_LIBS
734 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
735 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
738 if test x$have_glib = xno ; then
739 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
742 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0, have_gtk=yes, have_gtk=no)
745 if test x$have_gtk = xno ; then
746 AC_MSG_WARN([GTK+ development libraries not found])
749 if test x$enable_gtk = xyes; then
750 if test x$have_gtk = xno; then
751 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
755 if test x$enable_gtk = xno; then
759 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
762 AC_SUBST(DBUS_GTK_CFLAGS)
763 AC_SUBST(DBUS_GTK_LIBS)
766 AC_PATH_PROG(QT_MOC, moc, no)
769 AC_MSG_CHECKING([for qglobal.h])
770 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
772 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
774 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
775 if test -f "$dir/qglobal.h"; then
777 DBUS_QT_CXXFLAGS="-I$dir"
781 if test x"$have_qt" = x"yes"; then
782 AC_MSG_RESULT([found])
784 AC_MSG_RESULT([not found])
787 dnl linking to kdecore will give us a bit of help from libtool
788 if (! kde-config >& /dev/null); then
791 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
792 if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
795 DBUS_QT_LIBS="$kdelibs/libkdecore.la"
799 if test x$have_qt = xno ; then
800 AC_MSG_WARN([Qt development libraries not found])
803 if test x$enable_qt = xyes; then
804 if test x$have_qt = xno; then
805 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
809 if test x$enable_qt = xno; then
813 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
816 AC_SUBST(DBUS_QT_CXXFLAGS)
817 AC_SUBST(DBUS_QT_LIBS)
822 ## for now enable_x11 just tracks have_x11,
823 ## there's no --enable-x11
824 if test x$no_x = xyes ; then
832 if test x$enable_x11 = xyes ; then
833 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
834 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
835 DBUS_X_CFLAGS="$X_CFLAGS"
841 AC_SUBST(DBUS_X_CFLAGS)
842 AC_SUBST(DBUS_X_LIBS)
844 ### Doxygen Documentation
846 AC_PATH_PROG(DOXYGEN, doxygen, no)
848 AC_MSG_CHECKING([whether to build Doxygen documentation])
850 if test x$DOXYGEN = xno ; then
856 if test x$enable_doxygen_docs = xauto ; then
857 if test x$have_doxygen = xno ; then
858 enable_doxygen_docs=no
860 enable_doxygen_docs=yes
864 if test x$enable_doxygen_docs = xyes; then
865 if test x$have_doxygen = xno; then
866 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
870 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
873 ### XML Documentation
875 AC_PATH_PROG(XMLTO, xmlto, no)
877 AC_MSG_CHECKING([whether to build XML documentation])
879 if test x$XMLTO = xno ; then
885 if test x$enable_xml_docs = xauto ; then
886 if test x$have_xmlto = xno ; then
893 if test x$enable_xml_docs = xyes; then
894 if test x$have_xmlto = xno; then
895 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
899 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
902 #### Have to go $localstatedir->$prefix/var->/usr/local/var
903 #### someone please fix this a better way...
905 #### find the actual value for $prefix that we'll end up with
906 ## (I know this is broken and should be done in the Makefile, but
907 ## that's a major pain and almost nobody actually seems to care)
909 if test "x$prefix" = "xNONE"; then
910 REAL_PREFIX=$ac_default_prefix
915 ## temporarily change prefix and exec_prefix
919 if test "x$exec_prefix" = xNONE ; then
920 REAL_EXEC_PREFIX=$REAL_PREFIX
922 REAL_EXEC_PREFIX=$exec_prefix
924 old_exec_prefix=$exec_prefix
925 exec_prefix=$REAL_EXEC_PREFIX
928 LOCALSTATEDIR_TMP="$localstatedir"
929 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
930 AC_SUBST(EXPANDED_LOCALSTATEDIR)
932 SYSCONFDIR_TMP="$sysconfdir"
933 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
934 AC_SUBST(EXPANDED_SYSCONFDIR)
937 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
938 AC_SUBST(EXPANDED_BINDIR)
941 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
942 AC_SUBST(EXPANDED_LIBDIR)
944 ## put prefix and exec_prefix back
946 exec_prefix=$old_exec_prefix
948 #### Check our operating system
949 operating_system=unknown
950 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
951 operating_system=redhat
954 #### Sort out init scripts
956 if test x$with_init_scripts = x; then
957 if test xredhat = x$operating_system ; then
958 with_init_scripts=redhat
960 with_init_scripts=none
964 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
967 ##### Set up location for system bus socket
968 if ! test -z "$with_system_socket"; then
969 DBUS_SYSTEM_SOCKET=$with_system_socket
971 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
974 AC_SUBST(DBUS_SYSTEM_SOCKET)
975 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
977 ## system bus only listens on local domain sockets, and never
978 ## on an abstract socket (so only root can create the socket)
979 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
980 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
981 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-BUS address of the system bus])
983 #### Set up the pid file
984 if ! test -z "$with_system_pid_file"; then
985 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
986 elif test x$operating_system = xredhat ; then
987 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
989 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
992 AC_SUBST(DBUS_SYSTEM_PID_FILE)
994 #### Tell tests where to find certain stuff in builddir
995 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
997 AC_DEFUN(TEST_PATH, [
998 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
999 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
1000 [Full path to test file test/$2 in builddir])
1004 TEST_PATH(SERVICE_DIR, data/valid-service-files)
1005 TEST_PATH(SERVICE_BINARY, test-service)
1006 TEST_PATH(GLIB_SERVICE_BINARY, test-service-glib)
1007 TEST_PATH(EXIT_BINARY, test-exit)
1008 TEST_PATH(SEGFAULT_BINARY, test-segfault)
1009 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
1010 AC_SUBST(ABSOLUTE_TOP_BUILDDIR)
1012 #### Find socket directories
1013 if ! test -z "$TMPDIR" ; then
1014 DEFAULT_SOCKET_DIR=$TMPDIR
1015 elif ! test -z "$TEMP" ; then
1016 DEFAULT_SOCKET_DIR=$TEMP
1017 elif ! test -z "$TMP" ; then
1018 DEFAULT_SOCKET_DIR=$TMP
1020 DEFAULT_SOCKET_DIR=/tmp
1023 if ! test -z "$with_test_socket_dir" ; then
1024 TEST_SOCKET_DIR="$with_test_socket_dir"
1026 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1028 AC_SUBST(TEST_SOCKET_DIR)
1029 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1031 if ! test -z "$with_session_socket_dir" ; then
1032 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1034 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1036 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
1037 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
1039 # Detect if we can build Python bindings (need python, python headers, and pyrex)
1040 if test x$enable_python = xno; then
1043 AC_MSG_NOTICE([Checking to see if we can build Python bindings])
1047 if test -z "$PYTHON" ; then
1048 AC_MSG_WARN([Python not found])
1050 AC_CHECK_PROGS(PYREX, pyrexc)
1052 if test -z "$PYREX" ; then
1058 AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
1060 if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
1065 if test x$have_python = xno ; then
1066 if test x$enable_python = xyes ; then
1067 AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
1069 AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings])
1074 AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
1079 dbus/dbus-arch-deps.h
1091 gcj/org/freedesktop/Makefile
1092 gcj/org/freedesktop/dbus/Makefile
1094 mono/AssemblyInfo.cs
1095 mono/dbus-sharp.dll.config
1096 mono/example/Makefile
1106 test/data/valid-config-files/debug-allow-all.conf
1107 test/data/valid-config-files/debug-allow-all-sha1.conf
1108 test/data/valid-service-files/debug-echo.service
1109 test/data/valid-service-files/debug-segfault.service
1112 ### FIXME it's bizarre that have_qt and have_glib are used
1113 ### instead of enable_ - should fix things so that enable
1114 ### is always whether it's enabled, and have is always whether
1117 dnl ==========================================================================
1123 exec_prefix: ${exec_prefix}
1124 libdir: ${EXPANDED_LIBDIR}
1125 bindir: ${EXPANDED_BINDIR}
1126 sysconfdir: ${EXPANDED_SYSCONFDIR}
1127 localstatedir: ${EXPANDED_LOCALSTATEDIR}
1128 source code location: ${srcdir}
1131 cppflags: ${CPPFLAGS}
1132 cxxflags: ${CXXFLAGS}
1133 64-bit int: ${DBUS_INT64_TYPE}
1137 if test x$enable_gcj = xyes ; then
1140 gcjflags: ${GCJFLAGS}"
1143 " gcj: (not enabled)"
1146 if test x$enable_mono = xyes ; then
1152 " csc: (not enabled)
1157 Maintainer mode: ${USE_MAINTAINER_MODE}
1158 gcc coverage profiling: ${enable_gcov}
1159 Building unit tests: ${enable_tests}
1160 Building verbose mode: ${enable_verbose_mode}
1161 Building assertions: ${enable_asserts}
1162 Building checks: ${enable_checks}
1163 Building Qt bindings: ${have_qt}
1164 Building GLib bindings: ${have_glib}
1165 Building Python bindings: ${have_python}
1166 Building Mono bindings: ${enable_mono}
1167 Building Mono docs: ${enable_mono_docs}
1168 Building GTK+ tools: ${have_gtk}
1169 Building X11 code: ${enable_x11}
1170 Building Doxygen docs: ${enable_doxygen_docs}
1171 Building XML docs: ${enable_xml_docs}
1172 Using XML parser: ${with_xml}
1173 Init scripts style: ${with_init_scripts}
1174 Abstract socket names: ${have_abstract_sockets}
1175 System bus socket: ${DBUS_SYSTEM_SOCKET}
1176 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1177 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
1178 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
1179 'make check' socket dir: ${TEST_SOCKET_DIR}
1182 if test x$enable_tests = xyes; then
1183 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1185 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1186 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)"
1188 if test x$enable_gcov = xyes; then
1189 echo "NOTE: building with coverage profiling is definitely for developers only."
1191 if test x$enable_verbose_mode = xyes; then
1192 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1194 if test x$enable_asserts = xyes; then
1195 echo "NOTE: building with assertions increases library size and decreases performance."
1197 if test x$enable_checks = xno; then
1198 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."