1 | #!/bin/sh |
---|
2 | |
---|
3 | NAME="[cegui-0-7]" |
---|
4 | WORKING_DIR="cegui/CEGUI-0.7.9" |
---|
5 | |
---|
6 | source ./build_common.sh |
---|
7 | |
---|
8 | if [ $DO_CLEAN -eq 1 ] |
---|
9 | then |
---|
10 | rm -rf "dependencies" |
---|
11 | check_result $? "remove dependencies" |
---|
12 | cd projects/premake |
---|
13 | make clean |
---|
14 | # the above command may fail if Makefiles were already removed |
---|
15 | find "." -name "Makefile" -exec rm -rf {} \; |
---|
16 | check_result $? "remove Makefiles" |
---|
17 | find "." -name "*.o" -exec rm -rf {} \; |
---|
18 | check_result $? "remove build output" |
---|
19 | find "." -name "*.d" -exec rm -rf {} \; |
---|
20 | check_result $? "remove build output" |
---|
21 | fi |
---|
22 | |
---|
23 | if [ $DO_BUILD -eq 1 ] |
---|
24 | then |
---|
25 | # copy cegui dependencies |
---|
26 | cp -aT "${TEMP_DIR}/ceguideps" "dependencies" |
---|
27 | check_result $? "copy ceguideps dependencies" |
---|
28 | |
---|
29 | # merge ogre dependencies into cegui dependencies |
---|
30 | cp -aT "${TEMP_DIR}/ogredeps/include" "dependencies/include" |
---|
31 | check_result $? "copy includes" |
---|
32 | cp -aT "${TEMP_DIR}/ogredeps/bin/Release" "dependencies/lib" |
---|
33 | check_result $? "copy bins" |
---|
34 | cp -aT "${TEMP_DIR}/ogredeps/lib/Release" "dependencies/lib" |
---|
35 | check_result $? "copy libs" |
---|
36 | |
---|
37 | # create subdirectory to fix an include path in premake script |
---|
38 | mkdir -p "cegui/include/ScriptingModules/LuaScriptModule/support/tolua++bin" |
---|
39 | |
---|
40 | cd projects/premake |
---|
41 | |
---|
42 | # prepare config.lua |
---|
43 | CONFIG_FILE="config.lua" |
---|
44 | rm -rf $CONFIG_FILE |
---|
45 | check_result $? "removing old config-file" |
---|
46 | echo "CEGUI_EXTRA_PATHS = { |
---|
47 | { \"${HOME_DIR}/${WORKING_DIR}/dependencies\", \"include\", \"lib\" }, |
---|
48 | { \"${TARGET_BIN_DIR}\", \"\", \"\" }, |
---|
49 | { \"${TARGET_INC_DIR}\", \"lua/include\", \"\" }, |
---|
50 | { \"${TARGET_INC_DIR}\", \"ogre/include\", \"\", \"CEGUIOgreRenderer\" }, |
---|
51 | { \"${TARGET_INC_DIR}\", \"boost\", \"\", \"CEGUIOgreRenderer\" }, |
---|
52 | } |
---|
53 | CEGUI_LUA_VER = 51 |
---|
54 | CEGUI_USE_FREETYPE = true |
---|
55 | CEGUI_USE_PCRE_REGEX = true |
---|
56 | CEGUI_USE_DEFAULT_LOGGER = true |
---|
57 | OGRE_RENDERER = true |
---|
58 | FALAGARD_WR = true |
---|
59 | DEFAULT_WINDOW_RENDERER = \"falagard\" |
---|
60 | XERCES_PARSER = true |
---|
61 | DEFAULT_XML_PARSER = \"xerces\" |
---|
62 | LUA_SCRIPT_MODULE = true |
---|
63 | " > $CONFIG_FILE |
---|
64 | check_result $? "create new config-file" |
---|
65 | |
---|
66 | # change library names in several premake scripts |
---|
67 | sed -i "s/\"lua\"/\"lua51\"/" "ScriptingModules/LuaScriptModule/premake.lua" |
---|
68 | check_result $? "change lua library name" |
---|
69 | sed -i "s/\"lua\"/\"lua51\"/" "ScriptingModules/LuaScriptModule/support/tolua++/premake.lua" |
---|
70 | check_result $? "change lua library name" |
---|
71 | sed -i "s/\"lua\"/\"lua51\"/" "ScriptingModules/LuaScriptModule/support/tolua++bin/premake.lua" |
---|
72 | check_result $? "change lua library name" |
---|
73 | sed -i "s/\"xerces-c_3\"/\"xerces-c\"/" "XMLParserModules/XercesParser/premake.lua" |
---|
74 | check_result $? "change xerces library name" |
---|
75 | sed -i "s/library(\"OgreMain\", \"_d\")/library(\"OgreMain\"); library(\"libboost_system-mgw48-mt-1_60\")/" "RendererModules/Ogre/premake.lua" |
---|
76 | check_result $? "add boost system library" |
---|
77 | |
---|
78 | # run premake |
---|
79 | ./premake --file cegui.lua --target gnu |
---|
80 | check_result $? "premake" |
---|
81 | |
---|
82 | # compile |
---|
83 | CC=gcc \ |
---|
84 | make all -j8 CONFIG=Release |
---|
85 | check_result $? "make" |
---|
86 | |
---|
87 | # copy libraries |
---|
88 | find "../../bin" -name "*.dll" -exec cp -a {} ${TARGET_BIN_DIR} \; |
---|
89 | check_result $? "copy libraries" |
---|
90 | |
---|
91 | # copy includes |
---|
92 | mkdir -p ${TARGET_INC_DIR}/cegui |
---|
93 | check_result $? "creating include dir" |
---|
94 | cp -aT "../../cegui/include" ${TARGET_INC_DIR}/cegui/include |
---|
95 | check_result $? "copying includes" |
---|
96 | |
---|
97 | echo "${NAME} Finished building ${NAME}" |
---|
98 | fi |
---|