From 01005bbbd0155b606c1f3df845ccfaff81e0c6ff Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 13 Apr 2011 22:56:53 +0200 Subject: Add --with-system-include-path etc. Instead of hard-coding /usr/include, we now use the environment variable PKG_CONFIG_SYSTEM_INCLUDE_PATH, defaulting to the argument of ./configure --with-system-include-path, which in turn defaults to /usr/include. Similarly, PKG_CONFIG_SYSTEM_LIBRARY_PATH defaults to /usr/lib or /usr/lib:/usr/lib64 as appropriate. (As currently implemented, this causes a behaviour change on Win32 - the option -I/usr/include will now be filtered out.) The intended usage is for Debian to configure pkg-config with --with-system-include-path=/usr/include/$(DEB_HOST_GNU_TYPE):/usr/include and the corresponding library path, for multiarch support (). Based on work by Colin Walters --- configure.ac | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 67577a7..ace5682 100644 --- a/configure.ac +++ b/configure.ac @@ -34,6 +34,31 @@ fi PKG_CONFIG_FIND_PC_PATH +AC_MSG_CHECKING([for --with-system-include-path]) +AC_ARG_WITH(system_include_path, + [ --with-system-include-path Avoid -I flags that add the given directories ], + [ system_include_path="$withval" ], + [ system_include_path="/usr/include" ]) + AC_MSG_RESULT([$system_include_path]) + AC_SUBST([system_include_path]) + +AC_MSG_CHECKING([for --with-system-library-path]) +AC_ARG_WITH(system_library_path, + [ --with-system-library-path Avoid -L flags that add the given directories ], + [ 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. # @@ -92,11 +117,6 @@ case "$host" in esac AC_MSG_RESULT([$native_win32]) -case "$libdir" in -*lib64) AC_DEFINE(PREFER_LIB64,1,[Define if your native architecture defines libdir to be $prefix/lib64 instead of $prefix/lib.]) ;; -*) : ;; -esac - 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-2.0; then -- cgit v1.2.1