From d96d23a5102057a65fe586fe8538b98ad4c2e36c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 6 Feb 2022 15:43:48 +0200 Subject: [PATCH 22/22] Autotools: Do not require libsqlite3 when it's not really needed See osdn #43565 Signed-off-by: Marko Lindqvist --- INSTALL | 5 +- configure.ac | 106 +++++++++++++++++++++---------------------- doc/README.packaging | 4 +- 3 files changed, 59 insertions(+), 56 deletions(-) diff --git a/INSTALL b/INSTALL index dfda3f2607..0d89b8b541 100644 --- a/INSTALL +++ b/INSTALL @@ -4,7 +4,7 @@ Installing Freeciv: This file describes how to compile and install Freeciv. Last time we made sure this file is up to date was 16-Jul-06. -Last minor update was 20-Jan-22. +Last minor update was 06-Feb-22. There may be a localized version of this file in the ./doc directory, named INSTALL. (e.g., INSTALL.de). @@ -83,7 +83,8 @@ out whether your system is suitable. If in doubt, just try it. https://icu.unicode.org/ - - libsqlite3 + - libsqlite3 is required unless both authentication and modpack + installer support have been disabled from the build. https://www.sqlite.org/ diff --git a/configure.ac b/configure.ac index 2bd89db384..ea1b5f15f7 100644 --- a/configure.ac +++ b/configure.ac @@ -103,11 +103,6 @@ if test "x$fc_cv_malloc_zero_ok" = "xyes" ; then AC_DEFINE([MALLOC_ZERO_OK], [1], [It's ok to call malloc() for zero bytes]) fi -if test "x$emscripten" != "xyes" ; then - dnl Not needed in emscripten build as both users - fcdb and fcmp - are disabled - FC_CHECK_SQLITE3([], [AC_MSG_ERROR([sqlite3 not found])]) -fi - dnl set default values fcdb_all=no fcdb_mysql=no @@ -153,6 +148,59 @@ for db in $(echo $databases | $SED 's/,/ /g') ; do fi done +AC_ARG_ENABLE([fcmp], + AS_HELP_STRING([--enable-fcmp=no/yes/gtk3/gtk4/qt/cli/all/auto], [build freeciv-modpack-program [auto]]), +[fc_mp=${enableval}], +[if test "x$emscripten" = "xyes" ; then + fc_mp=no +else + fc_mp=auto +fi]) + +fcmp_cli=no +fcmp_gtk3=no +fcmp_gtk4=no +fcmp_qt=no +fcmp_list= + +if test "x$fc_mp" != "xno" && test "x$emscripten" = "xyes" ; then + AC_MSG_ERROR([fcmp not supported with emscripten]) +fi + +if test "x$fc_mp" = "xcli" ; then + dnl Only cli requested -> no gui needed + modinst=cli +fi + +for mp in $(echo $fc_mp | $SED 's/,/ /g') ; do + if test "x$mp" = "xno" ; then + modinst=no + elif test "x$mp" = "xauto" || test "x$mp" = "xyes" ; then + modinst=auto + elif test "x$mp" = "xall" ; then + modinst=all + else if test "x$mp" = "xgtk3" || + test "x$mp" = "xgtk3.0" || + test "x$mp" = "xgtk30" || + test "x$mp" = "xgtk-3.0" ; then + req_fcmp_gtk3=yes + elif test "x$mp" = "xgtk4" ; then + req_fcmp_gtk4=yes + elif test "x$mp" = "xqt" ; then + req_fcmp_qt=yes + elif test "x$mp" = "xcli" ; then + req_fcmp_cli=yes + elif test "x$mp" != "xyes" ; then + AC_MSG_ERROR([bad value ${mp} for --enable-fcmp]) + fi + fi +done + +if test "x$modinst" != "xno" || test "x$fcdb_sqlite3" != "xno" ; then + dnl Not needed in in builds where both users - fcdb and fcmp - are disabled + FC_CHECK_SQLITE3([], [AC_MSG_ERROR([sqlite3 not found])]) +fi + dnl checks for database mysql dnl sets FCDB_MYSQL(conditional), FCDB_MYSQL_CFLAGS FC_FCDB_MYSQL @@ -1140,54 +1188,6 @@ esac], [fcruleup=yes]) AM_CONDITIONAL([FCRULEUP], [test "x$fcruleup" != "xno"]) dnl freeciv-modpack checks -AC_ARG_ENABLE([fcmp], - AS_HELP_STRING([--enable-fcmp=no/yes/gtk3/gtk4/qt/cli/all/auto], [build freeciv-modpack-program [auto]]), -[fc_mp=${enableval}], -[if test "x$emscripten" = "xyes" ; then - fc_mp=no -else - fc_mp=auto -fi]) - -fcmp_cli=no -fcmp_gtk3=no -fcmp_gtk4=no -fcmp_qt=no -fcmp_list= - -if test "x$fc_mp" != "xno" && test "x$emscripten" = "xyes" ; then - AC_MSG_ERROR([fcmp not supported with emscripten]) -fi - -if test "x$fc_mp" = "xcli" ; then - dnl Only cli requested -> no gui needed - modinst=cli -fi - -for mp in $(echo $fc_mp | $SED 's/,/ /g') ; do - if test "x$mp" = "xno" ; then - modinst=no - elif test "x$mp" = "xauto" || test "x$mp" = "xyes" ; then - modinst=auto - elif test "x$mp" = "xall" ; then - modinst=all - else if test "x$mp" = "xgtk3" || - test "x$mp" = "xgtk3.0" || - test "x$mp" = "xgtk30" || - test "x$mp" = "xgtk-3.0" ; then - req_fcmp_gtk3=yes - elif test "x$mp" = "xgtk4" ; then - req_fcmp_gtk4=yes - elif test "x$mp" = "xqt" ; then - req_fcmp_qt=yes - elif test "x$mp" = "xcli" ; then - req_fcmp_cli=yes - elif test "x$mp" != "xyes" ; then - AC_MSG_ERROR([bad value ${mp} for --enable-fcmp]) - fi - fi -done - if test "x$req_fcmp_gtk3" = "xyes" || test "x$modinst" = "xall" || test "x$modinst" = "xauto" ; then PKG_CHECK_MODULES([GTK3MP], [gtk+-3.0 >= 3.10.0], diff --git a/doc/README.packaging b/doc/README.packaging index 6f7517b843..6e950ef83f 100644 --- a/doc/README.packaging +++ b/doc/README.packaging @@ -21,7 +21,9 @@ Updating from 3.0 to 3.1 * Gtk3-client has been marked unmaintained (this does not affect default gtk3.22-client) * Sdl1.2 Mixer support has been dropped -* Libsqlite3 is now hard requirement +* Libsqlite3 is now required in default build. One has to disable both + authentication and modpack installer support from the build to not + have that requirement. * Sqlite3 based player authentication support is enabled by default * Added gtk4-client. It's still in development. * Lua version to use is 5.4 now -- 2.34.1