Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0f3cde1

Browse files
committed
use autoconf macro to check for pkg-config (closes #15506)
1 parent eb9a9b6 commit 0f3cde1

3 files changed

Lines changed: 38 additions & 3 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ Tests
238238
Build
239239
-----
240240

241+
- Issue #15506: Use standard PKG_PROG_PKG_CONFIG autoconf macro in the configure
242+
script.
243+
241244
- Issue #22935: Allow the ssl module to be compiled if openssl doesn't support
242245
SSL 3.
243246

configure

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,8 @@ USE_SIGNAL_MODULE
650650
TCLTK_LIBS
651651
TCLTK_INCLUDES
652652
LIBFFI_INCLUDEDIR
653+
PKG_CONFIG_LIBDIR
654+
PKG_CONFIG_PATH
653655
PKG_CONFIG
654656
SHLIBS
655657
CFLAGSFORSHARED
@@ -828,7 +830,10 @@ CFLAGS
828830
LDFLAGS
829831
LIBS
830832
CPPFLAGS
831-
CPP'
833+
CPP
834+
PKG_CONFIG
835+
PKG_CONFIG_PATH
836+
PKG_CONFIG_LIBDIR'
832837

833838

834839
# Initialize some variables set by options.
@@ -1514,6 +1519,11 @@ Some influential environment variables:
15141519
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
15151520
you have headers in a nonstandard directory <include dir>
15161521
CPP C preprocessor
1522+
PKG_CONFIG path to pkg-config utility
1523+
PKG_CONFIG_PATH
1524+
directories to add to pkg-config's search path
1525+
PKG_CONFIG_LIBDIR
1526+
path overriding pkg-config's built-in search path
15171527
15181528
Use these variables to override the choices made by `configure' or to help
15191529
it to find libraries and programs with nonstandard names/locations.
@@ -9218,7 +9228,15 @@ $as_echo "no" >&6; }
92189228
fi
92199229

92209230

9221-
if test -n "$ac_tool_prefix"; then
9231+
9232+
9233+
9234+
9235+
9236+
9237+
9238+
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
9239+
if test -n "$ac_tool_prefix"; then
92229240
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
92239241
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
92249242
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -9316,6 +9334,20 @@ else
93169334
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
93179335
fi
93189336

9337+
fi
9338+
if test -n "$PKG_CONFIG"; then
9339+
_pkg_min_version=0.9.0
9340+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
9341+
$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; }
9342+
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
9343+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
9344+
$as_echo "yes" >&6; }
9345+
else
9346+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
9347+
$as_echo "no" >&6; }
9348+
PKG_CONFIG=""
9349+
fi
9350+
fi
93199351

93209352
# Check for use of the system expat library
93219353
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for --with-system-expat" >&5

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2335,7 +2335,7 @@ LIBS="$withval $LIBS"
23352335
],
23362336
[AC_MSG_RESULT(no)])
23372337

2338-
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
2338+
PKG_PROG_PKG_CONFIG
23392339

23402340
# Check for use of the system expat library
23412341
AC_MSG_CHECKING(for --with-system-expat)

0 commit comments

Comments
 (0)