Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/windows/precompiled_dependencies/mingw64/build_ogre.sh @ 131

Last change on this file since 131 was 131, checked in by landauf, 8 years ago

added dependencies for gcc 4.9 and improved build-scripts slightly

  • Property svn:eol-style set to native
File size: 2.6 KB
Line 
1#!/bin/sh
2
3NAME="[ogre]"
4WORKING_DIR="ogre/ogre_src_v1-8-1"
5#WORKING_DIR="ogre/ogre-1-9-0-sinbad-ogre-dd30349ea667"
6
7BUILD_DIR=build
8
9source ./build_common.sh
10
11if [ $DO_CLEAN -eq 1 ]
12then
13        rm -rf $BUILD_DIR
14        check_result $? "cleaning build dir"
15fi
16
17if [ $DO_BUILD -eq 1 ]
18then
19        # modify sources to make it work with mingw64
20        sed -i "s/ -march=i686//" "CMakeLists.txt"
21        check_result $? "remove compiler flag -march=i686"
22        sed -i "s/DxErr/dxerr9/" "CMake/Packages/FindDirectX.cmake"
23        check_result $? "renaming DxErr library in FindDirectX.cmake"
24        sed -i "s/#define __uuidof(Object) IID_##Object//" "OgreMain/include/WIN32/OgreMinGWSupport.h"
25        check_result $? "removing re-definition of __uuidof from OgreMinGWSupport.h"
26        sed -i "s/intptr_t __security_cookie;//" "OgreMain/src/WIN32/OgreMinGWSupport.cpp"
27        check_result $? "removing re-definition of __security_cookie from OgreMinGWSupport.cpp"
28        sed -i "s/(intptr_t/(uintptr_t/g" "OgreMain/src/WIN32/OgreMinGWSupport.cpp"
29        check_result $? "replacing intptr_t with uintptr_t in OgreMinGWSupport.cpp"
30        sed -i "s/(intptr_t/(uintptr_t/g" "RenderSystems/Direct3D9/src/OgreD3D9Plugin.cpp"
31        check_result $? "replacing intptr_t with uintptr_t in OgreD3D9Plugin.cpp"
32        sed -i "s/#include <DxErr.h>/#include <dxerr9.h>\n#define DXGetErrorDescription DXGetErrorDescription9/" "RenderSystems/Direct3D9/include/OgreD3D9Prerequisites.h"
33        check_result $? "replacing include and add define in OgreD3D9Prerequisites.h"
34
35        # prepare build directory
36        mkdir -p $BUILD_DIR
37        check_result $? "creating build dir"
38        cd $BUILD_DIR
39
40        # run cmake
41        cmake -DCMAKE_BUILD_TYPE=Release \
42                  -DOGRE_DEPENDENCIES_DIR=${TEMP_DIR}/ogredeps \
43                  -DBOOST_LIBRARYDIR=${TARGET_BIN_DIR} \
44                  -DBOOST_INCLUDEDIR=${TARGET_INC_DIR}/boost \
45                  -DOGRE_BUILD_RENDERSYSTEM_D3D11=OFF \
46                  -DOGRE_BUILD_SAMPLES=OFF \
47                  -DOGRE_BUILD_TOOLS=OFF \
48                  .. -G "MSYS Makefiles"
49
50        check_result $? "cmake"
51
52        # compile
53        make -j8 install
54        check_result $? "make install"
55
56        # copy libraries into target directory
57        find "sdk/bin/release" -name "Ogre*.dll" -exec cp -a {} ${TARGET_BIN_DIR} \;
58        check_result $? "copying Ogre-libraries"
59        find "sdk/bin/release" -name "Plugin_*.dll" -exec cp -a {} ${TARGET_BIN_DIR} \;
60        check_result $? "copying Plugin-libraries"
61        find "sdk/bin/release" -name "RenderSystem_*.dll" -exec cp -a {} ${TARGET_BIN_DIR} \;
62        check_result $? "copying RenderSystem_-libraries"
63
64        # copy includes
65        mkdir -p ${TARGET_INC_DIR}/ogre
66        check_result $? "creating include dir"
67        cp -aT "sdk/include/OGRE" ${TARGET_INC_DIR}/ogre/include
68        check_result $? "copying includes"
69
70        echo "${NAME} Finished building ${NAME}"
71fi
Note: See TracBrowser for help on using the repository browser.