From fc4f6a7bad0030c49d61b3c71aa4ffe0e5b9fa38 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 15 Jun 2013 21:20:06 +0000 Subject: Set up OurSpawn for MinGW compile environment on Windows. --- build_files/scons/tools/btools.py | 52 ++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 28 deletions(-) (limited to 'build_files') diff --git a/build_files/scons/tools/btools.py b/build_files/scons/tools/btools.py index d28521a8d07..f98e9a28c44 100644 --- a/build_files/scons/tools/btools.py +++ b/build_files/scons/tools/btools.py @@ -8,7 +8,6 @@ try: except ImportError: pass import string -import glob import shutil import sys @@ -58,7 +57,7 @@ def get_version(): def get_revision(): build_rev = os.popen('svnversion').read()[:-1] # remove \n - if build_rev == '' or build_rev==None: + if build_rev == '' or build_rev==None: build_rev = 'UNKNOWN' return 'r' + build_rev @@ -169,7 +168,7 @@ def validate_arguments(args, bc): 'WITH_BF_CYCLES_OSL', 'WITH_BF_STATICOSL', 'BF_OSL', 'BF_OSL_INC', 'BF_OSL_LIB', 'BF_OSL_LIBPATH', 'BF_OSL_LIB_STATIC', 'BF_OSL_COMPILER', 'WITH_BF_LLVM', 'WITH_BF_STATICLLVM', 'BF_LLVM', 'BF_LLVM_LIB', 'BF_LLVM_LIBPATH', 'BF_LLVM_LIB_STATIC', 'BF_PROGRAM_LINKFLAGS' ] - + # Have options here that scons expects to be lists opts_list_split = [ 'BF_PYTHON_LINKFLAGS', @@ -183,8 +182,8 @@ def validate_arguments(args, bc): 'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE', 'MACOSX_SDK_CHECK', 'XCODE_CUR_VER', 'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS', 'MACOSX_DEPLOYMENT_TARGET' ] - - + + arg_list = ['BF_DEBUG', 'BF_QUIET', 'BF_CROSS', 'BF_UPDATE', 'BF_INSTALLDIR', 'BF_TOOLSET', 'BF_BINNAME', 'BF_BUILDDIR', 'BF_FANCY', 'BF_QUICK', 'BF_PROFILE', 'BF_LINE_OVERWRITE', @@ -225,14 +224,13 @@ def validate_targets(targs, bc): print '\t'+bc.WARNING+'Invalid target: '+bc.ENDC+t return oklist -class ourSpawn: +class OurSpawn: def ourspawn(self, sh, escape, cmd, args, env): - newargs = string.join(args[1:], ' ') + newargs = " ".join(args[1:]) cmdline = cmd + " " + newargs startupinfo = subprocess.STARTUPINFO() - #startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False) + stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False, env=env) data, err = proc.communicate() rv = proc.wait() if data: @@ -242,8 +240,7 @@ class ourSpawn: return rv def SetupSpawn( env ): - buf = ourSpawn() - buf.ourenv = env + buf = OurSpawn() env['SPAWN'] = buf.ourspawn @@ -322,7 +319,7 @@ def read_opts(env, cfg, args): (BoolVariable('WITH_BF_CINEON', 'Support CINEON and DPX image formats if true', True)), (BoolVariable('WITH_BF_HDR', 'Support HDR image formats if true', True)), - + (BoolVariable('WITH_BF_FRAMESERVER', 'Support export to a frameserver', True)), (BoolVariable('WITH_BF_FFMPEG', 'Use FFMPEG if true', False)), @@ -335,7 +332,7 @@ def read_opts(env, cfg, args): ('BF_FFMPEG_LIBPATH', 'FFMPEG library path', ''), (BoolVariable('WITH_BF_STATICFFMPEG', 'Use static FFMPEG if true', False)), ('BF_FFMPEG_LIB_STATIC', 'Static FFMPEG libraries', ''), - + (BoolVariable('WITH_BF_OGG', 'Link OGG, THEORA, VORBIS with FFMPEG if true', False)), ('BF_OGG', 'OGG base path', ''), @@ -392,7 +389,7 @@ def read_opts(env, cfg, args): ('BF_ICONV_INC', 'iconv include path', ''), ('BF_ICONV_LIB', 'iconv library', ''), ('BF_ICONV_LIBPATH', 'iconv library path', ''), - + (BoolVariable('WITH_BF_FREESTYLE', 'Compile with freestyle', True)), (BoolVariable('WITH_BF_GAMEENGINE', 'Build with gameengine' , False)), @@ -404,11 +401,11 @@ def read_opts(env, cfg, args): ('BF_LAPACK_LIB_STATIC', 'LAPACK library', ''), ('BF_LAPACK_LIBPATH', 'LAPACK library path', ''), (BoolVariable('WITH_BF_STATICLAPACK', 'Staticly link to LAPACK', False)), - + ('BF_BULLET', 'Bullet base dir', ''), ('BF_BULLET_INC', 'Bullet include path', ''), ('BF_BULLET_LIB', 'Bullet library', ''), - + ('BF_WINTAB', 'WinTab base dir', ''), ('BF_WINTAB_INC', 'WinTab include dir', ''), ('BF_CXX', 'c++ base path for libstdc++, only used when static linking', ''), @@ -437,7 +434,7 @@ def read_opts(env, cfg, args): ('BF_QUICKTIME_INC', 'QuickTime include path', ''), ('BF_QUICKTIME_LIB', 'QuickTime library', ''), ('BF_QUICKTIME_LIBPATH', 'QuickTime library path', ''), - + (BoolVariable('WITH_BF_FFTW3', 'Use FFTW3 if true', False)), ('BF_FFTW3', 'FFTW3 base path', ''), ('BF_FFTW3_INC', 'FFTW3 include path', ''), @@ -470,7 +467,7 @@ def read_opts(env, cfg, args): ('BF_EXPAT_LIB', 'Expat library', ''), ('BF_EXPAT_LIBPATH', 'Expat library path', ''), ('BF_OPENCOLLADA_LIB_STATIC', 'OpenCollada static library', ''), - + (BoolVariable('WITH_BF_JEMALLOC', 'Use jemalloc if true', False)), (BoolVariable('WITH_BF_STATICJEMALLOC', 'Staticly link to jemalloc', False)), ('BF_JEMALLOC', 'jemalloc base path', ''), @@ -542,12 +539,12 @@ def read_opts(env, cfg, args): (BoolVariable('BF_QUIET', 'Enable silent output if true', True)), (BoolVariable('BF_LINE_OVERWRITE', 'Enable overwriting of compile line in BF_QUIET mode if true', False)), (BoolVariable('WITH_BF_BINRELOC', 'Enable relocatable binary (linux only)', False)), - + (BoolVariable('WITH_BF_LZO', 'Enable fast LZO pointcache compression', True)), (BoolVariable('WITH_BF_LZMA', 'Enable best LZMA pointcache compression', True)), - + (BoolVariable('WITH_BF_LIBMV', 'Enable libmv structure from motion library', True)), - + (BoolVariable('WITH_BF_COMPOSITOR', 'Enable the tile based nodal compositor', True)), ) # end of opts.AddOptions() @@ -555,15 +552,15 @@ def read_opts(env, cfg, args): ('BF_X264_CONFIG', 'configuration flags for x264', ''), ('BF_XVIDCORE_CONFIG', 'configuration flags for xvidcore', ''), # (BoolVariable('WITH_BF_DOCS', 'Generate API documentation', False)), - + ('BF_CONFIG', 'SCons python config file used to set default options', 'user_config.py'), ('BF_NUMJOBS', 'Number of build processes to spawn', '1'), ('BF_MSVS', 'Generate MSVS project files and solution', False), (BoolVariable('BF_UNIT_TEST', 'Build with unit test support.', False)), - + (BoolVariable('BF_GHOST_DEBUG', 'Make GHOST print events and info to stdout. (very verbose)', False)), - + (BoolVariable('WITH_BF_RAYOPTIMIZATION', 'Enable raytracer SSE/SIMD optimization.', False)), ('BF_RAYOPTIMIZATION_SSE_FLAGS', 'SSE flags', ''), (BoolVariable('WITH_BF_CXX_GUARDEDALLOC', 'Enable GuardedAlloc for C++ memory allocation tracking.', False)), @@ -722,7 +719,7 @@ def NSIS_Installer(target=None, source=None, env=None): if env['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'win64-mingw'): print "NSIS installer is only available on Windows." - Exit() + exit() if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'): bitness = '32' elif env['OURPLATFORM'] in ('win64-vc', 'win64-mingw'): @@ -741,7 +738,7 @@ def NSIS_Installer(target=None, source=None, env=None): deldatafiles = '' deldatadirs = '' l = len(bf_installdir) - + for dp,dn,df in os.walk(bf_installdir): # install if not doneroot: @@ -750,7 +747,6 @@ def NSIS_Installer(target=None, source=None, env=None): doneroot = True else: if len(df)>0: - dp_tmp = dp[l:] datafiles += "\n" +r'SetOutPath $INSTDIR'+dp[l:]+"\n\n" for f in df: @@ -769,7 +765,7 @@ def NSIS_Installer(target=None, source=None, env=None): #### change to suit install dir #### inst_dir = install_base_dir + env['BF_INSTALLDIR'] - + os.chdir(rel_dir) ns = open("00.sconsblender.nsi","r") -- cgit v1.2.3