aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorCory Fields <cory-nospam-@coryfields.com>2016-02-17 14:35:35 -0500
committerCory Fields <cory-nospam-@coryfields.com>2016-04-19 14:37:15 -0400
commita4625acbf8afbe3f698e8dc7936312c9d2b65d22 (patch)
tree0b9f648869425e3d5443c384f6cd134f9d211d47 /configure.ac
parent04a29373571d44be36bd099c3b3ec3cda89e99d1 (diff)
downloadbitcoin-a4625acbf8afbe3f698e8dc7936312c9d2b65d22.tar.xz
leveldb: integrate leveldb into our buildsystem
leveldb's buildsystem causes us a few problems: - breaks out-of-tree builds - forces flags used for some tools - limits cross builds Rather than continuing to add wrappers around it, simply integrate it into our build.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac22
1 files changed, 19 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 6e463dfc55..03b9052104 100644
--- a/configure.ac
+++ b/configure.ac
@@ -267,7 +267,7 @@ case $host in
fi
CPPFLAGS="$CPPFLAGS -D_MT -DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB"
- LEVELDB_TARGET_FLAGS="TARGET_OS=OS_WINDOWS_CROSSCOMPILE"
+ LEVELDB_TARGET_FLAGS="-DOS_WINDOWS"
if test "x$CXXFLAGS_overridden" = "xno"; then
CXXFLAGS="$CXXFLAGS -w"
fi
@@ -289,7 +289,7 @@ case $host in
;;
*darwin*)
TARGET_OS=darwin
- LEVELDB_TARGET_FLAGS="TARGET_OS=Darwin"
+ LEVELDB_TARGET_FLAGS="-DOS_MACOSX"
if test x$cross_compiling != xyes; then
BUILD_OS=darwin
AC_CHECK_PROG([PORT],port, port)
@@ -354,9 +354,11 @@ case $host in
OBJCXXFLAGS="$CXXFLAGS"
;;
*linux*)
- TARGET_OS=linux
+ LEVELDB_TARGET_FLAGS="-DOS_LINUX"
;;
*)
+ OTHER_OS=`echo ${host_os} | awk '{print toupper($0)}'`
+ LEVELDB_TARGET_FLAGS="-DOS_${OTHER_OS}"
;;
esac
@@ -541,6 +543,18 @@ if test x$use_reduce_exports = xyes; then
[AC_MSG_ERROR([Cannot set default symbol visibility. Use --disable-reduce-exports.])])
fi
+dnl This can go away when we require c++11
+TEMP_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS -std=c++0x"
+AC_MSG_CHECKING(for c++11 atomics)
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ #include <atomic>
+ ]],[[]])],
+ [ AC_MSG_RESULT(yes); LEVELDB_ATOMIC_CPPFLAGS="-DLEVELDB_ATOMIC_PRESENT"; LEVELDB_ATOMIC_CXXFLAGS="-std=c++0x"],
+ [ AC_MSG_RESULT(no)]
+)
+CXXFLAGS="$TEMP_CXXFLAGS"
+
LEVELDB_CPPFLAGS=
LIBLEVELDB=
LIBMEMENV=
@@ -1043,6 +1057,8 @@ AC_SUBST(TESTDEFS)
AC_SUBST(LEVELDB_TARGET_FLAGS)
AC_SUBST(MINIUPNPC_CPPFLAGS)
AC_SUBST(MINIUPNPC_LIBS)
+AC_SUBST(LEVELDB_ATOMIC_CPPFLAGS)
+AC_SUBST(LEVELDB_ATOMIC_CXXFLAGS)
AC_CONFIG_FILES([Makefile src/Makefile share/setup.nsi share/qt/Info.plist src/test/buildenv.py])
AC_CONFIG_FILES([qa/pull-tester/run-bitcoind-for-test.sh],[chmod +x qa/pull-tester/run-bitcoind-for-test.sh])
AC_CONFIG_FILES([qa/pull-tester/tests_config.py],[chmod +x qa/pull-tester/tests_config.py])