]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-90005: Don't link with libbsd if not needed (#105236) (#105360)
authorErlend E. Aasland <erlend.aasland@protonmail.com>
Tue, 6 Jun 2023 10:58:13 +0000 (12:58 +0200)
committerGitHub <noreply@github.com>
Tue, 6 Jun 2023 10:58:13 +0000 (10:58 +0000)
The regression was introduced with commit 5b946cada.
Restore pre gh-29696 behaviour.

Misc/NEWS.d/next/Build/2023-06-06-09-08-10.gh-issue-90005.8mmeJQ.rst [new file with mode: 0644]
configure
configure.ac

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 (file)
index 0000000..0a23fbf
--- /dev/null
@@ -0,0 +1 @@
+Fix a regression in :file:`configure` where we could end up unintentionally linking with ``libbsd``.
index a4d4996b0657988e8689942e2b579dcb3b51d918..e89155b5bbef9408624ba280c5a7fadd74a9c5dc 100755 (executable)
--- a/configure
+++ b/configure
 printf "%s\n" "$ac_cv_flock_decl" >&6; }
 if test "x$ac_cv_flock_decl" = xyes
 then :
+
+  for ac_func in flock
+do :
   ac_fn_c_check_func "$LINENO" "flock" "ac_cv_func_flock"
 if test "x$ac_cv_func_flock" = xyes
 then :
   printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h
 
-fi
-
+else $as_nop
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for flock in -lbsd" >&5
 printf %s "checking for flock in -lbsd... " >&6; }
 if test ${ac_cv_lib_bsd_flock+y}
@@ -19325,7 +19327,9 @@ then :
   FCNTL_LIBS="-lbsd"
 fi
 
+fi
 
+done
 fi
 
 
index e0a69583ca834a703f480ae90840a9d3457e9acb..dc9359e7c7bdeecc53bc18e2feee952d16a3ed86 100644 (file)
@@ -4936,9 +4936,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>])