From 265284da333acb53d30a37fb4ec0dd0586c3f6f1 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 6 Nov 2021 16:59:49 +0100 Subject: [PATCH 1/4] bpo-45723: Detect missing pkg-config Signed-off-by: Christian Heimes --- configure | 6 ++++++ configure.ac | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/configure b/configure index 1eea2d13205789..f5160581d44d35 100755 --- a/configure +++ b/configure @@ -2778,6 +2778,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then # If we're building out-of-tree, we need to make sure the following # resources get picked up before their $srcdir counterparts. @@ -19574,6 +19575,11 @@ $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ Modules/Setup.local $srcdir/Modules/Setup mv config.c Modules +if test -n "$PKG_CONFIG"; then + echo "" >&6 + echo "pkg-config is missing. Some dependencies may not be detected correctly." >&6 +fi + if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then echo "" >&6 echo "" >&6 diff --git a/configure.ac b/configure.ac index 8895818d19da6c..78b7d8c9963185 100644 --- a/configure.ac +++ b/configure.ac @@ -17,6 +17,11 @@ m4_ifdef( [], [AC_MSG_ERROR([Please install autoconf-archive package and re-run autoreconf])] ) +m4_ifdef( + [PKG_PROG_PKG_CONFIG], + [], + [AC_MSG_ERROR([Please install pkgconf's m4 macro package and re-run autoreconf])] +) AC_SUBST(BASECPPFLAGS) if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then @@ -6114,6 +6119,11 @@ $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ Modules/Setup.local $srcdir/Modules/Setup mv config.c Modules +if test -n "$PKG_CONFIG"; then + echo "" >&AS_MESSAGE_FD + echo "pkg-config is missing. Some dependencies may not be detected correctly." >&AS_MESSAGE_FD +fi + if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then echo "" >&AS_MESSAGE_FD echo "" >&AS_MESSAGE_FD From f4fa05f020cfd7ae35ce99dbfd7fe4bc7c7ea33f Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 6 Nov 2021 17:58:14 +0100 Subject: [PATCH 2/4] Get rid of extra new lines --- configure | 1 - configure.ac | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index f5160581d44d35..4f0e8233334e34 100755 --- a/configure +++ b/configure @@ -2778,7 +2778,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then # If we're building out-of-tree, we need to make sure the following # resources get picked up before their $srcdir counterparts. diff --git a/configure.ac b/configure.ac index 78b7d8c9963185..cb4cdf2122a105 100644 --- a/configure.ac +++ b/configure.ac @@ -16,12 +16,12 @@ m4_ifdef( [AX_C_FLOAT_WORDS_BIGENDIAN], [], [AC_MSG_ERROR([Please install autoconf-archive package and re-run autoreconf])] -) +)dnl m4_ifdef( [PKG_PROG_PKG_CONFIG], [], [AC_MSG_ERROR([Please install pkgconf's m4 macro package and re-run autoreconf])] -) +)dnl AC_SUBST(BASECPPFLAGS) if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then From 4342b78545576d73e7d173af966644f9f2456282 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sat, 6 Nov 2021 19:30:05 +0100 Subject: [PATCH 3/4] Use correct check --- configure | 3 +-- configure.ac | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/configure b/configure index 4f0e8233334e34..7c34a60763d6b2 100755 --- a/configure +++ b/configure @@ -2777,7 +2777,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test "$srcdir" != . -a "$srcdir" != "$(pwd)"; then # If we're building out-of-tree, we need to make sure the following # resources get picked up before their $srcdir counterparts. @@ -19574,7 +19573,7 @@ $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ Modules/Setup.local $srcdir/Modules/Setup mv config.c Modules -if test -n "$PKG_CONFIG"; then +if test -z "$PKG_CONFIG"; then echo "" >&6 echo "pkg-config is missing. Some dependencies may not be detected correctly." >&6 fi diff --git a/configure.ac b/configure.ac index cb4cdf2122a105..d7699dc4ea90d8 100644 --- a/configure.ac +++ b/configure.ac @@ -6119,7 +6119,7 @@ $SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \ Modules/Setup.local $srcdir/Modules/Setup mv config.c Modules -if test -n "$PKG_CONFIG"; then +if test -z "$PKG_CONFIG"; then echo "" >&AS_MESSAGE_FD echo "pkg-config is missing. Some dependencies may not be detected correctly." >&AS_MESSAGE_FD fi From 3061c4be7967f5a08bada448df1ec9dd365ee7f9 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Sun, 7 Nov 2021 10:36:22 +0100 Subject: [PATCH 4/4] blurb --- Misc/NEWS.d/next/Build/2021-11-07-10-36-12.bpo-45723.JNwKSG.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Build/2021-11-07-10-36-12.bpo-45723.JNwKSG.rst diff --git a/Misc/NEWS.d/next/Build/2021-11-07-10-36-12.bpo-45723.JNwKSG.rst b/Misc/NEWS.d/next/Build/2021-11-07-10-36-12.bpo-45723.JNwKSG.rst new file mode 100644 index 00000000000000..0e06560fcbab9e --- /dev/null +++ b/Misc/NEWS.d/next/Build/2021-11-07-10-36-12.bpo-45723.JNwKSG.rst @@ -0,0 +1 @@ +``configure`` now prints a warning when pkg-config is missing.