From: Paul Eggert Date: Mon, 20 Jan 2025 00:23:06 +0000 (-0800) Subject: Port better to AIX 7.3 with -lsqlite3 but not sqlite3.h X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=915640b04e2228e66f60e5d2c26c068dd0269b77;p=emacs.git Port better to AIX 7.3 with -lsqlite3 but not sqlite3.h * configure.ac (HAVE_SQLITE): Yes only if sqlite3.h can be included (Bug#75667). (cherry picked from commit dcccb9256262f8e992b75602dd4e861371b97361) --- diff --git a/configure.ac b/configure.ac index 64d2fcd2aba..40a33a8c31f 100644 --- a/configure.ac +++ b/configure.ac @@ -3749,9 +3749,18 @@ if test "${with_sqlite3}" != "no"; then CFLAGS="$SAVE_CFLAGS" fi else - AC_CHECK_LIB([sqlite3], [sqlite3_open_v2], - [HAVE_SQLITE3=yes], - [HAVE_SQLITE3=no]) + AC_CACHE_CHECK([for sqlite3], + [emacs_cv_have_sqlite3], + [OLIBS=$LIBS + LIBS="-lsqlite3 $LIBS" + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include + sqlite3 *handle;]], + [[return sqlite3_open_v2 ("", &handle, 0, "");]])], + [emacs_cv_have_sqlite3=yes], + [emacs_cv_have_sqlite3=no]) + LIBS=$OLIBS]) + HAVE_SQLITE3=$emacs_cv_have_sqlite3 if test "$HAVE_SQLITE3" = "yes"; then SQLITE3_LIBS=-lsqlite3 LIBS="$SQLITE3_LIBS $LIBS"