From cd6a879638a25969e06ed14aa609aa158b20cc41 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Mon, 30 Dec 2024 02:55:14 -0600 Subject: [PATCH] gh-128321: Set LIBS instead of LDFLAGS when checking sqlite3 requirements (GH-128322) (cherry picked from commit 81376fef76a53fb79893bfa9c9db18d97c228fbe) Co-authored-by: Zanie Blue Co-authored-by: Erlend E. Aasland --- .../next/Build/2024-12-28-21-05-19.gh-issue-128321.0UvbXw.rst | 3 +++ configure | 2 +- configure.ac | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 Misc/NEWS.d/next/Build/2024-12-28-21-05-19.gh-issue-128321.0UvbXw.rst diff --git a/Misc/NEWS.d/next/Build/2024-12-28-21-05-19.gh-issue-128321.0UvbXw.rst b/Misc/NEWS.d/next/Build/2024-12-28-21-05-19.gh-issue-128321.0UvbXw.rst new file mode 100644 index 00000000000000..ed72cc8ab1449a --- /dev/null +++ b/Misc/NEWS.d/next/Build/2024-12-28-21-05-19.gh-issue-128321.0UvbXw.rst @@ -0,0 +1,3 @@ +Set ``LIBS`` instead of ``LDFLAGS`` when checking if :mod:`sqlite3` library +functions are available. This fixes the ordering of linked libraries during +checks, which was incorrect when using a statically linked ``libsqlite3``. diff --git a/configure b/configure index 891f39033602e1..8401e07ba86c10 100755 --- a/configure +++ b/configure @@ -15055,7 +15055,7 @@ save_LIBS=$LIBS CPPFLAGS="$CPPFLAGS $LIBSQLITE3_CFLAGS" - LDFLAGS="$LIBSQLITE3_LIBS $LDFLAGS" + LIBS="$LIBSQLITE3_LIBS $LIBS" ac_fn_c_check_header_compile "$LINENO" "sqlite3.h" "ac_cv_header_sqlite3_h" "$ac_includes_default" if test "x$ac_cv_header_sqlite3_h" = xyes diff --git a/configure.ac b/configure.ac index 68ca1d0de1b11f..4a341b2735c1ed 100644 --- a/configure.ac +++ b/configure.ac @@ -4185,7 +4185,7 @@ WITH_SAVE_ENV([ dnl bpo-45774/GH-29507: The CPP check in AC_CHECK_HEADER can fail on FreeBSD, dnl hence CPPFLAGS instead of CFLAGS. CPPFLAGS="$CPPFLAGS $LIBSQLITE3_CFLAGS" - LDFLAGS="$LIBSQLITE3_LIBS $LDFLAGS" + LIBS="$LIBSQLITE3_LIBS $LIBS" AC_CHECK_HEADER([sqlite3.h], [ have_sqlite3=yes