From f476cd5aa12ec4fea76688baf793c4c4870b07a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Wed, 8 Dec 2010 22:06:46 -0500 Subject: [PATCH 2/3] Update autotools configuration Replace deprecated macros and use the new libtool syntax New requirements: autoconf >= 2.63 automake >= 1.10 libtool >= 2.2 --- .gitignore | 1 - Makefile.am | 2 +- configure.ac | 147 +++++++++++++++++++++++++++++++-------------------------- m4/.gitignore | 5 ++ 4 files changed, 86 insertions(+), 69 deletions(-) create mode 100644 m4/.gitignore diff --git a/.gitignore b/.gitignore index 3c612d6..ab8fd26 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ install-sh libtool ltmain.sh missing -m4 stamp-h1 stamp-h stamp-h.in diff --git a/Makefile.am b/Makefile.am index 8ce8d5b..dd2e02d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -66,4 +66,4 @@ update-authors: DISTCHECK_CONFIGURE_FLAGS = \ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir) -ACLOCAL_AMFLAGS = -I m4 +ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} diff --git a/configure.ac b/configure.ac index c4e36a9..1e2425d 100644 --- a/configure.ac +++ b/configure.ac @@ -1,33 +1,42 @@ 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], [1]) 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 +AC_INIT([dbus],[dbus_version],[https://bugs.freedesktop.org/enter_bug.cgi?product=dbus],[dbus]) +AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) -AM_INIT_AUTOMAKE([1.9 tar-ustar -Wno-portability]) -AM_CONFIG_HEADER(config.h) +AC_CANONICAL_HOST -# Honor aclocal flags -ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" +AM_INIT_AUTOMAKE([1.10 tar-ustar -Wno-portability]) +AM_MAINTAINER_MODE([enable]) -GETTEXT_PACKAGE=dbus-1 -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain]) +m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) + +# Check for programs +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_CXX +AC_USE_SYSTEM_EXTENSIONS +AC_HEADER_STDC +AC_C_INLINE +AC_PROG_MKDIR_P - ## must come before we use the $USE_MAINTAINER_MODE variable later -AM_MAINTAINER_MODE +# DBus versioning +DBUS_MAJOR_VERSION=dbus_major_version +DBUS_MINOR_VERSION=dbus_minor_version +DBUS_MICRO_VERSION=dbus_micro_version +DBUS_VERSION=dbus_major_version.dbus_minor_version.dbus_micro_version -m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) +AC_SUBST(DBUS_MAJOR_VERSION) +AC_SUBST(DBUS_MINOR_VERSION) +AC_SUBST(DBUS_MICRO_VERSION) +AC_SUBST(DBUS_VERSION) AC_DEFINE_UNQUOTED(DBUS_DAEMON_NAME,"dbus-daemon",[Name of executable]) @@ -52,25 +61,14 @@ AC_SUBST(LT_CURRENT) AC_SUBST(LT_REVISION) AC_SUBST(LT_AGE) -DBUS_MAJOR_VERSION=dbus_major_version -DBUS_MINOR_VERSION=dbus_minor_version -DBUS_MICRO_VERSION=dbus_micro_version -DBUS_VERSION=dbus_major_version.dbus_minor_version.dbus_micro_version - -AC_SUBST(DBUS_MAJOR_VERSION) -AC_SUBST(DBUS_MINOR_VERSION) -AC_SUBST(DBUS_MICRO_VERSION) -AC_SUBST(DBUS_VERSION) +# Initialize libtool +LT_INIT([win32-dll]) +LT_LANG([Windows Resource]) -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 +# i18n stuff +GETTEXT_PACKAGE=dbus-1 +AC_SUBST(GETTEXT_PACKAGE) +AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE",[The name of the gettext domain]) # Set some internal variables depending on the platform for later use. dbus_win=no @@ -500,32 +498,34 @@ AC_RUN_IFELSE([AC_LANG_SOURCE([[ AC_MSG_RESULT($broken_poll) AC_MSG_CHECKING(for dirfd) -AC_TRY_LINK([ +AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include -],[ +]], [[ DIR *dirp; dirp = opendir("."); dirfd(dirp); closedir(dirp); -], -dbus_have_dirfd=yes, dbus_have_dirfd=no) +]])], +[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_TRY_LINK([ + AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include - ],[ + ]], [[ DIR *dirp; int fd; dirp = opendir("."); fd = dirp->dd_fd; closedir(dirp); - ], - dbus_have_ddfd=yes, dbus_have_ddfd=no) + ]])], + [dbus_have_ddfd=yes], + [dbus_have_ddfd=no]) AC_MSG_RESULT($dbus_have_ddfd) if test "$dbus_have_ddfd" = yes; then AC_DEFINE(HAVE_DDFD,1,[Have the ddfd member of DIR]) @@ -592,11 +592,10 @@ if test "$ac_cv_func_posix_getpwnam_r" = yes; then else AC_CACHE_CHECK([for nonposix getpwnam_r], ac_cv_func_nonposix_getpwnam_r, - [AC_TRY_LINK([#include ], - [char buffer[10000]; + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[char buffer[10000]; struct passwd pwd; getpwnam_r ("", &pwd, buffer, - sizeof (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 @@ -607,14 +606,16 @@ fi dnl check for socklen_t AC_MSG_CHECKING(whether socklen_t is defined) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #include -],[ +]], [[ 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 @@ -633,19 +634,23 @@ AC_CHECK_DECLS([MSG_NOSIGNAL], [], [], [[ #include ]]) 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 @@ -658,14 +663,16 @@ fi dnl Check for various credentials. AC_MSG_CHECKING(for struct cmsgcred) -AC_TRY_COMPILE([ +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include -],[ +]], [[ 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 @@ -810,15 +817,17 @@ AC_CHECK_FUNC(pthread_condattr_setclock,have_pthread_condattr_setclock=true,have 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 + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include #include -], [ +]], [[ 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]) @@ -839,12 +848,13 @@ else # 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 ], - [#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 ]], + [[#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 @@ -1100,10 +1110,12 @@ cc_supports_flag() { 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 @@ -1616,7 +1628,7 @@ AH_VERBATIM(_DARWIN_ENVIRON, #endif ]) -AC_OUTPUT([ +AC_CONFIG_FILES([ Doxyfile dbus/versioninfo.rc dbus/dbus-arch-deps.h @@ -1655,6 +1667,7 @@ test/data/invalid-service-files-system/org.freedesktop.DBus.TestSuiteNoExec.serv 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 " diff --git a/m4/.gitignore b/m4/.gitignore new file mode 100644 index 0000000..464ba5c --- /dev/null +++ b/m4/.gitignore @@ -0,0 +1,5 @@ +libtool.m4 +lt~obsolete.m4 +ltoptions.m4 +ltsugar.m4 +ltversion.m4 -- 1.7.3.3