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])
]
)
-#### Integer sizes
+#### Integer sizes
AC_CHECK_SIZEOF(char)
AC_CHECK_SIZEOF(short)
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>
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,
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
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[\ \ ]*) ;;
fi
;;
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'`
AM_CONDITIONAL(DBUS_INIT_SCRIPTS_SLACKWARE, test x$with_init_scripts = xslackware)
+##### 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)])
+AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir"])
+
##### Set up location for system bus socket
if ! test -z "$with_system_socket"; then
DBUS_SYSTEM_SOCKET=$with_system_socket
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)
bus/messagebus
bus/rc.messagebus
bus/dbus-daemon.1
+bus/dbus.service
+bus/dbus.socket
Makefile
dbus/Makefile
bus/Makefile