aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorme0wmix <me0wmix@cryptoanarchy.localnet>2016-01-21 11:18:26 -0700
committerme0wmix <me0wmix@cryptoanarchy.localnet>2016-01-21 11:18:26 -0700
commit28f95eb001a47056287c8adf07c2638746ad8e48 (patch)
tree1ca085f0499b8e43d190b62dc02b15a5f1f0b2c5 /CMakeLists.txt
parentMerge pull request #616 (diff)
downloadmonero-28f95eb001a47056287c8adf07c2638746ad8e48.tar.xz
OpenBSD support for Monero.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 16 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 64b9f3e62..07ccc7197 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -139,12 +139,16 @@ elseif(CMAKE_SYSTEM_NAME MATCHES "DragonFly.*|FreeBSD")
set(FREEBSD TRUE)
endif()
-# TODO: check bsdi, NetBSD, OpenBSD, to see if they need the same FreeBSD changes
+# Check if we're on OpenBSD. Compile with gcc 4.9 from packages.
+# Use "env CC=egcc CXX=eg++ CPP=ecpp make release-static-64" or similar.
+if(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
+ set(OPENBSD TRUE)
+endif()
+
+# TODO: check bsdi, NetBSD, to see if they need the same FreeBSD changes
#
# elseif(CMAKE_SYSTEM_NAME MATCHES "kNetBSD.*|NetBSD.*")
# set(NETBSD TRUE)
-# elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*")
-# set(OPENBSD TRUE)
# elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
# set(BSDI TRUE)
@@ -385,11 +389,18 @@ else()
endif()
endif()
+ if(OPENBSD)
+ # This works around some bugs in the gcc 4.9 package as well as forces Boost to use the multithreaded libs
+ set(CMAKE_AR "ar")
+ set(CMAKE_RANLIB "ranlib")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
+ endif()
+
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${DEBUG_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}")
- if(STATIC AND NOT APPLE AND NOT FREEBSD)
+ if(STATIC AND NOT APPLE AND NOT FREEBSD AND NOT OPENBSD)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++")
endif()
endif()
@@ -421,7 +432,7 @@ endif()
include_directories(SYSTEM ${Boost_INCLUDE_DIRS})
if(MINGW)
set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi)
-elseif(APPLE OR FREEBSD)
+elseif(APPLE OR FREEBSD OR OPENBSD)
set(EXTRA_LIBRARIES "")
elseif(NOT MSVC)
find_library(RT rt)