summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorChristian Heimes <christian@python.org>2021-11-10 22:02:19 (GMT)
committerGitHub <noreply@github.com>2021-11-10 22:02:19 (GMT)
commitfc9b62281931da8d20f85d5ed44cfc24f068d3f4 (patch)
tree8ef77feda087e88e549fa4c40d314490e23d1df2 /configure.ac
parent0a9f69539be27acf1cddf1b58d02a88d02e5008d (diff)
downloadcpython-fc9b62281931da8d20f85d5ed44cfc24f068d3f4.zip
cpython-fc9b62281931da8d20f85d5ed44cfc24f068d3f4.tar.gz
cpython-fc9b62281931da8d20f85d5ed44cfc24f068d3f4.tar.bz2
bpo-45723: Add --with-pkg-config to configure (GH-29517)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac32
1 files changed, 30 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 4817422..898c2ba 100644
--- a/configure.ac
+++ b/configure.ac
@@ -155,6 +155,36 @@ define_xopen_source=yes
AC_SUBST(CONFIG_ARGS)
CONFIG_ARGS="$ac_configure_args"
+dnl Allow users to disable pkg-config or require pkg-config
+AC_ARG_WITH(
+ [pkg-config],
+ [AS_HELP_STRING([[--with-pkg-config=[yes|no|check]]],
+ [use pkg-config to detect build options (default is check)])],
+ [],
+ [with_pkg_config=check]
+)
+AS_CASE([$with_pkg_config],
+ [yes|check], [
+ if test -z "$PKG_CONFIG"; then
+ dnl invalidate stale config.cache values
+ AS_UNSET([PKG_CONFIG])
+ AS_UNSET([ac_cv_path_ac_pt_PKG_CONFIG])
+ AS_UNSET([ac_cv_prog_ac_ct_PKG_CONFIG])
+ fi
+ PKG_PROG_PKG_CONFIG
+ ],
+ [no], [
+ PKG_CONFIG=''
+ dnl force AX_CHECK_OPENSSL to ignore pkg-config
+ ac_cv_path_ac_pt_PKG_CONFIG=''
+ ac_cv_prog_ac_ct_PKG_CONFIG=''
+ ],
+ [AC_MSG_ERROR([invalid argument --with-pkg-config=$with_pkg_config])]
+)
+if test "$with_pkg_config" = yes -a -z "$PKG_CONFIG"; then
+ AC_MSG_ERROR([pkg-config is required])]
+fi
+
AC_MSG_CHECKING([for --enable-universalsdk])
AC_ARG_ENABLE(universalsdk,
AS_HELP_STRING([--enable-universalsdk@<:@=SDKDIR@:>@],
@@ -2978,8 +3008,6 @@ LIBS="$withval $LIBS"
],
[AC_MSG_RESULT(no)])
-PKG_PROG_PKG_CONFIG
-
# Check for use of the system expat library
AC_MSG_CHECKING(for --with-system-expat)
AC_ARG_WITH(system_expat,