dnl -*- mode: m4 -*-
-AC_PREREQ(2.52)
+AC_PREREQ([2.63])
m4_define([dbus_major_version], [1])
m4_define([dbus_minor_version], [4])
-m4_define([dbus_micro_version], [7])
+m4_define([dbus_micro_version], [9])
m4_define([dbus_version],
[dbus_major_version.dbus_minor_version.dbus_micro_version])
-AC_INIT(dbus, [dbus_version])
+AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus])
AC_CANONICAL_HOST
-AC_LIBTOOL_WIN32_DLL
-AC_LIBTOOL_RC
+AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])
-AM_INIT_AUTOMAKE([1.9 tar-ustar -Wno-portability])
-AM_CONFIG_HEADER(config.h)
-
-# Honor aclocal flags
-ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
+AM_INIT_AUTOMAKE([1.10 tar-ustar -Wno-portability])
GETTEXT_PACKAGE=dbus-1
AC_SUBST(GETTEXT_PACKAGE)
## increment any time the source changes; set to
## 0 if you increment CURRENT
-LT_REVISION=4
+LT_REVISION=5
## increment if any interfaces have been added; set to 0
## if any interfaces have been changed or removed. removal has
COMPILER_COVERAGE
COMPILER_OPTIMISATIONS
+# Initialize libtool
+LT_INIT([win32-dll])
+LT_LANG([Windows Resource])
+
# Set some internal variables depending on the platform for later use.
dbus_win=no
dbus_cygwin=no
AC_CHECK_SIZEOF(long long)
AC_CHECK_SIZEOF(__int64)
+AC_ARG_WITH([64-bit],
+ [AS_HELP_STRING([--without-64-bit],
+ [If you have to use this option, please report it as a bug])],
+ [],
+ [with_64_bit=yes])
+
### See what our 64 bit type is called
AC_MSG_CHECKING([64-bit integer type])
;;
esac
-if test -z "$dbusint64" ; then
+AS_IF(
+ [test "x$with_64_bit" = xno],
+ [
DBUS_INT64_TYPE="no_int64_type_detected"
DBUS_HAVE_INT64=0
DBUS_INT64_CONSTANT=
DBUS_UINT64_CONSTANT=
- AC_MSG_RESULT([none found])
-else
+ AC_MSG_RESULT([disabled via --without-64-bit])
+ ],
+ dnl else if
+ [test -z "$dbusint64"],
+ [AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Could not find a 64-bit integer type.
+
+Please report a bug here with details of your platform and compiler:
+
+ http://bugs.freedesktop.org/enter_bug.cgi?product=DBus&component=core
+
+To compile D-Bus with all 64-bit integer types removed (not recommended), use
+the option "--without-64-bit".
+
+This option is likely to be removed in future, unless you report that your
+platform needs it.])
+ ],
+ dnl else
+ [
DBUS_INT64_TYPE="$dbusint64"
DBUS_HAVE_INT64=1
DBUS_INT64_CONSTANT="$dbusint64_constant"
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_SUBST(DBUS_INT64_TYPE)
AC_SUBST(DBUS_INT64_CONSTANT)
dnl check for socklen_t
AC_MSG_CHECKING(whether socklen_t is defined)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
-],[
+]], [[
socklen_t foo;
foo = 1;
-],dbus_have_socklen_t=yes,dbus_have_socklen_t=no)
+]])],
+[dbus_have_socklen_t=yes],
+[dbus_have_socklen_t=no])
AC_MSG_RESULT($dbus_have_socklen_t)
if test "x$dbus_have_socklen_t" = "xyes"; then
dnl check for flavours of varargs macros (test from GLib)
AC_MSG_CHECKING(for ISO C99 varargs macros in C)
-AC_TRY_COMPILE([],[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
int a(int p1, int p2, int p3);
#define call_a(...) a(1,__VA_ARGS__)
call_a(2,3);
-],dbus_have_iso_c_varargs=yes,dbus_have_iso_c_varargs=no)
+]])],
+[dbus_have_iso_c_varargs=yes],
+[dbus_have_iso_c_varargs=no])
AC_MSG_RESULT($dbus_have_iso_c_varargs)
AC_MSG_CHECKING(for GNUC varargs macros)
-AC_TRY_COMPILE([],[
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
int a(int p1, int p2, int p3);
#define call_a(params...) a(1,params)
call_a(2,3);
-],dbus_have_gnuc_varargs=yes,dbus_have_gnuc_varargs=no)
+]])],
+[dbus_have_gnuc_varargs=yes],
+[dbus_have_gnuc_varargs=no])
AC_MSG_RESULT($dbus_have_gnuc_varargs)
dnl Output varargs tests
dnl Check for various credentials.
AC_MSG_CHECKING(for struct cmsgcred)
-AC_TRY_COMPILE([
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h>
#include <sys/socket.h>
-],[
+]], [[
struct cmsgcred cred;
cred.cmcred_pid = 0;
-],dbus_have_struct_cmsgcred=yes,dbus_have_struct_cmsgcred=no)
+]])],
+[dbus_have_struct_cmsgcred=yes],
+[dbus_have_struct_cmsgcred=no])
AC_MSG_RESULT($dbus_have_struct_cmsgcred)
if test x$dbus_have_struct_cmsgcred = xyes; then
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>
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#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)
+]])],
+[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])
# see if we have the SELinux header with the new D-Bus stuff in it
if test x$have_selinux = xyes ; then
AC_MSG_CHECKING([for DBUS Flask permissions in selinux/av_permissions.h])
- AC_TRY_COMPILE([#include <selinux/av_permissions.h>],
- [#ifdef DBUS__ACQUIRE_SVC return 0;
- #else
- #error DBUS__ACQUIRE_SVC not defined
- #endif],
- have_selinux=yes, have_selinux=no)
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <selinux/av_permissions.h>]],
+ [[#ifdef DBUS__ACQUIRE_SVC return 0;
+ #else
+ #error DBUS__ACQUIRE_SVC not defined
+ #endif]])],
+ [have_selinux=yes],
+ [have_selinux=no])
AC_MSG_RESULT($have_selinux)
fi
AC_SUBST(DBUS_TEST_LIBS)
### X11 detection
-if test x$dbus_win = xyes ; then
- enable_x11=no
-else
-AC_PATH_XTRA
+DBUS_X_LIBS=
+DBUS_X_CFLAGS=
+
+AC_ARG_ENABLE([x11-autolaunch],
+ AS_HELP_STRING([--enable-x11-autolaunch], [build with X11 auto-launch support]),
+ [], [enable_x11_autolaunch=auto])
+
+if test "x$dbus_win" = xyes; then
+ if test "x$enable_x11_autolaunch" = xyes; then
+ AC_MSG_ERROR([X11 auto-launch is not supported on Windows])
+ fi
+
+ enable_x11_autolaunch=no
+fi
-## for now enable_x11 just tracks have_x11,
-## there's no --enable-x11
-if test x$no_x = xyes ; then
- have_x11=no
- enable_x11=no
+if test "x$enable_x11_autolaunch" = xno; then
+ have_x11=no
else
- have_x11=yes
- enable_x11=yes
+ AC_PATH_XTRA
+
+ if test "x$no_x" = xyes; then
+ have_x11=no
+ else
+ have_x11=yes
+ DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
+ DBUS_X_CFLAGS="$X_CFLAGS"
+ fi
fi
-if test x$enable_x11 = xyes ; then
- AC_DEFINE(DBUS_BUILD_X11,1,[Build X11-dependent code])
- DBUS_X_LIBS="$X_LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
- DBUS_X_CFLAGS="$X_CFLAGS"
+if test "x$enable_x11_autolaunch,$have_x11" = xyes,no; then
+ AC_MSG_ERROR([X11 auto-launch requires X headers/libraries])
else
- DBUS_X_LIBS=
- DBUS_X_CFLAGS=
+ # move from "auto" to "yes" or "no" if necessary
+ enable_x11_autolaunch="$have_x11"
fi
-AC_SUBST(DBUS_X_CFLAGS)
-AC_SUBST(DBUS_X_LIBS)
+if test "x$enable_x11_autolaunch" = xyes ; then
+ AC_DEFINE([DBUS_BUILD_X11], [1], [Define to enable X11 auto-launch])
fi
+AC_SUBST([DBUS_X_CFLAGS])
+AC_SUBST([DBUS_X_LIBS])
#### gcc warning flags
ld_supports_flag() {
AC_MSG_CHECKING([whether $LD supports "$@"])
- AC_TRY_LINK([
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
int one(void) { return 1; }
int two(void) { return 2; }
- ], [ two(); ] , [_ac_ld_flag_supported=yes], [_ac_ld_flag_supported=no])
+ ]], [[ two(); ]])],
+ [_ac_ld_flag_supported=yes],
+ [_ac_ld_flag_supported=no])
if test "$_ac_ld_flag_supported" = "yes"; then
rm -f conftest.c
fi
fi
-if test "x$GCC" = "xyes"; then
- changequote(,)dnl
+dnl This whole "if" block is in m4 quotes ([]) because it uses them
+dnl for character ranges internally. m4 macros cannot be used inside this
+dnl block.
+[if test "x$GCC" = "xyes"; then
case " $CFLAGS " in
*[\ \ ]-Wall[\ \ ]*) ;;
*) CFLAGS="$CFLAGS -Wall" ;;
*) CFLAGS="$CFLAGS -pedantic" ;;
esac
fi
- changequote([,])dnl
-fi
+fi]
AC_SUBST(PIC_CFLAGS)
AC_SUBST(PIC_LDFLAGS)
CFLAGS="$CFLAGS -D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT"
esac
-changequote(,)dnl
-# compress spaces in flags
-CFLAGS=`echo "$CFLAGS" | sed -e 's/ +/ /g'`
-CXXFLAGS=`echo "$CXXFLAGS" | sed -e 's/ +/ /g'`
-CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/ +/ /g'`
-changequote([,])dnl
-
### Doxygen Documentation
AC_PATH_PROG(DOXYGEN, doxygen, no)
AM_CONDITIONAL(DBUS_DOXYGEN_DOCS_ENABLED, test x$enable_doxygen_docs = xyes)
AC_MSG_RESULT($enable_doxygen_docs)
+XSLTPROC=false
+AC_CHECK_PROGS([XSLTPROC], [xsltproc])
+AM_CONDITIONAL(DBUS_HAVE_XSLTPROC, test "$XSLTPROC" != false)
+
### XML Documentation
AC_PATH_PROG(XMLTO, xmlto, no)
#endif
])
-AC_OUTPUT([
+AC_CONFIG_FILES([
Doxyfile
dbus/versioninfo.rc
dbus/dbus-arch-deps.h
test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoUser.service
test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoService.service
])
+AC_OUTPUT
dnl ==========================================================================
echo "
echo
echo "WARNING: You have chosen to use libxml as your xml parser however this code path is not maintained by the D-Bus developers and if it breaks you get to keep the pieces. If you have selected this option in err please reconfigure with expat (e.g. --with-xml=expat)."
fi
+
+if test "x$DBUS_HAVE_INT64" = x0; then
+ AC_MSG_WARN([You have disabled 64-bit integers via --without-64-bit.
+
+ This removes parts of the standard D-Bus API and ABI (the 't' and 'x'
+ typecodes, the dbus_int64_t and dbus_uint64_t types, etc.) and should only be
+ used if your compiler lacks support for 64-bit integers. Please report a bug
+ with details of your platform and compiler.
+
+ This option is likely to be removed in future, unless the D-Bus developers
+ receive reports that it is still needed.
+ ])
+fi