* Brought back special normal recalc for sculpt (only recalculates modified faces...
[blender-staging.git] / SConstruct
index 991ef3d416831363ad91f9c6a80e0bc65ded096b..eeb39e9e6125924b97575b466809b953e924c0ed 100644 (file)
@@ -56,9 +56,7 @@ nsis_build = None
 
 ##### BEGIN SETUP #####
 
-B.possible_types = ['core', 'common', 'blender', 'intern',
-                                       'international', 'game', 'game2',
-                                       'player', 'player2', 'system']
+B.possible_types = ['core', 'player', 'intern', 'extern']
 
 B.binarykind = ['blender' , 'blenderplayer']
 ##################################
@@ -115,8 +113,9 @@ if toolset:
                env.Tool('mstoolkit', ['tools'])
        else:
                env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
-               if env:
-                       btools.SetupSpawn(env)
+               # xxx commented out, as was supressing warnings under mingw..
+               #if env:
+               #       btools.SetupSpawn(env)
 else:
        env = BlenderEnvironment(ENV = os.environ)
 
@@ -249,7 +248,7 @@ if len(B.quickdebug) > 0 and printdebug != 0:
 # 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++', ' ')
+               env['LLIBS'].remove('stdc++')
        else:
                print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
 
@@ -284,6 +283,10 @@ if 'blenderlite' in B.targets:
        env['BF_NO_ELBEEM'] = True
        env['WITH_BF_PYTHON'] = False
 
+if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming'):
+       env['PLATFORM_LINKFLAGS'].remove('/ENTRY:mainCRTStartup')
+       env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
+
 # 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']
@@ -321,10 +324,15 @@ if not quickie and do_clean:
                                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']:
+                               'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
                        if os.path.exists(confile):
                                print "clean file %s"%confile
-                               os.remove(confile)
+                               if os.path.isdir(confile):
+                                       for root, dirs, files in os.walk(confile):
+                                               for name in files:
+                                                       os.remove(os.path.join(root, name))
+                               else:
+                                       os.remove(confile)
                print B.bc.OKGREEN+'...done'+B.bc.ENDC
        else:
                print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
@@ -382,10 +390,10 @@ thestatlibs, thelibincs = B.setup_staticlibs(env)
 thesyslibs = B.setup_syslibs(env)
 
 if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
-       env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
+       env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
 if env['WITH_BF_PLAYER']:
        playerlist = B.create_blender_liblist(env, 'player')
-       env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
+       env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
 
 ##### Now define some targets
 
@@ -421,8 +429,18 @@ if  env['OURPLATFORM']!='darwin':
                                dn.remove('CVS')
                        if '.svn' in dn:
                                dn.remove('.svn')
+                       
                        for f in df:
-                               dotblendlist.append(dp+os.sep+f)
+                               if not env['WITH_BF_INTERNATIONAL']:
+                                       if 'locale' in dp:
+                                               continue
+                                       if f == '.Blanguages':
+                                               continue
+                               if not env['WITH_BF_FREETYPE']:
+                                       if f.endswith('.ttf'):
+                                               continue
+                               
+                               dotblendlist.append(os.path.join(dp, f))
                                dottargetlist.append(env['BF_INSTALLDIR']+dp[3:]+os.sep+f)
 
                dotblenderinstall = []
@@ -430,16 +448,17 @@ if  env['OURPLATFORM']!='darwin':
                        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))
+               if env['WITH_BF_PYTHON']:
+                       #-- .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':
@@ -461,6 +480,13 @@ if env['OURPLATFORM']=='linux2':
                td, tf = os.path.split(targetdir)
                iconinstall.append(env.Install(dir=td, source=srcfile))
 
+# dlls for linuxcross
+# TODO - add more libs, for now this lets blenderlite run
+if env['OURPLATFORM']=='linuxcross':
+       dir=env['BF_INSTALLDIR']
+       source = ['../lib/windows/pthreads/lib/pthreadGC2.dll']
+       scriptinstall.append(env.Install(dir=dir, source=source))
+
 #-- plugins
 pluglist = []
 plugtargetlist = []
@@ -516,22 +542,21 @@ else:
 
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'):
        dllsources = ['${LCGDIR}/gettext/lib/gnu_gettext.dll',
-                                               '${LCGDIR}/png/lib/libpng.dll',
-                                               '#release/windows/extra/python25.zip',
-                                               '#release/windows/extra/zlib.pyd',
-                                               '${LCGDIR}/sdl/lib/SDL.dll',
-                                               '${LCGDIR}/zlib/lib/zlib.dll',
-                                               '${LCGDIR}/tiff/lib/libtiff.dll']
-       if env['BF_DEBUG']:
-               dllsources.append('${LCGDIR}/python/lib/${BF_PYTHON_LIB}_d.dll')
-       else:
-               dllsources.append('${LCGDIR}/python/lib/${BF_PYTHON_LIB}.dll')
-       if env['OURPLATFORM'] == 'win32-mingw':
-               dllsources += ['${LCGDIR}/pthreads/lib/pthreadGC2.dll']
-       else:
-               dllsources += ['${LCGDIR}/pthreads/lib/pthreadVC2.dll']
+                                               '${BF_PNG_LIBPATH}/libpng.dll',
+                                               '${BF_ZLIB_LIBPATH}/zlib.dll',
+                                               '${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
+       dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
+       if env['WITH_BF_SDL']:
+               dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
+       if env['WITH_BF_PYTHON']:
+               dllsources.append('#release/windows/extra/python25.zip')
+               dllsources.append('#release/windows/extra/zlib.pyd')
+               if env['BF_DEBUG']:
+                       dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}_d.dll')
+               else:
+                       dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}.dll')
        if env['WITH_BF_ICONV']:
-               dllsources += ['${LCGDIR}/iconv/lib/iconv.dll']
+               dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
        if env['WITH_BF_FFMPEG']:
                dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-51.dll',
                                                '${LCGDIR}/ffmpeg/lib/avformat-52.dll',