8 AM_INIT_AUTOMAKE(dbus, 0.93)
10 AM_CONFIG_HEADER(config.h)
13 ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
15 GETTEXT_PACKAGE=dbus-1
16 AC_SUBST(GETTEXT_PACKAGE)
17 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain])
19 ## must come before we use the $USE_MAINTAINER_MODE variable later
22 # libtool versioning - this applies to libdbus
24 # See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
27 ## increment if the interface has additions, changes, removals.
30 ## increment any time the source changes; set to
31 ## 0 if you increment CURRENT
34 ## increment if any interfaces have been added; set to 0
35 ## if any interfaces have been changed or removed. removal has
36 ## precedence over adding, so set to 0 if both happened.
49 AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
50 AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no)
51 AC_ARG_ENABLE(verbose-mode, AS_HELP_STRING([--enable-verbose-mode],[support verbose debug mode]),enable_verbose_mode=$enableval,enable_verbose_mode=$USE_MAINTAINER_MODE)
52 AC_ARG_ENABLE(asserts, AS_HELP_STRING([--enable-asserts],[include assertion checks]),enable_asserts=$enableval,enable_asserts=$USE_MAINTAINER_MODE)
53 AC_ARG_ENABLE(checks, AS_HELP_STRING([--enable-checks],[include sanity checks on public API]),enable_checks=$enableval,enable_checks=yes)
54 AC_ARG_ENABLE(xml-docs, AS_HELP_STRING([--enable-xml-docs],[build XML documentation (requires xmlto)]),enable_xml_docs=$enableval,enable_xml_docs=auto)
55 AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGEN documentation (requires Doxygen)]),enable_doxygen_docs=$enableval,enable_doxygen_docs=auto)
56 AC_ARG_ENABLE(gcov, AS_HELP_STRING([--enable-gcov],[compile with coverage profiling instrumentation (gcc only)]),enable_gcov=$enableval,enable_gcov=no)
57 AC_ARG_ENABLE(abstract-sockets, AS_HELP_STRING([--enable-abstract-sockets],[use abstract socket namespace (linux only)]),enable_abstract_sockets=$enableval,enable_abstract_sockets=auto)
58 AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto)
59 AC_ARG_ENABLE(dnotify, AS_HELP_STRING([--enable-dnotify],[build with dnotify support (linux only)]),enable_dnotify=$enableval,enable_dnotify=auto)
60 AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
61 AC_ARG_ENABLE(console-owner-file, AS_HELP_STRING([--enable-console-owner-file],[enable console owner file]),enable_console_owner_file=$enableval,enable_console_owner_file=auto)
63 AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use]))
64 AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
65 AC_ARG_WITH(session-socket-dir, AS_HELP_STRING([--with-session-socket-dir=[dirname]],[Where to put sockets for the per-login-session message bus]))
66 AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))
67 AC_ARG_WITH(system-pid-file, AS_HELP_STRING([--with-system-pid-file=[pidfile]],[PID file for systemwide daemon]))
68 AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNIX domain socket for systemwide daemon]))
69 AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip]))
70 AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
71 AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
72 AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
75 dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
76 dnl and also some stuff in the test/ subdir
77 AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
78 if test x$enable_tests = xyes; then
79 AC_DEFINE(DBUS_BUILD_TESTS,1,[Build test code])
82 if test x$enable_verbose_mode = xyes; then
83 AC_DEFINE(DBUS_ENABLE_VERBOSE_MODE,1,[Support a verbose mode])
85 if test x$enable_asserts = xno; then
86 AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking])
87 AC_DEFINE(G_DISABLE_ASSERT,1,[Disable GLib assertion macros])
89 if test x$enable_checks = xno; then
90 AC_DEFINE(DBUS_DISABLE_CHECKS,1,[Disable public API sanity checking])
91 AC_DEFINE(G_DISABLE_CHECKS,1,[Disable GLib public API sanity checking])
94 #### gcc warning flags
97 AC_MSG_CHECKING(whether $CC supports "$@")
100 $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
102 rm -f ${Cfile}.c ${Cfile}.o
104 0) AC_MSG_RESULT(yes);;
105 *) AC_MSG_RESULT(no);;
110 if test "x$GCC" = "xyes"; then
113 *[\ \ ]-Wall[\ \ ]*) ;;
114 *) CFLAGS="$CFLAGS -Wall" ;;
118 *[\ \ ]-Wchar-subscripts[\ \ ]*) ;;
119 *) CFLAGS="$CFLAGS -Wchar-subscripts" ;;
123 *[\ \ ]-Wmissing-declarations[\ \ ]*) ;;
124 *) CFLAGS="$CFLAGS -Wmissing-declarations" ;;
128 *[\ \ ]-Wmissing-prototypes[\ \ ]*) ;;
129 *) CFLAGS="$CFLAGS -Wmissing-prototypes" ;;
133 *[\ \ ]-Wnested-externs[\ \ ]*) ;;
134 *) CFLAGS="$CFLAGS -Wnested-externs" ;;
138 *[\ \ ]-Wpointer-arith[\ \ ]*) ;;
139 *) CFLAGS="$CFLAGS -Wpointer-arith" ;;
143 *[\ \ ]-Wcast-align[\ \ ]*) ;;
144 *) CFLAGS="$CFLAGS -Wcast-align" ;;
148 *[\ \ ]-Wfloat-equal[\ \ ]*) ;;
149 *) if cc_supports_flag -Wfloat-equals; then
150 CFLAGS="$CFLAGS -Wfloat-equal"
156 *[\ \ ]-Wsign-compare[\ \ ]*) ;;
157 *) CFLAGS="$CFLAGS -Wsign-compare" ;;
161 *[\ \ ]-Wdeclaration-after-statement[\ \ ]*) ;;
162 *) if cc_supports_flag -Wdeclaration-after-statement; then
163 CFLAGS="$CFLAGS -Wdeclaration-after-statement"
169 *[\ \ ]-fno-common[\ \ ]*) ;;
170 *) if cc_supports_flag -fno-common; then
171 CFLAGS="$CFLAGS -fno-common"
176 if test "x$enable_ansi" = "xyes"; then
178 *[\ \ ]-ansi[\ \ ]*) ;;
179 *) CFLAGS="$CFLAGS -ansi" ;;
183 *[\ \ ]-D_POSIX_C_SOURCE*) ;;
184 *) CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=199309L" ;;
188 *[\ \ ]-D_BSD_SOURCE[\ \ ]*) ;;
189 *) CFLAGS="$CFLAGS -D_BSD_SOURCE" ;;
193 *[\ \ ]-pedantic[\ \ ]*) ;;
194 *) CFLAGS="$CFLAGS -pedantic" ;;
197 if test x$enable_gcov = xyes; then
199 *[\ \ ]-fprofile-arcs[\ \ ]*) ;;
200 *) CFLAGS="$CFLAGS -fprofile-arcs" ;;
203 *[\ \ ]-ftest-coverage[\ \ ]*) ;;
204 *) CFLAGS="$CFLAGS -ftest-coverage" ;;
207 ## remove optimization
208 CFLAGS=`echo "$CFLAGS" | sed -e 's/-O[0-9]*//g'`
212 if test x$enable_gcov = xyes; then
213 AC_MSG_ERROR([--enable-gcov can only be used with gcc])
220 # let ourselves use our own unstable API
221 CPPFLAGS="-DDBUS_API_SUBJECT_TO_CHANGE=1 $CPPFLAGS"
222 # compress spaces in flags
223 CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
224 CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
225 CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
228 if test x$enable_gcov = xyes; then
229 ## so that config.h changes when you toggle gcov support
230 AC_DEFINE_UNQUOTED(DBUS_GCOV_ENABLED, 1, [Defined if gcov is enabled to force a rebuild due to config.h changing])
232 AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
234 AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
236 if test x$have_gcc33_gcov = xyes ; then
237 AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
239 AC_MSG_RESULT($have_gcc33_gcov)
241 AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
245 AC_CHECK_SIZEOF(char)
246 AC_CHECK_SIZEOF(short)
247 AC_CHECK_SIZEOF(long)
249 AC_CHECK_SIZEOF(void *)
250 AC_CHECK_SIZEOF(long long)
251 AC_CHECK_SIZEOF(__int64)
253 ### See what our 64 bit type is called
254 AC_MSG_CHECKING([64-bit integer type])
259 dbusint64_constant='(val)'
260 dbusuint64_constant='(val)'
264 dbusint64_constant='(val##L)'
265 dbusuint64_constant='(val##UL)'
267 $ac_cv_sizeof_long_long)
268 dbusint64='long long'
269 dbusint64_constant='(val##LL)'
270 dbusuint64_constant='(val##ULL)'
272 $ac_cv_sizeof___int64)
274 dbusint64_constant='(val##i64)'
275 dbusuint64_constant='(val##ui64)'
279 if test -z "$dbusint64" ; then
280 DBUS_INT64_TYPE="no_int64_type_detected"
283 DBUS_UINT64_CONSTANT=
284 AC_MSG_RESULT([none found])
286 DBUS_INT64_TYPE="$dbusint64"
288 DBUS_INT64_CONSTANT="$dbusint64_constant"
289 DBUS_UINT64_CONSTANT="$dbusuint64_constant"
290 AC_MSG_RESULT($DBUS_INT64_TYPE)
293 AC_SUBST(DBUS_INT64_TYPE)
294 AC_SUBST(DBUS_INT64_CONSTANT)
295 AC_SUBST(DBUS_UINT64_CONSTANT)
296 AC_SUBST(DBUS_HAVE_INT64)
298 ### see what 32-bit int is called
299 AC_MSG_CHECKING([32-bit integer type])
313 if test -z "$dbusint32" ; then
314 DBUS_INT32_TYPE="no_int32_type_detected"
315 AC_MSG_ERROR([No 32-bit integer type found])
317 DBUS_INT32_TYPE="$dbusint32"
318 AC_MSG_RESULT($DBUS_INT32_TYPE)
321 AC_SUBST(DBUS_INT32_TYPE)
323 ### see what 16-bit int is called
324 AC_MSG_CHECKING([16-bit integer type])
335 if test -z "$dbusint16" ; then
336 DBUS_INT16_TYPE="no_int16_type_detected"
337 AC_MSG_ERROR([No 16-bit integer type found])
339 DBUS_INT16_TYPE="$dbusint16"
340 AC_MSG_RESULT($DBUS_INT16_TYPE)
343 AC_SUBST(DBUS_INT16_TYPE)
348 # check at compile-time, so that it is possible to build universal
349 # (with multiple architectures at once on the compile line)
350 AH_VERBATIM([WORDS_BIGENDIAN_DARWIN], [
351 /* Use the compiler-provided endianness defines to allow universal compiling. */
352 #if defined(__BIG_ENDIAN__)
353 #define WORDS_BIGENDIAN 1
362 dnl **********************************
363 dnl *** va_copy checks (from GLib) ***
364 dnl **********************************
365 dnl we currently check for all three va_copy possibilities, so we get
366 dnl all results in config.log for bug reports.
367 AC_CACHE_CHECK([for an implementation of va_copy()],dbus_cv_va_copy,[
368 AC_LINK_IFELSE([#include <stdarg.h>
369 void f (int i, ...) {
370 va_list args1, args2;
372 va_copy (args2, args1);
373 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
375 va_end (args1); va_end (args2);
381 [dbus_cv_va_copy=yes],
382 [dbus_cv_va_copy=no])
384 AC_CACHE_CHECK([for an implementation of __va_copy()],dbus_cv___va_copy,[
385 AC_LINK_IFELSE([#include <stdarg.h>
386 void f (int i, ...) {
387 va_list args1, args2;
389 __va_copy (args2, args1);
390 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
392 va_end (args1); va_end (args2);
398 [dbus_cv___va_copy=yes],
399 [dbus_cv___va_copy=no])
402 if test "x$dbus_cv_va_copy" = "xyes"; then
403 dbus_va_copy_func=va_copy
404 else if test "x$dbus_cv___va_copy" = "xyes"; then
405 dbus_va_copy_func=__va_copy
409 if test -n "$dbus_va_copy_func"; then
410 AC_DEFINE_UNQUOTED(DBUS_VA_COPY,$dbus_va_copy_func,[A 'va_copy' style function])
413 AC_CACHE_CHECK([whether va_lists can be copied by value],dbus_cv_va_val_copy,[
414 AC_TRY_RUN([#include <stdarg.h>
415 void f (int i, ...) {
416 va_list args1, args2;
419 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
421 va_end (args1); va_end (args2);
427 [dbus_cv_va_val_copy=yes],
428 [dbus_cv_va_val_copy=no],
429 [dbus_cv_va_val_copy=yes])
432 if test "x$dbus_cv_va_val_copy" = "xno"; then
433 AC_DEFINE(DBUS_VA_COPY_AS_ARRAY,1, ['va_lists' cannot be copies as values])
437 #### Atomic integers (checks by Sebastian Wilhelmi for GLib)
438 AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
440 if test x"$GCC" = xyes; then
441 if test "x$enable_ansi" = "xyes"; then
451 AC_MSG_RESULT([darwin])
452 # check at compile-time, so that it is possible to build universal
453 # (with multiple architectures at once on the compile line)
454 AH_VERBATIM([DBUS_USE_ATOMIC_INT_486_DARWIN], [
455 #if (defined(__i386__) || defined(__x86_64__))
456 # define DBUS_USE_ATOMIC_INT_486 1
461 AC_MSG_RESULT([i486])
462 AC_DEFINE_UNQUOTED(DBUS_USE_ATOMIC_INT_486, 1, [Use atomic integer implementation for 486])
473 if test x$have_atomic_inc = xyes ; then
476 AH_VERBATIM([DBUS_HAVE_ATOMIC_INT_DARWIN], [
477 #if (defined(__i386__) || defined(__x86_64__))
478 # define DBUS_HAVE_ATOMIC_INT 1
483 AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT, 1, [Some atomic integer implementation present])
488 #### Various functions
489 AC_CHECK_LIB(socket,socket)
490 AC_CHECK_LIB(nsl,gethostbyname)
492 AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep poll setenv unsetenv socketpair getgrouplist)
494 AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
496 AC_CACHE_CHECK([for posix getpwnam_r],
497 ac_cv_func_posix_getpwnam_r,
503 struct passwd pwd, *pwptr = &pwd;
506 error = getpwnam_r ("", &pwd, buffer,
507 sizeof (buffer), &pwptr);
508 return (error < 0 && errno == ENOSYS)
511 [ac_cv_func_posix_getpwnam_r=yes],
512 [ac_cv_func_posix_getpwnam_r=no])])
513 if test "$ac_cv_func_posix_getpwnam_r" = yes; then
514 AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
515 [Have POSIX function getpwnam_r])
517 AC_CACHE_CHECK([for nonposix getpwnam_r],
518 ac_cv_func_nonposix_getpwnam_r,
519 [AC_TRY_LINK([#include <pwd.h>],
522 getpwnam_r ("", &pwd, buffer,
524 [ac_cv_func_nonposix_getpwnam_r=yes],
525 [ac_cv_func_nonposix_getpwnam_r=no])])
526 if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
527 AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
528 [Have non-POSIX function getpwnam_r])
532 dnl check for socklen_t
533 AC_MSG_CHECKING(whether socklen_t is defined)
535 #include <sys/types.h>
536 #include <sys/socket.h>
541 ],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
542 AC_MSG_RESULT($dbus_have_socklen_t)
544 if test "x$dbus_have_socklen_t" = "xyes"; then
545 AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
548 dnl check for writev header and writev function so we're
549 dnl good to go if HAVE_WRITEV gets defined.
550 AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
552 dnl check for flavours of varargs macros (test from GLib)
553 AC_MSG_CHECKING(for ISO C99 varargs macros in C)
555 int a(int p1, int p2, int p3);
556 #define call_a(...) a(1,__VA_ARGS__)
558 ],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
559 AC_MSG_RESULT($dbus_have_iso_c_varargs)
561 AC_MSG_CHECKING(for GNUC varargs macros)
563 int a(int p1, int p2, int p3);
564 #define call_a(params...) a(1,params)
566 ],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
567 AC_MSG_RESULT($dbus_have_gnuc_varargs)
569 dnl Output varargs tests
570 if test x$dbus_have_iso_c_varargs = xyes; then
571 AC_DEFINE(HAVE_ISO_VARARGS,1,[Have ISO C99 varargs macros])
573 if test x$dbus_have_gnuc_varargs = xyes; then
574 AC_DEFINE(HAVE_GNUC_VARARGS,1,[Have GNU-style varargs macros])
577 dnl Check for various credentials.
578 AC_MSG_CHECKING(for struct cmsgcred)
580 #include <sys/types.h>
581 #include <sys/socket.h>
583 struct cmsgcred cred;
586 ],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
587 AC_MSG_RESULT($dbus_have_struct_cmsgcred)
589 if test x$dbus_have_struct_cmsgcred = xyes; then
590 AC_DEFINE(HAVE_CMSGCRED,1,[Have cmsgcred structure])
593 AC_CHECK_FUNCS(getpeerucred getpeereid)
595 #### Abstract sockets
597 AC_MSG_CHECKING(abstract socket namespace)
599 AC_RUN_IFELSE([AC_LANG_PROGRAM(
601 #include <sys/types.h>
605 #include <sys/socket.h>
611 struct sockaddr_un addr;
613 listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
617 fprintf (stderr, "socket() failed: %s\n", strerror (errno));
621 memset (&addr, '\0', sizeof (addr));
622 addr.sun_family = AF_UNIX;
623 strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
624 addr.sun_path[0] = '\0'; /* this is what makes it abstract */
626 if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
628 fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
635 [have_abstract_sockets=yes],
636 [have_abstract_sockets=no])
638 AC_MSG_RESULT($have_abstract_sockets)
640 if test x$enable_abstract_sockets = xyes; then
641 if test x$have_abstract_sockets = xno; then
642 AC_MSG_ERROR([Abstract sockets explicitly required, and support not detected.])
646 if test x$enable_abstract_sockets = xno; then
647 have_abstract_sockets=no;
650 if test x$have_abstract_sockets = xyes ; then
651 DBUS_PATH_OR_ABSTRACT=abstract
652 AC_DEFINE(HAVE_ABSTRACT_SOCKETS,1,[Have abstract socket namespace])
654 DBUS_PATH_OR_ABSTRACT=path
657 # this is used in addresses to prefer abstract, e.g.
658 # unix:path=/foo or unix:abstract=/foo
659 AC_SUBST(DBUS_PATH_OR_ABSTRACT)
661 #### Sort out XML library
664 AC_CHECK_LIB(expat, XML_ParserCreate_MM,
665 [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ],
668 PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0, have_libxml=true, have_libxml=false)
670 # see what we want to use
671 dbus_use_libxml=false
673 if test x$with_xml = xexpat; then
675 if ! $have_expat ; then
676 AC_MSG_ERROR([Explicitly requested expat but expat not found])
678 elif test x$with_xml = xlibxml; then
680 if ! $have_libxml ; then
681 AC_MSG_ERROR([Explicitly requested libxml but libxml not found])
684 ### expat is the default because libxml can't currently survive
685 ### our brutal OOM-handling unit test setup.
686 ### http://bugzilla.gnome.org/show_bug.cgi?id=109368
687 if $have_expat ; then
690 elif $have_libxml ; then
694 AC_MSG_ERROR([No XML library found, check config.log for failed attempts])
698 AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat)
699 AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml)
701 if $dbus_use_expat; then
705 if $dbus_use_libxml; then
706 XML_LIBS=$LIBXML_LIBS
707 XML_CFLAGS=$LIBXML_CFLAGS
711 if test x$enable_selinux = xno ; then
714 # See if we have SELinux library
715 AC_CHECK_LIB(selinux, is_selinux_enabled,
716 have_selinux=yes, have_selinux=no)
718 # see if we have the SELinux header with the new D-Bus stuff in it
719 if test x$have_selinux = xyes ; then
720 AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
721 AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
722 [#ifdef DBUS__ACQUIRE_SVC return 0;
724 #error DBUS__ACQUIRE_SVC not defined
726 have_selinux=yes, have_selinux=no)
727 AC_MSG_RESULT($have_selinux)
730 if test x$enable_selinux = xauto ; then
731 if test x$have_selinux = xno ; then
732 AC_MSG_WARN([Sufficiently new SELinux library not found])
735 if test x$have_selinux = xno ; then
736 AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
741 AM_CONDITIONAL(HAVE_SELINUX, test x$have_selinux = xyes)
743 if test x$have_selinux = xyes ; then
744 SELINUX_LIBS="-lselinux -lpthread"
745 AC_DEFINE(HAVE_SELINUX,1,[SELinux support])
751 if test x$enable_dnotify = xno ; then
754 if test x$target_os = xlinux-gnu -o x$target_os = xlinux; then
761 dnl check if dnotify backend is enabled
762 if test x$have_dnotify = xyes; then
763 AC_DEFINE(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX,1,[Use dnotify on Linux])
766 AM_CONDITIONAL(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX, test x$have_dnotify = xyes)
769 if test x$enable_kqueue = xno ; then
773 AC_CHECK_HEADER(sys/event.h, , have_kqueue=no)
774 AC_CHECK_FUNC(kqueue, , have_kqueue=no)
776 if test x$enable_kqueue = xyes -a x$have_kqueue = xno; then
777 AC_MSG_ERROR(kqueue support explicitly enabled but not available)
781 dnl check if kqueue backend is enabled
782 if test x$have_kqueue = xyes; then
783 AC_DEFINE(DBUS_BUS_ENABLE_KQUEUE,1,[Use kqueue])
786 AM_CONDITIONAL(DBUS_BUS_ENABLE_KQUEUE, test x$have_kqueue = xyes)
788 dnl console owner file
789 if test x$enable_console_owner_file = xno ; then
790 have_console_owner_file=no;
794 have_console_owner_file=yes;
795 AC_DEFINE(HAVE_CONSOLE_OWNER_FILE,1,[Have console owner file])
798 have_console_owner_file=no;;
802 AM_CONDITIONAL(HAVE_CONSOLE_OWNER_FILE, test x$have_console_owner_file = xyes)
804 #### Set up final flags
807 AC_SUBST(DBUS_CLIENT_CFLAGS)
808 AC_SUBST(DBUS_CLIENT_LIBS)
810 DBUS_BUS_CFLAGS=$XML_CFLAGS
811 DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS"
812 AC_SUBST(DBUS_BUS_CFLAGS)
813 AC_SUBST(DBUS_BUS_LIBS)
817 AC_SUBST(DBUS_TEST_CFLAGS)
818 AC_SUBST(DBUS_TEST_LIBS)
823 ## for now enable_x11 just tracks have_x11,
824 ## there's no --enable-x11
825 if test x$no_x = xyes ; then
833 if test x$enable_x11 = xyes ; then
834 AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
835 DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
836 DBUS_X_CFLAGS="$X_CFLAGS"
842 AC_SUBST(DBUS_X_CFLAGS)
843 AC_SUBST(DBUS_X_LIBS)
845 ### Doxygen Documentation
847 AC_PATH_PROG(DOXYGEN, doxygen, no)
849 AC_MSG_CHECKING([whether to build Doxygen documentation])
851 if test x$DOXYGEN = xno ; then
857 if test x$enable_doxygen_docs = xauto ; then
858 if test x$have_doxygen = xno ; then
859 enable_doxygen_docs=no
861 enable_doxygen_docs=yes
865 if test x$enable_doxygen_docs = xyes; then
866 if test x$have_doxygen = xno; then
867 AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
871 AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
874 ### XML Documentation
876 AC_PATH_PROG(XMLTO, xmlto, no)
878 AC_MSG_CHECKING([whether to build XML documentation])
880 if test x$XMLTO = xno ; then
886 if test x$enable_xml_docs = xauto ; then
887 if test x$have_xmlto = xno ; then
894 if test x$enable_xml_docs = xyes; then
895 if test x$have_xmlto = xno; then
896 AC_MSG_ERROR([Building XML docs explicitly required, but xmlto not found])
900 AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
903 #### Have to go $localstatedir->$prefix/var->/usr/local/var
904 #### someone please fix this a better way...
906 #### find the actual value for $prefix that we'll end up with
907 ## (I know this is broken and should be done in the Makefile, but
908 ## that's a major pain and almost nobody actually seems to care)
910 if test "x$prefix" = "xNONE"; then
911 REAL_PREFIX=$ac_default_prefix
916 ## temporarily change prefix and exec_prefix
920 if test "x$exec_prefix" = xNONE ; then
921 REAL_EXEC_PREFIX=$REAL_PREFIX
923 REAL_EXEC_PREFIX=$exec_prefix
925 old_exec_prefix=$exec_prefix
926 exec_prefix=$REAL_EXEC_PREFIX
929 LOCALSTATEDIR_TMP="$localstatedir"
930 EXPANDED_LOCALSTATEDIR=`eval echo $LOCALSTATEDIR_TMP`
931 AC_SUBST(EXPANDED_LOCALSTATEDIR)
933 SYSCONFDIR_TMP="$sysconfdir"
934 EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
935 AC_SUBST(EXPANDED_SYSCONFDIR)
938 EXPANDED_BINDIR=`eval echo $BINDIR_TMP`
939 AC_SUBST(EXPANDED_BINDIR)
942 EXPANDED_LIBDIR=`eval echo $LIBDIR_TMP`
943 AC_SUBST(EXPANDED_LIBDIR)
945 DATADIR_TMP="$datadir"
946 EXPANDED_DATADIR=`eval echo $DATADIR_TMP`
947 AC_SUBST(EXPANDED_DATADIR)
949 ## put prefix and exec_prefix back
951 exec_prefix=$old_exec_prefix
953 #### Check our operating system
954 operating_system=unknown
955 if test -f /etc/redhat-release || test -f $EXPANDED_SYSCONFDIR/redhat-release ; then
956 operating_system=redhat
959 if test -f /etc/slackware-version || test -f $EXPANDED_SYSCONFDIR/slackware-version ; then
960 operating_system=slackware
963 #### Sort out init scripts
965 if test x$with_init_scripts = x; then
966 if test xredhat = x$operating_system ; then
967 with_init_scripts=redhat
969 if test xslackware = x$operating_system ; then
970 with_init_scripts=slackware
972 with_init_scripts=none
977 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
979 AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
981 ##### Set up location for system bus socket
982 if ! test -z "$with_system_socket"; then
983 DBUS_SYSTEM_SOCKET=$with_system_socket
985 DBUS_SYSTEM_SOCKET=${EXPANDED_LOCALSTATEDIR}/run/dbus/system_bus_socket
988 AC_SUBST(DBUS_SYSTEM_SOCKET)
989 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
991 ## system bus only listens on local domain sockets, and never
992 ## on an abstract socket (so only root can create the socket)
993 DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
994 AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
995 AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS, "$DBUS_SYSTEM_BUS_DEFAULT_ADDRESS",[The default D-Bus address of the system bus])
997 #### Set up the pid file
998 if ! test -z "$with_system_pid_file"; then
999 DBUS_SYSTEM_PID_FILE=$with_system_pid_file
1000 elif test x$with_init_scripts = xredhat ; then
1001 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/messagebus.pid
1003 DBUS_SYSTEM_PID_FILE=${EXPANDED_LOCALSTATEDIR}/run/dbus/pid
1006 AC_SUBST(DBUS_SYSTEM_PID_FILE)
1008 #### Directory to check for console ownership
1009 if ! test -z "$with_console_auth_dir"; then
1010 DBUS_CONSOLE_AUTH_DIR=$with_console_auth_dir
1012 DBUS_CONSOLE_AUTH_DIR=/var/run/console/
1015 AC_SUBST(DBUS_CONSOLE_AUTH_DIR)
1016 AC_DEFINE_UNQUOTED(DBUS_CONSOLE_AUTH_DIR, "$DBUS_CONSOLE_AUTH_DIR", [Directory to check for console ownerhip])
1018 #### File to check for console ownership
1019 if test x$have_console_owner_file = xyes; then
1020 if ! test -z "$with_console_owner_file"; then
1021 DBUS_CONSOLE_OWNER_FILE=$with_console_owner_file
1023 DBUS_CONSOLE_OWNER_FILE=/dev/console
1026 DBUS_CONSOLE_OWNER_FILE=
1029 AC_SUBST(DBUS_CONSOLE_OWNER_FILE)
1030 AC_DEFINE_UNQUOTED(DBUS_CONSOLE_OWNER_FILE, "$DBUS_CONSOLE_OWNER_FILE", [File to check for console ownerhip])
1032 #### User to start the system bus as
1033 if test -z "$with_dbus_user" ; then
1034 DBUS_USER=messagebus
1036 DBUS_USER=$with_dbus_user
1039 AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
1041 #### Directory to install dbus-daemon
1042 if test -z "$with_dbus_daemondir" ; then
1043 DBUS_DAEMONDIR=$EXPANDED_BINDIR
1045 DBUS_DAEMONDIR=$with_dbus_daemondir
1047 AC_SUBST(DBUS_DAEMONDIR)
1048 AC_DEFINE_UNQUOTED(DBUS_DAEMONDIR,"$DBUS_DAEMONDIR", [Directory for installing the DBUS daemon])
1050 #### Tell tests where to find certain stuff in builddir
1053 AC_DEFUN([TEST_PATH], [
1054 TEST_$1=${DBUS_PWD}/test/$2
1055 AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
1056 [Full path to test file test/$2 in builddir])
1060 TEST_PATH(SERVICE_DIR, data/valid-service-files)
1061 TEST_PATH(SERVICE_BINARY, test-service)
1062 TEST_PATH(SHELL_SERVICE_BINARY, test-shell-service)
1063 TEST_PATH(EXIT_BINARY, test-exit)
1064 TEST_PATH(SEGFAULT_BINARY, test-segfault)
1065 TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
1067 #### Find socket directories
1068 if ! test -z "$TMPDIR" ; then
1069 DEFAULT_SOCKET_DIR=$TMPDIR
1070 elif ! test -z "$TEMP" ; then
1071 DEFAULT_SOCKET_DIR=$TEMP
1072 elif ! test -z "$TMP" ; then
1073 DEFAULT_SOCKET_DIR=$TMP
1075 DEFAULT_SOCKET_DIR=/tmp
1078 if ! test -z "$with_test_socket_dir" ; then
1079 TEST_SOCKET_DIR="$with_test_socket_dir"
1081 TEST_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1083 AC_SUBST(TEST_SOCKET_DIR)
1084 AC_DEFINE_UNQUOTED(DBUS_TEST_SOCKET_DIR, "$TEST_SOCKET_DIR", [Where to put test sockets])
1086 if ! test -z "$with_session_socket_dir" ; then
1087 DBUS_SESSION_SOCKET_DIR="$with_session_socket_dir"
1089 DBUS_SESSION_SOCKET_DIR=$DEFAULT_SOCKET_DIR
1091 AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
1092 AC_SUBST(DBUS_SESSION_SOCKET_DIR)
1096 dbus/dbus-arch-deps.h
1107 test/name-test/Makefile
1110 test/data/valid-config-files/debug-allow-all.conf
1111 test/data/valid-config-files/debug-allow-all-sha1.conf
1112 test/data/valid-service-files/debug-echo.service
1113 test/data/valid-service-files/debug-segfault.service
1114 test/data/valid-service-files/debug-shell-echo-success.service
1115 test/data/valid-service-files/debug-shell-echo-fail.service
1118 dnl ==========================================================================
1124 exec_prefix: ${exec_prefix}
1125 libdir: ${EXPANDED_LIBDIR}
1126 bindir: ${EXPANDED_BINDIR}
1127 sysconfdir: ${EXPANDED_SYSCONFDIR}
1128 localstatedir: ${EXPANDED_LOCALSTATEDIR}
1129 datadir: ${EXPANDED_DATADIR}
1130 source code location: ${srcdir}
1133 cppflags: ${CPPFLAGS}
1134 cxxflags: ${CXXFLAGS}
1135 64-bit int: ${DBUS_INT64_TYPE}
1136 32-bit int: ${DBUS_INT32_TYPE}
1137 16-bit int: ${DBUS_INT16_TYPE}
1142 Maintainer mode: ${USE_MAINTAINER_MODE}
1143 gcc coverage profiling: ${enable_gcov}
1144 Building unit tests: ${enable_tests}
1145 Building verbose mode: ${enable_verbose_mode}
1146 Building assertions: ${enable_asserts}
1147 Building checks: ${enable_checks}
1148 Building SELinux support: ${have_selinux}
1149 Building dnotify support: ${have_dnotify}
1150 Building X11 code: ${enable_x11}
1151 Building Doxygen docs: ${enable_doxygen_docs}
1152 Building XML docs: ${enable_xml_docs}
1153 Gettext libs (empty OK): ${INTLLIBS}
1154 Using XML parser: ${with_xml}
1155 Init scripts style: ${with_init_scripts}
1156 Abstract socket names: ${have_abstract_sockets}
1157 System bus socket: ${DBUS_SYSTEM_SOCKET}
1158 System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
1159 System bus PID file: ${DBUS_SYSTEM_PID_FILE}
1160 Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
1161 Console auth dir: ${DBUS_CONSOLE_AUTH_DIR}
1162 Console owner file: ${have_console_owner_file}
1163 Console owner file path: ${DBUS_CONSOLE_OWNER_FILE}
1164 System bus user: ${DBUS_USER}
1165 Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services
1166 'make check' socket dir: ${TEST_SOCKET_DIR}
1169 if test x$enable_tests = xyes; then
1170 echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."
1172 if test x$enable_tests = xyes -a x$enable_asserts = xno; then
1173 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)"
1175 if test x$enable_gcov = xyes; then
1176 echo "NOTE: building with coverage profiling is definitely for developers only."
1178 if test x$enable_verbose_mode = xyes; then
1179 echo "NOTE: building with verbose mode increases library size, may slightly increase security risk, and decreases performance."
1181 if test x$enable_asserts = xyes; then
1182 echo "NOTE: building with assertions increases library size and decreases performance."
1184 if test x$enable_checks = xno; then
1185 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."