6 AM_INIT_AUTOMAKE(dbus, 0.22)
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 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
110 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
113 if test "x$enable_ansi" = "xyes"; then
115 *[\ \ ]-ansi[\ \ ]*) ;;
116 *) CFLAGS="$CFLAGS -ansi" ;;
120 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
121 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
125 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
126 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
130 *[\ \ ]-pedantic[\ \ ]*) ;;
131 *) CFLAGS="$CFLAGS -pedantic" ;;
134 if test x$enable_gcov = xyes; then
136 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
137 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
140 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
141 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
144 ## remove optimization
145 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
149 if test x$enable_gcov = xyes; then
150 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
154 #### can't use AM_PROG_GCJ since it fails fatally if no gcj found
155 AC_CHECK_PROGS(GCJ, gcj, gcj)
156 if test -z "$GCJ" ; then
159 # Needs to be here so libtool wont get confused
163 if test "x${GCJFLAGS-unset}" = xunset; then
164 GCJFLAGS="-g -O2 -Wall"
169 if test x$enable_gcj = xauto ; then
170 if test x$have_gcj = xno ; then
177 if test x$enable_gcj = xyes; then
178 if test x$have_gcj = xno ; then
179 AC_MSG_ERROR([Building gcj explicitly required, but gcj not found])
183 AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
188 MONO_REQUIRED_VERSION=0.95
189 AC_SUBST(MONO_REQUIRED_VERSION)
190 PKG_CHECK_MODULES(MONO_DEPENDENCY, mono >= $MONO_REQUIRED_VERSION, have_mono=true, have_mono=false)
192 if test "x$enable_mono" = "xyes"; then
193 if test "x$have_mono" = "xfalse"; then
194 AC_MSG_ERROR([Mono was not found])
198 if test "x$have_mono" = "xtrue"; then
199 if test `uname -s` = "Darwin"; then
200 AC_PATH_PROG(RUNTIME, mint, no)
201 AC_PATH_PROG(CSC, mcs, no)
205 AC_PATH_PROG(RUNTIME, mono, no)
206 AC_PATH_PROG(CSC, mcs, no)
211 AC_PATH_PROG(CSC, csc.exe, no)
217 if test x$enable_mono = xyes; then
218 if test x$have_mcs = xno ; then
219 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
223 AC_PATH_PROG(GACUTIL, gacutil, no)
224 if test "x$GACUTIL" = "xno" ; then
225 AC_MSG_ERROR([No gacutil tool found])
231 if test x$enable_mono = xauto ; then
232 if test x$CSC = xno ; then
236 AC_PATH_PROG(GACUTIL, gacutil, no)
237 if test "x$GACUTIL" = "xno" ; then
251 AM_CONDITIONAL(DBUS_USE_CSC, test x$enable_mono = xyes)
253 #### Look for monodoc
254 MONODOC_REQUIRED_VERSION=0.16
255 AC_SUBST(MONODOC_REQUIRED_VERSION)
256 PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, have_monodoc=yes, have_monodoc=no)
258 if test x$enable_mono_docs = xyes; then
259 if test x$have_monodoc = xno ; then
260 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
262 AC_PATH_PROG(MONODOC, monodoc, no)
263 if test x$MONODOC = xno; then
264 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
269 if test x$enable_mono_docs = xauto ; then
270 if test x$have_monodoc = xno ; then
274 AC_PATH_PROG(MONODOC, monodoc, no)
275 if test x$MONODOC = xno; then
286 AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_mono_docs" = "xyes")
289 # let ourselves use our own unstable API
290 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
291 # compress spaces in flags
292 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
293 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
294 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
297 if test x$enable_gcov = xyes; then
298 ## so that config.h changes when you toggle gcov support
299 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
301 AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
303 AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
305 if test x$have_gcc33_gcov = xyes ; then
306 AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
308 AC_MSG_RESULT($have_gcc33_gcov)
310 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
314 AC_CHECK_SIZEOF(char)
315 AC_CHECK_SIZEOF(short)
316 AC_CHECK_SIZEOF(long)
318 AC_CHECK_SIZEOF(void *)
319 AC_CHECK_SIZEOF(long long)
320 AC_CHECK_SIZEOF(__int64)
322 ### See what our 64 bit type is called
323 AC_MSG_CHECKING([64-bit integer type])
328 dbusint64_constant='(val)'
329 dbusuint64_constant='(val)'
333 dbusint64_constant='(val##L)'
334 dbusuint64_constant='(val##UL)'
336 $ac_cv_sizeof_long_long)
337 dbusint64='long long'
338 dbusint64_constant='(val##LL)'
339 dbusuint64_constant='(val##ULL)'
341 $ac_cv_sizeof___int64)
343 dbusint64_constant='(val##i64)'
344 dbusuint64_constant='(val##ui64)'
348 if test -z "$dbusint64" ; then
349 DBUS_INT64_TYPE="no_int64_type_detected"
352 DBUS_UINT64_CONSTANT=
353 AC_MSG_RESULT([none found])
355 DBUS_INT64_TYPE="$dbusint64"
357 DBUS_INT64_CONSTANT="$dbusint64_constant"
358 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
359 AC_MSG_RESULT($DBUS_INT64_TYPE)
362 AC_SUBST(DBUS_INT64_TYPE)
363 AC_SUBST(DBUS_INT64_CONSTANT)
364 AC_SUBST(DBUS_UINT64_CONSTANT)
365 AC_SUBST(DBUS_HAVE_INT64)
371 dnl **********************************
372 dnl *** va_copy checks (from GLib) ***
373 dnl **********************************
374 dnl we currently check for all three va_copy possibilities, so we get
375 dnl all results in config.log for bug reports.
376 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
377 AC_LINK_IFELSE([#include <stdarg.h>
378 void f (int i, ...) {
379 va_list args1, args2;
381 va_copy (args2, args1);
382 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
384 va_end (args1); va_end (args2);
390 [dbus_cv_va_copy=yes],
391 [dbus_cv_va_copy=no])
393 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
394 AC_LINK_IFELSE([#include <stdarg.h>
395 void f (int i, ...) {
396 va_list args1, args2;
398 __va_copy (args2, args1);
399 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
401 va_end (args1); va_end (args2);
407 [dbus_cv___va_copy=yes],
408 [dbus_cv___va_copy=no])
411 if test "x$dbus_cv_va_copy" = "xyes"; then
412 dbus_va_copy_func=va_copy
413 else if test "x$dbus_cv___va_copy" = "xyes"; then
414 dbus_va_copy_func=__va_copy
418 if test -n "$dbus_va_copy_func"; then
419 AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
422 AC_CACHE_CHECK([whether va_lists can be copied by value],dbus_cv_va_val_copy,[
423 AC_TRY_RUN([#include <stdarg.h>
424 void f (int i, ...) {
425 va_list args1, args2;
428 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
430 va_end (args1); va_end (args2);
436 [dbus_cv_va_val_copy=yes],
437 [dbus_cv_va_val_copy=no],
438 [dbus_cv_va_val_copy=yes])
441 if test "x$dbus_cv_va_val_copy" = "xno"; then
442 AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
446 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
447 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
449 if test x"$GCC" = xyes; then
450 if test "x$enable_ansi" = "xyes"; then
458 AC_MSG_RESULT([i486])
459 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
468 if test x$have_atomic_inc = xyes ; then
469 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
472 #### Various functions
473 AC_CHECK_LIB(socket,socket)
474 AC_CHECK_LIB(nsl,gethostbyname)
476 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
478 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
480 AC_CACHE_CHECK([for posix getpwnam_r],
481 ac_cv_func_posix_getpwnam_r,
487 struct passwd pwd, *pwptr = &pwd;
490 error = getpwnam_r ("", &pwd, buffer,
491 sizeof (buffer), &pwptr);
492 return (error < 0 && errno == ENOSYS)
495 [ac_cv_func_posix_getpwnam_r=yes],
496 [ac_cv_func_posix_getpwnam_r=no])])
497 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
498 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
499 [Have POSIX function getpwnam_r])
501 AC_CACHE_CHECK([for nonposix getpwnam_r],
502 ac_cv_func_nonposix_getpwnam_r,
503 [AC_TRY_LINK([#include <pwd.h>],
506 getpwnam_r ("", &pwd, buffer,
508 [ac_cv_func_nonposix_getpwnam_r=yes],
509 [ac_cv_func_nonposix_getpwnam_r=no])])
510 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
511 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
512 [Have non-POSIX function getpwnam_r])
516 dnl check for socklen_t
517 AC_MSG_CHECKING(whether socklen_t is defined)
519 #include <sys/types.h>
520 #include <sys/socket.h>
525 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
526 AC_MSG_RESULT($dbus_have_socklen_t)
528 if test "x$dbus_have_socklen_t" = "xyes"; then
529 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
532 dnl check for writev header and writev function so we're
533 dnl good to go if HAVE_WRITEV gets defined.
534 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
536 dnl check for flavours of varargs macros (test from GLib)
537 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
539 int a(int p1, int p2, int p3);
540 #define call_a(...) a(1,__VA_ARGS__)
542 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
543 AC_MSG_RESULT($dbus_have_iso_c_varargs)
545 AC_MSG_CHECKING(for GNUC varargs macros)
547 int a(int p1, int p2, int p3);
548 #define call_a(params...) a(1,params)
550 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
551 AC_MSG_RESULT($dbus_have_gnuc_varargs)
553 dnl Output varargs tests
554 if test x$dbus_have_iso_c_varargs = xyes; then
555 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
557 if test x$dbus_have_gnuc_varargs = xyes; then
558 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
561 dnl Check for various credentials.
562 AC_MSG_CHECKING(for struct cmsgcred)
564 #include <sys/types.h>
565 #include <sys/socket.h>
567 struct cmsgcred cred;
570 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
571 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
573 if test x$dbus_have_struct_cmsgcred = xyes; then
574 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
578 #### Abstract sockets
580 AC_MSG_CHECKING(abstract socket namespace)
582 AC_RUN_IFELSE([AC_LANG_PROGRAM(
584 #include <sys/types.h>
588 #include <sys/socket.h>
594 struct sockaddr_un addr;
596 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
600 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
604 memset (&addr, '\0', sizeof (addr));
605 addr.sun_family = AF_UNIX;
606 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
607 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
609 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
611 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
618 [have_abstract_sockets=yes],
619 [have_abstract_sockets=no])
621 AC_MSG_RESULT($have_abstract_sockets)
623 if test x$enable_abstract_sockets = xyes; then
624 if test x$have_abstract_sockets = xno; then
625 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
629 if test x$enable_abstract_sockets = xno; then
630 have_abstract_sockets=no;
633 if test x$have_abstract_sockets = xyes ; then
634 DBUS_PATH_OR_ABSTRACT=abstract
635 AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
637 DBUS_PATH_OR_ABSTRACT=path
640 # this is used in addresses to prefer abstract, e.g.
641 # unix:path=/foo or unix:abstract=/foo
642 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
644 #### Sort out XML library
647 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
648 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
651 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
653 # see what we want to use
654 dbus_use_libxml=false
656 if test x$with_xml = xexpat; then
658 if ! $have_expat ; then
659 AC_MSG_ERROR([Explicitly requested expat but expat not found])
661 elif test x$with_xml = xlibxml; then
663 if ! $have_libxml ; then
664 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
667 ### expat is the default because libxml can't currently survive
668 ### our brutal OOM-handling unit test setup.
669 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
670 if $have_expat ; then
673 elif $have_libxml ; then
677 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
681 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
682 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
684 if $dbus_use_expat; then
688 if $dbus_use_libxml; then
689 XML_LIBS=$LIBXML_LIBS
690 XML_CFLAGS=$LIBXML_CFLAGS
694 if test x$enable_selinux = xno ; then
697 # See if we have SELinux library
698 AC_CHECK_LIB(selinux, is_selinux_enabled,
699 have_selinux=yes, have_selinux=no)
701 # see if we have the SELinux header with the new D-BUS stuff in it
702 if test x$have_selinux = xyes ; then
703 AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
704 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
705 [#ifdef DBUS__ACQUIRE_SVC return 0;
707 #error DBUS__ACQUIRE_SVC not defined
709 have_selinux=yes, have_selinux=no)
710 AC_MSG_RESULT($have_selinux)
713 if test x$enable_selinux = xauto ; then
714 if test x$have_selinux = xno ; then
715 AC_MSG_WARN([Sufficiently new SELinux library not found])
718 if test x$have_selinux = xno ; then
719 AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
724 AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
726 if test x$have_selinux = xyes ; then
727 SELINUX_LIBS=-lselinux
728 AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
733 #### Set up final flags
736 AC_SUBST(DBUS_CLIENT_CFLAGS)
737 AC_SUBST(DBUS_CLIENT_LIBS)
739 DBUS_BUS_CFLAGS=$XML_CFLAGS
740 DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS"
741 AC_SUBST(DBUS_BUS_CFLAGS)
742 AC_SUBST(DBUS_BUS_LIBS)
746 AC_SUBST(DBUS_TEST_CFLAGS)
747 AC_SUBST(DBUS_TEST_LIBS)
750 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
751 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
753 if test x$have_glib = xno ; then
754 AC_MSG_WARN([GLib development libraries not found])
757 if test x$enable_glib = xyes; then
758 if test x$have_glib = xno; then
759 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
763 if test x$enable_glib = xno; then
767 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
768 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
771 AC_SUBST(DBUS_GLIB_CFLAGS)
772 AC_SUBST(DBUS_GLIB_LIBS)
773 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
775 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
776 DBUS_GLIB_TOOL_LIBS=$XML_LIBS
777 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
778 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
781 if test x$have_glib = xno ; then
782 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
785 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0, have_gtk=yes, have_gtk=no)
788 if test x$have_gtk = xno ; then
789 AC_MSG_WARN([GTK+ development libraries not found])
792 if test x$enable_gtk = xyes; then
793 if test x$have_gtk = xno; then
794 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
798 if test x$enable_gtk = xno; then
802 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
805 AC_SUBST(DBUS_GTK_CFLAGS)
806 AC_SUBST(DBUS_GTK_LIBS)
809 AC_PATH_PROG(QT_MOC, moc, no)
812 AC_MSG_CHECKING([for qglobal.h])
813 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
815 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
817 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
818 if test -f "$dir/qglobal.h"; then
820 DBUS_QT_CXXFLAGS="-I$dir"
824 if test x"$have_qt" = x"yes"; then
825 AC_MSG_RESULT([found])
827 AC_MSG_RESULT([not found])
830 dnl linking to kdecore will give us a bit of help from libtool
831 if (! kde-config >& /dev/null); then
834 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
835 if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
838 DBUS_QT_LIBS="$kdelibs/libkdecore.la"
842 if test x$have_qt = xno ; then
843 AC_MSG_WARN([Qt development libraries not found])
846 if test x$enable_qt = xyes; then
847 if test x$have_qt = xno; then
848 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
852 if test x$enable_qt = xno; then
856 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
859 AC_SUBST(DBUS_QT_CXXFLAGS)
860 AC_SUBST(DBUS_QT_LIBS)
865 ## for now enable_x11 just tracks have_x11,
866 ## there's no --enable-x11
867 if test x$no_x = xyes ; then
875 if test x$enable_x11 = xyes ; then
876 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
877 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
878 DBUS_X_CFLAGS="$X_CFLAGS"
884 AC_SUBST(DBUS_X_CFLAGS)
885 AC_SUBST(DBUS_X_LIBS)
887 ### Doxygen Documentation
889 AC_PATH_PROG(DOXYGEN, doxygen, no)
891 AC_MSG_CHECKING([whether to build Doxygen documentation])
893 if test x$DOXYGEN = xno ; then
899 if test x$enable_doxygen_docs = xauto ; then
900 if test x$have_doxygen = xno ; then
901 enable_doxygen_docs=no
903 enable_doxygen_docs=yes
907 if test x$enable_doxygen_docs = xyes; then
908 if test x$have_doxygen = xno; then
909 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
913 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
916 ### XML Documentation
918 AC_PATH_PROG(XMLTO, xmlto, no)
920 AC_MSG_CHECKING([whether to build XML documentation])
922 if test x$XMLTO = xno ; then
928 if test x$enable_xml_docs = xauto ; then
929 if test x$have_xmlto = xno ; then
936 if test x$enable_xml_docs = xyes; then
937 if test x$have_xmlto = xno; then
938 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
942 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
945 #### Have to go $localstatedir->$prefix/var->/usr/local/var
946 #### someone please fix this a better way...
948 #### find the actual value for $prefix that we'll end up with
949 ## (I know this is broken and should be done in the Makefile, but
950 ## that's a major pain and almost nobody actually seems to care)
952 if test "x$prefix" = "xNONE"; then
953 REAL_PREFIX=$ac_default_prefix
958 ## temporarily change prefix and exec_prefix
962 if test "x$exec_prefix" = xNONE ; then
963 REAL_EXEC_PREFIX=$REAL_PREFIX
965 REAL_EXEC_PREFIX=$exec_prefix
967 old_exec_prefix=$exec_prefix
968 exec_prefix=$REAL_EXEC_PREFIX
971 LOCALSTATEDIR_TMP="$localstatedir"
972 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
973 AC_SUBST(EXPANDED_LOCALSTATEDIR)
975 SYSCONFDIR_TMP="$sysconfdir"
976 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
977 AC_SUBST(EXPANDED_SYSCONFDIR)
980 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
981 AC_SUBST(EXPANDED_BINDIR)
984 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
985 AC_SUBST(EXPANDED_LIBDIR)
987 ## put prefix and exec_prefix back
989 exec_prefix=$old_exec_prefix
991 #### Check our operating system
992 operating_system=unknown
993 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
994 operating_system=redhat
997 #### Sort out init scripts
999 if test x$with_init_scripts = x; then
1000 if test xredhat = x$operating_system ; then
1001 with_init_scripts=redhat
1003 with_init_scripts=none
1007 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
1010 ##### Set up location for system bus socket
1011 if ! test -z "$with_system_socket"; then
1012 DBUS_SYSTEM_SOCKET=$with_system_socket
1014 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
1017 AC_SUBST(DBUS_SYSTEM_SOCKET)
1018 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
1020 ## system bus only listens on local domain sockets, and never
1021 ## on an abstract socket (so only root can create the socket)
1022 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
1023 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
1024 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-BUS address of the system bus])
1026 #### Set up the pid file
1027 if ! test -z "$with_system_pid_file"; then
1028 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
1029 elif test x$operating_system = xredhat ; then
1030 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
1032 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
1035 AC_SUBST(DBUS_SYSTEM_PID_FILE)
1037 #### Tell tests where to find certain stuff in builddir
1038 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
1040 AC_DEFUN(TEST_PATH, [
1041 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
1042 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
1043 [Full path to test file test/$2 in builddir])
1047 TEST_PATH(SERVICE_DIR, data/valid-service-files)
1048 TEST_PATH(SERVICE_BINARY, test-service)
1049 TEST_PATH(GLIB_SERVICE_BINARY, test-service-glib)
1050 TEST_PATH(EXIT_BINARY, test-exit)
1051 TEST_PATH(SEGFAULT_BINARY, test-segfault)
1052 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
1053 AC_SUBST(ABSOLUTE_TOP_BUILDDIR)
1055 #### Find socket directories
1056 if ! test -z "$TMPDIR" ; then
1057 DEFAULT_SOCKET_DIR=$TMPDIR
1058 elif ! test -z "$TEMP" ; then
1059 DEFAULT_SOCKET_DIR=$TEMP
1060 elif ! test -z "$TMP" ; then
1061 DEFAULT_SOCKET_DIR=$TMP
1063 DEFAULT_SOCKET_DIR=/tmp
1066 if ! test -z "$with_test_socket_dir" ; then
1067 TEST_SOCKET_DIR="$with_test_socket_dir"
1069 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1071 AC_SUBST(TEST_SOCKET_DIR)
1072 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1074 if ! test -z "$with_session_socket_dir" ; then
1075 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1077 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1079 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
1080 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
1082 # Detect if we can build Python bindings (need python, python headers, and pyrex)
1083 if test x$enable_python = xno; then
1086 AC_MSG_NOTICE([Checking to see if we can build Python bindings])
1090 if test -z "$PYTHON" ; then
1091 AC_MSG_WARN([Python not found])
1093 AC_CHECK_PROGS(PYREX, pyrexc)
1095 if test -z "$PYREX" ; then
1101 AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
1103 if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
1108 if test x$have_python = xno ; then
1109 if test x$enable_python = xyes ; then
1110 AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
1112 AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings])
1117 AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
1121 dbus/dbus-arch-deps.h
1130 python/examples/Makefile
1134 gcj/org/freedesktop/Makefile
1135 gcj/org/freedesktop/dbus/Makefile
1137 mono/AssemblyInfo.cs
1138 mono/dbus-sharp.dll.config
1139 mono/example/Makefile
1149 test/data/valid-config-files/debug-allow-all.conf
1150 test/data/valid-config-files/debug-allow-all-sha1.conf
1151 test/data/valid-service-files/debug-echo.service
1152 test/data/valid-service-files/debug-segfault.service
1155 ### FIXME it's bizarre that have_qt and have_glib are used
1156 ### instead of enable_ - should fix things so that enable
1157 ### is always whether it's enabled, and have is always whether
1160 dnl ==========================================================================
1166 exec_prefix: ${exec_prefix}
1167 libdir: ${EXPANDED_LIBDIR}
1168 bindir: ${EXPANDED_BINDIR}
1169 sysconfdir: ${EXPANDED_SYSCONFDIR}
1170 localstatedir: ${EXPANDED_LOCALSTATEDIR}
1171 source code location: ${srcdir}
1174 cppflags: ${CPPFLAGS}
1175 cxxflags: ${CXXFLAGS}
1176 64-bit int: ${DBUS_INT64_TYPE}
1180 if test x$enable_gcj = xyes ; then
1183 gcjflags: ${GCJFLAGS}"
1186 " gcj: (not enabled)"
1189 if test x$enable_mono = xyes ; then
1195 " csc: (not enabled)
1200 Maintainer mode: ${USE_MAINTAINER_MODE}
1201 gcc coverage profiling: ${enable_gcov}
1202 Building unit tests: ${enable_tests}
1203 Building verbose mode: ${enable_verbose_mode}
1204 Building assertions: ${enable_asserts}
1205 Building checks: ${enable_checks}
1206 Building Qt bindings: ${have_qt}
1207 Building GLib bindings: ${have_glib}
1208 Building Python bindings: ${have_python}
1209 Building SELinux support: ${have_selinux}
1210 Building Mono bindings: ${enable_mono}
1211 Building Mono docs: ${enable_mono_docs}
1212 Building GTK+ tools: ${have_gtk}
1213 Building X11 code: ${enable_x11}
1214 Building Doxygen docs: ${enable_doxygen_docs}
1215 Building XML docs: ${enable_xml_docs}
1216 Using XML parser: ${with_xml}
1217 Init scripts style: ${with_init_scripts}
1218 Abstract socket names: ${have_abstract_sockets}
1219 System bus socket: ${DBUS_SYSTEM_SOCKET}
1220 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1221 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
1222 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
1223 'make check' socket dir: ${TEST_SOCKET_DIR}
1226 if test x$enable_tests = xyes; then
1227 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1229 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1230 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)"
1232 if test x$enable_gcov = xyes; then
1233 echo "NOTE: building with coverage profiling is definitely for developers only."
1235 if test x$enable_verbose_mode = xyes; then
1236 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1238 if test x$enable_asserts = xyes; then
1239 echo "NOTE: building with assertions increases library size and decreases performance."
1241 if test x$enable_checks = xno; then
1242 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."