aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2020-10-15 13:50:00 +0000
committerLuke Dashjr <luke-jr+git@utopios.org>2020-10-20 13:44:43 +0000
commit7b54d768e1514b328e1ac108d3db2f1bac3ba7ff (patch)
treeace67c61cc90f8b2dabbf5dbf47cdd2cf13404e5 /configure.ac
parent711ddce94377aea38ce30fa93b3ee8ea1d96ba98 (diff)
downloadbitcoin-7b54d768e1514b328e1ac108d3db2f1bac3ba7ff.tar.xz
Make sqlite support optional (compile-time)
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac30
1 files changed, 29 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index ab40991ce4..9a16b7c880 100644
--- a/configure.ac
+++ b/configure.ac
@@ -128,6 +128,12 @@ AC_ARG_ENABLE([wallet],
[enable_wallet=$enableval],
[enable_wallet=yes])
+AC_ARG_WITH([sqlite],
+ [AS_HELP_STRING([--with-sqlite=yes|no|auto],
+ [enable sqlite wallet support (default: auto, i.e., enabled if wallet is enabled and sqlite is found)])],
+ [use_sqlite=$withval],
+ [use_sqlite=auto])
+
AC_ARG_WITH([miniupnpc],
[AS_HELP_STRING([--with-miniupnpc],
[enable UPNP (default is yes if libminiupnpc is found)])],
@@ -1224,7 +1230,24 @@ if test x$enable_wallet != xno; then
fi
dnl Check for sqlite3
- PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.7.17], , [AC_MSG_ERROR([sqlite3 not found.])])
+ if test "x$use_sqlite" != "xno"; then
+ PKG_CHECK_MODULES([SQLITE], [sqlite3 >= 3.7.17], [have_sqlite=yes], [have_sqlite=no])
+ fi
+ AC_MSG_CHECKING([whether to build wallet with support for sqlite])
+ if test "x$use_sqlite" = "xno"; then
+ use_sqlite=no
+ elif test "x$have_sqlite" = "xno"; then
+ if test "x$use_sqlite" = "xyes"; then
+ AC_MSG_ERROR([sqlite support requested but cannot be built. Use --without-sqlite])
+ fi
+ use_sqlite=no
+ else
+ if test x$use_sqlite != xno; then
+ AC_DEFINE([USE_SQLITE],[1],[Define if sqlite support should be compiled in])
+ use_sqlite=yes
+ fi
+ fi
+ AC_MSG_RESULT([$use_sqlite])
fi
dnl Check for libminiupnpc (optional)
@@ -1578,6 +1601,7 @@ AM_CONDITIONAL([BUILD_DARWIN], [test x$BUILD_OS = xdarwin])
AM_CONDITIONAL([TARGET_LINUX], [test x$TARGET_OS = xlinux])
AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet = xyes])
+AM_CONDITIONAL([USE_SQLITE], [test "x$use_sqlite" = "xyes"])
AM_CONDITIONAL([ENABLE_TESTS],[test x$BUILD_TEST = xyes])
AM_CONDITIONAL([ENABLE_FUZZ],[test x$enable_fuzz = xyes])
AM_CONDITIONAL([ENABLE_QT],[test x$bitcoin_enable_qt = xyes])
@@ -1643,6 +1667,7 @@ AC_SUBST(AVX2_CXXFLAGS)
AC_SUBST(SHANI_CXXFLAGS)
AC_SUBST(ARM_CRC_CXXFLAGS)
AC_SUBST(LIBTOOL_APP_LDFLAGS)
+AC_SUBST(USE_SQLITE)
AC_SUBST(USE_UPNP)
AC_SUBST(USE_QRCODE)
AC_SUBST(BOOST_LIBS)
@@ -1718,6 +1743,9 @@ echo "Options used to compile and link:"
echo " boost process = $ax_cv_boost_process"
echo " multiprocess = $build_multiprocess"
echo " with wallet = $enable_wallet"
+if test "x$enable_wallet" != "xno"; then
+ echo " with sqlite = $use_sqlite"
+fi
echo " with gui / qt = $bitcoin_enable_qt"
if test x$bitcoin_enable_qt != xno; then
echo " with qr = $use_qr"