diff options
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | configure.ac | 93 |
2 files changed, 58 insertions, 37 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,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 |