AC_PREREQ(2.52)
m4_define([dbus_major_version], [1])
-m4_define([dbus_minor_version], [3])
+m4_define([dbus_minor_version], [4])
m4_define([dbus_micro_version], [1])
m4_define([dbus_version],
[dbus_major_version.dbus_minor_version.dbus_micro_version])
## 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
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=1
+LT_REVISION=2
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
# 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
;;
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_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]))
-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
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>
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
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)])
[[
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));
addr.sun_family = AF_UNIX;
strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
addr.sun_path[0] = '\0'; /* this is what makes it abstract */
-
+
if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 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
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
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)
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-ng, capng_clear,
NETWORK_libs=
if test x$dbus_win = xyes ; then
- NETWORK_libs="-lws2_32"
+ if test x$dbus_wince = xyes ; then
+ NETWORK_libs="-lws2"
+ else
+ NETWORK_libs="-lws2_32"
+ fi
fi
#### Set up final flags
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
}
# Don't bother with -Werror on Windows for now, too many warnings
-if test x$dbus_win != xyes -a x$USE_MAINTAINER_MODE = xyes; then
+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"
+ CFLAGS="$CFLAGS -Wfloat-equal"
fi
;;
esac
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"
solaris*)
CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS" ;;
esac
-
+
changequote(,)dnl
# compress spaces in flags
CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
#### 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)
bus/system.conf
bus/session.conf
bus/messagebus
+bus/messagebus-config
bus/rc.messagebus
bus/dbus-daemon.1
+bus/dbus.service
+bus/dbus.socket
Makefile
dbus/Makefile
bus/Makefile
D-Bus $VERSION
==============
- prefix: ${prefix}
+ prefix: ${EXPANDED_PREFIX}
exec_prefix: ${exec_prefix}
libdir: ${EXPANDED_LIBDIR}
libexecdir: ${EXPANDED_LIBEXECDIR}