]> skyeroc.xyz Git - dgamelaunch/commitdiff
Check for libsqlite3 and error if it isn't found
authorRon Nazarov <ron@noisytoot.org>
Wed, 4 Dec 2024 01:09:51 +0000 (01:09 +0000)
committerRon Nazarov <ron@noisytoot.org>
Wed, 4 Dec 2024 01:09:51 +0000 (01:09 +0000)
Instead of just adding it anyway, which resulted in confusing and
incorrect error messages when it wasn't found but --enable-sqlite was
specified.

configure.ac

index 8935a2ded09bdb69b8ed3c40876c02168bb4643b..9d8e990b9eeef28392bbc1fd13572ef43773035f 100644 (file)
@@ -110,7 +110,7 @@ AC_ARG_WITH(sqlite-db,
 if test "$enable_sqlite" = yes; then
    AC_MSG_RESULT([Using SQLite for the database, located at $dgl_sqlite_db])
    AC_DEFINE(USE_SQLITE3,1,[Use SQLite for the database instead of flat text file.])
-   LIBS="$LIBS -lsqlite3"
+   AC_CHECK_LIB(sqlite3, sqlite3_open, [LIBS+=" -lsqlite3"], [AC_MSG_ERROR([Cannot find libsqlite3.])])
    AC_DEFINE_UNQUOTED(USE_SQLITE_DB, "$dgl_sqlite_db", [Path and filename of the SQLite database.])
 fi