summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS.d/next/Build/2023-06-06-09-08-10.gh-issue-90005.8mmeJQ.rst1
-rwxr-xr-xconfigure8
-rw-r--r--configure.ac5
3 files changed, 9 insertions, 5 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 d2a667f..7f17fe4 100755
--- a/configure
+++ b/configure
@@ -18968,13 +18968,15 @@ fi
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}
@@ -19015,7 +19017,9 @@ then :
FCNTL_LIBS="-lbsd"
fi
+fi
+done
fi
diff --git a/configure.ac b/configure.ac
index f8f428a..3d03fa6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4908,9 +4908,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>])