==SCons==

* change CCFLAGS to CXXFLAGS and CFLAGS to CCFLAGS to be better
  for SCons
- removed old cruft from ancient system
This commit is contained in:
Nathan Letwory 2006-03-10 20:11:48 +00:00
parent 1c5aa14c5d
commit a71c07a044
15 changed files with 12 additions and 833 deletions

@ -109,10 +109,10 @@ BF_OPENGL_LIB_STATIC = '${BF_OPENGL}/libGL.a ${BF_OPENGL}/libGLU.a ${BF_OPENGL}/
##ifeq ($CPU),alpha)
## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
CFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
CPPFLAGS = ['-DXP_UNIX']
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
REL_CFLAGS = ['-O2']
REL_CCFLAGS = ['-O2']
##BF_DEPEND = 'true'

@ -123,10 +123,10 @@ BF_OPENGL_LIB_STATIC = [ '${BF_OPENGL}/lib/libGL.a', '${BF_OPENGL}/lib/libGLU.a'
##ifeq ($CPU),alpha)
## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
CFLAGS = [ '-pipe' '-funsigned-char', '-fno-strict-aliasing' ]
CCFLAGS = [ '-pipe' '-funsigned-char', '-fno-strict-aliasing' ]
CPPFLAGS = [ '-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS' ]
CCFLAGS = ['-pipe', '-mwindows', '-funsigned-char', '-fno-strict-aliasing' ]
CXXFLAGS = ['-pipe', '-mwindows', '-funsigned-char', '-fno-strict-aliasing' ]
REL_CFLAGS = [ '-O2' ]
REL_CCFLAGS = [ '-O2' ]
##BF_DEPEND = 'true'

@ -330,16 +330,16 @@ class BlenderEnvironment(SConsEnvironment):
if lenv['WITH_BF_GAMEENGINE']:
lenv.Append(CPPDEFINES=['GAMEBLENDER=1'])
if lenv['BF_DEBUG']:
lenv.Append(CFLAGS = lenv['BF_DEBUG_FLAGS'], CCFLAGS = lenv['BF_DEBUG_FLAGS'])
lenv.Append(CCFLAGS = lenv['BF_DEBUG_FLAGS'], CXXFLAGS = lenv['BF_DEBUG_FLAGS'])
else:
lenv.Append(CFLAGS = lenv['REL_CFLAGS'], CCFLAGS = lenv['REL_CCFLAGS'])
lenv.Append(CCFLAGS = lenv['REL_CFLAGS'], CXXFLAGS = lenv['REL_CCFLAGS'])
if lenv['BF_PROFILE']:
lenv.Append(CFLAGS = lenv['BF_PROFILE_FLAGS'], CCFLAGS = lenv['BF_PROFILE_FLAGS'])
lenv.Append(CCFLAGS = lenv['BF_PROFILE_FLAGS'], CXXFLAGS = lenv['BF_PROFILE_FLAGS'])
if compileflags:
lenv.Append(CFLAGS = compileflags)
lenv.Append(CCFLAGS = compileflags)
lenv.Append(CFLAGS = Split(lenv['C_WARN']))
lenv.Append(CCFLAGS = Split(lenv['CC_WARN']))
lenv.Append(CXXFLAGS = compileflags)
lenv.Append(CCFLAGS = Split(lenv['C_WARN']))
lenv.Append(CXXFLAGS = Split(lenv['CC_WARN']))
lib = lenv.Library(target= '#'+root_build_dir+'lib/'+libname, source=sources)
SConsEnvironment.Default(self, lib) # we add to default target, because this way we get some kind of progress info during build
else:
@ -356,6 +356,8 @@ class BlenderEnvironment(SConsEnvironment):
lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS'])
if lenv['BF_PROFILE']:
lenv.Append(LINKFLAGS = lenv['BF_PROFILE_FLAGS'])
lenv.Append(CPPPATH=includes)
lenv.Append(LIBPATH=libpath)
lenv.Append(LIBS=libs)

@ -1 +0,0 @@
__all__ = ['scons']

@ -1 +0,0 @@
__all__ = ['bs']

@ -1 +0,0 @@
__all__ = ['bs_default','bs_dirs','bs_globals','bs_libs','bs_nsis','bs_arc','bs_clean', 'bs_config', 'bs_bincopy']

@ -1,240 +0,0 @@
# archive targets ('scons release')
# and extra functions
#
# Mac OS: appit
# Unices: zipit -> .tar.gz
# Windows: zipit -> .zip
#
import os
import sys
import string
import bs_dirs
import bs_globals
def add2arc(arc, file):
"""
Add file to arc. For win32 arc is a Zipfile, for unices it's a Tarfile
"""
if sys.platform == 'win32':
arc.write(file)
else:
arc.add(file)
def appit(target, source, env):
if sys.platform == 'darwin':
import shutil
import commands
import os.path
target = 'blender'
sourceinfo = "source/darwin/%s.app/Contents/Info.plist"%target
targetinfo = "%s.app/Contents/Info.plist"%target
cmd = '%s.app'%target
if os.path.isdir(cmd):
shutil.rmtree('%s.app'%target)
shutil.copytree("source/darwin/%s.app"%target, '%s.app'%target)
cmd = "cat %s | sed s/VERSION/`cat release/VERSION`/ | sed s/DATE/`date +'%%Y-%%b-%%d'`/ > %s"%(sourceinfo,targetinfo)
commands.getoutput(cmd)
cmd = 'cp %s %s.app/Contents/MacOS/%s'%(target, target, target)
commands.getoutput(cmd)
if bs_globals.user_options_dict['BUILD_BINARY'] == 'debug':
print "building debug"
else :
cmd = 'strip -u -r %s.app/Contents/MacOS/%s'%(target, target)
commands.getoutput(cmd)
cmd = '%s.app/Contents/Resources/'%target
shutil.copy('bin/.blender/.bfont.ttf', cmd)
shutil.copy('bin/.blender/.Blanguages', cmd)
cmd = 'cp -R bin/.blender/locale %s.app/Contents/Resources/'%target
commands.getoutput(cmd)
cmd = 'mkdir %s.app/Contents/MacOS/.blender'%target
commands.getoutput(cmd)
cmd = 'cp -R release/scripts %s.app/Contents/MacOS/.blender/'%target
commands.getoutput(cmd)
cmd = 'cp -R release/plugins %s.app/Contents/Resources/'%target
commands.getoutput(cmd)
cmd = 'chmod +x %s.app/Contents/MacOS/%s'%(target, target)
commands.getoutput(cmd)
cmd = 'find %s.app -name CVS -prune -exec rm -rf {} \;'%target
commands.getoutput(cmd)
cmd = 'find %s.app -name .DS_Store -exec rm -rf {} \;'%target
commands.getoutput(cmd)
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
target = 'blenderplayer'
sourceinfo = "source/darwin/%s.app/Contents/Info.plist"%target
targetinfo = "%s.app/Contents/Info.plist"%target
cmd = '%s.app'%target
if os.path.isdir(cmd):
shutil.rmtree('%s.app'%target)
shutil.copytree("source/darwin/%s.app"%target, '%s.app'%target)
cmd = "cat %s | sed s/VERSION/`cat release/VERSION`/ | sed s/DATE/`date +'%%Y-%%b-%%d'`/ > %s"%(sourceinfo,targetinfo)
commands.getoutput(cmd)
cmd = 'cp %s %s.app/Contents/MacOS/%s'%(target, target, target)
commands.getoutput(cmd)
if bs_globals.user_options_dict['BUILD_BINARY'] == 'debug':
print "building debug player"
else :
cmd = 'strip -u -r %s.app/Contents/MacOS/%s'%(target, target)
commands.getoutput(cmd)
cmd = '%s.app/Contents/Resources/'%target
shutil.copy('bin/.blender/.bfont.ttf', cmd)
shutil.copy('bin/.blender/.Blanguages', cmd)
cmd = 'cp -R bin/.blender/locale %s.app/Contents/Resources/'%target
commands.getoutput(cmd)
cmd = 'cp -R release/scripts %s.app/Contents/MacOS/.blender/'%target
commands.getoutput(cmd)
cmd = 'cp -R release/plugins %s.app/Contents/Resources/'%target
commands.getoutput(cmd)
cmd = 'chmod +x %s.app/Contents/MacOS/%s'%(target, target)
commands.getoutput(cmd)
cmd = 'find %s.app -name CVS -prune -exec rm -rf {} \;'%target
commands.getoutput(cmd)
cmd = 'find %s.app -name .DS_Store -exec rm -rf {} \;'%target
commands.getoutput(cmd)
else:
print "This target is for the Os X platform only"
def zipit(env, target, source):
try:
if sys.platform == 'win32':
import zipfile
else:
import tarfile
except:
if sys.platform == 'win32':
print "no zipfile module found"
else:
print "no tarfile module found"
print "make sure you use python 2.3"
print
return
import shutil
import glob
import time
startdir = os.getcwd()
pf=""
zipext = ""
zipname = ""
today = time.strftime("%Y%m%d", time.gmtime()) # get time in the form 20040714
if bs_dirs.preparedist()==0:
print "check output for error"
return
if sys.platform == 'win32':
zipext += ".zip"
pf = "windows"
elif sys.platform == 'linux2' or sys.platform == 'linux-i386':
zipext += ".tar.gz"
pf = "linux"
elif sys.platform == 'freebsd4':
zipext += ".tar.gz"
pf = "freebsd4"
elif sys.platform == 'freebsd5':
zipext += ".tar.gz"
pf = "freebsd5"
elif sys.platform == 'cygwin':
zipext += ".tar.gz"
pf = "cygwin"
if bs_globals.user_options_dict['BUILD_BINARY'] == 'release':
if sys.platform == 'cygwin':
blendname = "blender-" + bs_globals.version + "-" + pf
else:
blendname = "blender-" + bs_globals.version + "-" + bs_globals.config_guess
else:
blendname = "bf_blender_" + pf + "_" + today
zipname = blendname + zipext
if os.path.isdir(blendname):
shutil.rmtree(blendname)
shutil.move(startdir + os.sep + "dist", blendname)
print
if sys.platform == 'win32':
print "Create the zip!"
else:
print "Create the tarball!"
print
if sys.platform == 'win32':
thezip = zipfile.ZipFile(zipname, 'w', zipfile.ZIP_DEFLATED)
else:
thezip = tarfile.open(zipname, 'w:gz')
for root, dirs, files in os.walk(blendname, topdown=False):
for name in files:
if name in [zipname]:
print "skipping self"
else:
file = root + "/" + name
print "adding: " + file
add2arc(thezip, file)
thezip.close()
os.chdir(startdir)
shutil.move(blendname, startdir + os.sep + "dist")
if bs_dirs.finalisedist(zipname)==0:
print "encountered an error in finalisedist"
print
return
print
print "Blender has been successfully packaged"
print "You can find the file %s in the root source directory"%zipname
print
def printadd(env, target, source):
"""
Print warning message if platform hasn't been added to zipit() yet
"""
print
print "############"
print
print "Make sure zipit() works for your platform:"
print " - binaries to copy (naming?)"
print " - possible libraries?"
print " - archive format?"
print
print "/Nathan Letwory (jesterKing)"
print
def BlenderRelease(target):
"""
Make a Release package (tarball, zip, bundle).
target = Name of package to make (string)
eg: BlenderRelease('blender')
"""
if sys.platform == 'darwin':
app_env = bs_globals.init_env.Copy()
Mappit = app_env.Command('appit', bs_globals.appname, appit)
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
app_env.Depends(Mappit, bs_globals.playername)
app_env.Alias("release", Mappit)
elif sys.platform in ['win32', 'linux2', 'linux-i386', 'freebsd4', 'freebsd5','cygwin']:
release_env = bs_globals.init_env.Copy()
releaseit = release_env.Command('blenderrelease', bs_globals.appname, zipit)
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
release_env.Depends(releaseit, bs_globals.playername)
release_env.Alias("release", releaseit)
else:
release_env = bs_globals.init_env.Copy()
releaseit = release_env.Command('blender.tar.gz', bs_globals.appname, printadd)
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
release_env.Depends(releaseit, bs_globals.playername)
release_env.Alias("release", releaseit)

@ -1,45 +0,0 @@
# bincopy target
import sys
import os
import shutil
import bs_globals
def docopyit(env, target, source):
"""
Copy the blender binaries to a specified location
"""
if bs_globals.docopy==0 or bs_globals.copyto=='':
print "The bincopy target has been activated with corrupt data"
sys.exit()
blender = 'blender'
blenderplayer = 'blenderplayer'
# make sure bs_globals.copyto exists
if os.path.isdir(bs_globals.copyto) == 0:
os.makedirs(bs_globals.copyto)
if sys.platform in ['win32', 'cygwin']:
blender = 'blender.exe'
blenderplayer = 'blenderplayer.exe'
shutil.copy(blender, bs_globals.copyto + os.sep + blender)
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
shutil.copy(blenderplayer, bs_globals.copyto + os.sep + blenderplayer)
def BlenderCopy(target):
#~ if sys.platform == 'darwin':
#~ copy_env = bs_globals.init_env.Copy()
#~ Mappit = app_env.Command('appit', bs_globals.appname, appit)
#~ if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
#~ app_env.Depends(Mappit, bs_globals.playername)
#~ app_env.Alias("release", Mappit)
if sys.platform in ['win32', 'linux2', 'linux-i386', 'freebsd4', 'freebsd5','cygwin']:
copy_env = bs_globals.init_env.Copy()
copyit = copy_env.Command('blendercopy', bs_globals.appname, docopyit)
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
copy_env.Depends(copyit, bs_globals.playername)
copy_env.Alias("bincopy", copyit)
else:
print "Check the scons implementation for bincopy, copydo if everything is setup correctly for your platform"

@ -1,17 +0,0 @@
# the clean target
import os
import shutil
def DoClean(dir2clean):
"""
Do a removal of the root_build_dir the fast way
"""
print "start the clean"
dirs = os.listdir(dir2clean)
for dir in dirs:
if os.path.isdir(dir2clean + "/" + dir) == 1:
print "clean dir %s"%(dir2clean+"/" + dir)
shutil.rmtree(dir2clean+"/" + dir)
print "done"

@ -1,38 +0,0 @@
# configuration functions
import sys
import os
#import SCons.Script
import bs_globals
def checkPyVersion():
if hex(sys.hexversion) < 0x2030000:
print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
print
print "You need at least Python 2.3 to build Blender with SCons"
print
print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
sys.exit()
def parseOpts():
copyloc = ''
all_args = sys.argv[1:]
# parser = SCons.Script.OptParser()
# options, targets = parser.parse_args(all_args)
if ('clean' in bs_globals.targets):
bs_globals.enable_clean = 1
# User configurable options file. This can be controlled by the user by running
# scons with the following argument: CONFIG=user_config_options_file
bs_globals.config_file = bs_globals.arguments.get('CONFIG', 'config.opts')
bs_globals.root_build_dir = bs_globals.arguments.get('root_build_dir', '..' + os.sep + 'build' + os.sep + sys.platform + os.sep)
copyloc = bs_globals.arguments.get('copyto', '0')
if copyloc == '0':
bs_globals.docopy = 0;
else:
bs_globals.docopy = 1;
bs_globals.copyto = copyloc

@ -1,16 +0,0 @@
# Default target
import bs_globals
def noaction(env, target, source):
print "Empty action"
def BlenderDefault(target):
"""
The default Blender build.
"""
def_env = bs_globals.init_env.Copy()
default = def_env.Command('nozip', 'blender$PROGSUFFIX', noaction)
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
def_env.Depends(default, 'blenderplayer$PROGSUFFIX')
def_env.Alias(".", default)

@ -1,127 +0,0 @@
# functions used for dir handling / preperation / cleaning
import os
import string
import sys
import bs_globals
def cleanCVS():
"""
walks the dist dir and removes all CVS dirs
"""
try:
import shutil
except:
print "no shutil available"
print "make sure you use python 2.3"
print
return 0
startdir = os.getcwd()
for root, dirs, files in os.walk("dist", topdown=False):
for name in dirs:
if name in ['CVS']:
if os.path.isdir(root + "/" + name):
shutil.rmtree(root + "/" + name)
os.chdir(startdir)
return 1
def preparedist():
"""
Prepare a directory for creating either archives or the installer
"""
try:
import shutil
import time
import stat
except:
print "no shutil available"
print "make sure you use python 2.3"
print
return 0
startdir = os.getcwd()
if os.path.isdir("dist") == 0:
os.makedirs("dist")
else:
shutil.rmtree("dist") # make sure we don't get old cruft
os.makedirs("dist")
# first copy binaries
if sys.platform == 'win32' or sys.platform == 'cygwin':
shutil.copy("blender.exe", "dist/blender.exe")
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
shutil.copy("blenderplayer.exe", "dist/blenderplayer.exe")
shutil.copy("../lib/windows/python/lib/python24.dll", "dist/python24.dll")
shutil.copy("../lib/windows/sdl/lib/SDL.dll", "dist/SDL.dll")
shutil.copy("../lib/windows/gettext/lib/gnu_gettext.dll", "dist/gnu_gettext.dll")
elif sys.platform in ['linux2', 'linux-i386', 'freebsd4', 'freebsd5']:
shutil.copy("blender", "dist/blender")
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
shutil.copy("blenderplayer", "dist/blenderplayer")
else:
print "update preparedist() for your platform!"
return 0
# now copy .blender and necessary extras for it
if os.path.isdir("dist/.blender"):
shutil.rmtree("dist/.blender")
os.chdir("bin")
shutil.copytree(".blender/", "../dist/.blender")
os.chdir(startdir)
if os.path.isdir("dist/.blender/scripts"):
shutil.rmtree("dist/.blender/scripts")
if os.path.isdir("dist/plugins"):
shutil.rmtree("dist/plugins")
os.makedirs("dist/plugins/include")
shutil.copy("source/blender/blenpluginapi/documentation.h", "dist/plugins/include/documentation.h")
shutil.copy("source/blender/blenpluginapi/floatpatch.h", "dist/plugins/include/floatpatch.h")
shutil.copy("source/blender/blenpluginapi/iff.h", "dist/plugins/include/iff.h")
shutil.copy("source/blender/blenpluginapi/plugin.h", "dist/plugins/include/plugin.h")
shutil.copy("source/blender/blenpluginapi/util.h", "dist/plugins/include/util.h")
os.chdir("release")
shutil.copytree("scripts/", "../dist/.blender/scripts")
# finally copy auxiliaries (readme, license, etc.)
if sys.platform == 'win32':
shutil.copy("windows/extra/Help.url", "../dist/Help.url")
shutil.copy("windows/extra/Python24.zip", "../dist/Python24.zip")
shutil.copy("windows/extra/zlib.pyd", "../dist/zlib.pyd")
shutil.copy("text/copyright.txt", "../dist/copyright.txt")
shutil.copy("text/blender.html", "../dist/blender.html")
shutil.copy("text/GPL-license.txt", "../dist/GPL-license.txt")
shutil.copy("text/Python-license.txt", "../dist/Python-license.txt")
reltext = "release_" + string.join(bs_globals.version.split("."), '') + ".txt"
shutil.copy("text/" + reltext, "../dist/" + reltext)
os.chdir(startdir)
if cleanCVS()==0:
return 0
return 1
def finalisedist(zipname):
"""
Fetch the package created and remove temp dir
"""
try:
import shutil
except:
print "no shutil available"
print "make sure you use python 2.3"
print
return 0
#shutil.copy("dist/" + zipname, zipname)
#shutil.rmtree("dist")
return 1

@ -1,16 +0,0 @@
# Global variables for the Blender build process
arguments = []
enable_clean = 0
config_file = ''
root_build_dir = ''
user_options_dict = []
init_env = []
version = ''
shortversion = ''
appname = ''
playername = ''
config_guess = ''
docopy = 0
copyto = ''

@ -1,166 +0,0 @@
# Blender library functions
import sys
import os
import string
import SCons
import bs_globals
def common_libs(env):
"""
Append to env all libraries that are common to Blender and Blenderplayer
"""
env.Append (LIBS=[
'blender_readblenfile',
'blender_img',
'blender_bop',
'blender_blenkernel',
'blender_blenloader',
'blender_blenpluginapi',
'blender_imbuf',
'blender_avi',
'blender_blenlib',
'blender_makesdna',
'blender_kernel',
'blender_GHOST',
'blender_STR',
'blender_guardedalloc',
'blender_CTR',
'blender_MEM',
'blender_MT',
'blender_BMF',
'soundsystem'])
if bs_globals.user_options_dict['USE_QUICKTIME'] == 1:
env.Append (LIBS=['blender_quicktime'])
if bs_globals.user_options_dict['USE_OPENEXR'] == 1:
env.Append (LIBS=['blender_openexr'])
env.Append (LIBS=['Half', 'Iex', 'IlmImf', 'Imath'])
def international_libs(env):
"""
Append international font support libraries
"""
if bs_globals.user_options_dict['USE_INTERNATIONAL'] == 1:
env.Append (LIBS=bs_globals.user_options_dict['FREETYPE_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['FREETYPE_LIBPATH'])
env.Append (LIBS=['blender_FTF'])
if sys.platform=='darwin':
env.Append (LIBS=bs_globals.user_options_dict['FTGL_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['FTGL_LIBPATH'])
else:
env.Append (LIBS=['extern_ftgl'])
env.Append (LIBS=bs_globals.user_options_dict['FREETYPE_LIBRARY'])
def blender_libs(env):
"""
Blender only libs (not in player)
"""
env.Append( LIBS=['blender_creator',
'blender_blendersrc',
'blender_render',
'blender_yafray',
# 'blender_renderconverter',
'blender_radiosity',
'blender_BSP',
'blender_blenkernel',
'blender_LOD',
'blender_IK',
'blender_ONL',
'blender_elbeem' ])
def ketsji_libs(env):
"""
Game Engine libs
"""
if bs_globals.user_options_dict['BUILD_GAMEENGINE'] == 1:
env.Append (LIBS=['KX_blenderhook',
'KX_converter',
'PHY_Dummy',
'PHY_Bullet',
'PHY_Physics',
'KX_ketsji',
'SCA_GameLogic',
'RAS_rasterizer',
'RAS_OpenGLRasterizer',
'blender_expressions',
'SG_SceneGraph',
'blender_MT',
'KX_blenderhook',
'KX_network',
'blender_kernel',
'NG_network',
'extern_bullet',
'NG_loopbacknetwork'])
if bs_globals.user_options_dict['USE_PHYSICS'] == 'solid':
env.Append (LIBS=['PHY_Sumo', 'PHY_Physics', 'blender_MT', 'extern_solid', 'extern_qhull'])
elif bs_globals.user_options_dict['USE_PHYSICS'] == 'ode':
env.Append (LIBS=['PHY_Ode',
'PHY_Physics'])
env.Append (LIBS=bs_globals.user_options_dict['ODE_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['ODE_LIBPATH'])
def player_libs(env):
"""
Player libraries
"""
env.Append (LIBS=['GPG_ghost',
'GPC_common'])
def player_libs2(env):
"""
Link order shenannigans: these libs are added after common_libs
"""
env.Append (LIBS=['blender_blenkernel_blc',
'blender_LOD',
'soundsystem'])
def winblenderres(env):
"""
build the windows icon resource file
"""
if sys.platform == 'win32':
env.RES(['source/icons/winblender.rc'])
def system_libs(env):
"""
System libraries: Python, SDL, PNG, JPEG, Gettext, OpenAL, Carbon
"""
env.Append (LIBS=['blender_python'])
env.Append (LIBS=bs_globals.user_options_dict['PYTHON_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['PYTHON_LIBPATH'])
env.Append (LINKFLAGS=bs_globals.user_options_dict['PYTHON_LINKFLAGS'])
env.Append (LIBS=bs_globals.user_options_dict['SDL_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['SDL_LIBPATH'])
env.Append (LIBS=bs_globals.user_options_dict['PNG_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['PNG_LIBPATH'])
env.Append (LIBS=bs_globals.user_options_dict['JPEG_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['JPEG_LIBPATH'])
env.Append (LIBS=bs_globals.user_options_dict['GETTEXT_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['GETTEXT_LIBPATH'])
env.Append (LIBS=bs_globals.user_options_dict['Z_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['Z_LIBPATH'])
if bs_globals.user_options_dict['USE_OPENAL'] == 1:
env.Append (LIBS=bs_globals.user_options_dict['OPENAL_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['OPENAL_LIBPATH'])
env.Append (LIBS=bs_globals.user_options_dict['PLATFORM_LIBS'])
env.Append (LIBPATH=bs_globals.user_options_dict['PLATFORM_LIBPATH'])
if sys.platform == 'darwin':
env.Append (LINKFLAGS='-framework')
env.Append (LINKFLAGS='Carbon')
env.Append (LINKFLAGS='-framework')
env.Append (LINKFLAGS='AGL')
env.Append (LINKFLAGS='-framework')
env.Append (LINKFLAGS='AudioUnit')
env.Append (LINKFLAGS='-framework')
env.Append (LINKFLAGS='AudioToolbox')
env.Append (LINKFLAGS='-framework')
env.Append (LINKFLAGS='CoreAudio')
if bs_globals.user_options_dict['USE_QUICKTIME'] == 1:
env.Append (LINKFLAGS='-framework')
env.Append (LINKFLAGS='QuickTime')
else:
env.Append (LINKFLAGS=bs_globals.user_options_dict['PLATFORM_LINKFLAGS'])
env.BuildDir (bs_globals.root_build_dir, '.', duplicate=0)

@ -1,155 +0,0 @@
# nsis target
#
# this file has the NSIS related functions
import os
import string
import sys
import bs_dirs
import bs_globals
def donsis(env, target, source):
"""
Create a Windows installer with NSIS
"""
print
print "Creating the Windows installer"
print
startdir = os.getcwd()
if bs_dirs.preparedist()==0:
print "check output for error"
return
os.chdir("release/windows/installer")
nsis = open("00.sconsblender.nsi", 'r')
nsis_cnt = str(nsis.read())
nsis.close()
# do root
rootlist = []
rootdir = os.listdir(startdir + "\\dist")
for rootitem in rootdir:
if os.path.isdir(startdir + "\\dist\\" + rootitem) == 0:
rootlist.append("File " + startdir + "\\dist\\" + rootitem)
rootstring = string.join(rootlist, "\n ")
rootstring += "\n\n"
nsis_cnt = string.replace(nsis_cnt, "[ROOTDIRCONTS]", rootstring)
# do delete items
delrootlist = []
for rootitem in rootdir:
if os.path.isdir(startdir + "\\dist\\" + rootitem) == 0:
delrootlist.append("Delete $INSTDIR\\" + rootitem)
delrootstring = string.join(delrootlist, "\n ")
delrootstring += "\n"
nsis_cnt = string.replace(nsis_cnt, "[DELROOTDIRCONTS]", delrootstring)
# do scripts
scriptlist = []
scriptpath = "%s%s" % (startdir, "\\dist\\.blender\\scripts")
scriptdir = os.listdir(scriptpath)
for scriptitem in scriptdir:
scriptfile = "%s\\%s" % (scriptpath, scriptitem)
if os.path.isdir(scriptfile) == 0:
scriptlist.append("File %s" % scriptfile)
scriptstring = string.join(scriptlist, "\n ")
scriptstring += "\n\n"
nsis_cnt = string.replace(nsis_cnt, "[SCRIPTCONTS]", scriptstring)
# do scripts\bpymodules
bpymodlist = []
bpymodpath = "%s%s" % (startdir, "\\dist\\.blender\\scripts\\bpymodules")
bpymoddir = os.listdir(bpymodpath)
for bpymoditem in bpymoddir:
bpymodfile = "%s\\%s" % (bpymodpath, bpymoditem)
if os.path.isdir(bpymodfile) == 0:
bpymodlist.append("File %s" % bpymodfile)
bpymodstring = string.join(bpymodlist, "\n ")
bpymodstring += "\n\n"
nsis_cnt = string.replace(nsis_cnt, "[SCRIPTMODCONTS]", bpymodstring)
# do scripts\bpydata
bpydatalist = []
bpydatapath = "%s%s" % (startdir, "\\dist\\.blender\\scripts\\bpydata")
bpydatadir = os.listdir(bpydatapath)
for bpydataitem in bpydatadir:
bpydatafile = "%s\\%s" % (bpydatapath, bpydataitem)
if os.path.isdir(bpydatafile) == 0:
bpydatalist.append("File %s" % bpydatafile)
bpydatastring = string.join(bpydatalist, "\n ")
bpydatastring += "\n\n"
nsis_cnt = string.replace(nsis_cnt, "[SCRIPTDATACONTS]", bpydatastring)
# do scripts\bpydata\config
cfglist = []
cfgpath = "%s%s" % (startdir, "\\dist\\.blender\\scripts\\bpydata\\config")
cfgdir = os.listdir(cfgpath)
for cfgitem in cfgdir:
cfgfile = "%s\\%s" % (cfgpath, cfgitem)
if os.path.isdir(cfgfile) == 0:
cfglist.append("File %s" % cfgfile)
cfgstring = string.join(cfglist, "\n ")
cfgstring += "\n\n"
nsis_cnt = string.replace(nsis_cnt, "[SCRIPTDATACFGCONTS]", cfgstring)
# do plugins\include
plugincludelist = []
plugincludepath = "%s%s" % (startdir, "\\dist\\plugins\\include")
plugincludedir = os.listdir(plugincludepath)
for plugincludeitem in plugincludedir:
plugincludefile = "%s\\%s" % (plugincludepath, plugincludeitem)
if os.path.isdir(plugincludefile) == 0:
plugincludelist.append("File %s" % plugincludefile)
plugincludestring = string.join(plugincludelist, "\n ")
plugincludestring += "\n\n"
nsis_cnt = string.replace(nsis_cnt, "[PLUGINCONTS]", plugincludestring)
# do dotblender
dotblendlist = []
dotblenddir = os.listdir(startdir+"\\dist\\.blender")
for dotblenditem in dotblenddir:
if os.path.isdir(startdir + "\\dist\\.blender\\" + dotblenditem) == 0:
dotblendlist.append("File " + startdir + "\\dist\\.blender\\" + dotblenditem)
dotblendstring = string.join(dotblendlist, "\n ")
dotblendstring += "\n\n"
nsis_cnt = string.replace(nsis_cnt, "[DOTBLENDERCONTS]", dotblendstring)
# do language files
langlist = []
langfiles = []
langdir = os.listdir(startdir + "\\dist\\.blender\\locale")
for langitem in langdir:
if os.path.isdir(startdir + "\\dist\\.blender\\locale\\" + langitem) == 1:
langfiles.append("SetOutPath $BLENDERHOME\\.blender\\locale\\" + langitem + "\\LC_MESSAGES")
langfiles.append("File " + startdir + "\\dist\\.blender\\locale\\" + langitem + "\\LC_MESSAGES\\blender.mo")
langstring = string.join(langfiles, "\n ")
langstring += "\n\n"
nsis_cnt = string.replace(nsis_cnt, "[LANGUAGECONTS]", langstring)
# var replacements
nsis_cnt = string.replace(nsis_cnt, "DISTDIR", startdir + "\\dist")
nsis_cnt = string.replace(nsis_cnt, "SHORTVER", bs_globals.shortversion)
nsis_cnt = string.replace(nsis_cnt, "VERSION", bs_globals.version)
new_nsis = open("00.blender_tmp.nsi", 'w')
new_nsis.write(nsis_cnt)
new_nsis.close()
sys.stdout = os.popen("makensis 00.blender_tmp.nsi", 'w')
os.chdir(startdir)
def BlenderNSIS(target):
"""
Entry for creating Windows installer
"""
if sys.platform == 'win32':
inst_env = bs_globals.init_env.Copy()
nsis_inst = inst_env.Command('nsisinstaller', 'blender$PROGSUFFIX', donsis)
if bs_globals.user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
inst_env.Depends(nsis_inst, 'blenderplayer$PROGSUFFIX')
inst_env.Alias("wininst", nsis_inst)