aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac154
1 files changed, 97 insertions, 57 deletions
diff --git a/configure.ac b/configure.ac
index 43a622feab..34509993a0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,6 +37,13 @@ AM_MAINTAINER_MODE([enable])
dnl make the compilation flags quiet unless V=1 is used
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+# Enable wallet
+AC_ARG_ENABLE([wallet],
+ [AS_HELP_STRING([--enable-wallet],
+ [enable wallet (default is yes)])],
+ [enable_wallet=$enableval],
+ [enable_wallet=yes])
+
AC_ARG_WITH([miniupnpc],
[AS_HELP_STRING([--with-miniupnpc],
[enable UPNP (default is yes if libminiupnpc is found)])],
@@ -61,7 +68,32 @@ AC_ARG_WITH([qt],
[AS_HELP_STRING([--with-qt],
[enable qt (default is yes)])],
[use_qt=$withval],
- [use_qt=yes])
+ [use_qt=auto])
+AC_DEFUN([BITCOIN_QT_FAIL],[
+ if test "x$use_qt" = "xauto"; then
+ AC_MSG_WARN([$1; bitcoin-qt frontend will not be built])
+ use_qt=no
+ else
+ AC_MSG_ERROR([$1])
+ fi
+])
+AC_DEFUN([BITCOIN_QT_CHECK],[
+ if test "x$use_qt" != "xno"; then
+ true
+ $1
+ else
+ true
+ $2
+ fi
+])
+AC_DEFUN([BITCOIN_QT_PATH_PROGS],[
+ BITCOIN_QT_CHECK([
+ AC_PATH_PROGS($1,$2,$3,$4)
+ if test "x$$1" = "x"; then
+ BITCOIN_QT_FAIL([$1 not found])
+ fi
+ ])
+])
AC_ARG_ENABLE(tests,
AS_HELP_STRING([--enable-tests],[compile tests (default is yes)]),
@@ -136,13 +168,13 @@ AC_PATH_PROG(LCOV, lcov)
AC_PATH_PROG(JAVA, java)
AC_PATH_PROG(GENHTML, genhtml)
AC_PATH_PROG([GIT], [git])
-AC_PATH_PROGS([MOC], [moc-qt4 moc4 moc],, $qt_bin_path:$PATH)
-AC_PATH_PROGS([UIC], [uic-qt4 uic4 uic],, $qt_bin_path:$PATH)
-AC_PATH_PROGS([RCC], [rcc-qt4 rcc4 rcc],, $qt_bin_path:$PATH)
-AC_PATH_PROGS([LRELEASE], [lrelease-qt4 lrelease4 lrelease],, $qt_bin_path:$PATH)
-AC_PATH_PROGS([LUPDATE], [lupdate-qt4 lupdate4 lupdate],, $qt_bin_path:$PATH)
-AC_PATH_PROG([PROTOC], [protoc],, $protoc_bin_path:$PATH)
+BITCOIN_QT_PATH_PROGS([MOC], [moc-qt4 moc4 moc],, $qt_bin_path:$PATH)
+BITCOIN_QT_PATH_PROGS([UIC], [uic-qt4 uic4 uic],, $qt_bin_path:$PATH)
+BITCOIN_QT_PATH_PROGS([RCC], [rcc-qt4 rcc4 rcc],, $qt_bin_path:$PATH)
+BITCOIN_QT_PATH_PROGS([LRELEASE], [lrelease-qt4 lrelease4 lrelease],, $qt_bin_path:$PATH)
+BITCOIN_QT_PATH_PROGS([PROTOC], [protoc],, $protoc_bin_path:$PATH)
AC_PATH_PROG(CCACHE,ccache)
+AC_PATH_PROGS([LUPDATE], [lupdate-qt4 lupdate4 lupdate],, $qt_bin_path:$PATH)
AC_PATH_PROG(XGETTEXT,xgettext)
AC_PATH_PROG(HEXDUMP,hexdump)
PKG_PROG_PKG_CONFIG
@@ -151,7 +183,7 @@ PKG_PROG_PKG_CONFIG
## compatibility with the legacy buildsystem.
##
CXXFLAGS="$CXXFLAGS -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter"
-CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO"
+CPPFLAGS="$CPPFLAGS -DBOOST_SPIRIT_THREADSAFE -DHAVE_BUILD_INFO -D__STDC_FORMAT_MACROS"
AC_LANG_PUSH([C++])
@@ -196,7 +228,7 @@ case $host in
AC_MSG_ERROR("windres not found")
fi
- CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
+ CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -D__USE_MINGW_ANSI_STDIO"
LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE"
CXXFLAGS="$CXXFLAGS -w"
;;
@@ -218,15 +250,15 @@ case $host in
bdb_prefix=`$BREW --prefix berkeley-db4`
export PKG_CONFIG_PATH="$openssl_prefix/lib/pkgconfig:$PKG_CONFIG_PATH"
CPPFLAGS="$CPPFLAGS -I$bdb_prefix/include"
- LIBS="$LIBS -L/$bdb_prefix/lib"
+ LIBS="$LIBS -L$bdb_prefix/lib"
fi
fi
- if test x$use_qt = xyes; then
+ BITCOIN_QT_CHECK([
MOC_DEFS="-DQ_OS_MAC"
base_frameworks="-framework Foundation -framework ApplicationServices -framework AppKit"
AX_CHECK_LINK_FLAG([[$base_frameworks]],[LIBS="$LIBS $base_frameworks"],[AC_MSG_ERROR(could not find base frameworks)])
- fi
+ ])
CPPFLAGS="$CPPFLAGS -DMAC_OSX"
TESTDEFS="-DBOOST_TEST_DYN_LINK"
@@ -337,8 +369,10 @@ AC_TRY_COMPILE([#include <sys/socket.h>],
[ AC_MSG_RESULT(no)]
)
-dnl Check for libdb_cxx
-BITCOIN_FIND_BDB48
+if test x$enable_wallet != xno; then
+ dnl Check for libdb_cxx only if wallet enabled
+ BITCOIN_FIND_BDB48
+fi
dnl Check for libminiupnpc (optional)
if test x$use_upnp != xno; then
@@ -431,8 +465,11 @@ if test x$use_pkgconfig = xyes; then
PKG_CHECK_MODULES([SSL], [libssl], [INCLUDES="$INCLUDES $SSL_CFLAGS"; LIBS="$LIBS $SSL_LIBS"], [AC_MSG_ERROR(openssl not found.)])
PKG_CHECK_MODULES([CRYPTO], [libcrypto], [INCLUDES="$INCLUDES $CRYPTO_CFLAGS"; LIBS="$LIBS $CRYPTO_LIBS"], [AC_MSG_ERROR(libcrypto not found.)])
- if test x$use_qt = xyes; then
- PKG_CHECK_MODULES([QT], [QtCore QtGui QtNetwork], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes], [have_qt=no])
+ BITCOIN_QT_CHECK([
+ PKG_CHECK_MODULES([QT], [QtCore QtGui QtNetwork], [QT_INCLUDES="$QT_CFLAGS"; have_qt=yes],[
+ have_qt=no
+ BITCOIN_QT_FAIL([Qt dependencies not found])
+ ])
if test x$use_tests = xyes; then
PKG_CHECK_MODULES([QT_TEST], [QtTest], [QT_TEST_INCLUDES="$QT_TEST_CFLAGS"; have_qt_test=yes], [have_qt_test=no])
fi
@@ -443,7 +480,7 @@ if test x$use_pkgconfig = xyes; then
PKG_CHECK_MODULES([QR], [libqrencode], [have_qrencode=yes], [have_qrencode=no])
fi
PKG_CHECK_MODULES([PROTOBUF], [protobuf], [have_protobuf=yes], [AC_MSG_ERROR(libprotobuf not found.)])
- fi
+ ])
]
)
else
@@ -453,7 +490,7 @@ else
AC_CHECK_HEADER([openssl/ssl.h],, AC_MSG_ERROR(libssl headers missing),)
AC_CHECK_LIB([ssl], [main],, AC_MSG_ERROR(libssl missing))
- if test x$use_qt = xyes; then
+ BITCOIN_QT_CHECK([
TEMP_LIBS="$LIBS"
LIBS=
if test x$qt_lib_path != x; then
@@ -466,22 +503,25 @@ else
fi
if test x$TARGET_OS == xwindows; then
- AC_CHECK_LIB([imm32], [main],, AC_MSG_ERROR(libimm32 not found. Install it or use --without-qt.))
+ AC_CHECK_LIB([imm32], [main],, BITCOIN_QT_FAIL(libimm32 not found))
fi
+ ])
#TODO: These are only needed when they're linked directly to parent libs. It really has nothing to do with windows.
#Instead, check for missing functions in parent libs and assume static if they're absent.
if test x$TARGET_OS == xwindows; then
- AC_CHECK_LIB([qcncodecs], [main],, AC_MSG_ERROR(libqcncodecs not found. Install it or use --without-qt.))
- AC_CHECK_LIB([qjpcodecs], [main],, AC_MSG_ERROR(libqjpcodecs not found. Install it or use --without-qt.))
- AC_CHECK_LIB([qkrcodecs], [main],, AC_MSG_ERROR(libqkrcodecs not found. Install it or use --without-qt.))
- AC_CHECK_LIB([qtwcodecs], [main],, AC_MSG_ERROR(libqtwcodecs not found. Install it or use --without-qt.))
+ BITCOIN_QT_CHECK(AC_CHECK_LIB([qcncodecs],[main],,BITCOIN_QT_FAIL(libqcncodecs not found)))
+ BITCOIN_QT_CHECK(AC_CHECK_LIB([qjpcodecs],[main],,BITCOIN_QT_FAIL(libqjpcodecs not found)))
+ BITCOIN_QT_CHECK(AC_CHECK_LIB([qkrcodecs],[main],,BITCOIN_QT_FAIL(libqkrcodecs not found)))
+ BITCOIN_QT_CHECK(AC_CHECK_LIB([qtwcodecs],[main],,BITCOIN_QT_FAIL(libqtwcodecs not found)))
fi
- AC_CHECK_LIB([QtCore], [main],, AC_MSG_ERROR(libQtCore not found. Install it or use --without-qt.))
- AC_CHECK_LIB([QtGui], [main],, AC_MSG_ERROR(libQtGui not found. Install it or use --without-qt.))
- AC_CHECK_LIB([QtNetwork], [main],, AC_MSG_ERROR(libQtNetwork not found. Install it or use --without-qt.))
- AC_CHECK_LIB([protobuf], [main],, AC_MSG_ERROR(libprotobuf not found. Install it or use --without-qt.))
+ BITCOIN_QT_CHECK(AC_CHECK_LIB([QtCore] ,[main],,BITCOIN_QT_FAIL(libQtCore not found)))
+ BITCOIN_QT_CHECK(AC_CHECK_LIB([QtGui] ,[main],,BITCOIN_QT_FAIL(libQtGui not found)))
+ BITCOIN_QT_CHECK(AC_CHECK_LIB([QtNetwork],[main],,BITCOIN_QT_FAIL(libQtNetwork not found)))
+ BITCOIN_QT_CHECK(AC_CHECK_LIB([protobuf] ,[main],,BITCOIN_QT_FAIL(libprotobuf not found)))
+
+ BITCOIN_QT_CHECK([
QT_LIBS="$LIBS"
LIBS="$TEMP_LIBS"
@@ -490,10 +530,13 @@ else
QT_INCLUDES="-I$qt_include_path -I$qt_include_path/QtCore -I$qt_include_path/QtGui -I$qt_include_path/QtNetwork -I$qt_include_path/QtTest -I$qt_include_path/QtDBus"
CPPFLAGS="$CPPFLAGS $QT_INCLUDES"
fi
- AC_CHECK_HEADER([QtPlugin],, AC_MSG_ERROR(QtCore headers missing. Install them or use --without-qt.),)
- AC_CHECK_HEADER([QApplication],, AC_MSG_ERROR(QtGUI headers missing. Install them or use --without-qt.),)
- AC_CHECK_HEADER([QLocalSocket],, AC_MSG_ERROR(QtNetwork headers missing. Install them or use --without-qt.),)
+ ])
+ BITCOIN_QT_CHECK(AC_CHECK_HEADER([QtPlugin],,BITCOIN_QT_FAIL(QtCore headers missing),))
+ BITCOIN_QT_CHECK(AC_CHECK_HEADER([QApplication],, BITCOIN_QT_FAIL(QtGui headers missing),))
+ BITCOIN_QT_CHECK(AC_CHECK_HEADER([QLocalSocket],, BITCOIN_QT_FAIL(QtNetwork headers missing),))
+
+ BITCOIN_QT_CHECK([
if test x$use_tests = xyes; then
TEMP_LIBS="$LIBS"
LIBS=
@@ -521,7 +564,7 @@ else
AC_CHECK_LIB([qrencode], [main],, [have_qrencode=no])
AC_CHECK_HEADER([qrencode.h],, have_qrencode=no)
fi
- fi
+ ])
fi
if test x$use_ipv6 = xyes; then
@@ -563,6 +606,20 @@ if test "x$use_ccache" != "xno"; then
AC_MSG_RESULT($use_ccache)
fi
+dnl enable wallet
+AC_MSG_CHECKING([if wallet should be enabled])
+if test x$enable_wallet != xno; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE_UNQUOTED([ENABLE_WALLET],[1],[Define to 1 to enable wallet functions])
+
+else
+ AC_MSG_RESULT(no)
+
+ if test "x$use_qt" != "xno"; then
+ AC_MSG_ERROR([Cannot currently build Qt GUI with wallet disabled. Use --without-qt.])
+ fi
+fi
+
dnl enable ipv6 support
AC_MSG_CHECKING([if ipv6 should be enabled])
if test x$have_ipv6 = xno; then
@@ -608,35 +665,19 @@ fi
dnl enable qt support
AC_MSG_CHECKING([if qt should be enabled])
-if test x$use_qt = xyes; then
- if test x$have_qt = xno; then
- AC_MSG_ERROR("qt support requested but qt could not be located. use --without-qt")
- fi
- if test x$MOC = x; then
- AC_MSG_ERROR("qt support requested but moc was not found. use --without-qt")
- fi
- if test x$PROTOC = x; then
- AC_MSG_ERROR("qt support requested but protoc was not found. use --without-qt")
- fi
- if test x$UIC = x; then
- AC_MSG_ERROR("qt support requested but uic was not found. use --without-qt")
- fi
- if test x$RCC = x; then
- AC_MSG_ERROR("qt support requested but rcc was not found. use --without-qt")
- fi
- if test x$LRELEASE = x; then
- AC_MSG_ERROR("qt support requested but lrelease was not found. use --without-qt")
- fi
+BITCOIN_QT_CHECK([
+ use_qt=yes
+ BUILD_QT=qt
if test x$use_tests = xyes; then
if test x$have_qt_test = xno; then
AC_MSG_ERROR("libQtTest not found. Use --disable-tests or --without-qt.")
fi
fi
if test x$have_qt_dbus = xno; then
- use_dbus=no
if test x$use_dbus = xyes; then
- AC_MSG_ERROR("libQtDBus not found. Use --without-qtdbus.")
+ AC_MSG_ERROR("libQtDBus not found. Install libQtDBus or remove --with-qtdbus.")
fi
+ use_dbus=no
fi
if test x$XGETTEXT == x; then
AC_MSG_WARN("xgettext is required to update qt translations")
@@ -644,11 +685,9 @@ if test x$use_qt = xyes; then
if test x$LUPDATE == x; then
AC_MSG_WARN("lupdate is required to update qt translations")
fi
-
- BUILD_QT=qt
-else
+],[
use_qt=no
-fi
+])
AC_MSG_RESULT($use_qt)
@@ -682,7 +721,7 @@ if test x$use_qt = xyes; then
fi
fi
- if test x$use_tests = xyes; then
+ if test x$use_tests$have_qt_test = xyesyes; then
BUILD_TEST_QT="test"
fi
fi
@@ -693,6 +732,7 @@ fi
AM_CONDITIONAL([TARGET_DARWIN], [test x$TARGET_OS = xdarwin])
AM_CONDITIONAL([TARGET_WINDOWS], [test x$TARGET_OS = xwindows])
+AM_CONDITIONAL([ENABLE_WALLET],[test x$enable_wallet == xyes])
AM_CONDITIONAL([USE_QRCODE], [test x$use_qr = xyes])
AM_CONDITIONAL([USE_LCOV],[test x$use_lcov == xyes])
AM_CONDITIONAL([USE_COMPARISON_TOOL],[test x$use_comparison_tool != xno])