3 # ***** BEGIN GPL LICENSE BLOCK *****
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.
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.
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.
19 # The Original Code is Copyright (C) 2006, Blender Foundation
20 # All rights reserved.
22 # The Original Code is: all of this file.
24 # Contributor(s): Nathan Letwory.
26 # ***** END GPL LICENSE BLOCK *****
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
32 # TODO: fix /FORCE:MULTIPLE on windows to get proper debug builds.
33 # TODO: cleanup CCFLAGS / CPPFLAGS use, often both are set when we only need one.
35 import platform as pltfrm
37 # Need a better way to do this. Automagical maybe is not the best thing, maybe it is.
38 if pltfrm.architecture()[0] == '64bit':
50 from tempfile import mkdtemp
53 toolpath=os.path.join(".", "build_files", "scons", "tools")
55 # needed for importing tools
56 sys.path.append(toolpath)
62 EnsureSConsVersion(1,0,0)
64 # Before we do anything, let's check if we have a sane os.environ
65 if not btools.check_environ():
68 BlenderEnvironment = Blender.BlenderEnvironment
71 VERSION = btools.VERSION # This is used in creating the local config directories
74 platform = sys.platform
78 ##### BEGIN SETUP #####
80 B.possible_types = ['core', 'player', 'player2', 'intern', 'extern']
82 B.binarykind = ['blender' , 'blenderplayer']
83 ##################################
84 # target and argument validation #
85 ##################################
86 # XX cheating for BF_FANCY, we check for BF_FANCY before args are validated
87 use_color = ARGUMENTS.get('BF_FANCY', '1')
91 if not use_color=='1':
94 #on defaut white Os X terminal, some colors are totally unlegible
95 if platform=='darwin':
96 B.bc.OKGREEN = '\033[34m'
97 B.bc.WARNING = '\033[36m'
100 print B.bc.HEADER+'Command-line arguments'+B.bc.ENDC
101 B.arguments = btools.validate_arguments(ARGUMENTS, B.bc)
102 btools.print_arguments(B.arguments, B.bc)
105 print B.bc.HEADER+'Command-line targets'+B.bc.ENDC
106 B.targets = btools.validate_targets(COMMAND_LINE_TARGETS, B.bc)
107 btools.print_targets(B.targets, B.bc)
109 ##########################
110 # setting up environment #
111 ##########################
113 # handling cmd line arguments & config file
116 tempbitness = int(B.arguments.get('BF_BITNESS', bitness)) # default to bitness found as per starting python
117 if tempbitness in (32, 64): # only set if 32 or 64 has been given
118 bitness = int(tempbitness)
120 # first check cmdline for toolset and we create env to work on
121 quickie = B.arguments.get('BF_QUICK', None)
122 quickdebug = B.arguments.get('BF_QUICKDEBUG', None)
125 B.quickdebug=string.split(quickdebug, ',')
130 B.quickie=string.split(quickie,',')
134 toolset = B.arguments.get('BF_TOOLSET', None)
136 print "Using " + toolset
137 if toolset=='mstoolkit':
138 env = BlenderEnvironment(ENV = os.environ)
139 env.Tool('mstoolkit', [toolpath])
141 env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
142 # xxx commented out, as was supressing warnings under mingw..
144 # btools.SetupSpawn(env)
146 if bitness==64 and platform=='win32':
147 env = BlenderEnvironment(ENV = os.environ, MSVS_ARCH='amd64')
149 env = BlenderEnvironment(ENV = os.environ)
152 print "Could not create a build environment"
155 cc = B.arguments.get('CC', None)
156 cxx = B.arguments.get('CXX', None)
162 if sys.platform=='win32':
163 if env['CC'] in ['cl', 'cl.exe']:
164 platform = 'win64-vc' if bitness == 64 else 'win32-vc'
165 elif env['CC'] in ['gcc']:
166 platform = 'win32-mingw'
168 env.SConscriptChdir(0)
170 # Remove major kernel version from linux platform.
171 # After Linus switched kernel to new version model this major version
172 # shouldn't take much sense for building rules.
174 if re.match('linux[0-9]+', platform):
177 crossbuild = B.arguments.get('BF_CROSS', None)
178 if crossbuild and platform not in ('win32-vc', 'win64-vc'):
179 platform = 'linuxcross'
181 env['OURPLATFORM'] = platform
183 configfile = os.path.join("build_files", "scons", "config", platform + "-config.py")
185 if os.path.exists(configfile):
186 print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
188 print B.bc.FAIL + configfile + " doesn't exist" + B.bc.ENDC
190 if crossbuild and env['PLATFORM'] != 'win32':
191 print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC
192 env.Tool('crossmingw', [toolpath])
193 # todo: determine proper libs/includes etc.
194 # Needed for gui programs, console programs should do without it
196 # Now we don't need this option to have console window
197 # env.Append(LINKFLAGS=['-mwindows'])
199 userconfig = B.arguments.get('BF_CONFIG', 'user-config.py')
200 # first read platform config. B.arguments will override
201 optfiles = [configfile]
202 if os.path.exists(userconfig):
203 print B.bc.OKGREEN + "Using user-config file: " + B.bc.ENDC + userconfig
204 optfiles += [userconfig]
206 print B.bc.WARNING + userconfig + " not found, no user overrides" + B.bc.ENDC
208 opts = btools.read_opts(env, optfiles, B.arguments)
211 if sys.platform=='win32':
213 env.Append(CFLAGS=['-DWIN64']) # -DWIN32 needed too, as it's used all over to target Windows generally
215 if not env['BF_FANCY']:
219 # remove install dir so old and new files are not mixed.
220 # NOTE: only do the scripts directory for now, otherwise is too disruptive for developers
221 # TODO: perhaps we need an option (off by default) to not do this altogether...
222 if not env['WITHOUT_BF_INSTALL'] and not env['WITHOUT_BF_OVERWRITE_INSTALL']:
223 scriptsDir = os.path.join(env['BF_INSTALLDIR'], VERSION, 'scripts')
224 if os.path.isdir(scriptsDir):
225 print B.bc.OKGREEN + "Clearing installation directory%s: %s" % (B.bc.ENDC, os.path.abspath(scriptsDir))
226 shutil.rmtree(scriptsDir)
229 SetOption('num_jobs', int(env['BF_NUMJOBS']))
230 print B.bc.OKGREEN + "Build with parallel jobs%s: %s" % (B.bc.ENDC, GetOption('num_jobs'))
231 print B.bc.OKGREEN + "Build with debug symbols%s: %s" % (B.bc.ENDC, env['BF_DEBUG'])
233 if 'blenderlite' in B.targets:
235 target_env_defs['WITH_BF_GAMEENGINE'] = False
236 target_env_defs['WITH_BF_OPENAL'] = False
237 target_env_defs['WITH_BF_OPENEXR'] = False
238 target_env_defs['WITH_BF_OPENMP'] = False
239 target_env_defs['WITH_BF_ICONV'] = False
240 target_env_defs['WITH_BF_INTERNATIONAL'] = False
241 target_env_defs['WITH_BF_OPENJPEG'] = False
242 target_env_defs['WITH_BF_FFMPEG'] = False
243 target_env_defs['WITH_BF_QUICKTIME'] = False
244 target_env_defs['WITH_BF_REDCODE'] = False
245 target_env_defs['WITH_BF_DDS'] = False
246 target_env_defs['WITH_BF_CINEON'] = False
247 target_env_defs['WITH_BF_HDR'] = False
248 target_env_defs['WITH_BF_ZLIB'] = False
249 target_env_defs['WITH_BF_SDL'] = False
250 target_env_defs['WITH_BF_JPEG'] = False
251 target_env_defs['WITH_BF_PNG'] = False
252 target_env_defs['WITH_BF_BULLET'] = False
253 target_env_defs['WITH_BF_BINRELOC'] = False
254 target_env_defs['BF_BUILDINFO'] = False
255 target_env_defs['BF_NO_ELBEEM'] = True
256 target_env_defs['WITH_BF_PYTHON'] = False
257 target_env_defs['WITH_BF_3DMOUSE'] = False
259 # Merge blenderlite, let command line to override
260 for k,v in target_env_defs.iteritems():
261 if k not in B.arguments:
264 # Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY detection for OSX
265 if env['OURPLATFORM']=='darwin':
266 print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'][:9] + " --"
267 print "Available " + env['MACOSX_SDK_CHECK']
268 if not 'Mac OS X 10.5' in env['MACOSX_SDK_CHECK']:
269 print B.bc.OKGREEN + "MacOSX10.5.sdk not available:" + B.bc.ENDC + " using MacOSX10.6.sdk"
271 print B.bc.OKGREEN + "Found recommended sdk :" + B.bc.ENDC + " using MacOSX10.5.sdk"
273 # for now, Mac builders must download and install the 3DxWare 10 Beta 4 driver framework from 3Dconnexion
274 # necessary header file lives here when installed:
275 # /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h
276 if env['WITH_BF_3DMOUSE'] == 1:
277 if not os.path.exists('/Library/Frameworks/3DconnexionClient.framework'):
278 print "3D_CONNEXION_CLIENT_LIBRARY not found, disabling WITH_BF_3DMOUSE" # avoid build errors !
279 env['WITH_BF_3DMOUSE'] = 0
281 env.Append(LINKFLAGS=['-Xlinker','-weak_framework','-Xlinker','3DconnexionClient'])
283 if env['WITH_BF_OPENMP'] == 1:
284 if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
285 env['CCFLAGS'].append('/openmp')
286 env['CPPFLAGS'].append('/openmp')
288 if env['CC'].endswith('icc'): # to be able to handle CC=/opt/bla/icc case
289 env.Append(LINKFLAGS=['-openmp', '-static-intel'])
290 env['CCFLAGS'].append('-openmp')
291 env['CPPFLAGS'].append('-openmp')
293 env.Append(CCFLAGS=['-fopenmp'])
294 env.Append(CPPFLAGS=['-fopenmp'])
296 if env['WITH_GHOST_COCOA'] == True:
297 env.Append(CFLAGS=['-DGHOST_COCOA'])
298 env.Append(CPPFLAGS=['-DGHOST_COCOA'])
300 if env['USE_QTKIT'] == True:
301 env.Append(CFLAGS=['-DUSE_QTKIT'])
302 env.Append(CPPFLAGS=['-DUSE_QTKIT'])
304 #check for additional debug libnames
306 if env.has_key('BF_DEBUG_LIBS'):
307 B.quickdebug += env['BF_DEBUG_LIBS']
309 printdebug = B.arguments.get('BF_LISTDEBUG', 0)
311 if len(B.quickdebug) > 0 and printdebug != 0:
312 print B.bc.OKGREEN + "Buildings these libs with debug symbols:" + B.bc.ENDC
313 for l in B.quickdebug:
316 # remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
317 if env['WITH_BF_STATICCXX']:
318 if 'stdc++' in env['LLIBS']:
319 env['LLIBS'].remove('stdc++')
321 print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
323 # check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
324 if 'blenderplayer' in B.targets:
325 env['WITH_BF_PLAYER'] = True
327 if 'blendernogame' in B.targets:
328 env['WITH_BF_GAMEENGINE'] = False
330 # disable elbeem (fluidsim) compilation?
331 if env['BF_NO_ELBEEM'] == 1:
332 env['CPPFLAGS'].append('-DDISABLE_ELBEEM')
333 env['CCFLAGS'].append('-DDISABLE_ELBEEM')
336 if btools.ENDIAN == "big":
337 env['CPPFLAGS'].append('-D__BIG_ENDIAN__')
338 env['CCFLAGS'].append('-D__BIG_ENDIAN__')
340 env['CPPFLAGS'].append('-D__LITTLE_ENDIAN__')
341 env['CCFLAGS'].append('-D__LITTLE_ENDIAN__')
344 # TODO, make optional
345 env['CPPFLAGS'].append('-DWITH_AUDASPACE')
346 env['CCFLAGS'].append('-DWITH_AUDASPACE')
348 # lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
349 B.root_build_dir = env['BF_BUILDDIR']
350 B.doc_build_dir = os.path.join(env['BF_INSTALLDIR'], 'doc')
351 if not B.root_build_dir[-1]==os.sep:
352 B.root_build_dir += os.sep
353 if not B.doc_build_dir[-1]==os.sep:
354 B.doc_build_dir += os.sep
356 # We do a shortcut for clean when no quicklist is given: just delete
357 # builddir without reading in SConscripts
359 if 'clean' in B.targets:
362 if not quickie and do_clean:
363 if os.path.exists(B.doc_build_dir):
364 print B.bc.HEADER+'Cleaning doc dir...'+B.bc.ENDC
365 dirs = os.listdir(B.doc_build_dir)
367 if os.path.isdir(B.doc_build_dir + entry) == 1:
368 print "clean dir %s"%(B.doc_build_dir+entry)
369 shutil.rmtree(B.doc_build_dir+entry)
371 print "remove file %s"%(B.doc_build_dir+entry)
372 os.remove(B.root_build_dir+entry)
373 if os.path.exists(B.root_build_dir):
374 print B.bc.HEADER+'Cleaning build dir...'+B.bc.ENDC
375 dirs = os.listdir(B.root_build_dir)
377 if os.path.isdir(B.root_build_dir + entry) == 1:
378 print "clean dir %s"%(B.root_build_dir+entry)
379 shutil.rmtree(B.root_build_dir+entry)
381 print "remove file %s"%(B.root_build_dir+entry)
382 os.remove(B.root_build_dir+entry)
383 for confile in ['extern/ffmpeg/config.mak', 'extern/x264/config.mak',
384 'extern/xvidcore/build/generic/platform.inc', 'extern/ffmpeg/include']:
385 if os.path.exists(confile):
386 print "clean file %s"%confile
387 if os.path.isdir(confile):
388 for root, dirs, files in os.walk(confile):
390 os.remove(os.path.join(root, name))
393 print B.bc.OKGREEN+'...done'+B.bc.ENDC
395 print B.bc.HEADER+'Already Clean, nothing to do.'+B.bc.ENDC
399 # ensure python header is found since detection can fail, this could happen
400 # with _any_ library but since we used a fixed python version this tends to
401 # be most problematic.
402 if env['WITH_BF_PYTHON']:
403 py_h = os.path.join(Dir(env.subst('${BF_PYTHON_INC}')).abspath, "Python.h")
405 if not os.path.exists(py_h):
406 print("\nMissing: \"" + env.subst('${BF_PYTHON_INC}') + os.sep + "Python.h\",\n"
407 " Set 'BF_PYTHON_INC' to point "
408 "to a valid python include path.\n Containing "
409 "Python.h for python version \"" + env.subst('${BF_PYTHON_VERSION}') + "\"")
415 if not os.path.isdir ( B.root_build_dir):
416 os.makedirs ( B.root_build_dir )
417 os.makedirs ( B.root_build_dir + 'source' )
418 os.makedirs ( B.root_build_dir + 'intern' )
419 os.makedirs ( B.root_build_dir + 'extern' )
420 os.makedirs ( B.root_build_dir + 'lib' )
421 os.makedirs ( B.root_build_dir + 'bin' )
422 # # Docs not working with epy anymore
423 # if not os.path.isdir(B.doc_build_dir) and env['WITH_BF_DOCS']:
424 # os.makedirs ( B.doc_build_dir )
426 Help(opts.GenerateHelpText(env))
428 # default is new quieter output, but if you need to see the
429 # commands, do 'scons BF_QUIET=0'
430 bf_quietoutput = B.arguments.get('BF_QUIET', '1')
432 B.set_quiet_output(env)
437 print B.bc.HEADER+'Building in: ' + B.bc.ENDC + os.path.abspath(B.root_build_dir)
438 env.SConsignFile(B.root_build_dir+'scons-signatures')
441 ##### END SETUP ##########
445 BuildDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
446 SConscript(B.root_build_dir+'/intern/SConscript')
447 BuildDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
448 SConscript(B.root_build_dir+'/extern/SConscript')
449 BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
450 SConscript(B.root_build_dir+'/source/SConscript')
452 # now that we have read all SConscripts, we know what
453 # libraries will be built. Create list of
454 # libraries to give as objects to linking phase
456 for tp in B.possible_types:
457 if (not tp == 'player') and (not tp == 'player2'):
458 mainlist += B.create_blender_liblist(env, tp)
460 if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
461 B.propose_priorities()
463 dobj = B.buildinfo(env, "dynamic") + B.resources
464 creob = B.creator(env)
465 thestatlibs, thelibincs = B.setup_staticlibs(env)
466 thesyslibs = B.setup_syslibs(env)
468 if 'blender' in B.targets or not env['WITH_BF_NOBLENDER']:
469 env.BlenderProg(B.root_build_dir, "blender", creob + mainlist + thestatlibs + dobj, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blender')
470 if env['WITH_BF_PLAYER']:
471 playerlist = B.create_blender_liblist(env, 'player')
472 playerlist += B.create_blender_liblist(env, 'player2')
473 playerlist += B.create_blender_liblist(env, 'intern')
474 playerlist += B.create_blender_liblist(env, 'extern')
475 env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, thesyslibs, [B.root_build_dir+'/lib'] + thelibincs, 'blenderplayer')
477 ##### Now define some targets
480 #------------ INSTALL
484 if env['OURPLATFORM']=='darwin':
485 for prg in B.program_list:
486 bundle = '%s.app' % prg[0]
487 bundledir = os.path.dirname(bundle)
488 for dp, dn, df in os.walk(bundle):
493 dir=env['BF_INSTALLDIR']+dp[len(bundledir):]
494 source=[dp+os.sep+f for f in df]
495 blenderinstall.append(env.Install(dir=dir,source=source))
497 blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
499 #-- local path = config files in install dir: installdir\VERSION
500 #- dont do config and scripts for darwin, it is already in the bundle
503 datafilestargetlist = []
507 if env['OURPLATFORM']!='darwin':
508 for dp, dn, df in os.walk('release/bin/.blender'):
509 dp = os.path.normpath(dp)
517 # This files aren't used anymore
518 if f in (".bfont.ttf", ):
521 if not env['WITH_BF_INTERNATIONAL']:
524 if not env['WITH_BF_FREETYPE']:
525 if f.endswith('.ttf'):
528 if 'locale' in dp or 'fonts' in dp:
529 datafileslist.append(os.path.join(dp,f))
530 dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['datafiles'] + dp.split(os.sep)[3:])) # skip bin
531 datafilestargetlist.append(dir + os.sep + f)
534 dotblendlist.append(os.path.join(dp, f))
535 dir= os.path.join(*([env['BF_INSTALLDIR']] + [VERSION] + ['config'] + dp.split(os.sep)[3:])) # skip bin
536 dottargetlist.append(dir + os.sep + f)
538 dotblenderinstall = []
539 for targetdir,srcfile in zip(dottargetlist, dotblendlist):
540 td, tf = os.path.split(targetdir)
541 dotblenderinstall.append(env.Install(dir=td, source=srcfile))
542 for targetdir,srcfile in zip(datafilestargetlist, datafileslist):
543 td, tf = os.path.split(targetdir)
544 dotblenderinstall.append(env.Install(dir=td, source=srcfile))
546 if env['WITH_BF_PYTHON']:
547 #-- local/VERSION/scripts
548 scriptpaths=['release/scripts']
549 for scriptpath in scriptpaths:
550 for dp, dn, df in os.walk(scriptpath):
555 if '__pycache__' in dn: # py3.2 cache dir
556 dn.remove('__pycache__')
558 dir = os.path.join(env['BF_INSTALLDIR'], VERSION)
559 dir += os.sep + os.path.basename(scriptpath) + dp[len(scriptpath):]
561 source=[os.path.join(dp, f) for f in df if not f.endswith(".pyc")]
562 # To ensure empty dirs are created too
564 env.Execute(Mkdir(dir))
565 scriptinstall.append(env.Install(dir=dir,source=source))
568 if env['OURPLATFORM']=='linux':
572 for tp, tn, tf in os.walk('release/freedesktop/icons'):
578 iconlist.append(os.path.join(tp, f))
579 icontargetlist.append( os.path.join(*([env['BF_INSTALLDIR']] + tp.split(os.sep)[2:] + [f])) )
582 for targetdir,srcfile in zip(icontargetlist, iconlist):
583 td, tf = os.path.split(targetdir)
584 iconinstall.append(env.Install(dir=td, source=srcfile))
586 # dlls for linuxcross
587 # TODO - add more libs, for now this lets blenderlite run
588 if env['OURPLATFORM']=='linuxcross':
589 dir=env['BF_INSTALLDIR']
592 if env['WITH_BF_OPENMP']:
593 source += ['../lib/windows/pthreads/lib/pthreadGC2.dll']
595 scriptinstall.append(env.Install(dir=dir, source=source))
600 for tp, tn, tf in os.walk('release/plugins'):
605 df = tp[8:] # remove 'release/'
607 pluglist.append(os.path.join(tp, f))
608 plugtargetlist.append( os.path.join(env['BF_INSTALLDIR'], VERSION, df, f) )
611 # header files for plugins
612 pluglist.append('source/blender/blenpluginapi/documentation.h')
613 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'documentation.h'))
614 pluglist.append('source/blender/blenpluginapi/externdef.h')
615 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'externdef.h'))
616 pluglist.append('source/blender/blenpluginapi/floatpatch.h')
617 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'floatpatch.h'))
618 pluglist.append('source/blender/blenpluginapi/iff.h')
619 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'iff.h'))
620 pluglist.append('source/blender/blenpluginapi/plugin.h')
621 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'plugin.h'))
622 pluglist.append('source/blender/blenpluginapi/util.h')
623 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'util.h'))
624 pluglist.append('source/blender/blenpluginapi/plugin.DEF')
625 plugtargetlist.append(os.path.join(env['BF_INSTALLDIR'], VERSION, 'plugins', 'include', 'plugin.def'))
628 # plugins in blender 2.5 don't work at the moment.
629 #for targetdir,srcfile in zip(plugtargetlist, pluglist):
630 # td, tf = os.path.split(targetdir)
631 # plugininstall.append(env.Install(dir=td, source=srcfile))
635 for tp, tn, tf in os.walk('release/text'):
641 textlist.append(tp+os.sep+f)
643 textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
645 if env['OURPLATFORM']=='darwin':
646 allinstall = [blenderinstall, plugininstall, textinstall]
647 elif env['OURPLATFORM']=='linux':
648 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall, iconinstall]
650 allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
652 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'win64-vc', 'linuxcross'):
655 if not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
656 # For MinGW and linuxcross static linking will be used
657 dllsources += ['${LCGDIR}/gettext/lib/gnu_gettext.dll']
659 #currently win64-vc doesn't appear to have libpng.dll
660 if env['OURPLATFORM'] != 'win64-vc':
661 dllsources += ['${BF_PNG_LIBPATH}/libpng.dll']
663 dllsources += ['${BF_ZLIB_LIBPATH}/zlib.dll']
664 # Used when linking to libtiff was dynamic
665 # keep it here until compilation on all platform would be ok
666 # dllsources += ['${BF_TIFF_LIBPATH}/${BF_TIFF_LIB}.dll']
668 if env['OURPLATFORM'] != 'linuxcross':
669 # pthreads library is already added
670 dllsources += ['${BF_PTHREADS_LIBPATH}/${BF_PTHREADS_LIB}.dll']
672 if env['WITH_BF_SDL']:
673 if env['OURPLATFORM'] == 'win64-vc':
674 pass # we link statically already to SDL on win64
676 dllsources.append('${BF_SDL_LIBPATH}/SDL.dll')
678 if env['WITH_BF_PYTHON']:
680 dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}_d.dll')
682 dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_DLL}.dll')
684 if env['WITH_BF_ICONV']:
685 if env['OURPLATFORM'] == 'win64-vc':
686 pass # we link statically to iconv on win64
687 elif not env['OURPLATFORM'] in ('win32-mingw', 'linuxcross'):
688 #gettext for MinGW and cross-compilation is compiled staticly
689 dllsources += ['${BF_ICONV_LIBPATH}/iconv.dll']
691 if env['WITH_BF_OPENAL']:
692 dllsources.append('${LCGDIR}/openal/lib/OpenAL32.dll')
693 dllsources.append('${LCGDIR}/openal/lib/wrap_oal.dll')
695 if env['WITH_BF_SNDFILE']:
696 dllsources.append('${LCGDIR}/sndfile/lib/libsndfile-1.dll')
698 if env['WITH_BF_FFMPEG']:
699 dllsources += env['BF_FFMPEG_DLL'].split()
701 # Since the thumb handler is loaded by Explorer, architecture is
702 # strict: the x86 build fails on x64 Windows. We need to ship
703 # both builds in x86 packages.
705 dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb.dll')
706 dllsources.append('${LCGDIR}/thumbhandler/lib/BlendThumb64.dll')
708 dllsources.append('#source/icons/blender.exe.manifest')
710 windlls = env.Install(dir=env['BF_INSTALLDIR'], source = dllsources)
711 allinstall += windlls
713 installtarget = env.Alias('install', allinstall)
714 bininstalltarget = env.Alias('install-bin', blenderinstall)
716 nsisaction = env.Action(btools.NSIS_Installer, btools.NSIS_print)
717 nsiscmd = env.Command('nsisinstaller', None, nsisaction)
718 nsisalias = env.Alias('nsis', nsiscmd)
720 if 'blender' in B.targets:
721 blenderexe= env.Alias('blender', B.program_list)
722 Depends(blenderexe,installtarget)
724 if env['WITH_BF_PLAYER']:
725 blenderplayer = env.Alias('blenderplayer', B.program_list)
726 Depends(blenderplayer,installtarget)
728 if not env['WITH_BF_GAMEENGINE']:
729 blendernogame = env.Alias('blendernogame', B.program_list)
730 Depends(blendernogame,installtarget)
732 if 'blenderlite' in B.targets:
733 blenderlite = env.Alias('blenderlite', B.program_list)
734 Depends(blenderlite,installtarget)
736 Depends(nsiscmd, allinstall)
738 buildslave_action = env.Action(btools.buildslave, btools.buildslave_print)
739 buildslave_cmd = env.Command('buildslave_exec', None, buildslave_action)
740 buildslave_alias = env.Alias('buildslave', buildslave_cmd)
742 Depends(buildslave_cmd, allinstall)
744 Default(B.program_list)
746 if not env['WITHOUT_BF_INSTALL']:
747 Default(installtarget)