1 | #!/bin/sh |
---|
2 | |
---|
3 | NAME="[ogredeps]" |
---|
4 | WORKING_DIR="ogre/cabalistic-ogredeps-7168c50f9d04" |
---|
5 | |
---|
6 | BUILD_DIR=build |
---|
7 | |
---|
8 | source ./build_common.sh |
---|
9 | |
---|
10 | if [ $DO_CLEAN -eq 1 ] |
---|
11 | then |
---|
12 | rm -rf $BUILD_DIR |
---|
13 | check_result $? "cleaning build dir" |
---|
14 | fi |
---|
15 | |
---|
16 | if [ $DO_BUILD -eq 1 ] |
---|
17 | then |
---|
18 | # modify build script: make zlib a SHARED library (instead of a STATIC one) |
---|
19 | CMAKE_FILE="src/zlib/CMakeLists.txt" |
---|
20 | sed -i "s/zlib STATIC /zlib SHARED /g" $CMAKE_FILE |
---|
21 | check_result $? "modifying build script" |
---|
22 | |
---|
23 | # prepare build |
---|
24 | mkdir -p $BUILD_DIR |
---|
25 | check_result $? "creating build dir" |
---|
26 | cd $BUILD_DIR |
---|
27 | |
---|
28 | # run cmake |
---|
29 | cmake .. -G "MSYS Makefiles" -DOGREDEPS_BUILD_SDL2=false |
---|
30 | check_result $? "cmake" |
---|
31 | |
---|
32 | # compile |
---|
33 | make -j8 |
---|
34 | check_result $? "make" |
---|
35 | make -j8 install |
---|
36 | check_result $? "make install" |
---|
37 | |
---|
38 | # copy zlib and cg into target directory |
---|
39 | cp -a "ogredeps/bin/Release/libzlib.dll" ${TARGET_BIN_DIR} |
---|
40 | check_result $? "copying library" |
---|
41 | cp -a "ogredeps/bin/Release/cg.dll" ${TARGET_BIN_DIR} |
---|
42 | check_result $? "copying cg" |
---|
43 | |
---|
44 | # copy zlib headers into target directory |
---|
45 | ZLIB_INC_DIR="${TARGET_INC_DIR}/zlib/include" |
---|
46 | mkdir -p $ZLIB_INC_DIR |
---|
47 | check_result $? "creating include dir" |
---|
48 | cp -a "ogredeps/include/zconf.h" ${ZLIB_INC_DIR} |
---|
49 | check_result $? "copying zconf.h" |
---|
50 | cp -a "ogredeps/include/zlib.h" ${ZLIB_INC_DIR} |
---|
51 | check_result $? "copying zlib.h" |
---|
52 | |
---|
53 | # copy whole dependency folder to TEMP_DIR for future build steps (i.e. ogre) |
---|
54 | cp -aT "ogredeps" "${TEMP_DIR}" |
---|
55 | check_result $? "copying dependencies to TEMP_DIR" |
---|
56 | |
---|
57 | echo "${NAME} Finished building ${NAME}" |
---|
58 | fi |
---|