forked from jMonkeyEngine/jmonkeyengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbullet-native-build.txt
More file actions
176 lines (138 loc) · 6.21 KB
/
bullet-native-build.txt
File metadata and controls
176 lines (138 loc) · 6.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
***********************************
* Build info for bulletjme *
* (c) 2011 Normen Hansen *
***********************************
This document outlines the process of building bullet-jme on different platforms.
Since bulletjme is a native java library and bullet gets included statically,
building requires downloading and building the bullet sources.
Note that you do need to have CMake and a GCC compiler installed as well as
the Android NDK in case you want to build for android too.
-----------------------------------
Requirements
-----------------------------------
ALL PLATFORMS
- Java SDK 1.5+: http://java.sun.com
- Apache ANT: http://ant.apache.org (included in most Java IDEs)
- Android NDK (optional): http://developer.android.com/sdk/ndk/index.html
WINDOWS
- Install mingw GNU C++ Compiler: http://www.mingw.org/
- Install CMake: http://www.cmake.org/
Mac OSX
- Install XCode: http://developer.apple.com/ (or via the App Store)
- Install the "Command Line Tools" from inside XCode
- Install http://www.macports.org
- Install cmake via macports, in the Terminal type:
> sudo port install cmake
LINUX
- Install cmake (and gcc if not available) via your package manager of choice, e.g.
> sudo apt-get install cmake
-----------------------------------
Building
-----------------------------------
The build script in this directory does everything needed to download and compile
bullet and the jme-bullet library, you only need to call the appropriate ant target,
via your IDE or command line:
> ant build-bullet-natives
..and all of the steps below are executed automatically, including the download.
You can alter options in the "nbproject/bullet.properties" file, such as the used
bullet version, native compilation options (see below), path to Android NDK etc.
-----------------------------------
Running
-----------------------------------
The resulting jMonkeyEngine3.jar containing the tests will automatically use the
jME3-jbullet.jar or jME3-bullet.jar, depending on which is available in the libs directory.
A convenience target exists to run the engine tests using the native bullet library:
> ant run-bullet-native
-----------------------------------
Altering the native build process
-----------------------------------
bullet-jme uses cpptasks to compile native code as well as the Android NDK.
If you get compilation errors, try setting "native.java.include" in the build.properties file to your
JDK include directory, e.g. /opt/java/include or "c:\Program Files\Java\jdk1.6.0_20\include".
To change the used compiler, edit the "native.platform.compiler" entry in the
"build.properties" file. The following c++ compilers work with cpptasks:
gcc GCC C++ compiler
g++ GCC C++ compiler
c++ GCC C++ compiler
msvc Microsoft Visual C++
bcc Borland C++ Compiler
icl Intel C++ compiler for Windows (IA-32)
ecl Intel C++ compiler for Windows (IA-64)
icc Intel C++ compiler for Linux (IA-32)
ecc Intel C++ compiler for Linux (IA-64)
CC Sun ONE C++ compiler
aCC HP aC++ C++ Compiler
wcl OpenWatcom C/C++ compiler
In the "nbproject" folder you can find "build-native-platform.xml" files containing the commands
to compile bullet-jme on different platforms. If you want to alter the process,
you can copy and modify one of the files and import it in the "build.xml" file instead
of the old one.
-----------------------------------
Netbeans Project
-----------------------------------
The engine NetBeans project also includes the native sources and a build configuration
entry to build the binary and run the tests with it.
To have correct syntax highlighting in .cpp/.h files:
- in Netbeans Settings -> C/C++ -> Code Assistance -> C++
- add bullet-2.79/src as include directories for C++
- add JAVA_HOME/include as include directories for C
***********************************
* Building bullet (optional) *
***********************************
-----------------------------------
General info
-----------------------------------
Note that the compilation of bullet should not produce dll / so / dylib files
but static *.a libraries which can later be compiled into the binary of bullet-jme.
-----------------------------------
Downloading and extracting bullet
-----------------------------------
Requirements:
- Bullet source: http://bullet.googlecode.com/
Extract bullet source and build bullet (see below)
-----------------------------------
Building on Mac OSX
-----------------------------------
Requirements:
- Apple Developer tools: http://developer.apple.com/
- CMake: http://www.cmake.org/ (or via http://www.macports.org)
Commands:
> cd bullet-trunk
> cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON \
-DCMAKE_OSX_ARCHITECTURES='ppc;i386;x86_64' \
-DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
> make
-----------------------------------
Building on WINDOWS (MinGW/GCC, Recommended)
-----------------------------------
Requirements:
- GNU C++ Compiler: http://www.mingw.org/
http://mingw-w64.sourceforge.net/
- CMake: http://www.cmake.org/
Commands:
> cd bullet-trunk
> cmake . -DBUILD_SHARED_LIBS=OFF -DBUILD_DEMOS:BOOL=OFF -DBUILD_EXTRAS:BOOL=OFF -DCMAKE_BUILD_TYPE=Release . -G "MinGW Makefiles"
> mingw32-make
-----------------------------------
Building on WINDOWS (VisualStudio, untested)
-----------------------------------
Requirements:
- Microsoft Visual Studio http://msdn.microsoft.com/
Bullet comes with autogenerated Project Files for Microsoft Visual Studio 6, 7, 7.1 and 8.
The main Workspace/Solution is located in Bullet/msvc/8/wksbullet.sln (replace 8 with your version).
Build the project to create static libraries.
-----------------------------------
Building bullet on LINUX
-----------------------------------
Requirements:
- Gnu C++ Compiler: http://gcc.gnu.org/
- CMake: http://www.cmake.org/ (or via your package manager of choice)
Commands:
> cd bullet-trunk
> cmake -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DCMAKE_C_FLAGS="-fPIC" -DCMAKE_CXX_FLAGS="-fPIC"\
-DBUILD_EXTRAS=off -DBUILD_DEMOS=off -DCMAKE_BUILD_TYPE=Release
> make
-----------------------------------
More info on building bullet
-----------------------------------
http://www.bulletphysics.org/mediawiki-1.5.8/index.php?title=Installation