6 AM_INIT_AUTOMAKE(dbus, 0.30)
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)
41 AC_ARG_ENABLE(selinux, [ --enable-selinux build with SELinux support],enable_selinux=$enableval,enable_selinux=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 *[\ \ ]-Wfloat-equal[\ \ ]*) ;;
110 *) CFLAGS="$CFLAGS -Wfloat-equal" ;;
114 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
115 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
118 if test "x$enable_ansi" = "xyes"; then
120 *[\ \ ]-ansi[\ \ ]*) ;;
121 *) CFLAGS="$CFLAGS -ansi" ;;
125 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
126 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
130 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
131 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
135 *[\ \ ]-pedantic[\ \ ]*) ;;
136 *) CFLAGS="$CFLAGS -pedantic" ;;
139 if test x$enable_gcov = xyes; then
141 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
142 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
145 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
146 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
149 ## remove optimization
150 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
154 if test x$enable_gcov = xyes; then
155 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
159 #### can't use AM_PROG_GCJ since it fails fatally if no gcj found
160 AC_CHECK_PROGS(GCJ, gcj, gcj)
161 if test -z "$GCJ" ; then
164 # Needs to be here so libtool wont get confused
168 if test "x${GCJFLAGS-unset}" = xunset; then
169 GCJFLAGS="-g -O2 -Wall"
174 if test x$enable_gcj = xauto ; then
175 if test x$have_gcj = xno ; then
182 if test x$enable_gcj = xyes; then
183 if test x$have_gcj = xno ; then
184 AC_MSG_ERROR([Building gcj explicitly required, but gcj not found])
188 AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
193 MONO_REQUIRED_VERSION=0.95
194 AC_SUBST(MONO_REQUIRED_VERSION)
195 PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, have_mono=true, have_mono=false)
197 if test "x$enable_mono" = "xyes"; then
198 if test "x$have_mono" = "xfalse"; then
199 AC_MSG_ERROR([Mono was not found])
203 if test "x$have_mono" = "xtrue"; then
204 if test `uname -s` = "Darwin"; then
205 AC_PATH_PROG(RUNTIME, mint, no)
206 AC_PATH_PROG(CSC, mcs, no)
210 AC_PATH_PROG(RUNTIME, mono, no)
211 AC_PATH_PROG(CSC, mcs, no)
216 AC_PATH_PROG(CSC, csc.exe, no)
222 if test x$enable_mono = xyes; then
223 if test x$have_mcs = xno ; then
224 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
228 AC_PATH_PROG(GACUTIL, gacutil, no)
229 if test "x$GACUTIL" = "xno" ; then
230 AC_MSG_ERROR([No gacutil tool found])
236 if test x$enable_mono = xauto ; then
237 if test x$CSC = xno ; then
241 AC_PATH_PROG(GACUTIL, gacutil, no)
242 if test "x$GACUTIL" = "xno" ; then
256 AM_CONDITIONAL(DBUS_USE_CSC, test x$enable_mono = xyes)
258 #### Look for monodoc
259 MONODOC_REQUIRED_VERSION=0.16
260 AC_SUBST(MONODOC_REQUIRED_VERSION)
261 PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, have_monodoc=yes, have_monodoc=no)
263 if test x$enable_mono_docs = xyes; then
264 if test x$have_monodoc = xno ; then
265 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
267 AC_PATH_PROG(MONODOC, monodoc, no)
268 if test x$MONODOC = xno; then
269 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
274 if test x$enable_mono_docs = xauto ; then
275 if test x$have_monodoc = xno ; then
279 AC_PATH_PROG(MONODOC, monodoc, no)
280 if test x$MONODOC = xno; then
291 AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_mono_docs" = "xyes")
294 # let ourselves use our own unstable API
295 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
296 # compress spaces in flags
297 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
298 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
299 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
302 if test x$enable_gcov = xyes; then
303 ## so that config.h changes when you toggle gcov support
304 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
306 AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
308 AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
310 if test x$have_gcc33_gcov = xyes ; then
311 AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
313 AC_MSG_RESULT($have_gcc33_gcov)
315 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
319 AC_CHECK_SIZEOF(char)
320 AC_CHECK_SIZEOF(short)
321 AC_CHECK_SIZEOF(long)
323 AC_CHECK_SIZEOF(void *)
324 AC_CHECK_SIZEOF(long long)
325 AC_CHECK_SIZEOF(__int64)
327 ### See what our 64 bit type is called
328 AC_MSG_CHECKING([64-bit integer type])
333 dbusint64_constant='(val)'
334 dbusuint64_constant='(val)'
338 dbusint64_constant='(val##L)'
339 dbusuint64_constant='(val##UL)'
341 $ac_cv_sizeof_long_long)
342 dbusint64='long long'
343 dbusint64_constant='(val##LL)'
344 dbusuint64_constant='(val##ULL)'
346 $ac_cv_sizeof___int64)
348 dbusint64_constant='(val##i64)'
349 dbusuint64_constant='(val##ui64)'
353 if test -z "$dbusint64" ; then
354 DBUS_INT64_TYPE="no_int64_type_detected"
357 DBUS_UINT64_CONSTANT=
358 AC_MSG_RESULT([none found])
360 DBUS_INT64_TYPE="$dbusint64"
362 DBUS_INT64_CONSTANT="$dbusint64_constant"
363 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
364 AC_MSG_RESULT($DBUS_INT64_TYPE)
367 AC_SUBST(DBUS_INT64_TYPE)
368 AC_SUBST(DBUS_INT64_CONSTANT)
369 AC_SUBST(DBUS_UINT64_CONSTANT)
370 AC_SUBST(DBUS_HAVE_INT64)
372 ### see what 32-bit int is called
373 AC_MSG_CHECKING([32-bit integer type])
387 if test -z "$dbusint32" ; then
388 DBUS_INT32_TYPE="no_int32_type_detected"
389 AC_MSG_ERROR([No 32-bit integer type found])
391 DBUS_INT32_TYPE="$dbusint32"
392 AC_MSG_RESULT($DBUS_INT32_TYPE)
395 AC_SUBST(DBUS_INT32_TYPE)
397 ### see what 16-bit int is called
398 AC_MSG_CHECKING([16-bit integer type])
409 if test -z "$dbusint16" ; then
410 DBUS_INT16_TYPE="no_int16_type_detected"
411 AC_MSG_ERROR([No 16-bit integer type found])
413 DBUS_INT16_TYPE="$dbusint16"
414 AC_MSG_RESULT($DBUS_INT16_TYPE)
417 AC_SUBST(DBUS_INT16_TYPE)
423 dnl **********************************
424 dnl *** va_copy checks (from GLib) ***
425 dnl **********************************
426 dnl we currently check for all three va_copy possibilities, so we get
427 dnl all results in config.log for bug reports.
428 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
429 AC_LINK_IFELSE([#include <stdarg.h>
430 void f (int i, ...) {
431 va_list args1, args2;
433 va_copy (args2, args1);
434 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
436 va_end (args1); va_end (args2);
442 [dbus_cv_va_copy=yes],
443 [dbus_cv_va_copy=no])
445 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
446 AC_LINK_IFELSE([#include <stdarg.h>
447 void f (int i, ...) {
448 va_list args1, args2;
450 __va_copy (args2, args1);
451 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
453 va_end (args1); va_end (args2);
459 [dbus_cv___va_copy=yes],
460 [dbus_cv___va_copy=no])
463 if test "x$dbus_cv_va_copy" = "xyes"; then
464 dbus_va_copy_func=va_copy
465 else if test "x$dbus_cv___va_copy" = "xyes"; then
466 dbus_va_copy_func=__va_copy
470 if test -n "$dbus_va_copy_func"; then
471 AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
474 AC_CACHE_CHECK([whether va_lists can be copied by value],dbus_cv_va_val_copy,[
475 AC_TRY_RUN([#include <stdarg.h>
476 void f (int i, ...) {
477 va_list args1, args2;
480 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
482 va_end (args1); va_end (args2);
488 [dbus_cv_va_val_copy=yes],
489 [dbus_cv_va_val_copy=no],
490 [dbus_cv_va_val_copy=yes])
493 if test "x$dbus_cv_va_val_copy" = "xno"; then
494 AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
498 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
499 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
501 if test x"$GCC" = xyes; then
502 if test "x$enable_ansi" = "xyes"; then
510 AC_MSG_RESULT([i486])
511 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
520 if test x$have_atomic_inc = xyes ; then
521 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
524 #### Various functions
525 AC_CHECK_LIB(socket,socket)
526 AC_CHECK_LIB(nsl,gethostbyname)
528 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
530 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
532 AC_CACHE_CHECK([for posix getpwnam_r],
533 ac_cv_func_posix_getpwnam_r,
539 struct passwd pwd, *pwptr = &pwd;
542 error = getpwnam_r ("", &pwd, buffer,
543 sizeof (buffer), &pwptr);
544 return (error < 0 && errno == ENOSYS)
547 [ac_cv_func_posix_getpwnam_r=yes],
548 [ac_cv_func_posix_getpwnam_r=no])])
549 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
550 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
551 [Have POSIX function getpwnam_r])
553 AC_CACHE_CHECK([for nonposix getpwnam_r],
554 ac_cv_func_nonposix_getpwnam_r,
555 [AC_TRY_LINK([#include <pwd.h>],
558 getpwnam_r ("", &pwd, buffer,
560 [ac_cv_func_nonposix_getpwnam_r=yes],
561 [ac_cv_func_nonposix_getpwnam_r=no])])
562 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
563 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
564 [Have non-POSIX function getpwnam_r])
568 dnl check for socklen_t
569 AC_MSG_CHECKING(whether socklen_t is defined)
571 #include <sys/types.h>
572 #include <sys/socket.h>
577 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
578 AC_MSG_RESULT($dbus_have_socklen_t)
580 if test "x$dbus_have_socklen_t" = "xyes"; then
581 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
584 dnl check for writev header and writev function so we're
585 dnl good to go if HAVE_WRITEV gets defined.
586 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
588 dnl check for flavours of varargs macros (test from GLib)
589 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
591 int a(int p1, int p2, int p3);
592 #define call_a(...) a(1,__VA_ARGS__)
594 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
595 AC_MSG_RESULT($dbus_have_iso_c_varargs)
597 AC_MSG_CHECKING(for GNUC varargs macros)
599 int a(int p1, int p2, int p3);
600 #define call_a(params...) a(1,params)
602 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
603 AC_MSG_RESULT($dbus_have_gnuc_varargs)
605 dnl Output varargs tests
606 if test x$dbus_have_iso_c_varargs = xyes; then
607 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
609 if test x$dbus_have_gnuc_varargs = xyes; then
610 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
613 dnl Check for various credentials.
614 AC_MSG_CHECKING(for struct cmsgcred)
616 #include <sys/types.h>
617 #include <sys/socket.h>
619 struct cmsgcred cred;
622 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
623 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
625 if test x$dbus_have_struct_cmsgcred = xyes; then
626 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
630 #### Abstract sockets
632 AC_MSG_CHECKING(abstract socket namespace)
634 AC_RUN_IFELSE([AC_LANG_PROGRAM(
636 #include <sys/types.h>
640 #include <sys/socket.h>
646 struct sockaddr_un addr;
648 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
652 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
656 memset (&addr, '\0', sizeof (addr));
657 addr.sun_family = AF_UNIX;
658 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
659 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
661 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
663 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
670 [have_abstract_sockets=yes],
671 [have_abstract_sockets=no])
673 AC_MSG_RESULT($have_abstract_sockets)
675 if test x$enable_abstract_sockets = xyes; then
676 if test x$have_abstract_sockets = xno; then
677 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
681 if test x$enable_abstract_sockets = xno; then
682 have_abstract_sockets=no;
685 if test x$have_abstract_sockets = xyes ; then
686 DBUS_PATH_OR_ABSTRACT=abstract
687 AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
689 DBUS_PATH_OR_ABSTRACT=path
692 # this is used in addresses to prefer abstract, e.g.
693 # unix:path=/foo or unix:abstract=/foo
694 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
696 #### Sort out XML library
699 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
700 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
703 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
705 # see what we want to use
706 dbus_use_libxml=false
708 if test x$with_xml = xexpat; then
710 if ! $have_expat ; then
711 AC_MSG_ERROR([Explicitly requested expat but expat not found])
713 elif test x$with_xml = xlibxml; then
715 if ! $have_libxml ; then
716 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
719 ### expat is the default because libxml can't currently survive
720 ### our brutal OOM-handling unit test setup.
721 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
722 if $have_expat ; then
725 elif $have_libxml ; then
729 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
733 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
734 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
736 if $dbus_use_expat; then
740 if $dbus_use_libxml; then
741 XML_LIBS=$LIBXML_LIBS
742 XML_CFLAGS=$LIBXML_CFLAGS
746 if test x$enable_selinux = xno ; then
749 # See if we have SELinux library
750 AC_CHECK_LIB(selinux, is_selinux_enabled,
751 have_selinux=yes, have_selinux=no)
753 # see if we have the SELinux header with the new D-BUS stuff in it
754 if test x$have_selinux = xyes ; then
755 AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
756 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
757 [#ifdef DBUS__ACQUIRE_SVC return 0;
759 #error DBUS__ACQUIRE_SVC not defined
761 have_selinux=yes, have_selinux=no)
762 AC_MSG_RESULT($have_selinux)
765 if test x$enable_selinux = xauto ; then
766 if test x$have_selinux = xno ; then
767 AC_MSG_WARN([Sufficiently new SELinux library not found])
770 if test x$have_selinux = xno ; then
771 AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
776 AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
778 if test x$have_selinux = xyes ; then
779 SELINUX_LIBS="-lselinux -lpthread"
780 AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
785 #### Set up final flags
788 AC_SUBST(DBUS_CLIENT_CFLAGS)
789 AC_SUBST(DBUS_CLIENT_LIBS)
791 DBUS_BUS_CFLAGS=$XML_CFLAGS
792 DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS"
793 AC_SUBST(DBUS_BUS_CFLAGS)
794 AC_SUBST(DBUS_BUS_LIBS)
798 AC_SUBST(DBUS_TEST_CFLAGS)
799 AC_SUBST(DBUS_TEST_LIBS)
802 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
803 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
805 if test x$have_glib = xno ; then
806 AC_MSG_WARN([GLib development libraries not found])
809 if test x$enable_glib = xyes; then
810 if test x$have_glib = xno; then
811 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
815 if test x$enable_glib = xno; then
819 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
820 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
823 AC_SUBST(DBUS_GLIB_CFLAGS)
824 AC_SUBST(DBUS_GLIB_LIBS)
825 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
827 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
828 DBUS_GLIB_TOOL_LIBS=$XML_LIBS
829 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
830 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
833 if test x$have_glib = xno ; then
834 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
837 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0, have_gtk=yes, have_gtk=no)
840 if test x$have_gtk = xno ; then
841 AC_MSG_WARN([GTK+ development libraries not found])
844 if test x$enable_gtk = xyes; then
845 if test x$have_gtk = xno; then
846 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
850 if test x$enable_gtk = xno; then
854 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
857 AC_SUBST(DBUS_GTK_CFLAGS)
858 AC_SUBST(DBUS_GTK_LIBS)
861 AC_PATH_PROG(QT_MOC, moc, no)
864 AC_MSG_CHECKING([for qglobal.h])
865 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
867 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
869 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
870 if test -f "$dir/qglobal.h"; then
872 DBUS_QT_CXXFLAGS="-I$dir"
876 if test x"$have_qt" = x"yes"; then
877 AC_MSG_RESULT([found])
879 AC_MSG_RESULT([not found])
882 dnl linking to kdecore will give us a bit of help from libtool
883 if (! kde-config >& /dev/null); then
886 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
887 if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
890 DBUS_QT_LIBS="$kdelibs/libkdecore.la"
894 if test x$have_qt = xno ; then
895 AC_MSG_WARN([Qt development libraries not found])
898 if test x$enable_qt = xyes; then
899 if test x$have_qt = xno; then
900 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
904 if test x$enable_qt = xno; then
908 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
911 AC_SUBST(DBUS_QT_CXXFLAGS)
912 AC_SUBST(DBUS_QT_LIBS)
917 ## for now enable_x11 just tracks have_x11,
918 ## there's no --enable-x11
919 if test x$no_x = xyes ; then
927 if test x$enable_x11 = xyes ; then
928 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
929 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
930 DBUS_X_CFLAGS="$X_CFLAGS"
936 AC_SUBST(DBUS_X_CFLAGS)
937 AC_SUBST(DBUS_X_LIBS)
939 ### Doxygen Documentation
941 AC_PATH_PROG(DOXYGEN, doxygen, no)
943 AC_MSG_CHECKING([whether to build Doxygen documentation])
945 if test x$DOXYGEN = xno ; then
951 if test x$enable_doxygen_docs = xauto ; then
952 if test x$have_doxygen = xno ; then
953 enable_doxygen_docs=no
955 enable_doxygen_docs=yes
959 if test x$enable_doxygen_docs = xyes; then
960 if test x$have_doxygen = xno; then
961 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
965 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
968 ### XML Documentation
970 AC_PATH_PROG(XMLTO, xmlto, no)
972 AC_MSG_CHECKING([whether to build XML documentation])
974 if test x$XMLTO = xno ; then
980 if test x$enable_xml_docs = xauto ; then
981 if test x$have_xmlto = xno ; then
988 if test x$enable_xml_docs = xyes; then
989 if test x$have_xmlto = xno; then
990 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
994 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
997 #### Have to go $localstatedir->$prefix/var->/usr/local/var
998 #### someone please fix this a better way...
1000 #### find the actual value for $prefix that we'll end up with
1001 ## (I know this is broken and should be done in the Makefile, but
1002 ## that's a major pain and almost nobody actually seems to care)
1004 if test "x$prefix" = "xNONE"; then
1005 REAL_PREFIX=$ac_default_prefix
1010 ## temporarily change prefix and exec_prefix
1014 if test "x$exec_prefix" = xNONE ; then
1015 REAL_EXEC_PREFIX=$REAL_PREFIX
1017 REAL_EXEC_PREFIX=$exec_prefix
1019 old_exec_prefix=$exec_prefix
1020 exec_prefix=$REAL_EXEC_PREFIX
1023 LOCALSTATEDIR_TMP="$localstatedir"
1024 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
1025 AC_SUBST(EXPANDED_LOCALSTATEDIR)
1027 SYSCONFDIR_TMP="$sysconfdir"
1028 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
1029 AC_SUBST(EXPANDED_SYSCONFDIR)
1031 BINDIR_TMP="$bindir"
1032 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
1033 AC_SUBST(EXPANDED_BINDIR)
1035 LIBDIR_TMP="$libdir"
1036 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
1037 AC_SUBST(EXPANDED_LIBDIR)
1039 DATADIR_TMP="$datadir"
1040 EXPANDED_DATADIR=`eval echo $DATADIR_TMP`
1041 AC_SUBST(EXPANDED_DATADIR)
1043 ## put prefix and exec_prefix back
1045 exec_prefix=$old_exec_prefix
1047 #### Check our operating system
1048 operating_system=unknown
1049 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
1050 operating_system=redhat
1053 if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
1054 operating_system=slackware
1057 #### Sort out init scripts
1059 if test x$with_init_scripts = x; then
1060 if test xredhat = x$operating_system ; then
1061 with_init_scripts=redhat
1063 if test xslackware = x$operating_system ; then
1064 with_init_scripts=slackware
1066 with_init_scripts=none
1071 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
1073 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
1075 ##### Set up location for system bus socket
1076 if ! test -z "$with_system_socket"; then
1077 DBUS_SYSTEM_SOCKET=$with_system_socket
1079 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
1082 AC_SUBST(DBUS_SYSTEM_SOCKET)
1083 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
1085 ## system bus only listens on local domain sockets, and never
1086 ## on an abstract socket (so only root can create the socket)
1087 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
1088 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
1089 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-BUS address of the system bus])
1091 #### Set up the pid file
1092 if ! test -z "$with_system_pid_file"; then
1093 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
1094 elif test x$operating_system = xredhat ; then
1095 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
1097 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
1100 AC_SUBST(DBUS_SYSTEM_PID_FILE)
1102 #### Tell tests where to find certain stuff in builddir
1103 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
1105 AC_DEFUN(TEST_PATH, [
1106 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
1107 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
1108 [Full path to test file test/$2 in builddir])
1112 TEST_PATH(SERVICE_DIR, data/valid-service-files)
1113 TEST_PATH(SERVICE_BINARY, test-service)
1114 TEST_PATH(GLIB_SERVICE_BINARY, glib/test-service-glib)
1115 TEST_PATH(EXIT_BINARY, test-exit)
1116 TEST_PATH(SEGFAULT_BINARY, test-segfault)
1117 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
1118 AC_SUBST(ABSOLUTE_TOP_BUILDDIR)
1120 #### Find socket directories
1121 if ! test -z "$TMPDIR" ; then
1122 DEFAULT_SOCKET_DIR=$TMPDIR
1123 elif ! test -z "$TEMP" ; then
1124 DEFAULT_SOCKET_DIR=$TEMP
1125 elif ! test -z "$TMP" ; then
1126 DEFAULT_SOCKET_DIR=$TMP
1128 DEFAULT_SOCKET_DIR=/tmp
1131 if ! test -z "$with_test_socket_dir" ; then
1132 TEST_SOCKET_DIR="$with_test_socket_dir"
1134 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1136 AC_SUBST(TEST_SOCKET_DIR)
1137 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1139 if ! test -z "$with_session_socket_dir" ; then
1140 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1142 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1144 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
1145 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
1147 # Detect if we can build Python bindings (need python, python headers, and pyrex)
1148 if test x$enable_python = xno; then
1151 AC_MSG_NOTICE([Checking to see if we can build Python bindings])
1155 if test -z "$PYTHON" ; then
1156 AC_MSG_WARN([Python not found])
1158 AC_CHECK_PROGS(PYREX, pyrexc)
1160 if test -z "$PYREX" ; then
1166 AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
1168 if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
1173 if test x$have_python = xno ; then
1174 if test x$enable_python = xyes ; then
1175 AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
1177 AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings])
1182 AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
1186 dbus/dbus-arch-deps.h
1196 python/examples/Makefile
1200 gcj/org/freedesktop/Makefile
1201 gcj/org/freedesktop/dbus/Makefile
1203 mono/AssemblyInfo.cs
1204 mono/dbus-sharp.dll.config
1205 mono/example/Makefile
1215 test/data/valid-config-files/debug-allow-all.conf
1216 test/data/valid-config-files/debug-allow-all-sha1.conf
1217 test/data/valid-service-files/debug-echo.service
1218 test/data/valid-service-files/debug-segfault.service
1219 test/data/valid-service-files/debug-glib.service
1222 ### FIXME it's bizarre that have_qt and have_glib are used
1223 ### instead of enable_ - should fix things so that enable
1224 ### is always whether it's enabled, and have is always whether
1227 dnl ==========================================================================
1233 exec_prefix: ${exec_prefix}
1234 libdir: ${EXPANDED_LIBDIR}
1235 bindir: ${EXPANDED_BINDIR}
1236 sysconfdir: ${EXPANDED_SYSCONFDIR}
1237 localstatedir: ${EXPANDED_LOCALSTATEDIR}
1238 datadir: ${EXPANDED_DATADIR}
1239 source code location: ${srcdir}
1242 cppflags: ${CPPFLAGS}
1243 cxxflags: ${CXXFLAGS}
1244 64-bit int: ${DBUS_INT64_TYPE}
1245 32-bit int: ${DBUS_INT32_TYPE}
1246 16-bit int: ${DBUS_INT16_TYPE}
1250 if test x$enable_gcj = xyes ; then
1253 gcjflags: ${GCJFLAGS}"
1256 " gcj: (not enabled)"
1259 if test x$enable_mono = xyes ; then
1265 " csc: (not enabled)
1270 Maintainer mode: ${USE_MAINTAINER_MODE}
1271 gcc coverage profiling: ${enable_gcov}
1272 Building unit tests: ${enable_tests}
1273 Building verbose mode: ${enable_verbose_mode}
1274 Building assertions: ${enable_asserts}
1275 Building checks: ${enable_checks}
1276 Building Qt bindings: ${have_qt}
1277 Building GLib bindings: ${have_glib}
1278 Building Python bindings: ${have_python}
1279 Building SELinux support: ${have_selinux}
1280 Building Mono bindings: ${enable_mono}
1281 Building Mono docs: ${enable_mono_docs}
1282 Building GTK+ tools: ${have_gtk}
1283 Building X11 code: ${enable_x11}
1284 Building Doxygen docs: ${enable_doxygen_docs}
1285 Building XML docs: ${enable_xml_docs}
1286 Using XML parser: ${with_xml}
1287 Init scripts style: ${with_init_scripts}
1288 Abstract socket names: ${have_abstract_sockets}
1289 System bus socket: ${DBUS_SYSTEM_SOCKET}
1290 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1291 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
1292 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
1293 'make check' socket dir: ${TEST_SOCKET_DIR}
1296 if test x$enable_tests = xyes; then
1297 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1299 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1300 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)"
1302 if test x$enable_gcov = xyes; then
1303 echo "NOTE: building with coverage profiling is definitely for developers only."
1305 if test x$enable_verbose_mode = xyes; then
1306 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1308 if test x$enable_asserts = xyes; then
1309 echo "NOTE: building with assertions increases library size and decreases performance."
1311 if test x$enable_checks = xno; then
1312 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."