]> git.eshelyaron.com Git - emacs.git/commitdiff
Port better to AIX 7.3 with -lsqlite3 but not sqlite3.h
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 20 Jan 2025 00:23:06 +0000 (16:23 -0800)
committerEshel Yaron <me@eshelyaron.com>
Mon, 20 Jan 2025 18:51:29 +0000 (19:51 +0100)
* configure.ac (HAVE_SQLITE): Yes only if sqlite3.h can be
included (Bug#75667).

(cherry picked from commit dcccb9256262f8e992b75602dd4e861371b97361)

configure.ac

index 64d2fcd2aba10877a0b0770b0c14bf9c01c3fcd7..40a33a8c31fb9062e3ae4c43366ee4550b4c6d1a 100644 (file)
@@ -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.h>
+                            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"