Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Letwory <nathan@letworyinteractive.com>2013-06-16 01:20:06 +0400
committerNathan Letwory <nathan@letworyinteractive.com>2013-06-16 01:20:06 +0400
commitfc4f6a7bad0030c49d61b3c71aa4ffe0e5b9fa38 (patch)
treead479382be96b0919efb447086da35ba4faa7992
parent11f104a4a31901febb6043cf1121599dd0d84155 (diff)
Set up OurSpawn for MinGW compile environment on Windows.
-rw-r--r--SConstruct29
-rw-r--r--build_files/scons/tools/btools.py52
2 files changed, 39 insertions, 42 deletions
diff --git a/SConstruct b/SConstruct
index c0c505fcc23..94acdbbab92 100644
--- a/SConstruct
+++ b/SConstruct
@@ -46,9 +46,7 @@ import os
import os.path
import string
import shutil
-import glob
import re
-from tempfile import mkdtemp
# store path to tools
toolpath=os.path.join(".", "build_files", "scons", "tools")
@@ -58,7 +56,6 @@ sys.path.append(toolpath)
import Blender
import btools
-import bcolors
EnsureSConsVersion(1,0,0)
@@ -121,7 +118,7 @@ if tempbitness in (32, 64): # only set if 32 or 64 has been given
if bitness:
B.bitness = bitness
-else:
+else:
B.bitness = tempbitness
@@ -172,6 +169,10 @@ if sys.platform=='win32':
elif env['CC'] in ['gcc']:
platform = 'win64-mingw' if bitness == 64 else 'win32-mingw'
+if 'mingw' in platform:
+ print "Setting custom spawn function"
+ btools.SetupSpawn(env)
+
env.SConscriptChdir(0)
# Remove major kernel version from linux platform.
@@ -303,7 +304,7 @@ if env['OURPLATFORM']=='darwin':
env.Append(LINKFLAGS=['-F/Library/Frameworks','-Xlinker','-weak_framework','-Xlinker','3DconnexionClient'])
env['BF_3DMOUSE_INC'] = '/Library/Frameworks/3DconnexionClient.framework/Headers'
- # for now, Mac builders must download and install the JackOSX framework
+ # for now, Mac builders must download and install the JackOSX framework
# necessary header file lives here when installed:
# /Library/Frameworks/Jackmp.framework/Versions/A/Headers/jack.h
if env['WITH_BF_JACK'] == 1:
@@ -313,13 +314,13 @@ if env['OURPLATFORM']=='darwin':
else:
env.Append(LINKFLAGS=['-L/Library/Frameworks','-Xlinker','-weak_framework','-Xlinker','Jackmp'])
- if env['WITH_BF_CYCLES_OSL'] == 1:
+ if env['WITH_BF_CYCLES_OSL'] == 1:
OSX_OSL_LIBPATH = Dir(env.subst(env['BF_OSL_LIBPATH'])).abspath
# we need 2 variants of passing the oslexec with the force_load option, string and list type atm
env.Append(LINKFLAGS=['-L'+OSX_OSL_LIBPATH,'-loslcomp','-force_load '+ OSX_OSL_LIBPATH +'/liboslexec.a','-loslquery'])
env.Append(BF_PROGRAM_LINKFLAGS=['-Xlinker','-force_load','-Xlinker',OSX_OSL_LIBPATH +'/liboslexec.a'])
- # Trying to get rid of eventually clashes, we export some explicite as local symbols
+ # Trying to get rid of eventually clashes, we export some explicite as local symbols
env.Append(LINKFLAGS=['-Xlinker','-unexported_symbols_list','-Xlinker','./source/creator/osx_locals.map'])
if env['WITH_BF_OPENMP'] == 1:
@@ -330,10 +331,10 @@ if env['WITH_BF_OPENMP'] == 1:
env.Append(LINKFLAGS=['-openmp', '-static-intel'])
env['CCFLAGS'].append('-openmp')
else:
- env.Append(CCFLAGS=['-fopenmp'])
+ env.Append(CCFLAGS=['-fopenmp'])
if env['WITH_GHOST_COCOA'] == True:
- env.Append(CPPFLAGS=['-DGHOST_COCOA'])
+ env.Append(CPPFLAGS=['-DGHOST_COCOA'])
if env['USE_QTKIT'] == True:
env.Append(CPPFLAGS=['-DUSE_QTKIT'])
@@ -370,7 +371,7 @@ if env['WITH_BF_FLUID'] == 1:
# build with ocean sim?
if env['WITH_BF_OCEANSIM'] == 1:
- env['WITH_BF_FFTW3'] = 1 # ocean needs fftw3 so enable it
+ env['WITH_BF_FFTW3'] = 1 # ocean needs fftw3 so enable it
env['CPPFLAGS'].append('-DWITH_MOD_OCEANSIM')
@@ -517,9 +518,9 @@ def data_to_c_simple(FILE_FROM):
filename_only = os.path.basename(FILE_FROM)
FILE_TO = os.path.join(env['DATA_SOURCES'], filename_only + ".c")
VAR_NAME = "datatoc_" + filename_only.replace(".", "_")
-
+
data_to_c(FILE_FROM, FILE_TO, VAR_NAME)
-
+
if B.targets != ['cudakernels']:
data_to_c("source/blender/compositor/operations/COM_OpenCLKernels.cl",
@@ -960,7 +961,7 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
else:
dllsources.append('${LCGDIR}/opencolorio/bin/libOpenColorIO.dll')
-
+
dllsources.append('#source/icons/blender.exe.manifest')
windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
@@ -990,7 +991,7 @@ if env['OURPLATFORM'] == 'win64-mingw':
if(env['WITH_BF_OPENMP']):
dllsources.append('${LCGDIR}/binaries/libgomp-1.dll')
-
+
if env['WITH_BF_OCIO']:
dllsources.append('${LCGDIR}/opencolorio/bin/libOpenColorIO.dll')
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")