2.5 filebrowser
[blender-staging.git] / SConstruct
1 #!/usr/bin/env python
2 # $Id$
3 # ***** BEGIN GPL LICENSE BLOCK *****
4 #
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
9 #
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 #
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
21 #
22 # The Original Code is: all of this file.
23 #
24 # Contributor(s): Nathan Letwory.
25 #
26 # ***** END GPL LICENSE BLOCK *****
27 #
28 # Main entry-point for the SCons building system
29 # Set up some custom actions and target/argument handling
30 # Then read all SConscripts and build
31
32 import platform as pltfrm
33
34 if pltfrm.architecture()[0] == '64bit':
35         bitness = 64
36 else:
37         bitness = 32
38
39 import sys
40 import os
41 import os.path
42 import string
43 import shutil
44 import glob
45 import re
46 from tempfile import mkdtemp
47
48 import tools.Blender
49 import tools.btools
50 import tools.bcolors
51
52 EnsureSConsVersion(1,0,0)
53
54 BlenderEnvironment = tools.Blender.BlenderEnvironment
55 btools = tools.btools
56 B = tools.Blender
57
58 ### globals ###
59 platform = sys.platform
60 quickie = None
61 quickdebug = None
62 nsis_build = None
63
64 ##### BEGIN SETUP #####
65
66 B.possible_types = ['core', 'player', 'intern', 'extern']
67
68 B.binarykind = ['blender' , 'blenderplayer']
69 ##################################
70 # target and argument validation #
71 ##################################
72 # XX cheating for BF_FANCY, we check for BF_FANCY before args are validated
73 use_color = ARGUMENTS.get('BF_FANCY', '1')
74 if platform=='win32':
75         use_color = None
76
77 if not use_color=='1':
78         B.bc.disable()
79         
80  #on defaut white Os X terminal, some colors are totally unlegible
81 if platform=='darwin':
82         B.bc.OKGREEN = '\033[34m'
83         B.bc.WARNING = '\033[36m'
84
85 # arguments
86 print B.bc.HEADER+'Command-line arguments'+B.bc.ENDC
87 B.arguments = btools.validate_arguments(ARGUMENTS, B.bc)
88 btools.print_arguments(B.arguments, B.bc)
89
90 # targets
91 print B.bc.HEADER+'Command-line targets'+B.bc.ENDC
92 B.targets = btools.validate_targets(COMMAND_LINE_TARGETS, B.bc)
93 btools.print_targets(B.targets, B.bc)
94
95 ##########################
96 # setting up environment #
97 ##########################
98
99 # handling cmd line arguments & config file
100
101 # first check cmdline for toolset and we create env to work on
102 quickie = B.arguments.get('BF_QUICK', None)
103 quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
104
105 if quickdebug:
106         B.quickdebug=string.split(quickdebug, ',')
107 else:
108         B.quickdebug=[]
109
110 if quickie:
111         B.quickie=string.split(quickie,',')
112 else:
113         B.quickie=[]
114         
115 toolset = B.arguments.get('BF_TOOLSET', None)
116 if toolset:
117         print "Using " + toolset
118         if toolset=='mstoolkit':
119                 env = BlenderEnvironment(ENV = os.environ)
120                 env.Tool('mstoolkit', ['tools'])
121         else:
122                 env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
123                 # xxx commented out, as was supressing warnings under mingw..
124                 #if env:
125                 #       btools.SetupSpawn(env)
126 else:
127         env = BlenderEnvironment(ENV = os.environ)
128
129 if not env:
130         print "Could not create a build environment"
131         Exit()
132
133
134 cc = B.arguments.get('CC', None)
135 cxx = B.arguments.get('CXX', None)
136 if cc:
137         env['CC'] = cc
138 if cxx:
139         env['CXX'] = cxx
140
141 if env['CC'] in ['cl', 'cl.exe'] and sys.platform=='win32':
142         if bitness == 64:
143                 platform = 'win64-vc'
144         else:
145                 platform = 'win32-vc'
146 elif env['CC'] in ['gcc'] and sys.platform=='win32':
147         platform = 'win32-mingw'
148
149 env.SConscriptChdir(0)
150
151 crossbuild = B.arguments.get('BF_CROSS', None)
152 if crossbuild and platform not in ('win32-vc', 'win64-vc'):
153         platform = 'linuxcross'
154
155 env['OURPLATFORM'] = platform
156
157 configfile = 'config'+os.sep+platform+'-config.py'
158
159 if os.path.exists(configfile):
160         print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
161 else:
162         print B.bc.FAIL + configfile + " doesn't exist" + B.bc.ENDC
163
164 if crossbuild and env['PLATFORM'] != 'win32':
165         print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC
166         env.Tool('crossmingw', ['tools'])
167         # todo: determine proper libs/includes etc.
168         # Needed for gui programs, console programs should do without it
169         env.Append(LINKFLAGS=['-mwindows'])
170
171 userconfig = B.arguments.get('BF_CONFIG', 'user-config.py')
172 # first read platform config. B.arguments will override
173 optfiles = [configfile]
174 if os.path.exists(userconfig):
175         print B.bc.OKGREEN + "Using user-config file: " + B.bc.ENDC + userconfig
176         optfiles += [userconfig]
177 else:
178         print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
179
180 opts = btools.read_opts(optfiles, B.arguments)
181 opts.Update(env)
182
183 if not env['BF_FANCY']:
184         B.bc.disable()
185
186 SetOption('num_jobs', int(env['BF_NUMJOBS']))
187 print "Build with %d parallel jobs" % (GetOption('num_jobs'))
188
189 # disable elbeem (fluidsim) compilation?
190 if env['BF_NO_ELBEEM'] == 1:
191         env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
192         env['CXXFLAGS'].append('-DDISABLE_ELBEEM')
193         env['CCFLAGS'].append('-DDISABLE_ELBEEM')
194
195 if env['WITH_BF_OPENMP'] == 1:
196                 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
197                                 env['CCFLAGS'].append('/openmp')
198                                 env['CPPFLAGS'].append('/openmp')
199                                 env['CXXFLAGS'].append('/openmp')
200                 else:
201                         if env['CC'][-3:] == 'icc': # to be able to handle CC=/opt/bla/icc case
202                                 env.Append(LINKFLAGS=['-openmp', '-static-intel'])
203                                 env['CCFLAGS'].append('-openmp')
204                                 env['CPPFLAGS'].append('-openmp')
205                                 env['CXXFLAGS'].append('-openmp')
206                         else:
207                                 env.Append(CCFLAGS=['-fopenmp']) 
208                                 env.Append(CPPFLAGS=['-fopenmp'])
209                                 env.Append(CXXFLAGS=['-fopenmp'])
210                                 # env.Append(LINKFLAGS=['-fprofile-generate'])
211
212 #check for additional debug libnames
213
214 if env.has_key('BF_DEBUG_LIBS'):
215         B.quickdebug += env['BF_DEBUG_LIBS']
216
217 printdebug = B.arguments.get('BF_LISTDEBUG', 0)
218
219 # see if this linux distro has libalut
220
221 if env['OURPLATFORM'] == 'linux2' :
222         if env['WITH_BF_OPENAL']:
223                 mylib_test_source_file = """
224                 #include "AL/alut.h"
225                 int main(int argc, char **argv)
226                 {
227                         alutGetMajorVersion();
228                         return 0;
229                 }
230                 """
231
232                 def CheckFreeAlut(context,env):
233                         context.Message( B.bc.OKGREEN + "Linux platform detected:\n  checking for FreeAlut... " + B.bc.ENDC )
234                         env['LIBS'] = 'alut'
235                         result = context.TryLink(mylib_test_source_file, '.c')
236                         context.Result(result)
237                         return result
238
239                 env2 = env.Clone( LIBPATH = env['BF_OPENAL'] ) 
240                 sconf_temp = mkdtemp()
241                 conf = Configure( env2, {'CheckFreeAlut' : CheckFreeAlut}, sconf_temp, '/dev/null' )
242                 if conf.CheckFreeAlut( env2 ):
243                         env['BF_OPENAL_LIB'] += ' alut'
244                 del env2
245                 root = ''
246                 for root, dirs, files in os.walk(sconf_temp, topdown=False):
247                         for name in files:
248                                 os.remove(os.path.join(root, name))
249                         for name in dirs:
250                                 os.rmdir(os.path.join(root, name))
251                 if root: os.rmdir(root)
252
253 if len(B.quickdebug) > 0 and printdebug != 0:
254         print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
255         for l in B.quickdebug:
256                 print "\t" + l
257
258 # remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
259 if env['WITH_BF_STATICCXX']:
260         if 'stdc++' in env['LLIBS']:
261                 env['LLIBS'].remove('stdc++')
262         else:
263                 print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
264
265 # check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
266 if 'blenderplayer' in B.targets:
267         env['WITH_BF_PLAYER'] = True
268
269 if 'blendernogame' in B.targets:
270         env['WITH_BF_GAMEENGINE'] = False
271
272 if 'blenderlite' in B.targets:
273         env['WITH_BF_GAMEENGINE'] = False
274         env['WITH_BF_OPENAL'] = False
275         env['WITH_BF_OPENEXR'] = False
276         env['WITH_BF_ICONV'] = False
277         env['WITH_BF_INTERNATIONAL'] = False
278         env['WITH_BF_OPENJPEG'] = False
279         env['WITH_BF_FFMPEG'] = False
280         env['WITH_BF_QUICKTIME'] = False
281         env['WITH_BF_YAFRAY'] = False
282         env['WITH_BF_REDCODE'] = False
283         env['WITH_BF_FTGL'] = False
284         env['WITH_BF_DDS'] = False
285         env['WITH_BF_ZLIB'] = False
286         env['WITH_BF_SDL'] = False
287         env['WITH_BF_JPEG'] = False
288         env['WITH_BF_PNG'] = False
289         env['WITH_BF_ODE'] = False
290         env['WITH_BF_BULLET'] = False
291         env['WITH_BF_BINRELOC'] = False
292         env['BF_BUILDINFO'] = False
293         env['BF_NO_ELBEEM'] = True
294         env['WITH_BF_PYTHON'] = False
295
296 if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming', 'win64-vc'):
297         env['PLATFORM_LINKFLAGS'].remove('/ENTRY:mainCRTStartup')
298         env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
299
300 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
301 #B.root_build_dir = B.arguments.get('BF_BUILDDIR', '..'+os.sep+'build'+os.sep+platform+os.sep)
302 B.root_build_dir = env['BF_BUILDDIR']
303 B.doc_build_dir = env['BF_DOCDIR']
304 if not B.root_build_dir[-1]==os.sep:
305         B.root_build_dir += os.sep
306 if not B.doc_build_dir[-1]==os.sep:
307         B.doc_build_dir += os.sep
308         
309 # We do a shortcut for clean when no quicklist is given: just delete
310 # builddir without reading in SConscripts
311 do_clean = None
312 if 'clean' in B.targets:
313         do_clean = True
314
315 if not quickie and do_clean:
316         if os.path.exists(B.doc_build_dir):
317                 print B.bc.HEADER+'Cleaning doc dir...'+B.bc.ENDC
318                 dirs = os.listdir(B.doc_build_dir)
319                 for entry in dirs:
320                         if os.path.isdir(B.doc_build_dir + entry) == 1:
321                                 print "clean dir %s"%(B.doc_build_dir+entry)
322                                 shutil.rmtree(B.doc_build_dir+entry)
323                         else: # remove file
324                                 print "remove file %s"%(B.doc_build_dir+entry)
325                                 os.remove(B.root_build_dir+entry)
326         if os.path.exists(B.root_build_dir):
327                 print B.bc.HEADER+'Cleaning build dir...'+B.bc.ENDC
328                 dirs = os.listdir(B.root_build_dir)
329                 for entry in dirs:
330                         if os.path.isdir(B.root_build_dir + entry) == 1:
331                                 print "clean dir %s"%(B.root_build_dir+entry)
332                                 shutil.rmtree(B.root_build_dir+entry)
333                         else: # remove file
334                                 print "remove file %s"%(B.root_build_dir+entry)
335                                 os.remove(B.root_build_dir+entry)
336                 for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
337                                 'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
338                         if os.path.exists(confile):
339                                 print "clean file %s"%confile
340                                 if os.path.isdir(confile):
341                                         for root, dirs, files in os.walk(confile):
342                                                 for name in files:
343                                                         os.remove(os.path.join(root, name))
344                                 else:
345                                         os.remove(confile)
346                 print B.bc.OKGREEN+'...done'+B.bc.ENDC
347         else:
348                 print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
349         Exit()
350
351 if not os.path.isdir ( B.root_build_dir):
352         os.makedirs ( B.root_build_dir )
353         os.makedirs ( B.root_build_dir + 'source' )
354         os.makedirs ( B.root_build_dir + 'intern' )
355         os.makedirs ( B.root_build_dir + 'extern' )
356         os.makedirs ( B.root_build_dir + 'lib' )
357         os.makedirs ( B.root_build_dir + 'bin' )
358 if not os.path.isdir(B.doc_build_dir):
359         os.makedirs ( B.doc_build_dir )
360
361 Help(opts.GenerateHelpText(env))
362
363 # default is new quieter output, but if you need to see the 
364 # commands, do 'scons BF_QUIET=0'
365 bf_quietoutput = B.arguments.get('BF_QUIET', '1')
366 if env['BF_QUIET']:
367         B.set_quiet_output(env)
368 else:
369         if toolset=='msvc':
370                 B.msvc_hack(env)
371
372 print B.bc.HEADER+'Building in '+B.bc.ENDC+B.root_build_dir
373 env.SConsignFile(B.root_build_dir+'scons-signatures')
374 B.init_lib_dict()
375
376 ##### END SETUP ##########
377
378 Export('env')
379
380 BuildDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
381 SConscript(B.root_build_dir+'/intern/SConscript')
382 BuildDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
383 SConscript(B.root_build_dir+'/extern/SConscript')
384 BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
385 SConscript(B.root_build_dir+'/source/SConscript')
386
387 # now that we have read all SConscripts, we know what
388 # libraries will be built. Create list of
389 # libraries to give as objects to linking phase
390 mainlist = []
391 for tp in B.possible_types:
392         if not tp == 'player' and not tp == 'player2':
393                 mainlist += B.create_blender_liblist(env, tp)
394
395 if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
396         B.propose_priorities()
397
398 dobj = B.buildinfo(env, "dynamic") + B.resources
399 thestatlibs, thelibincs = B.setup_staticlibs(env)
400 thesyslibs = B.setup_syslibs(env)
401
402 if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
403         #env.BlenderProg(B.root_build_dir, "blender", dobj , [], mainlist + thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
404         env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
405 if env['WITH_BF_PLAYER']:
406         playerlist = B.create_blender_liblist(env, 'player')
407         env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
408
409 ##### Now define some targets
410
411
412 #------------ INSTALL
413
414 #-- binaries
415 blenderinstall = []
416 if  env['OURPLATFORM']=='darwin':
417         for prg in B.program_list:
418                 bundle = '%s.app' % prg[0]
419                 bundledir = os.path.dirname(bundle)
420                 for dp, dn, df in os.walk(bundle):
421                         if 'CVS' in dn:
422                                 dn.remove('CVS')
423                         if '.svn' in dn:
424                                 dn.remove('.svn')
425                         dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
426                         source=[dp+os.sep+f for f in df]
427                         blenderinstall.append(env.Install(dir=dir,source=source))
428 else:
429         blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
430
431 #-- .blender
432 #- dont do .blender and scripts for darwin, it is already in the bundle
433 dotblendlist = []
434 dottargetlist = []
435 scriptinstall = []
436
437 if  env['OURPLATFORM']!='darwin':
438                 for dp, dn, df in os.walk('bin/.blender'):
439                         if 'CVS' in dn:
440                                 dn.remove('CVS')
441                         if '.svn' in dn:
442                                 dn.remove('.svn')
443                         
444                         for f in df:
445                                 if not env['WITH_BF_INTERNATIONAL']:
446                                         if 'locale' in dp:
447                                                 continue
448                                         if f == '.Blanguages':
449                                                 continue
450                                 if not env['WITH_BF_FREETYPE']:
451                                         if f.endswith('.ttf'):
452                                                 continue
453                                 
454                                 dotblendlist.append(os.path.join(dp, f))
455                                 dottargetlist.append(env['BF_INSTALLDIR']+dp[3:]+os.sep+f)
456
457                 dotblenderinstall = []
458                 for targetdir,srcfile in zip(dottargetlist, dotblendlist):
459                         td, tf = os.path.split(targetdir)
460                         dotblenderinstall.append(env.Install(dir=td, source=srcfile))
461                 
462                 if env['WITH_BF_PYTHON']:
463                         #-- .blender/scripts    
464                         scriptpath='release/scripts'
465                         for dp, dn, df in os.walk(scriptpath):
466                                 if 'CVS' in dn:
467                                         dn.remove('CVS')
468                                 if '.svn' in dn:
469                                         dn.remove('.svn')
470                                 dir=env['BF_INSTALLDIR']+'/.blender/scripts'+dp[len(scriptpath):]
471                                 source=[dp+os.sep+f for f in df]
472                                 scriptinstall.append(env.Install(dir=dir,source=source))
473
474 #-- icons
475 if env['OURPLATFORM']=='linux2':
476         iconlist = []
477         icontargetlist = []
478
479         for tp, tn, tf in os.walk('release/freedesktop/icons'):
480                 if 'CVS' in tn:
481                         tn.remove('CVS')
482                 if '.svn' in tn:
483                         tn.remove('.svn')
484                 for f in tf:
485                         iconlist.append(tp+os.sep+f)
486                         icontargetlist.append(env['BF_INSTALLDIR']+tp[19:]+os.sep+f)
487
488         iconinstall = []
489         for targetdir,srcfile in zip(icontargetlist, iconlist):
490                 td, tf = os.path.split(targetdir)
491                 iconinstall.append(env.Install(dir=td, source=srcfile))
492
493 # dlls for linuxcross
494 # TODO - add more libs, for now this lets blenderlite run
495 if env['OURPLATFORM']=='linuxcross':
496         dir=env['BF_INSTALLDIR']
497         source = ['../lib/windows/pthreads/lib/pthreadGC2.dll']
498         scriptinstall.append(env.Install(dir=dir, source=source))
499
500 #-- plugins
501 pluglist = []
502 plugtargetlist = []
503 for tp, tn, tf in os.walk('release/plugins'):
504         if 'CVS' in tn:
505                 tn.remove('CVS')
506         if '.svn' in tn:
507                 tn.remove('.svn')
508         for f in tf:
509                 pluglist.append(tp+os.sep+f)
510                 plugtargetlist.append(env['BF_INSTALLDIR']+tp[7:]+os.sep+f)
511
512 # header files for plugins
513 pluglist.append('source/blender/blenpluginapi/documentation.h')
514 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'documentation.h')
515 pluglist.append('source/blender/blenpluginapi/externdef.h')
516 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'externdef.h')
517 pluglist.append('source/blender/blenpluginapi/floatpatch.h')
518 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'floatpatch.h')
519 pluglist.append('source/blender/blenpluginapi/iff.h')
520 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'iff.h')
521 pluglist.append('source/blender/blenpluginapi/plugin.h')
522 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'plugin.h')
523 pluglist.append('source/blender/blenpluginapi/util.h')
524 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'util.h')
525 pluglist.append('source/blender/blenpluginapi/plugin.DEF')
526 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep + 'plugin.def')
527
528 plugininstall = []
529 for targetdir,srcfile in zip(plugtargetlist, pluglist):
530         td, tf = os.path.split(targetdir)
531         plugininstall.append(env.Install(dir=td, source=srcfile))
532
533 textlist = []
534 texttargetlist = []
535 for tp, tn, tf in os.walk('release/text'):
536         if 'CVS' in tn:
537                 tn.remove('CVS')
538         if '.svn' in tn:
539                 tn.remove('.svn')
540         for f in tf:
541                 textlist.append(tp+os.sep+f)
542
543 textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
544
545 if  env['OURPLATFORM']=='darwin':
546                 allinstall = [blenderinstall, plugininstall, textinstall]
547 elif env['OURPLATFORM']=='linux2':
548                 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall]
549 else:
550                 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
551
552 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
553         if env['OURPLATFORM'] == 'win64-vc':
554                 dllsources = []
555         else:
556                 dllsources = ['${LCGDIR}/gettext/lib/gnu_gettext.dll',
557                                 '${BF_PNG_LIBPATH}/libpng.dll',
558                                 '${BF_ZLIB_LIBPATH}/zlib.dll',
559                                 '${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
560         dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
561         if env['WITH_BF_SDL']:
562                 if env['OURPLATFORM'] == 'win64-vc':
563                         pass # we link statically already to SDL on win64
564                 else:
565                         dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
566         if env['WITH_BF_PYTHON']:
567                 dllsources.append('#release/windows/extra/python25.zip')
568                 dllsources.append('#release/windows/extra/zlib.pyd')
569                 if env['BF_DEBUG']:
570                         dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}_d.dll')
571                 else:
572                         dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}.dll')
573         if env['WITH_BF_ICONV']:
574                 if env['OURPLATFORM'] == 'win64-vc':
575                         pass # we link statically to iconv on win64
576                 else:
577                         dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
578         if env['WITH_BF_FFMPEG']:
579                 dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-51.dll',
580                                                 '${LCGDIR}/ffmpeg/lib/avformat-52.dll',
581                                                 '${LCGDIR}/ffmpeg/lib/avdevice-52.dll',
582                                                 '${LCGDIR}/ffmpeg/lib/avutil-49.dll',
583                                                 '${LCGDIR}/ffmpeg/lib/libfaad-0.dll',
584                                                 '${LCGDIR}/ffmpeg/lib/libfaac-0.dll',
585                                                 '${LCGDIR}/ffmpeg/lib/libmp3lame-0.dll',
586                                                 '${LCGDIR}/ffmpeg/lib/libx264-59.dll',
587                                                 '${LCGDIR}/ffmpeg/lib/xvidcore.dll',
588                                                 '${LCGDIR}/ffmpeg/lib/swscale-0.dll']
589         windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
590         allinstall += windlls
591
592 installtarget = env.Alias('install', allinstall)
593 bininstalltarget = env.Alias('install-bin', blenderinstall)
594
595 nsisaction = env.Action(btools.NSIS_Installer, btools.NSIS_print)
596 nsiscmd = env.Command('nsisinstaller', None, nsisaction)
597 nsisalias = env.Alias('nsis', nsiscmd)
598
599 if 'blender' in B.targets:
600         blenderexe= env.Alias('blender', B.program_list)
601         Depends(blenderexe,installtarget)
602
603 if env['WITH_BF_PLAYER']:
604         blenderplayer = env.Alias('blenderplayer', B.program_list)
605         Depends(blenderplayer,installtarget)
606
607 if not env['WITH_BF_GAMEENGINE']:
608         blendernogame = env.Alias('blendernogame', B.program_list)
609         Depends(blendernogame,installtarget)
610
611 if 'blenderlite' in B.targets:
612         blenderlite = env.Alias('blenderlite', B.program_list)
613         Depends(blenderlite,installtarget)
614
615 Depends(nsiscmd, allinstall)
616
617 Default(B.program_list)
618
619 if not env['WITHOUT_BF_INSTALL']:
620                 Default(installtarget)
621
622 #------------ EPYDOC
623 if env['WITH_BF_DOCS']:
624         SConscript('source/blender/python/api2_2x/doc/SConscript')
625         SConscript('source/gameengine/PyDoc/SConscript')
626