==SCons==
[blender.git] / tools / Blender.py
index 54780738b9b3968ceb14db42469d0f6d92d1fd4f..4a631f847981610b1ca60498b7aba8eb570b382a 100644 (file)
@@ -81,8 +81,6 @@ def add_lib_to_dict(dict = None, libtype = None, libname = None, priority = 100)
         print "Wrong type combinations for libtype and priority. Only str and int or list and list"
         Exit()
 
-#libs = init_lib_dict(libs)
-
 def create_blender_liblist(lenv = None, libtype = None):
     if not lenv or not libtype:
         print "missing arg"
@@ -96,7 +94,6 @@ def create_blender_liblist(lenv = None, libtype = None):
         curlib = libs[libtype]
         for sk in sortlist:
             v = curlib[sk]
-        #for k,v in sorted(libs[libtype].iteritems()):
             lst.append('#' + root_build_dir + 'lib/'+lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX'])
 
     return lst
@@ -112,18 +109,17 @@ def setup_staticlibs(lenv):
         lenv['BF_OPENGL_LIBPATH'],
         lenv['BF_SDL_LIBPATH'],
         lenv['BF_JPEG_LIBPATH'],
-        lenv['BF_TIFF_LIBPATH'],
         lenv['BF_PNG_LIBPATH'],
-        lenv['BF_GETTEXT_LIBPATH'],
         lenv['BF_ZLIB_LIBPATH'],
-        lenv['BF_FREETYPE_LIBPATH'],
-#        lenv['BF_QUICKTIME_LIBPATH'],
         lenv['BF_ICONV_LIBPATH']
         ]
     libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
 
+    if lenv['WITH_BF_INTERNATIONAL']:
+        libincs += Split(lenv['BF_GETTEXT_LIBPATH'])
+        libincs += Split(lenv['BF_FREETYPE_LIBPATH'])
     if lenv['WITH_BF_OPENAL']:
-        lenv['BF_OPENAL_LIBPATH']
+        libincs += Split(lenv['BF_OPENAL_LIBPATH'])
 
     return statlibs, libincs
 
@@ -132,15 +128,15 @@ def setup_syslibs(lenv):
         lenv['BF_PYTHON_LIB'],
         lenv['BF_JPEG_LIB'],
         lenv['BF_PNG_LIB'],
-        lenv['BF_ZLIB_LIB'],
-        lenv['BF_FREETYPE_LIB'],
-        lenv['BF_GETTEXT_LIB']
+        lenv['BF_ZLIB_LIB']
         ]
+    if lenv['WITH_BF_INTERNATIONAL']:
+        syslibs += Split(lenv['BF_FREETYPE_LIB'])
+        syslibs += Split(lenv['BF_GETTEXT_LIB'])
     if lenv['WITH_BF_OPENAL']:
        syslibs += Split(lenv['BF_OPENAL_LIB'])
     if lenv['OURPLATFORM']=='win32vc':
-            syslibs += Split(lenv['BF_ICONV_LIB'])
-    syslibs += Split(lenv['BF_TIFF_LIB'])
+        syslibs += Split(lenv['BF_ICONV_LIB'])
     if lenv['WITH_BF_OPENEXR']:
         syslibs += Split(lenv['BF_OPENEXR_LIB'])
     syslibs += Split(lenv['BF_SDL_LIB'])
@@ -260,9 +256,9 @@ def set_quiet_output(env):
     env['BUILDERS']['Program'] = program
 
 def  my_appit_print(target, source, env):
-       a = '%s' % (target[0])
-       d, f = os.path.split(a)
-       return "making bundle for " + f
+    a = '%s' % (target[0])
+    d, f = os.path.split(a)
+    return "making bundle for " + f
 
 def AppIt(target=None, source=None, env=None):
     import shutil
@@ -293,9 +289,9 @@ def AppIt(target=None, source=None, env=None):
     shutil.copy(bldroot + '/bin/.blender/.bfont.ttf', cmd)
     shutil.copy(bldroot + '/bin/.blender/.Blanguages', cmd)
     cmd = 'cp -R %s/bin/.blender/locale %s/%s.app/Contents/Resources/'%(bldroot,builddir,binary)
-    commands.getoutput(cmd)    
+    commands.getoutput(cmd) 
     cmd = 'cp -R %s/bin/.blender/locale %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
-    commands.getoutput(cmd)    
+    commands.getoutput(cmd) 
     cmd = 'cp -R %s/release/scripts %s/%s.app/Contents/MacOS/.blender/'%(bldroot,builddir,binary)
     commands.getoutput(cmd)
     cmd = 'chmod +x  %s/%s.app/Contents/MacOS/%s'%(builddir,binary, binary)
@@ -358,17 +354,8 @@ class BlenderEnvironment(SConsEnvironment):
         SConsEnvironment.Default(self, prog)
         program_list.append(prog)
         if  lenv['OURPLATFORM']=='darwin':
-               lenv['BINARYKIND'] = binarykind
-               lenv.AddPostAction(prog,Action(AppIt,strfunction=my_appit_print))
-
-## TODO: have register for libs/programs, so that we test only that
-#  which have expressed their need to be tested in their own sconscript
-    def BlenderUnitTest(env, source, **kwargs):
-        test = env.Program(source, **kwargs)
-        env.AddPostAction(test, test[0].abspath)
-        env.Alias('check', test)
-        env.AlwaysBuild(test)
-        return test
+            lenv['BINARYKIND'] = binarykind
+            lenv.AddPostAction(prog,Action(AppIt,strfunction=my_appit_print))
 
     def Glob(lenv, pattern):
         path = string.replace(GetBuildPath(lenv,'SConscript'),'SConscript', '')