6 AM_INIT_AUTOMAKE(dbus, 0.35)
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])
74 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
75 dnl and also some stuff in the test/ subdir
76 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
77 if test x$enable_tests = xyes; then
78 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
81 if test x$enable_verbose_mode = xyes; then
82 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
84 if test x$enable_asserts = xno; then
85 AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
86 AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
88 if test x$enable_checks = xno; then
89 AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
90 AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
93 #### gcc warning flags
95 if test "x$GCC" = "xyes"; then
98 *[\ \ ]-Wall[\ \ ]*) ;;
99 *) CFLAGS="$CFLAGS -Wall" ;;
103 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
104 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
108 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
109 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
113 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
114 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
118 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
119 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
123 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
124 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
128 *[\ \ ]-Wcast-align[\ \ ]*) ;;
129 *) CFLAGS="$CFLAGS -Wcast-align" ;;
133 *[\ \ ]-Wfloat-equal[\ \ ]*) ;;
134 *) CFLAGS="$CFLAGS -Wfloat-equal" ;;
138 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
139 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
142 if test "x$enable_ansi" = "xyes"; then
144 *[\ \ ]-ansi[\ \ ]*) ;;
145 *) CFLAGS="$CFLAGS -ansi" ;;
149 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
150 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
154 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
155 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
159 *[\ \ ]-pedantic[\ \ ]*) ;;
160 *) CFLAGS="$CFLAGS -pedantic" ;;
163 if test x$enable_gcov = xyes; then
165 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
166 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
169 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
170 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
173 ## remove optimization
174 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
178 if test x$enable_gcov = xyes; then
179 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
183 #### can't use AM_PROG_GCJ since it fails fatally if no gcj found
184 AC_CHECK_PROGS(GCJ, gcj, gcj)
185 if test -z "$GCJ" ; then
188 # Needs to be here so libtool wont get confused
192 if test "x${GCJFLAGS-unset}" = xunset; then
193 GCJFLAGS="-g -O2 -Wall"
198 if test x$enable_gcj = xauto ; then
199 if test x$have_gcj = xno ; then
206 if test x$enable_gcj = xyes; then
207 if test x$have_gcj = xno ; then
208 AC_MSG_ERROR([Building gcj explicitly required, but gcj not found])
212 AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
217 MONO_REQUIRED_VERSION=0.95
218 AC_SUBST(MONO_REQUIRED_VERSION)
219 PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, have_mono=true, have_mono=false)
221 if test "x$enable_mono" = "xyes"; then
222 if test "x$have_mono" = "xfalse"; then
223 AC_MSG_ERROR([Mono was not found])
227 if test "x$have_mono" = "xtrue"; then
228 if test `uname -s` = "Darwin"; then
229 AC_PATH_PROG(RUNTIME, mint, no)
230 AC_PATH_PROG(CSC, mcs, no)
234 AC_PATH_PROG(RUNTIME, mono, no)
235 AC_PATH_PROG(CSC, mcs, no)
240 AC_PATH_PROG(CSC, csc.exe, no)
246 if test x$enable_mono = xyes; then
247 if test x$have_mcs = xno ; then
248 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
252 AC_PATH_PROG(GACUTIL, gacutil, no)
253 if test "x$GACUTIL" = "xno" ; then
254 AC_MSG_ERROR([No gacutil tool found])
260 if test x$enable_mono = xauto ; then
261 if test x$CSC = xno ; then
265 AC_PATH_PROG(GACUTIL, gacutil, no)
266 if test "x$GACUTIL" = "xno" ; then
280 AM_CONDITIONAL(DBUS_USE_CSC, test x$enable_mono = xyes)
282 #### Look for monodoc
283 MONODOC_REQUIRED_VERSION=0.16
284 AC_SUBST(MONODOC_REQUIRED_VERSION)
285 PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, have_monodoc=yes, have_monodoc=no)
287 if test x$enable_mono_docs = xyes; then
288 if test x$have_monodoc = xno ; then
289 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
291 AC_PATH_PROG(MONODOC, monodoc, no)
292 if test x$MONODOC = xno; then
293 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
298 if test x$enable_mono_docs = xauto ; then
299 if test x$have_monodoc = xno ; then
303 AC_PATH_PROG(MONODOC, monodoc, no)
304 if test x$MONODOC = xno; then
315 AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_mono_docs" = "xyes")
318 # let ourselves use our own unstable API
319 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
320 # compress spaces in flags
321 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
322 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
323 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
326 if test x$enable_gcov = xyes; then
327 ## so that config.h changes when you toggle gcov support
328 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
330 AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
332 AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
334 if test x$have_gcc33_gcov = xyes ; then
335 AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
337 AC_MSG_RESULT($have_gcc33_gcov)
339 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
343 AC_CHECK_SIZEOF(char)
344 AC_CHECK_SIZEOF(short)
345 AC_CHECK_SIZEOF(long)
347 AC_CHECK_SIZEOF(void *)
348 AC_CHECK_SIZEOF(long long)
349 AC_CHECK_SIZEOF(__int64)
351 ### See what our 64 bit type is called
352 AC_MSG_CHECKING([64-bit integer type])
357 dbusint64_constant='(val)'
358 dbusuint64_constant='(val)'
362 dbusint64_constant='(val##L)'
363 dbusuint64_constant='(val##UL)'
365 $ac_cv_sizeof_long_long)
366 dbusint64='long long'
367 dbusint64_constant='(val##LL)'
368 dbusuint64_constant='(val##ULL)'
370 $ac_cv_sizeof___int64)
372 dbusint64_constant='(val##i64)'
373 dbusuint64_constant='(val##ui64)'
377 if test -z "$dbusint64" ; then
378 DBUS_INT64_TYPE="no_int64_type_detected"
381 DBUS_UINT64_CONSTANT=
382 AC_MSG_RESULT([none found])
384 DBUS_INT64_TYPE="$dbusint64"
386 DBUS_INT64_CONSTANT="$dbusint64_constant"
387 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
388 AC_MSG_RESULT($DBUS_INT64_TYPE)
391 AC_SUBST(DBUS_INT64_TYPE)
392 AC_SUBST(DBUS_INT64_CONSTANT)
393 AC_SUBST(DBUS_UINT64_CONSTANT)
394 AC_SUBST(DBUS_HAVE_INT64)
396 ### see what 32-bit int is called
397 AC_MSG_CHECKING([32-bit integer type])
411 if test -z "$dbusint32" ; then
412 DBUS_INT32_TYPE="no_int32_type_detected"
413 AC_MSG_ERROR([No 32-bit integer type found])
415 DBUS_INT32_TYPE="$dbusint32"
416 AC_MSG_RESULT($DBUS_INT32_TYPE)
419 AC_SUBST(DBUS_INT32_TYPE)
421 ### see what 16-bit int is called
422 AC_MSG_CHECKING([16-bit integer type])
433 if test -z "$dbusint16" ; then
434 DBUS_INT16_TYPE="no_int16_type_detected"
435 AC_MSG_ERROR([No 16-bit integer type found])
437 DBUS_INT16_TYPE="$dbusint16"
438 AC_MSG_RESULT($DBUS_INT16_TYPE)
441 AC_SUBST(DBUS_INT16_TYPE)
447 dnl **********************************
448 dnl *** va_copy checks (from GLib) ***
449 dnl **********************************
450 dnl we currently check for all three va_copy possibilities, so we get
451 dnl all results in config.log for bug reports.
452 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
453 AC_LINK_IFELSE([#include <stdarg.h>
454 void f (int i, ...) {
455 va_list args1, args2;
457 va_copy (args2, args1);
458 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
460 va_end (args1); va_end (args2);
466 [dbus_cv_va_copy=yes],
467 [dbus_cv_va_copy=no])
469 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
470 AC_LINK_IFELSE([#include <stdarg.h>
471 void f (int i, ...) {
472 va_list args1, args2;
474 __va_copy (args2, args1);
475 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
477 va_end (args1); va_end (args2);
483 [dbus_cv___va_copy=yes],
484 [dbus_cv___va_copy=no])
487 if test "x$dbus_cv_va_copy" = "xyes"; then
488 dbus_va_copy_func=va_copy
489 else if test "x$dbus_cv___va_copy" = "xyes"; then
490 dbus_va_copy_func=__va_copy
494 if test -n "$dbus_va_copy_func"; then
495 AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
498 AC_CACHE_CHECK([whether va_lists can be copied by value],dbus_cv_va_val_copy,[
499 AC_TRY_RUN([#include <stdarg.h>
500 void f (int i, ...) {
501 va_list args1, args2;
504 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
506 va_end (args1); va_end (args2);
512 [dbus_cv_va_val_copy=yes],
513 [dbus_cv_va_val_copy=no],
514 [dbus_cv_va_val_copy=yes])
517 if test "x$dbus_cv_va_val_copy" = "xno"; then
518 AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
522 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
523 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
525 if test x"$GCC" = xyes; then
526 if test "x$enable_ansi" = "xyes"; then
534 AC_MSG_RESULT([i486])
535 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
544 if test x$have_atomic_inc = xyes ; then
545 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
548 #### Various functions
549 AC_CHECK_LIB(socket,socket)
550 AC_CHECK_LIB(nsl,gethostbyname)
552 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
554 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
556 AC_CACHE_CHECK([for posix getpwnam_r],
557 ac_cv_func_posix_getpwnam_r,
563 struct passwd pwd, *pwptr = &pwd;
566 error = getpwnam_r ("", &pwd, buffer,
567 sizeof (buffer), &pwptr);
568 return (error < 0 && errno == ENOSYS)
571 [ac_cv_func_posix_getpwnam_r=yes],
572 [ac_cv_func_posix_getpwnam_r=no])])
573 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
574 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
575 [Have POSIX function getpwnam_r])
577 AC_CACHE_CHECK([for nonposix getpwnam_r],
578 ac_cv_func_nonposix_getpwnam_r,
579 [AC_TRY_LINK([#include <pwd.h>],
582 getpwnam_r ("", &pwd, buffer,
584 [ac_cv_func_nonposix_getpwnam_r=yes],
585 [ac_cv_func_nonposix_getpwnam_r=no])])
586 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
587 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
588 [Have non-POSIX function getpwnam_r])
592 dnl check for socklen_t
593 AC_MSG_CHECKING(whether socklen_t is defined)
595 #include <sys/types.h>
596 #include <sys/socket.h>
601 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
602 AC_MSG_RESULT($dbus_have_socklen_t)
604 if test "x$dbus_have_socklen_t" = "xyes"; then
605 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
608 dnl check for writev header and writev function so we're
609 dnl good to go if HAVE_WRITEV gets defined.
610 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
612 dnl check for flavours of varargs macros (test from GLib)
613 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
615 int a(int p1, int p2, int p3);
616 #define call_a(...) a(1,__VA_ARGS__)
618 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
619 AC_MSG_RESULT($dbus_have_iso_c_varargs)
621 AC_MSG_CHECKING(for GNUC varargs macros)
623 int a(int p1, int p2, int p3);
624 #define call_a(params...) a(1,params)
626 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
627 AC_MSG_RESULT($dbus_have_gnuc_varargs)
629 dnl Output varargs tests
630 if test x$dbus_have_iso_c_varargs = xyes; then
631 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
633 if test x$dbus_have_gnuc_varargs = xyes; then
634 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
637 dnl Check for various credentials.
638 AC_MSG_CHECKING(for struct cmsgcred)
640 #include <sys/types.h>
641 #include <sys/socket.h>
643 struct cmsgcred cred;
646 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
647 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
649 if test x$dbus_have_struct_cmsgcred = xyes; then
650 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
654 #### Abstract sockets
656 AC_MSG_CHECKING(abstract socket namespace)
658 AC_RUN_IFELSE([AC_LANG_PROGRAM(
660 #include <sys/types.h>
664 #include <sys/socket.h>
670 struct sockaddr_un addr;
672 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
676 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
680 memset (&addr, '\0', sizeof (addr));
681 addr.sun_family = AF_UNIX;
682 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
683 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
685 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
687 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
694 [have_abstract_sockets=yes],
695 [have_abstract_sockets=no])
697 AC_MSG_RESULT($have_abstract_sockets)
699 if test x$enable_abstract_sockets = xyes; then
700 if test x$have_abstract_sockets = xno; then
701 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
705 if test x$enable_abstract_sockets = xno; then
706 have_abstract_sockets=no;
709 if test x$have_abstract_sockets = xyes ; then
710 DBUS_PATH_OR_ABSTRACT=abstract
711 AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
713 DBUS_PATH_OR_ABSTRACT=path
716 # this is used in addresses to prefer abstract, e.g.
717 # unix:path=/foo or unix:abstract=/foo
718 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
720 #### Sort out gettext
722 # this makes us require GLib to run autoconf, but not at runtime
726 # INTLLIBS is now set
728 # (if someone wants to go through and make internationalization
729 # conditional with #ifdef ENABLE_NLS then go crazy and send us a patch,
730 # but right now we won't build without gettext)
731 if test "$gt_cv_have_gettext" != "yes" ; then
733 *** You must have either have gettext support in your C library, or use the
734 *** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
738 #### Sort out XML library
741 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
742 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
745 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
747 # see what we want to use
748 dbus_use_libxml=false
750 if test x$with_xml = xexpat; then
752 if ! $have_expat ; then
753 AC_MSG_ERROR([Explicitly requested expat but expat not found])
755 elif test x$with_xml = xlibxml; then
757 if ! $have_libxml ; then
758 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
761 ### expat is the default because libxml can't currently survive
762 ### our brutal OOM-handling unit test setup.
763 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
764 if $have_expat ; then
767 elif $have_libxml ; then
771 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
775 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
776 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
778 if $dbus_use_expat; then
782 if $dbus_use_libxml; then
783 XML_LIBS=$LIBXML_LIBS
784 XML_CFLAGS=$LIBXML_CFLAGS
788 if test x$enable_selinux = xno ; then
791 # See if we have SELinux library
792 AC_CHECK_LIB(selinux, is_selinux_enabled,
793 have_selinux=yes, have_selinux=no)
795 # see if we have the SELinux header with the new D-BUS stuff in it
796 if test x$have_selinux = xyes ; then
797 AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
798 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
799 [#ifdef DBUS__ACQUIRE_SVC return 0;
801 #error DBUS__ACQUIRE_SVC not defined
803 have_selinux=yes, have_selinux=no)
804 AC_MSG_RESULT($have_selinux)
807 if test x$enable_selinux = xauto ; then
808 if test x$have_selinux = xno ; then
809 AC_MSG_WARN([Sufficiently new SELinux library not found])
812 if test x$have_selinux = xno ; then
813 AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
818 AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
820 if test x$have_selinux = xyes ; then
821 SELINUX_LIBS="-lselinux -lpthread"
822 AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
828 if test x$target_os = xlinux-gnu; then
829 AC_ARG_ENABLE(dnotify,
830 [ --disable-dnotify Disable using dnotify on Linux],
831 [case "${enableval}" in
832 yes) dnotify=false ;;
834 *) AC_MSG_ERROR(bad value ${enableval} for --disable-dnotify) ;;
835 esac],[dnotify=true])
837 dnl check if dnotify backend is enabled
838 if test x$dnotify = xtrue; then
839 AC_DEFINE(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX,1,[Use dnotify on Linux])
843 #### Set up final flags
846 AC_SUBST(DBUS_CLIENT_CFLAGS)
847 AC_SUBST(DBUS_CLIENT_LIBS)
849 DBUS_BUS_CFLAGS=$XML_CFLAGS
850 DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS"
851 AC_SUBST(DBUS_BUS_CFLAGS)
852 AC_SUBST(DBUS_BUS_LIBS)
856 AC_SUBST(DBUS_TEST_CFLAGS)
857 AC_SUBST(DBUS_TEST_LIBS)
860 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
861 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
863 if test x$have_glib = xno ; then
864 AC_MSG_WARN([GLib development libraries not found])
867 if test x$enable_glib = xyes; then
868 if test x$have_glib = xno; then
869 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
873 if test x$enable_glib = xno; then
877 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
878 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
880 if test x$have_glib = xyes; then
881 GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
883 GLIB_GENMARSHAL=glib-not-enabled-so-there-is-no-genmarshal
885 AC_SUBST(GLIB_GENMARSHAL)
888 AC_SUBST(DBUS_GLIB_CFLAGS)
889 AC_SUBST(DBUS_GLIB_LIBS)
890 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
892 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
893 DBUS_GLIB_TOOL_LIBS="$XML_LIBS $INTLLIBS"
894 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
895 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
898 if test x$have_glib = xno ; then
899 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
902 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0 >= 2.4, have_gtk=yes, have_gtk=no)
903 PKG_CHECK_MODULES(DBUS_GTK_THREADS, gtk+-2.0 >= 2.4 gthread-2.0, have_gtk_threads=yes, have_gtk_threads=no)
906 if test x$have_gtk = xno ; then
907 AC_MSG_WARN([GTK+ development libraries not found])
910 if test x$enable_gtk = xyes; then
911 if test x$have_gtk = xno; then
912 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
916 if test x$enable_gtk = xno; then
920 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
923 AC_SUBST(DBUS_GTK_CFLAGS)
924 AC_SUBST(DBUS_GTK_LIBS)
925 AC_SUBST(DBUS_GTK_THREADS_CFLAGS)
926 AC_SUBST(DBUS_GTK_THREADS_LIBS)
929 AC_PATH_PROG(QT_MOC, moc, no)
932 AC_MSG_CHECKING([for qglobal.h])
933 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
935 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
937 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
938 if test -f "$dir/qglobal.h"; then
940 DBUS_QT_CXXFLAGS="-I$dir"
944 if test x"$have_qt" = x"yes"; then
945 AC_MSG_RESULT([found])
947 AC_MSG_RESULT([not found])
950 dnl linking to kdecore will give us a bit of help from libtool
951 if (! kde-config >& /dev/null); then
954 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
955 if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
958 DBUS_QT_LIBS="$kdelibs/libkdecore.la"
962 if test x$have_qt = xno ; then
963 AC_MSG_WARN([Qt development libraries not found])
966 if test x$enable_qt = xyes; then
967 if test x$have_qt = xno; then
968 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
972 if test x$enable_qt = xno; then
976 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
979 AC_SUBST(DBUS_QT_CXXFLAGS)
980 AC_SUBST(DBUS_QT_LIBS)
985 ## for now enable_x11 just tracks have_x11,
986 ## there's no --enable-x11
987 if test x$no_x = xyes ; then
995 if test x$enable_x11 = xyes ; then
996 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
997 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
998 DBUS_X_CFLAGS="$X_CFLAGS"
1004 AC_SUBST(DBUS_X_CFLAGS)
1005 AC_SUBST(DBUS_X_LIBS)
1007 ### Doxygen Documentation
1009 AC_PATH_PROG(DOXYGEN, doxygen, no)
1011 AC_MSG_CHECKING([whether to build Doxygen documentation])
1013 if test x$DOXYGEN = xno ; then
1019 if test x$enable_doxygen_docs = xauto ; then
1020 if test x$have_doxygen = xno ; then
1021 enable_doxygen_docs=no
1023 enable_doxygen_docs=yes
1027 if test x$enable_doxygen_docs = xyes; then
1028 if test x$have_doxygen = xno; then
1029 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
1033 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
1036 ### XML Documentation
1038 AC_PATH_PROG(XMLTO, xmlto, no)
1040 AC_MSG_CHECKING([whether to build XML documentation])
1042 if test x$XMLTO = xno ; then
1048 if test x$enable_xml_docs = xauto ; then
1049 if test x$have_xmlto = xno ; then
1056 if test x$enable_xml_docs = xyes; then
1057 if test x$have_xmlto = xno; then
1058 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
1062 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
1065 #### Have to go $localstatedir->$prefix/var->/usr/local/var
1066 #### someone please fix this a better way...
1068 #### find the actual value for $prefix that we'll end up with
1069 ## (I know this is broken and should be done in the Makefile, but
1070 ## that's a major pain and almost nobody actually seems to care)
1072 if test "x$prefix" = "xNONE"; then
1073 REAL_PREFIX=$ac_default_prefix
1078 ## temporarily change prefix and exec_prefix
1082 if test "x$exec_prefix" = xNONE ; then
1083 REAL_EXEC_PREFIX=$REAL_PREFIX
1085 REAL_EXEC_PREFIX=$exec_prefix
1087 old_exec_prefix=$exec_prefix
1088 exec_prefix=$REAL_EXEC_PREFIX
1091 LOCALSTATEDIR_TMP="$localstatedir"
1092 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
1093 AC_SUBST(EXPANDED_LOCALSTATEDIR)
1095 SYSCONFDIR_TMP="$sysconfdir"
1096 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
1097 AC_SUBST(EXPANDED_SYSCONFDIR)
1099 BINDIR_TMP="$bindir"
1100 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
1101 AC_SUBST(EXPANDED_BINDIR)
1103 LIBDIR_TMP="$libdir"
1104 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
1105 AC_SUBST(EXPANDED_LIBDIR)
1107 DATADIR_TMP="$datadir"
1108 EXPANDED_DATADIR=`eval echo $DATADIR_TMP`
1109 AC_SUBST(EXPANDED_DATADIR)
1111 ## put prefix and exec_prefix back
1113 exec_prefix=$old_exec_prefix
1115 #### Check our operating system
1116 operating_system=unknown
1117 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
1118 operating_system=redhat
1121 if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
1122 operating_system=slackware
1125 #### Sort out init scripts
1127 if test x$with_init_scripts = x; then
1128 if test xredhat = x$operating_system ; then
1129 with_init_scripts=redhat
1131 if test xslackware = x$operating_system ; then
1132 with_init_scripts=slackware
1134 with_init_scripts=none
1139 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
1141 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
1143 ##### Set up location for system bus socket
1144 if ! test -z "$with_system_socket"; then
1145 DBUS_SYSTEM_SOCKET=$with_system_socket
1147 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
1150 AC_SUBST(DBUS_SYSTEM_SOCKET)
1151 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
1153 ## system bus only listens on local domain sockets, and never
1154 ## on an abstract socket (so only root can create the socket)
1155 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
1156 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
1157 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-BUS address of the system bus])
1159 #### Set up the pid file
1160 if ! test -z "$with_system_pid_file"; then
1161 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
1162 elif test x$operating_system = xredhat ; then
1163 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
1165 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
1168 AC_SUBST(DBUS_SYSTEM_PID_FILE)
1170 #### Tell tests where to find certain stuff in builddir
1171 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
1173 AC_DEFUN(TEST_PATH, [
1174 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
1175 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
1176 [Full path to test file test/$2 in builddir])
1180 TEST_PATH(SERVICE_DIR, data/valid-service-files)
1181 TEST_PATH(SERVICE_BINARY, test-service)
1182 TEST_PATH(GLIB_SERVICE_BINARY, glib/test-service-glib)
1183 TEST_PATH(EXIT_BINARY, test-exit)
1184 TEST_PATH(SEGFAULT_BINARY, test-segfault)
1185 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
1186 AC_SUBST(ABSOLUTE_TOP_BUILDDIR)
1188 #### Find socket directories
1189 if ! test -z "$TMPDIR" ; then
1190 DEFAULT_SOCKET_DIR=$TMPDIR
1191 elif ! test -z "$TEMP" ; then
1192 DEFAULT_SOCKET_DIR=$TEMP
1193 elif ! test -z "$TMP" ; then
1194 DEFAULT_SOCKET_DIR=$TMP
1196 DEFAULT_SOCKET_DIR=/tmp
1199 if ! test -z "$with_test_socket_dir" ; then
1200 TEST_SOCKET_DIR="$with_test_socket_dir"
1202 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1204 AC_SUBST(TEST_SOCKET_DIR)
1205 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1207 if ! test -z "$with_session_socket_dir" ; then
1208 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1210 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1212 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
1213 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
1215 # Detect if we can build Python bindings (need python, python headers, and pyrex)
1216 if test x$enable_python = xno; then
1219 AC_MSG_NOTICE([Checking to see if we can build Python bindings])
1223 if test -z "$PYTHON" ; then
1224 AC_MSG_WARN([Python not found])
1226 AC_CHECK_PROGS(PYREX, pyrexc)
1228 if test -z "$PYREX" ; then
1234 AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
1236 if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
1241 if test x$have_python = xno ; then
1242 if test x$enable_python = xyes ; then
1243 AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
1245 AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings])
1250 AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
1254 dbus/dbus-arch-deps.h
1263 glib/examples/Makefile
1265 python/examples/Makefile
1269 gcj/org/freedesktop/Makefile
1270 gcj/org/freedesktop/dbus/Makefile
1272 mono/AssemblyInfo.cs
1273 mono/dbus-sharp.dll.config
1274 mono/example/Makefile
1284 test/data/valid-config-files/debug-allow-all.conf
1285 test/data/valid-config-files/debug-allow-all-sha1.conf
1286 test/data/valid-service-files/debug-echo.service
1287 test/data/valid-service-files/debug-segfault.service
1288 test/data/valid-service-files/debug-glib.service
1291 ### FIXME it's bizarre that have_qt and have_glib are used
1292 ### instead of enable_ - should fix things so that enable
1293 ### is always whether it's enabled, and have is always whether
1296 dnl ==========================================================================
1302 exec_prefix: ${exec_prefix}
1303 libdir: ${EXPANDED_LIBDIR}
1304 bindir: ${EXPANDED_BINDIR}
1305 sysconfdir: ${EXPANDED_SYSCONFDIR}
1306 localstatedir: ${EXPANDED_LOCALSTATEDIR}
1307 datadir: ${EXPANDED_DATADIR}
1308 source code location: ${srcdir}
1311 cppflags: ${CPPFLAGS}
1312 cxxflags: ${CXXFLAGS}
1313 64-bit int: ${DBUS_INT64_TYPE}
1314 32-bit int: ${DBUS_INT32_TYPE}
1315 16-bit int: ${DBUS_INT16_TYPE}
1319 if test x$enable_gcj = xyes ; then
1322 gcjflags: ${GCJFLAGS}"
1325 " gcj: (not enabled)"
1328 if test x$enable_mono = xyes ; then
1334 " csc: (not enabled)
1339 Maintainer mode: ${USE_MAINTAINER_MODE}
1340 gcc coverage profiling: ${enable_gcov}
1341 Building unit tests: ${enable_tests}
1342 Building verbose mode: ${enable_verbose_mode}
1343 Building assertions: ${enable_asserts}
1344 Building checks: ${enable_checks}
1345 Building Qt bindings: ${have_qt}
1346 Building GLib bindings: ${have_glib}
1347 Building Python bindings: ${have_python}
1348 Building SELinux support: ${have_selinux}
1349 Building Mono bindings: ${enable_mono}
1350 Building Mono docs: ${enable_mono_docs}
1351 Building GTK+ tools: ${have_gtk}
1352 Building X11 code: ${enable_x11}
1353 Building Doxygen docs: ${enable_doxygen_docs}
1354 Building XML docs: ${enable_xml_docs}
1355 Gettext libs (empty OK): ${INTLLIBS}
1356 Using XML parser: ${with_xml}
1357 Init scripts style: ${with_init_scripts}
1358 Abstract socket names: ${have_abstract_sockets}
1359 System bus socket: ${DBUS_SYSTEM_SOCKET}
1360 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1361 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
1362 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
1363 'make check' socket dir: ${TEST_SOCKET_DIR}
1366 if test x$enable_tests = xyes; then
1367 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1369 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1370 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)"
1372 if test x$enable_gcov = xyes; then
1373 echo "NOTE: building with coverage profiling is definitely for developers only."
1375 if test x$enable_verbose_mode = xyes; then
1376 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1378 if test x$enable_asserts = xyes; then
1379 echo "NOTE: building with assertions increases library size and decreases performance."
1381 if test x$enable_checks = xno; then
1382 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."