AC_PREREQ(2.52)
m4_define([dbus_major_version], [1])
-m4_define([dbus_minor_version], [2])
-m4_define([dbus_micro_version], [14])
+m4_define([dbus_minor_version], [4])
+m4_define([dbus_micro_version], [3])
m4_define([dbus_version],
[dbus_major_version.dbus_minor_version.dbus_micro_version])
AC_INIT(dbus, [dbus_version])
AC_CANONICAL_HOST
+AC_LIBTOOL_WIN32_DLL
+AC_LIBTOOL_RC
-AM_INIT_AUTOMAKE([1.9 tar-ustar])
+AC_CONFIG_MACRO_DIR([m4])
+
+AM_INIT_AUTOMAKE([1.9 tar-ustar -Wno-portability])
AM_CONFIG_HEADER(config.h)
# Honor aclocal flags
## must come before we use the $USE_MAINTAINER_MODE variable later
AM_MAINTAINER_MODE
+m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
+
+AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable])
+
# libtool versioning - this applies to libdbus
#
# See http://sources.redhat.com/autobook/autobook/autobook_91.html#SEC91 for details
#
## increment if the interface has additions, changes, removals.
-LT_CURRENT=7
+LT_CURRENT=8
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=0
+LT_REVISION=3
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
## precedence over adding, so set to 0 if both happened.
-LT_AGE=4
+LT_AGE=5
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_PROG_CC
AM_PROG_CC_C_O
AC_PROG_CXX
+AC_USE_SYSTEM_EXTENSIONS
AC_ISC_POSIX
AC_HEADER_STDC
AC_C_INLINE
AM_PROG_LIBTOOL
+AC_PROG_MKDIR_P
+
+# Set some internal variables depending on the platform for later use.
+dbus_win=no
+dbus_cygwin=no
+dbus_unix=no
+case "${host}" in
+ *-mingw32ce*)
+ dbus_win=yes
+ dbus_wince=yes
+ ;;
+ *-mingw32*)
+ dbus_win=yes
+ ;;
+ *-cygwin*)
+ dbus_cygwin=yes
+ dbus_unix=yes
+ ;;
+ *)
+ dbus_unix=yes
+ ;;
+esac
+
+# Special defines for certain platforms
+if test "$dbus_win" = yes; then
+ AC_DEFINE(DBUS_WIN,1,[Defined if we run on a W32 API based system])
+ BUILD_TIMESTAMP=`date --iso-8601=minutes`
+ AC_SUBST(BUILD_TIMESTAMP)
+ # Assume DBUS_VERSION is always three numbers
+ BUILD_FILEVERSION=`echo "$DBUS_VERSION" | sed -e 's/\./,/g'`,0
+ AC_SUBST(BUILD_FILEVERSION)
+ AC_CHECK_TOOL(WINDRES, windres, no)
+ if test "$WINDRES" = no; then
+ AC_MSG_ERROR([*** Could not find an implementation of windres in your PATH.])
+ fi
+ if test "$dbus_wince" = yes; then
+ AC_DEFINE(DBUS_WINCE,1,[Defined if we run on a W32 CE API based system])
+ AC_DEFINE(_WIN32_WCE, 0x0502, [Defined to get newer W32 CE APIs])
+ fi
+else
+ AC_DEFINE(DBUS_UNIX,1,[Defined if we run on a Unix-based system])
+fi
+if test "$dbus_cygwin" = yes; then
+ AC_DEFINE(DBUS_CYGWIN,1,[Defined if we run on a cygwin API based system])
+fi
+
+AM_CONDITIONAL(DBUS_WIN, test "$dbus_win" = yes)
+AM_CONDITIONAL(DBUS_WINCE, test "$dbus_wince" = yes)
+AM_CONDITIONAL(DBUS_UNIX, test "$dbus_unix" = yes)
+AM_CONDITIONAL(DBUS_CYGWIN, test "$dbus_cygwin" = yes)
AC_ARG_ENABLE(tests, AS_HELP_STRING([--enable-tests],[enable unit test code]),enable_tests=$enableval,enable_tests=$USE_MAINTAINER_MODE)
AC_ARG_ENABLE(ansi, AS_HELP_STRING([--enable-ansi],[enable -ansi -pedantic gcc flags]),enable_ansi=$enableval,enable_ansi=no)
AC_ARG_ENABLE(kqueue, AS_HELP_STRING([--enable-kqueue],[build with kqueue support]),enable_kqueue=$enableval,enable_kqueue=auto)
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)
AC_ARG_ENABLE(userdb-cache, AS_HELP_STRING([--enable-userdb-cache],[build with userdb-cache support]),enable_userdb_cache=$enableval,enable_userdb_cache=yes)
+AC_ARG_ENABLE(launchd, AS_HELP_STRING([--enable-launchd],[build with launchd auto-launch support]),enable_launchd=$enableval,enable_launchd=auto)
-AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use]))
+AC_ARG_WITH(xml, AS_HELP_STRING([--with-xml=[libxml/expat]],[XML library to use (libxml may be named libxml2 on some systems)]))
AC_ARG_WITH(init-scripts, AS_HELP_STRING([--with-init-scripts=[redhat]],[Style of init scripts to install]))
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]))
AC_ARG_WITH(test-socket-dir, AS_HELP_STRING([--with-test-socket-dir=[dirname]],[Where to put sockets for make check]))
AC_ARG_WITH(system-socket, AS_HELP_STRING([--with-system-socket=[filename]],[UNIX domain socket for systemwide daemon]))
AC_ARG_WITH(console-auth-dir, AS_HELP_STRING([--with-console-auth-dir=[dirname]],[directory to check for console ownerhip]))
AC_ARG_WITH(console-owner-file, AS_HELP_STRING([--with-console-owner-file=[filename]],[file whose owner determines current console owner]))
+AC_ARG_WITH(launchd-agent-dir, AS_HELP_STRING([--with-launchd-agent-dir=[dirname]],[directory to put the launchd agent (default: /Library/LaunchAgents)]))
AC_ARG_WITH(dbus_user, AS_HELP_STRING([--with-dbus-user=<user>],[User for running the DBUS daemon (messagebus)]))
AC_ARG_WITH(dbus_daemondir, AS_HELP_STRING([--with-dbus-daemondir=[dirname]],[Directory for installing the DBUS daemon]))
-AC_DEFINE(DBUS_UNIX,1,[dbus on unix])
-
-dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
+dnl DBUS_BUILD_TESTS controls unit tests built in to .c files
dnl and also some stuff in the test/ subdir
AM_CONDITIONAL(DBUS_BUILD_TESTS, test x$enable_tests = xyes)
if test x$enable_tests = xyes; then
R_DYNAMIC_LDFLAG=""
else
# -rdynamic is needed for glibc's backtrace_symbols to work.
- # No clue how much overhead this adds, but it's useful
+ # No clue how much overhead this adds, but it's useful
# to do this on any assertion failure,
# so for now it's enabled anytime asserts are (currently not
# in production builds).
AC_MSG_CHECKING([for gcc 3.3 version of gcov file format])
have_gcc33_gcov=no
- AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
+ AC_RUN_IFELSE( [AC_LANG_PROGRAM( , [[ if (__GNUC__ >=3 && __GNUC_MINOR__ >= 3) exit (0); else exit (1); ]])],
have_gcc33_gcov=yes)
if test x$have_gcc33_gcov = xyes ; then
AC_DEFINE_UNQUOTED(DBUS_HAVE_GCC33_GCOV, 1, [Defined if we have gcc 3.3 and thus the new gcov format])
fi
AM_CONDITIONAL(DBUS_GCOV_ENABLED, test x$enable_gcov = xyes)
-#### Integer sizes
+# glibc21.m4 serial 3
+dnl Copyright (C) 2000-2002, 2004 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+# Test for the GNU C Library, version 2.1 or newer.
+# From Bruno Haible.
+
+AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
+ ac_cv_gnu_library_2_1,
+ [AC_EGREP_CPP([Lucky GNU user],
+ [
+#include <features.h>
+#ifdef __GNU_LIBRARY__
+ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
+ Lucky GNU user
+ #endif
+#endif
+ ],
+ ac_cv_gnu_library_2_1=yes,
+ ac_cv_gnu_library_2_1=no)
+ ]
+)
+
+#### Integer sizes
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
dbusint64=int
dbusint64_constant='(val)'
dbusuint64_constant='(val)'
+ dbusint64_printf_modifier='""'
;;
$ac_cv_sizeof_long)
dbusint64=long
dbusint64_constant='(val##L)'
dbusuint64_constant='(val##UL)'
+ dbusint64_printf_modifier='"l"'
;;
$ac_cv_sizeof_long_long)
dbusint64='long long'
dbusint64_constant='(val##LL)'
dbusuint64_constant='(val##ULL)'
+ # Ideally we discover what the format is, but this is
+ # only used in verbose mode, so eh...
+ if test x"$ac_cv_gnu_library_2_1" = xyes; then
+ dbusint64_printf_modifier='"ll"'
+ fi
;;
$ac_cv_sizeof___int64)
dbusint64=__int64
dbusint64_constant='(val##i64)'
dbusuint64_constant='(val##ui64)'
+ # See above case
+ if test x"$ac_cv_gnu_library_2_1" = xyes; then
+ dbusint64_printf_modifier='"ll"'
+ fi
;;
esac
DBUS_HAVE_INT64=1
DBUS_INT64_CONSTANT="$dbusint64_constant"
DBUS_UINT64_CONSTANT="$dbusuint64_constant"
+ if test x"$dbusint64_printf_modifier" != x; then
+ AC_DEFINE_UNQUOTED(DBUS_INT64_PRINTF_MODIFIER, [$dbusint64_printf_modifier], [Define to printf modifier for 64 bit integer type])
+ fi
AC_MSG_RESULT($DBUS_INT64_TYPE)
fi
case 4 in
$ac_cv_sizeof_short)
- dbusint32=int
+ dbusint32=short
;;
$ac_cv_sizeof_int)
dbusint32=int
fi
-#### Atomic integers (checks by Sebastian Wilhelmi for GLib)
-AC_MSG_CHECKING([whether to use inline assembler routines for atomic integers])
-have_atomic_inc_cond=0
-if test x"$GCC" = xyes; then
- if test "x$enable_ansi" = "xyes"; then
- AC_MSG_RESULT([no])
- else
- case $host_cpu in
- i386)
- AC_MSG_RESULT([no])
- ;;
- i?86)
- case $host_os in
- darwin*)
- AC_MSG_RESULT([darwin])
- # check at compile-time, so that it is possible to build universal
- # (with multiple architectures at once on the compile line)
- have_atomic_inc_cond="(defined(__i386__) || defined(__x86_64__))"
- ;;
- *)
- AC_MSG_RESULT([i486])
- have_atomic_inc_cond=1
- ;;
- esac
- ;;
- *)
- AC_MSG_RESULT([no])
- ;;
- esac
- fi
+#### Atomic integers
+
+AC_CACHE_CHECK([whether $CC knows __sync_sub_and_fetch()],
+ dbus_cv_sync_sub_and_fetch,
+ [AC_LINK_IFELSE(
+ AC_LANG_PROGRAM([], [[int a = 4; int b = __sync_sub_and_fetch(&a, 4); exit(b); ]]),
+ [dbus_cv_sync_sub_and_fetch=yes],
+ [dbus_cv_sync_sub_and_fetch=no])
+ ])
+
+if test "x$dbus_cv_sync_sub_and_fetch" = "xyes" ; then
+ have_sync=1
+else
+ have_sync=0
fi
-AC_DEFINE_UNQUOTED([DBUS_USE_ATOMIC_INT_486_COND], [$have_atomic_inc_cond],
- [Always defined; expands to 1 if we should use atomic integer implementation for 486, else 0])
-AC_DEFINE_UNQUOTED(DBUS_HAVE_ATOMIC_INT_COND, [$have_atomic_inc_cond],
- [Always defined; expands to 1 if we have an atomic integer implementation, else 0])
+
+AC_DEFINE_UNQUOTED([DBUS_USE_SYNC], [$have_sync], [Use the gcc __sync extension])
#### Various functions
-AC_CHECK_LIB(socket,socket)
+AC_SEARCH_LIBS(socket,[socket network])
AC_CHECK_FUNC(gethostbyname,,[AC_CHECK_LIB(nsl,gethostbyname)])
-AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit poll)
+AC_CHECK_FUNCS(vsnprintf vasprintf nanosleep usleep setenv clearenv unsetenv socketpair getgrouplist fpathconf setrlimit poll setlocale localeconv strtoll strtoull)
#### Check for broken poll; taken from Glib's configure
dirp = opendir(".");
dirfd(dirp);
closedir(dirp);
-],
+],
dbus_have_dirfd=yes, dbus_have_dirfd=no)
AC_MSG_RESULT($dbus_have_dirfd)
if test "$dbus_have_dirfd" = yes; then
AC_DEFINE(HAVE_DIRFD,1,[Have dirfd function])
else
- AC_MSG_CHECKING(for DIR *dirp->dd_fd)
+ AC_MSG_CHECKING(for DIR *dirp->dd_fd)
AC_TRY_LINK([
#include <sys/types.h>
#include <dirent.h>
fi
fi
+AC_CHECK_HEADERS(sys/resource.h)
+
+AC_CHECK_HEADERS(dirent.h)
+
AC_CHECK_HEADERS(execinfo.h, [AC_CHECK_FUNCS(backtrace)])
AC_CHECK_HEADERS(errno.h)
+AC_CHECK_HEADERS(signal.h)
+
+AC_CHECK_HEADERS(locale.h)
+
+AC_CHECK_HEADERS(byteswap.h)
+
AC_CHECK_HEADERS(unistd.h)
+AC_CHECK_HEADERS(ws2tcpip.h)
+
+AC_CHECK_HEADERS(wspiapi.h)
+
+# Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
+#
+case $host_os in
+ solaris*)
+ CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
+esac
+
# checking for a posix version of getpwnam_r
# if we are cross compiling and can not run the test
# assume getpwnam_r is the posix version
struct passwd pwd, *pwptr = &pwd;
int error;
errno = 0;
- error = getpwnam_r ("", &pwd, buffer,
+ error = getpwnam_r ("", &pwd, buffer,
sizeof (buffer), &pwptr);
- return (error < 0 && errno == ENOSYS)
- || error == ENOSYS;
+ return (error < 0 && errno == ENOSYS)
+ || error == ENOSYS;
]])],
[ac_cv_func_posix_getpwnam_r=yes],
[ac_cv_func_posix_getpwnam_r=no],
AC_LANG_POP(C)
if test "$ac_cv_func_posix_getpwnam_r" = yes; then
- AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
- [Have POSIX function getpwnam_r])
+ AC_DEFINE(HAVE_POSIX_GETPWNAM_R,1,
+ [Have POSIX function getpwnam_r])
else
- AC_CACHE_CHECK([for nonposix getpwnam_r],
- ac_cv_func_nonposix_getpwnam_r,
- [AC_TRY_LINK([#include <pwd.h>],
- [char buffer[10000];
- struct passwd pwd;
- getpwnam_r ("", &pwd, buffer,
- sizeof (buffer));],
- [ac_cv_func_nonposix_getpwnam_r=yes],
- [ac_cv_func_nonposix_getpwnam_r=no])])
- if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
- AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
- [Have non-POSIX function getpwnam_r])
- fi
+ AC_CACHE_CHECK([for nonposix getpwnam_r],
+ ac_cv_func_nonposix_getpwnam_r,
+ [AC_TRY_LINK([#include <pwd.h>],
+ [char buffer[10000];
+ struct passwd pwd;
+ getpwnam_r ("", &pwd, buffer,
+ sizeof (buffer));],
+ [ac_cv_func_nonposix_getpwnam_r=yes],
+ [ac_cv_func_nonposix_getpwnam_r=no])])
+ if test "$ac_cv_func_nonposix_getpwnam_r" = yes; then
+ AC_DEFINE(HAVE_NONPOSIX_GETPWNAM_R,1,
+ [Have non-POSIX function getpwnam_r])
+ fi
fi
dnl check for socklen_t
AC_DEFINE(HAVE_SOCKLEN_T,1,[Have socklen_t type])
fi
-dnl check for writev header and writev function so we're
+dnl check for writev header and writev function so we're
dnl good to go if HAVE_WRITEV gets defined.
AC_CHECK_HEADERS(sys/uio.h, [AC_CHECK_FUNCS(writev)])
dnl needed on darwin for NAME_MAX
AC_CHECK_HEADERS(sys/syslimits.h)
+dnl Make it easy to check if we have MSG_NOSIGNAL without actually having to include sys/socket.h
+AC_CHECK_DECLS([MSG_NOSIGNAL], [], [], [[ #include <sys/socket.h> ]])
+
dnl check for flavours of varargs macros (test from GLib)
AC_MSG_CHECKING(for ISO C99 varargs macros in C)
AC_TRY_COMPILE([],[
AC_CHECK_FUNCS(getpeerucred getpeereid)
+AC_CHECK_FUNCS(pipe2 accept4)
+
#### Abstract sockets
if test x$enable_abstract_sockets = xauto; then
#include <errno.h>
]],
[[
+ size_t slen;
int listen_fd;
struct sockaddr_un addr;
-
+
listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
-
+
if (listen_fd < 0)
{
fprintf (stderr, "socket() failed: %s\n", strerror (errno));
memset (&addr, '\0', sizeof (addr));
addr.sun_family = AF_UNIX;
strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
+ /* SUN_LEN uses strlen() so need to calculate it before adding \0 at the
+ * beginning.
+ */
+ slen = SUN_LEN(&addr);
addr.sun_path[0] = '\0'; /* this is what makes it abstract */
-
- if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
+
+ if (bind (listen_fd, (struct sockaddr*) &addr, slen) < 0)
{
- fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
+ fprintf (stderr, "Abstract socket namespace bind() failed: %s\n",
strerror (errno));
exit (1);
}
- else
+ else
exit (0);
]])],
[ac_cv_have_abstract_sockets=yes],
DBUS_PATH_OR_ABSTRACT=path
fi
-# this is used in addresses to prefer abstract, e.g.
-# unix:path=/foo or unix:abstract=/foo
+# this is used in addresses to prefer abstract, e.g.
+# unix:path=/foo or unix:abstract=/foo
AC_SUBST(DBUS_PATH_OR_ABSTRACT)
+PKG_PROG_PKG_CONFIG
+
#### Sort out XML library
# see what we have
fi
dbus_use_libxml=true
else
- ### expat is the default because libxml can't currently survive
+ ### expat is the default because libxml can't currently survive
### our brutal OOM-handling unit test setup.
### http://bugzilla.gnome.org/show_bug.cgi?id=109368
if test x$have_expat = xfalse; then
fi
# Thread lib detection
-AC_CHECK_FUNC(pthread_cond_timedwait,,[AC_CHECK_LIB(pthread,pthread_cond_timedwait,
+AC_CHECK_FUNC(pthread_cond_timedwait,[AC_CHECK_LIB(pthread,pthread_cond_timedwait,
[THREAD_LIBS="-lpthread"])])
+save_libs="$LIBS"
+LIBS="$LIBS $THREAD_LIBS"
+AC_CHECK_FUNC(pthread_condattr_setclock,have_pthread_condattr_setclock=true,have_pthread_condattr_setclock=false)
+if test x$have_pthread_condattr_setclock = xtrue; then
+ AC_SEARCH_LIBS([clock_getres],[rt],[THREAD_LIBS="$THREAD_LIBS -lrt"])
+ AC_MSG_CHECKING([for CLOCK_MONOTONIC])
+ AC_TRY_COMPILE([#include <time.h>
+#include <pthread.h>
+], [
+struct timespec monotonic_timer;
+pthread_condattr_t attr;
+pthread_condattr_init (&attr);
+pthread_condattr_setclock (&attr, CLOCK_MONOTONIC);
+clock_getres (CLOCK_MONOTONIC,&monotonic_timer);
+], have_clock_monotonic=true, have_clock_monotonic=false)
+if test x$have_clock_monotonic = xtrue; then
+ AC_MSG_RESULT([found])
+ AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, [Define if we have CLOCK_MONOTONIC])
+else
+ AC_MSG_RESULT([not found])
+fi
+fi
+LIBS="$save_libs"
# SELinux detection
if test x$enable_selinux = xno ; then
have_selinux=no;
else
# See if we have SELinux library
- AC_CHECK_LIB(selinux, is_selinux_enabled,
+ AC_CHECK_LIB(selinux, is_selinux_enabled,
have_selinux=yes, have_selinux=no)
# see if we have the SELinux header with the new D-Bus stuff in it
if test x$have_selinux = xno ; then
AC_MSG_WARN([Sufficiently new SELinux library not found])
fi
- else
+ else
if test x$have_selinux = xno ; then
AC_MSG_ERROR([SElinux explicitly required, and SELinux library not found])
fi
dnl check if inotify backend is enabled
if test x$have_inotify = xyes; then
AC_DEFINE(DBUS_BUS_ENABLE_INOTIFY,1,[Use inotify])
-
+ AC_CHECK_FUNCS(inotify_init1)
fi
AM_CONDITIONAL(DBUS_BUS_ENABLE_INOTIFY, test x$have_inotify = xyes)
have_dnotify=no;
else
if test x$have_inotify = xno -a x$host_os = xlinux-gnu -o x$host_os = xlinux; then
- have_dnotify=yes;
+ have_dnotify=yes;
else
have_dnotify=no;
fi
AC_DEFINE(DBUS_BUS_ENABLE_KQUEUE,1,[Use kqueue])
fi
-AM_CONDITIONAL(DBUS_BUS_ENABLE_KQUEUE, test x$have_kqueue = xyes)
+AM_CONDITIONAL(DBUS_BUS_ENABLE_KQUEUE, test x$have_kqueue = xyes)
+
+# launchd checks
+if test x$enable_launchd = xno ; then
+ have_launchd=no
+else
+ have_launchd=yes
+ AC_CHECK_HEADER([launch.h], , have_launchd=no)
+ AC_PATH_PROG([LAUNCHCTL], [launchctl])
+ if test "x$LAUNCHCTL" = "x"; then
+ have_launchd=no
+ fi
+
+ if test x$enable_launchd = xyes && test x$have_launchd = xno ; then
+ AC_MSG_ERROR([launchd support explicitly enabled but not available])
+ fi
+fi
+
+dnl check if launchd is enabled
+if test x$have_launchd = xyes; then
+ AC_DEFINE(DBUS_ENABLE_LAUNCHD,1,[Use launchd autolaunch])
+fi
+
+AM_CONDITIONAL(DBUS_ENABLE_LAUNCHD, test x$have_launchd = xyes)
+
+#### Directory to place launchd agent file
+if test "x$with_launchd_agent_dir" = "x"; then
+ LAUNCHD_AGENT_DIR="/Library/LaunchAgents"
+else
+ LAUNCHD_AGENT_DIR="$with_launchd_agent_dir"
+fi
+
+AC_SUBST(LAUNCHD_AGENT_DIR)
dnl console owner file
if test x$enable_console_owner_file = xno ; then
have_libaudit=no;
else
# See if we have audit daemon & capabilities library
- AC_CHECK_LIB(audit, audit_log_user_avc_message,
+ AC_CHECK_LIB(audit, audit_log_user_avc_message,
have_libaudit=yes, have_libaudit=no)
if test x$have_libaudit = xyes ; then
- AC_CHECK_LIB(cap, cap_set_proc,
+ AC_CHECK_LIB(cap-ng, capng_clear,
have_libaudit=yes, have_libaudit=no)
fi
fi
AM_CONDITIONAL(HAVE_LIBAUDIT, test x$have_libaudit = xyes)
if test x$have_libaudit = xyes ; then
- SELINUX_LIBS="$SELINUX_LIBS -laudit"
- LIBS="-lcap $LIBS"
+ SELINUX_LIBS="$SELINUX_LIBS -laudit -lcap-ng"
AC_DEFINE(HAVE_LIBAUDIT,1,[audit daemon SELinux support])
fi
AC_MSG_RESULT(no)
fi
+# Check for SCM_RIGHTS
+AC_MSG_CHECKING([for SCM_RIGHTS])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <sys/socket.h>
+#include <sys/un.h>
+static int x = SCM_RIGHTS;
+]], [[]])],
+[ AC_MSG_RESULT([supported])
+ AC_DEFINE([HAVE_UNIX_FD_PASSING], [1], [Supports sending UNIX file descriptors]) ],
+[ AC_MSG_RESULT([not supported]) ])
+
+NETWORK_libs=
+if test x$dbus_win = xyes ; then
+ if test x$dbus_wince = xyes ; then
+ NETWORK_libs="-lws2"
+ else
+ NETWORK_libs="-lws2_32"
+ fi
+fi
#### Set up final flags
DBUS_CLIENT_CFLAGS=
-DBUS_CLIENT_LIBS="$THREAD_LIBS"
+DBUS_CLIENT_LIBS="$THREAD_LIBS $NETWORK_libs"
AC_SUBST(DBUS_CLIENT_CFLAGS)
AC_SUBST(DBUS_CLIENT_LIBS)
DBUS_BUS_CFLAGS="$XML_CFLAGS"
-DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $INTLLIBS $THREAD_LIBS $ADT_LIBS"
+DBUS_BUS_LIBS="$XML_LIBS $SELINUX_LIBS $THREAD_LIBS $ADT_LIBS $NETWORK_libs"
AC_SUBST(DBUS_BUS_CFLAGS)
AC_SUBST(DBUS_BUS_LIBS)
DBUS_LAUNCHER_CFLAGS="$XML_CFLAGS"
-DBUS_LAUNCHER_LIBS="$XML_LIBS $THREAD_LIBS"
+DBUS_LAUNCHER_LIBS="$XML_LIBS $THREAD_LIBS $NETWORK_libs"
AC_SUBST(DBUS_LAUNCHER_CFLAGS)
AC_SUBST(DBUS_LAUNCHER_LIBS)
DBUS_TEST_CFLAGS=
-DBUS_TEST_LIBS="$THREAD_LIBS"
+DBUS_TEST_LIBS="$THREAD_LIBS $NETWORK_libs"
AC_SUBST(DBUS_TEST_CFLAGS)
AC_SUBST(DBUS_TEST_LIBS)
### X11 detection
+if test x$dbus_win = xyes ; then
+ enable_x11=no
+else
AC_PATH_XTRA
-## for now enable_x11 just tracks have_x11,
+## for now enable_x11 just tracks have_x11,
## there's no --enable-x11
if test x$no_x = xyes ; then
have_x11=no
AC_SUBST(DBUS_X_CFLAGS)
AC_SUBST(DBUS_X_LIBS)
+fi
#### gcc warning flags
cc_supports_flag() {
- AC_MSG_CHECKING(whether $CC supports "$@")
- Cfile=/tmp/foo${$}
- touch ${Cfile}.c
- $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1
- rc=$?
- rm -f ${Cfile}.c ${Cfile}.o
- case $rc in
- 0) AC_MSG_RESULT(yes);;
- *) AC_MSG_RESULT(no);;
- esac
- return $rc
+ AC_MSG_CHECKING(whether $CC supports "$*")
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$*"
+ AC_TRY_COMPILE([], [], [rc=yes], [rc=no])
+ CFLAGS="$save_CFLAGS"
+ AC_MSG_RESULT([$rc])
+ test "x$rc" = xyes
}
ld_supports_flag() {
fi
}
-if test x$USE_MAINTAINER_MODE = xyes; then
+# Don't bother with -Werror on Windows for now, too many warnings
+if test x$dbus_win != xyes -a x$dbus_cygwin != xyes -a x$USE_MAINTAINER_MODE = xyes; then
if cc_supports_flag "-Werror"; then
CFLAGS="$CFLAGS -Werror"
fi
case " $CFLAGS " in
*[\ \ ]-Wfloat-equal[\ \ ]*) ;;
- *) if cc_supports_flag -Wfloat-equals; then
- CFLAGS="$CFLAGS -Wfloat-equal"
+ *) if cc_supports_flag -Wfloat-equal; then
+ CFLAGS="$CFLAGS -Wfloat-equal"
fi
;;
esac
case " $CFLAGS " in
*[\ \ ]-fPIC[\ \ ]*) ;;
- *) if cc_supports_flag -fPIC; then
+ *) if test x$dbus_win = xno && cc_supports_flag -fPIC; then
PIC_CFLAGS="-fPIC"
if ld_supports_flag -z,relro; then
PIC_LDFLAGS="-Wl,-z,relro"
case " $CFLAGS " in
*[\ \ ]-fPIE[\ \ ]*) ;;
- *) if cc_supports_flag -fPIE; then
+ *) if test x$dbus_win = xno && cc_supports_flag -fPIE; then
PIE_CFLAGS="-fPIE"
if ld_supports_flag -z,relro; then
PIE_LDFLAGS="-pie -Wl,-z,relro"
fi
;;
esac
-
+
### Disabled warnings, and compiler flag overrides
-
+
# Let's just ignore unused for now
case " $CFLAGS " in
*[\ \ ]-Wno-unused[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wno-unused" ;;
- esac
-
+ esac
+
# This group is for warnings we currently don't pass.
# We would like to, however. Please fix.
-
+
# http://bugs.freedesktop.org/show_bug.cgi?id=17433
case " $CFLAGS " in
*[\ \ ]-Wno-sign-compare[\ \ ]*) ;;
CFLAGS="$CFLAGS -Wno-pointer-sign"
fi
;;
- esac
-
- # http://bugs.freedesktop.org/show_bug.cgi?id=19195
- case " $CFLAGS " in
- *[\ \ ]-Wno-format[\ \ ]*) ;;
- *) CFLAGS="$CFLAGS -Wno-format" ;;
esac
-
+
# This one is special - it's not a warning override.
# http://bugs.freedesktop.org/show_bug.cgi?id=10599
case " $CFLAGS " in
case " $CFLAGS " in
*[\ \ ]-pedantic[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -pedantic" ;;
- esac
+ esac
fi
if test x$enable_gcov = xyes; then
case " $CFLAGS " in
fi
AC_SUBST(PIC_CFLAGS)
-AC_SUBST(PIC_LDFLAGS)
+AC_SUBST(PIC_LDFLAGS)
AC_SUBST(PIE_CFLAGS)
-AC_SUBST(PIE_LDFLAGS)
+AC_SUBST(PIE_LDFLAGS)
if ld_supports_flag --gc-sections; then
SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS"
AC_SUBST(SECTION_LDFLAGS)
AC_MSG_RESULT($ac_gcsections)
-# Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris
-#
case $host_os in
solaris*)
- CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
+ # Solaris' C library apparently needs these runes to be threadsafe...
+ CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
esac
-
+
changequote(,)dnl
# compress spaces in flags
CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
fi
AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
-AC_MSG_RESULT(yes)
+AC_MSG_RESULT($enable_doxygen_docs)
### XML Documentation
fi
AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes)
-AC_MSG_RESULT(yes)
+AC_MSG_RESULT($enable_xml_docs)
+
+AC_PATH_PROG([MAN2HTML], [man2html])
+AC_ARG_VAR([MAN2HTML], [Path to man2html (optional)])
+AM_CONDITIONAL(DBUS_HAVE_MAN2HTML, test x$MAN2HTML != x)
+
+AM_CONDITIONAL(DBUS_CAN_UPLOAD_DOCS,
+ test x$enable_doxygen_docs = xyes -a x$enable_xml_docs = xyes -a \
+ x$MAN2HTML != x)
#### Have to go $localstatedir->$prefix/var->/usr/local/var
#### find the actual value for $prefix that we'll end up with
## (I know this is broken and should be done in the Makefile, but
## that's a major pain and almost nobody actually seems to care)
+AS_AC_EXPAND(EXPANDED_PREFIX, "$prefix")
AS_AC_EXPAND(EXPANDED_LOCALSTATEDIR, "$localstatedir")
AS_AC_EXPAND(EXPANDED_SYSCONFDIR, "$sysconfdir")
AS_AC_EXPAND(EXPANDED_BINDIR, "$bindir")
operating_system=slackware
fi
+if test -f /usr/bin/cygwin1.dll || test -f $EXPANDED_BINDIR/cygwin1.dll ; then
+ operating_system=cygwin
+fi
+
#### Sort out init scripts
if test x$with_init_scripts = x; then
- if test xredhat = x$operating_system ; then
- with_init_scripts=redhat
- else
- if test xslackware = x$operating_system ; then
- with_init_scripts=slackware
- else
- with_init_scripts=none
- fi
- fi
+ case x$operating_system in
+ xredhat) with_init_scripts=redhat ;;
+ xslackware) with_init_scripts=slackware ;;
+ xcygwin) with_init_scripts=cygwin ;;
+ *) with_init_scripts=none ;;
+ esac
fi
AM_CONDITIONAL(DBUS_INIT_SCRIPTS_RED_HAT, test x$with_init_scripts = xredhat)
-
AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
+AM_CONDITIONAL(DBUS_INIT_SCRIPTS_CYGWIN, test x$with_init_scripts = xcygwin)
+
+##### systemd unit files
+AC_ARG_WITH([systemdsystemunitdir],
+AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
+if test "x$with_systemdsystemunitdir" != xno; then
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+fi
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
##### Set up location for system bus socket
if ! test -z "$with_system_socket"; then
AC_SUBST(DBUS_SYSTEM_SOCKET)
AC_DEFINE_UNQUOTED(DBUS_SYSTEM_SOCKET,"$DBUS_SYSTEM_SOCKET",[The name of the socket the system bus listens on by default])
-## system bus only listens on local domain sockets, and never
+## system bus only listens on local domain sockets, and never
## on an abstract socket (so only root can create the socket)
DBUS_SYSTEM_BUS_DEFAULT_ADDRESS="unix:path=$DBUS_SYSTEM_SOCKET"
AC_SUBST(DBUS_SYSTEM_BUS_DEFAULT_ADDRESS)
AC_SUBST(DBUS_USER)
AC_DEFINE_UNQUOTED(DBUS_USER,"$DBUS_USER", [User for running the system BUS daemon])
+#### Prefix to install into
+DBUS_PREFIX=$EXPANDED_PREFIX
+AC_SUBST(DBUS_PREFIX)
+AC_DEFINE_UNQUOTED(DBUS_PREFIX,"$DBUS_PREFIX", [Prefix for installing DBUS])
+
#### Direcotry to install data files into
DBUS_DATADIR=$EXPANDED_DATADIR
AC_SUBST(DBUS_DATADIR)
#### Tell tests where to find certain stuff in builddir
DBUS_PWD=`pwd`
+# Useful in a cross-compilation environment, where the tests are run on the host system.
+AC_ARG_WITH(dbus-test-dir, AS_HELP_STRING([--with-dbus-test-dir=[dirname]],[path where the tests tools are available]),
+ DBUS_PWD=$withval)
AC_DEFUN([TEST_PATH], [
TEST_$1=${DBUS_PWD}/test/$2
AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1",
[Full path to test file test/$2 in builddir])
AC_SUBST(TEST_$1)
])
+AC_DEFUN([TEST_PROG], [
+TEST_$1=${DBUS_PWD}/test/$2
+AC_DEFINE_UNQUOTED(TEST_$1, "$TEST_$1$EXEEXT",
+ [Full path to test file test/$2 in builddir])
+AC_SUBST(TEST_$1)
+])
TEST_PATH(VALID_SERVICE_DIR, data/valid-service-files)
TEST_PATH(INVALID_SERVICE_DIR, data/invalid-service-files)
TEST_PATH(VALID_SERVICE_SYSTEM_DIR, data/valid-service-files-system)
TEST_PATH(INVALID_SERVICE_SYSTEM_DIR, data/invalid-service-files-system)
-TEST_PATH(SERVICE_BINARY, test-service)
-TEST_PATH(SHELL_SERVICE_BINARY, test-shell-service)
-TEST_PATH(EXIT_BINARY, test-exit)
-TEST_PATH(SEGFAULT_BINARY, test-segfault)
-TEST_PATH(SLEEP_FOREVER_BINARY, test-sleep-forever)
-TEST_PATH(PRIVSERVER_BINARY, name-test/test-privserver)
-
-AC_DEFINE_UNQUOTED(TEST_BUS_BINARY, "$DBUS_PWD/bus/dbus-daemon",
+TEST_PROG(SERVICE_BINARY, test-service)
+TEST_PROG(SHELL_SERVICE_BINARY, test-shell-service)
+TEST_PROG(EXIT_BINARY, test-exit)
+TEST_PROG(SEGFAULT_BINARY, test-segfault)
+TEST_PROG(SLEEP_FOREVER_BINARY, test-sleep-forever)
+TEST_PROG(PRIVSERVER_BINARY, name-test/test-privserver)
+
+AC_DEFINE_UNQUOTED(TEST_BUS_BINARY, "$DBUS_PWD/bus/dbus-daemon$EXEEXT",
[Full path to the daemon in the builddir])
AC_SUBST(TEST_BUS_BINARY)
## Export the non-setuid external helper
-TEST_LAUNCH_HELPER_BINARY="$DBUS_PWD/bus/dbus-daemon-launch-helper-test"
+TEST_LAUNCH_HELPER_BINARY="$DBUS_PWD/bus/dbus-daemon-launch-helper-test$EXEEXT"
AC_SUBST(TEST_LAUNCH_HELPER_BINARY)
AC_DEFINE_UNQUOTED(DBUS_TEST_LAUNCH_HELPER_BINARY, "$TEST_LAUNCH_HELPER_BINARY",
[Full path to the launch helper test program in the builddir])
DEFAULT_SOCKET_DIR=/tmp
fi
+DEFAULT_SOCKET_DIR=`echo $DEFAULT_SOCKET_DIR | sed 's/+/%2B/g'`
+
if ! test -z "$with_test_socket_dir" ; then
TEST_SOCKET_DIR="$with_test_socket_dir"
else
AC_DEFINE_UNQUOTED(DBUS_SESSION_SOCKET_DIR, "$DBUS_SESSION_SOCKET_DIR", [Where per-session bus puts its sockets])
AC_SUBST(DBUS_SESSION_SOCKET_DIR)
-AC_DEFINE_UNQUOTED(DBUS_UNIX, "1", [Defined on UNIX and Linux systems and not on Windows])
+if test x$dbus_win = xyes; then
+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="nonce-tcp:"
+elif test x$have_launchd = xyes; then
+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="launchd:env=DBUS_LAUNCHD_SESSION_BUS_SOCKET"
+else
+ DBUS_SESSION_BUS_DEFAULT_ADDRESS="unix:tmpdir=$DBUS_SESSION_SOCKET_DIR"
+fi
+AC_SUBST(DBUS_SESSION_BUS_DEFAULT_ADDRESS)
# darwin needs this to initialize the environment
AC_CHECK_HEADERS(crt_externs.h)
AC_OUTPUT([
Doxyfile
+dbus/versioninfo.rc
dbus/dbus-arch-deps.h
bus/system.conf
bus/session.conf
bus/messagebus
+bus/messagebus-config
+bus/org.freedesktop.dbus-session.plist
bus/rc.messagebus
-bus/dbus-daemon.1
+bus/dbus.service
+bus/dbus.socket
Makefile
dbus/Makefile
bus/Makefile
test/Makefile
test/name-test/Makefile
doc/Makefile
+doc/dbus-daemon.1
dbus-1.pc
test/data/valid-config-files/debug-allow-all.conf
test/data/valid-config-files/debug-allow-all-sha1.conf
test/data/valid-config-files-system/debug-allow-all-fail.conf
test/data/valid-service-files/org.freedesktop.DBus.TestSuite.PrivServer.service
test/data/valid-service-files/org.freedesktop.DBus.TestSuiteEchoService.service
+test/data/valid-service-files/org.freedesktop.DBus.TestSuiteForkingEchoService.service
test/data/valid-service-files/org.freedesktop.DBus.TestSuiteSegfaultService.service
test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceSuccess.service
test/data/valid-service-files/org.freedesktop.DBus.TestSuiteShellEchoServiceFail.service
D-Bus $VERSION
==============
- prefix: ${prefix}
+ prefix: ${EXPANDED_PREFIX}
exec_prefix: ${exec_prefix}
libdir: ${EXPANDED_LIBDIR}
libexecdir: ${EXPANDED_LIBEXECDIR}
64-bit int: ${DBUS_INT64_TYPE}
32-bit int: ${DBUS_INT32_TYPE}
16-bit int: ${DBUS_INT16_TYPE}
- Doxygen: ${DOXYGEN}
- xmlto: ${XMLTO}"
+ Doxygen: ${DOXYGEN:-not found}
+ xmlto: ${XMLTO:-not found}
+ man2html: ${MAN2HTML:-not found}"
echo "
Maintainer mode: ${USE_MAINTAINER_MODE}
Building Doxygen docs: ${enable_doxygen_docs}
Building XML docs: ${enable_xml_docs}
Building cache support: ${enable_userdb_cache}
- Gettext libs (empty OK): ${INTLLIBS}
+ Building launchd support: ${have_launchd}
Using XML parser: ${with_xml}
Init scripts style: ${with_init_scripts}
Abstract socket names: ${ac_cv_have_abstract_sockets}
System bus socket: ${DBUS_SYSTEM_SOCKET}
System bus address: ${DBUS_SYSTEM_BUS_DEFAULT_ADDRESS}
System bus PID file: ${DBUS_SYSTEM_PID_FILE}
- Session bus socket dir: ${DBUS_SESSION_SOCKET_DIR}
+ Session bus address: ${DBUS_SESSION_BUS_DEFAULT_ADDRESS}
Console auth dir: ${DBUS_CONSOLE_AUTH_DIR}
Console owner file: ${have_console_owner_file}
Console owner file path: ${DBUS_CONSOLE_OWNER_FILE}
Session bus services dir: ${EXPANDED_DATADIR}/dbus-1/services
'make check' socket dir: ${TEST_SOCKET_DIR}
"
+if test x$have_launchd = xyes; then
+ echo " launchd agent dir: ${LAUNCHD_AGENT_DIR}"
+fi
+echo
if test x$enable_tests = xyes; then
echo "NOTE: building with unit tests increases the size of the installed library and renders it insecure."