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)
39 AC_ARG_WITH(xml, [ --with-xml=[libxml/expat] XML library to use])
40 AC_ARG_WITH(init-scripts, [ --with-init-scripts=[redhat] Style of init scripts to install])
41 AC_ARG_WITH(session-socket-dir, [ --with-session-socket-dir=[dirname] Where to put sockets for the per-login-session message bus])
42 AC_ARG_WITH(test-socket-dir, [ --with-test-socket-dir=[dirname] Where to put sockets for make check])
43 AC_ARG_WITH(system-pid-file, [ --with-system-pid-file=[pidfile] PID file for systemwide daemon])
44 AC_ARG_WITH(system-socket, [ --with-system-socket=[filename] UNIX domain socket for systemwide daemon])
46 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
47 dnl and also some stuff in the test/ subdir
48 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
49 if test x$enable_tests = xyes; then
50 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
53 if test x$enable_verbose_mode = xyes; then
54 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
56 if test x$enable_asserts = xno; then
57 AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
58 AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
60 if test x$enable_checks = xno; then
61 AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
62 AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
65 #### gcc warning flags
67 if test "x$GCC" = "xyes"; then
70 *[\ \ ]-Wall[\ \ ]*) ;;
71 *) CFLAGS="$CFLAGS -Wall" ;;
75 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
76 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
80 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
81 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
85 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
86 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
90 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
91 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
95 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
96 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
100 *[\ \ ]-Wcast-align[\ \ ]*) ;;
101 *) CFLAGS="$CFLAGS -Wcast-align" ;;
105 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
106 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
109 if test "x$enable_ansi" = "xyes"; then
111 *[\ \ ]-ansi[\ \ ]*) ;;
112 *) CFLAGS="$CFLAGS -ansi" ;;
116 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
117 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
121 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
122 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
126 *[\ \ ]-pedantic[\ \ ]*) ;;
127 *) CFLAGS="$CFLAGS -pedantic" ;;
130 if test x$enable_gcov = xyes; then
132 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
133 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
136 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
137 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
140 ## remove optimization
141 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
145 if test x$enable_gcov = xyes; then
146 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
150 #### can't use AM_PROG_GCJ since it fails fatally if no gcj found
151 AC_CHECK_PROGS(GCJ, gcj, gcj)
152 if test -z "$GCJ" ; then
155 # Needs to be here so libtool wont get confused
159 if test "x${GCJFLAGS-unset}" = xunset; then
160 GCJFLAGS="-g -O2 -Wall"
165 if test x$enable_gcj = xauto ; then
166 if test x$have_gcj = xno ; then
173 if test x$enable_gcj = xyes; then
174 if test x$have_gcj = xno ; then
175 AC_MSG_ERROR([Building gcj explicitly required, but gcj not found])
179 AM_CONDITIONAL(DBUS_USE_GCJ, test x$enable_gcj = xyes)
184 AC_CHECK_TOOL(MCS, mcs, mcs)
185 if test -z "$MCS" ; then
189 if test "x${MCSFLAGS-unset}" = xunset; then
190 MCSFLAGS="" ### put default MCSFLAGS here
195 if test x$enable_mono = xauto ; then
196 if test x$have_mcs = xno ; then
203 if test x$enable_mono = xyes; then
204 if test x$have_mcs = xno ; then
205 AC_MSG_ERROR([Building Mono bindings explicitly required, but mcs compiler not found])
209 AM_CONDITIONAL(DBUS_USE_MCS, test x$enable_mono = xyes)
212 # let ourselves use our own unstable API
213 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
214 # compress spaces in flags
215 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
216 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
217 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
220 if test x$enable_gcov = xyes; then
221 ## so that config.h changes when you toggle gcov support
222 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
224 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
228 AC_CHECK_SIZEOF(char)
229 AC_CHECK_SIZEOF(short)
230 AC_CHECK_SIZEOF(long)
232 AC_CHECK_SIZEOF(void *)
233 AC_CHECK_SIZEOF(long long)
234 AC_CHECK_SIZEOF(__int64)
236 ### See what our 64 bit type is called
237 AC_MSG_CHECKING([64-bit integer type])
242 dbusint64_constant='(val)'
243 dbusuint64_constant='(val)'
247 dbusint64_constant='(val##L)'
248 dbusuint64_constant='(val##UL)'
250 $ac_cv_sizeof_long_long)
251 dbusint64='long long'
252 dbusint64_constant='(val##LL)'
253 dbusuint64_constant='(val##ULL)'
255 $ac_cv_sizeof___int64)
257 dbusint64_constant='(val##i64)'
258 dbusuint64_constant='(val##ui64)'
262 if test -z "$dbusint64" ; then
263 DBUS_INT64_TYPE="no_int64_type_detected"
266 DBUS_UINT64_CONSTANT=
267 AC_MSG_RESULT([none found])
269 DBUS_INT64_TYPE="$dbusint64"
271 DBUS_INT64_CONSTANT="$dbusint64_constant"
272 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
273 AC_MSG_RESULT($DBUS_INT64_TYPE)
276 AC_SUBST(DBUS_INT64_TYPE)
277 AC_SUBST(DBUS_INT64_CONSTANT)
278 AC_SUBST(DBUS_UINT64_CONSTANT)
279 AC_SUBST(DBUS_HAVE_INT64)
284 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
285 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
287 if test x"$GCC" = xyes; then
288 if test "x$enable_ansi" = "xyes"; then
296 AC_MSG_RESULT([i486])
297 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
306 if test x$have_atomic_inc = xyes ; then
307 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
310 #### Various functions
311 AC_CHECK_LIB(socket,socket)
312 AC_CHECK_LIB(nsl,gethostbyname)
314 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
316 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
318 AC_CACHE_CHECK([for posix getpwnam_r],
319 ac_cv_func_posix_getpwnam_r,
325 struct passwd pwd, *pwptr = &pwd;
328 error = getpwnam_r ("", &pwd, buffer,
329 sizeof (buffer), &pwptr);
330 return (error < 0 && errno == ENOSYS)
333 [ac_cv_func_posix_getpwnam_r=yes],
334 [ac_cv_func_posix_getpwnam_r=no])])
335 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
336 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
337 [Have POSIX function getpwnam_r])
339 AC_CACHE_CHECK([for nonposix getpwnam_r],
340 ac_cv_func_nonposix_getpwnam_r,
341 [AC_TRY_LINK([#include <pwd.h>],
344 getpwnam_r ("", &pwd, buffer,
346 [ac_cv_func_nonposix_getpwnam_r=yes],
347 [ac_cv_func_nonposix_getpwnam_r=no])])
348 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
349 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
350 [Have non-POSIX function getpwnam_r])
354 dnl check for socklen_t
355 AC_MSG_CHECKING(whether socklen_t is defined)
357 #include <sys/types.h>
358 #include <sys/socket.h>
363 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
364 AC_MSG_RESULT($dbus_have_socklen_t)
366 if test "x$dbus_have_socklen_t" = "xyes"; then
367 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
370 dnl check for writev header and writev function so we're
371 dnl good to go if HAVE_WRITEV gets defined.
372 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
374 dnl check for flavours of varargs macros (test from GLib)
375 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
377 int a(int p1, int p2, int p3);
378 #define call_a(...) a(1,__VA_ARGS__)
380 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
381 AC_MSG_RESULT($dbus_have_iso_c_varargs)
383 AC_MSG_CHECKING(for GNUC varargs macros)
385 int a(int p1, int p2, int p3);
386 #define call_a(params...) a(1,params)
388 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
389 AC_MSG_RESULT($dbus_have_gnuc_varargs)
391 dnl Output varargs tests
392 if test x$dbus_have_iso_c_varargs = xyes; then
393 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
395 if test x$dbus_have_gnuc_varargs = xyes; then
396 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
399 dnl Check for various credentials.
400 AC_MSG_CHECKING(for struct cmsgcred)
402 #include <sys/types.h>
403 #include <sys/socket.h>
405 struct cmsgcred cred;
408 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
409 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
411 if test x$dbus_have_struct_cmsgcred = xyes; then
412 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
416 #### Abstract sockets
418 AC_MSG_CHECKING(abstract socket namespace)
420 AC_RUN_IFELSE([AC_LANG_PROGRAM(
422 #include <sys/types.h>
426 #include <sys/socket.h>
432 struct sockaddr_un addr;
434 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
438 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
442 memset (&addr, '\0', sizeof (addr));
443 addr.sun_family = AF_UNIX;
444 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
445 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
447 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
449 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
456 [have_abstract_sockets=yes],
457 [have_abstract_sockets=no])
459 AC_MSG_RESULT($have_abstract_sockets)
461 if test x$enable_abstract_sockets = xyes; then
462 if test x$have_abstract_sockets = xno; then
463 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
467 if test x$enable_abstract_sockets = xno; then
468 have_abstract_sockets=no;
471 if test x$have_abstract_sockets = xyes ; then
473 DBUS_PATH_OR_ABSTRACT=abstract
476 DBUS_PATH_OR_ABSTRACT=path
479 AC_DEFINE_UNQUOTED(HAVE_ABSTRACT_SOCKETS, $abstract_sockets, [Have abstract socket namespace])
481 # this is used in addresses to prefer abstract, e.g.
482 # unix:path=/foo or unix:abstract=/foo
483 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
485 #### Sort out XML library
488 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
489 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
492 PKG_CHECK_MODULES(LIBXML, libxml-2.0, have_libxml=true, have_libxml=false)
494 # see what we want to use
495 dbus_use_libxml=false
497 if test x$with_xml = xexpat; then
499 if ! $have_expat ; then
500 AC_MSG_ERROR([Explicitly requested expat but expat not found])
502 elif test x$with_xml = xlibxml; then
504 if ! $have_libxml ; then
505 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
508 ### expat is the default because libxml can't currently survive
509 ### our brutal OOM-handling unit test setup.
510 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
511 if $have_expat ; then
514 elif $have_libxml ; then
518 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
522 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
523 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
525 if $dbus_use_expat; then
529 if $dbus_use_libxml; then
530 XML_LIBS=$LIBXML_LIBS
531 XML_CFLAGS=$LIBXML_CFLAGS
534 #### Set up final flags
537 AC_SUBST(DBUS_CLIENT_CFLAGS)
538 AC_SUBST(DBUS_CLIENT_LIBS)
540 DBUS_BUS_CFLAGS=$XML_CFLAGS
541 DBUS_BUS_LIBS=$XML_LIBS
542 AC_SUBST(DBUS_BUS_CFLAGS)
543 AC_SUBST(DBUS_BUS_LIBS)
547 AC_SUBST(DBUS_TEST_CFLAGS)
548 AC_SUBST(DBUS_TEST_LIBS)
551 PKG_CHECK_MODULES(DBUS_GLIB, gobject-2.0, have_glib=yes, have_glib=no)
552 PKG_CHECK_MODULES(DBUS_GLIB_THREADS, glib-2.0 gthread-2.0, have_glib_threads=yes, have_glib_threads=no)
554 if test x$have_glib = xno ; then
555 AC_MSG_WARN([GLib development libraries not found])
558 if test x$enable_glib = xyes; then
559 if test x$have_glib = xno; then
560 AC_MSG_ERROR([GLib explicitly required, and GLib development libraries not found])
564 if test x$enable_glib = xno; then
568 AM_CONDITIONAL(HAVE_GLIB, test x$have_glib = xyes)
569 AM_CONDITIONAL(HAVE_GLIB_THREADS, test x$have_glib_threads = xyes)
572 AC_SUBST(DBUS_GLIB_CFLAGS)
573 AC_SUBST(DBUS_GLIB_LIBS)
574 AC_SUBST(DBUS_GLIB_THREADS_LIBS)
576 DBUS_GLIB_TOOL_CFLAGS=$XML_CFLAGS
577 DBUS_GLIB_TOOL_LIBS=$XML_LIBS
578 AC_SUBST(DBUS_GLIB_TOOL_CFLAGS)
579 AC_SUBST(DBUS_GLIB_TOOL_LIBS)
582 if test x$have_glib = xno ; then
583 AC_MSG_WARN([Can't use GTK+ since GLib not enabled])
586 PKG_CHECK_MODULES(DBUS_GTK, gtk+-2.0, have_gtk=yes, have_gtk=no)
589 if test x$have_gtk = xno ; then
590 AC_MSG_WARN([GTK+ development libraries not found])
593 if test x$enable_gtk = xyes; then
594 if test x$have_gtk = xno; then
595 AC_MSG_ERROR([GTK+ explicitly required, and GTK+ development libraries not found])
599 if test x$enable_gtk = xno; then
603 AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
606 AC_SUBST(DBUS_GTK_CFLAGS)
607 AC_SUBST(DBUS_GTK_LIBS)
611 AC_MSG_CHECKING([for qglobal.h])
612 if test -n "$QTDIR" -a -f "$QTDIR/include/qglobal.h"; then
614 DBUS_QT_CXXFLAGS="-I$QTDIR/include"
616 for dir in "${prefix}/include/qt" "/usr/include/qt-3.1" "/usr/include/qt3" "/usr/include/qt" "/usr/lib/qt/include"; do
617 if test -f "$dir/qglobal.h"; then
619 DBUS_QT_CXXFLAGS="-I$dir"
623 if test x"$have_qt" = x"yes"; then
624 AC_MSG_RESULT([found])
626 AC_MSG_RESULT([not found])
629 dnl linking to kdecore will give us a bit of help from libtool
630 if (! kde-config >& /dev/null); then
633 kdelibs=`kde-config --install lib --expandvars 2>/dev/null`
634 if test -z $kdelibs -o ! -f $kdelibs/libkdecore.la; then
637 DBUS_QT_LIBS="$kdelibs/libkdecore.la"
641 if test x$have_qt = xno ; then
642 AC_MSG_WARN([Qt development libraries not found])
645 if test x$enable_qt = xyes; then
646 if test x$have_qt = xno; then
647 AC_MSG_ERROR([Qt integration explicitly required, and Qt libraries not found])
651 if test x$enable_qt = xno; then
655 AM_CONDITIONAL(HAVE_QT, test x$have_qt = xyes)
658 AC_SUBST(DBUS_QT_CXXFLAGS)
659 AC_SUBST(DBUS_QT_LIBS)
664 ## for now enable_x11 just tracks have_x11,
665 ## there's no --enable-x11
666 if test x$no_x = xyes ; then
674 if test x$enable_x11 = xyes ; then
675 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
676 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
677 DBUS_X_CFLAGS="$X_CFLAGS"
683 AC_SUBST(DBUS_X_CFLAGS)
684 AC_SUBST(DBUS_X_LIBS)
688 AC_PATH_PROG(DOXYGEN, doxygen, no)
689 AC_PATH_PROG(DB2HTML, db2html, no)
691 AC_MSG_CHECKING([whether to build documentation])
693 if test x$DOXYGEN = xno -o x$DB2HTML = xno ; then
699 if test x$enable_docs = xauto ; then
700 if test x$have_docs_tools = xno ; then
707 if test x$enable_docs = xyes; then
708 if test x$have_docs_tools = xno; then
709 AC_MSG_ERROR([Building docs explicitly required, but Doxygen or db2html not found])
713 AM_CONDITIONAL(DBUS_DOCS_ENABLED, test x$enable_docs = xyes)
716 #### find the actual value for $prefix that we'll end up with
717 ## (I know this is broken and should be done in the Makefile, but
718 ## that's a major pain and almost nobody actually seems to care)
720 if test "x$prefix" = "xNONE"; then
721 REAL_PREFIX=$ac_default_prefix
726 #### Have to go $localstatedir->$prefix/var->/usr/local/var
727 #### someone please fix this a better way...
728 LOCALSTATEDIR_TMP="$localstatedir"
731 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
733 AC_SUBST(EXPANDED_LOCALSTATEDIR)
735 SYSCONFDIR_TMP="$sysconfdir"
738 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
740 AC_SUBST(EXPANDED_SYSCONFDIR)
745 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
747 AC_SUBST(EXPANDED_BINDIR)
749 old_exec_prefix=${exec_prefix}
750 test "x$exec_prefix" = xNONE && eval exec_prefix=${prefix}
751 eval EXPANDED_LIBDIR=${libdir}
752 exec_prefix=${old_exec_prefix}
753 AC_SUBST(EXPANDED_LIBDIR)
755 #### Check our operating system
756 operating_system=unknown
757 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
758 operating_system=redhat
761 #### Sort out init scripts
763 if test x$with_init_scripts = x; then
764 if test xredhat = x$operating_system ; then
765 with_init_scripts=redhat
767 with_init_scripts=none
771 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
774 ##### Set up location for system bus socket
775 if ! test -z "$with_system_socket"; then
776 DBUS_SYSTEM_SOCKET=$with_system_socket
778 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
781 AC_SUBST(DBUS_SYSTEM_SOCKET)
783 #### Set up the pid file
784 if ! test -z "$with_system_pid_file"; then
785 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
786 elif test x$operating_system = xredhat ; then
787 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
789 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
792 AC_SUBST(DBUS_SYSTEM_PID_FILE)
794 #### Tell tests where to find certain stuff in builddir
795 ABSOLUTE_TOP_BUILDDIR=`cd ${ac_top_builddir}. && pwd`
797 AC_DEFUN(TEST_PATH, [
798 TEST_$1=${ABSOLUTE_TOP_BUILDDIR}/test/$2
799 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
800 [Full path to test file test/$2 in builddir])
804 TEST_PATH(SERVICE_DIR, data/valid-service-files)
805 TEST_PATH(SERVICE_BINARY, test-service)
806 TEST_PATH(EXIT_BINARY, test-exit)
807 TEST_PATH(SEGFAULT_BINARY, test-segfault)
808 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
810 #### Find socket directories
811 if ! test -z "$TMPDIR" ; then
812 DEFAULT_SOCKET_DIR=$TMPDIR
813 elif ! test -z "$TEMP" ; then
814 DEFAULT_SOCKET_DIR=$TEMP
815 elif ! test -z "$TMP" ; then
816 DEFAULT_SOCKET_DIR=$TMP
818 DEFAULT_SOCKET_DIR=/tmp
821 if ! test -z "$with_test_socket_dir" ; then
822 TEST_SOCKET_DIR="$with_test_socket_dir"
824 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
826 AC_SUBST(TEST_SOCKET_DIR)
827 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
829 if ! test -z "$with_session_socket_dir" ; then
830 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
832 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
834 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
835 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
841 dbus/dbus-arch-deps.h
852 gcj/org/freedesktop/Makefile
853 gcj/org/freedesktop/dbus/Makefile
862 test/data/valid-config-files/debug-allow-all.conf
863 test/data/valid-config-files/debug-allow-all-sha1.conf
864 test/data/valid-service-files/debug-echo.service
865 test/data/valid-service-files/debug-segfault.service
868 ### FIXME it's bizarre that have_qt and have_glib are used
869 ### instead of enable_ - should fix things so that enable
870 ### is always whether it's enabled, and have is always whether
873 dnl ==========================================================================
879 source code location: ${srcdir}
882 cppflags: ${CPPFLAGS}
883 cxxflags: ${CXXFLAGS}
884 64-bit int: ${DBUS_INT64_TYPE}
888 if test x$enable_gcj = xyes ; then
891 gcjflags: ${GCJFLAGS}"
894 " gcj: (not enabled)"
897 if test x$enable_mono = xyes ; then
900 mcsflags: ${MCSFLAGS}
909 Maintainer mode: ${USE_MAINTAINER_MODE}
910 gcc coverage profiling: ${enable_gcov}
911 Building unit tests: ${enable_tests}
912 Building verbose mode: ${enable_verbose_mode}
913 Building assertions: ${enable_asserts}
914 Building checks: ${enable_checks}
915 Building Qt bindings: ${have_qt}
916 Building GLib bindings: ${have_glib}
917 Building GTK+ tools: ${have_gtk}
918 Building X11 code: ${enable_x11}
919 Building documentation: ${enable_docs}
920 Using XML parser: ${with_xml}
921 Init scripts style: ${with_init_scripts}
922 Abstract socket names: ${have_abstract_sockets}
923 System bus socket: ${DBUS_SYSTEM_SOCKET}
924 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
925 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
926 'make check' socket dir: ${TEST_SOCKET_DIR}
929 if test x$enable_tests = xyes; then
930 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
932 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
933 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)"
935 if test x$enable_gcov = xyes; then
936 echo "NOTE: building with coverage profiling is definitely for developers only."
938 if test x$enable_verbose_mode = xyes; then
939 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
941 if test x$enable_asserts = xyes; then
942 echo "NOTE: building with assertions increases library size and decreases performance."
944 if test x$enable_checks = xno; then
945 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."