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