From 124b4c1f6e37c14e0f030d4b2a7f9294b2b600a3 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 2/2] Update autotools configuration Replace deprecated macros and use the new libtool syntax. Also use silent rules to silence the build a bit --- Makefile.am | 2 + configure.ac | 67 +++++++++++++++++++++++++++++++++++++------------------- m4/.gitignore | 5 ++++ 3 files changed, 51 insertions(+), 23 deletions(-) create mode 100644 m4/.gitignore diff --git a/Makefile.am b/Makefile.am index a7d9fc6..aa140b4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,5 @@ +ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS} + if USE_INSTALLED_GLIB included_glib_includes = @GLIB_CFLAGS@ pkg_config_LDADD=@GLIB_LIBS@ diff --git a/configure.ac b/configure.ac index e58157d..76f4e89 100644 --- a/configure.ac +++ b/configure.ac @@ -1,16 +1,38 @@ +AC_PREREQ([2.63]) +AC_INIT([pkg-config], + [0.25], + [https://bugs.freedesktop.org/enter_bug.cgi?product=pkg-config], + [pkg-config]) + +AC_CONFIG_HEADERS([config.h]) +AC_CONFIG_SRCDIR([pkg-config.1]) +AC_CONFIG_MACRO_DIR([m4]) +AC_CONFIG_AUX_DIR([build-aux]) + +AM_INIT_AUTOMAKE([1.10]) +AM_MAINTAINER_MODE([enable]) + +# Support silent build rules, requires at least automake-1.11. Disable +# by either passing --disable-silent-rules to configure or passing V=1 +# to make +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) + +# Check for programs +AC_PROG_CC -AC_INIT(pkg-config.1) - -AM_INIT_AUTOMAKE(pkg-config, 0.25) -AM_MAINTAINER_MODE - -AM_CONFIG_HEADER(config.h) - -AM_PROG_LIBTOOL +# Initialize libtool +LT_PREREQ([2.2]) +LT_INIT dnl when using libtool 2.x create libtool early, because it's used in configure m4_ifdef([LT_OUTPUT], [LT_OUTPUT]) -AC_PROG_CC +# Checks for header files +AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h]) + +# Checks for library functions +AC_FUNC_ALLOCA +AC_CHECK_FUNCS([setresuid setreuid],[break]) + AC_DEFUN([PKG_CONFIG_FIND_PC_PATH], [ @@ -41,13 +63,14 @@ PKG_CONFIG_FIND_PC_PATH # common example is libm) on platforms which support inter-library # dependencies. -AC_ARG_ENABLE(indirect-deps, - [AC_HELP_STRING([--enable-indirect-deps], +AC_ARG_ENABLE([indirect-deps], + [AS_HELP_STRING([--enable-indirect-deps], [list both direct and indirect dependencies.]) -AC_HELP_STRING([--disable-indirect-deps], + AS_HELP_STRING([--disable-indirect-deps], [only list direct dependencies.]) - [default=auto]],use_indirect_deps=$enableval, - [use_indirect_deps=auto]) + [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]) case $use_indirect_deps in @@ -153,12 +176,10 @@ fi AC_SUBST([POPT_LIBS]) AM_CONDITIONAL([USE_INSTALLED_POPT], [test "x$with_installed_popt" = xyes]) -AC_FUNC_ALLOCA - -AC_CHECK_FUNCS(setresuid setreuid,break) -AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h]) - -AC_OUTPUT([Makefile - popt/Makefile - check/Makefile - check/config.sh]) +AC_CONFIG_FILES([ + Makefile + popt/Makefile + check/Makefile + check/config.sh +]) +AC_OUTPUT 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.4