[126] | 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" |
---|
[131] | 21 | sed -i "s/library(\"OgreMain\"); library(\".*\")/library(\"OgreMain\", \"_d\")/" "RendererModules/Ogre/premake.lua" |
---|
| 22 | check_result $? "remove boost system library" |
---|
[126] | 23 | fi |
---|
| 24 | |
---|
| 25 | if [ $DO_BUILD -eq 1 ] |
---|
| 26 | then |
---|
| 27 | # copy cegui dependencies |
---|
| 28 | cp -aT "${TEMP_DIR}/ceguideps" "dependencies" |
---|
| 29 | check_result $? "copy ceguideps dependencies" |
---|
| 30 | |
---|
| 31 | # merge ogre dependencies into cegui dependencies |
---|
| 32 | cp -aT "${TEMP_DIR}/ogredeps/include" "dependencies/include" |
---|
| 33 | check_result $? "copy includes" |
---|
| 34 | cp -aT "${TEMP_DIR}/ogredeps/bin/Release" "dependencies/lib" |
---|
| 35 | check_result $? "copy bins" |
---|
| 36 | cp -aT "${TEMP_DIR}/ogredeps/lib/Release" "dependencies/lib" |
---|
| 37 | check_result $? "copy libs" |
---|
[127] | 38 | |
---|
| 39 | # create subdirectory to fix an include path in premake script |
---|
| 40 | mkdir -p "cegui/include/ScriptingModules/LuaScriptModule/support/tolua++bin" |
---|
[126] | 41 | |
---|
| 42 | cd projects/premake |
---|
| 43 | |
---|
| 44 | # prepare config.lua |
---|
| 45 | CONFIG_FILE="config.lua" |
---|
| 46 | rm -rf $CONFIG_FILE |
---|
| 47 | check_result $? "removing old config-file" |
---|
| 48 | echo "CEGUI_EXTRA_PATHS = { |
---|
| 49 | { \"${HOME_DIR}/${WORKING_DIR}/dependencies\", \"include\", \"lib\" }, |
---|
| 50 | { \"${TARGET_BIN_DIR}\", \"\", \"\" }, |
---|
| 51 | { \"${TARGET_INC_DIR}\", \"lua/include\", \"\" }, |
---|
| 52 | { \"${TARGET_INC_DIR}\", \"ogre/include\", \"\", \"CEGUIOgreRenderer\" }, |
---|
| 53 | { \"${TARGET_INC_DIR}\", \"boost\", \"\", \"CEGUIOgreRenderer\" }, |
---|
| 54 | } |
---|
| 55 | CEGUI_LUA_VER = 51 |
---|
| 56 | CEGUI_USE_FREETYPE = true |
---|
| 57 | CEGUI_USE_PCRE_REGEX = true |
---|
| 58 | CEGUI_USE_DEFAULT_LOGGER = true |
---|
| 59 | OGRE_RENDERER = true |
---|
| 60 | FALAGARD_WR = true |
---|
| 61 | DEFAULT_WINDOW_RENDERER = \"falagard\" |
---|
| 62 | XERCES_PARSER = true |
---|
| 63 | DEFAULT_XML_PARSER = \"xerces\" |
---|
| 64 | LUA_SCRIPT_MODULE = true |
---|
| 65 | " > $CONFIG_FILE |
---|
| 66 | check_result $? "create new config-file" |
---|
| 67 | |
---|
[131] | 68 | BOOST_SYSTEM_LIBRARY=$(find $TARGET_BIN_DIR -name "libboost_system*.dll") |
---|
| 69 | BOOST_SYSTEM_LIBRARY_NAME=$(basename $BOOST_SYSTEM_LIBRARY) |
---|
| 70 | BOOST_SYSTEM_LIBRARY_NAME=$(echo $BOOST_SYSTEM_LIBRARY_NAME | sed "s/.dll//") |
---|
| 71 | |
---|
[126] | 72 | # change library names in several premake scripts |
---|
| 73 | sed -i "s/\"lua\"/\"lua51\"/" "ScriptingModules/LuaScriptModule/premake.lua" |
---|
| 74 | check_result $? "change lua library name" |
---|
| 75 | sed -i "s/\"lua\"/\"lua51\"/" "ScriptingModules/LuaScriptModule/support/tolua++/premake.lua" |
---|
| 76 | check_result $? "change lua library name" |
---|
| 77 | sed -i "s/\"lua\"/\"lua51\"/" "ScriptingModules/LuaScriptModule/support/tolua++bin/premake.lua" |
---|
| 78 | check_result $? "change lua library name" |
---|
| 79 | sed -i "s/\"xerces-c_3\"/\"xerces-c\"/" "XMLParserModules/XercesParser/premake.lua" |
---|
| 80 | check_result $? "change xerces library name" |
---|
[131] | 81 | sed -i "s/library(\"OgreMain\", \"_d\")/library(\"OgreMain\"); library(\"${BOOST_SYSTEM_LIBRARY_NAME}\")/" "RendererModules/Ogre/premake.lua" |
---|
[126] | 82 | check_result $? "add boost system library" |
---|
| 83 | |
---|
| 84 | # run premake |
---|
| 85 | ./premake --file cegui.lua --target gnu |
---|
| 86 | check_result $? "premake" |
---|
| 87 | |
---|
| 88 | # compile |
---|
| 89 | CC=gcc \ |
---|
| 90 | make all -j8 CONFIG=Release |
---|
| 91 | check_result $? "make" |
---|
| 92 | |
---|
| 93 | # copy libraries |
---|
| 94 | find "../../bin" -name "*.dll" -exec cp -a {} ${TARGET_BIN_DIR} \; |
---|
| 95 | check_result $? "copy libraries" |
---|
| 96 | |
---|
| 97 | # copy includes |
---|
| 98 | mkdir -p ${TARGET_INC_DIR}/cegui |
---|
| 99 | check_result $? "creating include dir" |
---|
| 100 | cp -aT "../../cegui/include" ${TARGET_INC_DIR}/cegui/include |
---|
| 101 | check_result $? "copying includes" |
---|
| 102 | |
---|
| 103 | echo "${NAME} Finished building ${NAME}" |
---|
| 104 | fi |
---|