2011-02-17 11:55:36 +00:00
|
|
|
AC_PREREQ([2.62])
|
|
|
|
|
AC_INIT([pkg-config],
|
2012-08-24 06:03:54 -07:00
|
|
|
[0.27.1],
|
2011-02-17 11:55:36 +00:00
|
|
|
[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
|
2012-08-22 17:10:24 -07:00
|
|
|
AC_CHECK_PROG([LN], [ln], [ln], [cp -Rp])
|
2005-07-14 13:04:01 +00:00
|
|
|
|
2011-02-17 11:55:36 +00:00
|
|
|
dnl Check for headers
|
|
|
|
|
AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h malloc.h])
|
2005-07-14 13:04:42 +00:00
|
|
|
|
2012-08-19 07:36:36 -07:00
|
|
|
dnl A POSIX shell is required for the tests. If TEST_SHELL hasn't been
|
|
|
|
|
dnl set on the command line then we try to find bash or ksh or sh from
|
|
|
|
|
dnl the path. If none of those are available, we just use whatever
|
|
|
|
|
dnl autoconf detected for configure.
|
|
|
|
|
AC_ARG_VAR([TESTS_SHELL], [Path to a POSIX shell to be used for testing])
|
|
|
|
|
conf_path="$PATH:`getconf PATH 2>/dev/null`"
|
|
|
|
|
AC_PATH_PROGS([TESTS_SHELL], [bash ksh sh], [$CONFIG_SHELL], [$conf_path])
|
2005-07-14 13:05:32 +00:00
|
|
|
|
2012-05-15 02:41:16 -07:00
|
|
|
dnl
|
|
|
|
|
dnl Default pkg-config search path
|
|
|
|
|
dnl
|
2008-01-31 02:43:41 +01:00
|
|
|
AC_MSG_CHECKING([for default search path for .pc files])
|
2012-05-15 02:41:16 -07:00
|
|
|
AC_ARG_WITH([pc_path],
|
|
|
|
|
[AS_HELP_STRING([--with-pc-path],
|
|
|
|
|
[default search path for .pc files])],
|
|
|
|
|
[pc_path="$withval"],
|
|
|
|
|
[
|
2008-01-31 02:43:41 +01:00
|
|
|
# This is slightly wrong, but hopefully causes less confusion than
|
|
|
|
|
# people being unable to find their .pc files in the standard location.
|
|
|
|
|
if test "${prefix}" = "NONE"; then
|
|
|
|
|
pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig'
|
|
|
|
|
else
|
|
|
|
|
pc_path='${libdir}/pkgconfig:${datadir}/pkgconfig'
|
|
|
|
|
fi
|
|
|
|
|
])
|
2012-05-15 02:41:16 -07:00
|
|
|
AC_MSG_RESULT([$pc_path])
|
|
|
|
|
AC_SUBST([pc_path])
|
2005-07-14 13:06:23 +00:00
|
|
|
|
2012-05-15 02:41:16 -07:00
|
|
|
dnl
|
|
|
|
|
dnl System default -I paths
|
|
|
|
|
dnl
|
|
|
|
|
AC_MSG_CHECKING([for system include path to avoid -I flags])
|
|
|
|
|
AC_ARG_WITH([system_include_path],
|
|
|
|
|
[AS_HELP_STRING([--with-system-include-path],
|
|
|
|
|
[avoid -I flags from the given path])],
|
|
|
|
|
[system_include_path="$withval"],
|
|
|
|
|
[system_include_path="/usr/include"])
|
|
|
|
|
AC_MSG_RESULT([$system_include_path])
|
|
|
|
|
AC_SUBST([system_include_path])
|
2011-04-13 22:56:53 +02:00
|
|
|
|
2012-05-15 02:41:16 -07:00
|
|
|
dnl
|
|
|
|
|
dnl System default -L paths
|
|
|
|
|
dnl
|
|
|
|
|
AC_MSG_CHECKING([for system library path to avoid -L flags])
|
|
|
|
|
AC_ARG_WITH([system_library_path],
|
|
|
|
|
[AS_HELP_STRING([--with-system-library-path],
|
|
|
|
|
[avoid -L flags from the given path])],
|
|
|
|
|
[system_library_path="$withval"],
|
|
|
|
|
[
|
2011-04-13 22:56:53 +02:00
|
|
|
case "$libdir" in
|
|
|
|
|
*lib64)
|
|
|
|
|
system_library_path="/usr/lib64:/usr/lib"
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
system_library_path="/usr/lib"
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
])
|
2012-05-15 02:41:16 -07:00
|
|
|
AC_MSG_RESULT([$system_library_path])
|
|
|
|
|
AC_SUBST([system_library_path])
|
2011-04-13 22:56:53 +02:00
|
|
|
|
2011-02-17 11:55:36 +00:00
|
|
|
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],
|
2005-07-14 13:07:03 +00:00
|
|
|
[use_indirect_deps=auto])
|
|
|
|
|
echo use_indirect_deps=$use_indirect_deps >&AS_MESSAGE_LOG_FD
|
2005-07-14 13:07:02 +00:00
|
|
|
AC_MSG_CHECKING([whether to list both direct and indirect dependencies])
|
2005-07-14 13:07:03 +00:00
|
|
|
case $use_indirect_deps in
|
2005-07-14 13:06:42 +00:00
|
|
|
auto)
|
2010-05-09 10:38:01 +02:00
|
|
|
deplibs_check_method=`(./libtool --config; echo eval echo '\"$deplibs_check_method\"') | sh`
|
2005-07-14 13:07:03 +00:00
|
|
|
if test "X$deplibs_check_method" = Xnone; then
|
|
|
|
|
echo "foo: $deplibs_check_method" >&AS_MESSAGE_LOG_FD
|
|
|
|
|
use_indirect_deps=yes
|
2005-07-14 13:06:42 +00:00
|
|
|
else
|
2005-07-14 13:07:03 +00:00
|
|
|
use_indirect_deps=no
|
2005-07-14 13:06:42 +00:00
|
|
|
fi
|
|
|
|
|
;;
|
|
|
|
|
yes|no)
|
|
|
|
|
;;
|
|
|
|
|
*) AC_MSG_ERROR([Value given to --enable-indirect-deps must be one of yes, no
|
|
|
|
|
or auto])
|
|
|
|
|
;;
|
|
|
|
|
esac
|
2005-07-14 13:07:03 +00:00
|
|
|
AC_MSG_RESULT($use_indirect_deps)
|
2011-02-17 11:55:36 +00:00
|
|
|
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])
|
2005-07-14 13:06:42 +00:00
|
|
|
|
2011-02-17 11:55:36 +00:00
|
|
|
dnl
|
|
|
|
|
dnl Choose default CFLAGS and warnings depending on compiler.
|
|
|
|
|
dnl
|
2005-12-28 14:07:04 +00:00
|
|
|
WARN_CFLAGS=""
|
|
|
|
|
if test "${GCC}" = "yes" && test "${ac_env_CFLAGS_set}" != "set"; then
|
|
|
|
|
WARN_CFLAGS="-g -Wall -O2"
|
|
|
|
|
fi
|
|
|
|
|
AC_SUBST(WARN_CFLAGS)
|
|
|
|
|
|
2001-09-30 Tor Lillqvist <tml@iki.fi>
Author: tml
Date: 2001-09-29 21:05:25 GMT
2001-09-30 Tor Lillqvist <tml@iki.fi>
Changes for "pure" Win32 (without Cygwin or similar)
support. The most important differences compared to pkg-config
on Unix are:
We don't use hardcoded PKGLIBDIR paths but deduce the
installation prefix at runtime.
Use the normal GLib DLL, not a private copy. Yes, this does
introduce a circular dependency, but that can be worked around.
* README.win32: New file.
* configure.in: Check for Win32. If so, define USE_INSTALLED_GLIB,
and don't configure in the included glib-1.2.8. Set GLIB_CFLAGS
and GLIB_LIBS assuming that GLib is installed in the same location
pkgconfig will be. Check for dirent.h, unistd.h and sys/wait.h
headers.
* Makefile.am: If USE_INSTALLED_GLIB, use the GLIB_* values set
above, and don't make in the glib-1.2.8 subdir.
* autogen.sh: Use perl -p -i.bak, works better on Win32 (and Cygwin).
* *.c: Conditionalize inclusions of unistd.h and sys/wait.h.
* findme.c: Define X_OK on Win32 if necessary.
* parse.c
* popthelp.c: Minor Win32 portability ifdefs.
* parse.c: No need to include <windows.h>.
* pkg.c: Don't hardcode PKGLIBDIR, but use
g_win32_get_package_installation_directory() to deduce it.
(scan_dir): Make a temp copy of dirname with potential superfluous
trailing slash removed. The Win32 opendir implementation doesn't
always like those.
* pkg.h: If USE_INSTALLED_GLIB, include <glib.h> instead of
partial-glib.h.
* popt.c (execCommand): Don't compile on Win32.
* poptconfig.c (configLine): Don't bother with the "exec" stuff on
Win32, too complex to port, at least for now.
(poptReadDefaultConfig) Don't bother compiling on Win32, this
function isn't even called.
2005-07-14 13:04:29 +00:00
|
|
|
AC_MSG_CHECKING([for Win32])
|
2011-04-14 07:25:43 +04:00
|
|
|
case "$build" in
|
2001-09-30 Tor Lillqvist <tml@iki.fi>
Author: tml
Date: 2001-09-29 21:05:25 GMT
2001-09-30 Tor Lillqvist <tml@iki.fi>
Changes for "pure" Win32 (without Cygwin or similar)
support. The most important differences compared to pkg-config
on Unix are:
We don't use hardcoded PKGLIBDIR paths but deduce the
installation prefix at runtime.
Use the normal GLib DLL, not a private copy. Yes, this does
introduce a circular dependency, but that can be worked around.
* README.win32: New file.
* configure.in: Check for Win32. If so, define USE_INSTALLED_GLIB,
and don't configure in the included glib-1.2.8. Set GLIB_CFLAGS
and GLIB_LIBS assuming that GLib is installed in the same location
pkgconfig will be. Check for dirent.h, unistd.h and sys/wait.h
headers.
* Makefile.am: If USE_INSTALLED_GLIB, use the GLIB_* values set
above, and don't make in the glib-1.2.8 subdir.
* autogen.sh: Use perl -p -i.bak, works better on Win32 (and Cygwin).
* *.c: Conditionalize inclusions of unistd.h and sys/wait.h.
* findme.c: Define X_OK on Win32 if necessary.
* parse.c
* popthelp.c: Minor Win32 portability ifdefs.
* parse.c: No need to include <windows.h>.
* pkg.c: Don't hardcode PKGLIBDIR, but use
g_win32_get_package_installation_directory() to deduce it.
(scan_dir): Make a temp copy of dirname with potential superfluous
trailing slash removed. The Win32 opendir implementation doesn't
always like those.
* pkg.h: If USE_INSTALLED_GLIB, include <glib.h> instead of
partial-glib.h.
* popt.c (execCommand): Don't compile on Win32.
* poptconfig.c (configLine): Don't bother with the "exec" stuff on
Win32, too complex to port, at least for now.
(poptReadDefaultConfig) Don't bother compiling on Win32, this
function isn't even called.
2005-07-14 13:04:29 +00:00
|
|
|
*-*-mingw*)
|
|
|
|
|
native_win32=yes
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
native_win32=no
|
2005-07-14 13:04:42 +00:00
|
|
|
;;
|
2001-09-30 Tor Lillqvist <tml@iki.fi>
Author: tml
Date: 2001-09-29 21:05:25 GMT
2001-09-30 Tor Lillqvist <tml@iki.fi>
Changes for "pure" Win32 (without Cygwin or similar)
support. The most important differences compared to pkg-config
on Unix are:
We don't use hardcoded PKGLIBDIR paths but deduce the
installation prefix at runtime.
Use the normal GLib DLL, not a private copy. Yes, this does
introduce a circular dependency, but that can be worked around.
* README.win32: New file.
* configure.in: Check for Win32. If so, define USE_INSTALLED_GLIB,
and don't configure in the included glib-1.2.8. Set GLIB_CFLAGS
and GLIB_LIBS assuming that GLib is installed in the same location
pkgconfig will be. Check for dirent.h, unistd.h and sys/wait.h
headers.
* Makefile.am: If USE_INSTALLED_GLIB, use the GLIB_* values set
above, and don't make in the glib-1.2.8 subdir.
* autogen.sh: Use perl -p -i.bak, works better on Win32 (and Cygwin).
* *.c: Conditionalize inclusions of unistd.h and sys/wait.h.
* findme.c: Define X_OK on Win32 if necessary.
* parse.c
* popthelp.c: Minor Win32 portability ifdefs.
* parse.c: No need to include <windows.h>.
* pkg.c: Don't hardcode PKGLIBDIR, but use
g_win32_get_package_installation_directory() to deduce it.
(scan_dir): Make a temp copy of dirname with potential superfluous
trailing slash removed. The Win32 opendir implementation doesn't
always like those.
* pkg.h: If USE_INSTALLED_GLIB, include <glib.h> instead of
partial-glib.h.
* popt.c (execCommand): Don't compile on Win32.
* poptconfig.c (configLine): Don't bother with the "exec" stuff on
Win32, too complex to port, at least for now.
(poptReadDefaultConfig) Don't bother compiling on Win32, this
function isn't even called.
2005-07-14 13:04:29 +00:00
|
|
|
esac
|
|
|
|
|
AC_MSG_RESULT([$native_win32])
|
2011-04-14 07:25:43 +04:00
|
|
|
AM_CONDITIONAL(NATIVE_WIN32, [test "x$native_win32" = xyes])
|
2005-07-14 13:04:42 +00:00
|
|
|
|
2012-05-18 08:40:38 -07:00
|
|
|
dnl
|
|
|
|
|
dnl Find glib or use internal copy. Required version is 2.16 for
|
|
|
|
|
dnl g_win32_get_package_installation_directory_of_module().
|
|
|
|
|
dnl
|
|
|
|
|
m4_define([glib_module], ["glib-2.0 >= 2.16"])
|
2012-03-22 14:51:30 -07:00
|
|
|
AC_ARG_WITH([internal-glib],
|
|
|
|
|
[AS_HELP_STRING([--with-internal-glib], [use internal glib])],
|
|
|
|
|
[with_internal_glib="$withval"],
|
|
|
|
|
[with_internal_glib=no])
|
|
|
|
|
AM_CONDITIONAL([INTERNAL_GLIB], [test "x$with_internal_glib" = xyes])
|
2012-06-04 11:01:03 -07:00
|
|
|
AC_MSG_CHECKING([if internal glib should be used])
|
2012-03-22 14:51:30 -07:00
|
|
|
if test "x$with_internal_glib" = xyes; then
|
2012-06-04 11:01:03 -07:00
|
|
|
AC_MSG_RESULT([yes])
|
2012-03-22 14:51:30 -07:00
|
|
|
GLIB_CFLAGS='-I$(top_srcdir)/glib -I$(top_srcdir)/glib/glib \
|
|
|
|
|
-I$(top_builddir)/glib/glib'
|
|
|
|
|
GLIB_LIBS='$(top_builddir)/glib/glib/libglib-2.0.la'
|
|
|
|
|
AC_CONFIG_SUBDIRS([glib])
|
|
|
|
|
else
|
2012-06-04 11:01:03 -07:00
|
|
|
AC_MSG_RESULT([no])
|
2012-03-22 14:51:30 -07:00
|
|
|
if test "x$GLIB_CFLAGS" = "x" && test "x$GLIB_LIBS" = "x"; then
|
|
|
|
|
AC_CHECK_PROGS([PKG_CONFIG], [pkg-config], [])
|
2012-05-18 08:40:38 -07:00
|
|
|
if test -n $PKG_CONFIG && $PKG_CONFIG --exists glib_module; then
|
|
|
|
|
GLIB_CFLAGS=`$PKG_CONFIG --cflags glib_module`
|
|
|
|
|
GLIB_LIBS=`$PKG_CONFIG --libs glib_module`
|
2012-03-22 14:51:30 -07:00
|
|
|
else
|
2012-05-18 08:40:38 -07:00
|
|
|
AC_MSG_ERROR(m4_normalize([pkg-config and ]glib_module[ not found,
|
|
|
|
|
please set GLIB_CFLAGS and GLIB_LIBS to
|
|
|
|
|
the correct values or pass
|
|
|
|
|
--with-internal-glib to configure]))
|
2012-03-22 14:51:30 -07:00
|
|
|
fi
|
|
|
|
|
fi
|
2010-08-19 18:54:12 +02:00
|
|
|
fi
|
|
|
|
|
AC_SUBST(GLIB_LIBS)
|
|
|
|
|
AC_SUBST(GLIB_CFLAGS)
|
2005-07-14 13:04:01 +00:00
|
|
|
|
2012-09-28 05:45:37 -07:00
|
|
|
dnl
|
|
|
|
|
dnl Optional gcov test coverage usage
|
|
|
|
|
dnl
|
|
|
|
|
AC_ARG_WITH([gcov],
|
|
|
|
|
[AS_HELP_STRING([--with-gcov], [gcov test coverage @<:@default=no@:>@])],
|
|
|
|
|
[],
|
|
|
|
|
[with_gcov=no])
|
|
|
|
|
if test "x$with_gcov" = xyes; then
|
|
|
|
|
if test "$GCC" = no; then
|
|
|
|
|
AC_MSG_ERROR([gcov test coverage can only be used with GCC])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
AC_PATH_PROG([GCOV], [gcov], [AC_MSG_ERROR([could not find gcov program])])
|
|
|
|
|
GCOV_CFLAGS="-fprofile-arcs -ftest-coverage"
|
|
|
|
|
|
|
|
|
|
# Ensure there's no optimizing since last -O wins and CFLAGS is used
|
|
|
|
|
# at the end of COMPILE/LTCOMPILE.
|
|
|
|
|
CFLAGS="${CFLAGS+$CFLAGS }-O0"
|
|
|
|
|
fi
|
|
|
|
|
AC_SUBST([GCOV_CFLAGS])
|
|
|
|
|
|
2012-08-22 17:10:24 -07:00
|
|
|
dnl See if the user wants a host- prefixed tool
|
|
|
|
|
dnl (e.g. i686-pc-linux-gnu-pkg-config) to be installed.
|
|
|
|
|
dnl
|
|
|
|
|
AC_MSG_CHECKING([if host- prefixed tool should be installed])
|
|
|
|
|
AC_ARG_ENABLE([host-tool],
|
|
|
|
|
[AS_HELP_STRING([--disable-host-tool],
|
|
|
|
|
[install link to pkg-config with $host- prefix @<:@default=yes@:>@])],
|
|
|
|
|
[],
|
|
|
|
|
[enable_host_tool=yes])
|
|
|
|
|
AC_MSG_RESULT([$enable_host_tool])
|
|
|
|
|
AM_CONDITIONAL([HOST_TOOL], [test "x$enable_host_tool" = xyes])
|
|
|
|
|
|
2011-02-17 11:55:36 +00:00
|
|
|
AC_CONFIG_FILES([
|
|
|
|
|
Makefile
|
|
|
|
|
check/Makefile
|
|
|
|
|
check/config.sh
|
|
|
|
|
])
|
|
|
|
|
AC_OUTPUT
|