summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-12-15 00:00:23 -0500
committerBenjamin Peterson <benjamin@python.org>2014-12-15 00:00:23 -0500
commit0f3cde14533060cd7a46f897e7db938166dff56a (patch)
tree8309e85b36b146dc9a973d3de68be7b666d31ea2
parenteb9a9b6ffa7946f0e76f5425bacadb4944e615f8 (diff)
downloadcpython-git-0f3cde14533060cd7a46f897e7db938166dff56a.tar.gz
use autoconf macro to check for pkg-config (closes #15506)
-rw-r--r--Misc/NEWS3
-rwxr-xr-xconfigure36
-rw-r--r--configure.ac2
3 files changed, 38 insertions, 3 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index 2d1b9639b3..f6b1a3bbd5 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -238,6 +238,9 @@ Tests
Build
-----
+- Issue #15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the configure
+ script.
+
- Issue #22935: Allow the ssl module to be compiled if openssl doesn't support
SSL 3.
diff --git a/configure b/configure
index 139d391d0c..21bab5ba57 100755
--- a/configure
+++ b/configure
@@ -650,6 +650,8 @@ USE_SIGNAL_MODULE
TCLTK_LIBS
TCLTK_INCLUDES
LIBFFI_INCLUDEDIR
+PKG_CONFIG_LIBDIR
+PKG_CONFIG_PATH
PKG_CONFIG
SHLIBS
CFLAGSFORSHARED
@@ -828,7 +830,10 @@ CFLAGS
LDFLAGS
LIBS
CPPFLAGS
-CPP'
+CPP
+PKG_CONFIG
+PKG_CONFIG_PATH
+PKG_CONFIG_LIBDIR'
# Initialize some variables set by options.
@@ -1514,6 +1519,11 @@ Some influential environment variables:
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
+ PKG_CONFIG path to pkg-config utility
+ PKG_CONFIG_PATH
+ directories to add to pkg-config's search path
+ PKG_CONFIG_LIBDIR
+ path overriding pkg-config's built-in search path
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
@@ -9218,7 +9228,15 @@ $as_echo "no" >&6; }
fi
-if test -n "$ac_tool_prefix"; then
+
+
+
+
+
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+ if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -9316,6 +9334,20 @@ else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
+fi
+if test -n "$PKG_CONFIG"; then
+ _pkg_min_version=0.9.0
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
+$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
+ if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ PKG_CONFIG=""
+ fi
+fi
# Check for use of the system expat library
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-expat" >&5
diff --git a/configure.ac b/configure.ac
index 9698ea0221..8177e272c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2335,7 +2335,7 @@ LIBS="$withval $LIBS"
],
[AC_MSG_RESULT(no)])
-AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
+PKG_PROG_PKG_CONFIG
# Check for use of the system expat library
AC_MSG_CHECKING(for --with-system-expat)