Skip to content

Commit

Permalink
build: add missing leveldb defines
Browse files Browse the repository at this point in the history
Summary:
```
src/leveldb/build_detect_platform shows how upstream defines them.

These platform may not be able to fully build or run Bitcoin, but
defining all known to leveldb saves future hassle.

Now that all possible platforms are enumerated, specifying an unknown
one is an error.
```

Backport of core PR13659
https://github.com/bitcoin/bitcoin/pull/13659/files

Test Plan:
  make
  ninja

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D3817
  • Loading branch information
theuni authored and Fabcien committed Aug 8, 2019
1 parent 0c4d36b commit 4412d8a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
20 changes: 17 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -536,10 +536,17 @@ case $host in
CPPFLAGS="$CPPFLAGS -DMAC_OSX"
OBJCXXFLAGS="$CXXFLAGS"
;;
*android*)
dnl make sure android stays above linux for hosts like *linux-android*
LEVELDB_TARGET_FLAGS="-DOS_ANDROID"
;;
*linux*)
TARGET_OS=linux
LEVELDB_TARGET_FLAGS="-DOS_LINUX"
;;
*kfreebsd*)
LEVELDB_TARGET_FLAGS="-DOS_KFREEBSD"
;;
*freebsd*)
LEVELDB_TARGET_FLAGS="-DOS_FREEBSD"
;;
Expand All @@ -549,10 +556,17 @@ case $host in
*netbsd*)
LEVELDB_TARGET_FLAGS="-DOS_NETBSD"
;;
*dragonfly*)
LEVELDB_TARGET_FLAGS="-DOS_DRAGONFLYBSD"
;;
*solaris*)
LEVELDB_TARGET_FLAGS="-DOS_SOLARIS"
;;
*hpux*)
LEVELDB_TARGET_FLAGS="-DOS_HPUX"
;;
*)
OTHER_OS=`echo ${host_os} | awk '{print toupper($0)}'`
AC_MSG_WARN([Guessing LevelDB OS as OS_${OTHER_OS}, please check whether this is correct, if not add an entry to configure.ac.])
LEVELDB_TARGET_FLAGS="-DOS_${OTHER_OS}"
AC_MSG_ERROR(Cannot build leveldb for $host. Please file a bug report.)
;;
esac

Expand Down
5 changes: 3 additions & 2 deletions src/leveldb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ else()
set(LEVELDB_OS SOLARIS)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(LEVELDB_OS FREEBSD)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "KFreeBSD")
set(LEVELDB_OS KFREEBSD)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
set(LEVELDB_OS NETBSD)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
Expand All @@ -116,8 +118,7 @@ else()
# No idea what's the proper system name is here.
set(LEVELDB_OS IOS)
else()
# Unknown plateform, assume linux.
set(LEVELDB_OS LINUX)
message(FATAL_ERROR "Cannot build leveldb for ${CMAKE_SYSTEM_NAME}. Please file a bug report.")
endif()
endif()

Expand Down

0 comments on commit 4412d8a

Please sign in to comment.