[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [16938] branches/blender2.5/blender: * merge main SConstruct and some of the utility scripts for our scons build from trunk .

Nathan Letwory jesterking at letwory.net
Sun Oct 5 23:33:23 CEST 2008


Revision: 16938
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16938
Author:   jesterking
Date:     2008-10-05 23:33:23 +0200 (Sun, 05 Oct 2008)

Log Message:
-----------
* merge main SConstruct and some of the utility scripts for our scons build from trunk.
  Note: I'll be working on improving our scons build environment in this branch
  Note2: I'll be upgrading our scripts to work fully with scons 1.0 (and possibly later)

Modified Paths:
--------------
    branches/blender2.5/blender/SConstruct
    branches/blender2.5/blender/config/win32-vc-config.py
    branches/blender2.5/blender/tools/Blender.py
    branches/blender2.5/blender/tools/btools.py

Modified: branches/blender2.5/blender/SConstruct
===================================================================
--- branches/blender2.5/blender/SConstruct	2008-10-05 19:07:09 UTC (rev 16937)
+++ branches/blender2.5/blender/SConstruct	2008-10-05 21:33:23 UTC (rev 16938)
@@ -36,6 +36,7 @@
 import shutil
 import glob
 import re
+from tempfile import mkdtemp
 
 import tools.Blender
 import tools.btools
@@ -142,7 +143,7 @@
 
 env['OURPLATFORM'] = platform
 
-configfile = B.arguments.get('BF_CONFIG', 'config'+os.sep+platform+'-config.py')
+configfile = 'config'+os.sep+platform+'-config.py'
 
 if os.path.exists(configfile):
     print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
@@ -156,13 +157,14 @@
     # Needed for gui programs, console programs should do without it
     env.Append(LINKFLAGS=['-mwindows'])
 
+userconfig = B.arguments.get('BF_CONFIG', 'user-config.py')
 # first read platform config. B.arguments will override
 optfiles = [configfile]
-if os.path.exists('user-config.py'):
-    print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + 'user-config.py'
-    optfiles += ['user-config.py']
+if os.path.exists(userconfig):
+    print B.bc.OKGREEN + "Using user-config file: " + B.bc.ENDC + userconfig
+    optfiles += [userconfig]
 else:
-    print B.bc.WARNING + 'user-config.py' + " not found, no user overrides" + B.bc.ENDC
+    print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
 
 opts = btools.read_opts(optfiles, B.arguments)
 opts.Update(env)
@@ -176,6 +178,23 @@
     env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
     env['CCFLAGS'].append('-DDISABLE_ELBEEM')
 
+if env['WITH_BF_OPENMP'] == 1:
+        if env['OURPLATFORM']=='win32-vc':
+                env['CCFLAGS'].append('/openmp')
+                env['CPPFLAGS'].append('/openmp')
+                env['CXXFLAGS'].append('/openmp')
+        else:
+            if env['CC'][-3:] == 'icc': # to be able to handle CC=/opt/bla/icc case
+                env.Append(LINKFLAGS=['-openmp', '-static-intel'])
+                env['CCFLAGS'].append('-openmp')
+                env['CPPFLAGS'].append('-openmp')
+                env['CXXFLAGS'].append('-openmp')
+            else:
+                env.Append(CCFLAGS=['-fopenmp']) 
+                env.Append(CPPFLAGS=['-fopenmp'])
+                env.Append(CXXFLAGS=['-fopenmp'])
+                # env.Append(LINKFLAGS=['-fprofile-generate'])
+
 #check for additional debug libnames
 
 if env.has_key('BF_DEBUG_LIBS'):
@@ -204,22 +223,31 @@
             return result
 
         env2 = env.Copy( LIBPATH = env['BF_OPENAL'] ) 
-        conf = Configure( env2, {'CheckFreeAlut' : CheckFreeAlut}, '.sconf_temp', '/dev/null' )
+        sconf_temp = mkdtemp()
+        conf = Configure( env2, {'CheckFreeAlut' : CheckFreeAlut}, sconf_temp, '/dev/null' )
         if conf.CheckFreeAlut( env2 ):
             env['BF_OPENAL_LIB'] += ' alut'
         del env2
-        for root, dirs, files in os.walk('.sconf_temp', topdown=False):
+        root = ''
+        for root, dirs, files in os.walk(sconf_temp, topdown=False):
             for name in files:
                 os.remove(os.path.join(root, name))
             for name in dirs:
                 os.rmdir(os.path.join(root, name))
-        os.rmdir(root)
+        if root: os.rmdir(root)
 
 if len(B.quickdebug) > 0 and printdebug != 0:
     print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
     for l in B.quickdebug:
         print "\t" + l
 
+# remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
+if env['WITH_BF_STATICCXX']:
+    if 'stdc++' in env['LLIBS']:
+        env['LLIBS'] = env['LLIBS'].replace('stdc++', ' ')
+    else:
+        print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
+
 # check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
 if 'blenderplayer' in B.targets:
     env['WITH_BF_PLAYER'] = True
@@ -227,6 +255,31 @@
 if 'blendernogame' in B.targets:
     env['WITH_BF_GAMEENGINE'] = False
 
+if 'blenderlite' in B.targets:
+    env['WITH_BF_GAMEENGINE'] = False
+    env['WITH_BF_OPENAL'] = False
+    env['WITH_BF_OPENEXR'] = False
+    env['WITH_BF_ICONV'] = False
+    env['WITH_BF_INTERNATIONAL'] = False
+    env['WITH_BF_OPENJPEG'] = False
+    env['WITH_BF_FFMPEG'] = False
+    env['WITH_BF_QUICKTIME'] = False
+    env['WITH_BF_YAFRAY'] = False
+    env['WITH_BF_REDCODE'] = False
+    env['WITH_BF_FTGL'] = False
+    env['WITH_BF_DDS'] = False
+    env['WITH_BF_ZLIB'] = False
+    env['WITH_BF_SDL'] = False
+    env['WITH_BF_JPEG'] = False
+    env['WITH_BF_PNG'] = False
+    env['WITH_BF_ODE'] = False
+    env['WITH_BF_BULLET'] = False
+    env['WITH_BF_BINRELOC'] = False
+    env['BF_BUILDINFO'] = False
+    env['BF_NO_ELBEEM'] = True
+    
+
+
 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
 #B.root_build_dir = B.arguments.get('BF_BUILDDIR', '..'+os.sep+'build'+os.sep+platform+os.sep)
 B.root_build_dir = env['BF_BUILDDIR']
@@ -244,10 +297,18 @@
     if os.path.exists(B.root_build_dir):
         print B.bc.HEADER+'Cleaning...'+B.bc.ENDC
         dirs = os.listdir(B.root_build_dir)
-        for dir in dirs:
-            if os.path.isdir(B.root_build_dir + dir) == 1:
-                print "clean dir %s"%(B.root_build_dir+dir)
-                shutil.rmtree(B.root_build_dir+dir)
+        for entry in dirs:
+            if os.path.isdir(B.root_build_dir + entry) == 1:
+                print "clean dir %s"%(B.root_build_dir+entry)
+                shutil.rmtree(B.root_build_dir+entry)
+            else: # remove file
+                print "remove file %s"%(B.root_build_dir+entry)
+                os.remove(B.root_build_dir+entry)
+        for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
+                'extern/xvidcore/build/generic/platform.inc']:
+            if os.path.exists(confile):
+                print "clean file %s"%confile
+                os.remove(confile)
         print B.bc.OKGREEN+'...done'+B.bc.ENDC
     else:
         print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
@@ -266,7 +327,7 @@
 # default is new quieter output, but if you need to see the 
 # commands, do 'scons BF_QUIET=0'
 bf_quietoutput = B.arguments.get('BF_QUIET', '1')
-if bf_quietoutput=='1':
+if env['BF_QUIET']:
     B.set_quiet_output(env)
 else:
     if toolset=='msvc':
@@ -330,34 +391,57 @@
     blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
 
 #-- .blender
+#- dont do .blender and scripts for darwin, it is already in the bundle
 dotblendlist = []
 dottargetlist = []
-for dp, dn, df in os.walk('bin/.blender'):
-    if 'CVS' in dn:
-        dn.remove('CVS')
-    if '.svn' in dn:
-        dn.remove('.svn')
-    for f in df:
-        dotblendlist.append(dp+os.sep+f)
-        dottargetlist.append(env['BF_INSTALLDIR']+dp[3:]+os.sep+f)
+scriptinstall = []
 
-dotblenderinstall = []
-for targetdir,srcfile in zip(dottargetlist, dotblendlist):
-    td, tf = os.path.split(targetdir)
-    dotblenderinstall.append(env.Install(dir=td, source=srcfile))
+if  env['OURPLATFORM']!='darwin':
+        for dp, dn, df in os.walk('bin/.blender'):
+            if 'CVS' in dn:
+                dn.remove('CVS')
+            if '.svn' in dn:
+                dn.remove('.svn')
+            for f in df:
+                dotblendlist.append(dp+os.sep+f)
+                dottargetlist.append(env['BF_INSTALLDIR']+dp[3:]+os.sep+f)
 
-#-- .blender/scripts
-scriptinstall = []
-scriptpath='release/scripts'
-for dp, dn, df in os.walk(scriptpath):
-    if 'CVS' in dn:
-        dn.remove('CVS')
-    if '.svn' in dn:
-        dn.remove('.svn')
-    dir=env['BF_INSTALLDIR']+'/.blender/scripts'+dp[len(scriptpath):]
-    source=[dp+os.sep+f for f in df]
-    scriptinstall.append(env.Install(dir=dir,source=source))
+        dotblenderinstall = []
+        for targetdir,srcfile in zip(dottargetlist, dotblendlist):
+            td, tf = os.path.split(targetdir)
+            dotblenderinstall.append(env.Install(dir=td, source=srcfile))
+        
+        #-- .blender/scripts    
+        scriptpath='release/scripts'
+        for dp, dn, df in os.walk(scriptpath):
+            if 'CVS' in dn:
+                dn.remove('CVS')
+            if '.svn' in dn:
+                dn.remove('.svn')
+            dir=env['BF_INSTALLDIR']+'/.blender/scripts'+dp[len(scriptpath):]
+            source=[dp+os.sep+f for f in df]
+            scriptinstall.append(env.Install(dir=dir,source=source))
 
+#-- icons
+if env['OURPLATFORM']=='linux2':
+	iconlist = []
+	icontargetlist = []
+
+	for tp, tn, tf in os.walk('release/freedesktop/icons'):
+		if 'CVS' in tn:
+			tn.remove('CVS')
+		if '.svn' in tn:
+			tn.remove('.svn')
+		for f in tf:
+			print ">>>", env['BF_INSTALLDIR'], tp, f
+			iconlist.append(tp+os.sep+f)
+			icontargetlist.append(env['BF_INSTALLDIR']+tp[19:]+os.sep+f)
+
+	iconinstall = []
+	for targetdir,srcfile in zip(icontargetlist, iconlist):
+		td, tf = os.path.split(targetdir)
+		iconinstall.append(env.Install(dir=td, source=srcfile))
+
 #-- plugins
 pluglist = []
 plugtargetlist = []
@@ -367,9 +451,26 @@
     if '.svn' in tn:
         tn.remove('.svn')
     for f in tf:
+        print ">>>", env['BF_INSTALLDIR'], tp, f
         pluglist.append(tp+os.sep+f)
         plugtargetlist.append(env['BF_INSTALLDIR']+tp[7:]+os.sep+f)
 
+# header files for plugins
+pluglist.append('source/blender/blenpluginapi/documentation.h')
+plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'documentation.h')
+pluglist.append('source/blender/blenpluginapi/externdef.h')
+plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'externdef.h')
+pluglist.append('source/blender/blenpluginapi/floatpatch.h')
+plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'floatpatch.h')
+pluglist.append('source/blender/blenpluginapi/iff.h')
+plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'iff.h')
+pluglist.append('source/blender/blenpluginapi/plugin.h')
+plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'plugin.h')
+pluglist.append('source/blender/blenpluginapi/util.h')
+plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'util.h')

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list