summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErlend E. Aasland <erlend.aasland@protonmail.com>2023-06-06 11:00:38 (GMT)
committerGitHub <noreply@github.com>2023-06-06 11:00:38 (GMT)
commitb8d3bb72b0bfa8bcc0fae282739d4e534c57aac6 (patch)
treed89bdb10229807af7d72495ed3236b6b1dcfe150
parentfaae548e0e22585e2f8ac5f92f9587c837f1db97 (diff)
downloadcpython-b8d3bb72b0bfa8bcc0fae282739d4e534c57aac6.zip
cpython-b8d3bb72b0bfa8bcc0fae282739d4e534c57aac6.tar.gz
cpython-b8d3bb72b0bfa8bcc0fae282739d4e534c57aac6.tar.bz2
[3.11] gh-90005: Don't link with libbsd if not needed (#105236) (#105359)
The regression was introduced with commit 5b946cada. Restore pre gh-29696 behaviour.
-rw-r--r--Misc/NEWS.d/next/Build/2023-06-06-09-08-10.gh-issue-90005.8mmeJQ.rst1
-rwxr-xr-xconfigure6
-rw-r--r--configure.ac5
3 files changed, 6 insertions, 6 deletions
diff --git a/Misc/NEWS.d/next/Build/2023-06-06-09-08-10.gh-issue-90005.8mmeJQ.rst b/Misc/NEWS.d/next/Build/2023-06-06-09-08-10.gh-issue-90005.8mmeJQ.rst
new file mode 100644
index 0000000..0a23fbf
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2023-06-06-09-08-10.gh-issue-90005.8mmeJQ.rst
@@ -0,0 +1 @@
+Fix a regression in :file:`configure` where we could end up unintentionally linking with ``libbsd``.
diff --git a/configure b/configure
index 9e76287..03aa078 100755
--- a/configure
+++ b/configure
@@ -15796,9 +15796,7 @@ if test "x$ac_cv_func_flock" = xyes; then :
#define HAVE_FLOCK 1
_ACEOF
-fi
-done
-
+else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd" >&5
$as_echo_n "checking for flock in -lbsd... " >&6; }
if ${ac_cv_lib_bsd_flock+:} false; then :
@@ -15839,6 +15837,8 @@ if test "x$ac_cv_lib_bsd_flock" = xyes; then :
FCNTL_LIBS="-lbsd"
fi
+fi
+done
fi
diff --git a/configure.ac b/configure.ac
index c62a565..1c25abd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4696,9 +4696,8 @@ AC_CACHE_CHECK([for flock declaration], [ac_cv_flock_decl],
])
dnl Linking with libbsd may be necessary on AIX for flock function.
AS_VAR_IF([ac_cv_flock_decl], [yes],
- AC_CHECK_FUNCS([flock])
- AC_CHECK_LIB([bsd], [flock], [FCNTL_LIBS="-lbsd"])
-)
+ [AC_CHECK_FUNCS([flock], [],
+ [AC_CHECK_LIB([bsd], [flock], [FCNTL_LIBS="-lbsd"])])])
PY_CHECK_FUNC([getpagesize], [#include <unistd.h>])