From 478374ccf26f1198bfdcc9ed7b44d0f2444b82a1 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Sat, 28 Dec 2024 20:37:11 -0600 Subject: [PATCH 1/3] Set `LIBS` during sqlite3 library build checks --- .../next/Build/2024-12-28-21-05-19.gh-issue-128321.0UvbXw.rst | 2 ++ configure | 1 + configure.ac | 1 + 3 files changed, 4 insertions(+) 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..e1caf93db55ac6 --- /dev/null +++ b/Misc/NEWS.d/next/Build/2024-12-28-21-05-19.gh-issue-128321.0UvbXw.rst @@ -0,0 +1,2 @@ +Set ``LIBS`` when checking if :mod:`sqlite3` library functions are +available. diff --git a/configure b/configure index 299eff6bc3bf70..852e408d1bff78 100755 --- a/configure +++ b/configure @@ -15435,6 +15435,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 badb19d55895de..5ed147f5482f27 100644 --- a/configure.ac +++ b/configure.ac @@ -4221,6 +4221,7 @@ 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 From 2fea65148ae2ab0a50606cc22c8c26fecdd57588 Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Mon, 30 Dec 2024 00:54:32 +0100 Subject: [PATCH 2/3] Use LIBS iso. LDFLAGS for sqlite3 func checks --- configure | 1 - configure.ac | 1 - 2 files changed, 2 deletions(-) diff --git a/configure b/configure index 852e408d1bff78..3d2c60213db591 100755 --- a/configure +++ b/configure @@ -15434,7 +15434,6 @@ 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" diff --git a/configure.ac b/configure.ac index 5ed147f5482f27..ee034e5a9621df 100644 --- a/configure.ac +++ b/configure.ac @@ -4220,7 +4220,6 @@ 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], [ From 0f2f2c9cada6ca260744374ffe934354646c45b6 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Sun, 29 Dec 2024 20:23:59 -0600 Subject: [PATCH 3/3] Update news blurb --- .../Build/2024-12-28-21-05-19.gh-issue-128321.0UvbXw.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 index e1caf93db55ac6..ed72cc8ab1449a 100644 --- 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 @@ -1,2 +1,3 @@ -Set ``LIBS`` when checking if :mod:`sqlite3` library functions are -available. +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``.