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