Skip to content

Commit a4d8a65

Browse files
committed
Merge pull request #237 from anthonygego/openbsd
Added support for OpenBSD
2 parents 96e16bb + 6cd9cef commit a4d8a65

File tree

3 files changed

+49
-2
lines changed

3 files changed

+49
-2
lines changed

README.OpenBSD.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# OpenBSD-specific notes
2+
3+
These information apply to OpenBSD. Feel free to contribute and add instructions for other BSD distribution if general information found in the [main Readme](README.md) do not directly apply.
4+
5+
## Global configuration
6+
7+
* Download and install the following tools from the OpenBSD packages directory :
8+
9+
$ export PKG_PATH=http://ftp.openbsd.org/pub/OpenBSD/$(uname -r)/packages/$(uname -m)/
10+
$ pkg_add -i jre jdk cmake git subversion boost gcc g++ emacs tcl tk
11+
12+
Make sure, when choice is offered, to install the latest version available of these tools, as required in the [main Readme](README.md). _Please note that default gcc version included in OpenBSD is too old for Mozart to compile._
13+
* The directory layout suggested in [main Readme](README.md) will be assumed here.
14+
15+
## Compilation of Gtest
16+
1. Download Gtest in your `<projects>/externals/gtest` directory as suggested in the [main Readme](README.md).
17+
1. In your terminal, launch Gtest compilation by typing :
18+
19+
$ cd <projects>/builds/gtest-debug
20+
$ cmake -DCMAKE_C_COMPILER="egcc" -DCMAKE_CXX_COMPILER="eg++" -DCMAKE_BUILD_TYPE=Debug ../../externals/gtest
21+
$ make
22+
23+
Note that the recent gcc you have installed is identified by `egcc` on OpenBSD and no confusion must be made to avoid compilation errors.
24+
25+
## Compilation of LLVM
26+
1. Download LLVM in your `<projects>/externals/llvm` directory as suggested in the [main Readme](README.md).
27+
1. In your terminal, launch LLVM compilation by typing :
28+
29+
$ cd <projects>/builds/llvm-release
30+
$ cmake -DCMAKE_C_COMPILER="egcc" -DCMAKE_CXX_COMPILER="eg++" -DCMAKE_BUILD_TYPE=Release -DLLVM_TARGETS_TO_BUILD="X86" ../../externals/llvm
31+
$ make
32+
33+
Please note that compilation may fail due to resource limitation. Use `ulimit` to temporarily change these values.
34+
35+
## Compilation of Mozart 2
36+
1. Download Mozart in your `<projects>/mozart2` directory as suggested in the [main Readme](README.md).
37+
1. In your terminal, launch Mozart compilation by typing :
38+
39+
$ cd <projects>/builds/mozart2-release
40+
$ cmake -DCMAKE_C_COMPILER="egcc" -DCMAKE_CXX_COMPILER="eg++" -DCMAKE_BUILD_TYPE=Release -DGTEST_SRC_DIR=../../externals/gtest -DGTEST_BUILD_DIR=../gtest-debug -DLLVM_SRC_DIR=../../externals/llvm -DLLVM_BUILD_DIR=../llvm-release -DCMAKE_CXX_FLAGS="-I/usr/local/include -I/usr/local/include/c++/4.8.2 -I/usr/local/include/c++/4.8.2/x86_64-unknown-openbsd5.5 -I/usr/X11R6/include -pthread -O3" -DCMAKE_INSTALL_PREFIX=../../redist ../../mozart2
41+
$ make
42+
43+
__Replace `4.8.2` and `x86_64-unknown-openbsd5.5` by the folders corresponding to your gcc installation.__ You may need to add parameter `-DCMAKE_CXX_LINK_FLAGS="-latomic"` on some versions if linking fails with undefined references.
44+
45+
1. To copy all the binaries in the `redist` folder, type :
46+
47+
$ make install

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ system.
2323
# Build instructions
2424

2525
This main Readme is shamefully biased towards Linux. Side-along Readmes are
26-
available [for Mac OS](README.MacOS.md) and [for Windows](README.Windows.md).
26+
available for [Mac OS](README.MacOS.md), [Windows](README.Windows.md), and [OpenBSD](README.OpenBSD.md).
2727

2828
## Requirements
2929

boosthost/emulator/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ endif()
5959
# Here it starts to differ wildly on Windows
6060
if(NOT WIN32)
6161
target_link_libraries(ozemulator pthread)
62-
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
62+
if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin|OpenBSD")
6363
target_link_libraries(ozemulator rt)
6464
endif()
6565

0 commit comments

Comments
 (0)