X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=configure.ac;h=39ae389c205871d59bda0c41cd81db2013b95478;hb=7d9239c9c78cb6d0b9c282376fcf3cda1de23209;hp=b0f2ec201cf9b6335f6e185013b5b7e7e5ca222d;hpb=9fafead23d5a8f66ea65c36b450017b10cf8b5fb;p=platform%2Fupstream%2Fdbus.git diff --git a/configure.ac b/configure.ac index b0f2ec2..39ae389 100644 --- a/configure.ac +++ b/configure.ac @@ -2,8 +2,8 @@ dnl -*- mode: m4 -*- AC_PREREQ([2.63]) m4_define([dbus_major_version], [1]) -m4_define([dbus_minor_version], [6]) -m4_define([dbus_micro_version], [255]) +m4_define([dbus_minor_version], [7]) +m4_define([dbus_micro_version], [5]) m4_define([dbus_version], [dbus_major_version.dbus_minor_version.dbus_micro_version]) AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus]) @@ -33,7 +33,7 @@ AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable]) # ## increment if the interface has additions, changes, removals. -LT_CURRENT=10 +LT_CURRENT=11 ## increment any time the source changes; set to ## 0 if you increment CURRENT @@ -42,7 +42,7 @@ LT_REVISION=2 ## 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=7 +LT_AGE=8 AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) @@ -150,15 +150,14 @@ AC_ARG_ENABLE(doxygen-docs, AS_HELP_STRING([--enable-doxygen-docs],[build DOXYGE 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) AC_ARG_ENABLE(selinux, AS_HELP_STRING([--enable-selinux],[build with SELinux support]),enable_selinux=$enableval,enable_selinux=auto) AC_ARG_ENABLE(libaudit,AS_HELP_STRING([--enable-libaudit],[build audit daemon support for SELinux]),enable_libaudit=$enableval,enable_libaudit=auto) -AC_ARG_ENABLE(dnotify, AS_HELP_STRING([--enable-dnotify],[build with dnotify support (linux only)]),enable_dnotify=$enableval,enable_dnotify=auto) AC_ARG_ENABLE(inotify, AS_HELP_STRING([--enable-inotify],[build with inotify support (linux only)]),enable_inotify=$enableval,enable_inotify=auto) 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_ENABLE(systemd, AS_HELP_STRING([--enable-systemd],[build with systemd at_console support]),enable_systemd=$enableval,enable_systemd=auto) +AC_ARG_ENABLE(kdbus-transport, AS_HELP_STRING([--enable-kdbus-transport],[build with kdbus transport support]),enable_kdbus_transport=$enableval,enable_kdbus_transport=no) -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])) @@ -194,16 +193,12 @@ AC_ARG_ENABLE([tests], []) # DBUS_ENABLE_EMBEDDED_TESTS controls unit tests built in to .c files -# and also some stuff in the test/ subdir. DBUS_BUILD_TESTS was an older -# name for this. -AM_CONDITIONAL([DBUS_BUILD_TESTS], [test "x$enable_embedded_tests" = xyes]) +# and also some stuff in the test/ subdir. AM_CONDITIONAL([DBUS_ENABLE_EMBEDDED_TESTS], [test "x$enable_embedded_tests" = xyes]) if test "x$enable_embedded_tests" = xyes; then AC_DEFINE([DBUS_ENABLE_EMBEDDED_TESTS], [1], [Define to build test code into the library and binaries]) - AC_DEFINE([DBUS_BUILD_TESTS], [1], - [Define to build test code into the library and binaries]) fi # DBUS_ENABLE_MODULAR_TESTS controls tests that work based on public API. @@ -211,9 +206,13 @@ fi # default (unless you don't have GLib), because they don't bloat the library # or binaries. +AC_DEFINE([GLIB_VERSION_MIN_REQUIRED], [GLIB_VERSION_2_26], [Ignore post-2.26 deprecations]) +AC_DEFINE([GLIB_VERSION_MAX_ALLOWED], [GLIB_VERSION_2_32], [Prevent post-2.32 APIs]) + with_glib=yes -if test "x$enable_modular_tests" != xno; then +AS_IF([test "x$enable_modular_tests" != xno], + [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.24, gio-2.0 >= 2.24], [], [if test "x$enable_modular_tests" = xyes; then @@ -222,16 +221,25 @@ if test "x$enable_modular_tests" != xno; then else # assumed to be "auto" with_glib=no fi]) - # If dbus-gmain.[ch] returned to libdbus then we wouldn't need this - PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1], + ], + [with_glib=no]) + +# Not required, because we can use internal APIs (but that makes the +# "installable tests" less useful as integration tests) +AC_ARG_WITH([dbus_glib], + [AS_HELP_STRING([--with-dbus-glib], [Use dbus-glib for regression tests])], + [], + [with_dbus_glib=auto]) +AS_IF([test "x$with_dbus_glib" != xno], + [PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1], [], - [if test "x$enable_modular_tests" = xyes; then - AC_MSG_NOTICE([Full test coverage (--enable-modular-tests=yes or --enable-tests=yes) requires dbus-glib]) - AC_MSG_ERROR([$DBUS_GLIB_ERRORS]) - else # assumed to be "auto" - with_glib=no - fi]) -fi + [AS_IF([test "x$with_dbus_glib" = xyes], + dnl specifically requested, but not found + [AC_MSG_ERROR([$DBUS_GLIB_ERRORS])], + dnl else: assumed to be "auto" + [with_dbus_glib=no])])]) +AM_CONDITIONAL([DBUS_WITH_DBUS_GLIB], [test "x$with_dbus_glib" != xno]) + if test "x$enable_modular_tests" != xno; then AC_DEFINE([DBUS_ENABLE_MODULAR_TESTS], [1], [Define to build independent test binaries]) @@ -276,6 +284,11 @@ if test x$enable_asserts = xno; then AC_DEFINE(DBUS_DISABLE_ASSERT,1,[Disable assertion checking]) DISABLE_UNUSED_WARNINGS="unused-label" R_DYNAMIC_LDFLAG="" + if test x$enable_embedded_tests = xyes; then + DISABLE_UNUSED_WARNINGS="$DISABLE_UNUSED_WARNINGS \ + unused-but-set-variable unused-variable \ + unused-function" + fi else # -rdynamic is needed for glibc's backtrace_symbols to work. # No clue how much overhead this adds, but it's useful @@ -295,6 +308,15 @@ if test x$enable_checks = xno; then DISABLE_UNUSED_WARNINGS="unused-label" fi +AH_BOTTOM([ +/* explicitly define these macros to get less confusing conditions */ +#ifndef DBUS_DISABLE_ASSERT +# define DBUS_ENABLE_ASSERT 1 +#endif +#ifndef DBUS_DISABLE_CHECKS +# define DBUS_ENABLE_CHECKS 1 +#endif]) + if test x$enable_userdb_cache = xyes; then AC_DEFINE(DBUS_ENABLE_USERDB_CACHE,1,[Build with caching of user data]) fi @@ -685,6 +707,8 @@ AC_CHECK_HEADERS(ws2tcpip.h) AC_CHECK_HEADERS(wspiapi.h) +AC_CHECK_HEADERS(alloca.h) + # Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris # case $host_os in @@ -905,62 +929,64 @@ PKG_PROG_PKG_CONFIG #### Sort out XML library -# see what we have AC_CHECK_LIB(expat, XML_ParserCreate_MM, - [ AC_CHECK_HEADERS(expat.h, have_expat=true, have_expat=false) ], - have_expat=false) - -# see what we want to use -dbus_use_libxml=false -dbus_use_expat=false -if test x$with_xml = xexpat; then - if ! $have_expat ; then - AC_MSG_ERROR([Explicitly requested expat but expat not found]) - fi - dbus_use_expat=true -elif test x$with_xml = xlibxml; then - PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.6.0, have_libxml=true, have_libxml=false) - if ! $have_libxml ; then - AC_MSG_ERROR([Explicitly requested libxml but libxml not found]) - fi - dbus_use_libxml=true -else - ### 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 - AC_MSG_ERROR([Could not find expat.h, check config.log for failed attempts]) - fi - ### By default, only use Expat since it's tested and known to work. If you're a - ### general-purpose OS vendor, please don't enable libxml. For embedded use - ### if your OS is built around libxml, that's another case. - dbus_use_expat=true -fi - -AM_CONDITIONAL(DBUS_USE_EXPAT, $dbus_use_expat) -AM_CONDITIONAL(DBUS_USE_LIBXML, $dbus_use_libxml) + [ AC_CHECK_HEADERS(expat.h, [], + [AC_MSG_ERROR([Could not find expat.h, check config.log for failed attempts])]) ], + [ AC_MSG_ERROR([Explicitly requested expat but expat not found]) ]) -if $dbus_use_expat; then - XML_LIBS=-lexpat - XML_CFLAGS= -fi -if $dbus_use_libxml; then - XML_LIBS=$LIBXML_LIBS - XML_CFLAGS=$LIBXML_CFLAGS -fi +XML_LIBS=-lexpat +XML_CFLAGS= AC_SUBST([XML_CFLAGS]) AC_SUBST([XML_LIBS]) # Thread lib detection -AC_CHECK_FUNC(pthread_cond_timedwait,[AC_CHECK_LIB(pthread,pthread_cond_timedwait, - [THREAD_LIBS="-lpthread"])]) +AC_ARG_VAR([THREAD_LIBS]) 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_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + +is_missing_pthread_function="is required when compiling D-Bus on Unix platforms, but is not in your libc or libpthread. Please open a bug on https://bugs.freedesktop.org/enter_bug.cgi?product=dbus with details of your platform." + +# Don't do these automatic checks if the user set THREAD_LIBS on the +# configure command-line. If they did, we assume they're right. +# +# We also don't do these checks on Windows, because you don't need magical +# linker flags to have threading support there. +AS_IF([test "x$dbus_unix" = xyes && test "x$THREAD_LIBS" = x], + [ + # Mandatory pthread functions. In principle, some of these could be made + # optional if there are platforms that don't have them. + # + # Currently, we only look in -lpthread. + # In principle we might need to look in -lpthreads, -lthreads, ... + # as well - please file a bug if your platform needs this. + AC_SEARCH_LIBS([pthread_cond_timedwait], + [pthread], + [THREAD_LIBS="$LIBS"], + [AC_MSG_ERROR([pthread_cond_timedwait $is_missing_pthread_function])], + []) + AC_SEARCH_LIBS([pthread_mutexattr_init], + [pthread], + [THREAD_LIBS="$LIBS"], + [AC_MSG_ERROR([pthread_mutexattr_init $is_missing_pthread_function])], + []) + AC_SEARCH_LIBS([pthread_mutexattr_settype], + [pthread], + [THREAD_LIBS="$LIBS"], + [AC_MSG_ERROR([pthread_mutexattr_settype $is_missing_pthread_function])], + []) + + # Optional, for monotonic clocks. Because it's optional, this check + # is non-fatal if we don't find it. + AC_SEARCH_LIBS([pthread_condattr_setclock], + [pthread], + [THREAD_LIBS="$LIBS"]) + + AS_IF([test "x$ac_cv_search_pthread_condattr_setclock" != xno], + [ + AC_SEARCH_LIBS([clock_getres], [rt], [THREAD_LIBS="$LIBS"]) + AC_MSG_CHECKING([for CLOCK_MONOTONIC]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[[#include #include ]], [[ struct timespec monotonic_timer; @@ -969,15 +995,17 @@ 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 + [have_clock_monotonic=true], + [have_clock_monotonic=false]) + AS_IF([test x$have_clock_monotonic = xtrue], + [ + AC_MSG_RESULT([found]) + AC_DEFINE(HAVE_MONOTONIC_CLOCK, 1, [Define if we have CLOCK_MONOTONIC]) + ], + [AC_MSG_RESULT([not found])]) + ]) dnl have pthread_condattr_setclock + ]) dnl on Unix + LIBS="$save_libs" AC_SUBST([THREAD_LIBS]) @@ -1043,24 +1071,6 @@ fi AM_CONDITIONAL(DBUS_BUS_ENABLE_INOTIFY, test x$have_inotify = xyes) -# dnotify checks -if test x$enable_dnotify = xno ; then - 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; - else - have_dnotify=no; - fi -fi - -dnl check if dnotify backend is enabled -if test x$have_dnotify = xyes; then - AC_DEFINE(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX,1,[Use dnotify on Linux]) -fi - -AM_CONDITIONAL(DBUS_BUS_ENABLE_DNOTIFY_ON_LINUX, test x$have_dnotify = xyes) - # For simplicity, we require the userland API for epoll_create1 at # compile-time (glibc 2.9), but we'll run on kernels that turn out # not to have it at runtime. @@ -1234,7 +1244,7 @@ if test x$dbus_win = xyes ; then if test x$dbus_wince = xyes ; then NETWORK_libs="-lws2" else - NETWORK_libs="-lws2_32" + NETWORK_libs="-lws2_32 -liphlpapi" fi fi @@ -1251,10 +1261,34 @@ if test x$with_valgrind != xno; then AC_DEFINE([WITH_VALGRIND], [1], [Define to add Valgrind instrumentation]) fi +# Determine maximum number of Unix fds which may be passed +AS_CASE([$host_os], + [*qnx*], + [DEFAULT_MESSAGE_UNIX_FDS=256], + [*], + [DEFAULT_MESSAGE_UNIX_FDS=1024]) +AC_DEFINE_UNQUOTED([DBUS_DEFAULT_MESSAGE_UNIX_FDS], + [$DEFAULT_MESSAGE_UNIX_FDS], + [Default for dbus_connection_get_max_message_unix_fds()]) +AC_SUBST([DEFAULT_MESSAGE_UNIX_FDS]) + +### kdbus support +if test x$enable_kdbus_transport = xyes; then + KDBUS_LIBS= + #"-lcrypto" + #AC_SUBST([KDBUS_LIBS]) + AC_DEFINE(ENABLE_KDBUS_TRANSPORT,1,[Enable kdbus transport support]) +else + KDBUS_LIBS= +fi + +AM_CONDITIONAL([ENABLE_KDBUS_TRANSPORT], [test x$enable_kdbus_transport = xyes]) + #### Set up final flags -LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs" +LIBDBUS_LIBS="$THREAD_LIBS $NETWORK_libs $KDBUS_LIBS" AC_SUBST([LIBDBUS_LIBS]) + ### X11 detection DBUS_X_LIBS= DBUS_X_CFLAGS= @@ -1448,13 +1482,8 @@ fi AM_CONDITIONAL(DBUS_XML_DOCS_ENABLED, test x$enable_xml_docs = xyes) 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) + [test x$enable_doxygen_docs = xyes && test x$enable_xml_docs = xyes]) #### Have to go $localstatedir->$prefix/var->/usr/local/var @@ -1775,7 +1804,13 @@ tools/Makefile test/Makefile test/name-test/Makefile doc/Makefile -doc/dbus-daemon.1 +doc/dbus-cleanup-sockets.1.xml +doc/dbus-daemon.1.xml +doc/dbus-launch.1.xml +doc/dbus-monitor.1.xml +doc/dbus-run-session.1.xml +doc/dbus-send.1.xml +doc/dbus-uuidgen.1.xml dbus-1.pc dbus-1-uninstalled.pc test/data/valid-config-files/debug-allow-all.conf @@ -1820,8 +1855,7 @@ echo " 32-bit int: ${DBUS_INT32_TYPE} 16-bit int: ${DBUS_INT16_TYPE} Doxygen: ${DOXYGEN:-not found} - xmlto: ${XMLTO:-not found} - man2html: ${MAN2HTML:-not found}" + xmlto: ${XMLTO:-not found}" echo " Rebuilding generated files: ${USE_MAINTAINER_MODE} @@ -1829,21 +1863,20 @@ echo " Building embedded tests: ${enable_embedded_tests} Building modular tests: ${enable_modular_tests} - with GLib: ${with_glib} + - with dbus-glib: ${with_dbus_glib} Building verbose mode: ${enable_verbose_mode} Building assertions: ${enable_asserts} Building checks: ${enable_checks} Building bus stats API: ${enable_stats} Building SELinux support: ${have_selinux} Building inotify support: ${have_inotify} - Building dnotify support: ${have_dnotify} Building kqueue support: ${have_kqueue} Building systemd support: ${have_systemd} - Building X11 code: ${enable_x11} + Building X11 code: ${have_x11} Building Doxygen docs: ${enable_doxygen_docs} Building XML docs: ${enable_xml_docs} Building cache support: ${enable_userdb_cache} 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} @@ -1881,10 +1914,6 @@ fi if test x$enable_checks = xno; then 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." fi -if test x$dbus_use_libxml = xtrue; then - 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.