2.5: UV Edit
[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 platform as pltfrm
33
34 # Need a better way to do this. Automagical maybe is not the best thing, maybe it is.
35 if pltfrm.architecture()[0] == '64bit':
36         bitness = 64
37 else:
38         bitness = 32
39
40 import sys
41 import os
42 import os.path
43 import string
44 import shutil
45 import glob
46 import re
47 from tempfile import mkdtemp
48
49 import tools.Blender
50 import tools.btools
51 import tools.bcolors
52
53 EnsureSConsVersion(1,0,0)
54
55 BlenderEnvironment = tools.Blender.BlenderEnvironment
56 btools = tools.btools
57 B = tools.Blender
58
59 ### globals ###
60 platform = sys.platform
61 quickie = None
62 quickdebug = 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
211 #check for additional debug libnames
212
213 if env.has_key('BF_DEBUG_LIBS'):
214         B.quickdebug += env['BF_DEBUG_LIBS']
215
216 printdebug = B.arguments.get('BF_LISTDEBUG', 0)
217
218 # see if this linux distro has libalut
219
220 if env['OURPLATFORM'] == 'linux2' :
221         if env['WITH_BF_OPENAL']:
222                 mylib_test_source_file = """
223                 #include "AL/alut.h"
224                 int main(int argc, char **argv)
225                 {
226                         alutGetMajorVersion();
227                         return 0;
228                 }
229                 """
230
231                 def CheckFreeAlut(context,env):
232                         context.Message( B.bc.OKGREEN + "Linux platform detected:\n  checking for FreeAlut... " + B.bc.ENDC )
233                         env['LIBS'] = 'alut'
234                         result = context.TryLink(mylib_test_source_file, '.c')
235                         context.Result(result)
236                         return result
237
238                 env2 = env.Clone( LIBPATH = env['BF_OPENAL'] ) 
239                 sconf_temp = mkdtemp()
240                 conf = Configure( env2, {'CheckFreeAlut' : CheckFreeAlut}, sconf_temp, '/dev/null' )
241                 if conf.CheckFreeAlut( env2 ):
242                         env['BF_OPENAL_LIB'] += ' alut'
243                 del env2
244                 root = ''
245                 for root, dirs, files in os.walk(sconf_temp, topdown=False):
246                         for name in files:
247                                 os.remove(os.path.join(root, name))
248                         for name in dirs:
249                                 os.rmdir(os.path.join(root, name))
250                 if root: os.rmdir(root)
251
252 if len(B.quickdebug) > 0 and printdebug != 0:
253         print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
254         for l in B.quickdebug:
255                 print "\t" + l
256
257 # remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
258 if env['WITH_BF_STATICCXX']:
259         if 'stdc++' in env['LLIBS']:
260                 env['LLIBS'].remove('stdc++')
261         else:
262                 print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
263
264 # check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
265 if 'blenderplayer' in B.targets:
266         env['WITH_BF_PLAYER'] = True
267
268 if 'blendernogame' in B.targets:
269         env['WITH_BF_GAMEENGINE'] = False
270
271 if 'blenderlite' in B.targets:
272         target_env_defs = {}
273         target_env_defs['WITH_BF_GAMEENGINE'] = False
274         target_env_defs['WITH_BF_OPENAL'] = False
275         target_env_defs['WITH_BF_OPENEXR'] = False
276         target_env_defs['WITH_BF_ICONV'] = False
277         target_env_defs['WITH_BF_INTERNATIONAL'] = False
278         target_env_defs['WITH_BF_OPENJPEG'] = False
279         target_env_defs['WITH_BF_FFMPEG'] = False
280         target_env_defs['WITH_BF_QUICKTIME'] = False
281         target_env_defs['WITH_BF_REDCODE'] = False
282         target_env_defs['WITH_BF_DDS'] = False
283         target_env_defs['WITH_BF_ZLIB'] = False
284         target_env_defs['WITH_BF_SDL'] = False
285         target_env_defs['WITH_BF_JPEG'] = False
286         target_env_defs['WITH_BF_PNG'] = False
287         target_env_defs['WITH_BF_BULLET'] = False
288         target_env_defs['WITH_BF_BINRELOC'] = False
289         target_env_defs['BF_BUILDINFO'] = False
290         target_env_defs['BF_NO_ELBEEM'] = True
291         target_env_defs['WITH_BF_PYTHON'] = False
292         
293         # Merge blenderlite, let command line to override
294         for k,v in target_env_defs.iteritems():
295                 if k not in B.arguments:
296                         env[k] = v
297
298 if env['WITH_BF_SDL'] == False and env['OURPLATFORM'] in ('win32-vc', 'win32-ming', 'win64-vc'):
299         env['PLATFORM_LINKFLAGS'].remove('/ENTRY:mainCRTStartup')
300         env['PLATFORM_LINKFLAGS'].append('/ENTRY:main')
301
302 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
303 B.root_build_dir = env['BF_BUILDDIR']
304 B.doc_build_dir = env['BF_DOCDIR']
305 if not B.root_build_dir[-1]==os.sep:
306         B.root_build_dir += os.sep
307 if not B.doc_build_dir[-1]==os.sep:
308         B.doc_build_dir += os.sep
309         
310 # We do a shortcut for clean when no quicklist is given: just delete
311 # builddir without reading in SConscripts
312 do_clean = None
313 if 'clean' in B.targets:
314         do_clean = True
315
316 if not quickie and do_clean:
317         if os.path.exists(B.doc_build_dir):
318                 print B.bc.HEADER+'Cleaning doc dir...'+B.bc.ENDC
319                 dirs = os.listdir(B.doc_build_dir)
320                 for entry in dirs:
321                         if os.path.isdir(B.doc_build_dir + entry) == 1:
322                                 print "clean dir %s"%(B.doc_build_dir+entry)
323                                 shutil.rmtree(B.doc_build_dir+entry)
324                         else: # remove file
325                                 print "remove file %s"%(B.doc_build_dir+entry)
326                                 os.remove(B.root_build_dir+entry)
327         if os.path.exists(B.root_build_dir):
328                 print B.bc.HEADER+'Cleaning build dir...'+B.bc.ENDC
329                 dirs = os.listdir(B.root_build_dir)
330                 for entry in dirs:
331                         if os.path.isdir(B.root_build_dir + entry) == 1:
332                                 print "clean dir %s"%(B.root_build_dir+entry)
333                                 shutil.rmtree(B.root_build_dir+entry)
334                         else: # remove file
335                                 print "remove file %s"%(B.root_build_dir+entry)
336                                 os.remove(B.root_build_dir+entry)
337                 for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
338                                 'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
339                         if os.path.exists(confile):
340                                 print "clean file %s"%confile
341                                 if os.path.isdir(confile):
342                                         for root, dirs, files in os.walk(confile):
343                                                 for name in files:
344                                                         os.remove(os.path.join(root, name))
345                                 else:
346                                         os.remove(confile)
347                 print B.bc.OKGREEN+'...done'+B.bc.ENDC
348         else:
349                 print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
350         Exit()
351
352 if not os.path.isdir ( B.root_build_dir):
353         os.makedirs ( B.root_build_dir )
354         os.makedirs ( B.root_build_dir + 'source' )
355         os.makedirs ( B.root_build_dir + 'intern' )
356         os.makedirs ( B.root_build_dir + 'extern' )
357         os.makedirs ( B.root_build_dir + 'lib' )
358         os.makedirs ( B.root_build_dir + 'bin' )
359 if not os.path.isdir(B.doc_build_dir):
360         os.makedirs ( B.doc_build_dir )
361
362 Help(opts.GenerateHelpText(env))
363
364 # default is new quieter output, but if you need to see the 
365 # commands, do 'scons BF_QUIET=0'
366 bf_quietoutput = B.arguments.get('BF_QUIET', '1')
367 if env['BF_QUIET']:
368         B.set_quiet_output(env)
369 else:
370         if toolset=='msvc':
371                 B.msvc_hack(env)
372
373 print B.bc.HEADER+'Building in '+B.bc.ENDC+B.root_build_dir
374 env.SConsignFile(B.root_build_dir+'scons-signatures')
375 B.init_lib_dict()
376
377 ##### END SETUP ##########
378
379 Export('env')
380
381 BuildDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
382 SConscript(B.root_build_dir+'/intern/SConscript')
383 BuildDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
384 SConscript(B.root_build_dir+'/extern/SConscript')
385 BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
386 SConscript(B.root_build_dir+'/source/SConscript')
387
388 # now that we have read all SConscripts, we know what
389 # libraries will be built. Create list of
390 # libraries to give as objects to linking phase
391 mainlist = []
392 for tp in B.possible_types:
393         if not tp == 'player':
394                 mainlist += B.create_blender_liblist(env, tp)
395
396 if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
397         B.propose_priorities()
398
399 dobj = B.buildinfo(env, "dynamic") + B.resources
400 thestatlibs, thelibincs = B.setup_staticlibs(env)
401 thesyslibs = B.setup_syslibs(env)
402
403 if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
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         playerlist += B.create_blender_liblist(env, 'intern')
408         playerlist += B.create_blender_liblist(env, 'extern')
409         env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist, [], thestatlibs + thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
410
411 ##### Now define some targets
412
413
414 #------------ INSTALL
415
416 #-- binaries
417 blenderinstall = []
418 if  env['OURPLATFORM']=='darwin':
419         for prg in B.program_list:
420                 bundle = '%s.app' % prg[0]
421                 bundledir = os.path.dirname(bundle)
422                 for dp, dn, df in os.walk(bundle):
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 '.svn' in dn:
440                                 dn.remove('.svn')
441                         
442                         for f in df:
443                                 if not env['WITH_BF_INTERNATIONAL']:
444                                         if 'locale' in dp:
445                                                 continue
446                                         if f == '.Blanguages':
447                                                 continue
448                                 if not env['WITH_BF_FREETYPE']:
449                                         if f.endswith('.ttf'):
450                                                 continue
451                                 
452                                 dotblendlist.append(os.path.join(dp, f))
453                                 dottargetlist.append(env['BF_INSTALLDIR']+dp[3:]+os.sep+f)
454
455                 dotblenderinstall = []
456                 for targetdir,srcfile in zip(dottargetlist, dotblendlist):
457                         td, tf = os.path.split(targetdir)
458                         dotblenderinstall.append(env.Install(dir=td, source=srcfile))
459                 
460                 if env['WITH_BF_PYTHON']:
461                         #-- .blender/scripts, .blender/ui, .blender/io
462                         scriptpaths=['release/scripts', 'release/ui', 'release/io']
463                         for scriptpath in scriptpaths:
464                                 for dp, dn, df in os.walk(scriptpath):
465                                         if '.svn' in dn:
466                                                 dn.remove('.svn')
467                                         dir=env['BF_INSTALLDIR']+'/.blender/'+os.path.basename(scriptpath)+dp[len(scriptpath):]
468                                         source=[dp+os.sep+f for f in df]
469                                         scriptinstall.append(env.Install(dir=dir,source=source))
470
471 #-- icons
472 if env['OURPLATFORM']=='linux2':
473         iconlist = []
474         icontargetlist = []
475
476         for tp, tn, tf in os.walk('release/freedesktop/icons'):
477                 if '.svn' in tn:
478                         tn.remove('.svn')
479                 for f in tf:
480                         iconlist.append(tp+os.sep+f)
481                         icontargetlist.append(env['BF_INSTALLDIR']+tp[19:]+os.sep+f)
482
483         iconinstall = []
484         for targetdir,srcfile in zip(icontargetlist, iconlist):
485                 td, tf = os.path.split(targetdir)
486                 iconinstall.append(env.Install(dir=td, source=srcfile))
487
488 # dlls for linuxcross
489 # TODO - add more libs, for now this lets blenderlite run
490 if env['OURPLATFORM']=='linuxcross':
491         dir=env['BF_INSTALLDIR']
492         source = ['../lib/windows/pthreads/lib/pthreadGC2.dll']
493         scriptinstall.append(env.Install(dir=dir, source=source))
494
495 #-- plugins
496 pluglist = []
497 plugtargetlist = []
498 for tp, tn, tf in os.walk('release/plugins'):
499         if '.svn' in tn:
500                 tn.remove('.svn')
501         for f in tf:
502                 pluglist.append(tp+os.sep+f)
503                 plugtargetlist.append(env['BF_INSTALLDIR']+tp[7:]+os.sep+f)
504
505 # header files for plugins
506 pluglist.append('source/blender/blenpluginapi/documentation.h')
507 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'documentation.h')
508 pluglist.append('source/blender/blenpluginapi/externdef.h')
509 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'externdef.h')
510 pluglist.append('source/blender/blenpluginapi/floatpatch.h')
511 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'floatpatch.h')
512 pluglist.append('source/blender/blenpluginapi/iff.h')
513 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'iff.h')
514 pluglist.append('source/blender/blenpluginapi/plugin.h')
515 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'plugin.h')
516 pluglist.append('source/blender/blenpluginapi/util.h')
517 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep +'util.h')
518 pluglist.append('source/blender/blenpluginapi/plugin.DEF')
519 plugtargetlist.append(env['BF_INSTALLDIR'] + os.sep + 'plugins' + os.sep + 'include' + os.sep + 'plugin.def')
520
521 plugininstall = []
522 for targetdir,srcfile in zip(plugtargetlist, pluglist):
523         td, tf = os.path.split(targetdir)
524         plugininstall.append(env.Install(dir=td, source=srcfile))
525
526 textlist = []
527 texttargetlist = []
528 for tp, tn, tf in os.walk('release/text'):
529         if '.svn' in tn:
530                 tn.remove('.svn')
531         for f in tf:
532                 textlist.append(tp+os.sep+f)
533
534 textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
535
536 if  env['OURPLATFORM']=='darwin':
537                 allinstall = [blenderinstall, plugininstall, textinstall]
538 elif env['OURPLATFORM']=='linux2':
539                 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall]
540 else:
541                 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
542
543 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc'):
544         if env['OURPLATFORM'] == 'win64-vc':
545                 dllsources = []
546         else:
547                 dllsources = ['${LCGDIR}/gettext/lib/gnu_gettext.dll',
548                                 '${BF_PNG_LIBPATH}/libpng.dll',
549                                 '${BF_ZLIB_LIBPATH}/zlib.dll',
550                                 '${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
551         dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
552         if env['WITH_BF_SDL']:
553                 if env['OURPLATFORM'] == 'win64-vc':
554                         pass # we link statically already to SDL on win64
555                 else:
556                         dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
557         if env['WITH_BF_PYTHON']:
558                 ver = env["BF_PYTHON_VERSION"].replace(".", "")
559                 
560                 dllsources.append('${LCGDIR}/release/python' + ver + '.zip')
561                 dllsources.append('${LCGDIR}/release/zlib.pyd')
562                 if env['BF_DEBUG']:
563                         dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}_d.dll')
564                 else:
565                         dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}.dll')
566         if env['WITH_BF_ICONV']:
567                 if env['OURPLATFORM'] == 'win64-vc':
568                         pass # we link statically to iconv on win64
569                 else:
570                         dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
571         if env['WITH_BF_OPENAL']:
572                 dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
573                 dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
574         if env['WITH_BF_SNDFILE']:
575                 dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
576         if env['WITH_BF_FFMPEG']:
577                 dllsources += ['${LCGDIR}/ffmpeg/lib/avcodec-52.dll',
578                                                 '${LCGDIR}/ffmpeg/lib/avformat-52.dll',
579                                                 '${LCGDIR}/ffmpeg/lib/avdevice-52.dll',
580                                                 '${LCGDIR}/ffmpeg/lib/avutil-50.dll',
581                                                 '${LCGDIR}/ffmpeg/lib/swscale-0.dll']
582         if env['WITH_BF_JACK']:
583                 dllsources += ['${LCGDIR}/jack/lib/libjack.dll']
584         windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
585         allinstall += windlls
586
587 installtarget = env.Alias('install', allinstall)
588 bininstalltarget = env.Alias('install-bin', blenderinstall)
589
590 nsisaction = env.Action(btools.NSIS_Installer, btools.NSIS_print)
591 nsiscmd = env.Command('nsisinstaller', None, nsisaction)
592 nsisalias = env.Alias('nsis', nsiscmd)
593
594 if 'blender' in B.targets:
595         blenderexe= env.Alias('blender', B.program_list)
596         Depends(blenderexe,installtarget)
597
598 if env['WITH_BF_PLAYER']:
599         blenderplayer = env.Alias('blenderplayer', B.program_list)
600         Depends(blenderplayer,installtarget)
601
602 if not env['WITH_BF_GAMEENGINE']:
603         blendernogame = env.Alias('blendernogame', B.program_list)
604         Depends(blendernogame,installtarget)
605
606 if 'blenderlite' in B.targets:
607         blenderlite = env.Alias('blenderlite', B.program_list)
608         Depends(blenderlite,installtarget)
609
610 Depends(nsiscmd, allinstall)
611
612 Default(B.program_list)
613
614 if not env['WITHOUT_BF_INSTALL']:
615                 Default(installtarget)
616
617 #------------ EPYDOC
618 if env['WITH_BF_DOCS']:
619         try:            import epydoc
620         except: epydoc = None
621         
622         if epydoc:
623                 SConscript('source/blender/python/api2_2x/doc/SConscript')
624                 SConscript('source/gameengine/PyDoc/SConscript')
625         else:
626                 print "No epydoc install detected, Python API and Gameengine API Docs will not be generated "
627         
628