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:
Diffstat (limited to 'build_files/scons/tools/Blender.py')
-rw-r--r--build_files/scons/tools/Blender.py102
1 files changed, 77 insertions, 25 deletions
diff --git a/build_files/scons/tools/Blender.py b/build_files/scons/tools/Blender.py
index ad4df1a60c1..75af7e47edd 100644
--- a/build_files/scons/tools/Blender.py
+++ b/build_files/scons/tools/Blender.py
@@ -148,8 +148,6 @@ def setup_staticlibs(lenv):
libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
if lenv['WITH_BF_STATICOPENEXR']:
statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
- if lenv['WITH_BF_LCMS']:
- libincs += Split(lenv['BF_LCMS_LIBPATH'])
if lenv['WITH_BF_TIFF']:
libincs += Split(lenv['BF_TIFF_LIBPATH'])
if lenv['WITH_BF_STATICTIFF']:
@@ -203,6 +201,11 @@ def setup_staticlibs(lenv):
if lenv['OURPLATFORM'] not in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
libincs.append('/usr/lib')
+ if lenv['WITH_BF_JEMALLOC']:
+ libincs += Split(lenv['BF_JEMALLOC_LIBPATH'])
+ if lenv['WITH_BF_STATICJEMALLOC']:
+ statlibs += Split(lenv['BF_JEMALLOC_LIB_STATIC'])
+
return statlibs, libincs
def setup_syslibs(lenv):
@@ -253,16 +256,20 @@ def setup_syslibs(lenv):
syslibs += Split(lenv['BF_OPENGL_LIB'])
if lenv['OURPLATFORM'] in ('win32-vc', 'win32-mingw','linuxcross', 'win64-vc'):
syslibs += Split(lenv['BF_PTHREADS_LIB'])
- if lenv['WITH_BF_LCMS']:
- syslibs.append(lenv['BF_LCMS_LIB'])
if lenv['WITH_BF_COLLADA']:
syslibs.append(lenv['BF_PCRE_LIB'])
- syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
+ if lenv['BF_DEBUG']:
+ syslibs += [colladalib+'_d' for colladalib in Split(lenv['BF_OPENCOLLADA_LIB'])]
+ else:
+ syslibs += Split(lenv['BF_OPENCOLLADA_LIB'])
syslibs.append(lenv['BF_EXPAT_LIB'])
if not lenv['WITH_BF_STATICLIBSAMPLERATE']:
syslibs += Split(lenv['BF_LIBSAMPLERATE_LIB'])
+ if lenv['WITH_BF_JEMALLOC']:
+ if not lenv['WITH_BF_STATICJEMALLOC']:
+ syslibs += Split(lenv['BF_JEMALLOC_LIB'])
syslibs += lenv['LLIBS']
@@ -283,6 +290,46 @@ def propose_priorities():
print "\t\t",new_priority, v
new_priority += 5
+# emits the necessary file objects for creator.c, to be used in creating
+# the final blender executable
+def creator(env):
+ sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources
+
+ incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', env['BF_OPENGL_INC']]
+
+ defs = []
+ if env['WITH_BF_QUICKTIME']:
+ incs.append(env['BF_QUICKTIME_INC'])
+ defs.append('WITH_QUICKTIME')
+
+ if env['WITH_BF_BINRELOC']:
+ incs.append('#/extern/binreloc/include')
+ defs.append('WITH_BINRELOC')
+
+ if env['WITH_BF_OPENEXR']:
+ defs.append('WITH_OPENEXR')
+
+ if env['WITH_BF_TIFF']:
+ defs.append('WITH_TIFF')
+
+ if not env['WITH_BF_SDL']:
+ defs.append('DISABLE_SDL')
+
+ if env['WITH_BF_PYTHON']:
+ incs.append('#/source/blender/python')
+ defs.append('WITH_PYTHON')
+ if env['BF_DEBUG']:
+ defs.append('_DEBUG')
+
+ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc'):
+ incs.append(env['BF_PTHREADS_INC'])
+
+ env.Append(CPPDEFINES=defs)
+ env.Append(CPPPATH=incs)
+ obj = [env.Object(root_build_dir+'source/creator/creator/creator', ['#source/creator/creator.c'])]
+
+ return obj
+
## TODO: see if this can be made in an emitter
def buildinfo(lenv, build_type):
"""
@@ -320,7 +367,7 @@ def buildinfo(lenv, build_type):
lenv.Append (CPPPATH = [root_build_dir+'source/blender/blenkernel'])
- obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type, [root_build_dir+'source/creator/buildinfo.c'])]
+ obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type, ['#source/creator/buildinfo.c'])]
return obj
@@ -445,10 +492,16 @@ def WinPyBundle(target=None, source=None, env=None):
shutil.rmtree(py_target, False, printexception)
exclude_re=[re.compile('.*/test/.*'),
re.compile('^config/.*'),
+ re.compile('^config-*/.*'),
re.compile('^distutils/.*'),
re.compile('^idlelib/.*'),
re.compile('^lib2to3/.*'),
- re.compile('^tkinter/.*')]
+ re.compile('^tkinter/.*'),
+ re.compile('^_tkinter_d.pyd'),
+ re.compile('^turtledemo'),
+ re.compile('^turtle.py'),
+ ]
+
print "Unpacking '" + py_tar + "' to '" + py_target + "'"
untar_pybundle(py_tar,py_target,exclude_re)
@@ -508,13 +561,16 @@ def AppIt(target=None, source=None, env=None):
cmd = 'mkdir %s/%s.app/Contents/MacOS/%s/python/'%(installdir,binary, VERSION)
commands.getoutput(cmd)
cmd = 'unzip -q %s/release/%s -d %s/%s.app/Contents/MacOS/%s/python/'%(libdir,python_zip,installdir,binary,VERSION)
- commands.getoutput(cmd)
- cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
- commands.getoutput(cmd)
- cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
- commands.getoutput(cmd)
- cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
commands.getoutput(cmd)
+
+ if binary == 'blender':#not copy everything for blenderplayer
+ cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
+ commands.getoutput(cmd)
+ cmd = 'cp -R %s/release/ui %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
+ commands.getoutput(cmd)
+ cmd = 'cp -R %s/release/io %s/%s.app/Contents/MacOS/%s/'%(bldroot,installdir,binary,VERSION)
+ commands.getoutput(cmd)
+
cmd = 'chmod +x %s/%s.app/Contents/MacOS/%s'%(installdir,binary, binary)
commands.getoutput(cmd)
cmd = 'find %s/%s.app -name .svn -prune -exec rm -rf {} \;'%(installdir, binary)
@@ -565,17 +621,17 @@ def UnixPyBundle(target=None, source=None, env=None):
run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target)))
run("rm -rf '%s/distutils'" % py_target)
run("rm -rf '%s/lib2to3'" % py_target)
- run("rm -rf '%s/idlelib'" % py_target)
- run("rm -rf '%s/tkinter'" % py_target)
run("rm -rf '%s/config'" % py_target)
-
+ run("rm -rf '%s/config-*'" % py_target)
run("rm -rf '%s/site-packages'" % py_target)
run("mkdir '%s/site-packages'" % py_target) # python needs it.'
-
+ run("rm -rf '%s/idlelib'" % py_target)
+ run("rm -rf '%s/tkinter'" % py_target)
+ run("rm -rf '%s/turtledemo'" % py_target)
+ run("rm -r '%s/turtle.py'" % py_target)
run("rm -f '%s/lib-dynload/_tkinter.so'" % py_target)
+
run("find '%s' -type d -name 'test' -prune -exec rm -rf {} ';'" % py_target)
- run("find '%s' -type d -name 'config-*' -prune -exec rm -rf {} ';'" % py_target)
- run("find '%s' -type d -name 'turtledemo' -prune -exec rm -rf {} ';'" % py_target)
run("find '%s' -type d -name '__pycache__' -exec rm -rf {} ';'" % py_target)
run("find '%s' -name '*.py[co]' -exec rm -rf {} ';'" % py_target)
run("find '%s' -name '*.so' -exec strip -s {} ';'" % py_target)
@@ -704,23 +760,19 @@ class BlenderEnvironment(SConsEnvironment):
global vcp
print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
lenv = self.Clone()
+ lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
if lenv['OURPLATFORM'] in ('win32-vc', 'cygwin', 'win64-vc'):
- lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
- lenv.Append(LINKFLAGS = ['/FORCE:MULTIPLE'])
if lenv['BF_DEBUG']:
- lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb'])
+ lenv.Prepend(LINKFLAGS = ['/DEBUG','/PDB:'+progname+'.pdb','/NODEFAULTLIB:libcmt'])
if lenv['OURPLATFORM']=='linux2':
- lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
if lenv['WITH_BF_PYTHON']:
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
if lenv['OURPLATFORM']=='sunos5':
- lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
if lenv['WITH_BF_PYTHON']:
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
if lenv['CXX'].endswith('CC'):
lenv.Replace(LINK = '$CXX')
if lenv['OURPLATFORM']=='darwin':
- lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
if lenv['WITH_BF_PYTHON']:
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS'])