Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 589 lines (508 sloc) 17.265 kb
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
1 #!/bin/bash
2
3 set -e
4
2e5afad Erik Ogenvik Restructure the directories.
erikogenvik authored
5 export HAMMERDIR=$PWD
6 export WORKDIR=$HAMMERDIR/work
7 export PREFIX=$WORKDIR/local
8 export SOURCE=$WORKDIR/build/worldforge
9 export DEPS_SOURCE=$WORKDIR/build/deps
d3c089f Joshua Roesslein Removed the make -s option. Doesn't help any.
joshthecoder authored
10 export MAKEOPTS="-j3"
355bf65 Erik Ogenvik Include the original PKG_CONFIG_PATH as well.
erikogenvik authored
11 export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
a0d9f19 Joshua Roesslein arch --> uname
joshthecoder authored
12 export BUILDDIR=`uname -m`
1d5bef6 Peter Szücs Add openal.pc file for mac.
sajty authored
13 export SUPPORTDIR=$HAMMERDIR/support
1348da6 Peter Szücs Make prefix fully functional.
sajty authored
14 #needed to find tolua++ program if installed in prefix
15 export PATH="$PATH:$PREFIX/bin"
16 export CPATH="$PREFIX/include:$CPATH"
17 export LDFLAGS="$LDFLAGS -L$PREFIX/lib"
18 export LIBRARY_PATH="$PREFIX/lib:$LIBRARY_PATH"
19 export LD_LIBRARY_PATH="$PREFIX/lib:$LD_LIBRARY_PATH"
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
20
4ffe0b3 Joshua Roesslein Minor fixes.
joshthecoder authored
21 # setup directories
22 mkdir -p $PREFIX
23 mkdir -p $DEPS_SOURCE
dde0cd5 Joshua Roesslein Bump ogre version.
joshthecoder authored
24 mkdir -p $SOURCE
4ffe0b3 Joshua Roesslein Minor fixes.
joshthecoder authored
25
477df2d Joshua Roesslein Added logging build output to files.
joshthecoder authored
26 # Log Directory
2e5afad Erik Ogenvik Restructure the directories.
erikogenvik authored
27 LOGDIR=$WORKDIR/logs
477df2d Joshua Roesslein Added logging build output to files.
joshthecoder authored
28 mkdir -p $LOGDIR
29
30 # Output redirect logs
819925a Joshua Roesslein Added logging for dependency install.
joshthecoder authored
31 AUTOLOG=autogen.log # Autogen output
32 CONFIGLOG=config.log # Configure output
33 MAKELOG=build.log # Make output
34 INSTALLLOG=install.log # Install output
477df2d Joshua Roesslein Added logging build output to files.
joshthecoder authored
35
bdb8ced Joshua Roesslein Added clean command to delete build files.
joshthecoder authored
36 # Dependencies
9b1790d Erik Ogenvik Bumped Ogre and CEGUI versions.
erikogenvik authored
37 CEGUI=CEGUI-0.7.5
38 CEGUI_DOWNLOAD=CEGUI-0.7.5.tar.gz
561660c Erik Ogenvik Bump Ogre version.
erikogenvik authored
39 OGRE=ogre_1_7_3
40 OGRE_DOWNLOAD=ogre_src_v1-7-3.tar.bz2
bdb8ced Joshua Roesslein Added clean command to delete build files.
joshthecoder authored
41
a7f75ad Erik Ogenvik Various fixes for getting it to compile on mingw.
erikogenvik authored
42 CONFIGURE_EXTRA_FLAGS=""
e517660 Erik Ogenvik Upgrade to Ogre 1.7.1 and CEGUI 0.7.1. Note that this haven't been tried
erikogenvik authored
43 CMAKE_EXTRA_FLAGS=""
a7f75ad Erik Ogenvik Various fixes for getting it to compile on mingw.
erikogenvik authored
44
b82dfd0 Peter Szücs Set flags for mac.
sajty authored
45 if [[ $OSTYPE == *darwin* ]] ; then
46 #the default architecture is universal build: i864;x86_64
47 #To save space and time, we will only build x86_64
48 CMAKE_EXTRA_FLAGS="-GXcode -DCMAKE_OSX_ARCHITECTURES=x86_64"
49
50 #on mac libtool is called glibtool.
51 #Automake should set this, but it has messed up the order of variable definitions.
52 export MAKEOPTS="$MAKEOPTS LIBTOOL=glibtool"
53
c1014c1 Peter Szücs Build cegui without plugin interface on mac.
sajty authored
54 export CXXFLAGS="-O2 -g -DTOLUA_EXPORT -DCEGUI_STATIC -DWITHOUT_SCRAP -I$PREFIX/include -I/opt/local/include $CXXFLAGS"
55 export CFLAGS="-O2 -g -DTOLUA_EXPORT -DCEGUI_STATIC -DWITHOUT_SCRAP -I$PREFIX/include -I/opt/local/include $CFLAGS"
b82dfd0 Peter Szücs Set flags for mac.
sajty authored
56 export LDFLAGS="$LDFLAGS -L$PREFIX/lib -L/opt/local/lib"
57
1348da6 Peter Szücs Make prefix fully functional.
sajty authored
58 #without CPATH cegui is not finding freeimage.
59 export CPATH="/opt/local/include:$CPATH"
b82dfd0 Peter Szücs Set flags for mac.
sajty authored
60
61 elif [[ x$MSYSTEM = x"MINGW32" && $1 != "install-deps" ]] ; then
a7f75ad Erik Ogenvik Various fixes for getting it to compile on mingw.
erikogenvik authored
62 export CONFIGURE_EXTRA_FLAGS="--enable-shared --disable-static"
7122ce8 Peter Szücs Link CEGUILuaScriptModule statically.
sajty authored
63 export CXXFLAGS="-O2 -msse2 -mthreads -DBOOST_THREAD_USE_LIB -DCEGUILUA_EXPORTS $CXXFLAGS"
929ef75 Peter Szücs Use same build settings for wf and deps.
sajty authored
64 export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig:/usr/local/lib/pkgconfig:/mingw/lib/pkgconfig:/lib/pkgconfig:$PKG_CONFIG_PATH"
a7f75ad Erik Ogenvik Various fixes for getting it to compile on mingw.
erikogenvik authored
65 fi
66
67
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
68 function buildwf()
69 {
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
70 if [ x"$2" = x"" ]; then
71 PRJNAME="$1"
72 else
73 PRJNAME="$2"
74 fi
75
76 mkdir -p $LOGDIR/$PRJNAME
477df2d Joshua Roesslein Added logging build output to files.
joshthecoder authored
77
2e5afad Erik Ogenvik Restructure the directories.
erikogenvik authored
78 cd $SOURCE/$1
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
79 if [ ! -f "configure" ] ; then
80 echo " Running autogen..."
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
81 NOCONFIGURE=1 ./autogen.sh > $LOGDIR/$PRJNAME/$AUTOLOG
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
82 fi
83
84 mkdir -p $BUILDDIR
85 cd $BUILDDIR
f411aca Joshua Roesslein Added ability to select build target.
joshthecoder authored
86 if [ ! -f "Makefile" ] ; then
355bf65 Erik Ogenvik Include the original PKG_CONFIG_PATH as well.
erikogenvik authored
87 echo " Running configure..."
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
88 ../configure --prefix=$PREFIX $CONFIGURE_EXTRA_FLAGS > $LOGDIR/$PRJNAME/$CONFIGLOG
f411aca Joshua Roesslein Added ability to select build target.
joshthecoder authored
89 fi
477df2d Joshua Roesslein Added logging build output to files.
joshthecoder authored
90
1fa95d8 Joshua Roesslein Added a few echoes in buildwf.
joshthecoder authored
91 echo " Building..."
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
92 make $MAKEOPTS > $LOGDIR/$PRJNAME/$MAKELOG
1fa95d8 Joshua Roesslein Added a few echoes in buildwf.
joshthecoder authored
93 echo " Installing..."
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
94 make install > $LOGDIR/$PRJNAME/$INSTALLLOG
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
95 }
96
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
97 function checkoutwf()
98 {
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
99 if [ x"$2" = x"" ]; then
100 USER="worldforge"
101 else
102 USER="$2"
103 fi
104 if [ x"$3" = x"" ]; then
105 BRANCH="master"
106 else
107 BRANCH="$3"
108 fi
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
109 if [ ! -d $1 ]; then
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
110 git clone git://github.com/$USER/$1.git -b $BRANCH
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
111 else
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
112 cd $1 && git remote set-url origin git://github.com/$USER/$1.git && git fetch && git rebase origin/$BRANCH && cd ..
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
113 fi
114 }
115
87b9c57 Joshua Roesslein Added cyphesis support.
joshthecoder authored
116 function cyphesis_post_install()
117 {
118 cd $PREFIX/bin
119
120 # Rename real cyphesis binary to cyphesis.bin
121 mv cyphesis cyphesis.bin
122
123 # Install our cyphesis.in script as cyphesis
124 cp $HAMMERDIR/cyphesis.in cyphesis
125 chmod +x cyphesis
126 }
127
71810f9 Joshua Roesslein Added help command that will display help text.
joshthecoder authored
128 function show_help()
129 {
130 if [ $1 = "main" ] ; then
131 echo "Script for automating the process of installing dependencies"
87b9c57 Joshua Roesslein Added cyphesis support.
joshthecoder authored
132 echo "and compiling Worldforge in a self contained environment."
71810f9 Joshua Roesslein Added help command that will display help text.
joshthecoder authored
133 echo ""
134 echo "Usage: hammer.sh <command> <arguments>"
135 echo "Commands:"
136 echo " install-deps - install all 3rd party dependencies"
137 echo " checkout - fetch worldforge source (libraries, clients)"
138 echo " build - build the sources and install in environment"
bdb8ced Joshua Roesslein Added clean command to delete build files.
joshthecoder authored
139 echo " clean - delete build directory so a fresh build can be performed"
71810f9 Joshua Roesslein Added help command that will display help text.
joshthecoder authored
140 echo ""
141 echo "For more help, type: hammer.sh help <command>"
142 elif [ $1 = "install-deps" ] ; then
143 echo "Install all 3rd party dependencies into build environment."
144 echo ""
145 echo "Usage: hammer.sh install-deps <dependency to install>"
146 echo "Dependencies Available:"
147 echo " all - install all dependencies listed below"
f3e5a35 Peter Szücs Fix glitch.
sajty authored
148 echo " cegui - a free library providing windowing and widgets for "
149 echo " graphics APIs / engines"
71810f9 Joshua Roesslein Added help command that will display help text.
joshthecoder authored
150 echo " ogre - 3D rendering engine"
07b40e1 Erik Ogenvik Updated help texts.
erikogenvik authored
151 echo "Hint: build ogre first then cegui"
71810f9 Joshua Roesslein Added help command that will display help text.
joshthecoder authored
152 elif [ $1 = "checkout" ] ; then
153 echo "Fetch latest source code for worldforge libraries and clients."
154 echo ""
155 echo "Usage: hammer.sh checkout"
156 elif [ $1 = "build" ] ; then
157 echo "Build the sources and install in environment."
158 echo ""
da7cd4e Joshua Roesslein Added support for passing in make options.
joshthecoder authored
159 echo "Usage: hammer.sh build <target> \"<makeopts>\""
71810f9 Joshua Roesslein Added help command that will display help text.
joshthecoder authored
160 echo "Available targets:"
161 echo " libs - build libraries only"
162 echo " ember - build ember only"
87b9c57 Joshua Roesslein Added cyphesis support.
joshthecoder authored
163 echo " cyphesis - build cyphesis server only"
da7cd4e Joshua Roesslein Added support for passing in make options.
joshthecoder authored
164 echo "makeopts [optional] - options to pass into make"
71810f9 Joshua Roesslein Added help command that will display help text.
joshthecoder authored
165 echo ""
166 echo "Hint: after a checkout use 'all'. To rebuild after changing code"
167 echo "only in Ember, use 'ember'. Will build much quicker!"
bdb8ced Joshua Roesslein Added clean command to delete build files.
joshthecoder authored
168 elif [ $1 = "clean" ] ; then
169 echo "Clean out build files of a project."
170 echo ""
171 echo "Usage: hammer.sh clean <target>"
172 echo "Targets:"
173 echo " cegui, ogre, libs/<name>, clients/<name>, servers/<name>"
71810f9 Joshua Roesslein Added help command that will display help text.
joshthecoder authored
174 else
175 echo "No help page found!"
176 fi
177 }
178
179 # Show main help page if no arguments given
180 if [ $# -eq 0 ] ; then
181 show_help "main"
182
183 # If help command given, show help page
184 elif [ $1 = "help" ] ; then
185 if [ $# -eq 2 ] ; then
186 show_help $2
187 else
188 show_help "main"
189 fi
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
190
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
191 mkdir -p $PREFIX $SOURCE $DEPS_SOURCE
192
193 # Dependencies install
71810f9 Joshua Roesslein Added help command that will display help text.
joshthecoder authored
194 elif [ $1 = "install-deps" ] ; then
d17af5a Peter Szücs Call the script for install-deps with MINGW.
sajty authored
195 if [ x$MSYSTEM = x"MINGW32" ] ; then
196 SCRIPTDIR=`dirname "$0"`
197 $SCRIPTDIR/mingw_install_deps.sh
198 exit 0
199 fi
fb61b3f Joshua Roesslein Updated Ogre. Added parameter checks.
joshthecoder authored
200 if [ $# -ne 2 ] ; then
201 echo "Missing required parameter!"
202 show_help "install-deps"
203 exit 1
204 fi
205
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
206 echo "Installing deps..."
207
819925a Joshua Roesslein Added logging for dependency install.
joshthecoder authored
208 # Create deps log directory
209 mkdir -p $LOGDIR/deps
210
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
211 # Ogre3D
212 if [ $2 = "all" ] || [ $2 = "ogre" ] ; then
213 echo " Installing Ogre..."
819925a Joshua Roesslein Added logging for dependency install.
joshthecoder authored
214 mkdir -p $LOGDIR/deps/ogre
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
215 cd $DEPS_SOURCE
bdb8ced Joshua Roesslein Added clean command to delete build files.
joshthecoder authored
216 if [ ! -d $OGRE ]; then
819925a Joshua Roesslein Added logging for dependency install.
joshthecoder authored
217 echo " Downloading..."
bdb8ced Joshua Roesslein Added clean command to delete build files.
joshthecoder authored
218 wget -c http://downloads.sourceforge.net/sourceforge/ogre/$OGRE_DOWNLOAD
219 mkdir -p $OGRE
220 cd $OGRE
221 tar -xjf ../$OGRE_DOWNLOAD
22832a5 Peter Szücs Add ogre_cocoa_currentGLContext_support.patch.
sajty authored
222 if [[ $OSTYPE == *darwin* ]] ; then
223 cd $DEPS_SOURCE/$OGRE/`ls $DEPS_SOURCE/$OGRE`
224 echo " Patching..."
225 ls .
226 patch -p1 < $SUPPORTDIR/ogre_cocoa_currentGLContext_support.patch
227 fi
1b99135 Joshua Roesslein Fixes for errors during testing.
joshthecoder authored
228 fi
e517660 Erik Ogenvik Upgrade to Ogre 1.7.1 and CEGUI 0.7.1. Note that this haven't been tried
erikogenvik authored
229 cd $DEPS_SOURCE/$OGRE/`ls $DEPS_SOURCE/$OGRE`
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
230 mkdir -p $BUILDDIR
231 cd $BUILDDIR
819925a Joshua Roesslein Added logging for dependency install.
joshthecoder authored
232 echo " Configuring..."
a7f75ad Erik Ogenvik Various fixes for getting it to compile on mingw.
erikogenvik authored
233 OGRE_EXTRA_FLAGS=""
a14a839 Peter Szücs Add logging support for Ogre and freealut on mac.
sajty authored
234 cmake .. -DCMAKE_INSTALL_PREFIX="$PREFIX" -DOGRE_BUILD_SAMPLES=false $OGRE_EXTRA_FLAGS $CMAKE_EXTRA_FLAGS > $LOGDIR/deps/ogre/$CONFIGLOG
5441095 Peter Szücs Use xcodebuild instead of make for Ogre3D on Mac.
sajty authored
235 if [[ $OSTYPE == *darwin* ]] ; then
a14a839 Peter Szücs Add logging support for Ogre and freealut on mac.
sajty authored
236 echo " Building..."
237 xcodebuild -configuration RelWithDebInfo > $LOGDIR/deps/ogre/$MAKELOG
238 echo " Installing..."
239 xcodebuild -configuration RelWithDebInfo -target install > $LOGDIR/deps/ogre/$INSTALLLOG
240 cp -r lib/RelWithDebInfo/* $PREFIX/lib
5441095 Peter Szücs Use xcodebuild instead of make for Ogre3D on Mac.
sajty authored
241 #on mac, we have only Ogre.framework
a14a839 Peter Szücs Add logging support for Ogre and freealut on mac.
sajty authored
242 sed -i "" -e "s/-L\$[{]libdir[}]\ -lOgreMain/-F\${libdir} -framework Ogre/g" $PREFIX/lib/pkgconfig/OGRE.pc
243 echo " Done."
5441095 Peter Szücs Use xcodebuild instead of make for Ogre3D on Mac.
sajty authored
244 else
245 echo " Building..."
246 make $MAKEOPTS > $LOGDIR/deps/ogre/$MAKELOG
247 echo " Installing..."
248 make install > $LOGDIR/deps/ogre/$INSTALLLOG
249 echo " Done."
250 fi
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
251 fi
af5ddac Peter Szücs Add freealut installer.
sajty authored
252
253 # freealut
a4dbc5d Peter Szücs Add freealut and tolua++ to "all" on mac.
sajty authored
254 if [ $2 = "all" ] && [[ $OSTYPE == *darwin* ]] || [ $2 = "freealut" ] ; then
af5ddac Peter Szücs Add freealut installer.
sajty authored
255 echo " Installing freealut..."
a14a839 Peter Szücs Add logging support for Ogre and freealut on mac.
sajty authored
256 mkdir -p $LOGDIR/deps/freealut
af5ddac Peter Szücs Add freealut installer.
sajty authored
257 cd $DEPS_SOURCE
258
259 echo " Downloading..."
260 wget -c http://connect.creativelabs.com/openal/Downloads/ALUT/freealut-1.1.0-src.zip
e45b3e5 Peter Szücs Use unzip for zip.
sajty authored
261 unzip -o freealut-1.1.0-src.zip
af5ddac Peter Szücs Add freealut installer.
sajty authored
262 cd freealut-1.1.0-src
1d5bef6 Peter Szücs Add openal.pc file for mac.
sajty authored
263 if [[ $OSTYPE == *darwin* ]] ; then
264 cp $SUPPORTDIR/openal.pc $PREFIX/lib/pkgconfig/openal.pc
265 fi
af5ddac Peter Szücs Add freealut installer.
sajty authored
266 echo " Running autogen..."
267 autoreconf --install --force --warnings=all
268
269 mkdir -p $BUILDDIR
270 cd $BUILDDIR
1d5bef6 Peter Szücs Add openal.pc file for mac.
sajty authored
271
af5ddac Peter Szücs Add freealut installer.
sajty authored
272 echo " Running configure..."
273 ../configure --prefix=$PREFIX $CONFIGURE_EXTRA_FLAGS \
1d5bef6 Peter Szücs Add openal.pc file for mac.
sajty authored
274 CFLAGS="$CFLAGS `pkg-config --cflags openal`" LDFLAGS="$LDFLAGS `pkg-config --libs openal`" > $LOGDIR/deps/freealut/$CONFIGLOG
af5ddac Peter Szücs Add freealut installer.
sajty authored
275
276 echo " Building..."
a14a839 Peter Szücs Add logging support for Ogre and freealut on mac.
sajty authored
277 make $MAKEOPTS > $LOGDIR/deps/freealut/$MAKELOG
af5ddac Peter Szücs Add freealut installer.
sajty authored
278 echo " Installing..."
a14a839 Peter Szücs Add logging support for Ogre and freealut on mac.
sajty authored
279 make install > $LOGDIR/deps/freealut/$INSTALLLOG
af5ddac Peter Szücs Add freealut installer.
sajty authored
280 fi
deff2f4 Peter Szücs Add tolua++ installer.
sajty authored
281
282 # tolua++
a4dbc5d Peter Szücs Add freealut and tolua++ to "all" on mac.
sajty authored
283 if [ $2 = "all" ] && [[ $OSTYPE == *darwin* ]] || [ $2 = "tolua++" ] ; then
7a695e1 Peter Szücs Add tolua++ build support for linux.
sajty authored
284 #the "all" keyword will only work on mac, but "tolua++" will work on linux and mac, if you set LUA_CFLAGS and LUA_LDFLAGS.
285 #LUA_CFLAGS="`pkg-config --cflags lua5.1`"
286 #LUA_LDFLAGS="`pkg-config --libs lua5.1`"
287 if [ "x$LUA_CFLAGS" == "x" ] ; then
288 LUA_CFLAGS=""
289 fi
290 if [ "x$LUA_LDFLAGS" == "x" ] ; then
291 LUA_LDFLAGS="-llua"
292 fi
a14a839 Peter Szücs Add logging support for Ogre and freealut on mac.
sajty authored
293 cd $DEPS_SOURCE
deff2f4 Peter Szücs Add tolua++ installer.
sajty authored
294 wget -c http://www.codenix.com/~tolua/tolua++-1.0.93.tar.bz2
295 tar -xjf tolua++-1.0.93.tar.bz2
296 cd tolua++-1.0.93
7a695e1 Peter Szücs Add tolua++ build support for linux.
sajty authored
297 mkdir -p $PREFIX/include
deff2f4 Peter Szücs Add tolua++ installer.
sajty authored
298 cp include/tolua++.h $PREFIX/include/tolua++.h
299 cd src/lib
7a695e1 Peter Szücs Add tolua++ build support for linux.
sajty authored
300 gcc $CFLAGS -c -fPIC -I$PREFIX/include *.c $LUA_CFLAGS
301 mkdir -p $PREFIX/lib
302 if [[ $OSTYPE == *darwin* ]] ; then
303 #ar cq libtolua++.a *.o
304 gcc -shared -Wl,-soname,libtolua++.dylib -o libtolua++.dylib *.o
305 cp libtolua++.dylib $PREFIX/lib/libtolua++.dylib
306 else
307 gcc -shared -Wl,-soname,libtolua++.so -o libtolua++.so *.o
308 cp libtolua++.so $PREFIX/lib/libtolua++.so
309 fi
deff2f4 Peter Szücs Add tolua++ installer.
sajty authored
310 cd ../bin
7a695e1 Peter Szücs Add tolua++ build support for linux.
sajty authored
311 gcc $CFLAGS $LDFLAGS -o tolua++ -I$PREFIX/include $LUA_CFLAGS $LUA_LDFLAGS -L$PREFIX/lib tolua.c toluabind.c -ltolua++
312 mkdir -p $PREFIX/bin
deff2f4 Peter Szücs Add tolua++ installer.
sajty authored
313 cp tolua++ $PREFIX/bin/tolua++
314 cd ../../..
315 fi
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
316
e517660 Erik Ogenvik Upgrade to Ogre 1.7.1 and CEGUI 0.7.1. Note that this haven't been tried
erikogenvik authored
317 # CEGUI
318 if [ $2 = "all" ] || [ $2 = "cegui" ] ; then
319 echo " Installing CEGUI..."
320 mkdir -p $LOGDIR/deps/CEGUI # create CEGUI log directory
321 cd $DEPS_SOURCE
322 if [ ! -d $CEGUI ] ; then
323 echo " Downloading..."
324 wget -c http://downloads.sourceforge.net/sourceforge/crayzedsgui/$CEGUI_DOWNLOAD
325 tar zxvf $CEGUI_DOWNLOAD
c1014c1 Peter Szücs Build cegui without plugin interface on mac.
sajty authored
326 if [[ $OSTYPE == *darwin* ]] ; then
327 echo " Patching..."
328 cd $DEPS_SOURCE/$CEGUI
329 sed -i "" -e "s/\"macPlugins.h\"/\"implementations\/mac\/macPlugins.h\"/g" cegui/src/CEGUIDynamicModule.cpp
330 #Do not change indentation for the include line.
331 sed -i "" -e '1i\
332 #include<CoreFoundation\/CoreFoundation.h>' cegui/include/CEGUIDynamicModule.h
333 fi
e517660 Erik Ogenvik Upgrade to Ogre 1.7.1 and CEGUI 0.7.1. Note that this haven't been tried
erikogenvik authored
334 fi
c1014c1 Peter Szücs Build cegui without plugin interface on mac.
sajty authored
335 cd $DEPS_SOURCE/$CEGUI
e517660 Erik Ogenvik Upgrade to Ogre 1.7.1 and CEGUI 0.7.1. Note that this haven't been tried
erikogenvik authored
336 mkdir -p $BUILDDIR
337 cd $BUILDDIR
338 echo " Configuring..."
ba7e15e Peter Szücs Disable python module in cegui.
sajty authored
339 ../configure --prefix=$PREFIX --disable-samples --disable-opengl-renderer --disable-irrlicht-renderer --disable-xerces-c --disable-libxml --disable-expat --disable-directfb-renderer --disable-corona --disable-devil --disable-stb --disable-tga --disable-python-module $CONFIGURE_EXTRA_FLAGS > $LOGDIR/deps/CEGUI/$CONFIGLOG
e517660 Erik Ogenvik Upgrade to Ogre 1.7.1 and CEGUI 0.7.1. Note that this haven't been tried
erikogenvik authored
340 echo " Building..."
341 make $MAKEOPTS > $LOGDIR/deps/CEGUI/$MAKELOG
342 echo " Installing..."
343 make install > $LOGDIR/deps/CEGUI/$INSTALLLOG
c1014c1 Peter Szücs Build cegui without plugin interface on mac.
sajty authored
344 if [[ $OSTYPE == *darwin* ]] ; then
345 #on mac we use -DCEGUI_STATIC, which will disable the plugin interface and we need to link the libraries manually.
346 sed -i "" -e "s/-lCEGUIBase/-lCEGUIBase -lCEGUIFalagardWRBase -lCEGUIFreeImageImageCodec -lCEGUITinyXMLParser/g" $PREFIX/lib/pkgconfig/CEGUI.pc
347 fi
e517660 Erik Ogenvik Upgrade to Ogre 1.7.1 and CEGUI 0.7.1. Note that this haven't been tried
erikogenvik authored
348 echo " Done."
349 fi
350
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
351 echo "Install Done."
352
353 # Source checkout
354 elif [ $1 = "checkout" ] ; then
355 echo "Fetching sources..."
356
1491b0f Peter Szücs Add options for checkout.
sajty authored
357 if [ $2 = "libs" ] || [ $2 = "all" ] ; then
358
2e5afad Erik Ogenvik Restructure the directories.
erikogenvik authored
359 mkdir -p $SOURCE/libs
360 cd $SOURCE/libs
b22888e Joshua Roesslein Bump ogre version to 1.6. Checkout atlas and varconf from Git.
joshthecoder authored
361
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
362 # Varconf
363 echo " Varconf..."
b22888e Joshua Roesslein Bump ogre version to 1.6. Checkout atlas and varconf from Git.
joshthecoder authored
364 checkoutwf "varconf"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
365 echo " Done."
366
b22888e Joshua Roesslein Bump ogre version to 1.6. Checkout atlas and varconf from Git.
joshthecoder authored
367 # Atlas-C++
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
368 echo " Atlas-C++..."
edb7af1 Erik Ogenvik Update with Github urls.
erikogenvik authored
369 checkoutwf "atlas-cpp"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
370 echo " Done."
371
372 # Skstream
373 echo " Skstream..."
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
374 checkoutwf "skstream"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
375 echo " Done."
376
377 # Wfmath
378 echo " Wfmath..."
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
379 checkoutwf "wfmath"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
380 echo " Done."
381
382 # Eris
383 echo " Eris..."
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
384 checkoutwf "eris"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
385 echo " Done."
386
387 # Libwfut
388 echo " Libwfut..."
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
389 checkoutwf "libwfut"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
390 echo " Done."
391
392 # Mercator
393 echo " Mercator..."
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
394 checkoutwf "mercator"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
395 echo " Done."
1491b0f Peter Szücs Add options for checkout.
sajty authored
396 fi
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
397
4544742 Peter Szücs Checkout webember should clone ember too.
sajty authored
398 if [ $2 = "ember" ] || [ $2 = "webember" ] || [ $2 = "all" ] ; then
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
399 # Ember client
400 echo " Ember client..."
2e5afad Erik Ogenvik Restructure the directories.
erikogenvik authored
401 mkdir -p $SOURCE/clients
402 cd $SOURCE/clients
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
403 #get github.com/sajty/ember.git with webember branch
404 checkoutwf "ember" "sajty" "webember"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
405 echo " Done."
1491b0f Peter Szücs Add options for checkout.
sajty authored
406 fi
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
407
1491b0f Peter Szücs Add options for checkout.
sajty authored
408 if [ $2 = "cyphesis" ] || [ $2 = "all" ] ; then
87b9c57 Joshua Roesslein Added cyphesis support.
joshthecoder authored
409 # Cyphesis
410 echo " Cyphesis..."
2e5afad Erik Ogenvik Restructure the directories.
erikogenvik authored
411 mkdir -p $SOURCE/servers
412 cd $SOURCE/servers
87b9c57 Joshua Roesslein Added cyphesis support.
joshthecoder authored
413 checkoutwf "cyphesis"
414 echo " Done."
1491b0f Peter Szücs Add options for checkout.
sajty authored
415 fi
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
416
417 if [ $2 = "webember" ] || [ $2 = "all" ] ; then
1c07f19 Peter Szücs Add Mingw support for webember
sajty authored
418 if [[ x$MSYSTEM != x"MINGW32" ]] ; then
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
419 echo " FireBreath..."
420 mkdir -p $SOURCE/clients/webember
421 cd $SOURCE/clients/webember
422 checkoutwf "FireBreath" "sajty"
423 echo " Done."
424 echo " WebEmber..."
425 checkoutwf "WebEmber" "sajty"
426 echo " Done."
427 fi
1c07f19 Peter Szücs Add Mingw support for webember
sajty authored
428 fi
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
429
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
430 echo "Checkout Done."
431
432 # Build source
433 elif [ $1 = "build" ] ; then
da7cd4e Joshua Roesslein Added support for passing in make options.
joshthecoder authored
434 if [ $# -lt 2 ] ; then
fb61b3f Joshua Roesslein Updated Ogre. Added parameter checks.
joshthecoder authored
435 echo "Missing required parameter!"
436 show_help "build"
da7cd4e Joshua Roesslein Added support for passing in make options.
joshthecoder authored
437 exit 1
438 fi
439
440 # Check for make options
441 if [ $# -ge 3 ] ; then
442 MAKEOPTS=$3
fb61b3f Joshua Roesslein Updated Ogre. Added parameter checks.
joshthecoder authored
443 fi
444
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
445 echo "Building sources..."
f411aca Joshua Roesslein Added ability to select build target.
joshthecoder authored
446
447 # Build libraries
448 if [ $2 = "libs" ] || [ $2 = "all" ] ; then
449
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
450 # Varconf
451 echo " Varconf..."
452 buildwf "libs/varconf"
453 echo " Done."
454
455 # Skstream
456 echo " Skstream..."
457 buildwf "libs/skstream"
458 echo " Done."
459
460 # Wfmath
461 echo " Wfmath..."
462 buildwf "libs/wfmath"
463 echo " Done."
464
465 # Atlas-C++
466 echo " Atlas-C++..."
b77ba8f Erik Ogenvik Fixed building of Atlas, thanks Dean.
erikogenvik authored
467 buildwf "libs/atlas-cpp"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
468 echo " Done."
469
1b99135 Joshua Roesslein Fixes for errors during testing.
joshthecoder authored
470 # Mercator
471 echo " Mercator..."
472 buildwf "libs/mercator"
473 echo " Done."
474
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
475 # Eris
476 echo " Eris..."
477 buildwf "libs/eris"
478 echo " Done."
479
480 # Libwfut
481 echo " Libwfut..."
482 buildwf "libs/libwfut"
483 echo " Done."
484
fde5310 Joshua Roesslein Fix for build all issue where ember and cyphesis where not getting
joshthecoder authored
485 fi
486
487 if [ $2 = "ember" ] || [ $2 = "all" ] ; then
f411aca Joshua Roesslein Added ability to select build target.
joshthecoder authored
488
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
489 # Ember client
490 echo " Ember client..."
b3e1474 Erik Ogenvik Oops, this shouldn't have been commented out.
erikogenvik authored
491 buildwf "clients/ember"
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
492 echo " Done."
493
a7f75ad Erik Ogenvik Various fixes for getting it to compile on mingw.
erikogenvik authored
494 if command -v rsync &> /dev/null; then
495 echo "Fetching media..."
2e5afad Erik Ogenvik Restructure the directories.
erikogenvik authored
496 cd $SOURCE/clients/ember/$BUILDDIR
a7f75ad Erik Ogenvik Various fixes for getting it to compile on mingw.
erikogenvik authored
497 make devmedia
498 echo "Media fetched."
499 else
2e5afad Erik Ogenvik Restructure the directories.
erikogenvik authored
500 echo "Rsync not found, skipping fetching media. You will need to download and install it yourself."
a7f75ad Erik Ogenvik Various fixes for getting it to compile on mingw.
erikogenvik authored
501 fi
2806726 Joshua Roesslein Applying patch from Erik.
joshthecoder authored
502
fde5310 Joshua Roesslein Fix for build all issue where ember and cyphesis where not getting
joshthecoder authored
503 fi
504
505 if [ $2 = "cyphesis" ] || [ $2 = "all" ] ; then
87b9c57 Joshua Roesslein Added cyphesis support.
joshthecoder authored
506
507 # Cyphesis
508 echo " Cyphesis..."
509 buildwf "servers/cyphesis"
510 cyphesis_post_install
511 echo " Done."
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
512 fi
513
514
515 if [ $2 = "webember" ] || [ $2 = "all" ] ; then
516
517 echo " WebEmber..."
1c07f19 Peter Szücs Add Mingw support for webember
sajty authored
518 CONFIGURE_EXTRA_FLAGS="$CONFIGURE_EXTRA_FLAGS --enable-webember"
c1014c1 Peter Szücs Build cegui without plugin interface on mac.
sajty authored
519 #we need to change the BUILDDIR to separate the ember and webember build directories.
1c07f19 Peter Szücs Add Mingw support for webember
sajty authored
520 #the strange thing is that if BUILDDIR is 6+ character on win32, the build will fail with missing headers.
521 export BUILDDIR="build"
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
522 buildwf "clients/ember" "webember"
523 echo " Done."
524
525 if command -v rsync &> /dev/null; then
526 echo "Fetching media..."
527 cd $SOURCE/clients/ember/$BUILDDIR
528 make devmedia > $LOGDIR/webember/media.log
529 echo "Media fetched."
530 else
531 echo "Rsync not found, skipping fetching media. You will need to download and install it yourself."
532 fi
87b9c57 Joshua Roesslein Added cyphesis support.
joshthecoder authored
533
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
534 # WebEmber
535 echo " WebEmber plugin..."
1c07f19 Peter Szücs Add Mingw support for webember
sajty authored
536 if [[ x$MSYSTEM = x"MINGW32" ]] ; then
5aaac10 Peter Szücs Use xcodebuild for webember on Mac.
sajty authored
537 # Firebreath is not supporting mingw32 yet, we will use msvc prebuilt for webember.
1c07f19 Peter Szücs Add Mingw support for webember
sajty authored
538 mkdir -p $SOURCE/clients/ember/$BUILDDIR
539 cd $SOURCE/clients/ember/$BUILDDIR
a1a0b2c Peter Szücs Change URL.
sajty authored
540 wget -c http://sajty.elementfx.com/npWebEmber.tar.gz
541 tar -xzf npWebEmber.tar.gz
1c07f19 Peter Szücs Add Mingw support for webember
sajty authored
542 cp npWebEmber.dll $PREFIX/bin/npWebEmber.dll
543 regsvr32 -s $PREFIX/bin/npWebEmber.dll
544 #To uninstall: regsvr32 -u $PREFIX/bin/npWebEmber.dll
545 else
546 mkdir -p $LOGDIR/webember_plugin
547 mkdir -p $SOURCE/clients/webember/FireBreath/$BUILDDIR
548 cd $SOURCE/clients/webember/FireBreath/$BUILDDIR
5aaac10 Peter Szücs Use xcodebuild for webember on Mac.
sajty authored
549
1348da6 Peter Szücs Make prefix fully functional.
sajty authored
550 cmake -DCMAKE_INSTALL_PREFIX=$PREFIX -DFB_PROJECTS_DIR=$SOURCE/clients/webember/WebEmber/plugin $CMAKE_EXTRA_FLAGS .. > $LOGDIR/webember_plugin/cmake.log
5aaac10 Peter Szücs Use xcodebuild for webember on Mac.
sajty authored
551 if [[ $OSTYPE == *darwin* ]] ; then
552 echo " Building..."
553 xcodebuild -configuration RelWithDebInfo > $LOGDIR/webember_plugin/$MAKELOG
554 echo " Installing..."
555 cp -r projects/WebEmber/RelWithDebInfo/webember.plugin $PREFIX/lib
556 else
557 echo " Building..."
558 make $MAKEOPTS > $LOGDIR/webember_plugin/build.log
559 echo " Installing..."
560 mkdir -p ~/.mozilla/plugins
561 cp bin/WebEmber/npWebEmber.so ~/.mozilla/plugins/npWebEmber.so
562 fi
563 fi
e76feb2 Peter Szücs Add WebEmber build support.
sajty authored
564 echo " Done."
87b9c57 Joshua Roesslein Added cyphesis support.
joshthecoder authored
565 fi
566
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
567 echo "Build Done."
568
bdb8ced Joshua Roesslein Added clean command to delete build files.
joshthecoder authored
569 elif [ $1 = "clean" ] ; then
570 if [ $# -ne 2 ] ; then
571 echo "Missing required parameter!"
572 show_help "clean"
573 exit 1
574 fi
817c9a5 Joshua Roesslein Initial commit!
joshthecoder authored
575
bdb8ced Joshua Roesslein Added clean command to delete build files.
joshthecoder authored
576 # Delete build directory
577 if [ $2 = "cegui" ] ; then
578 rm -rf $DEPS_SOURCE/$CEGUI/$BUILDDIR
579 elif [ $2 = "ogre" ] ; then
580 rm -rf $DEPS_SOURCE/$OGRE/ogre/$BUILDDIR
581 else
2e5afad Erik Ogenvik Restructure the directories.
erikogenvik authored
582 rm -rf $SOURCE/$2/$BUILDDIR
bdb8ced Joshua Roesslein Added clean command to delete build files.
joshthecoder authored
583 fi
584
585 else
586 echo "Invalid command!"
587 show_help "main"
588 fi
Something went wrong with that request. Please try again.