summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-02-17 11:55:36 +0000
committerDan Nicholson <dbn.lists@gmail.com>2012-05-23 05:45:20 -0700
commit7a8cc77163bdf5f648326cd31f528400ebc8fbcb (patch)
tree42a45b354c9f5071cbb251df43246b79ab678e30 /configure.ac
parentd575f1e5ea011d8c68c7cbfc40184f36bbcd5ead (diff)
downloadpkg-config-7a8cc77163bdf5f648326cd31f528400ebc8fbcb.tar.gz
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
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac93
1 files changed, 56 insertions, 37 deletions
diff --git a/configure.ac b/configure.ac
index 2c936d4..fd87128 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,15 +1,32 @@
+AC_PREREQ([2.62])
+AC_INIT([pkg-config],
+ [0.26],
+ [https://bugs.freedesktop.org/enter_bug.cgi?product=pkg-config],
+ [pkg-config])
+
+AC_CONFIG_HEADERS([config.h])
+AC_CONFIG_SRCDIR([main.c])
+
+dnl Initialize automake and libtool
+AM_INIT_AUTOMAKE([1.11])
+LT_PREREQ([2.2])
+LT_INIT
+
+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
-AC_INIT(pkg-config.1)
-
-AM_INIT_AUTOMAKE(pkg-config, 0.26)
-
-AM_CONFIG_HEADER(config.h)
+dnl Check for headers
+AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.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 Check for library functions
+AC_FUNC_ALLOCA
+AC_CHECK_FUNCS(setresuid setreuid,break)
-AC_PROG_CC
dnl
dnl Default pkg-config search path
@@ -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.
-
-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,
+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],
+ [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