6 AM_INIT_AUTOMAKE(dbus, 0.51)
8 AM_CONFIG_HEADER(config.h)
13 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
15 GETTEXT_PACKAGE=dbus-1
16 AC_SUBST(GETTEXT_PACKAGE)
17 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
19 ## must come before we use the $USE_MAINTAINER_MODE variable later
22 # libtool versioning - this applies to libdbus
24 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
27 ## increment if the interface has additions, changes, removals.
30 ## increment any time the source changes; set to
31 ## 0 if you increment CURRENT
34 ## increment if any interfaces have been added; set to 0
35 ## if any interfaces have been changed or removed. removal has
36 ## precedence over adding, so set to 0 if both happened.
49 AC_ARG_ENABLE(qt, [ --enable-qt enable Qt-friendly client library],enable_qt=$enableval,enable_qt=auto)
50 AC_ARG_ENABLE(glib, [ --enable-glib enable GLib-friendly client library],enable_glib=$enableval,enable_glib=auto)
51 AC_ARG_ENABLE(gtk, [ --enable-gtk enable GTK-requiring executables],enable_gtk=$enableval,enable_gtk=auto)
52 AC_ARG_ENABLE(tests, [ --enable-tests enable unit test code],enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
53 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
54 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
55 AC_ARG_ENABLE(asserts, [ --enable-asserts include assertion checks],enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
56 AC_ARG_ENABLE(checks, [ --enable-checks include sanity checks on public API],enable_checks=$enableval,enable_checks=yes)
57 AC_ARG_ENABLE(xml-docs, [ --enable-xml-docs build XML documentation (requires xmlto)],enable_xml_docs=$enableval,enable_xml_docs=auto)
58 AC_ARG_ENABLE(doxygen-docs, [ --enable-doxygen-docs build DOXYGEN documentation (requires Doxygen)],enable_doxygen_docs=$enableval,enable_doxygen_docs=auto)
59 AC_ARG_ENABLE(gcov, [ --enable-gcov compile with coverage profiling instrumentation (gcc only)],enable_gcov=$enableval,enable_gcov=no)
60 AC_ARG_ENABLE(abstract-sockets, [ --enable-abstract-sockets use abstract socket namespace (linux only)],enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
61 AC_ARG_ENABLE(gcj, [ --enable-gcj build gcj bindings],enable_gcj=$enableval,enable_gcj=no)
62 AC_ARG_ENABLE(mono, [ --enable-mono build mono bindings],enable_mono=$enableval,enable_mono=auto)
63 AC_ARG_ENABLE(mono_docs, [ --enable-mono-docs build mono docs],enable_mono_docs=$enableval,enable_mono_docs=auto)
64 AC_ARG_ENABLE(python, [ --enable-python build python bindings],enable_python=$enableval,enable_python=auto)
65 AC_ARG_ENABLE(selinux, [ --enable-selinux build with SELinux support],enable_selinux=$enableval,enable_selinux=auto)
67 AC_ARG_WITH(xml, [ --with-xml=[libxml/expat] XML library to use])
68 AC_ARG_WITH(init-scripts, [ --with-init-scripts=[redhat] Style of init scripts to install])
69 AC_ARG_WITH(session-socket-dir, [ --with-session-socket-dir=[dirname] Where to put sockets for the per-login-session message bus])
70 AC_ARG_WITH(test-socket-dir, [ --with-test-socket-dir=[dirname] Where to put sockets for make check])
71 AC_ARG_WITH(system-pid-file, [ --with-system-pid-file=[pidfile] PID file for systemwide daemon])
72 AC_ARG_WITH(system-socket, [ --with-system-socket=[filename] UNIX domain socket for systemwide daemon])
73 AC_ARG_WITH(console-auth-dir, [ --with-console-auth-dir=[dirname] directory to check for console ownerhip])
74 AC_ARG_WITH(dbus_user, [ --with-dbus-user=<user> User for running the DBUS daemon (messagebus)])
76 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
77 dnl and also some stuff in the test/ subdir
78 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
79 if test x$enable_tests = xyes; then
80 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
83 if test x$enable_verbose_mode = xyes; then
84 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
86 if test x$enable_asserts = xno; then
87 AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
88 AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
90 if test x$enable_checks = xno; then
91 AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
92 AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
95 #### gcc warning flags
97 if test "x$GCC" = "xyes"; then
100 *[\ \ ]-Wall[\ \ ]*) ;;
101 *) CFLAGS="$CFLAGS -Wall" ;;
105 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
106 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
110 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
111 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
115 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
116 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
120 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
121 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
125 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
126 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
130 *[\ \ ]-Wcast-align[\ \ ]*) ;;
131 *) CFLAGS="$CFLAGS -Wcast-align" ;;
135 *[\ \ ]-Wfloat-equal[\ \ ]*) ;;
136 *) CFLAGS="$CFLAGS -Wfloat-equal" ;;
140 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
141 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
144 if test "x$enable_ansi" = "xyes"; then
146 *[\ \ ]-ansi[\ \ ]*) ;;
147 *) CFLAGS="$CFLAGS -ansi" ;;
151 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
152 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
156 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
157 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
161 *[\ \ ]-pedantic[\ \ ]*) ;;
162 *) CFLAGS="$CFLAGS -pedantic" ;;
165 if test x$enable_gcov = xyes; then
167 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
168 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
171 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
172 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
175 ## remove optimization
176 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
180 if test x$enable_gcov = xyes; then
181 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
185 #### can't use AM_PROG_GCJ since it fails fatally if no gcj found
186 AC_CHECK_PROGS(GCJ, gcj, gcj)
187 if test -z "$GCJ" ; then
190 # Needs to be here so libtool wont get confused
194 if test "x${GCJFLAGS-unset}" = xunset; then
195 GCJFLAGS="-g -O2 -Wall"
200 if test x$enable_gcj = xauto ; then
201 if test x$have_gcj = xno ; then
208 if test x$enable_gcj = xyes; then
209 if test x$have_gcj = xno ; then
210 AC_MSG_ERROR([Building gcj explicitly required, but gcj not found])
214 AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
219 MONO_REQUIRED_VERSION=0.95
220 AC_SUBST(MONO_REQUIRED_VERSION)
221 PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, have_mono=true, have_mono=false)
223 if test "x$enable_mono" = "xyes"; then
224 if test "x$have_mono" = "xfalse"; then
225 AC_MSG_ERROR([Mono was not found])
229 if test "x$have_mono" = "xtrue"; then
230 if test `uname -s` = "Darwin"; then
231 AC_PATH_PROG(RUNTIME, mint, no)
232 AC_PATH_PROG(CSC, mcs, no)
236 AC_PATH_PROG(RUNTIME, mono, no)
237 AC_PATH_PROG(CSC, mcs, no)
242 AC_PATH_PROG(CSC, csc.exe, no)
248 if test x$enable_mono = xyes; then
249 if test x$have_mcs = xno ; then
250 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
254 AC_PATH_PROG(GACUTIL, gacutil, no)
255 if test "x$GACUTIL" = "xno" ; then
256 AC_MSG_ERROR([No gacutil tool found])
262 if test x$enable_mono = xauto ; then
263 if test x$CSC = xno ; then
267 AC_PATH_PROG(GACUTIL, gacutil, no)
268 if test "x$GACUTIL" = "xno" ; then
282 AM_CONDITIONAL(DBUS_USE_CSC, test x$enable_mono = xyes)
284 #### Look for monodoc
285 MONODOC_REQUIRED_VERSION=0.16
286 AC_SUBST(MONODOC_REQUIRED_VERSION)
287 PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, have_monodoc=yes, have_monodoc=no)
289 if test x$enable_mono_docs = xyes; then
290 if test x$have_monodoc = xno ; then
291 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
293 AC_PATH_PROG(MONODOC, monodoc, no)
294 if test x$MONODOC = xno; then
295 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
300 if test x$enable_mono_docs = xauto ; then
301 if test x$have_monodoc = xno ; then
305 AC_PATH_PROG(MONODOC, monodoc, no)
306 if test x$MONODOC = xno; then
317 AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_mono_docs" = "xyes")
320 # let ourselves use our own unstable API
321 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
322 # compress spaces in flags
323 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
324 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
325 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
328 if test x$enable_gcov = xyes; then
329 ## so that config.h changes when you toggle gcov support
330 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
332 AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
334 AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
336 if test x$have_gcc33_gcov = xyes ; then
337 AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
339 AC_MSG_RESULT($have_gcc33_gcov)
341 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
345 AC_CHECK_SIZEOF(char)
346 AC_CHECK_SIZEOF(short)
347 AC_CHECK_SIZEOF(long)
349 AC_CHECK_SIZEOF(void *)
350 AC_CHECK_SIZEOF(long long)
351 AC_CHECK_SIZEOF(__int64)
353 ### See what our 64 bit type is called
354 AC_MSG_CHECKING([64-bit integer type])
359 dbusint64_constant='(val)'
360 dbusuint64_constant='(val)'
364 dbusint64_constant='(val##L)'
365 dbusuint64_constant='(val##UL)'
367 $ac_cv_sizeof_long_long)
368 dbusint64='long long'
369 dbusint64_constant='(val##LL)'
370 dbusuint64_constant='(val##ULL)'
372 $ac_cv_sizeof___int64)
374 dbusint64_constant='(val##i64)'
375 dbusuint64_constant='(val##ui64)'
379 if test -z "$dbusint64" ; then
380 DBUS_INT64_TYPE="no_int64_type_detected"
383 DBUS_UINT64_CONSTANT=
384 AC_MSG_RESULT([none found])
386 DBUS_INT64_TYPE="$dbusint64"
388 DBUS_INT64_CONSTANT="$dbusint64_constant"
389 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
390 AC_MSG_RESULT($DBUS_INT64_TYPE)
393 AC_SUBST(DBUS_INT64_TYPE)
394 AC_SUBST(DBUS_INT64_CONSTANT)
395 AC_SUBST(DBUS_UINT64_CONSTANT)
396 AC_SUBST(DBUS_HAVE_INT64)
398 ### see what 32-bit int is called
399 AC_MSG_CHECKING([32-bit integer type])
413 if test -z "$dbusint32" ; then
414 DBUS_INT32_TYPE="no_int32_type_detected"
415 AC_MSG_ERROR([No 32-bit integer type found])
417 DBUS_INT32_TYPE="$dbusint32"
418 AC_MSG_RESULT($DBUS_INT32_TYPE)
421 AC_SUBST(DBUS_INT32_TYPE)
423 ### see what 16-bit int is called
424 AC_MSG_CHECKING([16-bit integer type])
435 if test -z "$dbusint16" ; then
436 DBUS_INT16_TYPE="no_int16_type_detected"
437 AC_MSG_ERROR([No 16-bit integer type found])
439 DBUS_INT16_TYPE="$dbusint16"
440 AC_MSG_RESULT($DBUS_INT16_TYPE)
443 AC_SUBST(DBUS_INT16_TYPE)
449 dnl **********************************
450 dnl *** va_copy checks (from GLib) ***
451 dnl **********************************
452 dnl we currently check for all three va_copy possibilities, so we get
453 dnl all results in config.log for bug reports.
454 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
455 AC_LINK_IFELSE([#include <stdarg.h>
456 void f (int i, ...) {
457 va_list args1, args2;
459 va_copy (args2, args1);
460 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
462 va_end (args1); va_end (args2);
468 [dbus_cv_va_copy=yes],
469 [dbus_cv_va_copy=no])
471 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
472 AC_LINK_IFELSE([#include <stdarg.h>
473 void f (int i, ...) {
474 va_list args1, args2;
476 __va_copy (args2, args1);
477 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
479 va_end (args1); va_end (args2);
485 [dbus_cv___va_copy=yes],
486 [dbus_cv___va_copy=no])
489 if test "x$dbus_cv_va_copy" = "xyes"; then
490 dbus_va_copy_func=va_copy
491 else if test "x$dbus_cv___va_copy" = "xyes"; then
492 dbus_va_copy_func=__va_copy
496 if test -n "$dbus_va_copy_func"; then
497 AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
500 AC_CACHE_CHECK([whether va_lists can be copied by value],dbus_cv_va_val_copy,[
501 AC_TRY_RUN([#include <stdarg.h>
502 void f (int i, ...) {
503 va_list args1, args2;
506 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
508 va_end (args1); va_end (args2);
514 [dbus_cv_va_val_copy=yes],
515 [dbus_cv_va_val_copy=no],
516 [dbus_cv_va_val_copy=yes])
519 if test "x$dbus_cv_va_val_copy" = "xno"; then
520 AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
524 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
525 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
527 if test x"$GCC" = xyes; then
528 if test "x$enable_ansi" = "xyes"; then
536 AC_MSG_RESULT([i486])
537 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
546 if test x$have_atomic_inc = xyes ; then
547 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
550 #### Various functions
551 AC_CHECK_LIB(socket,socket)
552 AC_CHECK_LIB(nsl,gethostbyname)
554 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
556 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
558 AC_CACHE_CHECK([for posix getpwnam_r],
559 ac_cv_func_posix_getpwnam_r,
565 struct passwd pwd, *pwptr = &pwd;
568 error = getpwnam_r ("", &pwd, buffer,
569 sizeof (buffer), &pwptr);
570 return (error < 0 && errno == ENOSYS)
573 [ac_cv_func_posix_getpwnam_r=yes],
574 [ac_cv_func_posix_getpwnam_r=no])])
575 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
576 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
577 [Have POSIX function getpwnam_r])
579 AC_CACHE_CHECK([for nonposix getpwnam_r],
580 ac_cv_func_nonposix_getpwnam_r,
581 [AC_TRY_LINK([#include <pwd.h>],
584 getpwnam_r ("", &pwd, buffer,
586 [ac_cv_func_nonposix_getpwnam_r=yes],
587 [ac_cv_func_nonposix_getpwnam_r=no])])
588 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
589 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
590 [Have non-POSIX function getpwnam_r])
594 dnl check for socklen_t
595 AC_MSG_CHECKING(whether socklen_t is defined)
597 #include <sys/types.h>
598 #include <sys/socket.h>
603 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
604 AC_MSG_RESULT($dbus_have_socklen_t)
606 if test "x$dbus_have_socklen_t" = "xyes"; then
607 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
610 dnl check for writev header and writev function so we're
611 dnl good to go if HAVE_WRITEV gets defined.
612 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
614 dnl check for flavours of varargs macros (test from GLib)
615 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
617 int a(int p1, int p2, int p3);
618 #define call_a(...) a(1,__VA_ARGS__)
620 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
621 AC_MSG_RESULT($dbus_have_iso_c_varargs)
623 AC_MSG_CHECKING(for GNUC varargs macros)
625 int a(int p1, int p2, int p3);
626 #define call_a(params...) a(1,params)
628 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
629 AC_MSG_RESULT($dbus_have_gnuc_varargs)
631 dnl Output varargs tests
632 if test x$dbus_have_iso_c_varargs = xyes; then
633 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
635 if test x$dbus_have_gnuc_varargs = xyes; then
636 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
639 dnl Check for various credentials.
640 AC_MSG_CHECKING(for struct cmsgcred)
642 #include <sys/types.h>
643 #include <sys/socket.h>
645 struct cmsgcred cred;
648 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
649 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
651 if test x$dbus_have_struct_cmsgcred = xyes; then
652 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
656 #### Abstract sockets
658 AC_MSG_CHECKING(abstract socket namespace)
660 AC_RUN_IFELSE([AC_LANG_PROGRAM(
662 #include <sys/types.h>
666 #include <sys/socket.h>
672 struct sockaddr_un addr;
674 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
678 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
682 memset (&addr, '\0', sizeof (addr));
683 addr.sun_family = AF_UNIX;
684 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
685 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
687 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
689 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
696 [have_abstract_sockets=yes],
697 [have_abstract_sockets=no])
699 AC_MSG_RESULT($have_abstract_sockets)
701 if test x$enable_abstract_sockets = xyes; then
702 if test x$have_abstract_sockets = xno; then
703 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
707 if test x$enable_abstract_sockets = xno; then
708 have_abstract_sockets=no;
711 if test x$have_abstract_sockets = xyes ; then
712 DBUS_PATH_OR_ABSTRACT=abstract
713 AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
715 DBUS_PATH_OR_ABSTRACT=path
718 # this is used in addresses to prefer abstract, e.g.
719 # unix:path=/foo or unix:abstract=/foo
720 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
722 #### Sort out gettext
724 # this makes us require GLib to run autoconf, but not at runtime
728 # INTLLIBS is now set
730 # (if someone wants to go through and make internationalization
731 # conditional with #ifdef ENABLE_NLS then go crazy and send us a patch,
732 # but right now we won't build without gettext)
733 if test "$gt_cv_have_gettext" != "yes" ; then
735 *** You must have either have gettext support in your C library, or use the
736 *** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
740 #### Sort out XML library
743 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
744 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
747 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
749 # see what we want to use
750 dbus_use_libxml=false
752 if test x$with_xml = xexpat; then
754 if ! $have_expat ; then
755 AC_MSG_ERROR([Explicitly requested expat but expat not found])
757 elif test x$with_xml = xlibxml; then
759 if ! $have_libxml ; then
760 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
763 ### expat is the default because libxml can't currently survive
764 ### our brutal OOM-handling unit test setup.
765 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
766 if $have_expat ; then
769 elif $have_libxml ; then
773 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
777 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
778 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
780 if $dbus_use_expat; then
784 if $dbus_use_libxml; then
785 XML_LIBS=$LIBXML_LIBS
786 XML_CFLAGS=$LIBXML_CFLAGS
790 if test x$enable_selinux = xno ; then
793 # See if we have SELinux library
794 AC_CHECK_LIB(selinux, is_selinux_enabled,
795 have_selinux=yes, have_selinux=no)
797 # see if we have the SELinux header with the new D-BUS stuff in it
798 if test x$have_selinux = xyes ; then
799 AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
800 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
801 [#ifdef DBUS__ACQUIRE_SVC return 0;
803 #error DBUS__ACQUIRE_SVC not defined
805 have_selinux=yes, have_selinux=no)
806 AC_MSG_RESULT($have_selinux)
809 if test x$enable_selinux = xauto ; then
810 if test x$have_selinux = xno ; then
811 AC_MSG_WARN([Sufficiently new SELinux library not found])
814 if test x$have_selinux = xno ; then
815 AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
820 AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
822 if test x$have_selinux = xyes ; then
823 SELINUX_LIBS="-lselinux -lpthread"
824 AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
830 if test x$target_os = xlinux-gnu; then
831 AC_ARG_ENABLE(dnotify,
832 [ --disable-dnotify Disable using dnotify on Linux],
833 [case "${enableval}" in
834 yes) dnotify=false ;;
836 *) AC_MSG_ERROR(bad value ${enableval} for --disable-dnotify) ;;
837 esac],[dnotify=true])
839 dnl check if dnotify backend is enabled
840 if test x$dnotify = xtrue; then
841 AC_DEFINE(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX,1,[Use dnotify on Linux])
845 #### Set up final flags
848 AC_SUBST(DBUS_CLIENT_CFLAGS)
849 AC_SUBST(DBUS_CLIENT_LIBS)
851 DBUS_BUS_CFLAGS=$XML_CFLAGS
852 DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS"
853 AC_SUBST(DBUS_BUS_CFLAGS)
854 AC_SUBST(DBUS_BUS_LIBS)
858 AC_SUBST(DBUS_TEST_CFLAGS)
859 AC_SUBST(DBUS_TEST_LIBS)
862 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0 >= 2.4, have_glib=yes, have_glib=no)
863 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, gthread-2.0 >= 2.4, have_glib_threads=yes, have_glib_threads=no)
865 if test x$have_glib = xno ; then
866 AC_MSG_WARN([GLib development libraries not found])
869 if test x$enable_glib = xyes; then
870 if test x$have_glib = xno; then
871 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
875 if test x$enable_glib = xno; then
879 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
880 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
882 if test x$have_glib = xyes; then
883 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
885 GLIB_GENMARSHAL=glib-not-enabled-so-there-is-no-genmarshal
887 AC_SUBST(GLIB_GENMARSHAL)
890 AC_SUBST(DBUS_GLIB_CFLAGS)
891 AC_SUBST(DBUS_GLIB_LIBS)
892 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
894 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
895 DBUS_GLIB_TOOL_LIBS="$XML_LIBS $INTLLIBS"
896 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
897 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
900 if test x$have_glib = xno ; then
901 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
904 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0 >= 2.4, have_gtk=yes, have_gtk=no)
905 PKG_CHECK_MODULES(DBUS_GTK_THREADS, gtk+-2.0 >= 2.4 gthread-2.0, have_gtk_threads=yes, have_gtk_threads=no)
908 if test x$have_gtk = xno ; then
909 AC_MSG_WARN([GTK+ development libraries not found])
912 if test x$enable_gtk = xyes; then
913 if test x$have_gtk = xno; then
914 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
918 if test x$enable_gtk = xno; then
922 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
925 AC_SUBST(DBUS_GTK_CFLAGS)
926 AC_SUBST(DBUS_GTK_LIBS)
927 AC_SUBST(DBUS_GTK_THREADS_CFLAGS)
928 AC_SUBST(DBUS_GTK_THREADS_LIBS)
931 AC_PATH_PROG(QT_MOC, moc, no)
934 AC_MSG_CHECKING([for qglobal.h])
935 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
937 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
939 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
940 if test -f "$dir/qglobal.h"; then
942 DBUS_QT_CXXFLAGS="-I$dir"
943 DBUS_QT_LIBS="-L$QTDIR/lib -lqt-mt"
947 if test x"$have_qt" = x"yes"; then
948 AC_MSG_RESULT([found])
950 AC_MSG_RESULT([not found])
953 if test x$have_qt = xno ; then
954 AC_MSG_WARN([Qt development libraries not found])
957 if test x$enable_qt = xyes; then
958 if test x$have_qt = xno; then
959 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
963 if test x$enable_qt = xno; then
967 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
970 AC_SUBST(DBUS_QT_CXXFLAGS)
971 AC_SUBST(DBUS_QT_LIBS)
976 ## for now enable_x11 just tracks have_x11,
977 ## there's no --enable-x11
978 if test x$no_x = xyes ; then
986 if test x$enable_x11 = xyes ; then
987 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
988 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
989 DBUS_X_CFLAGS="$X_CFLAGS"
995 AC_SUBST(DBUS_X_CFLAGS)
996 AC_SUBST(DBUS_X_LIBS)
998 ### Doxygen Documentation
1000 AC_PATH_PROG(DOXYGEN, doxygen, no)
1002 AC_MSG_CHECKING([whether to build Doxygen documentation])
1004 if test x$DOXYGEN = xno ; then
1010 if test x$enable_doxygen_docs = xauto ; then
1011 if test x$have_doxygen = xno ; then
1012 enable_doxygen_docs=no
1014 enable_doxygen_docs=yes
1018 if test x$enable_doxygen_docs = xyes; then
1019 if test x$have_doxygen = xno; then
1020 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
1024 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
1027 ### XML Documentation
1029 AC_PATH_PROG(XMLTO, xmlto, no)
1031 AC_MSG_CHECKING([whether to build XML documentation])
1033 if test x$XMLTO = xno ; then
1039 if test x$enable_xml_docs = xauto ; then
1040 if test x$have_xmlto = xno ; then
1047 if test x$enable_xml_docs = xyes; then
1048 if test x$have_xmlto = xno; then
1049 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
1053 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
1056 #### Have to go $localstatedir->$prefix/var->/usr/local/var
1057 #### someone please fix this a better way...
1059 #### find the actual value for $prefix that we'll end up with
1060 ## (I know this is broken and should be done in the Makefile, but
1061 ## that's a major pain and almost nobody actually seems to care)
1063 if test "x$prefix" = "xNONE"; then
1064 REAL_PREFIX=$ac_default_prefix
1069 ## temporarily change prefix and exec_prefix
1073 if test "x$exec_prefix" = xNONE ; then
1074 REAL_EXEC_PREFIX=$REAL_PREFIX
1076 REAL_EXEC_PREFIX=$exec_prefix
1078 old_exec_prefix=$exec_prefix
1079 exec_prefix=$REAL_EXEC_PREFIX
1082 LOCALSTATEDIR_TMP="$localstatedir"
1083 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
1084 AC_SUBST(EXPANDED_LOCALSTATEDIR)
1086 SYSCONFDIR_TMP="$sysconfdir"
1087 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
1088 AC_SUBST(EXPANDED_SYSCONFDIR)
1090 BINDIR_TMP="$bindir"
1091 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
1092 AC_SUBST(EXPANDED_BINDIR)
1094 LIBDIR_TMP="$libdir"
1095 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
1096 AC_SUBST(EXPANDED_LIBDIR)
1098 DATADIR_TMP="$datadir"
1099 EXPANDED_DATADIR=`eval echo $DATADIR_TMP`
1100 AC_SUBST(EXPANDED_DATADIR)
1102 ## put prefix and exec_prefix back
1104 exec_prefix=$old_exec_prefix
1106 #### Check our operating system
1107 operating_system=unknown
1108 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
1109 operating_system=redhat
1112 if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
1113 operating_system=slackware
1116 #### Sort out init scripts
1118 if test x$with_init_scripts = x; then
1119 if test xredhat = x$operating_system ; then
1120 with_init_scripts=redhat
1122 if test xslackware = x$operating_system ; then
1123 with_init_scripts=slackware
1125 with_init_scripts=none
1130 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
1132 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
1134 ##### Set up location for system bus socket
1135 if ! test -z "$with_system_socket"; then
1136 DBUS_SYSTEM_SOCKET=$with_system_socket
1138 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
1141 AC_SUBST(DBUS_SYSTEM_SOCKET)
1142 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
1144 ## system bus only listens on local domain sockets, and never
1145 ## on an abstract socket (so only root can create the socket)
1146 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
1147 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
1148 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-BUS address of the system bus])
1150 #### Set up the pid file
1151 if ! test -z "$with_system_pid_file"; then
1152 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
1153 elif test x$operating_system = xredhat ; then
1154 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
1156 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
1159 AC_SUBST(DBUS_SYSTEM_PID_FILE)
1161 #### Directory to check for console ownership
1162 if ! test -z "$with_console_auth_dir"; then
1163 DBUS_CONSOLE_AUTH_DIR=$with_console_auth_dir
1165 DBUS_CONSOLE_AUTH_DIR=/var/run/console/
1168 AC_SUBST(DBUS_CONSOLE_AUTH_DIR)
1169 AC_DEFINE_UNQUOTED(DBUS_CONSOLE_AUTH_DIR, "$DBUS_CONSOLE_AUTH_DIR", [Directory to check for console ownerhip])
1171 #### User to start the system bus as
1172 if test -z "$with_dbus_user" ; then
1173 DBUS_USER=messagebus
1175 DBUS_USER=$with_dbus_user
1178 AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
1180 #### Tell tests where to find certain stuff in builddir
1181 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
1183 AC_DEFUN(TEST_PATH, [
1184 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
1185 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
1186 [Full path to test file test/$2 in builddir])
1190 TEST_PATH(SERVICE_DIR, data/valid-service-files)
1191 TEST_PATH(SERVICE_BINARY, test-service)
1192 TEST_PATH(SHELL_SERVICE_BINARY, test-shell-service)
1193 TEST_PATH(GLIB_SERVICE_BINARY, glib/test-service-glib)
1194 TEST_PATH(PYTHON_SERVICE_BINARY, python/test-service.py)
1195 TEST_PATH(EXIT_BINARY, test-exit)
1196 TEST_PATH(SEGFAULT_BINARY, test-segfault)
1197 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
1198 AC_SUBST(ABSOLUTE_TOP_BUILDDIR)
1200 #### Find socket directories
1201 if ! test -z "$TMPDIR" ; then
1202 DEFAULT_SOCKET_DIR=$TMPDIR
1203 elif ! test -z "$TEMP" ; then
1204 DEFAULT_SOCKET_DIR=$TEMP
1205 elif ! test -z "$TMP" ; then
1206 DEFAULT_SOCKET_DIR=$TMP
1208 DEFAULT_SOCKET_DIR=/tmp
1211 if ! test -z "$with_test_socket_dir" ; then
1212 TEST_SOCKET_DIR="$with_test_socket_dir"
1214 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1216 AC_SUBST(TEST_SOCKET_DIR)
1217 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1219 if ! test -z "$with_session_socket_dir" ; then
1220 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1222 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1224 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
1225 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
1227 # Detect if we can build Python bindings (need python, python headers, and pyrex)
1228 if test x$enable_python = xno; then
1231 have_python_version=2.4
1232 AC_MSG_NOTICE([Checking to see if we can build Python bindings])
1236 if test -z "$PYTHON" ; then
1237 AC_MSG_WARN([Python not found])
1239 AC_MSG_CHECKING([whether $PYTHON version >= $have_python_version])
1240 AM_PYTHON_CHECK_VERSION([$PYTHON], [$have_python_version],
1241 [have_python_version="yes"],
1242 [have_python_version="too old"])
1244 AC_MSG_RESULT($have_python_version)
1246 AC_CHECK_PROGS(PYREX, pyrexc)
1248 if test -z "$PYREX" ; then
1254 AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
1256 if test x$have_pyrex = xyes -a x$have_python_headers = xyes -a "x$have_python_version" = xyes ; then
1261 if test x$have_python = xno ; then
1262 if test x$enable_python = xyes ; then
1263 AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings because either Pyrex, Python headers or a suitable Python version was not found])
1265 AC_MSG_WARN([Couldn't find either Pyrex, the Python headers or a suitable version of Python, not building Python bindings])
1270 AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
1274 dbus/dbus-arch-deps.h
1283 glib/examples/Makefile
1284 glib/examples/statemachine/Makefile
1286 python/examples/Makefile
1290 gcj/org/freedesktop/Makefile
1291 gcj/org/freedesktop/dbus/Makefile
1293 mono/AssemblyInfo.cs
1294 mono/dbus-sharp.dll.config
1295 mono/example/Makefile
1301 test/python/Makefile
1306 test/data/valid-config-files/debug-allow-all.conf
1307 test/data/valid-config-files/debug-allow-all-sha1.conf
1308 test/data/valid-service-files/debug-echo.service
1309 test/data/valid-service-files/debug-segfault.service
1310 test/data/valid-service-files/debug-glib.service
1311 test/data/valid-service-files/debug-shell-echo-success.service
1312 test/data/valid-service-files/debug-shell-echo-fail.service
1313 test/data/valid-service-files/debug-python.service
1316 ### FIXME it's bizarre that have_qt and have_glib are used
1317 ### instead of enable_ - should fix things so that enable
1318 ### is always whether it's enabled, and have is always whether
1321 dnl ==========================================================================
1327 exec_prefix: ${exec_prefix}
1328 libdir: ${EXPANDED_LIBDIR}
1329 bindir: ${EXPANDED_BINDIR}
1330 sysconfdir: ${EXPANDED_SYSCONFDIR}
1331 localstatedir: ${EXPANDED_LOCALSTATEDIR}
1332 datadir: ${EXPANDED_DATADIR}
1333 source code location: ${srcdir}
1336 cppflags: ${CPPFLAGS}
1337 cxxflags: ${CXXFLAGS}
1338 64-bit int: ${DBUS_INT64_TYPE}
1339 32-bit int: ${DBUS_INT32_TYPE}
1340 16-bit int: ${DBUS_INT16_TYPE}
1344 if test x$enable_gcj = xyes ; then
1347 gcjflags: ${GCJFLAGS}"
1350 " gcj: (not enabled)"
1353 if test x$enable_mono = xyes ; then
1359 " csc: (not enabled)
1364 Maintainer mode: ${USE_MAINTAINER_MODE}
1365 gcc coverage profiling: ${enable_gcov}
1366 Building unit tests: ${enable_tests}
1367 Building verbose mode: ${enable_verbose_mode}
1368 Building assertions: ${enable_asserts}
1369 Building checks: ${enable_checks}
1370 Building Qt bindings: ${have_qt}
1371 Building GLib bindings: ${have_glib}
1372 Building Python bindings: ${have_python}
1373 Building SELinux support: ${have_selinux}
1374 Building Mono bindings: ${enable_mono}
1375 Building Mono docs: ${enable_mono_docs}
1376 Building GTK+ tools: ${have_gtk}
1377 Building X11 code: ${enable_x11}
1378 Building Doxygen docs: ${enable_doxygen_docs}
1379 Building XML docs: ${enable_xml_docs}
1380 Gettext libs (empty OK): ${INTLLIBS}
1381 Using XML parser: ${with_xml}
1382 Init scripts style: ${with_init_scripts}
1383 Abstract socket names: ${have_abstract_sockets}
1384 System bus socket: ${DBUS_SYSTEM_SOCKET}
1385 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1386 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
1387 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
1388 Console auth dir: ${DBUS_CONSOLE_AUTH_DIR}
1389 System bus user: ${DBUS_USER}
1390 'make check' socket dir: ${TEST_SOCKET_DIR}
1393 if test x$enable_tests = xyes; then
1394 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1396 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1397 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)"
1399 if test x$enable_gcov = xyes; then
1400 echo "NOTE: building with coverage profiling is definitely for developers only."
1402 if test x$enable_verbose_mode = xyes; then
1403 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1405 if test x$enable_asserts = xyes; then
1406 echo "NOTE: building with assertions increases library size and decreases performance."
1408 if test x$enable_checks = xno; then
1409 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."