Make configure script use system libsqlite3, if requested (disabled by default).

This commit is contained in:
Stephen Anthony 2021-12-19 23:36:13 -03:30
parent 6dc8c51395
commit bd2f5cc866
2 changed files with 39 additions and 6 deletions

View File

@ -176,8 +176,7 @@ MODULES += \
src/emucore \
src/emucore/tia \
src/emucore/tia/frame-manager \
src/common/repository/sqlite \
src/sqlite
src/common/repository/sqlite
######################################################################
# The build rules follow - normally you should have no need to

42
configure vendored
View File

@ -22,6 +22,7 @@ _build_joystick=yes
_build_cheats=yes
_build_httplib=yes
_build_png=yes
_build_sqlite3=yes
_build_zip=yes
_build_static=no
_build_profile=no
@ -206,6 +207,7 @@ Optional Features:
--disable-png
--enable-zip enable/disable ZIP file support [enabled]
--disable-zip
--use-system-sqlite use libsqlite3 installed on system [disabled]
--enable-windowed enable/disable windowed rendering modes [enabled]
--disable-windowed
--enable-shared build shared binary [enabled]
@ -250,6 +252,7 @@ for ac_option in $@; do
--disable-png) _build_png=no ;;
--enable-zip) _build_zip=yes ;;
--disable-zip) _build_zip=no ;;
--use-system-sqlite) _build_sqlite3=no ;;
--enable-windowed) _build_windowed=yes ;;
--disable-windowed) _build_windowed=no ;;
--enable-shared) _build_static=no ;;
@ -618,7 +621,7 @@ if test "$_build_zip" = yes ; then
#include <zlib.h>
int main(void) { return strcmp(ZLIB_VERSION, zlibVersion()); }
EOF
cc_check $LDFLAGS $CXXFLAGS $ZLIB_CFLAGS $ZLIB_LIBS -lz && _zlib=yes
cc_check $LDFLAGS $CXXFLAGS $ZLIB_CFLAGS $ZLIB_LIBS `pkg-config --libs zlib` && _zlib=yes
if test "$_zlib" = yes ; then
echo "$_zlib"
@ -657,6 +660,30 @@ else
_build_png=no
fi
#
# Check for sqlite3
#
_libsqlite3=no
echocheck "libsqlite3"
if test "$_build_sqlite3" = no ; then
cat > $TMPC << EOF
#include <stdio.h>
#include <sqlite3.h>
int main(void) { return printf("%s\n", SQLITE_VERSION); }
EOF
cc_check $LDFLAGS $CXXFLAGS `pkg-config --libs sqlite3` && _libsqlite3=yes
if test "$_libsqlite3" = yes ; then
echo "$_libsqlite3 (WIP, not complete)"
else
echo "built-in"
_build_sqlite3=yes
fi
else
echo "built-in"
_build_sqlite3=yes
fi
#
# figure out installation directories
#
@ -784,7 +811,7 @@ SQLITE_LIB="$SRC/sqlite"
JSON="$SRC/json"
HTTP_LIB="$SRC/httplib"
INCLUDES="-I$CORE -I$COMMON -I$TV -I$TIA -I$TIA_FRAME_MANAGER -I$JSON -I$SQLITE_REPO -I$SQLITE_LIB"
INCLUDES="-I$CORE -I$COMMON -I$TV -I$TIA -I$TIA_FRAME_MANAGER -I$JSON -I$SQLITE_REPO"
INCLUDES="$INCLUDES `$_sdlconfig --cflags`"
if test "$_build_static" = yes ; then
@ -866,17 +893,24 @@ fi
if test "$_build_png" = yes ; then
DEFINES="$DEFINES -DPNG_SUPPORT"
if test "$_libpng" = yes ; then
LIBS="$LIBS -lpng"
LIBS="$LIBS `pkg-config --libs libpng`"
else
MODULES="$MODULES $LIBPNG"
INCLUDES="$INCLUDES -I$LIBPNG"
fi
fi
if test "$_libsqlite3" = yes ; then
LIBS="$LIBS `pkg-config --libs sqlite3`"
else
MODULES="$MODULES $SQLITE_LIB"
INCLUDES="$INCLUDES -I$SQLITE_LIB"
fi
if test "$_build_zip" = yes ; then
DEFINES="$DEFINES -DZIP_SUPPORT"
if test "$_zlib" = yes ; then
LIBS="$LIBS -lz"
LIBS="$LIBS `pkg-config --libs zlib`"
else
MODULES="$MODULES $ZLIB"
INCLUDES="$INCLUDES -I$ZLIB"