6 AM_INIT_AUTOMAKE(dbus, 0.13)
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=no)
39 AC_ARG_ENABLE(python, [ --enable-python build python bindings],enable_python=$enableval,enable_python=auto)
42 AC_ARG_WITH(xml, [ --with-xml=[libxml/expat] XML library to use])
43 AC_ARG_WITH(init-scripts, [ --with-init-scripts=[redhat] Style of init scripts to install])
44 AC_ARG_WITH(session-socket-dir, [ --with-session-socket-dir=[dirname] Where to put sockets for the per-login-session message bus])
45 AC_ARG_WITH(test-socket-dir, [ --with-test-socket-dir=[dirname] Where to put sockets for make check])
46 AC_ARG_WITH(system-pid-file, [ --with-system-pid-file=[pidfile] PID file for systemwide daemon])
47 AC_ARG_WITH(system-socket, [ --with-system-socket=[filename] UNIX domain socket for systemwide daemon])
49 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
50 dnl and also some stuff in the test/ subdir
51 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
52 if test x$enable_tests = xyes; then
53 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
56 if test x$enable_verbose_mode = xyes; then
57 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
59 if test x$enable_asserts = xno; then
60 AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
61 AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
63 if test x$enable_checks = xno; then
64 AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
65 AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
68 #### gcc warning flags
70 if test "x$GCC" = "xyes"; then
73 *[\ \ ]-Wall[\ \ ]*) ;;
74 *) CFLAGS="$CFLAGS -Wall" ;;
78 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
79 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
83 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
84 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
88 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
89 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
93 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
94 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
98 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
99 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
103 *[\ \ ]-Wcast-align[\ \ ]*) ;;
104 *) CFLAGS="$CFLAGS -Wcast-align" ;;
108 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
109 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
112 if test "x$enable_ansi" = "xyes"; then
114 *[\ \ ]-ansi[\ \ ]*) ;;
115 *) CFLAGS="$CFLAGS -ansi" ;;
119 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
120 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
124 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
125 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
129 *[\ \ ]-pedantic[\ \ ]*) ;;
130 *) CFLAGS="$CFLAGS -pedantic" ;;
133 if test x$enable_gcov = xyes; then
135 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
136 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
139 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
140 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
143 ## remove optimization
144 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
148 if test x$enable_gcov = xyes; then
149 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
153 #### can't use AM_PROG_GCJ since it fails fatally if no gcj found
154 AC_CHECK_PROGS(GCJ, gcj, gcj)
155 if test -z "$GCJ" ; then
158 # Needs to be here so libtool wont get confused
162 if test "x${GCJFLAGS-unset}" = xunset; then
163 GCJFLAGS="-g -O2 -Wall"
168 if test x$enable_gcj = xauto ; then
169 if test x$have_gcj = xno ; then
176 if test x$enable_gcj = xyes; then
177 if test x$have_gcj = xno ; then
178 AC_MSG_ERROR([Building gcj explicitly required, but gcj not found])
182 AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
187 AC_CHECK_TOOL(MCS, mcs, mcs)
188 if test -z "$MCS" ; then
192 if test "x${MCSFLAGS-unset}" = xunset; then
193 MCSFLAGS="" ### put default MCSFLAGS here
198 if test x$enable_mono = xauto ; then
199 if test x$have_mcs = xno ; then
206 if test x$enable_mono = xyes; then
207 if test x$have_mcs = xno ; then
208 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
212 AM_CONDITIONAL(DBUS_USE_MCS, test x$enable_mono = xyes)
215 # let ourselves use our own unstable API
216 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
217 # compress spaces in flags
218 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
219 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
220 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
223 if test x$enable_gcov = xyes; then
224 ## so that config.h changes when you toggle gcov support
225 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
227 AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
229 AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
231 if test x$have_gcc33_gcov = xyes ; then
232 AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
234 AC_MSG_RESULT($have_gcc33_gcov)
236 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
240 AC_CHECK_SIZEOF(char)
241 AC_CHECK_SIZEOF(short)
242 AC_CHECK_SIZEOF(long)
244 AC_CHECK_SIZEOF(void *)
245 AC_CHECK_SIZEOF(long long)
246 AC_CHECK_SIZEOF(__int64)
248 ### See what our 64 bit type is called
249 AC_MSG_CHECKING([64-bit integer type])
254 dbusint64_constant='(val)'
255 dbusuint64_constant='(val)'
259 dbusint64_constant='(val##L)'
260 dbusuint64_constant='(val##UL)'
262 $ac_cv_sizeof_long_long)
263 dbusint64='long long'
264 dbusint64_constant='(val##LL)'
265 dbusuint64_constant='(val##ULL)'
267 $ac_cv_sizeof___int64)
269 dbusint64_constant='(val##i64)'
270 dbusuint64_constant='(val##ui64)'
274 if test -z "$dbusint64" ; then
275 DBUS_INT64_TYPE="no_int64_type_detected"
278 DBUS_UINT64_CONSTANT=
279 AC_MSG_RESULT([none found])
281 DBUS_INT64_TYPE="$dbusint64"
283 DBUS_INT64_CONSTANT="$dbusint64_constant"
284 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
285 AC_MSG_RESULT($DBUS_INT64_TYPE)
288 AC_SUBST(DBUS_INT64_TYPE)
289 AC_SUBST(DBUS_INT64_CONSTANT)
290 AC_SUBST(DBUS_UINT64_CONSTANT)
291 AC_SUBST(DBUS_HAVE_INT64)
296 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
297 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
299 if test x"$GCC" = xyes; then
300 if test "x$enable_ansi" = "xyes"; then
308 AC_MSG_RESULT([i486])
309 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
318 if test x$have_atomic_inc = xyes ; then
319 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
322 #### Various functions
323 AC_CHECK_LIB(socket,socket)
324 AC_CHECK_LIB(nsl,gethostbyname)
326 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
328 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
330 AC_CACHE_CHECK([for posix getpwnam_r],
331 ac_cv_func_posix_getpwnam_r,
337 struct passwd pwd, *pwptr = &pwd;
340 error = getpwnam_r ("", &pwd, buffer,
341 sizeof (buffer), &pwptr);
342 return (error < 0 && errno == ENOSYS)
345 [ac_cv_func_posix_getpwnam_r=yes],
346 [ac_cv_func_posix_getpwnam_r=no])])
347 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
348 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
349 [Have POSIX function getpwnam_r])
351 AC_CACHE_CHECK([for nonposix getpwnam_r],
352 ac_cv_func_nonposix_getpwnam_r,
353 [AC_TRY_LINK([#include <pwd.h>],
356 getpwnam_r ("", &pwd, buffer,
358 [ac_cv_func_nonposix_getpwnam_r=yes],
359 [ac_cv_func_nonposix_getpwnam_r=no])])
360 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
361 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
362 [Have non-POSIX function getpwnam_r])
366 dnl check for socklen_t
367 AC_MSG_CHECKING(whether socklen_t is defined)
369 #include <sys/types.h>
370 #include <sys/socket.h>
375 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
376 AC_MSG_RESULT($dbus_have_socklen_t)
378 if test "x$dbus_have_socklen_t" = "xyes"; then
379 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
382 dnl check for writev header and writev function so we're
383 dnl good to go if HAVE_WRITEV gets defined.
384 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
386 dnl check for flavours of varargs macros (test from GLib)
387 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
389 int a(int p1, int p2, int p3);
390 #define call_a(...) a(1,__VA_ARGS__)
392 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
393 AC_MSG_RESULT($dbus_have_iso_c_varargs)
395 AC_MSG_CHECKING(for GNUC varargs macros)
397 int a(int p1, int p2, int p3);
398 #define call_a(params...) a(1,params)
400 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
401 AC_MSG_RESULT($dbus_have_gnuc_varargs)
403 dnl Output varargs tests
404 if test x$dbus_have_iso_c_varargs = xyes; then
405 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
407 if test x$dbus_have_gnuc_varargs = xyes; then
408 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
411 dnl Check for various credentials.
412 AC_MSG_CHECKING(for struct cmsgcred)
414 #include <sys/types.h>
415 #include <sys/socket.h>
417 struct cmsgcred cred;
420 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
421 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
423 if test x$dbus_have_struct_cmsgcred = xyes; then
424 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
428 #### Abstract sockets
430 AC_MSG_CHECKING(abstract socket namespace)
432 AC_RUN_IFELSE([AC_LANG_PROGRAM(
434 #include <sys/types.h>
438 #include <sys/socket.h>
444 struct sockaddr_un addr;
446 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
450 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
454 memset (&addr, '\0', sizeof (addr));
455 addr.sun_family = AF_UNIX;
456 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
457 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
459 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
461 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
468 [have_abstract_sockets=yes],
469 [have_abstract_sockets=no])
471 AC_MSG_RESULT($have_abstract_sockets)
473 if test x$enable_abstract_sockets = xyes; then
474 if test x$have_abstract_sockets = xno; then
475 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
479 if test x$enable_abstract_sockets = xno; then
480 have_abstract_sockets=no;
483 if test x$have_abstract_sockets = xyes ; then
485 DBUS_PATH_OR_ABSTRACT=abstract
488 DBUS_PATH_OR_ABSTRACT=path
491 AC_DEFINE_UNQUOTED(HAVE_ABSTRACT_SOCKETS, $abstract_sockets, [Have abstract socket namespace])
493 # this is used in addresses to prefer abstract, e.g.
494 # unix:path=/foo or unix:abstract=/foo
495 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
497 #### Sort out XML library
500 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
501 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
504 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
506 # see what we want to use
507 dbus_use_libxml=false
509 if test x$with_xml = xexpat; then
511 if ! $have_expat ; then
512 AC_MSG_ERROR([Explicitly requested expat but expat not found])
514 elif test x$with_xml = xlibxml; then
516 if ! $have_libxml ; then
517 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
520 ### expat is the default because libxml can't currently survive
521 ### our brutal OOM-handling unit test setup.
522 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
523 if $have_expat ; then
526 elif $have_libxml ; then
530 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
534 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
535 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
537 if $dbus_use_expat; then
541 if $dbus_use_libxml; then
542 XML_LIBS=$LIBXML_LIBS
543 XML_CFLAGS=$LIBXML_CFLAGS
546 #### Set up final flags
549 AC_SUBST(DBUS_CLIENT_CFLAGS)
550 AC_SUBST(DBUS_CLIENT_LIBS)
552 DBUS_BUS_CFLAGS=$XML_CFLAGS
553 DBUS_BUS_LIBS=$XML_LIBS
554 AC_SUBST(DBUS_BUS_CFLAGS)
555 AC_SUBST(DBUS_BUS_LIBS)
559 AC_SUBST(DBUS_TEST_CFLAGS)
560 AC_SUBST(DBUS_TEST_LIBS)
563 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
564 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
566 if test x$have_glib = xno ; then
567 AC_MSG_WARN([GLib development libraries not found])
570 if test x$enable_glib = xyes; then
571 if test x$have_glib = xno; then
572 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
576 if test x$enable_glib = xno; then
580 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
581 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
584 AC_SUBST(DBUS_GLIB_CFLAGS)
585 AC_SUBST(DBUS_GLIB_LIBS)
586 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
588 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
589 DBUS_GLIB_TOOL_LIBS=$XML_LIBS
590 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
591 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
594 if test x$have_glib = xno ; then
595 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
598 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0, have_gtk=yes, have_gtk=no)
601 if test x$have_gtk = xno ; then
602 AC_MSG_WARN([GTK+ development libraries not found])
605 if test x$enable_gtk = xyes; then
606 if test x$have_gtk = xno; then
607 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
611 if test x$enable_gtk = xno; then
615 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
618 AC_SUBST(DBUS_GTK_CFLAGS)
619 AC_SUBST(DBUS_GTK_LIBS)
623 AC_MSG_CHECKING([for qglobal.h])
624 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
626 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
628 for dir in "${prefix}/include/qt" "/usr/include/qt-3.1" "/usr/include/qt3" "/usr/include/qt" "/usr/lib/qt/include"; do
629 if test -f "$dir/qglobal.h"; then
631 DBUS_QT_CXXFLAGS="-I$dir"
635 if test x"$have_qt" = x"yes"; then
636 AC_MSG_RESULT([found])
638 AC_MSG_RESULT([not found])
641 dnl linking to kdecore will give us a bit of help from libtool
642 if (! kde-config >& /dev/null); then
645 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
646 if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
649 DBUS_QT_LIBS="$kdelibs/libkdecore.la"
653 if test x$have_qt = xno ; then
654 AC_MSG_WARN([Qt development libraries not found])
657 if test x$enable_qt = xyes; then
658 if test x$have_qt = xno; then
659 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
663 if test x$enable_qt = xno; then
667 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
670 AC_SUBST(DBUS_QT_CXXFLAGS)
671 AC_SUBST(DBUS_QT_LIBS)
676 ## for now enable_x11 just tracks have_x11,
677 ## there's no --enable-x11
678 if test x$no_x = xyes ; then
686 if test x$enable_x11 = xyes ; then
687 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
688 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
689 DBUS_X_CFLAGS="$X_CFLAGS"
695 AC_SUBST(DBUS_X_CFLAGS)
696 AC_SUBST(DBUS_X_LIBS)
698 ### Doxygen Documentation
700 AC_PATH_PROG(DOXYGEN, doxygen, no)
702 AC_MSG_CHECKING([whether to build Doxygen documentation])
704 if test x$DOXYGEN = xno ; then
710 if test x$enable_doxygen_docs = xauto ; then
711 if test x$have_doxygen = xno ; then
712 enable_doxygen_docs=no
714 enable_doxygen_docs=yes
718 if test x$enable_doxygen_docs = xyes; then
719 if test x$have_doxygen = xno; then
720 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
724 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
727 ### XML Documentation
729 AC_PATH_PROG(XMLTO, xmlto, no)
731 AC_MSG_CHECKING([whether to build XML documentation])
733 if test x$XMLTO = xno ; then
739 if test x$enable_xml_docs = xauto ; then
740 if test x$have_xmlto = xno ; then
747 if test x$enable_xml_docs = xyes; then
748 if test x$have_xmlto = xno; then
749 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
753 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
756 #### Have to go $localstatedir->$prefix/var->/usr/local/var
757 #### someone please fix this a better way...
759 #### find the actual value for $prefix that we'll end up with
760 ## (I know this is broken and should be done in the Makefile, but
761 ## that's a major pain and almost nobody actually seems to care)
763 if test "x$prefix" = "xNONE"; then
764 REAL_PREFIX=$ac_default_prefix
769 ## temporarily change prefix and exec_prefix
773 if test "x$exec_prefix" = xNONE ; then
774 REAL_EXEC_PREFIX=$REAL_PREFIX
776 REAL_EXEC_PREFIX=$exec_prefix
778 old_exec_prefix=$exec_prefix
779 exec_prefix=$REAL_EXEC_PREFIX
782 LOCALSTATEDIR_TMP="$localstatedir"
783 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
784 AC_SUBST(EXPANDED_LOCALSTATEDIR)
786 SYSCONFDIR_TMP="$sysconfdir"
787 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
788 AC_SUBST(EXPANDED_SYSCONFDIR)
791 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
792 AC_SUBST(EXPANDED_BINDIR)
795 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
796 AC_SUBST(EXPANDED_LIBDIR)
798 ## put prefix and exec_prefix back
800 exec_prefix=$old_exec_prefix
802 #### Check our operating system
803 operating_system=unknown
804 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
805 operating_system=redhat
808 #### Sort out init scripts
810 if test x$with_init_scripts = x; then
811 if test xredhat = x$operating_system ; then
812 with_init_scripts=redhat
814 with_init_scripts=none
818 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
821 ##### Set up location for system bus socket
822 if ! test -z "$with_system_socket"; then
823 DBUS_SYSTEM_SOCKET=$with_system_socket
825 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
828 AC_SUBST(DBUS_SYSTEM_SOCKET)
829 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
831 ## system bus only listens on local domain sockets, and never
832 ## on an abstract socket (so only root can create the socket)
833 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
834 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
835 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-BUS address of the system bus])
837 #### Set up the pid file
838 if ! test -z "$with_system_pid_file"; then
839 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
840 elif test x$operating_system = xredhat ; then
841 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
843 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
846 AC_SUBST(DBUS_SYSTEM_PID_FILE)
848 #### Tell tests where to find certain stuff in builddir
849 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
851 AC_DEFUN(TEST_PATH, [
852 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
853 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
854 [Full path to test file test/$2 in builddir])
858 TEST_PATH(SERVICE_DIR, data/valid-service-files)
859 TEST_PATH(SERVICE_BINARY, test-service)
860 TEST_PATH(GLIB_SERVICE_BINARY, test-service-glib)
861 TEST_PATH(EXIT_BINARY, test-exit)
862 TEST_PATH(SEGFAULT_BINARY, test-segfault)
863 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
865 #### Find socket directories
866 if ! test -z "$TMPDIR" ; then
867 DEFAULT_SOCKET_DIR=$TMPDIR
868 elif ! test -z "$TEMP" ; then
869 DEFAULT_SOCKET_DIR=$TEMP
870 elif ! test -z "$TMP" ; then
871 DEFAULT_SOCKET_DIR=$TMP
873 DEFAULT_SOCKET_DIR=/tmp
876 if ! test -z "$with_test_socket_dir" ; then
877 TEST_SOCKET_DIR="$with_test_socket_dir"
879 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
881 AC_SUBST(TEST_SOCKET_DIR)
882 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
884 if ! test -z "$with_session_socket_dir" ; then
885 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
887 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
889 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
890 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
892 # Detect if we can build Python bindings (need python, python headers, and pyrex)
893 if test x$enable_python = xno; then
896 AC_MSG_NOTICE([Checking to see if we can build Python bindings])
900 if test -z "$PYTHON" ; then
901 AC_MSG_WARN([Python not found])
903 AC_CHECK_PROGS(PYREX, pyrexc)
905 if test -z "$PYREX" ; then
911 AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
913 if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
918 if test x$have_python = xno ; then
919 if test x$enable_python = xyes ; then
920 AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
922 AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings])
927 AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
932 dbus/dbus-arch-deps.h
944 gcj/org/freedesktop/Makefile
945 gcj/org/freedesktop/dbus/Makefile
954 test/data/valid-config-files/debug-allow-all.conf
955 test/data/valid-config-files/debug-allow-all-sha1.conf
956 test/data/valid-service-files/debug-echo.service
957 test/data/valid-service-files/debug-segfault.service
960 ### FIXME it's bizarre that have_qt and have_glib are used
961 ### instead of enable_ - should fix things so that enable
962 ### is always whether it's enabled, and have is always whether
965 dnl ==========================================================================
971 exec_prefix: ${exec_prefix}
972 libdir: ${EXPANDED_LIBDIR}
973 bindir: ${EXPANDED_BINDIR}
974 sysconfdir: ${EXPANDED_SYSCONFDIR}
975 localstatedir: ${EXPANDED_LOCALSTATEDIR}
976 source code location: ${srcdir}
979 cppflags: ${CPPFLAGS}
980 cxxflags: ${CXXFLAGS}
981 64-bit int: ${DBUS_INT64_TYPE}
985 if test x$enable_gcj = xyes ; then
988 gcjflags: ${GCJFLAGS}"
991 " gcj: (not enabled)"
994 if test x$enable_mono = xyes ; then
997 mcsflags: ${MCSFLAGS}
1001 " mcs: (not enabled)
1006 Maintainer mode: ${USE_MAINTAINER_MODE}
1007 gcc coverage profiling: ${enable_gcov}
1008 Building unit tests: ${enable_tests}
1009 Building verbose mode: ${enable_verbose_mode}
1010 Building assertions: ${enable_asserts}
1011 Building checks: ${enable_checks}
1012 Building Qt bindings: ${have_qt}
1013 Building GLib bindings: ${have_glib}
1014 Building Python bindings: ${have_python}
1015 Building GTK+ tools: ${have_gtk}
1016 Building X11 code: ${enable_x11}
1017 Building Doxygen docs: ${enable_doxygen_docs}
1018 Building XML docs: ${enable_xml_docs}
1019 Using XML parser: ${with_xml}
1020 Init scripts style: ${with_init_scripts}
1021 Abstract socket names: ${have_abstract_sockets}
1022 System bus socket: ${DBUS_SYSTEM_SOCKET}
1023 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1024 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
1025 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
1026 'make check' socket dir: ${TEST_SOCKET_DIR}
1029 if test x$enable_tests = xyes; then
1030 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1032 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1033 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)"
1035 if test x$enable_gcov = xyes; then
1036 echo "NOTE: building with coverage profiling is definitely for developers only."
1038 if test x$enable_verbose_mode = xyes; then
1039 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1041 if test x$enable_asserts = xyes; then
1042 echo "NOTE: building with assertions increases library size and decreases performance."
1044 if test x$enable_checks = xno; then
1045 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."