Ticket #32: scons_1.patch
| File scons_1.patch, 27.6 KB (added by Carsten, 22 months ago) |
|---|
-
CompilerSetup.py.tmpl
1 # -*- coding: utf-8 -*- 2 from SCons.Script import * 3 1 4 # Edit the settings and paths in this file as required for your system. 2 5 3 # The default compiler to be used for each platform.4 # Note that this can easily be overridden at the command-line5 # by the "cmp" parameter. Example: scons -Q cmp=vc86 defaultCompilerWin32="vc9"; # Valid values are "vc8" and "vc9".7 defaultCompilerLinux="g++"; # Currently, only "g++" is a valid value.8 6 7 # envCommon is the common base environment for constructing all Cafu programs. 8 # The base environment defines the target platform and architecture and the 9 # compiler and other tools for the built. It is normally initialized without 10 # any parameters, which means that the installed compiler and other details 11 # are automatically detected. 12 # 13 # MSVC_VERSION sets the version of Visual C/C++ to use. 14 # Set it to an unexpected value (e.g. "XXX") to see the valid values for 15 # your system, such as "8.0", "8.0Exp", "9.0", "9.0Exp", "10.0", "10.0Exp". 16 # If not set, SCons will select the latest version of Visual C/C++ installed 17 # on your system. 18 # 19 # TARGET_ARCH sets the target architecture for the Visual C/C++ compiler. 20 # It it currently unused under Linux, where the host architecture determines 21 # the target architecture. Valid values are: 22 # "x86" or "i386" for 32 bit builds, 23 # "x86_64" or "amd64" for 64 bit builds, 24 # "ia64" for Itanium builds. 25 # 26 # Examples: 27 # # Print all valid values for MSVC_VERSION on your system. 28 # envCommon=Environment(MSVC_VERSION="XXX"); 29 # 30 # # Use Visual C/C++ version 9 (2008), Express Edition. 31 # envCommon=Environment(MSVC_VERSION="9.0Exp"); 32 # 33 # # Use the latest Visual C/C++ version for creating 32 bit binaries. 34 # envCommon=Environment(TARGET_ARCH="x86"); 35 # 36 # # Use Visual C/C++ version 9 (2008) for creating 32 bit binaries. 37 # envCommon=Environment(MSVC_VERSION="9.0", TARGET_ARCH="x86"); 38 # 39 # See the SCons man page at 40 # <http://www.scons.org/doc/2.0.0.final.0/HTML/scons-man.html> for full 41 # details about possible parameters to Environment(). 42 envCommon=Environment(); 9 43 44 10 45 # This string describes all program variants that should be built: 11 46 # Insert a "d" for having all code being built in the debug variant. 12 47 # Insert a "p" for having all code being built in the profile variant. -
SConscript
154 154 # Note that we only (want to) determine the right library path matching the used compiler here. 155 155 # The specific wx-version used (e.g. latest stable vs. trunk) is still determined locally (here), 156 156 # BUT if this is moved into the SConstruct file, also the wx-version (wxPath above) must be fixed there. 157 LibPath="/lib/"+compiler+"_lib" 157 LibPath="/lib/"+compiler 158 if wxEnv["TARGET_ARCH"]: LibPath += "_"+wxEnv["TARGET_ARCH"]; 159 LibPath += "_lib" 158 160 159 161 wxEnv.Append(CPPPATH=['ExtLibs/freetype/include']) # Linux builds (must) use the systems freetype library instead. 160 162 wxEnv.Append(LIBPATH = [wxPath+LibPath]) -
SConstruct
1 import os, sys 2 import CompilerSetup 1 import os, shutil, sys 3 2 4 3 5 4 # See the SCons manual, http://www.scons.org/wiki/GoFastButton and the man page for more information about the next two lines. … … 10 9 print "" 11 10 12 11 13 # Set the default compiler (platform dependent). 14 if sys.platform=="win32": 15 compiler=ARGUMENTS.get("cmp", CompilerSetup.defaultCompilerWin32) 16 elif sys.platform=="linux2": 17 compiler=ARGUMENTS.get("cmp", CompilerSetup.defaultCompilerLinux) 18 else: 19 print "Unknown platform '" + sys.platform + "'." 20 exit 12 try: 13 import CompilerSetup 14 except ImportError: 15 # In order to make getting started with the Cafu source code more convenient, install the 16 # CompilerSetup.py file from the related template file (which is under version control) automatically. 17 shutil.copy("CompilerSetup.py.tmpl", "CompilerSetup.py") 18 import CompilerSetup 21 19 22 # Set the list of variants (debug, profile, release) that should be built. 23 BVs=ARGUMENTS.get("bv", CompilerSetup.buildVariants) 20 # Import the (user-configured) base environment from the setup file. 21 # The base environment is evaluated and further refined (e.g. with compiler-specific settings) below. 22 envCommon=CompilerSetup.envCommon; 24 23 25 24 26 # Set the build directories.27 my_build_dir="build/"+sys.platform+"/"+compiler28 my_build_dir_dbg=my_build_dir+"/debug"29 my_build_dir_rel=my_build_dir+"/release"30 my_build_dir_prf=my_build_dir+"/profile"31 32 CommonLibPaths=["#/ExtLibs/bullet/",33 "#/ExtLibs/freealut/",34 "#/ExtLibs/jpeg/",35 "#/ExtLibs/libogg/",36 "#/ExtLibs/libpng/",37 "#/ExtLibs/libvorbis/",38 "#/ExtLibs/lwo/",39 "#/ExtLibs/lua/",40 "#/ExtLibs/mpg123/",41 "#/ExtLibs/noise/",42 "#/ExtLibs/openal-soft/",43 "#/ExtLibs/zlib/",44 "#/Libs/"];45 46 if sys.platform=="win32":47 # Only for Windows, as under Linux we must link to the systems freetype library.48 CommonLibPaths.append("#/ExtLibs/freetype/");49 50 CommonLibPaths_dbg=[x+my_build_dir_dbg for x in CommonLibPaths];51 CommonLibPaths_rel=[x+my_build_dir_rel for x in CommonLibPaths];52 CommonLibPaths_prf=[x+my_build_dir_prf for x in CommonLibPaths];53 54 55 25 # This big if-else tree has a branch for each supported platform and each supported compiler. 56 26 # For the chosen combination of platform and compiler, it prepares the environments envDebug, envRelease and envProfile. 57 27 if sys.platform=="win32": 58 if compiler=="vc8":59 ############################## ##################60 ### Win32, Visual C++ 2005 (Express Edition)###61 ############################## ##################28 if envCommon["MSVC_VERSION"] in ["8.0", "8.0Exp"]: 29 ############################## 30 ### Win32, Visual C++ 2005 ### 31 ############################## 62 32 33 compiler="vc8" 34 63 35 # Reference of commonly used compiler switches: 64 # /EHsc Enable exception handling. 65 # /GR Enable RTTI. 66 # /J Treat char as unsigned char. 67 # /MT Use multi-threaded run-time libraries (statically linked into the exe). Defines _MT. 68 # /MTd Use multi-threaded debug run-time libraries (statically linked into the exe). Defines _DEBUG and _MT. 69 # /nologo No version and name banner. 70 # /Od Disable optimizations. 71 # /O2 Fastest possible code. 72 # /Ob2 Inline expansion at compilers discretion. 73 # /RTC1 Run-Time Error Checks: Catch release-build errors in debug build. 74 # /W3 Warning level. 75 # /WX Treat warnings as errors. 76 # /Z7 Include full debug info. 36 # /EHsc Enable exception handling. 37 # /GR Enable RTTI. 38 # /J Treat char as unsigned char. 39 # /MT Use multi-threaded run-time libraries (statically linked into the exe). Defines _MT. 40 # /MTd Use multi-threaded debug run-time libraries (statically linked into the exe). Defines _DEBUG and _MT. 41 # /Od Disable optimizations. 42 # /O2 Fastest possible code. 43 # /Ob2 Inline expansion at compilers discretion. 44 # /RTC1 Run-Time Error Checks: Catch release-build errors in debug build. 45 # /W3 Warning level. 46 # /WX Treat warnings as errors. 47 # /Z7 Include full debug info. 77 48 78 49 # Begin with an environment with settings that are common for debug, release and profile builds. 79 envCommon=Environment( 80 CCFLAGS = Split("/nologo /GR /EHsc"), # CCFLAGS is also taken as the default value for CXXFLAGS. 81 CPPDEFINES = ["_CRT_SECURE_NO_DEPRECATE", "_CRT_NONSTDC_NO_DEPRECATE"], 82 LINKFLAGS = Split("/nologo /incremental:no")) 50 envCommon.Append(CCFLAGS = Split("/GR /EHsc")) # CCFLAGS is also taken as the default value for CXXFLAGS. 51 envCommon.Append(CPPDEFINES = ["_CRT_SECURE_NO_DEPRECATE", "_CRT_NONSTDC_NO_DEPRECATE"]) 52 envCommon.Append(LINKFLAGS = Split("/incremental:no")) 83 53 84 54 # Explicitly instruct SCons to detect and use the Microsoft Platform SDK, as it is not among the default tools. 85 55 # See thread "Scons 2010/01/17 doesn't look for MS SDK?" at <http://scons.tigris.org/ds/viewMessage.do?dsForumId=1272&dsMessageId=2455554> … … 100 70 envProfile.Append(CCFLAGS=Split("/MT /O2 /Ob2 /Z7")); 101 71 envProfile.Append(LINKFLAGS=["/fixed:no", "/debug"]); 102 72 103 elif compiler=="vc9":104 ############################## ##################105 ### Win32, Visual C++ 2008 (Express Edition)###106 ############################## ##################73 elif envCommon["MSVC_VERSION"] in ["9.0", "9.0Exp"]: 74 ############################## 75 ### Win32, Visual C++ 2008 ### 76 ############################## 107 77 78 compiler="vc9" 79 108 80 # Reference of commonly used compiler switches: 109 81 # Identical to the compiler switches for Visual C++ 2005, see there for more details. 110 82 111 83 # Begin with an environment with settings that are common for debug, release and profile builds. 112 envCommon=Environment( 113 CCFLAGS = Split("/nologo /GR /EHsc"), # CCFLAGS is also taken as the default value for CXXFLAGS. 114 CPPDEFINES = ["_CRT_SECURE_NO_DEPRECATE", "_CRT_NONSTDC_NO_DEPRECATE"], 115 LINKFLAGS = Split("/nologo /incremental:no")) 84 envCommon.Append(CCFLAGS = Split("/GR /EHsc")) # CCFLAGS is also taken as the default value for CXXFLAGS. 85 envCommon.Append(CPPDEFINES = ["_CRT_SECURE_NO_DEPRECATE", "_CRT_NONSTDC_NO_DEPRECATE"]) 86 envCommon.Append(LINKFLAGS = Split("/incremental:no")) 116 87 117 88 # Explicitly instruct SCons to detect and use the Microsoft Platform SDK, as it is not among the default tools. 118 89 # See thread "Scons 2010/01/17 doesn't look for MS SDK?" at <http://scons.tigris.org/ds/viewMessage.do?dsForumId=1272&dsMessageId=2455554> … … 133 104 envProfile.Append(CCFLAGS=Split("/MT /O2 /Ob2 /Z7")); 134 105 envProfile.Append(LINKFLAGS=["/fixed:no", "/debug"]); 135 106 136 elif compiler=="ow":137 ######################### 138 ### Win32, OpenWatcom###139 ######################### 107 elif envCommon["MSVC_VERSION"] in ["10.0", "10.0Exp"]: 108 ############################## 109 ### Win32, Visual C++ 2010 ### 110 ############################## 140 111 112 compiler="vc10" 113 141 114 # Reference of commonly used compiler switches: 142 # -5r Pentium register based calling. 143 # -bt=nt Compile for NT. 144 # -d2 Full debug info (required for wdw and wprof). 145 # -e25 Stop compilation after 25 errors. 146 # -od No optimizations. 147 # -otexan Fastest possible code. 148 # -w8 Enable all warnings. 149 # -we Treat warnings as errors. 150 # -zp8 8-byte structure alignment. 151 # -zq Quiet operation. 152 # -xr Enable Run-time type information. According to docs, comes with no execution (speed) penalty at all, except for the use of dynamic_cast. 153 # -xs Enable exceptions. 115 # Identical to the compiler switches for Visual C++ 2005, see there for more details. 154 116 155 117 # Begin with an environment with settings that are common for debug, release and profile builds. 156 envCommon=Environment( 157 CXX = "wpp386", 158 CCFLAGS = Split("-e25 -zq -5r -bt=nt -xr -xs"), # CCFLAGS is also taken as the default value for CXXFLAGS. 159 LINK = "wlink", 160 LINKFLAGS = ["option quiet"]) 118 envCommon.Append(CCFLAGS = Split("/GR /EHsc")) # CCFLAGS is also taken as the default value for CXXFLAGS. 119 envCommon.Append(CPPDEFINES = ["_CRT_SECURE_NO_DEPRECATE", "_CRT_NONSTDC_NO_DEPRECATE"]) 120 envCommon.Append(LINKFLAGS = Split("/incremental:no")) 161 121 162 # Compiler system environment paths. 163 watcom_base="D:\\Programme\\OpenWatcom\\OW13RC3" 122 # Explicitly instruct SCons to detect and use the Microsoft Platform SDK, as it is not among the default tools. 123 # See thread "Scons 2010/01/17 doesn't look for MS SDK?" at <http://scons.tigris.org/ds/viewMessage.do?dsForumId=1272&dsMessageId=2455554> 124 # for further information. 125 envCommon.Tool('mssdk') 164 126 165 envCommon['ENV']['PATH' ]="%s\\binnt;%s\\binw" % (watcom_base, watcom_base)166 envCommon['ENV']['INCLUDE']="%s\\h;%s\\h\\nt" % (watcom_base, watcom_base)167 envCommon['ENV']['LIB' ]="%s\\lib386;%s\\lib386\\nt" % (watcom_base, watcom_base)168 169 170 127 # Environment for debug builds: 171 128 envDebug=envCommon.Clone(); 172 envDebug.Append(CCFLAGS=Split(" -d2 -od"));173 envDebug.Append(LINKFLAGS=[" debug all"]);129 envDebug.Append(CCFLAGS=Split("/MTd /Od /Z7 /RTC1")); 130 envDebug.Append(LINKFLAGS=["/debug"]); 174 131 175 132 # Environment for release builds: 176 133 envRelease=envCommon.Clone(); 177 envRelease.Append(CCFLAGS=Split(" -zp8 -otexan"));134 envRelease.Append(CCFLAGS=Split("/MT /O2 /Ob2")); 178 135 179 136 # Environment for profile builds: 180 137 envProfile=envCommon.Clone(); 181 envProfile.Append(CCFLAGS=Split(" -zp8 -otexan -d2"));182 envProfile.Append(LINKFLAGS=[" debug all"]);138 envProfile.Append(CCFLAGS=Split("/MT /O2 /Ob2 /Z7")); 139 envProfile.Append(LINKFLAGS=["/fixed:no", "/debug"]); 183 140 184 141 else: 185 142 ############################### 186 143 ### Win32, unknown compiler ### 187 144 ############################### 188 145 189 print "Unknown compiler " + compiler + "on platform " + sys.platform + "."146 print "Unknown compiler on platform " + sys.platform + "." 190 147 exit 191 148 192 149 elif sys.platform=="linux2": 193 if compiler=="g++":150 if envCommon["CXX"]=="g++": 194 151 ################## 195 152 ### Linux, g++ ### 196 153 ################## 197 154 155 compiler="g++" 156 198 157 # Begin with an environment with settings that are common for debug, release and profile builds. 199 envCommon=Environment( 200 CCFLAGS = Split("")) # CCFLAGS is also taken as the default value for CXXFLAGS. 158 envCommon.Append(CCFLAGS = Split("")) # CCFLAGS is also taken as the default value for CXXFLAGS. 201 159 202 160 # Environment for debug builds: 203 161 envDebug=envCommon.Clone(); … … 217 175 ### Linux, unknown compiler ### 218 176 ############################### 219 177 220 print "Unknown compiler " + compiler+ " on platform " + sys.platform + "."178 print "Unknown compiler " + envCommon["CXX"] + " on platform " + sys.platform + "." 221 179 exit 222 180 223 181 else: … … 233 191 ### Build all external libraries ### 234 192 #################################### 235 193 236 if "d" in BVs: SConscript('ExtLibs/bullet/src/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/bullet/"+my_build_dir_dbg, duplicate=0) 237 if "r" in BVs: SConscript('ExtLibs/bullet/src/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/bullet/"+my_build_dir_rel, duplicate=0) 238 if "p" in BVs: SConscript('ExtLibs/bullet/src/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/bullet/"+my_build_dir_prf, duplicate=0) 194 # Set the list of variants (debug, profile, release) that should be built. 195 BVs=ARGUMENTS.get("bv", CompilerSetup.buildVariants) 239 196 240 if "d" in BVs: SConscript('ExtLibs/freealut/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/freealut/"+my_build_dir_dbg, duplicate=0) 241 if "r" in BVs: SConscript('ExtLibs/freealut/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/freealut/"+my_build_dir_rel, duplicate=0) 242 if "p" in BVs: SConscript('ExtLibs/freealut/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/freealut/"+my_build_dir_prf, duplicate=0)197 # Set the build directories. 198 my_build_dir="build/"+sys.platform+"/"+compiler 199 if envCommon["TARGET_ARCH"]: my_build_dir += "/"+envCommon["TARGET_ARCH"]; 243 200 244 if "d" in BVs: SConscript('ExtLibs/freetype/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/freetype/"+my_build_dir_dbg, duplicate=0) 245 if "r" in BVs: SConscript('ExtLibs/freetype/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/freetype/"+my_build_dir_rel, duplicate=0) 246 if "p" in BVs: SConscript('ExtLibs/freetype/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/freetype/"+my_build_dir_prf, duplicate=0) 201 my_build_dir_dbg=my_build_dir+"/debug" 202 my_build_dir_rel=my_build_dir+"/release" 203 my_build_dir_prf=my_build_dir+"/profile" 247 204 248 if "d" in BVs: SConscript('ExtLibs/jpeg/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/jpeg/"+my_build_dir_dbg, duplicate=0)249 if "r" in BVs: SConscript('ExtLibs/jpeg/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/jpeg/"+my_build_dir_rel, duplicate=0)250 if "p" in BVs: SConscript('ExtLibs/jpeg/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/jpeg/"+my_build_dir_prf, duplicate=0)251 205 252 if "d" in BVs: SConscript('ExtLibs/libogg/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/libogg/"+my_build_dir_dbg, duplicate=0) 253 if "r" in BVs: SConscript('ExtLibs/libogg/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/libogg/"+my_build_dir_rel, duplicate=0) 254 if "p" in BVs: SConscript('ExtLibs/libogg/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/libogg/"+my_build_dir_prf, duplicate=0) 206 for lib_name in ["bullet", "freealut", "freetype", "jpeg", "libogg", "libpng", "libvorbis", "lwo", "lua", "mpg123", "noise", "openal-soft", "zlib"]: 207 s_name=lib_name 255 208 256 if "d" in BVs: SConscript('ExtLibs/libpng/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/libpng/"+my_build_dir_dbg, duplicate=0) 257 if "r" in BVs: SConscript('ExtLibs/libpng/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/libpng/"+my_build_dir_rel, duplicate=0) 258 if "p" in BVs: SConscript('ExtLibs/libpng/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/libpng/"+my_build_dir_prf, duplicate=0) 209 if lib_name=="openal-soft" and sys.platform=="win32": continue; # OpenAL-Soft is not built on Windows, use the OpenAL Windows SDK there. 210 if lib_name=="bullet": s_name+="/src"; 211 if lib_name=="lua": s_name+="/src"; 212 if lib_name=="mpg123": s_name+="/src/libmpg123"; 259 213 260 if "d" in BVs: SConscript('ExtLibs/libvorbis/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/libvorbis/"+my_build_dir_dbg, duplicate=0)261 if "r" in BVs: SConscript('ExtLibs/libvorbis/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/libvorbis/"+my_build_dir_rel, duplicate=0)262 if "p" in BVs: SConscript('ExtLibs/libvorbis/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/libvorbis/"+my_build_dir_prf, duplicate=0)214 if "d" in BVs: SConscript("ExtLibs/"+s_name+"/SConscript", exports={ "env": envDebug }, variant_dir="ExtLibs/"+lib_name+"/"+my_build_dir_dbg, duplicate=0) 215 if "r" in BVs: SConscript("ExtLibs/"+s_name+"/SConscript", exports={ "env": envRelease }, variant_dir="ExtLibs/"+lib_name+"/"+my_build_dir_rel, duplicate=0) 216 if "p" in BVs: SConscript("ExtLibs/"+s_name+"/SConscript", exports={ "env": envProfile }, variant_dir="ExtLibs/"+lib_name+"/"+my_build_dir_prf, duplicate=0) 263 217 264 if "d" in BVs: SConscript('ExtLibs/lwo/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/lwo/"+my_build_dir_dbg, duplicate=0)265 if "r" in BVs: SConscript('ExtLibs/lwo/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/lwo/"+my_build_dir_rel, duplicate=0)266 if "p" in BVs: SConscript('ExtLibs/lwo/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/lwo/"+my_build_dir_prf, duplicate=0)267 218 268 if "d" in BVs: SConscript('ExtLibs/lua/src/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/lua/"+my_build_dir_dbg, duplicate=0)269 if "r" in BVs: SConscript('ExtLibs/lua/src/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/lua/"+my_build_dir_rel, duplicate=0)270 if "p" in BVs: SConscript('ExtLibs/lua/src/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/lua/"+my_build_dir_prf, duplicate=0)271 272 if "d" in BVs: SConscript('ExtLibs/mpg123/src/libmpg123/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/mpg123/"+my_build_dir_dbg, duplicate=0)273 if "r" in BVs: SConscript('ExtLibs/mpg123/src/libmpg123/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/mpg123/"+my_build_dir_rel, duplicate=0)274 if "p" in BVs: SConscript('ExtLibs/mpg123/src/libmpg123/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/mpg123/"+my_build_dir_prf, duplicate=0)275 276 if "d" in BVs: SConscript('ExtLibs/noise/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/noise/"+my_build_dir_dbg, duplicate=0)277 if "r" in BVs: SConscript('ExtLibs/noise/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/noise/"+my_build_dir_rel, duplicate=0)278 if "p" in BVs: SConscript('ExtLibs/noise/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/noise/"+my_build_dir_prf, duplicate=0)279 280 if sys.platform!="win32":281 # OpenAL-Soft is not built on Windows, use the OpenAL Windows SDK there.282 if "d" in BVs: SConscript('ExtLibs/openal-soft/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/openal-soft/"+my_build_dir_dbg, duplicate=0)283 if "r" in BVs: SConscript('ExtLibs/openal-soft/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/openal-soft/"+my_build_dir_rel, duplicate=0)284 if "p" in BVs: SConscript('ExtLibs/openal-soft/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/openal-soft/"+my_build_dir_prf, duplicate=0)285 286 if "d" in BVs: SConscript('ExtLibs/zlib/SConscript', exports={'env':envDebug}, variant_dir="ExtLibs/zlib/"+my_build_dir_dbg, duplicate=0)287 if "r" in BVs: SConscript('ExtLibs/zlib/SConscript', exports={'env':envRelease}, variant_dir="ExtLibs/zlib/"+my_build_dir_rel, duplicate=0)288 if "p" in BVs: SConscript('ExtLibs/zlib/SConscript', exports={'env':envProfile}, variant_dir="ExtLibs/zlib/"+my_build_dir_prf, duplicate=0)289 290 219 # Compile wxWidgets for the current platform. 291 220 if sys.platform=="win32": 292 # Make sure the "compiler" string begins with "vc" and is three characters long. 293 if compiler[0]=='v' and compiler[1]=='c' and len(compiler)==3: 294 result=envDebug. Execute("nmake /nologo /f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 RUNTIME_LIBS=static COMPILER_PREFIX="+compiler, chdir="ExtLibs/wxWidgets/build/msw"); 221 if compiler.startswith("vc"): 222 c_prefix="COMPILER_PREFIX="+compiler 223 if envCommon["TARGET_ARCH"]: c_prefix += "_"+envCommon["TARGET_ARCH"]; 224 225 if envCommon["TARGET_ARCH"] in ["x86_64", "amd64", "emt64"]: target_cpu=" TARGET_CPU=AMD64" 226 elif envCommon["TARGET_ARCH"] in ["ia64"]: target_cpu=" TARGET_CPU=IA64" 227 else: target_cpu="" 228 229 result=envDebug. Execute("nmake /nologo /f makefile.vc BUILD=debug SHARED=0 USE_OPENGL=1 RUNTIME_LIBS=static "+c_prefix+target_cpu, chdir="ExtLibs/wxWidgets/build/msw"); 295 230 if (result!=0): envDebug. Exit(result); 296 result=envRelease.Execute("nmake /nologo /f makefile.vc BUILD=release SHARED=0 USE_OPENGL=1 RUNTIME_LIBS=static COMPILER_PREFIX="+compiler, chdir="ExtLibs/wxWidgets/build/msw");231 result=envRelease.Execute("nmake /nologo /f makefile.vc BUILD=release SHARED=0 USE_OPENGL=1 RUNTIME_LIBS=static "+c_prefix+target_cpu, chdir="ExtLibs/wxWidgets/build/msw"); 297 232 if (result!=0): envRelease.Exit(result); 298 233 print ""; # Print just another empty line for better visual separation. 299 234 … … 335 270 envRelease.Install(".", ["#/ExtLibs/Cg/bin/cg.dll", "#/ExtLibs/Cg/bin/cgGL.dll"]); 336 271 envRelease.Install(".", ["#/ExtLibs/fmod/api/fmod.dll"]); 337 272 envRelease.Install(".", ["#/ExtLibs/openal-win/OpenAL32.dll", "#/ExtLibs/openal-win/wrap_oal.dll"]); 273 338 274 if "r" in BVs: 339 275 envRelease.Install(".", ["#/ExtLibs/freealut/"+my_build_dir_rel+"/alut.dll"]); 340 276 envRelease.Install(".", ["#/ExtLibs/mpg123/"+my_build_dir_rel+"/mpg123.dll"]); 277 341 278 else: 342 279 envRelease.Install(".", ["#/ExtLibs/freealut/"+my_build_dir_dbg+"/alut.dll"]); 343 280 envRelease.Install(".", ["#/ExtLibs/mpg123/"+my_build_dir_dbg+"/mpg123.dll"]); … … 345 282 elif sys.platform=="linux2": 346 283 envRelease.Install(".", ["#/ExtLibs/Cg/lib/libCg.so", "#/ExtLibs/Cg/lib/libCgGL.so"]); 347 284 envRelease.Install(".", ["#/ExtLibs/fmod/api/libfmod-3.75.so"]); 285 348 286 if "r" in BVs: 349 287 envRelease.Install(".", ["#/ExtLibs/freealut/"+my_build_dir_rel+"/libalut.so"]); 350 288 envRelease.Install(".", ["#/ExtLibs/mpg123/"+my_build_dir_rel+"/libmpg123.so"]); 351 289 envRelease.Install(".", ["#/ExtLibs/openal-soft/"+my_build_dir_rel+"/libopenal.so"]); 290 352 291 else: 353 292 envRelease.Install(".", ["#/ExtLibs/freealut/"+my_build_dir_dbg+"/libalut.so"]); 354 293 envRelease.Install(".", ["#/ExtLibs/mpg123/"+my_build_dir_dbg+"/libmpg123.so"]); … … 359 298 ### Update the construction environments ### 360 299 ############################################ 361 300 301 CommonLibPaths=["#/ExtLibs/bullet/", 302 "#/ExtLibs/freealut/", 303 "#/ExtLibs/jpeg/", 304 "#/ExtLibs/libogg/", 305 "#/ExtLibs/libpng/", 306 "#/ExtLibs/libvorbis/", 307 "#/ExtLibs/lwo/", 308 "#/ExtLibs/lua/", 309 "#/ExtLibs/mpg123/", 310 "#/ExtLibs/noise/", 311 "#/ExtLibs/openal-soft/", 312 "#/ExtLibs/zlib/", 313 "#/Libs/"]; 314 315 if sys.platform=="win32": 316 # Only for Windows, as under Linux we must link to the systems freetype library. 317 CommonLibPaths.append("#/ExtLibs/freetype/"); 318 319 CommonLibPaths_dbg=[x+my_build_dir_dbg for x in CommonLibPaths]; 320 CommonLibPaths_rel=[x+my_build_dir_rel for x in CommonLibPaths]; 321 CommonLibPaths_prf=[x+my_build_dir_prf for x in CommonLibPaths]; 322 323 362 324 # Note that modifying the original environments here affects the build of the external libraries above! 363 325 envDebug_Cafu =envDebug.Clone(); 364 326 envRelease_Cafu=envRelease.Clone(); … … 380 342 envDebug_Cafu .Append(CCFLAGS=Split("/J /W3 /WX")); 381 343 envRelease_Cafu.Append(CCFLAGS=Split("/J /W3 /WX")); 382 344 envProfile_Cafu.Append(CCFLAGS=Split("/J /W3 /WX")); 345 383 346 elif compiler=="vc9": 384 347 envDebug_Cafu .Append(CCFLAGS=Split("/J /W3 /WX")); 385 348 envRelease_Cafu.Append(CCFLAGS=Split("/J /W3 /WX")); 386 349 envProfile_Cafu.Append(CCFLAGS=Split("/J /W3 /WX")); 387 elif compiler=="ow": 388 envDebug_Cafu .Append(CCFLAGS=Split("-w8 -we")); 389 envRelease_Cafu.Append(CCFLAGS=Split("-w8 -we")); 390 envProfile_Cafu.Append(CCFLAGS=Split("-w8 -we")); 350 351 elif compiler=="vc10": 352 envDebug_Cafu .Append(CCFLAGS=Split("/J /W3 /WX")); 353 envRelease_Cafu.Append(CCFLAGS=Split("/J /W3 /WX")); 354 envProfile_Cafu.Append(CCFLAGS=Split("/J /W3 /WX")); 355 391 356 elif compiler=="g++": 392 357 envDebug_Cafu .Append(CCFLAGS=Split("-funsigned-char -Wall -Werror -Wno-char-subscripts")); 393 358 envRelease_Cafu.Append(CCFLAGS=Split("-funsigned-char -Wall -Werror -Wno-char-subscripts -fno-strict-aliasing"));
