pkg-config/configure.ac

166 lines
4.7 KiB
Text
Raw Normal View History

AC_INIT(pkg-config.1)
AM_INIT_AUTOMAKE(pkg-config, 0.26)
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])
AC_PROG_CC
dnl
dnl Default pkg-config search path
dnl
AC_MSG_CHECKING([for default search path for .pc files])
AC_ARG_WITH([pc_path],
[AS_HELP_STRING([--with-pc-path],
[default search path for .pc files])],
[pc_path="$withval"],
[
# 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
])
AC_MSG_RESULT([$pc_path])
AC_SUBST([pc_path])
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])
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"],
[
case "$libdir" in
*lib64)
system_library_path="/usr/lib64:/usr/lib"
;;
*)
system_library_path="/usr/lib"
;;
esac
])
AC_MSG_RESULT([$system_library_path])
AC_SUBST([system_library_path])
#
# Code taken from gtk+-2.0's configure.in.
#
2005-05-21 Tollef Fog Heen <tfheen@err.no> Author: tfheen Date: 2005-05-21 09:14:47 GMT 2005-05-21 Tollef Fog Heen <tfheen@err.no> * check/check-libs-private: New test to check for support for private libraries. * check/simple.pc (prefix): Add Libs.private header. * check/Makefile.am (TESTS): Add check-libs-private test * pkg.h: Adjust function prototypes. * pkg.c: Add global ignore_private_libs variable. (scan_dir): Use the correct free function. Stop leaking file descriptors. (package_get_l_libs, packages_get_l_libs, package_get_L_libs, packages_get_L_libs): Stop the recursive silliness and go back to old behaviour. (packages_get_all_libs): Adjust parameters to packages_get_*_libs (enable_private_libs, disable_private_libs): Trivial helper functions. * pkg-config.1: Update documentation wrt search path (Debian #308942), update docs for Libs.private and add the problematic handling of mixing = and non-= arguments to the bugs section. * parse.h: Adjust parameters for parse_package_file to get private libs or not. * parse.c (trim_and_sub): Fix memory leak. (_do_parse_libs): New function including what's common between parse_libs and parse_private_libs. (parse_libs_private): New function. Handle private libraries. (parse_line): Add . to the list of valid characters in headers (so Libs.private works correctly. (parse_line): Fix memory leaks. (parse_line): Handle Libs.private. (parse_package_file): Fix memory leak. * main.c (main): Fix memory leak. * NEWS: Document changes to inter-library handling. * main.c (main): Handle inter-library dependencies old-style, but do private libraries too. Adjust parameters to packages_get_*_libs. * configure.in: Change comment wrt inter-library handling to talk about private libraries instead.
2005-07-14 13:07:18 +00:00
# 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,
[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
auto)
deplibs_check_method=`(./libtool --config; echo eval echo '\"$deplibs_check_method\"') | sh`
if test "X$deplibs_check_method" = Xnone; then
echo "foo: $deplibs_check_method" >&AS_MESSAGE_LOG_FD
use_indirect_deps=yes
else
use_indirect_deps=no
fi
;;
yes|no)
;;
*) AC_MSG_ERROR([Value given to --enable-indirect-deps must be one of yes, no
or auto])
;;
esac
AC_MSG_RESULT($use_indirect_deps)
#
# Choose default CFLAGS and warnings depending on compiler.
#
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)
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])
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
;;
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])
AM_CONDITIONAL(NATIVE_WIN32, [test "x$native_win32" = xyes])
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"])
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])
if test "x$with_internal_glib" = xyes; then
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
if test "x$GLIB_CFLAGS" = "x" && test "x$GLIB_LIBS" = "x"; then
AC_CHECK_PROGS([PKG_CONFIG], [pkg-config], [])
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`
else
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]))
fi
fi
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])