6 AM_INIT_AUTOMAKE(dbus, 0.21)
8 AM_CONFIG_HEADER(config.h)
11 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
13 GETTEXT_PACKAGE=dbus-1
14 AC_SUBST(GETTEXT_PACKAGE)
15 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
17 ## must come before we use the $USE_MAINTAINER_MODE variable later
25 AC_ARG_ENABLE(qt, [ --enable-qt enable Qt-friendly client library],enable_qt=$enableval,enable_qt=auto)
26 AC_ARG_ENABLE(glib, [ --enable-glib enable GLib-friendly client library],enable_glib=$enableval,enable_glib=auto)
27 AC_ARG_ENABLE(gtk, [ --enable-gtk enable GTK-requiring executables],enable_gtk=$enableval,enable_gtk=auto)
28 AC_ARG_ENABLE(tests, [ --enable-tests enable unit test code],enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
29 AC_ARG_ENABLE(ansi, [ --enable-ansi enable -ansi -pedantic gcc flags],enable_ansi=$enableval,enable_ansi=no)
30 AC_ARG_ENABLE(verbose-mode, [ --enable-verbose-mode support verbose debug mode],enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
31 AC_ARG_ENABLE(asserts, [ --enable-asserts include assertion checks],enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
32 AC_ARG_ENABLE(checks, [ --enable-checks include sanity checks on public API],enable_checks=$enableval,enable_checks=yes)
33 AC_ARG_ENABLE(xml-docs, [ --enable-xml-docs build XML documentation (requires xmlto)],enable_xml_docs=$enableval,enable_xml_docs=auto)
34 AC_ARG_ENABLE(doxygen-docs, [ --enable-doxygen-docs build DOXYGEN documentation (requires Doxygen)],enable_doxygen_docs=$enableval,enable_doxygen_docs=auto)
35 AC_ARG_ENABLE(gcov, [ --enable-gcov compile with coverage profiling instrumentation (gcc only)],enable_gcov=$enableval,enable_gcov=no)
36 AC_ARG_ENABLE(abstract-sockets, [ --enable-abstract-sockets use abstract socket namespace (linux only)],enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
37 AC_ARG_ENABLE(gcj, [ --enable-gcj build gcj bindings],enable_gcj=$enableval,enable_gcj=no)
38 AC_ARG_ENABLE(mono, [ --enable-mono build mono bindings],enable_mono=$enableval,enable_mono=auto)
39 AC_ARG_ENABLE(mono_docs, [ --enable-mono-docs build mono docs],enable_mono_docs=$enableval,enable_mono_docs=auto)
40 AC_ARG_ENABLE(python, [ --enable-python build python bindings],enable_python=$enableval,enable_python=auto)
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$have_mono" = "xtrue"; then
193 if test `uname -s` = "Darwin"; then
194 AC_PATH_PROG(RUNTIME, mint, no)
195 AC_PATH_PROG(CSC, mcs, no)
199 AC_PATH_PROG(RUNTIME, mono, no)
200 AC_PATH_PROG(CSC, mcs, no)
205 AC_PATH_PROG(CSC, csc.exe, no)
211 if test x$enable_mono = xyes; then
212 if test x$have_mcs = xno ; then
213 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
217 AC_PATH_PROG(GACUTIL, gacutil, no)
218 if test "x$GACUTIL" = "xno" ; then
219 AC_MSG_ERROR([No gacutil tool found])
225 if test x$enable_mono = xauto ; then
226 if test x$CSC = xno ; then
230 AC_PATH_PROG(GACUTIL, gacutil, no)
231 if test "x$GACUTIL" = "xno" ; then
245 AM_CONDITIONAL(DBUS_USE_CSC, test x$enable_mono = xyes)
247 #### Look for monodoc
248 MONODOC_REQUIRED_VERSION=0.16
249 AC_SUBST(MONODOC_REQUIRED_VERSION)
250 PKG_CHECK_MODULES(MONODOC_DEPENDENCY, monodoc >= $MONODOC_REQUIRED_VERSION, have_monodoc=yes, have_monodoc=no)
252 if test x$enable_mono_docs = xyes; then
253 if test x$have_monodoc = xno ; then
254 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
256 AC_PATH_PROG(MONODOC, monodoc, no)
257 if test x$MONODOC = xno; then
258 AC_MSG_ERROR([Building Mono docs explicitly required, but monodoc not found])
263 if test x$enable_mono_docs = xauto ; then
264 if test x$have_monodoc = xno ; then
268 AC_PATH_PROG(MONODOC, monodoc, no)
269 if test x$MONODOC = xno; then
280 AM_CONDITIONAL(ENABLE_MONODOC, test "x$enable_mono_docs" = "xyes")
283 # let ourselves use our own unstable API
284 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
285 # compress spaces in flags
286 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
287 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
288 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
291 if test x$enable_gcov = xyes; then
292 ## so that config.h changes when you toggle gcov support
293 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
295 AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
297 AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
299 if test x$have_gcc33_gcov = xyes ; then
300 AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
302 AC_MSG_RESULT($have_gcc33_gcov)
304 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
308 AC_CHECK_SIZEOF(char)
309 AC_CHECK_SIZEOF(short)
310 AC_CHECK_SIZEOF(long)
312 AC_CHECK_SIZEOF(void *)
313 AC_CHECK_SIZEOF(long long)
314 AC_CHECK_SIZEOF(__int64)
316 ### See what our 64 bit type is called
317 AC_MSG_CHECKING([64-bit integer type])
322 dbusint64_constant='(val)'
323 dbusuint64_constant='(val)'
327 dbusint64_constant='(val##L)'
328 dbusuint64_constant='(val##UL)'
330 $ac_cv_sizeof_long_long)
331 dbusint64='long long'
332 dbusint64_constant='(val##LL)'
333 dbusuint64_constant='(val##ULL)'
335 $ac_cv_sizeof___int64)
337 dbusint64_constant='(val##i64)'
338 dbusuint64_constant='(val##ui64)'
342 if test -z "$dbusint64" ; then
343 DBUS_INT64_TYPE="no_int64_type_detected"
346 DBUS_UINT64_CONSTANT=
347 AC_MSG_RESULT([none found])
349 DBUS_INT64_TYPE="$dbusint64"
351 DBUS_INT64_CONSTANT="$dbusint64_constant"
352 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
353 AC_MSG_RESULT($DBUS_INT64_TYPE)
356 AC_SUBST(DBUS_INT64_TYPE)
357 AC_SUBST(DBUS_INT64_CONSTANT)
358 AC_SUBST(DBUS_UINT64_CONSTANT)
359 AC_SUBST(DBUS_HAVE_INT64)
365 dnl **********************************
366 dnl *** va_copy checks (from GLib) ***
367 dnl **********************************
368 dnl we currently check for all three va_copy possibilities, so we get
369 dnl all results in config.log for bug reports.
370 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
371 AC_LINK_IFELSE([#include <stdarg.h>
372 void f (int i, ...) {
373 va_list args1, args2;
375 va_copy (args2, args1);
376 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
378 va_end (args1); va_end (args2);
384 [dbus_cv_va_copy=yes],
385 [dbus_cv_va_copy=no])
387 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
388 AC_LINK_IFELSE([#include <stdarg.h>
389 void f (int i, ...) {
390 va_list args1, args2;
392 __va_copy (args2, args1);
393 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
395 va_end (args1); va_end (args2);
401 [dbus_cv___va_copy=yes],
402 [dbus_cv___va_copy=no])
405 if test "x$dbus_cv_va_copy" = "xyes"; then
406 dbus_va_copy_func=va_copy
407 else if test "x$dbus_cv___va_copy" = "xyes"; then
408 dbus_va_copy_func=__va_copy
412 if test -n "$dbus_va_copy_func"; then
413 AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
416 AC_CACHE_CHECK([whether va_lists can be copied by value],dbus_cv_va_val_copy,[
417 AC_TRY_RUN([#include <stdarg.h>
418 void f (int i, ...) {
419 va_list args1, args2;
422 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
424 va_end (args1); va_end (args2);
430 [dbus_cv_va_val_copy=yes],
431 [dbus_cv_va_val_copy=no],
432 [dbus_cv_va_val_copy=yes])
435 if test "x$dbus_cv_va_val_copy" = "xno"; then
436 AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
440 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
441 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
443 if test x"$GCC" = xyes; then
444 if test "x$enable_ansi" = "xyes"; then
452 AC_MSG_RESULT([i486])
453 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
462 if test x$have_atomic_inc = xyes ; then
463 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
466 #### Various functions
467 AC_CHECK_LIB(socket,socket)
468 AC_CHECK_LIB(nsl,gethostbyname)
470 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
472 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
474 AC_CACHE_CHECK([for posix getpwnam_r],
475 ac_cv_func_posix_getpwnam_r,
481 struct passwd pwd, *pwptr = &pwd;
484 error = getpwnam_r ("", &pwd, buffer,
485 sizeof (buffer), &pwptr);
486 return (error < 0 && errno == ENOSYS)
489 [ac_cv_func_posix_getpwnam_r=yes],
490 [ac_cv_func_posix_getpwnam_r=no])])
491 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
492 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
493 [Have POSIX function getpwnam_r])
495 AC_CACHE_CHECK([for nonposix getpwnam_r],
496 ac_cv_func_nonposix_getpwnam_r,
497 [AC_TRY_LINK([#include <pwd.h>],
500 getpwnam_r ("", &pwd, buffer,
502 [ac_cv_func_nonposix_getpwnam_r=yes],
503 [ac_cv_func_nonposix_getpwnam_r=no])])
504 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
505 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
506 [Have non-POSIX function getpwnam_r])
510 dnl check for socklen_t
511 AC_MSG_CHECKING(whether socklen_t is defined)
513 #include <sys/types.h>
514 #include <sys/socket.h>
519 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
520 AC_MSG_RESULT($dbus_have_socklen_t)
522 if test "x$dbus_have_socklen_t" = "xyes"; then
523 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
526 dnl check for writev header and writev function so we're
527 dnl good to go if HAVE_WRITEV gets defined.
528 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
530 dnl check for flavours of varargs macros (test from GLib)
531 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
533 int a(int p1, int p2, int p3);
534 #define call_a(...) a(1,__VA_ARGS__)
536 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
537 AC_MSG_RESULT($dbus_have_iso_c_varargs)
539 AC_MSG_CHECKING(for GNUC varargs macros)
541 int a(int p1, int p2, int p3);
542 #define call_a(params...) a(1,params)
544 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
545 AC_MSG_RESULT($dbus_have_gnuc_varargs)
547 dnl Output varargs tests
548 if test x$dbus_have_iso_c_varargs = xyes; then
549 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
551 if test x$dbus_have_gnuc_varargs = xyes; then
552 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
555 dnl Check for various credentials.
556 AC_MSG_CHECKING(for struct cmsgcred)
558 #include <sys/types.h>
559 #include <sys/socket.h>
561 struct cmsgcred cred;
564 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
565 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
567 if test x$dbus_have_struct_cmsgcred = xyes; then
568 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
572 #### Abstract sockets
574 AC_MSG_CHECKING(abstract socket namespace)
576 AC_RUN_IFELSE([AC_LANG_PROGRAM(
578 #include <sys/types.h>
582 #include <sys/socket.h>
588 struct sockaddr_un addr;
590 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
594 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
598 memset (&addr, '\0', sizeof (addr));
599 addr.sun_family = AF_UNIX;
600 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
601 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
603 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
605 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
612 [have_abstract_sockets=yes],
613 [have_abstract_sockets=no])
615 AC_MSG_RESULT($have_abstract_sockets)
617 if test x$enable_abstract_sockets = xyes; then
618 if test x$have_abstract_sockets = xno; then
619 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
623 if test x$enable_abstract_sockets = xno; then
624 have_abstract_sockets=no;
627 if test x$have_abstract_sockets = xyes ; then
628 DBUS_PATH_OR_ABSTRACT=abstract
629 AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
631 DBUS_PATH_OR_ABSTRACT=path
634 # this is used in addresses to prefer abstract, e.g.
635 # unix:path=/foo or unix:abstract=/foo
636 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
638 #### Sort out XML library
641 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
642 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
645 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
647 # see what we want to use
648 dbus_use_libxml=false
650 if test x$with_xml = xexpat; then
652 if ! $have_expat ; then
653 AC_MSG_ERROR([Explicitly requested expat but expat not found])
655 elif test x$with_xml = xlibxml; then
657 if ! $have_libxml ; then
658 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
661 ### expat is the default because libxml can't currently survive
662 ### our brutal OOM-handling unit test setup.
663 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
664 if $have_expat ; then
667 elif $have_libxml ; then
671 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
675 if $dbus_use_libxml ; then
676 dnl libxml OOM handling is a bit broken
677 AC_MSG_WARN([libxml loader is not as robust as the expat one wrt. OOM handling])
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_EGREP_HEADER(DBUS__ACQUIRE_SVC, av_permissions.h,
704 have_selinux=yes, have_selinux=no)
707 if test x$enable_selinux = xauto ; then
708 if test x$have_selinux = xno ; then
709 AC_MSG_WARN([Sufficiently new SELinux library not found])
712 if test x$have_selinux = xno ; then
713 AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
718 AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
720 if test x$have_selinux = xyes ; then
721 SELINUX_LIBS=-lselinux
722 AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
727 #### Set up final flags
730 AC_SUBST(DBUS_CLIENT_CFLAGS)
731 AC_SUBST(DBUS_CLIENT_LIBS)
733 DBUS_BUS_CFLAGS=$XML_CFLAGS
734 DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS"
735 AC_SUBST(DBUS_BUS_CFLAGS)
736 AC_SUBST(DBUS_BUS_LIBS)
740 AC_SUBST(DBUS_TEST_CFLAGS)
741 AC_SUBST(DBUS_TEST_LIBS)
744 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
745 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
747 if test x$have_glib = xno ; then
748 AC_MSG_WARN([GLib development libraries not found])
751 if test x$enable_glib = xyes; then
752 if test x$have_glib = xno; then
753 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
757 if test x$enable_glib = xno; then
761 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
762 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
765 AC_SUBST(DBUS_GLIB_CFLAGS)
766 AC_SUBST(DBUS_GLIB_LIBS)
767 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
769 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
770 DBUS_GLIB_TOOL_LIBS=$XML_LIBS
771 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
772 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
775 if test x$have_glib = xno ; then
776 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
779 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0, have_gtk=yes, have_gtk=no)
782 if test x$have_gtk = xno ; then
783 AC_MSG_WARN([GTK+ development libraries not found])
786 if test x$enable_gtk = xyes; then
787 if test x$have_gtk = xno; then
788 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
792 if test x$enable_gtk = xno; then
796 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
799 AC_SUBST(DBUS_GTK_CFLAGS)
800 AC_SUBST(DBUS_GTK_LIBS)
803 AC_PATH_PROG(QT_MOC, moc, no)
806 AC_MSG_CHECKING([for qglobal.h])
807 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
809 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
811 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
812 if test -f "$dir/qglobal.h"; then
814 DBUS_QT_CXXFLAGS="-I$dir"
818 if test x"$have_qt" = x"yes"; then
819 AC_MSG_RESULT([found])
821 AC_MSG_RESULT([not found])
824 dnl linking to kdecore will give us a bit of help from libtool
825 if (! kde-config >& /dev/null); then
828 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
829 if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
832 DBUS_QT_LIBS="$kdelibs/libkdecore.la"
836 if test x$have_qt = xno ; then
837 AC_MSG_WARN([Qt development libraries not found])
840 if test x$enable_qt = xyes; then
841 if test x$have_qt = xno; then
842 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
846 if test x$enable_qt = xno; then
850 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
853 AC_SUBST(DBUS_QT_CXXFLAGS)
854 AC_SUBST(DBUS_QT_LIBS)
859 ## for now enable_x11 just tracks have_x11,
860 ## there's no --enable-x11
861 if test x$no_x = xyes ; then
869 if test x$enable_x11 = xyes ; then
870 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
871 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
872 DBUS_X_CFLAGS="$X_CFLAGS"
878 AC_SUBST(DBUS_X_CFLAGS)
879 AC_SUBST(DBUS_X_LIBS)
881 ### Doxygen Documentation
883 AC_PATH_PROG(DOXYGEN, doxygen, no)
885 AC_MSG_CHECKING([whether to build Doxygen documentation])
887 if test x$DOXYGEN = xno ; then
893 if test x$enable_doxygen_docs = xauto ; then
894 if test x$have_doxygen = xno ; then
895 enable_doxygen_docs=no
897 enable_doxygen_docs=yes
901 if test x$enable_doxygen_docs = xyes; then
902 if test x$have_doxygen = xno; then
903 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
907 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
910 ### XML Documentation
912 AC_PATH_PROG(XMLTO, xmlto, no)
914 AC_MSG_CHECKING([whether to build XML documentation])
916 if test x$XMLTO = xno ; then
922 if test x$enable_xml_docs = xauto ; then
923 if test x$have_xmlto = xno ; then
930 if test x$enable_xml_docs = xyes; then
931 if test x$have_xmlto = xno; then
932 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
936 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
939 #### Have to go $localstatedir->$prefix/var->/usr/local/var
940 #### someone please fix this a better way...
942 #### find the actual value for $prefix that we'll end up with
943 ## (I know this is broken and should be done in the Makefile, but
944 ## that's a major pain and almost nobody actually seems to care)
946 if test "x$prefix" = "xNONE"; then
947 REAL_PREFIX=$ac_default_prefix
952 ## temporarily change prefix and exec_prefix
956 if test "x$exec_prefix" = xNONE ; then
957 REAL_EXEC_PREFIX=$REAL_PREFIX
959 REAL_EXEC_PREFIX=$exec_prefix
961 old_exec_prefix=$exec_prefix
962 exec_prefix=$REAL_EXEC_PREFIX
965 LOCALSTATEDIR_TMP="$localstatedir"
966 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
967 AC_SUBST(EXPANDED_LOCALSTATEDIR)
969 SYSCONFDIR_TMP="$sysconfdir"
970 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
971 AC_SUBST(EXPANDED_SYSCONFDIR)
974 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
975 AC_SUBST(EXPANDED_BINDIR)
978 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
979 AC_SUBST(EXPANDED_LIBDIR)
981 ## put prefix and exec_prefix back
983 exec_prefix=$old_exec_prefix
985 #### Check our operating system
986 operating_system=unknown
987 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
988 operating_system=redhat
991 #### Sort out init scripts
993 if test x$with_init_scripts = x; then
994 if test xredhat = x$operating_system ; then
995 with_init_scripts=redhat
997 with_init_scripts=none
1001 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
1004 ##### Set up location for system bus socket
1005 if ! test -z "$with_system_socket"; then
1006 DBUS_SYSTEM_SOCKET=$with_system_socket
1008 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
1011 AC_SUBST(DBUS_SYSTEM_SOCKET)
1012 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
1014 ## system bus only listens on local domain sockets, and never
1015 ## on an abstract socket (so only root can create the socket)
1016 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
1017 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
1018 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-BUS address of the system bus])
1020 #### Set up the pid file
1021 if ! test -z "$with_system_pid_file"; then
1022 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
1023 elif test x$operating_system = xredhat ; then
1024 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
1026 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
1029 AC_SUBST(DBUS_SYSTEM_PID_FILE)
1031 #### Tell tests where to find certain stuff in builddir
1032 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
1034 AC_DEFUN(TEST_PATH, [
1035 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
1036 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
1037 [Full path to test file test/$2 in builddir])
1041 TEST_PATH(SERVICE_DIR, data/valid-service-files)
1042 TEST_PATH(SERVICE_BINARY, test-service)
1043 TEST_PATH(GLIB_SERVICE_BINARY, test-service-glib)
1044 TEST_PATH(EXIT_BINARY, test-exit)
1045 TEST_PATH(SEGFAULT_BINARY, test-segfault)
1046 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
1047 AC_SUBST(ABSOLUTE_TOP_BUILDDIR)
1049 #### Find socket directories
1050 if ! test -z "$TMPDIR" ; then
1051 DEFAULT_SOCKET_DIR=$TMPDIR
1052 elif ! test -z "$TEMP" ; then
1053 DEFAULT_SOCKET_DIR=$TEMP
1054 elif ! test -z "$TMP" ; then
1055 DEFAULT_SOCKET_DIR=$TMP
1057 DEFAULT_SOCKET_DIR=/tmp
1060 if ! test -z "$with_test_socket_dir" ; then
1061 TEST_SOCKET_DIR="$with_test_socket_dir"
1063 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1065 AC_SUBST(TEST_SOCKET_DIR)
1066 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1068 if ! test -z "$with_session_socket_dir" ; then
1069 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1071 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1073 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
1074 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
1076 # Detect if we can build Python bindings (need python, python headers, and pyrex)
1077 if test x$enable_python = xno; then
1080 AC_MSG_NOTICE([Checking to see if we can build Python bindings])
1084 if test -z "$PYTHON" ; then
1085 AC_MSG_WARN([Python not found])
1087 AC_CHECK_PROGS(PYREX, pyrexc)
1089 if test -z "$PYREX" ; then
1095 AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
1097 if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
1102 if test x$have_python = xno ; then
1103 if test x$enable_python = xyes ; then
1104 AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
1106 AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings])
1111 AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
1115 dbus/dbus-arch-deps.h
1124 python/examples/Makefile
1128 gcj/org/freedesktop/Makefile
1129 gcj/org/freedesktop/dbus/Makefile
1131 mono/AssemblyInfo.cs
1132 mono/dbus-sharp.dll.config
1133 mono/example/Makefile
1143 test/data/valid-config-files/debug-allow-all.conf
1144 test/data/valid-config-files/debug-allow-all-sha1.conf
1145 test/data/valid-service-files/debug-echo.service
1146 test/data/valid-service-files/debug-segfault.service
1149 ### FIXME it's bizarre that have_qt and have_glib are used
1150 ### instead of enable_ - should fix things so that enable
1151 ### is always whether it's enabled, and have is always whether
1154 dnl ==========================================================================
1160 exec_prefix: ${exec_prefix}
1161 libdir: ${EXPANDED_LIBDIR}
1162 bindir: ${EXPANDED_BINDIR}
1163 sysconfdir: ${EXPANDED_SYSCONFDIR}
1164 localstatedir: ${EXPANDED_LOCALSTATEDIR}
1165 source code location: ${srcdir}
1168 cppflags: ${CPPFLAGS}
1169 cxxflags: ${CXXFLAGS}
1170 64-bit int: ${DBUS_INT64_TYPE}
1174 if test x$enable_gcj = xyes ; then
1177 gcjflags: ${GCJFLAGS}"
1180 " gcj: (not enabled)"
1183 if test x$enable_mono = xyes ; then
1189 " csc: (not enabled)
1194 Maintainer mode: ${USE_MAINTAINER_MODE}
1195 gcc coverage profiling: ${enable_gcov}
1196 Building unit tests: ${enable_tests}
1197 Building verbose mode: ${enable_verbose_mode}
1198 Building assertions: ${enable_asserts}
1199 Building checks: ${enable_checks}
1200 Building Qt bindings: ${have_qt}
1201 Building GLib bindings: ${have_glib}
1202 Building Python bindings: ${have_python}
1203 Building SELinux support: ${have_selinux}
1204 Building Mono bindings: ${enable_mono}
1205 Building Mono docs: ${enable_mono_docs}
1206 Building GTK+ tools: ${have_gtk}
1207 Building X11 code: ${enable_x11}
1208 Building Doxygen docs: ${enable_doxygen_docs}
1209 Building XML docs: ${enable_xml_docs}
1210 Using XML parser: ${with_xml}
1211 Init scripts style: ${with_init_scripts}
1212 Abstract socket names: ${have_abstract_sockets}
1213 System bus socket: ${DBUS_SYSTEM_SOCKET}
1214 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1215 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
1216 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
1217 'make check' socket dir: ${TEST_SOCKET_DIR}
1220 if test x$enable_tests = xyes; then
1221 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1223 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1224 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)"
1226 if test x$enable_gcov = xyes; then
1227 echo "NOTE: building with coverage profiling is definitely for developers only."
1229 if test x$enable_verbose_mode = xyes; then
1230 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1232 if test x$enable_asserts = xyes; then
1233 echo "NOTE: building with assertions increases library size and decreases performance."
1235 if test x$enable_checks = xno; then
1236 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."