From 7a8cc77163bdf5f648326cd31f528400ebc8fbcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Thu, 17 Feb 2011 11:55:36 +0000 Subject: [PATCH] Update autotools configuration Replace deprecated macros and use the new libtool syntax. The required versions of the tools have been bumped up to match the versions of the bundled glib. This was effectively the requirement, anyway. The new required autotools versions are: autoconf-2.62 (released 2008-04-08) automake-1.11 (released 2009-05-17) libtool-2.2 (released 2008-03-01) Also use silent rules to quiet the build a bit. Freedesktop #34382 --- Makefile.am | 2 ++ configure.ac | 87 ++++++++++++++++++++++++++++++++-------------------- 2 files changed, 55 insertions(+), 34 deletions(-) diff --git a/Makefile.am b/Makefile.am index 3bbcd6f..312d109 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} + pkg_config_LDADD=@GLIB_LIBS@ if INTERNAL_GLIB diff --git a/configure.ac b/configure.ac index 2c936d4..fd87128 100644 --- a/configure.ac +++ b/configure.ac @@ -1,16 +1,33 @@ +AC_PREREQ([2.62]) +AC_INIT([pkg-config], + [0.26], + [https://bugs.freedesktop.org/enter_bug.cgi?product=pkg-config], + [pkg-config]) -AC_INIT(pkg-config.1) +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_SRCDIR([main.c]) -AM_INIT_AUTOMAKE(pkg-config, 0.26) +dnl Initialize automake and libtool +AM_INIT_AUTOMAKE([1.11]) +LT_PREREQ([2.2]) +LT_INIT -AM_CONFIG_HEADER(config.h) - -AM_PROG_LIBTOOL -dnl when using libtool 2.x create libtool early, because it's used in configure -m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) +dnl Support silent build rules, requires at least automake-1.11. Disable +dnl by either passing --disable-silent-rules to configure or passing V=1 +dnl to make +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) +dnl Check for programs AC_PROG_CC +dnl Check for headers +AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h]) + +dnl Check for library functions +AC_FUNC_ALLOCA +AC_CHECK_FUNCS(setresuid setreuid,break) + + dnl dnl Default pkg-config search path dnl @@ -64,19 +81,23 @@ esac AC_MSG_RESULT([$system_library_path]) AC_SUBST([system_library_path]) -# -# Code taken from gtk+-2.0's configure.in. -# -# This causes pkg-config to not list private dependencies (a very -# common example is libm) on platforms which support inter-library -# dependencies. +dnl Code taken from gtk+-2.0's configure.in. +dnl +dnl This causes pkg-config to not list private dependencies (a very +dnl common example is libm) on platforms which support inter-library +dnl dependencies. +dnl +dnl When using libtool 2.x, we need to force libtool to be created +dnl early so we can use it here. +m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) -AC_ARG_ENABLE(indirect-deps, - [AC_HELP_STRING([--enable-indirect-deps], - [list both direct and indirect dependencies.]) -AC_HELP_STRING([--disable-indirect-deps], - [only list direct dependencies.]) - [default=auto]],use_indirect_deps=$enableval, +AC_ARG_ENABLE([indirect-deps], + [AS_HELP_STRING([--enable-indirect-deps], + [list both direct and indirect dependencies.]) + AS_HELP_STRING([--disable-indirect-deps], + [only list direct dependencies.]) + [default=auto]], + [use_indirect_deps=$enableval], [use_indirect_deps=auto]) echo use_indirect_deps=$use_indirect_deps >&AS_MESSAGE_LOG_FD AC_MSG_CHECKING([whether to list both direct and indirect dependencies]) @@ -97,20 +118,20 @@ or auto]) ;; esac AC_MSG_RESULT($use_indirect_deps) +AC_DEFINE_UNQUOTED([ENABLE_INDIRECT_DEPS], + [`test $use_indirect_deps = no; echo $?`], + [Link library to all dependent libraries, not only directly needed ones]) +AC_SUBST([use_indirect_deps]) -# -# Choose default CFLAGS and warnings depending on compiler. -# - +dnl +dnl Choose default CFLAGS and warnings depending on compiler. +dnl WARN_CFLAGS="" if test "${GCC}" = "yes" && test "${ac_env_CFLAGS_set}" != "set"; then WARN_CFLAGS="-g -Wall -O2" fi AC_SUBST(WARN_CFLAGS) -AC_DEFINE_UNQUOTED(ENABLE_INDIRECT_DEPS, `test $use_indirect_deps = no; echo $?`, [Link library to all dependent libraries, not only directly needed ones]) -AC_SUBST(use_indirect_deps) - AC_MSG_CHECKING([for Win32]) case "$build" in *-*-mingw*) @@ -155,11 +176,9 @@ fi AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_CFLAGS) -AC_FUNC_ALLOCA - -AC_CHECK_FUNCS(setresuid setreuid,break) -AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h]) - -AC_OUTPUT([Makefile - check/Makefile - check/config.sh]) +AC_CONFIG_FILES([ +Makefile +check/Makefile +check/config.sh +]) +AC_OUTPUT