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 \
src/emucore/tia \ src/emucore/tia \
src/emucore/tia/frame-manager \ src/emucore/tia/frame-manager \
src/common/repository/sqlite \ src/common/repository/sqlite
src/sqlite
###################################################################### ######################################################################
# The build rules follow - normally you should have no need to # 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_cheats=yes
_build_httplib=yes _build_httplib=yes
_build_png=yes _build_png=yes
_build_sqlite3=yes
_build_zip=yes _build_zip=yes
_build_static=no _build_static=no
_build_profile=no _build_profile=no
@ -206,6 +207,7 @@ Optional Features:
--disable-png --disable-png
--enable-zip enable/disable ZIP file support [enabled] --enable-zip enable/disable ZIP file support [enabled]
--disable-zip --disable-zip
--use-system-sqlite use libsqlite3 installed on system [disabled]
--enable-windowed enable/disable windowed rendering modes [enabled] --enable-windowed enable/disable windowed rendering modes [enabled]
--disable-windowed --disable-windowed
--enable-shared build shared binary [enabled] --enable-shared build shared binary [enabled]
@ -250,6 +252,7 @@ for ac_option in $@; do
--disable-png) _build_png=no ;; --disable-png) _build_png=no ;;
--enable-zip) _build_zip=yes ;; --enable-zip) _build_zip=yes ;;
--disable-zip) _build_zip=no ;; --disable-zip) _build_zip=no ;;
--use-system-sqlite) _build_sqlite3=no ;;
--enable-windowed) _build_windowed=yes ;; --enable-windowed) _build_windowed=yes ;;
--disable-windowed) _build_windowed=no ;; --disable-windowed) _build_windowed=no ;;
--enable-shared) _build_static=no ;; --enable-shared) _build_static=no ;;
@ -618,7 +621,7 @@ if test "$_build_zip" = yes ; then
#include <zlib.h> #include <zlib.h>
int main(void) { return strcmp(ZLIB_VERSION, zlibVersion()); } int main(void) { return strcmp(ZLIB_VERSION, zlibVersion()); }
EOF 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 if test "$_zlib" = yes ; then
echo "$_zlib" echo "$_zlib"
@ -657,6 +660,30 @@ else
_build_png=no _build_png=no
fi 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 # figure out installation directories
# #
@ -784,7 +811,7 @@ SQLITE_LIB="$SRC/sqlite"
JSON="$SRC/json" JSON="$SRC/json"
HTTP_LIB="$SRC/httplib" 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`" INCLUDES="$INCLUDES `$_sdlconfig --cflags`"
if test "$_build_static" = yes ; then if test "$_build_static" = yes ; then
@ -866,17 +893,24 @@ fi
if test "$_build_png" = yes ; then if test "$_build_png" = yes ; then
DEFINES="$DEFINES -DPNG_SUPPORT" DEFINES="$DEFINES -DPNG_SUPPORT"
if test "$_libpng" = yes ; then if test "$_libpng" = yes ; then
LIBS="$LIBS -lpng" LIBS="$LIBS `pkg-config --libs libpng`"
else else
MODULES="$MODULES $LIBPNG" MODULES="$MODULES $LIBPNG"
INCLUDES="$INCLUDES -I$LIBPNG" INCLUDES="$INCLUDES -I$LIBPNG"
fi fi
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 if test "$_build_zip" = yes ; then
DEFINES="$DEFINES -DZIP_SUPPORT" DEFINES="$DEFINES -DZIP_SUPPORT"
if test "$_zlib" = yes ; then if test "$_zlib" = yes ; then
LIBS="$LIBS -lz" LIBS="$LIBS `pkg-config --libs zlib`"
else else
MODULES="$MODULES $ZLIB" MODULES="$MODULES $ZLIB"
INCLUDES="$INCLUDES -I$ZLIB" INCLUDES="$INCLUDES -I$ZLIB"