6 AM_INIT_AUTOMAKE(dbus, 0.11)
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(docs, [ --enable-docs build documentation (requires Doxygen and jade)],enable_docs=$enableval,enable_docs=auto)
34 AC_ARG_ENABLE(gcov, [ --enable-gcov compile with coverage profiling instrumentation (gcc only)],enable_gcov=$enableval,enable_gcov=no)
35 AC_ARG_ENABLE(abstract-sockets, [ --enable-abstract-sockets use abstract socket namespace (linux only)],enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
36 AC_ARG_ENABLE(gcj, [ --enable-gcj build gcj bindings],enable_gcj=$enableval,enable_gcj=no)
37 AC_ARG_ENABLE(mono, [ --enable-mono build mono bindings],enable_mono=$enableval,enable_mono=no)
38 AC_ARG_ENABLE(python, [ --enable-python build python bindings],enable_python=$enableval,enable_python=auto)
41 AC_ARG_WITH(xml, [ --with-xml=[libxml/expat] XML library to use])
42 AC_ARG_WITH(init-scripts, [ --with-init-scripts=[redhat] Style of init scripts to install])
43 AC_ARG_WITH(session-socket-dir, [ --with-session-socket-dir=[dirname] Where to put sockets for the per-login-session message bus])
44 AC_ARG_WITH(test-socket-dir, [ --with-test-socket-dir=[dirname] Where to put sockets for make check])
45 AC_ARG_WITH(system-pid-file, [ --with-system-pid-file=[pidfile] PID file for systemwide daemon])
46 AC_ARG_WITH(system-socket, [ --with-system-socket=[filename] UNIX domain socket for systemwide daemon])
48 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
49 dnl and also some stuff in the test/ subdir
50 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
51 if test x$enable_tests = xyes; then
52 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
55 if test x$enable_verbose_mode = xyes; then
56 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
58 if test x$enable_asserts = xno; then
59 AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
60 AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
62 if test x$enable_checks = xno; then
63 AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
64 AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
67 #### gcc warning flags
69 if test "x$GCC" = "xyes"; then
72 *[\ \ ]-Wall[\ \ ]*) ;;
73 *) CFLAGS="$CFLAGS -Wall" ;;
77 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
78 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
82 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
83 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
87 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
88 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
92 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
93 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
97 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
98 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
102 *[\ \ ]-Wcast-align[\ \ ]*) ;;
103 *) CFLAGS="$CFLAGS -Wcast-align" ;;
107 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
108 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
111 if test "x$enable_ansi" = "xyes"; then
113 *[\ \ ]-ansi[\ \ ]*) ;;
114 *) CFLAGS="$CFLAGS -ansi" ;;
118 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
119 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
123 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
124 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
128 *[\ \ ]-pedantic[\ \ ]*) ;;
129 *) CFLAGS="$CFLAGS -pedantic" ;;
132 if test x$enable_gcov = xyes; then
134 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
135 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
138 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
139 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
142 ## remove optimization
143 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
147 if test x$enable_gcov = xyes; then
148 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
152 #### can't use AM_PROG_GCJ since it fails fatally if no gcj found
153 AC_CHECK_PROGS(GCJ, gcj, gcj)
154 if test -z "$GCJ" ; then
157 # Needs to be here so libtool wont get confused
161 if test "x${GCJFLAGS-unset}" = xunset; then
162 GCJFLAGS="-g -O2 -Wall"
167 if test x$enable_gcj = xauto ; then
168 if test x$have_gcj = xno ; then
175 if test x$enable_gcj = xyes; then
176 if test x$have_gcj = xno ; then
177 AC_MSG_ERROR([Building gcj explicitly required, but gcj not found])
181 AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
186 AC_CHECK_TOOL(MCS, mcs, mcs)
187 if test -z "$MCS" ; then
191 if test "x${MCSFLAGS-unset}" = xunset; then
192 MCSFLAGS="" ### put default MCSFLAGS here
197 if test x$enable_mono = xauto ; then
198 if test x$have_mcs = xno ; then
205 if test x$enable_mono = xyes; then
206 if test x$have_mcs = xno ; then
207 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
211 AM_CONDITIONAL(DBUS_USE_MCS, test x$enable_mono = xyes)
214 # let ourselves use our own unstable API
215 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
216 # compress spaces in flags
217 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
218 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
219 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
222 if test x$enable_gcov = xyes; then
223 ## so that config.h changes when you toggle gcov support
224 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
226 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
230 AC_CHECK_SIZEOF(char)
231 AC_CHECK_SIZEOF(short)
232 AC_CHECK_SIZEOF(long)
234 AC_CHECK_SIZEOF(void *)
235 AC_CHECK_SIZEOF(long long)
236 AC_CHECK_SIZEOF(__int64)
238 ### See what our 64 bit type is called
239 AC_MSG_CHECKING([64-bit integer type])
244 dbusint64_constant='(val)'
245 dbusuint64_constant='(val)'
249 dbusint64_constant='(val##L)'
250 dbusuint64_constant='(val##UL)'
252 $ac_cv_sizeof_long_long)
253 dbusint64='long long'
254 dbusint64_constant='(val##LL)'
255 dbusuint64_constant='(val##ULL)'
257 $ac_cv_sizeof___int64)
259 dbusint64_constant='(val##i64)'
260 dbusuint64_constant='(val##ui64)'
264 if test -z "$dbusint64" ; then
265 DBUS_INT64_TYPE="no_int64_type_detected"
268 DBUS_UINT64_CONSTANT=
269 AC_MSG_RESULT([none found])
271 DBUS_INT64_TYPE="$dbusint64"
273 DBUS_INT64_CONSTANT="$dbusint64_constant"
274 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
275 AC_MSG_RESULT($DBUS_INT64_TYPE)
278 AC_SUBST(DBUS_INT64_TYPE)
279 AC_SUBST(DBUS_INT64_CONSTANT)
280 AC_SUBST(DBUS_UINT64_CONSTANT)
281 AC_SUBST(DBUS_HAVE_INT64)
286 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
287 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
289 if test x"$GCC" = xyes; then
290 if test "x$enable_ansi" = "xyes"; then
298 AC_MSG_RESULT([i486])
299 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
308 if test x$have_atomic_inc = xyes ; then
309 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
312 #### Various functions
313 AC_CHECK_LIB(socket,socket)
314 AC_CHECK_LIB(nsl,gethostbyname)
316 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
318 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
320 AC_CACHE_CHECK([for posix getpwnam_r],
321 ac_cv_func_posix_getpwnam_r,
327 struct passwd pwd, *pwptr = &pwd;
330 error = getpwnam_r ("", &pwd, buffer,
331 sizeof (buffer), &pwptr);
332 return (error < 0 && errno == ENOSYS)
335 [ac_cv_func_posix_getpwnam_r=yes],
336 [ac_cv_func_posix_getpwnam_r=no])])
337 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
338 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
339 [Have POSIX function getpwnam_r])
341 AC_CACHE_CHECK([for nonposix getpwnam_r],
342 ac_cv_func_nonposix_getpwnam_r,
343 [AC_TRY_LINK([#include <pwd.h>],
346 getpwnam_r ("", &pwd, buffer,
348 [ac_cv_func_nonposix_getpwnam_r=yes],
349 [ac_cv_func_nonposix_getpwnam_r=no])])
350 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
351 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
352 [Have non-POSIX function getpwnam_r])
356 dnl check for socklen_t
357 AC_MSG_CHECKING(whether socklen_t is defined)
359 #include <sys/types.h>
360 #include <sys/socket.h>
365 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
366 AC_MSG_RESULT($dbus_have_socklen_t)
368 if test "x$dbus_have_socklen_t" = "xyes"; then
369 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
372 dnl check for writev header and writev function so we're
373 dnl good to go if HAVE_WRITEV gets defined.
374 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
376 dnl check for flavours of varargs macros (test from GLib)
377 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
379 int a(int p1, int p2, int p3);
380 #define call_a(...) a(1,__VA_ARGS__)
382 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
383 AC_MSG_RESULT($dbus_have_iso_c_varargs)
385 AC_MSG_CHECKING(for GNUC varargs macros)
387 int a(int p1, int p2, int p3);
388 #define call_a(params...) a(1,params)
390 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
391 AC_MSG_RESULT($dbus_have_gnuc_varargs)
393 dnl Output varargs tests
394 if test x$dbus_have_iso_c_varargs = xyes; then
395 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
397 if test x$dbus_have_gnuc_varargs = xyes; then
398 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
401 dnl Check for various credentials.
402 AC_MSG_CHECKING(for struct cmsgcred)
404 #include <sys/types.h>
405 #include <sys/socket.h>
407 struct cmsgcred cred;
410 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
411 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
413 if test x$dbus_have_struct_cmsgcred = xyes; then
414 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
418 #### Abstract sockets
420 AC_MSG_CHECKING(abstract socket namespace)
422 AC_RUN_IFELSE([AC_LANG_PROGRAM(
424 #include <sys/types.h>
428 #include <sys/socket.h>
434 struct sockaddr_un addr;
436 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
440 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
444 memset (&addr, '\0', sizeof (addr));
445 addr.sun_family = AF_UNIX;
446 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
447 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
449 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
451 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
458 [have_abstract_sockets=yes],
459 [have_abstract_sockets=no])
461 AC_MSG_RESULT($have_abstract_sockets)
463 if test x$enable_abstract_sockets = xyes; then
464 if test x$have_abstract_sockets = xno; then
465 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
469 if test x$enable_abstract_sockets = xno; then
470 have_abstract_sockets=no;
473 if test x$have_abstract_sockets = xyes ; then
475 DBUS_PATH_OR_ABSTRACT=abstract
478 DBUS_PATH_OR_ABSTRACT=path
481 AC_DEFINE_UNQUOTED(HAVE_ABSTRACT_SOCKETS, $abstract_sockets, [Have abstract socket namespace])
483 # this is used in addresses to prefer abstract, e.g.
484 # unix:path=/foo or unix:abstract=/foo
485 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
487 #### Sort out XML library
490 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
491 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
494 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
496 # see what we want to use
497 dbus_use_libxml=false
499 if test x$with_xml = xexpat; then
501 if ! $have_expat ; then
502 AC_MSG_ERROR([Explicitly requested expat but expat not found])
504 elif test x$with_xml = xlibxml; then
506 if ! $have_libxml ; then
507 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
510 ### expat is the default because libxml can't currently survive
511 ### our brutal OOM-handling unit test setup.
512 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
513 if $have_expat ; then
516 elif $have_libxml ; then
520 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
524 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
525 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
527 if $dbus_use_expat; then
531 if $dbus_use_libxml; then
532 XML_LIBS=$LIBXML_LIBS
533 XML_CFLAGS=$LIBXML_CFLAGS
536 #### Set up final flags
539 AC_SUBST(DBUS_CLIENT_CFLAGS)
540 AC_SUBST(DBUS_CLIENT_LIBS)
542 DBUS_BUS_CFLAGS=$XML_CFLAGS
543 DBUS_BUS_LIBS=$XML_LIBS
544 AC_SUBST(DBUS_BUS_CFLAGS)
545 AC_SUBST(DBUS_BUS_LIBS)
549 AC_SUBST(DBUS_TEST_CFLAGS)
550 AC_SUBST(DBUS_TEST_LIBS)
553 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
554 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
556 if test x$have_glib = xno ; then
557 AC_MSG_WARN([GLib development libraries not found])
560 if test x$enable_glib = xyes; then
561 if test x$have_glib = xno; then
562 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
566 if test x$enable_glib = xno; then
570 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
571 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
574 AC_SUBST(DBUS_GLIB_CFLAGS)
575 AC_SUBST(DBUS_GLIB_LIBS)
576 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
578 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
579 DBUS_GLIB_TOOL_LIBS=$XML_LIBS
580 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
581 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
584 if test x$have_glib = xno ; then
585 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
588 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0, have_gtk=yes, have_gtk=no)
591 if test x$have_gtk = xno ; then
592 AC_MSG_WARN([GTK+ development libraries not found])
595 if test x$enable_gtk = xyes; then
596 if test x$have_gtk = xno; then
597 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
601 if test x$enable_gtk = xno; then
605 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
608 AC_SUBST(DBUS_GTK_CFLAGS)
609 AC_SUBST(DBUS_GTK_LIBS)
613 AC_MSG_CHECKING([for qglobal.h])
614 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
616 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
618 for dir in "${prefix}/include/qt" "/usr/include/qt-3.1" "/usr/include/qt3" "/usr/include/qt" "/usr/lib/qt/include"; do
619 if test -f "$dir/qglobal.h"; then
621 DBUS_QT_CXXFLAGS="-I$dir"
625 if test x"$have_qt" = x"yes"; then
626 AC_MSG_RESULT([found])
628 AC_MSG_RESULT([not found])
631 dnl linking to kdecore will give us a bit of help from libtool
632 if (! kde-config >& /dev/null); then
635 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
636 if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
639 DBUS_QT_LIBS="$kdelibs/libkdecore.la"
643 if test x$have_qt = xno ; then
644 AC_MSG_WARN([Qt development libraries not found])
647 if test x$enable_qt = xyes; then
648 if test x$have_qt = xno; then
649 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
653 if test x$enable_qt = xno; then
657 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
660 AC_SUBST(DBUS_QT_CXXFLAGS)
661 AC_SUBST(DBUS_QT_LIBS)
666 ## for now enable_x11 just tracks have_x11,
667 ## there's no --enable-x11
668 if test x$no_x = xyes ; then
676 if test x$enable_x11 = xyes ; then
677 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
678 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
679 DBUS_X_CFLAGS="$X_CFLAGS"
685 AC_SUBST(DBUS_X_CFLAGS)
686 AC_SUBST(DBUS_X_LIBS)
690 AC_PATH_PROG(DOXYGEN, doxygen, no)
691 AC_PATH_PROG(DB2HTML, db2html, no)
693 AC_MSG_CHECKING([whether to build documentation])
695 if test x$DOXYGEN = xno -o x$DB2HTML = xno ; then
701 if test x$enable_docs = xauto ; then
702 if test x$have_docs_tools = xno ; then
709 if test x$enable_docs = xyes; then
710 if test x$have_docs_tools = xno; then
711 AC_MSG_ERROR([Building docs explicitly required, but Doxygen or db2html not found])
715 AM_CONDITIONAL(DBUS_DOCS_ENABLED, test x$enable_docs = xyes)
718 #### find the actual value for $prefix that we'll end up with
719 ## (I know this is broken and should be done in the Makefile, but
720 ## that's a major pain and almost nobody actually seems to care)
722 if test "x$prefix" = "xNONE"; then
723 REAL_PREFIX=$ac_default_prefix
728 #### Have to go $localstatedir->$prefix/var->/usr/local/var
729 #### someone please fix this a better way...
730 LOCALSTATEDIR_TMP="$localstatedir"
733 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
735 AC_SUBST(EXPANDED_LOCALSTATEDIR)
737 SYSCONFDIR_TMP="$sysconfdir"
740 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
742 AC_SUBST(EXPANDED_SYSCONFDIR)
747 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
749 AC_SUBST(EXPANDED_BINDIR)
751 old_exec_prefix=${exec_prefix}
752 test "x$exec_prefix" = xNONE && eval exec_prefix=${prefix}
753 eval EXPANDED_LIBDIR=${libdir}
754 exec_prefix=${old_exec_prefix}
755 AC_SUBST(EXPANDED_LIBDIR)
757 #### Check our operating system
758 operating_system=unknown
759 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
760 operating_system=redhat
763 #### Sort out init scripts
765 if test x$with_init_scripts = x; then
766 if test xredhat = x$operating_system ; then
767 with_init_scripts=redhat
769 with_init_scripts=none
773 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
776 ##### Set up location for system bus socket
777 if ! test -z "$with_system_socket"; then
778 DBUS_SYSTEM_SOCKET=$with_system_socket
780 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
783 AC_SUBST(DBUS_SYSTEM_SOCKET)
785 #### Set up the pid file
786 if ! test -z "$with_system_pid_file"; then
787 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
788 elif test x$operating_system = xredhat ; then
789 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
791 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
794 AC_SUBST(DBUS_SYSTEM_PID_FILE)
796 #### Tell tests where to find certain stuff in builddir
797 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
799 AC_DEFUN(TEST_PATH, [
800 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
801 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
802 [Full path to test file test/$2 in builddir])
806 TEST_PATH(SERVICE_DIR, data/valid-service-files)
807 TEST_PATH(SERVICE_BINARY, test-service)
808 TEST_PATH(EXIT_BINARY, test-exit)
809 TEST_PATH(SEGFAULT_BINARY, test-segfault)
810 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
812 #### Find socket directories
813 if ! test -z "$TMPDIR" ; then
814 DEFAULT_SOCKET_DIR=$TMPDIR
815 elif ! test -z "$TEMP" ; then
816 DEFAULT_SOCKET_DIR=$TEMP
817 elif ! test -z "$TMP" ; then
818 DEFAULT_SOCKET_DIR=$TMP
820 DEFAULT_SOCKET_DIR=/tmp
823 if ! test -z "$with_test_socket_dir" ; then
824 TEST_SOCKET_DIR="$with_test_socket_dir"
826 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
828 AC_SUBST(TEST_SOCKET_DIR)
829 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
831 if ! test -z "$with_session_socket_dir" ; then
832 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
834 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
836 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
837 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
839 # Detect if we can build Python bindings (need python, python headers, and pyrex)
840 if test x$enable_python = xno; then
843 AC_MSG_NOTICE([Checking to see if we can build Python bindings])
847 if test -z "$PYTHON" ; then
848 AC_MSG_WARN([Python not found])
850 AC_CHECK_PROGS(PYREX, pyrexc)
852 if test -z "$PYREX" ; then
858 AM_CHECK_PYTHON_HEADERS(have_python_headers=yes,have_python_headers=no)
860 if test x$have_pyrex = xyes -a x$have_python_headers = xyes ; then
865 if test x$have_python = xno ; then
866 if test x$enable_python = xyes ; then
867 AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings])
869 AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings])
874 AM_CONDITIONAL(HAVE_PYTHON, test x$have_python = xyes)
879 dbus/dbus-arch-deps.h
891 gcj/org/freedesktop/Makefile
892 gcj/org/freedesktop/dbus/Makefile
901 test/data/valid-config-files/debug-allow-all.conf
902 test/data/valid-config-files/debug-allow-all-sha1.conf
903 test/data/valid-service-files/debug-echo.service
904 test/data/valid-service-files/debug-segfault.service
907 ### FIXME it's bizarre that have_qt and have_glib are used
908 ### instead of enable_ - should fix things so that enable
909 ### is always whether it's enabled, and have is always whether
912 dnl ==========================================================================
918 source code location: ${srcdir}
921 cppflags: ${CPPFLAGS}
922 cxxflags: ${CXXFLAGS}
923 64-bit int: ${DBUS_INT64_TYPE}
927 if test x$enable_gcj = xyes ; then
930 gcjflags: ${GCJFLAGS}"
933 " gcj: (not enabled)"
936 if test x$enable_mono = xyes ; then
939 mcsflags: ${MCSFLAGS}
948 Maintainer mode: ${USE_MAINTAINER_MODE}
949 gcc coverage profiling: ${enable_gcov}
950 Building unit tests: ${enable_tests}
951 Building verbose mode: ${enable_verbose_mode}
952 Building assertions: ${enable_asserts}
953 Building checks: ${enable_checks}
954 Building Qt bindings: ${have_qt}
955 Building GLib bindings: ${have_glib}
956 Building Python bindings: ${have_python}
957 Building GTK+ tools: ${have_gtk}
958 Building X11 code: ${enable_x11}
959 Building documentation: ${enable_docs}
960 Using XML parser: ${with_xml}
961 Init scripts style: ${with_init_scripts}
962 Abstract socket names: ${have_abstract_sockets}
963 System bus socket: ${DBUS_SYSTEM_SOCKET}
964 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
965 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
966 'make check' socket dir: ${TEST_SOCKET_DIR}
969 if test x$enable_tests = xyes; then
970 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
972 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
973 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)"
975 if test x$enable_gcov = xyes; then
976 echo "NOTE: building with coverage profiling is definitely for developers only."
978 if test x$enable_verbose_mode = xyes; then
979 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
981 if test x$enable_asserts = xyes; then
982 echo "NOTE: building with assertions increases library size and decreases performance."
984 if test x$enable_checks = xno; then
985 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."