== SCons ==
authorNathan Letwory <nathan@letworyinteractive.com>
Sat, 4 Feb 2006 14:15:10 +0000 (14:15 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Sat, 4 Feb 2006 14:15:10 +0000 (14:15 +0000)
* This commit is all of the rewrite work done on the SCons system. For
  documentation see doc/blender-scons.txt and doc/blender-scons-dev.txt.
  Also http://mediawiki.blender.org/index.php/BlenderDev/SconsRefactoring
  contains valuable information, along with what still needs to be done.

    - linux, os x and windows compile now.
    - files are compiled to BF_INSTALLDIR (see config/(platform)-config.py)
        - NOTE: Jean-Luc P will commit sometime during the weekend proper
          appit() for OS X. For now, copy the resulting binary to an
          existing .app bundle.
    - features:
        - cleaner structure for better maintenance
        - cleaner output during compile
        - better handling of build options
        - general overall speed increase
        - see the wiki for more info

  Cygwin, FreeBSD and Solaris systems still need work. For these systems:
    1) copy a config/(platform)-config.py to ie. config/cygwin-config.py
    2) set the proper defaults for your platform
    3) mail me at jesterking at letwory dot net with you configuration. if
       you need any modifications to the system, do send a patch, too.

  I'll be giving first-aid today and tomorrow, after that it'll be all
  regular development work :)

  /Nathan

74 files changed:
SConstruct
config/darwin-config.py [new file with mode: 0644]
config/linux2-config.py [new file with mode: 0644]
config/linuxcross-config.py [new file with mode: 0644]
config/win32-mingw-config.py [new file with mode: 0644]
config/win32-vc-config.py [new file with mode: 0644]
extern/SConscript
extern/bFTGL/SConscript
extern/bullet/SConscript
extern/qhull/SConscript
extern/solid/SConscript
intern/SConscript
intern/SoundSystem/SConscript
intern/bmfont/SConscript
intern/boolop/SConscript
intern/bsp/SConscript
intern/container/SConscript
intern/csg/SConscript
intern/decimation/SConscript
intern/elbeem/SConscript
intern/ghost/SConscript
intern/guardedalloc/SConscript
intern/iksolver/SConscript
intern/memutil/SConscript
intern/moto/SConscript
intern/opennl/SConscript
intern/string/SConscript
source/SConscript
source/blender/SConscript
source/blender/avi/SConscript
source/blender/blenkernel/SConscript
source/blender/blenkernel/bad_level_call_stubs/SConscript
source/blender/blenlib/SConscript
source/blender/blenloader/SConscript
source/blender/blenpluginapi/SConscript
source/blender/ftfont/SConscript
source/blender/imbuf/SConscript
source/blender/imbuf/intern/openexr/SConscript
source/blender/img/SConscript
source/blender/makesdna/SConscript
source/blender/makesdna/intern/SConscript
source/blender/python/SConscript
source/blender/quicktime/SConscript
source/blender/radiosity/SConscript
source/blender/readblenfile/SConscript
source/blender/render/SConscript
source/blender/src/SConscript
source/blender/yafray/SConscript
source/creator/SConscript
source/gameengine/BlenderRoutines/SConscript
source/gameengine/Converter/SConscript
source/gameengine/Expressions/SConscript
source/gameengine/GameLogic/SConscript
source/gameengine/GamePlayer/SConscript
source/gameengine/GamePlayer/common/SConscript
source/gameengine/GamePlayer/ghost/SConscript
source/gameengine/Ketsji/KXNetwork/SConscript
source/gameengine/Ketsji/SConscript
source/gameengine/Network/LoopBackNetwork/SConscript
source/gameengine/Network/SConscript
source/gameengine/Physics/Bullet/SConscript
source/gameengine/Physics/Dummy/SConscript
source/gameengine/Physics/Sumo/SConscript
source/gameengine/Physics/common/SConscript
source/gameengine/Rasterizer/RAS_OpenGLRasterizer/SConscript
source/gameengine/Rasterizer/SConscript
source/gameengine/SConscript
source/gameengine/SceneGraph/SConscript
source/kernel/SConscript
tools/Blender.py [new file with mode: 0644]
tools/bcolors.py [new file with mode: 0755]
tools/btools.py [new file with mode: 0755]
tools/crossmingw.py [new file with mode: 0755]
tools/mstoolkit.py [new file with mode: 0755]

index 695fd29795b403230783a55289ef97a2ba8e653f..4ed8d331d03df749a0ec755c83306539b7b33606 100644 (file)
 #!/usr/bin/env python
-import string
-import os
-import time
-import sys
-from distutils import sysconfig
-from tools.scons.bs import *
-
-bs_globals.arguments = ARGUMENTS
-bs_globals.targets = COMMAND_LINE_TARGETS
-
-print 'targets = ',bs_globals.targets
-print 'arguments = ', bs_globals.arguments
-print os.getcwd()
+# $Id$
+# ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# as published by the Free Software Foundation; either version 2
+# of the License, or (at your option) any later version. The Blender
+# Foundation also sells licenses for use in proprietary software under
+# the Blender License.  See http://www.blender.org/BL/ for information
+# about this.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+#
+# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
+# All rights reserved.
+#
+# The Original Code is: none of this file.
+#
+# Contributor(s): Nathan Letwory.
+#
+# ***** END GPL/BL DUAL LICENSE BLOCK *****
+#
+# Main entry-point for the SCons building system
+# Set up some custom actions and target/argument handling
+# Then read all SConscripts and build
 
-appname = ''
-playername = ''
-config_guess = ''
-
-bs_config.checkPyVersion()
-
-if sys.platform != 'win32':
-       #~ sys.stdout = os.popen("tee build.log", "w")
-       #~ sys.stderr = sys.stdout
-       # guess at the platform, used to maintain the tarball naming scheme
-       config_guess = os.popen("SRCHOME=source/ source/tools/guess/guessconfig").read()[:-1]
+import sys
+import os
+import os.path
+import string
+import shutil
+import glob
+
+import tools.Blender
+import tools.btools
+import tools.bcolors
+
+BlenderEnvironment = tools.Blender.BlenderEnvironment
+btools = tools.btools
+B = tools.Blender
+
+### globals ###
+platform = sys.platform
+quickie = None
+
+##### BEGIN SETUP #####
+
+B.possible_types = ['core', 'common', 'blender', 'intern',
+                    'international', 'game', 'game2',
+                    'player', 'player2', 'system']
+
+##################################
+# target and argument validation #
+##################################
+# XX cheating for BF_FANCY, we check for BF_FANCY before args are validated
+use_color = ARGUMENTS.get('BF_FANCY', '1')
+if platform=='win32':
+    use_color = None
+
+if not use_color=='1':
+    B.bc.disable()
+
+# arguments
+print B.bc.HEADER+'Command-line arguments'+B.bc.ENDC
+B.arguments = btools.validate_arguments(ARGUMENTS, B.bc)
+btools.print_arguments(B.arguments, B.bc)
+
+# targets
+print B.bc.HEADER+'Command-line targets'+B.bc.ENDC
+B.targets = btools.validate_targets(COMMAND_LINE_TARGETS, B.bc)
+btools.print_targets(B.targets, B.bc)
+
+##########################
+# setting up environment #
+##########################
+
+# handling cmd line arguments & config file
+
+# first check cmdline for toolset and we create env to work on
+quickie = B.arguments.get('BF_QUICK', None)
+if quickie:
+    B.quickie=string.split(quickie,',')
 else:
-       config_guess = "windows"
-
-#the above check is not enough for darwin. we way want to build for darwin/X11
-#more, now even for Os X, we need to check and take in account arch 
-#(PPC, x86, universal binaries)        
-if sys.platform == 'darwin':
-       appname = 'blender'
-       playername = 'blenderplayer'
+    B.quickie=[]
+
+toolset = B.arguments.get('BF_TOOLSET', None)
+if toolset:
+    print "Using " + toolset
+    if toolset=='mstoolkit':
+        env = BlenderEnvironment(ENV = os.environ)
+        env.Tool('mstoolkit', ['tools'])
+    else:
+        env = BlenderEnvironment(tools=[toolset], ENV = os.environ)
 else:
-       appname = 'blender$PROGSUFFIX'
-       playername = 'blenderplayer$PROGSUFFIX'
-
-# Build directory.
-# root_build_dir = '..' + os.sep + 'build' + os.sep + sys.platform + os.sep
-
-bs_config.parseOpts()
-
-# Create the build directory. SCons does this automatically, but since we
-# don't want to put scons-generated .sconsign files in the source tree, but in
-# the root_build_dir, we have to create that dir ourselves before SCons tries
-# to access/create the file containing .sconsign data.
-# we need to create the top level hierarchy too (at least on Os X) 
-if os.path.isdir (bs_globals.root_build_dir) == 0:
-       os.makedirs (bs_globals.root_build_dir)
-       os.makedirs (bs_globals.root_build_dir+os.sep+'extern')
-       os.makedirs (bs_globals.root_build_dir+os.sep+'intern')
-       os.makedirs (bs_globals.root_build_dir+os.sep+'source')
-
-# Blender version.
-version='2.40-alpha1'
-shortversion = '240alpha1' # for wininst target -> nsis installer creation
-
-sdl_env = Environment (ENV = os.environ)
-freetype_env = Environment (ENV = os.environ)
-env = Environment (ENV = os.environ)
-
-if sys.platform == 'linux2' or sys.platform == 'linux-i386':
-       use_international = 'true'
-       use_gameengine = 'true'
-       use_openal = 'false'
-       use_fmod = 'false'
-       use_quicktime = 'false'
-       use_openexr = 'true'
-       use_sumo = 'true'
-       use_ode = 'false'
-       use_bullet = 'true'
-       use_buildinfo = 'true'
-       use_fluidsim = 'true'
-       build_blender_dynamic = 'true'
-       build_blender_static = 'false'
-       build_blender_player = 'false'
-       build_blender_plugin = 'false'
-       release_flags = ['-O2']
-       debug_flags = ['-O2', '-g']
-       extra_flags = ['-pipe', '-funsigned-char']
-       cxxflags = []
-       defines = []
-       warn_flags = ['-Wall', '-W']
-       window_system = 'X11'
-       platform_libs = ['m', 'util', 'stdc++']
-       platform_libpath = []
-       platform_linkflags = ['-pthread']
-       extra_includes = []
-       # z library information
-       z_lib = ['z']
-       z_libpath = ['/usr/lib']
-       z_include = ['/usr/include']
-       # png library information
-       png_lib = ['png']
-       png_libpath = ['/usr/lib']
-       png_include = ['/usr/include']
-       # OpenEXR library information
-       if use_openexr == 'true':
-               defines += ['WITH_OPENEXR']
-       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
-       openexr_libpath = ['/usr/lib']
-       openexr_include = ['/usr/include/OpenEXR']
-       # jpeg library information
-       jpeg_lib = ['jpeg']
-       jpeg_libpath = ['/usr/lib']
-       jpeg_include = ['/usr/include']
-       #tiff library information
-       tiff_lib = ['tiff']
-       tiff_libpath = ['/usr/lib']
-       tiff_include = ['/usr/include']
-       # OpenGL library information
-       opengl_lib = ['GL', 'GLU']
-       opengl_static = ['/usr/lib/libGL.a', '/usr/lib/libGLU.a']
-       opengl_libpath = ['/usr/lib', '/usr/X11R6/lib']
-       opengl_include = ['/usr/include', '/usr/X11R6/include']
-       # SDL library information
-       sdl_env.ParseConfig ('sdl-config --cflags --libs')
-       sdl_cflags = sdl_env.Dictionary()['CCFLAGS']
-       sdl_include = sdl_env.Dictionary()['CPPPATH']
-       sdl_libpath = sdl_env.Dictionary()['LIBPATH']
-       sdl_lib = sdl_env.Dictionary()['LIBS']
-       # SOLID library information
-       solid_lib = []
-       solid_libpath = []
-       solid_include = ['#extern/solid']
-       qhull_lib = []
-       qhull_libpath = []
-       qhull_include = ['#extern/qhull/include']
-       # Bullet library information
-       bullet_lib = []
-       bullet_libpath = []
-       bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics']
-       # ODE library information
-       ode_lib = ['ode']
-       ode_libpath = ['#../lib/linux-glibc2.2.5-i386/ode/lib']
-       ode_include = ['#../lib/linux-glibc2.2.5-i386/ode/include']
-       # Python library information
-       python_lib = ['python%d.%d' % sys.version_info[0:2]]
-       python_libpath = [sysconfig.get_python_lib (0, 1) + '/config']
-       python_include = [sysconfig.get_python_inc ()]
-       python_linkflags = Split (sysconfig.get_config_var('LINKFORSHARED'))
-       # International support information
-       ftgl_lib = []
-       ftgl_libpath = []
-       ftgl_include = ['#extern/bFTGL/include']
-       freetype_env.ParseConfig ('pkg-config --cflags --libs freetype2 2>/dev/null || freetype-config --cflags --libs 2>/dev/null')
-       freetype_lib = freetype_env.Dictionary()['LIBS']
-       freetype_libpath = freetype_env.Dictionary()['LIBPATH']
-       freetype_include = freetype_env.Dictionary()['CPPPATH']
-       gettext_lib = []
-       gettext_libpath = []
-       gettext_include = []
-       # OpenAL library information
-       openal_lib = ['openal']
-       openal_libpath = ['/usr/lib']
-       openal_include = ['/usr/include']
-
-elif sys.platform == 'darwin':
-       use_international = 'true'
-       use_gameengine = 'true'
-       use_openal = 'true'
-       use_fmod = 'false'
-       use_openal = 'true'
-       use_quicktime = 'true'
-       use_openexr = 'true'
-       use_precomp = 'true'
-       use_sumo = 'true'
-       use_ode = 'false'
-       use_bullet = 'true'
-       use_buildinfo = 'true'
-       use_fluidsim = 'true'
-       build_blender_dynamic = 'true'
-       build_blender_static = 'false'
-       build_blender_player = 'true'
-       build_blender_plugin = 'false'
-       # TODO: replace darwin-6.1-powerpc with the actual directiory on the
-       #       build machine
-       # darwin-6.1 is the name of cvs precomp folder
-       # a symbolic link named darwin-X.Y-powerpc must be manually done
-       #for now. X-Y is darwin kernel rev number
-       darwin_precomp = '#../lib/darwin-6.1-powerpc/'
-       fink_path = '/sw/'
-       # TODO : try -mpowerpc -mpowerpc-gopt -mpowerpc-gfxopt optims
-       #           doing actual profiling
-       extra_flags = ['-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc', '-mtune=G4']
-       
-       # , '-malign-natural'] malign is causing problems with jpeg lib but worth a 1-2% speedup
-       #'-force_cpusubtype_ALL', '-mpowerpc-gpopt', 
-       cxxflags = []
-       defines = ['_THREAD_SAFE' ]
-       if use_quicktime == 'true':
-               defines += ['WITH_QUICKTIME']
-       warn_flags = ['-Wall']    # , '-W'
-       release_flags = ['-O2']
-       debug_flags = ['-g']
-       window_system = 'CARBON'
-       # z library information
-       z_lib = ['z']
-       z_libpath = []
-       z_include = []
-       # TODO : add a flag to allow each lib to be build from fink or precomp
-       #        without having to have to specify the path manually in config.opts.    
-       # png library information
-       png_lib = ['libpng']
-       png_libpath = [darwin_precomp + 'png/lib']
-       png_include = [darwin_precomp + 'png/include']
-       # OpenEXR library information
-       if use_openexr == 'true':
-               defines += ['WITH_OPENEXR']
-       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
-       openexr_libpath = ['/usr/local/lib']
-       openexr_include = ['/usr/local/include/OpenEXR']
-       # jpeg library information
-       jpeg_lib = ['libjpeg']
-       jpeg_libpath = [darwin_precomp + 'jpeg/lib']
-       jpeg_include = [darwin_precomp + 'jpeg/include']
-       # TIFF library information
-       tiff_lib = ['libtiff']
-       tiff_libpath = [darwin_precomp + 'tiff/lib']
-       tiff_include = [darwin_precomp + 'tiff/include']
-       # OpenGL library information
-       opengl_lib = ['GL', 'GLU']
-       opengl_static = []
-       opengl_libpath = []
-       opengl_include = []
-       # SDL specific stuff.
-       #sdl_env.ParseConfig ('sdl-config --cflags --libs')
-       # Want to use precompiled libraries?
-       if use_precomp == 'true':
-               sdl_include = [darwin_precomp + 'sdl/include']
-               sdl_libpath = [darwin_precomp + 'sdl/lib']
-               sdl_lib = ['libSDL.a']
-               sdl_cflags = [ '-I' + darwin_precomp + 'sdl/include' ]
-               sdl_env.Append (CCFLAGS = sdl_cflags )
-               sdl_env.Append (CPPPATH = [darwin_precomp + 'sdl/include'] )
-
-       platform_libs = ['stdc++'] 
-       extra_includes = ['/sw/include']
-       platform_libpath = ['/System/Library/Frameworks/OpenGL.framework/Libraries']
-       platform_linkflags = []
-       # SOLID library information
-       solid_lib = []                                          
-       solid_libpath = []                                          
-       solid_include = ['#/extern/solid']
-       qhull_lib = []                                          
-       qhull_libpath = []                                          
-       qhull_include = ['#/extern/qhull/include']
-       # Bullet library information
-       bullet_lib = []
-       bullet_libpath = []
-       bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics']
-       # ODE library information
-       ode_lib = ['libode']                                             
-       ode_libpath = [darwin_precomp + 'ode/lib']                                          
-       ode_include = [darwin_precomp + 'ode/include/ode']
-       # Python variables.
-       # TODO : fill vars differently if we are on 10.2 or 10.3
-       # python_lib = ['python%d.%d' % sys.version_info[0:2]]
-       # python_libpath = [sysconfig.get_python_lib (0, 1) + '/config']
-       # python_include = [sysconfig.get_python_inc ()]
-       # python_linkflags = Split (sysconfig.get_config_var('LINKFORSHARED'))
-       python_lib = []
-       python_libpath = ['/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config']
-       python_include = ['/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3']
-       python_linkflags = ['-u', '__dummy', '-u', '_PyMac_Error', 
-                                               '-framework', 'System',
-                                               '-framework', 'Python',
-                                               '-framework', 'CoreServices',
-                                               '-framework', 'Foundation',
-                                               '-framework', 'OpenGL',
-                                               '-framework', 'IOKit' , 
-                                               '-framework', 'AppKit']
-       # International stuff
-       ftgl_lib = ['libftgl']
-       ftgl_libpath = [darwin_precomp + 'ftgl/lib']
-       ftgl_include = ['#extern/bFTGL/include']
-       freetype_lib = ['libfreetype']
-       freetype_libpath = [darwin_precomp + 'freetype/lib']
-       freetype_include = [darwin_precomp + 'freetype/include']
-       gettext_lib = ['libintl']
-       gettext_libpath = [darwin_precomp + 'gettext/lib']
-       gettext_include = [darwin_precomp + 'gettext/include']
-       # OpenAL library information
-       openal_lib = ['libopenal']
-       openal_libpath = [darwin_precomp + 'openal/lib']
-       openal_include = [darwin_precomp + 'openal/include']
+    env = BlenderEnvironment(ENV = os.environ)
 
-elif sys.platform == 'cygwin':
-       use_international = 'false'
-       use_gameengine = 'false'
-       use_openal = 'false'
-       use_fmod = 'false'
-       use_quicktime = 'false'
-       use_openexr = 'true'
-       use_sumo = 'false'
-       use_ode = 'false'
-       use_bullet = 'false'
-       use_buildinfo = 'false'
-       use_fluidsim = 'true'
-       build_blender_dynamic = 'true'
-       build_blender_static = 'false'
-       build_blender_player = 'false'
-       build_blender_plugin = 'false'
-       release_flags = ['-O2']
-       debug_flags = ['-O2', '-g']
-       extra_flags = ['-pipe', '-mno-cygwin', '-mwindows', '-funsigned-char']
-       cxxflags = []
-       defines = ['FREE_WINDOWS']
-       warn_flags = ['-Wall', '-Wno-char-subscripts']
-       platform_libs = ['png', 'jpeg', 'netapi32',
-                                        'opengl32', 'glu32', 'winmm',
-                                        'mingw32']
-       platform_libpath = ['/usr/lib/w32api', '/lib/w32api']
-       platform_linkflags = ['-mwindows', '-mno-cygwin', '-mconsole']
-       window_system = 'WIN32'
-       extra_includes = []
-       # z library information
-       z_lib = ['z']
-       z_libpath = ['#../lib/windows/zlib/lib']
-       z_include = ['#../lib/windows/zlib/include']
-       # png library information
-       png_lib = ['png']
-       png_libpath = ['#../lib/windows/png/lib']
-       png_include = ['#../lib/windows/png/include']
-       # OpenEXR library information
-       if use_openexr == 'true':
-               defines += ['WITH_OPENEXR']
-       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
-       openexr_libpath = ['/usr/lib']
-       openexr_include = ['/usr/include/OpenEXR']
-       # jpeg library information
-       jpeg_lib = ['jpeg']
-       jpeg_libpath = ['#../lib/windows/jpeg/lib']
-       jpeg_include = ['#../lib/windows/jpeg/include']
-       # Tiff Library information
-       tiff_lib = ['libtiff']
-       tiff_libpath = ['#../lib/windows/tiff/lib']
-       tiff_include = ['#../lib/windows/tiff/include']
-       # OpenGL library information
-       opengl_lib = ['opengl32', 'glu32']
-       opengl_static = []
-       opengl_libpath = []
-       opengl_include = []
-       # SDL specific stuff.
-       sdl_include = ['#../lib/windows/sdl/include']
-       sdl_libpath = ['#../lib/windows/sdl/lib']
-       sdl_lib = ['SDL']
-       sdl_cflags = []
-       #sdl_cflags = '-DWIN32'
-       # SOLID library information
-       solid_lib = []
-       solid_libpath = []
-       solid_include = ['#extern/solid']
-       qhull_lib = []
-       qhull_libpath = []
-       qhull_include = ['#extern/qhull/include']
-       # Bullet library information
-       bullet_lib = []
-       bullet_libpath = []
-       bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics']
-       # ODE library information
-       ode_lib = ['ode']
-       ode_libpath = ['#../lib/windows/gcc/ode/lib']
-       ode_include = ['#../lib/windows/gcc/ode/include']
-       # Python library information
-       python_include = ['#../lib/windows/python/include/python2.2']
-       python_libpath = ['#../lib/windows/python/lib']
-       python_lib = ['python22']
-       python_linkflags = []
-       # International stuff
-       ftgl_lib = []
-       ftgl_libpath = []
-       ftgl_include = ['#extern/bFTGL/include']
-       freetype_lib = ['freetype']
-       freetype_libpath = ['#../lib/windows/gcc/freetype/lib']
-       freetype_include = ['#../lib/windows/gcc/freetype/include']
-       gettext_lib = []
-       gettext_libpath = []
-       gettext_include = []
-       # OpenAL library information
-       openal_lib = []
-       openal_libpath = []
-       openal_include = []
+if not env:
+    print "Could not create a build environment"
+    Exit()
 
-elif sys.platform == 'win32':
-       use_international = 'true'
-       use_gameengine = 'true'
-       use_openal = 'true'
-       use_fmod = 'false'
-       use_quicktime = 'true'
-       use_openexr = 'true'
-       use_bullet = 'true'
-       use_sumo = 'true'
-       use_ode = 'false'
-       use_buildinfo = 'true'
-       use_fluidsim = 'true'
-       build_blender_dynamic = 'true'
-       build_blender_static = 'false'
-       build_blender_player = 'true'
-       build_blender_plugin = 'false'
-       release_flags = ['/Og', '/Ot', '/Ob1', '/Op', '/G6']
-       debug_flags = ['/Zi', '/Fr${TARGET.base}.sbr']
-       extra_flags = ['/EHsc', '/J', '/W3', '/Gd', '/MT']
-       cxxflags = []
-       defines = ['WIN32', '_CONSOLE']
-       if use_quicktime == 'true':
-               defines += ['WITH_QUICKTIME']
-       defines += ['_LIB', 'USE_OPENAL']
-       defines += ['FTGL_LIBRARY_STATIC']
-       warn_flags = []
-       platform_libs = [ 'qtmlClient', 'soundsystem',
-                                        'ws2_32', 'dxguid', 'vfw32', 'winmm',
-                                        'iconv', 'kernel32', 'user32', 'gdi32',
-                                        'comdlg32', 'advapi32', 'shell32',
-                                        'ole32', 'oleaut32', 'uuid', 
-                                        'libcmt', 'libc']
-       platform_libpath = ['#../lib/windows/iconv/lib',
-                                               '#../lib/windows/QTDevWin/Libraries']
-       platform_linkflags = [
-                                               '/SUBSYSTEM:CONSOLE',
-                                               '/MACHINE:IX86',
-                                               '/ENTRY:mainCRTStartup',
-                                               '/INCREMENTAL:NO',
-                                               '/NODEFAULTLIB:"msvcprt.lib"',
-                                               '/NODEFAULTLIB:"glut32.lib"',
-                                               '/NODEFAULTLIB:"libcd.lib"',
-                                               #'/NODEFAULTLIB:"libc.lib"',
-                                               '/NODEFAULTLIB:"libcpd.lib"',
-                                               '/NODEFAULTLIB:"libcp.lib"',
-                                               '/NODEFAULTLIB:"libcmtd.lib"',
-                                               ]
-       window_system = 'WIN32'
-       extra_includes = []
-       if use_quicktime == 'true':
-               extra_includes += ['#../lib/windows/QTDevWin/CIncludes']
-       # z library information
-       z_lib = ['zlib']
-       z_libpath = ['#../lib/windows/zlib/lib']
-       z_include = ['#../lib/windows/zlib/include']
-       # png library information
-       png_lib = ['libpng_st']
-       png_libpath = ['#../lib/windows/png/lib']
-       png_include = ['#../lib/windows/png/include']
-       # OpenEXR library information
-       if use_openexr == 'true':
-               defines += ['WITH_OPENEXR']
-       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
-       openexr_libpath = ['/usr/lib']
-       openexr_include = ['/usr/include/OpenEXR']
-       # jpeg library information
-       jpeg_lib = ['libjpeg']
-       jpeg_libpath = ['#../lib/windows/jpeg/lib']
-       jpeg_include = ['#../lib/windows/jpeg/include']
-       # Tiff Library information
-       tiff_lib = ['libtiff']
-       tiff_libpath = ['#../lib/windows/tiff/lib']
-       tiff_include = ['#../lib/windows/tiff/include']
-       # OpenGL library information
-       opengl_lib = ['opengl32', 'glu32']
-       opengl_static = []
-       opengl_libpath = []
-       opengl_include = ['/usr/include']
-       # SDL library information
-       sdl_include = ['#../lib/windows/sdl/include']
-       sdl_libpath = ['#../lib/windows/sdl/lib']
-       sdl_lib = ['SDL']
-       sdl_cflags = []
-       window_system = 'WIN32'
-       # SOLID library information
-       solid_lib = ['extern/solid']
-       solid_libpath = ['#../lib/windows/solid/lib']
-       solid_include = ['#extern/solid']
-       qhull_lib = ['qhull']
-       qhull_libpath = ['#../lib/windows/qhull/lib']
-       qhull_include = ['#extern/qhull/include']
-       # Bullet library information
-       bullet_lib = []
-       bullet_libpath = []
-       bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics']
-       # ODE library information
-       ode_lib = []                                                                                            # TODO
-       ode_libpath = ['#../lib/windows/ode/lib']
-       ode_include = ['#../lib/windows/ode/include']
-       # Python lib name
-       python_include = ['#../lib/windows/python/include/python2.4']
-       python_libpath = ['#../lib/windows/python/lib']
-       python_lib = ['python24']
-       python_linkflags = []
-       # International stuff
-       ftgl_lib = []
-       ftgl_libpath = []
-       ftgl_include = ['#extern/bFTGL/include']
-       freetype_lib = ['freetype2ST']
-       freetype_libpath = ['#../lib/windows/freetype/lib']
-       freetype_include = ['#../lib/windows/freetype/include']
-       gettext_lib = ['gnu_gettext']
-       gettext_libpath = ['#../lib/windows/gettext/lib']
-       gettext_include = ['#../lib/windows/gettext/include']
-       # OpenAL library information
-       openal_lib = ['openal_static']
-       openal_libpath = ['#../lib/windows/openal/lib']
-       openal_include = ['#../lib/windows/openal/include']
+if env['CC'] in ['cl', 'cl.exe'] and sys.platform=='win32':
+    platform = 'win32-vc'
+elif env['CC'] in ['gcc'] and sys.platform=='win32':
+    platform = 'win32-mingw'
 
-elif string.find (sys.platform, 'sunos') != -1:
-       use_international = 'true'
-       use_gameengine = 'false'
-       use_openal = 'false'
-       use_fmod = 'false'
-       use_quicktime = 'false'
-       use_openexr = 'false'
-       use_sumo = 'false'
-       use_ode = 'false'
-       use_bullet = 'false'
-       use_buildinfo = 'false'
-       use_fluidsim = 'true'
-       build_blender_dynamic = 'true'
-       build_blender_static = 'false'
-       build_blender_player = 'false'
-       build_blender_plugin = 'false'
-       release_flags = ['-O2']
-       debug_flags = ['-O2', '-g']
-       extra_flags = ['-pipe', '-fPIC', '-funsigned-char', '-DSUN_OGL_NO_VERTEX_MACROS']
-       cxxflags = []
-       defines = []
-       warn_flags = ['-Wall', '-W']
-       window_system = 'X11'
-       platform_libs = ['stdc++', 'dl', 'm']
-       platform_libpath = []
-       platform_linkflags = []
-       extra_includes = []
-       # z library information
-       z_lib = ['z']
-       z_libpath = []
-       z_include = []
-       # png library information
-       png_lib = ['png']
-       png_libpath = []
-       png_include = []
-       # OpenEXR library information
-       if use_openexr == 'true':
-               defines += ['WITH_OPENEXR']
-       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
-       openexr_libpath = ['/usr/lib']
-       openexr_include = ['/usr/include/OpenEXR']
-       # jpeg library information
-       jpeg_lib = ['jpeg']
-       jpeg_libpath = []
-       jpeg_include = []
-       # OpenGL library information
-       opengl_lib = ['GL', 'GLU', 'X11']
-       opengl_static = []
-       opengl_libpath = ['/usr/openwin/include']
-       opengl_include = ['/usr/openwin/lib']
-       # SDL library information
-       sdl_env.ParseConfig ('sdl-config --cflags --libs')
-       sdl_cflags = sdl_env.Dictionary()['CCFLAGS']
-       sdl_include = sdl_env.Dictionary()['CPPPATH']
-       sdl_libpath = sdl_env.Dictionary()['LIBPATH']
-       sdl_lib = sdl_env.Dictionary()['LIBS']
-       # SOLID library information
-       solid_lib = []
-       solid_libpath = []
-       solid_include = ['#extern/solid']
-       qhull_lib = []
-       qhull_libpath = []
-       qhull_include = ['#extern/qhull/include']
-       # ODE library information
-       ode_lib = []
-       ode_libpath = []
-       ode_include = ['#extern/ode/dist/include/ode']
-       # Bullet library information
-       bullet_lib = []
-       bullet_libpath = []
-       bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics']
-       # Python variables.
-       python_lib = ['python%d.%d' % sys.version_info[0:2]]
-       python_libpath = [sysconfig.get_python_lib (0, 1) + '/config']
-       python_include = [sysconfig.get_python_inc ()]
-       python_linkflags = []
-       # International support information
-       ftgl_lib = []
-       ftgl_libpath = []
-       ftgl_include = ['#extern/bFTGL/include']
-       freetype_lib = ['freetype']
-       freetype_libpath = ['#../lib/solaris-2.8-sparc/freetype/lib']
-       freetype_include = ['#../lib/solaris-2.8-sparc/freetype/include']
-       gettext_lib = []
-       gettext_libpath = []
-       gettext_include = []
-       # OpenAL library information
-       openal_lib = []
-       openal_libpath = []
-       openal_include = []
+crossbuild = B.arguments.get('BF_CROSS', None)
+if crossbuild and platform!='win32':
+    platform = 'linuxcross'
 
-elif string.find (sys.platform, 'irix') != -1:
-       use_international = 'false'
-       use_gameengine = 'false'
-       use_openal = 'false'
-       use_fmod = 'false'
-       use_quicktime = 'false'
-       use_openexr = 'false'
-       use_sumo = 'false'
-       use_ode = 'false'
-       use_bullet = 'false'
-       use_buildinfo = 'false'
-       use_fluidsim = 'true'
-       build_blender_dynamic = 'true'
-       build_blender_static = 'false'
-       build_blender_player = 'false'
-       build_blender_plugin = 'false'
-       irix_precomp = '#../lib/irix-6.5-mips'
-       extra_flags = ['-n32', '-mips3', '-Xcpluscomm']
-       cxxflags = ['-n32', '-mips3', '-Xcpluscomm', '-LANG:std']
-       cxxflags += ['-LANG:libc_in_namespace_std=off']
-       
-       window_system = 'X11'
-       release_flags = ['-O2', '-OPT:Olimit=0']
-       debug_flags = ['-O2', '-g']
-       defines = []
-       warn_flags = ['-fullwarn', '-woff', '1001,1110,1201,1209,1355,1424,1681,3201']
-       platform_libs = ['movieGL', 'Xmu', 'Xext', 'X11',
-                                        'c', 'm', 'dmedia', 'cl', 'audio',
-                                        'Cio', 'pthread']
-       platform_libpath = ['/usr/lib32/mips3',
-                                               '/lib/freeware/lib32',
-                                               '/usr/lib32']
-       platform_linkflags = ['-mips3', '-n32']
-       extra_includes = ['/usr/freeware/include',
-                                         '/usr/include']
-       # z library information
-       z_lib = ['z']
-       z_libpath = []
-       z_include = []
-       # png library information
-       png_lib = ['png']
-       png_libpath = [irix_precomp + '/png/lib']
-       png_include = [irix_precomp + '/png/include']
-       # OpenEXR library information
-       if use_openexr == 'true':
-               defines += ['WITH_OPENEXR']
-       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
-       openexr_libpath = ['/usr/lib']
-       openexr_include = ['/usr/include/OpenEXR']
-       # jpeg library information
-       jpeg_lib = ['jpeg']
-       jpeg_libpath = [irix_precomp + '/jpeg/lib']
-       jpeg_include = [irix_precomp + '/jpeg/include']
-       # OpenGL library information
-       opengl_lib = ['GL', 'GLU']
-       opengl_static = []
-       opengl_libpath = []
-       opengl_include = []
-       # SDL library information
-       sdl_cflags = []
-       sdl_include = [irix_precomp + '/sdl/include/SDL']
-       sdl_libpath = [irix_precomp + '/sdl/lib']
-       sdl_lib = ['SDL', 'libSDL.a']
-       # SOLID library information
-       solid_lib = []
-       solid_libpath = []
-       solid_include = [irix_precomp + '/solid/include']
-       qhull_lib = []
-       qhull_libpath = []
-       qhull_include = ['#extern/qhull/include']
-       # Bullet library information
-       bullet_lib = []
-       bullet_libpath = []
-       bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics']
-       # ODE library information
-       ode_lib = []
-       ode_libpath = []
-       ode_include = [irix_precomp + '/ode/include']
-       # Python library information
-       python_libpath = [irix_precomp + '/python/lib/python2.2/config']
-       python_include = [irix_precomp + '/python/include/python2.2']
-       python_lib = ['python2.2']
-       python_linkflags = []
-       # International support information
-        ftgl_lib = []
-        ftgl_libpath = []
-        ftgl_include = ['#extern/bFTGL/include']
-       freetype_lib = ['freetype']
-       freetype_libpath = [irix_precomp + '/freetype/lib']
-       freetype_include = [irix_precomp + '/freetype/include']
-       gettext_lib = []
-       gettext_libpath = []
-       gettext_include = []
-       # OpenAL library information
-       openal_lib = []
-       openal_libpath = []
-       openal_include = []
+env['OURPLATFORM'] = platform
 
-elif string.find (sys.platform, 'hp-ux') != -1:
-       window_system = 'X11'
-       defines = []
-
-elif sys.platform=='openbsd3':
-       print "Building for OpenBSD 3.x"
-       use_international = 'false'
-       use_gameengine = 'false'
-       use_openal = 'false'
-       use_fmod = 'false'
-       use_quicktime = 'false'
-       use_openexr = 'false'
-       use_sumo = 'false'
-       use_ode = 'false'
-       use_bullet = 'false'
-       use_buildinfo = 'true'
-       use_fluidsim = 'true'
-       build_blender_dynamic = 'true'
-       build_blender_static = 'false'
-       build_blender_player = 'false'
-       build_blender_plugin = 'false'
-       release_flags = ['-O2']
-       debug_flags = ['-O2', '-g']
-       extra_flags = ['-pipe', '-fPIC', '-funsigned-char']
-       cxxflags = []
-       defines = []
-       warn_flags = ['-Wall','-W']
-       window_system = 'X11'
-       platform_libs = ['m', 'stdc++', 'pthread', 'util']
-       platform_libpath = []
-       platform_linkflags = []
-       extra_includes = []
-       z_lib = ['z']
-       z_libpath = ['/usr/lib']
-       z_include = ['/usr/include']
-       # png library information
-       png_lib = ['png']
-       png_libpath = ['/usr/local/lib']
-       png_include = ['/usr/local/include/libpng']
-       # OpenEXR library information
-       if use_openexr == 'true':
-               defines += ['WITH_OPENEXR']
-       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
-       openexr_libpath = ['/usr/lib']
-       openexr_include = ['/usr/include/OpenEXR']
-       # jpeg library information
-       jpeg_lib = ['jpeg']
-       jpeg_libpath = ['/usr/local/lib']
-       jpeg_include = ['/usr/local/include']
-       # OpenGL library information
-       opengl_lib = ['GL', 'GLU']
-       opengl_static = ['/usr/lib/libGL.a', '/usr/lib/libGLU.a']
-       opengl_libpath = ['/usr/lib', '/usr/X11R6/lib']
-       opengl_include = ['/usr/X11R6/include/']
-       # SDL library information
-       sdl_env.ParseConfig ('sdl-config --cflags --libs')
-       sdl_cflags = sdl_env.Dictionary()['CCFLAGS']
-       sdl_include = sdl_env.Dictionary()['CPPPATH']
-       sdl_libpath = sdl_env.Dictionary()['LIBPATH']
-       sdl_lib = sdl_env.Dictionary()['LIBS']
-       # SOLID library information
-       solid_lib = []
-       solid_libpath = []
-       solid_include = ['#extern/solid']
-       qhull_lib = []
-       qhull_libpath = []
-       qhull_include = ['#extern/qhull/include']
-       # Bullet library information
-       bullet_lib = []
-       bullet_libpath = []
-       bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics']
-       # ODE library information
-       ode_lib = ['ode']
-       ode_libpath = ['#../lib/linux-glibc2.2.5-i386/ode/lib']
-       ode_include = ['#../lib/linux-glibc2.2.5-i386/ode/include']
-       # Python library information
-       python_lib = ['python%d.%d' % sys.version_info[0:2]]
-       python_libpath = [sysconfig.get_python_lib (0, 1) + '/config']
-       python_include = [sysconfig.get_python_inc ()]
-       python_linkflags = []
-       # International support information
-        ftgl_lib = []
-        ftgl_libpath = []
-        ftgl_include = ['#extern/bFTGL/include']
-       freetype_env.ParseConfig('pkg-config --cflags --libs freetype2')
-       freetype_lib = freetype_env.Dictionary()['LIBS']
-       freetype_libpath = freetype_env.Dictionary()['LIBPATH']
-       freetype_include = freetype_env.Dictionary()['CPPPATH']
-       gettext_lib = []
-       gettext_libpath = []
-       gettext_include = []
-       # OpenAL library information
-       openal_lib = ['openal']
-       openal_libpath = ['/usr/lib']
-       openal_include = ['/usr/include']
-       
-elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
-       print "Building for FreeBSD"
-       use_international = 'false'
-       use_gameengine = 'false'
-       use_openal = 'false'
-       use_fmod = 'false'
-       use_quicktime = 'false'
-       use_openexr = 'false'
-       use_sumo = 'false'
-       use_ode = 'false'
-       use_bullet = 'false'
-       use_buildinfo = 'true'
-       use_fluidsim = 'true'
-       build_blender_dynamic = 'true'
-       build_blender_static = 'false'
-       build_blender_player = 'false'
-       build_blender_plugin = 'false'
-       release_flags = ['-O2']
-       debug_flags = ['-O2', '-g']
-       extra_flags = ['-pipe', '-fPIC', '-funsigned-char']
-       cxxflags = []
-       defines = []
-       warn_flags = ['-Wall','-W']
-       window_system = 'X11'
-       platform_libs = ['m', 'stdc++', 'util']
-       platform_libpath = []
-       platform_linkflags = ['-pthread']
-       extra_includes = []
-       z_lib = ['z']
-       z_libpath = ['/usr/lib']
-       z_include = ['/usr/include']
-       # png library information
-       png_lib = ['png']
-       png_libpath = ['/usr/local/lib']
-       png_include = ['/usr/local/include']
-       # OpenEXR library information
-       if use_openexr == 'true':
-               defines += ['WITH_OPENEXR']
-       openexr_lib = ['Iex', 'Half', 'IlmImf', 'Imath']
-       openexr_libpath = ['/usr/lib']
-       openexr_include = ['/usr/include/OpenEXR']
-       # jpeg library information
-       jpeg_lib = ['jpeg']
-       jpeg_libpath = ['/usr/local/lib']
-       jpeg_include = ['/usr/local/include']
-       # OpenGL library information
-       opengl_lib = ['GL', 'GLU']
-       opengl_static = ['/usr/lib/libGL.a', '/usr/lib/libGLU.a']
-       opengl_libpath = ['/usr/lib', '/usr/X11R6/lib']
-       opengl_include = ['/usr/X11R6/include/']
-       # SDL library information
-       sdl_env.ParseConfig ('sdl11-config --cflags --libs')
-       sdl_cflags = sdl_env.Dictionary()['CCFLAGS']
-       sdl_include = sdl_env.Dictionary()['CPPPATH']
-       sdl_libpath = ['/usr/local/include/SDL11']
-       sdl_lib = sdl_env.Dictionary()['LIBS']
-       # SOLID library information
-       solid_lib = []
-       solid_libpath = []
-       solid_include = ['#extern/solid']
-       qhull_lib = []
-       qhull_libpath = []
-       qhull_include = ['#extern/qhull/include']
-       # Bullet library information
-       bullet_lib = []
-       bullet_libpath = []
-       bullet_include = ['#extern/bullet','#extern/bullet/LinearMath','#extern/bullet/Bullet','#extern/bullet/BulletDynamics']
-       # ODE library information
-       ode_lib = ['ode']
-       ode_libpath = ['#../lib/linux-glibc2.2.5-i386/ode/lib']
-       ode_include = ['#../lib/linux-glibc2.2.5-i386/ode/include']
-       # Python library information
-       python_lib = ['python%d.%d' % sys.version_info[0:2]]
-       python_libpath = [sysconfig.get_python_lib (0, 1) + '/config']
-       python_include = [sysconfig.get_python_inc ()]
-       python_linkflags = []
-       # International support information
-       ftgl_lib = []
-       ftgl_libpath = []
-       ftgl_include = ['#extern/bFTGL/include']
-       freetype_env.ParseConfig('pkg-config --cflags --libs freetype2')
-       freetype_lib = freetype_env.Dictionary()['LIBS']
-       freetype_libpath = freetype_env.Dictionary()['LIBPATH']
-       freetype_include = freetype_env.Dictionary()['CPPPATH']
-       gettext_lib = []
-       gettext_libpath = []
-       gettext_include = []
-       # OpenAL library information
-       openal_lib = ['openal']
-       openal_libpath = ['/usr/lib']
-       openal_include = ['/usr/include']
+configfile = B.arguments.get('BF_CONFIG', 'config'+os.sep+platform+'-config.py')
 
+if os.path.exists(configfile):
+    print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + configfile
 else:
-       print "Unknown platform %s"%sys.platform
-       exit
-
-#-----------------------------------------------------------------------------
-# End of platform specific section
-#-----------------------------------------------------------------------------
-
-#-----------------------------------------------------------------------------
-# User configurable options to be saved in a config file.
-#-----------------------------------------------------------------------------
-# Checking for an existing config file - use that one if it exists,
-# otherwise create one.
-my_defines = []
-my_ccflags = []
-my_cxxflags = []
-my_ldflags = []
-if os.path.exists (bs_globals.config_file):
-       print "Using config file: " + bs_globals.config_file
-else:
-       print "Creating new config file: " + bs_globals.config_file
-       env_dict = env.Dictionary()
-       config=open (bs_globals.config_file, 'w')
-       config.write ("# Configuration file containing user definable options.\n")
-       config.write ("VERSION = %r\n"%(version))
-       config.write ("BUILD_BINARY = 'release'\n")
-       config.write ("USE_BUILDINFO = %r\n"%(use_buildinfo))
-       config.write ("BUILD_BLENDER_DYNAMIC = %r\n"%(build_blender_dynamic))
-       config.write ("BUILD_BLENDER_STATIC = %r\n"%(build_blender_static))
-       config.write ("BUILD_BLENDER_PLAYER = %r\n"%(build_blender_player))
-       config.write ("BUILD_BLENDER_PLUGIN = %r\n"%(build_blender_plugin))
-       config.write ("BUILD_DIR = %r\n"%(bs_globals.root_build_dir))
-       
-       config.write ("\n# Extra compiler flags can be defined here.\n")
-       config.write ("DEFINES = %s\n"%(my_defines))
-       config.write ("CCFLAGS = %s\n"%(my_ccflags))
-       config.write ("CXXFLAGS = %s\n"%(my_cxxflags))
-       config.write ("LDFLAGS = %s\n"%(my_ldflags))
-
-       config.write ("USE_INTERNATIONAL = %r\n"%(use_international))
-       config.write ("BUILD_GAMEENGINE = %r\n"%(use_gameengine))
-       if use_ode == 'true':
-               config.write ("USE_PHYSICS = 'ode'\n")
-       elif (use_bullet == 'true') and (use_sumo == 'false'):
-               config.write("USE_PHYSICS = 'bullet'\n")
-       else:
-               config.write ("USE_PHYSICS = 'solid'\n")
-       config.write ("USE_OPENAL = %r\n"%(use_openal))
-       config.write ("USE_FMOD = %r\n"%(use_fmod))
-       config.write ("USE_QUICKTIME = %r\n"%(use_quicktime))
-       config.write ("USE_OPENEXR = %r\n"%(use_openexr))
-       config.write ("USE_FLUIDSIM = %r\n"%(use_fluidsim))
-       config.write ("\n# Compiler information.\n")
-       config.write ("HOST_CC = %r\n"%(env_dict['CC']))
-       config.write ("HOST_CXX = %r\n"%(env_dict['CXX']))
-       config.write ("TARGET_CC = %r\n"%(env_dict['CC']))
-       config.write ("TARGET_CXX = %r\n"%(env_dict['CXX']))
-       config.write ("TARGET_AR = %r\n"%(env_dict['AR']))
-       config.write ("PATH = %r\n"%(os.environ['PATH']))
-       config.write ("\n# External library information.\n")
-       config.write ("PLATFORM_LIBS = %r\n"%(platform_libs))
-       config.write ("PLATFORM_LIBPATH = %r\n"%(platform_libpath))
-       config.write ("PLATFORM_LINKFLAGS = %r\n"%(platform_linkflags))
-       config.write ("PYTHON_INCLUDE = %r\n"%(python_include))
-       config.write ("PYTHON_LIBPATH = %r\n"%(python_libpath))
-       config.write ("PYTHON_LIBRARY = %r\n"%(python_lib))
-       config.write ("PYTHON_LINKFLAGS = %r\n"%(python_linkflags))
-       config.write ("SDL_CFLAGS = %r\n"%(sdl_cflags))
-       config.write ("SDL_INCLUDE = %r\n"%(sdl_include))
-       config.write ("SDL_LIBPATH = %r\n"%(sdl_libpath))
-       config.write ("SDL_LIBRARY = %r\n"%(sdl_lib))
-       config.write ("Z_INCLUDE = %r\n"%(z_include))
-       config.write ("Z_LIBPATH = %r\n"%(z_libpath))
-       config.write ("Z_LIBRARY = %r\n"%(z_lib))
-       config.write ("PNG_INCLUDE = %r\n"%(png_include))
-       config.write ("PNG_LIBPATH = %r\n"%(png_libpath))
-       config.write ("PNG_LIBRARY = %r\n"%(png_lib))
-        config.write ("OPENEXR_INCLUDE = %r\n"%(openexr_include))
-        config.write ("OPENEXR_LIBPATH = %r\n"%(openexr_libpath))
-        config.write ("OPENEXR_LIBRARY = %r\n"%(openexr_lib))
-       config.write ("JPEG_INCLUDE = %r\n"%(jpeg_include))
-       config.write ("JPEG_LIBPATH = %r\n"%(jpeg_libpath))
-       config.write ("JPEG_LIBRARY = %r\n"%(jpeg_lib))
-       config.write ("TIFF_INCLUDE = %r\n"%(tiff_include))
-       config.write ("TIFF_LIBPATH = %r\n"%(tiff_libpath))
-       config.write ("TIFF_LIBRARY = %r\n"%(tiff_lib))
-       config.write ("OPENGL_INCLUDE = %r\n"%(opengl_include))
-       config.write ("OPENGL_LIBPATH = %r\n"%(opengl_libpath))
-       config.write ("OPENGL_LIBRARY = %r\n"%(opengl_lib))
-       config.write ("OPENGL_STATIC = %r\n"%(opengl_static))
-       config.write ("\n# The following information is only necessary when you've enabled support for\n")
-       config.write ("# the game engine.\n")
-       config.write ("SOLID_INCLUDE = %r\n"%(solid_include))
-       config.write ("SOLID_LIBPATH = %r\n"%(solid_libpath))
-       config.write ("SOLID_LIBRARY = %r\n"%(solid_lib))
-       config.write ("QHULL_INCLUDE = %r\n"%(qhull_include))
-       config.write ("QHULL_LIBPATH = %r\n"%(qhull_libpath))
-       config.write ("QHULL_LIBRARY = %r\n"%(qhull_lib))
-       config.write ("ODE_INCLUDE = %r\n"%(ode_include))
-       config.write ("ODE_LIBPATH = %r\n"%(ode_libpath))
-       config.write ("ODE_LIBRARY = %r\n"%(ode_lib))
-       config.write ("BULLET_INCLUDE = %r\n"%(bullet_include))
-       config.write ("BULLET_LIBPATH = %r\n"%(bullet_libpath))
-       config.write ("BULLET_LIBRARY = %r\n"%(bullet_lib))
-       config.write ("OPENAL_INCLUDE = %r\n"%(openal_include))
-       config.write ("OPENAL_LIBPATH = %r\n"%(openal_libpath))
-       config.write ("OPENAL_LIBRARY = %r\n"%(openal_lib))
-       config.write ("\n# The following information is only necessary when building with\n")
-       config.write ("# internationalization support.\n");
-       config.write ("FTGL_INCLUDE = %r\n"%(ftgl_include))
-       config.write ("FTGL_LIBPATH = %r\n"%(ftgl_libpath))
-       config.write ("FTGL_LIBRARY = %r\n"%(ftgl_lib))
-       config.write ("FREETYPE_INCLUDE = %r\n"%(freetype_include))
-       config.write ("FREETYPE_LIBPATH = %r\n"%(freetype_libpath))
-       config.write ("FREETYPE_LIBRARY = %r\n"%(freetype_lib))
-       config.write ("GETTEXT_INCLUDE = %r\n"%(gettext_include))
-       config.write ("GETTEXT_LIBPATH = %r\n"%(gettext_libpath))
-       config.write ("GETTEXT_LIBRARY = %r\n"%(gettext_lib))
-       config.close ()
-
-#-----------------------------------------------------------------------------
-# Read the options from the config file and update the various necessary flags
-#-----------------------------------------------------------------------------
-list_opts = []
-user_options = Options (bs_globals.config_file)
-user_options_env = Environment (ENV = os.environ, options = user_options)
-user_options.AddOptions (
-               ('VERSION', 'Blender version', version),
-               (EnumOption ('BUILD_BINARY', 'release',
-                                       'Select a release or debug binary.',
-                                        allowed_values = ('release', 'debug'))),
-               (BoolOption ('USE_BUILDINFO',
-                                       'Set to 1 if you want to add build information.',
-                                       'false')),
-               (BoolOption ('BUILD_BLENDER_DYNAMIC',
-                                       'Set to 1 if you want to build blender with hardware accellerated OpenGL support.',
-                                       'true')),
-               (BoolOption ('BUILD_BLENDER_STATIC',
-                                       'Set to 1 if you want to build blender with software OpenGL support.',
-                                       'false')),
-               (BoolOption ('BUILD_BLENDER_PLAYER',
-                                       'Set to 1 if you want to build the blender player.',
-                                       'false')),
-               (BoolOption ('BUILD_BLENDER_PLUGIN',
-                                       'Set to 1 if you want to build the blender plugin.',
-                                       'false')),
-               ('BUILD_DIR', 'Target directory for intermediate files.',
-                                       bs_globals.root_build_dir),
-               (BoolOption ('USE_INTERNATIONAL',
-                                       'Set to 1 to have international support.',
-                                       'false')),
-               (EnumOption ('USE_PHYSICS', 'solid',
-                                       'Select which physics engine to use.',
-                                       allowed_values = ('ode', 'solid', 'bullet'))),
-               (BoolOption ('BUILD_GAMEENGINE',
-                                       'Set to 1 to build blender with game engine support.',
-                                       'false')),
-               (BoolOption ('USE_OPENAL',
-                                       'Set to 1 to build the game engine with OpenAL support.',
-                                       'false')),
-               (BoolOption ('USE_FMOD',
-                                       'Set to 1 to build the game engine with FMod support.',
-                                       'false')),
-               (BoolOption ('USE_QUICKTIME',
-                                       'Set to 1 to add support for QuickTime.',
-                                       'false')),
-               (BoolOption ('USE_OPENEXR',
-                                        'Set to 1 to add support for OpenEXR.',
-                                        'false')),
-               (BoolOption ('USE_FLUIDSIM', # NT test new
-                                       'Set to 0 to disable compilation of fluid simulation library El\'Beem.',
-                                       'true')),
-               ('HOST_CC', 'C compiler for the host platfor. This is the same as target platform when not cross compiling.'),
-               ('HOST_CXX', 'C++ compiler for the host platform. This is the same as target platform when not cross compiling.'),
-               ('TARGET_CC', 'C compiler for the target platform.'),
-               ('TARGET_CXX', 'C++ compiler for the target platform.'),
-               ('TARGET_AR', 'Linker command for linking libraries.'),
-               ('PATH', 'Standard search path'),
-               ('PLATFORM_LIBS', 'Platform specific libraries.'),
-               ('PLATFORM_LIBPATH', 'Platform specific library link path.'),
-               ('PLATFORM_LINKFLAGS', 'Platform specific linkflags'),
-               ('PYTHON_INCLUDE', 'Include directory for Python header files.'),
-               ('PYTHON_LIBPATH', 'Library path where the Python lib is located.'),
-               ('PYTHON_LIBRARY', 'Python library name.'),
-               ('PYTHON_LINKFLAGS', 'Python specific linkflags.'),
-               ('SDL_CFLAGS', 'Necessary CFLAGS when using sdl functionality.'),
-               ('SDL_INCLUDE', 'Include directory for SDL header files.'),
-               ('SDL_LIBPATH', 'Library path where the SDL library is located.'),
-               ('SDL_LIBRARY', 'SDL library name.'),
-               ('Z_INCLUDE', 'Include directory for zlib header files.'),
-               ('Z_LIBPATH', 'Library path where the zlib library is located.'),
-               ('Z_LIBRARY', 'Z library name.'),
-               ('PNG_INCLUDE', 'Include directory for png header files.'),
-               ('PNG_LIBPATH', 'Library path where the png library is located.'),
-               ('PNG_LIBRARY', 'png library name.'),
-                ('OPENEXR_INCLUDE', 'Include directory for OpenEXR header files.'),
-                ('OPENEXR_LIBPATH', 'Library path where the OpenEXR libraries are located.'),
-                ('OPENEXR_LIBRARY', 'OpenEXR library names.'),
-               ('JPEG_INCLUDE', 'Include directory for jpeg header files.'),
-               ('JPEG_LIBPATH', 'Library path where the jpeg library is located.'),
-               ('JPEG_LIBRARY', 'jpeg library name.'),
-               ('TIFF_INCLUDE', 'Include directory for TIFF header files.'),
-               ('TIFF_LIBPATH', 'Library path where the TIFF library is located.'),
-               ('TIFF_LIBRARY', 'TIFF library name.'),
-               ('OPENGL_INCLUDE', 'Include directory for OpenGL header files.'),
-               ('OPENGL_LIBPATH', 'Library path where the OpenGL libraries are located.'),
-               ('OPENGL_LIBRARY', 'OpenGL library names.'),
-               ('OPENGL_STATIC', 'Linker flags for static linking of Open GL.'),
-               ('SOLID_INCLUDE', 'Include directory for SOLID header files.'),
-               ('SOLID_LIBPATH', 'Library path where the SOLID library is located.'),
-               ('SOLID_LIBRARY', 'SOLID library name.'),
-               ('QHULL_INCLUDE', 'Include directory for QHULL header files.'),
-               ('QHULL_LIBPATH', 'Library path where the QHULL library is located.'),
-               ('QHULL_LIBRARY', 'QHULL library name.'),
-               ('ODE_INCLUDE', 'Include directory for ODE header files.'),
-               ('ODE_LIBPATH', 'Library path where the ODE library is located.'),
-               ('ODE_LIBRARY', 'ODE library name.'),
-               ('BULLET_INCLUDE', 'Include directory for BULLET header files.'),
-               ('BULLET_LIBPATH', 'Library path where the BULLET library is located.'),
-               ('BULLET_LIBRARY', 'BULLET library name'),
-               ('OPENAL_INCLUDE', 'Include directory for OpenAL header files.'),
-               ('OPENAL_LIBPATH', 'Library path where the OpenAL library is located.'),
-               ('OPENAL_LIBRARY', 'OpenAL library name.'),
-               ('FTGL_INCLUDE', 'Include directory for ftgl header files.'),
-               ('FTGL_LIBPATH', 'Library path where the ftgl library is located.'),
-               ('FTGL_LIBRARY', 'ftgl library name.'),
-               ('FREETYPE_INCLUDE', 'Include directory for freetype2 header files.'),
-               ('FREETYPE_LIBPATH', 'Library path where the freetype2 library is located.'),
-               ('FREETYPE_LIBRARY', 'Freetype2 library name.'),
-               ('GETTEXT_INCLUDE', 'Include directory for gettext header files.'),
-               ('GETTEXT_LIBPATH', 'Library path where the gettext library is located.'),
-               ('GETTEXT_LIBRARY', 'gettext library name.'),
-               ('DEFINES', 'Extra Preprocessor defines.'),
-               ('CCFLAGS', 'Extra C Compiler flags.'),
-               ('CXXFLAGS','Extra C++ Compiler flags.'),
-               ('LDFLAGS', 'Extra Linker flags.')
-       )
-user_options.Update (user_options_env)
-user_options_dict = user_options_env.Dictionary()
-Help(user_options.GenerateHelpText(user_options_env))
-bs_globals.root_build_dir = user_options_dict['BUILD_DIR']
-# SET MODULE VARS #
-init_env = Environment(ENV = os.environ)
-
-bs_globals.user_options_dict = user_options_dict
-bs_globals.init_env = init_env
-bs_globals.version = version
-bs_globals.shortversion = shortversion
-bs_globals.appname = appname
-bs_globals.playername = playername
-bs_globals.config_guess = config_guess
-# END SET MODULE VARS #
-
-if user_options_dict['BUILD_GAMEENGINE'] == 1:
-       defines += ['GAMEBLENDER=1']
-       defines += ['USE_BULLET']
-       if user_options_dict['USE_PHYSICS'] == 'ode':
-               defines += ['USE_ODE']
-       else:
-               defines += ['USE_SUMO_SOLID']
+    print B.bc.FAIL + configfile + " doesn't exist" + B.bc.ENDC
+
+if crossbuild and env['PLATFORM'] != 'win32':
+    print B.bc.HEADER+"Preparing for crossbuild"+B.bc.ENDC
+    env.Tool('crossmingw', ['tools'])
+    # todo: determine proper libs/includes etc.
+    # Needed for gui programs, console programs should do without it
+    env.Append(LINKFLAGS=['-mwindows'])
+
+# first read platform config. B.arguments will override
+optfiles = [configfile]
+if os.path.exists('user-config.py'):
+    print B.bc.OKGREEN + "Using config file: " + B.bc.ENDC + 'user-config.py'
+    optfiles += ['user-config.py']
 else:
-       defines += ['GAMEBLENDER=0']
-
-if user_options_dict['BUILD_BINARY'] == 'release':
-       cflags = extra_flags + release_flags + warn_flags
-       defines += ['NDEBUG']
+    print B.bc.WARNING + 'user-config.py' + " not found, no user overrides" + B.bc.ENDC
+
+opts = btools.read_opts(optfiles, B.arguments)
+opts.Update(env)
+
+# check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
+if 'blenderplayer' in B.targets:
+    env['WITH_BF_PLAYER'] = True
+
+# lastly we check for root_build_dir ( we should not do before, otherwise we might do wrong builddir
+#B.root_build_dir = B.arguments.get('BF_BUILDDIR', '..'+os.sep+'build'+os.sep+platform+os.sep)
+B.root_build_dir = env['BF_BUILDDIR']
+env['BUILDDIR'] = B.root_build_dir
+if not B.root_build_dir[-1]==os.sep:
+    B.root_build_dir += os.sep
+
+# We do a shortcut for clean when no quicklist is given: just delete
+# builddir without reading in SConscripts
+do_clean = None
+if 'clean' in B.targets:
+    do_clean = True
+
+if not quickie and do_clean:
+    print B.bc.HEADER+'Cleaning...'+B.bc.ENDC
+    dirs = os.listdir(B.root_build_dir)
+    for dir in dirs:
+        if os.path.isdir(B.root_build_dir + dir) == 1:
+            print "clean dir %s"%(B.root_build_dir+dir)
+            shutil.rmtree(B.root_build_dir+dir)
+    print B.bc.OKGREEN+'...done'+B.bc.ENDC
+    Exit()
+
+if not os.path.isdir ( B.root_build_dir):
+    os.makedirs ( B.root_build_dir )
+    os.makedirs ( B.root_build_dir + 'source' )
+    os.makedirs ( B.root_build_dir + 'intern' )
+    os.makedirs ( B.root_build_dir + 'extern' )
+    os.makedirs ( B.root_build_dir + 'lib' )
+    os.makedirs ( B.root_build_dir + 'bin' )
+
+Help(opts.GenerateHelpText(env))
+
+# default is new quieter output, but if you need to see the 
+# commands, do 'scons BF_QUIET=0'
+bf_quietoutput = B.arguments.get('BF_QUIET', '1')
+if bf_quietoutput=='1':
+    B.set_quiet_output(env)
 else:
-       cflags = extra_flags + debug_flags + warn_flags
-       if sys.platform == 'win32':
-               platform_linkflags = ['/DEBUG','/PDB:blender.pdb'] + platform_linkflags
-
-defines += user_options_dict['DEFINES']
-cflags += user_options_dict['CCFLAGS']
-cxxflags += user_options_dict['CXXFLAGS']
-platform_linkflags += user_options_dict['LDFLAGS'] 
-
-user_options_dict['PLATFORM_LINKFLAGS'] = platform_linkflags
-
-if user_options_dict['USE_FLUIDSIM'] == 0: # NT test new
-       use_fluidsim='false';
-
-#-----------------------------------------------------------------------------
-# Generic library generation environment. This one is the basis for each
-# library.
-#-----------------------------------------------------------------------------
-library_env = env.Copy ()
-library_env.Replace (CC = user_options_dict['TARGET_CC'])
-library_env.Replace (CXX = user_options_dict['TARGET_CXX'])
-library_env.Replace (PATH = user_options_dict['PATH'])
-library_env.Replace (AR = user_options_dict['TARGET_AR'])
-library_env.Append (CCFLAGS = cflags)
-library_env.Append (CXXFLAGS = cxxflags)
-library_env.Append (CPPDEFINES = defines)
-library_env.SConsignFile (bs_globals.root_build_dir+'scons-signatures')
-
-#-----------------------------------------------------------------------------
-# Settings to be exported to other SConscript files
-#-----------------------------------------------------------------------------
-
-if bs_globals.enable_clean==0: # only read SConscripts when not cleaning, this to cut overhead
-       Export ('cflags')
-       Export ('defines')
-       Export ('window_system')
-       Export ('extra_includes')
-       Export ('user_options_dict')
-       Export ('library_env')
-       Export ('sdl_env')
-       Export ('use_fluidsim') # NT test
-       
-       BuildDir (bs_globals.root_build_dir+'/extern', 'extern', duplicate=0)
-       SConscript (bs_globals.root_build_dir+'extern/SConscript')
-       BuildDir (bs_globals.root_build_dir+'/intern', 'intern', duplicate=0)
-       SConscript (bs_globals.root_build_dir+'intern/SConscript')
-       BuildDir (bs_globals.root_build_dir+'/source', 'source', duplicate=0)
-       SConscript (bs_globals.root_build_dir+'source/SConscript')
-       
-       libpath = (['#'+bs_globals.root_build_dir+'/lib'])
-       
-       link_env = library_env.Copy ()
-       link_env.Append (LIBPATH=libpath)
-
-def buildinfo(env, build_type):
-       """
-       Generate a buildinfo object
-       """
-       build_date = time.strftime ("%Y-%m-%d")
-       build_time = time.strftime ("%H:%M:%S")
-       obj = []
-       if user_options_dict['USE_BUILDINFO'] == 1:
-               if sys.platform=='win32':
-                       build_info_file = open("source/creator/winbuildinfo.h", 'w')
-                       build_info_file.write("char *build_date=\"%s\";\n"%build_date)
-                       build_info_file.write("char *build_time=\"%s\";\n"%build_time)
-                       build_info_file.write("char *build_platform=\"win32\";\n")
-                       build_info_file.write("char *build_type=\"dynamic\";\n")
-                       build_info_file.close()
-                       env.Append (CPPDEFINES = ['NAN_BUILDINFO', 'BUILD_DATE'])
-               else:
-                       env.Append (CPPDEFINES = ['BUILD_TIME=\'"%s"\''%(build_time),
-                                                       'BUILD_DATE=\'"%s"\''%(build_date),
-                                                       'BUILD_TYPE=\'"dynamic"\'',
-                                                       'NAN_BUILDINFO',
-                                                       'BUILD_PLATFORM=\'"%s"\''%(sys.platform)])
-               obj = [env.Object (bs_globals.root_build_dir+'source/creator/%s_buildinfo'%build_type,
-                                               [bs_globals.root_build_dir+'source/creator/buildinfo.c'])]
-       return obj
-
-if bs_globals.enable_clean == 0:
-       if user_options_dict['BUILD_BLENDER_DYNAMIC'] == 1:
-               dy_blender = link_env.Copy ()
-               if sys.platform=='win32':
-                       bs_libs.winblenderres(dy_blender)
-               bs_libs.blender_libs(dy_blender)
-               bs_libs.common_libs(dy_blender)
-               bs_libs.international_libs(dy_blender)
-               bs_libs.ketsji_libs(dy_blender)
-               bs_libs.system_libs(dy_blender)
-               dy_blender.Append (LIBS=user_options_dict['OPENGL_LIBRARY'])
-               dy_blender.Append (LIBPATH=user_options_dict['OPENGL_LIBPATH'])
-               dy_blender.Append (CPPPATH=user_options_dict['OPENGL_INCLUDE'])
-               d_obj = buildinfo(dy_blender, "dynamic")
-               if sys.platform == 'win32':
-                       dy_blender.Program (target='blender',
-                                               source=d_obj + ['source/icons/winblender.res'])
-               else:
-                       if sys.platform == 'cygwin':
-                               dy_blender.Replace (CC='g++')
-                       dy_blender.Program (target='blender', source=d_obj)
-       
-       if user_options_dict['BUILD_BLENDER_STATIC'] == 1:
-               st_blender = link_env.Copy ()
-               if sys.platform=='win32':
-                       bs_libs.winblenderres(st_blender)
-               bs_libs.blender_libs(st_blender)
-               bs_libs.common_libs(st_blender)
-               bs_libs.international_libs(st_blender)
-               bs_libs.ketsji_libs(st_blender)
-               bs_libs.system_libs(st_blender)
-               # The next line is to make sure that the LINKFLAGS are appended at the end
-               # of the link command. This 'trick' is needed because the GL and GLU static
-               # libraries need to be at the end of the command.
-               st_blender.Replace(LINKCOM="$LINK -o $TARGET $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $LINKFLAGS")
-               s_obj = buildinfo(st_blender, "static")
-               st_blender.Append (LINKFLAGS=user_options_dict['OPENGL_STATIC'])
-               st_blender.Append (CPPPATH=user_options_dict['OPENGL_INCLUDE'])
-               st_blender.Prepend (LIBPATH=['/usr/lib/opengl/xfree/lib'])
-               st_blender.Program (target='blenderstatic', source=s_obj)
-       
-       if sys.platform=='win32':
-               if user_options_dict['BUILD_BINARY']=='debug':
-                       browser = Environment(ENV = os.environ)
-                       browser_tmp = bs_globals.root_build_dir+'bscmake.tmp'
-                       browser.Command ('blender.bsc', 'blender$PROGSUFFIX',
-                               ['dir /b/s '+bs_globals.root_build_dir+'*.sbr >'+browser_tmp,
-                                'bscmake /nologo /n /oblender.bsc @'+browser_tmp,
-                                'del '+browser_tmp])
-       
-       if user_options_dict['BUILD_BLENDER_PLAYER'] == 1 and user_options_dict['BUILD_GAMEENGINE'] == 1:
-               player_blender = link_env.Copy()
-               bs_libs.player_libs(player_blender)
-               bs_libs.common_libs(player_blender)
-               bs_libs.international_libs(player_blender)
-               bs_libs.ketsji_libs(player_blender)
-               bs_libs.player_libs2(player_blender)
-               bs_libs.system_libs(player_blender)
-               player_blender.Append (LIBS=user_options_dict['OPENGL_LIBRARY'])
-               player_blender.Append (LIBPATH=user_options_dict['OPENGL_LIBPATH'])
-               player_blender.Append (CPPPATH=user_options_dict['OPENGL_INCLUDE'])
-               d_obj = buildinfo(player_blender, "player")
-               if sys.platform == 'win32':
-                       player_blender.Program (target='blenderplayer',
-                                               source=d_obj + ['source/icons/winblender.res'])
-               else:
-                       if sys.platform == 'cygwin':
-                               player_blender.Replace (CC='g++')
-                       player_blender.Program (target='blenderplayer', source=d_obj)
-               if sys.platform=='win32':
-                       if user_options_dict['BUILD_BINARY']=='debug':
-                               browser = Environment(ENV = os.environ)
-                               browser_tmp = bs_globals.root_build_dir+'bscmake.tmp'
-                               browser.Command ('blenderplayer.bsc', 'blenderplayer$PROGSUFFIX',
-                               ['dir /b/s '+bs_globals.root_build_dir+'*.sbr >'+browser_tmp,
-                               'bscmake /nologo /n /oblenderplayer.bsc @'+browser_tmp,
-                               'del '+browser_tmp])
-
-       release_target = env.Alias("release", bs_arc.BlenderRelease(appname))
-       default_target = env.Alias("default", bs_default.BlenderDefault(appname))
-       wininst_target = env.Alias("winist", bs_nsis.BlenderNSIS(appname))
-       if bs_globals.docopy == 1:
-               bincopy_target = env.Alias("bincopy", bs_bincopy.BlenderCopy(appname))
-               
-else: # only clean target to prevent any building
-       clean_target = env.Alias("clean", bs_clean.DoClean(bs_globals.root_build_dir))
-       Default("clean")
-
-if bs_globals.enable_clean == 0: # only set up dependencies when not cleaning
-       if sys.platform == 'darwin':
-               Default("release")
-       else:
-               Default("default")
+    if toolset=='msvc':
+        B.msvc_hack(env)
+
+print B.bc.HEADER+'Building in '+B.bc.ENDC+B.root_build_dir
+env.SConsignFile(B.root_build_dir+'scons-signatures')
+B.init_lib_dict()
+
+##### END SETUP ##########
+
+Export('env')
+#Export('root_build_dir') # this one is still needed for makesdna
+##TODO: improve makesdna usage
+
+BuildDir(B.root_build_dir+'/intern', 'intern', duplicate=0)
+SConscript(B.root_build_dir+'/intern/SConscript')
+BuildDir(B.root_build_dir+'/extern', 'extern', duplicate=0)
+SConscript(B.root_build_dir+'/extern/SConscript')
+BuildDir(B.root_build_dir+'/source', 'source', duplicate=0)
+SConscript(B.root_build_dir+'/source/SConscript')
+
+# now that we have read all SConscripts, we know what
+# libraries will be built. Create list of
+# libraries to give as objects to linking phase
+mainlist = []
+for tp in B.possible_types:
+    if not tp == 'player' and not tp == 'player2':
+        mainlist += B.create_blender_liblist(env, tp)
+
+if B.arguments.get('BF_PRIORITYLIST', '0')=='1':
+    B.propose_priorities()
+
+dobj = B.buildinfo(env, "dynamic")
+thestatlibs, thelibincs = B.setup_staticlibs(env)
+thesyslibs = B.setup_syslibs(env)
+
+env.BlenderProg(B.root_build_dir, "blender", dobj + mainlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs)
+if env['WITH_BF_PLAYER']:
+    playerlist = B.create_blender_liblist(env, 'player')
+    playerlist += B.create_blender_liblist(env, 'core')
+    playerlist += B.create_blender_liblist(env, 'common')
+    playerlist += B.create_blender_liblist(env, 'intern')
+    playerlist += B.create_blender_liblist(env, 'international')
+    playerlist += B.create_blender_liblist(env, 'game')
+    playerlist += B.create_blender_liblist(env, 'game2')
+    playerlist += B.create_blender_liblist(env, 'player2')
+    env.BlenderProg(B.root_build_dir, "blenderplayer", dobj + playerlist + thestatlibs, [], thesyslibs, [B.root_build_dir+'/lib'] + thelibincs)
+
+##### Now define some targets
+
+
+#------------ INSTALL
+
+blenderinstall = env.Install(dir=env['BF_INSTALLDIR'], source=B.program_list)
+
+#-- .blender
+dotblendlist = []
+dottargetlist = []
+for dp, dn, df in os.walk('bin/.blender'):
+    dn.remove('CVS')
+    for f in df:
+        dotblendlist.append(dp+os.sep+f)
+        dottargetlist.append(env['BF_INSTALLDIR']+dp[3:]+os.sep+f)
+
+dotblenderinstall = []
+for targetdir,srcfile in zip(dottargetlist, dotblendlist):
+    td, tf = os.path.split(targetdir)
+    dotblenderinstall.append(env.Install(dir=td, source=srcfile))
+
+#-- .blender/scripts
+scriptlist = glob.glob('release/scripts/*.py')
+scriptinstall = env.Install(dir=env['BF_INSTALLDIR']+'/.blender/scripts', source=scriptlist)
+
+#-- plugins
+pluglist = []
+plugtargetlist = []
+for tp, tn, tf in os.walk('release/plugins'):
+    tn.remove('CVS')
+    for f in tf:
+        pluglist.append(tp+os.sep+f)
+        plugtargetlist.append(env['BF_INSTALLDIR']+tp[7:]+os.sep+f)
+
+plugininstall = []
+for targetdir,srcfile in zip(plugtargetlist, pluglist):
+    td, tf = os.path.split(targetdir)
+    plugininstall.append(env.Install(dir=td, source=srcfile))
+
+textlist = []
+texttargetlist = []
+for tp, tn, tf in os.walk('release/text'):
+    tn.remove('CVS')
+    for f in tf:
+        textlist.append(tp+os.sep+f)
+
+textinstall = env.Install(dir=env['BF_INSTALLDIR'], source=textlist)
+
+allinstall = [blenderinstall, dotblenderinstall, scriptinstall, plugininstall, textinstall]
+
+if sys.platform=='win32':
+    # TODO: gather all needed dlls from lib/windows for inclusion in install
+    windlls = []
+    allinstall += windlls
+
+installtarget = env.Alias('install', [allinstall])
+bininstalltarget = env.Alias('install-bin', blenderinstall)
+
+if env['WITH_BF_PLAYER']:
+    blenderplayer = env.Alias('blenderplayer', B.program_list)
+Default(B.program_list)
+Default(installtarget)
+
+#------------ RELEASE
+# TODO: zipup the installation
+
+#------------ BLENDERPLAYER
+# TODO: build stubs and link into blenderplayer
+
+#------------ EPYDOC
+# TODO: run epydoc
 
-       if sys.platform == 'win32':
-               if user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
-                       env.Depends(wininst_target, playername)
-               env.Depends(wininst_target, appname)
-       
-       if user_options_dict['BUILD_BLENDER_PLAYER'] == 1:
-               env.Depends(release_target, playername)
-               env.Depends(default_target, playername)
-               if bs_globals.docopy == 1:
-                       env.Depends(bincopy_target, playername)
-       env.Depends(release_target, appname)
-       env.Depends(default_target, appname)
-       if bs_globals.docopy == 1:
-               env.Depends(bincopy_target, appname)
diff --git a/config/darwin-config.py b/config/darwin-config.py
new file mode 100644 (file)
index 0000000..2fdfba4
--- /dev/null
@@ -0,0 +1,149 @@
+LCGDIR = '#../lib/darwin-6.1-powerpc'
+BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
+BF_PYTHON_VERSION = '2.4'
+BF_PYTHON_INC = BF_PYTHON + BF_PYTHON_VERSION + '/include/python' + BF_PYTHON_VERSION
+BF_PYTHON_BINARY = BF_PYTHON + BF_PYTHON_VERSION +'/bin/python'+BF_PYTHON_VERSION
+BF_PYTHON_LIB = ''
+BF_PYTHON_LIBPATH = '/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/config'
+BF_PYTHON_LINKFLAGS = '-u __dummy -u _PyMac_Error -framework System -framework Python'
+
+WITH_BF_OPENAL = 'true'
+BF_OPENAL = LCGDIR + '/openal'
+BF_OPENAL_INC = BF_OPENAL + '/include'
+BF_OPENAL_LIB = 'openal'
+BF_OPENAL_LIBPATH = BF_OPENAL + '/lib'
+
+WITH_BF_SDL = 'true'
+BF_SDL = LCGDIR + '/sdl' #$(shell sdl-config --prefix)
+BF_SDL_INC = BF_SDL + '/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+BF_SDL_LIBPATH = BF_SDL + '/lib'
+
+WITH_BF_FMOD = 'false'
+BF_FMOD = LCGDIR + '/fmod'
+
+WITH_BF_OPENEXR = 'true'
+BF_OPENEXR = '/usr/local'
+BF_OPENEXR_INC = BF_OPENEXR + '/include/OpenEXR'
+BF_OPENEXR_LIB = ' Iex Half IlmImf Imath '
+
+
+WITH_BF_JPEG = 'true'
+BF_JPEG = LCGDIR + '/jpeg'
+BF_JPEG_INC = BF_JPEG + '/include'
+BF_JPEG_LIB = 'jpeg'
+BF_JPEG_LIBPATH = BF_JPEG + '/lib'
+
+WITH_BF_PNG = 'true'
+BF_PNG = LCGDIR + '/png'
+BF_PNG_INC = BF_PNG + '/include'
+BF_PNG_LIB = 'png'
+BF_PNG_LIBPATH = BF_PNG + '/lib'
+
+WITH_BF_TIFF = 'true'
+BF_TIFF = LCGDIR + '/tiff'
+BF_TIFF_INC = BF_TIFF + '/include'
+BF_TIFF_LIB = 'tiff'
+BF_TIFF_LIBPATH = BF_TIFF + '/lib'
+
+WITH_BF_ZLIB = 'true'
+BF_ZLIB = '/usr'
+BF_ZLIB_INC = BF_ZLIB + '/include'
+BF_ZLIB_LIB = 'z'
+
+WITH_BF_GETTEXT = 'true'
+BF_GETTEXT = LCGDIR + '/gettext'
+BF_GETTEXT_INC = BF_GETTEXT + '/include'
+BF_GETTEXT_LIB = 'intl'
+BF_GETTEXT_LIBPATH = BF_GETTEXT + '/lib'
+
+WITH_BF_FTGL = 'true'
+BF_FTGL = '#extern/bFTGL'
+BF_FTGL_INC = BF_FTGL + '/include'
+BF_FTGL_LIB = 'extern_ftgl'
+
+WITH_BF_GAMEENGINE='true'
+
+WITH_BF_ODE = 'false'
+BF_ODE = LCGDIR + '/ode'
+BF_ODE_INC = BF_ODE + '/include'
+BF_ODE_LIB = BF_ODE + '/lib/libode.a'
+
+WITH_BF_BULLET = 'true'
+BF_BULLET = '#extern/bullet'
+BF_BULLET_INC = BF_BULLET + '/LinearMath ' + BF_BULLET + '/BulletDynamics ' + BF_BULLET + '/Bullet'
+BF_BULLET_LIB = 'extern_bullet'
+
+BF_SOLID = '#extern/solid'
+BF_SOLID_INC = BF_SOLID
+BF_SOLID_LIB = 'extern_solid'
+
+#WITH_BF_NSPR = 'true'
+#BF_NSPR = $(LCGDIR)/nspr
+#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
+#BF_NSPR_LIB = 
+
+# Uncomment the following line to use Mozilla inplace of netscape
+#CPPFLAGS += -DMOZ_NOT_NET
+# Location of MOZILLA/Netscape header files...
+#BF_MOZILLA = $(LCGDIR)/mozilla
+#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
+#BF_MOZILLA_LIB =
+# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
+# if this is not set.
+#
+# Be paranoid regarding library creation (do not update archives)
+#BF_PARANOID = 'true'
+
+# enable freetype2 support for text objects
+WITH_BF_FREETYPE = 'true'
+BF_FREETYPE = LCGDIR + '/freetype'
+BF_FREETYPE_INC = BF_FREETYPE + '/include ' + BF_FREETYPE + '/include/freetype2'
+BF_FREETYPE_LIB = 'freetype'
+BF_FREETYPE_LIBPATH = BF_FREETYPE + '/lib'
+
+WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
+
+# Mesa Libs should go here if your using them as well....
+WITH_BF_OPENGL = 'true'
+BF_OPENGL_LIB = 'GL GLU'
+BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
+BF_OPENGL_LINKFLAGS = '-framework OpenGL'
+
+##
+##CC = gcc
+##CCC = g++
+##ifeq ($CPU),alpha)
+##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
+
+CFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
+
+CPPFLAGS = ['-DXP_UNIX']
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
+PLATFORM_LINKFLAGS = '-framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime'
+REL_CFLAGS = ' -O2 '
+REL_CCFLAGS = ' -O2 '
+##BF_DEPEND = 'true'
+##
+##AR = ar
+##ARFLAGS = ruv
+##ARFLAGSQUIET = ru
+##
+C_WARN = ' -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wredundant-decls -Wno-long-double'
+
+CC_WARN = ' -Wall -W -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wredundant-decls -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wsign-promo -Wsynth -Wno-long-double'
+
+##FIX_STUBS_WARNINGS = -Wno-unused
+
+LLIBS = 'stdc++'
+##LOPTS = --dynamic
+##DYNLDFLAGS = -shared $(LDFLAGS)
+
+BF_PROFILE_FLAGS = ' -pg -g '
+BF_PROFILE = 'false'
+
+BF_DEBUG = 'false'
+BF_DEBUG_FLAGS = ''
+
+BF_BUILDDIR='../build/darwin'
+BF_INSTALLDIR='../install/darwin'
diff --git a/config/linux2-config.py b/config/linux2-config.py
new file mode 100644 (file)
index 0000000..6d6ffe7
--- /dev/null
@@ -0,0 +1,142 @@
+LCGDIR = '../lib/linux2'
+BF_PYTHON = '/usr'
+BF_PYTHON_VERSION = '2.4'
+BF_PYTHON_INC = BF_PYTHON + '/include/python' + BF_PYTHON_VERSION
+BF_PYTHON_BINARY = BF_PYTHON+'/bin/python'+BF_PYTHON_VERSION
+BF_PYTHON_LIB = 'python' + BF_PYTHON_VERSION #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
+
+WITH_BF_OPENAL = 'true'
+BF_OPENAL = '/usr'
+BF_OPENAL_INC = BF_OPENAL+'/include'
+BF_OPENAL_LIB = 'openal'
+
+WITH_BF_SDL = 'true'
+BF_SDL = '/usr' #$(shell sdl-config --prefix)
+BF_SDL_INC = BF_SDL + '/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+
+WITH_BF_FMOD = 'false'
+BF_FMOD = LCGDIR + '/fmod'
+
+WITH_BF_OPENEXR = 'true'
+BF_OPENEXR = '/usr'
+BF_OPENEXR_INC = BF_OPENEXR + '/include/OpenEXR'
+BF_OPENEXR_LIB = ' Iex Half IlmImf Imath '
+
+WITH_BF_JPEG = 'true'
+BF_JPEG = '/usr'
+BF_JPEG_INC = BF_JPEG + '/include'
+BF_JPEG_LIB = 'jpeg'
+
+WITH_BF_PNG = 'true'
+BF_PNG = '/usr'
+BF_PNG_INC = BF_PNG + '/include'
+BF_PNG_LIB = 'png'
+
+WITH_BF_TIFF = 'true'
+BF_TIFF = '/usr'
+BF_TIFF_INC = BF_TIFF + '/include'
+BF_TIFF_LIB = 'tiff'
+
+WITH_BF_ZLIB = 'true'
+BF_ZLIB = '/usr'
+BF_ZLIB_INC = BF_ZLIB + '/include'
+BF_ZLIB_LIB = 'z'
+
+WITH_BF_GETTEXT = 'true'
+BF_GETTEXT = '/usr'
+BF_GETTEXT_INC = BF_GETTEXT + '/include'
+BF_GETTEXT_LIB = 'gettextlib'
+BF_GETTEXT_LIBPATH = BF_GETTEXT + '/lib'
+
+WITH_BF_FTGL = 'true'
+BF_FTGL = '#extern/bFTGL'
+BF_FTGL_INC = BF_FTGL + '/include'
+BF_FTGL_LIB = 'extern_ftgl'
+
+WITH_BF_GAMEENGINE='true'
+
+WITH_BF_ODE = 'false'
+BF_ODE = LCGDIR + '/ode'
+BF_ODE_INC = BF_ODE + '/include'
+BF_ODE_LIB = BF_ODE + '/lib/libode.a'
+
+WITH_BF_BULLET = 'true'
+BF_BULLET = '#extern/bullet'
+BF_BULLET_INC = BF_BULLET + '/LinearMath ' + BF_BULLET + '/BulletDynamics ' + BF_BULLET + '/Bullet'
+BF_BULLET_LIB = 'extern_bullet'
+
+BF_SOLID = '#extern/solid'
+BF_SOLID_INC = BF_SOLID
+BF_SOLID_LIB = 'extern_solid'
+
+#WITH_BF_NSPR = 'true'
+#BF_NSPR = $(LCGDIR)/nspr
+#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
+#BF_NSPR_LIB = 
+
+# Uncomment the following line to use Mozilla inplace of netscape
+#CPPFLAGS += -DMOZ_NOT_NET
+# Location of MOZILLA/Netscape header files...
+#BF_MOZILLA = $(LCGDIR)/mozilla
+#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
+#BF_MOZILLA_LIB =
+# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
+# if this is not set.
+#
+# Be paranoid regarding library creation (do not update archives)
+#BF_PARANOID = 'true'
+
+# enable freetype2 support for text objects
+WITH_BF_FREETYPE = 'true'
+BF_FREETYPE = '/usr'
+BF_FREETYPE_INC = BF_FREETYPE + '/include ' + BF_FREETYPE + '/include/freetype2'
+BF_FREETYPE_LIB = 'freetype'
+
+WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
+BF_QUICKTIME = '/usr/local'
+BF_QUICKTIME_INC = BF_QUICKTIME + '/include' 
+
+# Mesa Libs should go here if your using them as well....
+WITH_BF_OPENGL = 'true'
+BF_OPENGL = '/usr/X11R6'
+BF_OPENGL_INC = BF_OPENGL + '/include'
+BF_OPENGL_LIB = 'GL GLU Xmu Xext X11 Xi'
+BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
+BF_OPENGL_LIB_STATIC = BF_OPENGL + '/lib/libGL.a ' + BF_OPENGL + '/lib/libGLU.a ' + BF_OPENGL + '/lib/libXmu.a ' + BF_OPENGL + '/lib/libXext.a ' + BF_OPENGL + '/lib/libX11.a ' + BF_OPENGL + '/lib/libXi.a'
+##
+##CC = gcc
+##CCC = g++
+##ifeq ($CPU),alpha)
+##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
+
+CFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
+
+CPPFLAGS = ['-DXP_UNIX']
+CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing']
+REL_CFLAGS = ' -O2 '
+REL_CCFLAGS = ' -O2 '
+##BF_DEPEND = 'true'
+##
+##AR = ar
+##ARFLAGS = ruv
+##ARFLAGSQUIET = ru
+##
+C_WARN = ' -Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wredundant-decls '
+
+CC_WARN = ' -Wall -W -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wredundant-decls -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wsign-promo -Wsynth '
+
+##FIX_STUBS_WARNINGS = -Wno-unused
+
+LLIBS = 'util c m dl pthread stdc++'
+##LOPTS = --dynamic
+##DYNLDFLAGS = -shared $(LDFLAGS)
+
+BF_PROFILE_FLAGS = ' -pg -g '
+BF_PROFILE = 'false'
+
+BF_DEBUG = 'false'
+BF_DEBUG_FLAGS = ''
+
+BF_BUILDDIR = '../build/linux2'
+BF_INSTALLDIR='../install/linux2'
diff --git a/config/linuxcross-config.py b/config/linuxcross-config.py
new file mode 100644 (file)
index 0000000..a17a9d0
--- /dev/null
@@ -0,0 +1,133 @@
+LCGDIR = '../lib/linux2'
+BF_PYTHON = '/usr'
+BF_PYTHON_VERSION = '2.4'
+BF_PYTHON_INC = BF_PYTHON + '/include/python' + BF_PYTHON_VERSION
+BF_PYTHON_BINARY = BF_PYTHON+'/bin/python'+BF_PYTHON_VERSION
+BF_PYTHON_LIB = 'python' + BF_PYTHON_VERSION #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
+
+WITH_BF_OPENAL = 'true'
+BF_OPENAL = '/usr'
+BF_OPENAL_INC = BF_OPENAL+'/include'
+BF_OPENAL_LIB = 'openal'
+
+WITH_BF_SDL = 'true'
+BF_SDL = '/usr' #$(shell sdl-config --prefix)
+BF_SDL_INC = BF_SDL + '/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+
+WITH_BF_FMOD = 'false'
+BF_FMOD = LCGDIR + '/fmod'
+
+WITH_BF_JPEG = 'true'
+BF_JPEG = '/usr'
+BF_JPEG_INC = BF_JPEG + '/include'
+BF_JPEG_LIB = 'jpeg'
+
+WITH_BF_OPENEXR = 'true'
+BF_OPENEXR = '/usr'
+BF_OPENEXR_INC = BF_OPENEXR + '/include/OpenEXR'
+BF_OPENEXR_LIB = ' Iex Half IlmImf Imath '
+
+WITH_BF_PNG = 'true'
+BF_PNG = '/usr'
+BF_PNG_INC = BF_PNG + '/include'
+BF_PNG_LIB = 'png'
+
+WITH_BF_TIFF = 'true'
+BF_TIFF = '/usr'
+BF_TIFF_INC = BF_TIFF + '/include'
+BF_TIFF_LIB = 'tiff'
+
+WITH_BF_ZLIB = 'true'
+BF_ZLIB = '/usr'
+BF_ZLIB_INC = BF_ZLIB + '/include'
+BF_ZLIB_LIB = 'z'
+
+WITH_BF_GETTEXT = 'true'
+BF_GETTEXT = '/usr'
+BF_GETTEXT_INC = BF_GETTEXT + '/include'
+BF_GETTEXT_LIB = BF_GETTEXT + '/lib/libintl.a'
+
+WITH_BF_FTGL = 'true'
+BF_FTGL = '#extern/bFTGL'
+BF_FTGL_INC = BF_FTGL + '/include'
+BF_FTGL_LIB = 'extern_ftgl'
+
+
+WITH_BF_ODE = 'false'
+BF_ODE = LCGDIR + '/ode'
+BF_ODE_INC = BF_ODE + '/include'
+BF_ODE_LIB = BF_ODE + '/lib/libode.a'
+
+WITH_BF_BULLET = 'true'
+BF_BULLET = '#extern/bullet'
+BF_BULLET_INC = BF_BULLET + '/LinearMath ' + BF_BULLET + '/BulletDynamics ' + BF_BULLET + '/Bullet'
+BF_BULLET_LIB = 'extern_bullet'
+
+BF_SOLID = '#extern/solid'
+BF_SOLID_INC = BF_SOLID + '/include ' + BF_SOLID
+BF_SOLID_LIB = 'extern_solid'
+
+#WITH_BF_NSPR = 'true'
+#BF_NSPR = $(LCGDIR)/nspr
+#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
+#BF_NSPR_LIB = 
+
+# Uncomment the following line to use Mozilla inplace of netscape
+#CPPFLAGS += -DMOZ_NOT_NET
+# Location of MOZILLA/Netscape header files...
+#BF_MOZILLA = $(LCGDIR)/mozilla
+#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
+#BF_MOZILLA_LIB =
+# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
+# if this is not set.
+#
+# Be paranoid regarding library creation (do not update archives)
+#BF_PARANOID = 'true'
+
+# enable freetype2 support for text objects
+WITH_BF_FREETYPE = 'true'
+BF_FREETYPE = '/usr'
+BF_FREETYPE_INC = BF_FREETYPE + '/include ' + BF_FREETYPE + '/include/freetype2'
+BF_FREETYPE_LIB = 'freetype'
+
+WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
+BF_QUICKTIME = '/usr/local'
+BF_QUICKTIME_INC = BF_QUICKTIME + '/include' 
+
+# Mesa Libs should go here if your using them as well....
+WITH_BF_OPENGL = 'true'
+BF_OPENGL = '/usr/X11R6'
+BF_OPENGL_INC = BF_OPENGL + '/include'
+BF_OPENGL_LIB = 'GL GLU Xmu Xext X11 Xi'
+BF_OPENGL_LIB_STATIC = BF_OPENGL + '/lib/libGL.a ' + BF_OPENGL + '/lib/libGLU.a ' + BF_OPENGL + '/lib/libXmu.a ' + BF_OPENGL + '/lib/libXext.a ' + BF_OPENGL + '/lib/libX11.a ' + BF_OPENGL + '/lib/libXi.a'
+##
+##CC = gcc
+##CCC = g++
+##ifeq ($CPU),alpha)
+##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
+
+CFLAGS = '-pipe -funsigned-char -fno-strict-aliasing'
+
+CPPFLAGS = '-DXP_UNIX'
+CCFLAGS = '-pipe -funsigned-char -fno-strict-aliasing'
+REL_CFLAGS = '-O2'
+REL_CCFLAGS = '-O2'
+##BF_DEPEND = 'true'
+##
+##AR = ar
+##ARFLAGS = ruv
+##ARFLAGSQUIET = ru
+##
+C_WARN = '-Wall -W -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Wredundant-decls'
+
+CC_WARN = '-Wall -W -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wredundant-decls -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -Wold-style-cast -Woverloaded-virtual -Wsign-promo -Wsynth'
+
+##FIX_STUBS_WARNINGS = -Wno-unused
+
+LLIBS = 'util c m dl pthread stdc++'
+##LOPTS = --dynamic
+##DYNLDFLAGS = -shared $(LDFLAGS)
+
+BF_BUILDDIR = '../build/linuxcross'
+BF_INSTALLDIR='../install/linuxcross'
diff --git a/config/win32-mingw-config.py b/config/win32-mingw-config.py
new file mode 100644 (file)
index 0000000..7829482
--- /dev/null
@@ -0,0 +1,155 @@
+LCGDIR = '#../lib/windows'
+BF_PYTHON = LCGDIR + '/python'
+BF_PYTHON_VERSION = '2.4'
+BF_PYTHON_INC = BF_PYTHON + '/include/python' + BF_PYTHON_VERSION
+BF_PYTHON_BINARY = 'python'
+BF_PYTHON_LIB = 'python24'
+BF_PYTHON_LIBPATH = BF_PYTHON + '/lib'
+
+WITH_BF_OPENAL = 'true'
+BF_OPENAL = LCGDIR + '/openal'
+BF_OPENAL_INC = BF_OPENAL+'/include'
+BF_OPENAL_LIB = 'openal'
+BF_OPENAL_LIBPATH = BF_OPENAL + '/lib'
+
+WITH_BF_SDL = 'true'
+BF_SDL = '#../extra/SDL-1.2.9' #$(shell sdl-config --prefix)
+BF_SDL_INC = BF_SDL + '/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_LIB = 'SDLmain SDL' #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+BF_SDL_LIBPATH = BF_SDL + '/lib'
+
+WITH_BF_FMOD = 'false'
+BF_FMOD = LCGDIR + '/fmod'
+
+WITH_BF_OPENEXR = 'true'
+BF_OPENEXR = LCGDIR + '/gcc/openexr'
+BF_OPENEXR_INC = BF_OPENEXR + '/include ' + BF_OPENEXR + '/include/OpenEXR'
+BF_OPENEXR_LIB = ' Iex Half IlmImf Imath '
+BF_OPENEXR_LIBPATH = LCGDIR+'/openexr/lib'
+
+WITH_BF_JPEG = 'true'
+BF_JPEG = LCGDIR + '/jpeg'
+BF_JPEG_INC = BF_JPEG + '/include'
+BF_JPEG_LIB = 'jpeg'
+BF_JPEG_LIBPATH = BF_JPEG + '/lib'
+
+WITH_BF_PNG = 'true'
+BF_PNG = LCGDIR + '/png'
+BF_PNG_INC = BF_PNG + '/include'
+BF_PNG_LIB = 'png'
+BF_PNG_LIBPATH = BF_PNG + '/lib'
+
+WITH_BF_TIFF = 'true'
+BF_TIFF = LCGDIR + '/tiff'
+BF_TIFF_INC = BF_TIFF + '/include'
+BF_TIFF_LIB = 'z tiff'
+BF_TIFF_LIBPATH = BF_TIFF + '/lib'
+
+WITH_BF_ZLIB = 'true'
+BF_ZLIB = LCGDIR + '/zlib'
+BF_ZLIB_INC = BF_ZLIB + '/include'
+BF_ZLIB_LIB = 'z'
+BF_ZLIB_LIBPATH = BF_ZLIB + '/lib'
+
+WITH_BF_GETTEXT = 'true'
+BF_GETTEXT = LCGDIR + '/gettext'
+BF_GETTEXT_INC = BF_GETTEXT + '/include'
+BF_GETTEXT_LIB = 'freegettext'
+BF_GETTEXT_LIBPATH = '#../extra/gettext'
+
+WITH_BF_FTGL = 'true'
+BF_FTGL = LCGDIR + '/ftgl'
+BF_FTGL_INC = BF_FTGL + '/include'
+BF_FTGL_LIB = 'extern_ftgl'
+
+WITH_BF_GAMEENGINE = 'false'
+
+WITH_BF_ODE = 'true'
+BF_ODE = LCGDIR + '/ode'
+BF_ODE_INC = BF_ODE + '/include'
+BF_ODE_LIB = BF_ODE + '/lib/libode.a'
+
+WITH_BF_BULLET = 'true'
+BF_BULLET = '#extern/bullet'
+BF_BULLET_INC = BF_BULLET + '/LinearMath ' + BF_BULLET + '/BulletDynamics ' + BF_BULLET + '/Bullet'
+BF_BULLET_LIB = 'extern_bullet'
+
+BF_SOLID = '#extern/solid'
+BF_SOLID_INC = BF_SOLID
+BF_SOLID_LIB = 'extern_solid'
+
+#WITH_BF_NSPR = 'true'
+#BF_NSPR = $(LCGDIR)/nspr
+#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
+#BF_NSPR_LIB = 
+
+# Uncomment the following line to use Mozilla inplace of netscape
+#CPPFLAGS += -DMOZ_NOT_NET
+# Location of MOZILLA/Netscape header files...
+#BF_MOZILLA = $(LCGDIR)/mozilla
+#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
+#BF_MOZILLA_LIB =
+# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
+# if this is not set.
+#
+# Be paranoid regarding library creation (do not update archives)
+#BF_PARANOID = 'true'
+
+# enable freetype2 support for text objects
+WITH_BF_FREETYPE = 'true'
+BF_FREETYPE = '#../extra/freetype'
+BF_FREETYPE_INC = BF_FREETYPE + '/include '
+BF_FREETYPE_LIB = 'freetype'
+BF_FREETYPE_LIBPATH = BF_FREETYPE + '/lib'
+
+WITH_BF_QUICKTIME = 'false' # -DWITH_QUICKTIME
+BF_QUICKTIME = '/usr/local'
+BF_QUICKTIME_INC = BF_QUICKTIME + '/include'
+
+# Mesa Libs should go here if your using them as well....
+WITH_BF_OPENGL = 'true'
+BF_OPENGL = 'C:\\MingW'
+BF_OPENGL_INC = BF_OPENGL + '/include'
+BF_OPENGL_LIBINC = BF_OPENGL + '/lib'
+BF_OPENGL_LIB = 'opengl32 glu32'
+BF_OPENGL_LIB_STATIC = [ BF_OPENGL + '/lib/libGL.a', BF_OPENGL + '/lib/libGLU.a',
+             BF_OPENGL + '/lib/libXmu.a', BF_OPENGL + '/lib/libXext.a',
+             BF_OPENGL + '/lib/libX11.a', BF_OPENGL + '/lib/libXi.a' ]
+##
+##CC = gcc
+##CCC = g++
+##ifeq ($CPU),alpha)
+##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
+
+CFLAGS = [ '-pipe' '-funsigned-char', '-fno-strict-aliasing' ]
+
+CPPFLAGS = [ '-DXP_UNIX', '-DWIN32', '-DFREE_WINDOWS' ]
+CCFLAGS = ['-pipe', '-mwindows', '-funsigned-char', '-fno-strict-aliasing' ]
+REL_CFLAGS = [ '-O2' ]
+REL_CCFLAGS = [ '-O2' ]
+##BF_DEPEND = 'true'
+##
+##AR = ar
+##ARFLAGS = ruv
+##ARFLAGSQUIET = ru
+##
+C_WARN = [ '-Wall', '-W', '-Wshadow', '-Wpointer-arith', '-Wbad-function-cast',
+        '-Wcast-qual', '-Wcast-align', '-Waggregate-return',
+        '-Wstrict-prototypes', '-Wmissing-prototypes',
+        '-Wmissing-declarations', '-Wnested-externs', '-Wredundant-decls' ]
+
+CC_WARN = [ '-Wall', '-W', '-Wshadow', '-Wpointer-arith', '-Wcast-qual', '-Wcast-align',
+        '-Wredundant-decls', '-Wreorder', '-Wctor-dtor-privacy', '-Wnon-virtual-dtor',
+        '-Wold-style-cast', '-Woverloaded-virtual', '-Wsign-promo', '-Wsynth' ]
+
+##FIX_STUBS_WARNINGS = -Wno-unused
+
+LLIBS = [ '-ldxguid', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm' ] #'-lutil', '-lc', '-lm', '-ldl', '-lpthread' ]
+##LOPTS = --dynamic
+##DYNLDFLAGS = -shared $(LDFLAGS)
+
+BF_DEBUG = 'false'
+BF_DEBUG_FLAGS= ''
+
+BF_BUILDDIR = '..\\build\\win32-mingw'
+BF_INSTALLDIR='..\\install\\win32-mingw'
diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py
new file mode 100644 (file)
index 0000000..377d5f4
--- /dev/null
@@ -0,0 +1,169 @@
+LCGDIR = '#../lib/windows'
+BF_PYTHON = LCGDIR + '/python'
+BF_PYTHON_VERSION = '2.4'
+BF_PYTHON_INC = BF_PYTHON + '/include/python' + BF_PYTHON_VERSION
+BF_PYTHON_BINARY = 'python'
+BF_PYTHON_LIB = 'python24'
+BF_PYTHON_LIBPATH = BF_PYTHON + '/lib'
+
+WITH_BF_OPENAL = 'true'
+BF_OPENAL = LCGDIR + '/openal'
+BF_OPENAL_INC = BF_OPENAL+'/include ' + BF_OPENAL+'/include/AL '
+BF_OPENAL_LIB = 'openal_static'
+BF_OPENAL_LIBPATH = BF_OPENAL + '/lib'
+
+WITH_BF_ICONV = 'true'
+BF_ICONV = LCGDIR + '/iconv'
+BF_ICONV_INC = BF_ICONV + '/include'
+BF_ICONV_LIB = 'iconv'
+BF_ICONV_LIBPATH = BF_ICONV + '/lib'
+
+WITH_BF_SDL = 'true'
+BF_SDL = LCGDIR + '/sdl' #$(shell sdl-config --prefix)
+BF_SDL_INC = BF_SDL + '/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+BF_SDL_LIB = 'SDL.lib' #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+BF_SDL_LIBPATH = BF_SDL + '/lib'
+
+WITH_BF_FMOD = 'false'
+BF_FMOD = LCGDIR + '/fmod'
+
+WITH_BF_OPENEXR = 'true'
+BF_OPENEXR = LCGDIR + '/openexr'
+BF_OPENEXR_INC = BF_OPENEXR + '/include ' + BF_OPENEXR + '/include/IlmImf ' + BF_OPENEXR + '/include/Iex ' + BF_OPENEXR + '/include/Imath '
+BF_OPENEXR_LIB = ' Iex Half IlmImf Imath '
+BF_OPENEXR_LIBPATH = BF_OPENEXR+'/lib'
+
+WITH_BF_JPEG = 'true'
+BF_JPEG = LCGDIR + '/jpeg'
+BF_JPEG_INC = BF_JPEG + '/include'
+BF_JPEG_LIB = 'libjpeg'
+BF_JPEG_LIBPATH = BF_JPEG + '/lib'
+
+WITH_BF_PNG = 'true'
+BF_PNG = LCGDIR + '/png'
+BF_PNG_INC = BF_PNG + '/include'
+BF_PNG_LIB = 'libpng'
+BF_PNG_LIBPATH = BF_PNG + '/lib'
+
+WITH_BF_TIFF = 'true'
+BF_TIFF = LCGDIR + '/tiff'
+BF_TIFF_INC = BF_TIFF + '/include'
+BF_TIFF_LIB = 'libtiff'
+BF_TIFF_LIBPATH = BF_TIFF + '/lib'
+
+WITH_BF_ZLIB = 'true'
+BF_ZLIB = LCGDIR + '/zlib'
+BF_ZLIB_INC = BF_ZLIB + '/include'
+BF_ZLIB_LIB = 'libz'
+BF_ZLIB_LIBPATH = BF_ZLIB + '/lib'
+
+WITH_BF_GETTEXT = 'true'
+BF_GETTEXT = LCGDIR + '/gettext'
+BF_GETTEXT_INC = BF_GETTEXT + '/include'
+BF_GETTEXT_LIB = 'gnu_gettext'
+BF_GETTEXT_LIBPATH = BF_GETTEXT + '/lib'
+
+WITH_BF_FTGL = 'true'
+BF_FTGL = LCGDIR + '/ftgl'
+BF_FTGL_INC = BF_FTGL + '/include'
+BF_FTGL_LIB = 'extern_ftgl'
+
+WITH_BF_GAMEENGINE = 'true'
+
+WITH_BF_ODE = 'true'
+BF_ODE = LCGDIR + '/ode'
+BF_ODE_INC = BF_ODE + '/include'
+BF_ODE_LIB = BF_ODE + '/lib/libode.a'
+
+WITH_BF_BULLET = 'true'
+BF_BULLET = '#extern/bullet'
+BF_BULLET_INC = BF_BULLET + '/LinearMath ' + BF_BULLET + '/BulletDynamics ' + BF_BULLET + '/Bullet'
+BF_BULLET_LIB = 'extern_bullet'
+
+BF_SOLID = '#extern/solid'
+BF_SOLID_INC = BF_SOLID
+BF_SOLID_LIB = 'extern_solid'
+
+#WITH_BF_NSPR = 'true'
+#BF_NSPR = $(LCGDIR)/nspr
+#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
+#BF_NSPR_LIB = 
+
+# Uncomment the following line to use Mozilla inplace of netscape
+#CPPFLAGS += -DMOZ_NOT_NET
+# Location of MOZILLA/Netscape header files...
+#BF_MOZILLA = $(LCGDIR)/mozilla
+#BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
+#BF_MOZILLA_LIB =
+# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
+# if this is not set.
+#
+# Be paranoid regarding library creation (do not update archives)
+#BF_PARANOID = 'true'
+
+# enable freetype2 support for text objects
+WITH_BF_FREETYPE = 'true'
+BF_FREETYPE = LCGDIR + '/freetype'
+BF_FREETYPE_INC = BF_FREETYPE + '/include ' + BF_FREETYPE + '/include/freetype2'
+BF_FREETYPE_LIB = 'freetype2ST'
+BF_FREETYPE_LIBPATH = BF_FREETYPE + '/lib'
+
+WITH_BF_QUICKTIME = 'true' # -DWITH_QUICKTIME
+BF_QUICKTIME = LCGDIR + '/QTDevWin'
+BF_QUICKTIME_INC = BF_QUICKTIME + '/CIncludes'
+BF_QUICKTIME_LIB = 'qtmlClient'
+BF_QUICKTIME_LIBPATH = BF_QUICKTIME + '/Libraries'
+
+# Mesa Libs should go here if your using them as well....
+WITH_BF_OPENGL = 'true'
+#BF_OPENGL = 'C:\\MingW'
+BF_OPENGL_INC = BF_OPENGL + '/include'
+BF_OPENGL_LIBINC = BF_OPENGL + '/lib'
+BF_OPENGL_LIB = 'opengl32 glu32'
+BF_OPENGL_LIB_STATIC = [ BF_OPENGL + '/lib/libGL.a', BF_OPENGL + '/lib/libGLU.a',
+             BF_OPENGL + '/lib/libXmu.a', BF_OPENGL + '/lib/libXext.a',
+             BF_OPENGL + '/lib/libX11.a', BF_OPENGL + '/lib/libXi.a' ]
+##
+##CC = gcc
+##CCC = g++
+##ifeq ($CPU),alpha)
+##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
+
+CCFLAGS = ['/nologo', '/Og', '/Ot', '/Ob1', '/Op', '/G6','/EHsc', '/J', '/W3', '/Gd', '/MT']
+
+CPPFLAGS = ['-DWIN32','-D_CONSOLE', '-D_LIB', '-DUSE_OPENAL', '-DFTGL_LIBRARY_STATIC']
+REL_CFLAGS = []
+REL_CCFLAGS = []
+##BF_DEPEND = 'true'
+##
+##AR = ar
+##ARFLAGS = ruv
+##ARFLAGSQUIET = ru
+##
+C_WARN = []
+#
+CC_WARN = []
+
+##FIX_STUBS_WARNINGS = -Wno-unused
+
+LLIBS = 'ws2_32 dxguid vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shell32 ole32 oleaut32 uuid'  #[ '-lutil', '-lc', '-lm', '-ldl', '-lpthread' ]
+
+PLATFORM_LINKFLAGS = '''
+                        /SUBSYSTEM:CONSOLE 
+                        /MACHINE:IX86 
+                        /ENTRY:mainCRTStartup 
+                        /INCREMENTAL:NO 
+                        /NODEFAULTLIB:"msvcprt.lib" 
+                        /NODEFAULTLIB:"glut32.lib" 
+                        /NODEFAULTLIB:"libc.lib"
+                        /NODEFAULTLIB:"libcd.lib"
+                        /NODEFAULTLIB:"libcpd.lib" 
+                        /NODEFAULTLIB:"libcp.lib" 
+                        /NODEFAULTLIB:"libcmtd.lib"
+                    '''
+                        
+##LOPTS = --dynamic
+##DYNLDFLAGS = -shared $(LDFLAGS)
+
+BF_BUILDDIR = '..\\build\\win32-vc'
+BF_INSTALLDIR='..\\install\\win32-vc'
index d11db23ab7ab2a71ba1fa1cd1665988a145f72f5..15cace23c6c2d50841e0a10b6c8808aa8c0faff0 100644 (file)
@@ -1,14 +1,10 @@
 #!/usr/bin/python
 
-Import('user_options_dict')
+Import('env')
 
-
-print "externs..."
 SConscript(['qhull/SConscript',
-            'solid/SConscript',
-           'bullet/SConscript'])
-            
-            
-if user_options_dict['USE_INTERNATIONAL'] == 1:
-    print "bftgl"
-    SConscript(['bFTGL/SConscript'])
\ No newline at end of file
+                       'solid/SConscript',
+                       'bullet/SConscript'])
+
+if env['WITH_BF_FREETYPE'] == 1:
+    SConscript(['bFTGL/SConscript'])
index 5504965b1c9874a6eea06bc5a1b41a75f42b5b3c..a201cbae1253fdacbbc58e7027f4c840199f53ce 100644 (file)
@@ -2,52 +2,29 @@
 import sys
 import os
 
-ftgl_env = Environment(ENV=os.environ)
+Import('env')
 
 # Import the C flags set in the SConstruct file
-Import ('cflags')
-Import ('defines')
-Import ('user_options_dict')
+#Import ('cflags')
+#Import ('defines')
+#Import ('user_options_dict')
 
-if sys.platform=='linux2' or sys.platform=='linux-i386':
-       ftgl_env.Append (CCFLAGS = ['-O2', '-ansi'])
-elif sys.platform=='win32':
-       ftgl_env.Append (CCFLAGS = ['/O2'])
-elif sys.platform=='sunos':
-       ftgl_env.Append (CCFLAGS = ['Xc', '-v', '-fast'])
-elif sys.platform=='darwin':
-       ftgl_env.Append (CCFLAGS = ['-O2', '-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4'])
-else:
-       ftgl_env.Append (CCFLAGS = cflags)
+#if sys.platform=='linux2' or sys.platform=='linux-i386':
+#      ftgl_env.Append (CCFLAGS = ['-O2', '-ansi'])
+#elif sys.platform=='win32':
+       #ftgl_env.Append (CCFLAGS = ['/O2'])
+#elif sys.platform=='sunos':
+#      ftgl_env.Append (CCFLAGS = ['Xc', '-v', '-fast'])
+#elif sys.platform=='darwin':
+#      ftgl_env.Append (CCFLAGS = ['-O2', '-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4'])
+#else:
+#      ftgl_env.Append (CCFLAGS = cflags)
 
-ftgl_env.Append (CPPDEFINES = defines)
-ftgl_env.Append (CPPPATH = ['include',
-                             'src'])
+#ftgl_env.Append (CPPDEFINES = defines)
 
-ftgl_env.Append (CPPPATH = user_options_dict['FREETYPE_INCLUDE'])
+incs = 'include src ' + env['BF_FREETYPE_INC']
+defs = ''
 
-source_files = [
-               'src/FTBitmapGlyph.cpp',
-               'src/FTCharmap.cpp',
-               'src/FTContour.cpp',
-               'src/FTExtrdGlyph.cpp',
-               'src/FTFace.cpp',
-               'src/FTFont.cpp',
-               'src/FTGLBitmapFont.cpp',
-               'src/FTGLExtrdFont.cpp',
-               'src/FTGLOutlineFont.cpp',
-               'src/FTGLPixmapFont.cpp',
-               'src/FTGLPolygonFont.cpp',
-               'src/FTGLTextureFont.cpp',
-               'src/FTGlyph.cpp',
-               'src/FTGlyphContainer.cpp',
-               'src/FTLibrary.cpp',
-               'src/FTOutlineGlyph.cpp',
-               'src/FTPixmapGlyph.cpp',
-               'src/FTPoint.cpp',
-               'src/FTPolyGlyph.cpp',
-               'src/FTSize.cpp',
-               'src/FTTextureGlyph.cpp',
-               'src/FTVectoriser.cpp']
+sources = env.Glob('src/*.cpp')
 
-ftgl_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_ftgl', source=source_files)
+env.BlenderLib ( 'extern_ftgl', sources, Split(incs), Split(defs), libtype='international', priority=5)
index 453d18aff6d1e10b73b8505e2a1779142b2dda0a..bb58c0c840e91962d9b14176ae09b4230d6f11a6 100644 (file)
@@ -2,28 +2,24 @@
 import sys
 import os
 
-bullet_env = Environment(ENV = os.environ)
+Import('env')
 
-# Import the C flags set in the SConstruct file
-Import ('cflags')
-#Import ('cxxflags')
-#Import ('defines')
-Import ('user_options_dict')
-#defines = ['QHULL', '_LIB']
-defines = ['USE_DOUBLES','QHULL', '_LIB']
-#cflags = []
-cxxflags = []
+defs = 'USE_DOUBLES QHULL _LIB'
+cflags = []
 
-if sys.platform=='win32':
-       defines += ['WIN32','NDEBUG', '_WINDOWS', '_LIB']
-       #cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
-       cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6']
+if env['OURPLATFORM']=='win32-vc':
+    defs += ' WIN32 NDEBUG _WINDOWS _LIB'
+    #cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
+    cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6']
+if env['OURPLATFORM']=='win32-mingw':
+    defs += ' NDEBUG'
+    cflags += ['-O2']
 elif sys.platform=='linux2' or sys.platform=='linux-i386' or sys.platform=='freebsd4' or sys.platform=='freebsd5':
-       defines += ['NDEBUG']
-       cflags += ['-O2']
-elif sys.platform=='darwin' :
-       defines += ['NDEBUG']
-       cflags += ['-O2','-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4']
+    defs += ' NDEBUG'
+    cflags += ['-O2']
+elif sys.platform=='darwin':
+    defs += ' NDEBUG'
+    cflags += ['-O2','-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4']
 
 else:
     print "################################################"
@@ -33,79 +29,79 @@ else:
     print "and cflags / cxxflags to the"
     print "extern/bullet/SConscript file"
 
-bullet_env.Append (CCFLAGS = cflags)
-bullet_env.Append (CPPFLAGS = cxxflags)
+#bullet_env.Append (CCFLAGS = cflags)
+#bullet_env.Append (CPPFLAGS = cxxflags)
 
-bullet_env.Append (CPPDEFINES = defines)
+#bullet_env.Append (CPPDEFINES = defines)
 
-bullet_sources = ['Bullet/BroadphaseCollision/BroadphaseProxy.cpp',
-                               'Bullet/BroadphaseCollision/CollisionAlgorithm.cpp',
-                               'Bullet/BroadphaseCollision/CollisionDispatcher.cpp',
-                               'Bullet/BroadphaseCollision/SimpleBroadphase.cpp',
-                               
-                               'Bullet/CollisionShapes/BoxShape.cpp',
-                               'Bullet/CollisionShapes/CollisionShape.cpp',
-                               'Bullet/CollisionShapes/ConeShape.cpp',
-                               'Bullet/CollisionShapes/ConvexHullShape.cpp',
-                               'Bullet/CollisionShapes/ConvexShape.cpp',
-                               'Bullet/CollisionShapes/CylinderShape.cpp',
-                               'Bullet/CollisionShapes/MinkowskiSumShape.cpp',
-                               'Bullet/CollisionShapes/MultiSphereShape.cpp',
-                               'Bullet/CollisionShapes/PolyhedralConvexShape.cpp',
-                               'Bullet/CollisionShapes/Simplex1to4Shape.cpp',
-                               'Bullet/CollisionShapes/SphereShape.cpp',
-                               'Bullet/CollisionShapes/StridingMeshInterface.cpp',
-                               'Bullet/CollisionShapes/TriangleMesh.cpp',
-                               'Bullet/CollisionShapes/TriangleMeshShape.cpp',
-                               'Bullet/CollisionShapes/BvhTriangleMeshShape.cpp',
-                               'Bullet/CollisionShapes/ConvexTriangleCallback.cpp',
-                               'Bullet/CollisionShapes/EmptyShape.cpp',
-                               'Bullet/CollisionShapes/OptimizedBvh.cpp',
-                               'Bullet/CollisionShapes/TriangleCallback.cpp',
-                               'Bullet/CollisionShapes/TriangleIndexVertexArray.cpp',
-                                                                                       
-                               'Bullet/NarrowPhaseCollision/BU_AlgebraicPolynomialSolver.cpp',
-                               'Bullet/NarrowPhaseCollision/BU_Collidable.cpp',
-                               'Bullet/NarrowPhaseCollision/BU_CollisionPair.cpp',
-                               'Bullet/NarrowPhaseCollision/BU_EdgeEdge.cpp',
-                               'Bullet/NarrowPhaseCollision/BU_Screwing.cpp',
-                               'Bullet/NarrowPhaseCollision/BU_VertexPoly.cpp',
-                               'Bullet/NarrowPhaseCollision/ContinuousConvexCollision.cpp',
-                               'Bullet/NarrowPhaseCollision/ConvexCast.cpp',
-                               'Bullet/NarrowPhaseCollision/GjkConvexCast.cpp',
-                               'Bullet/NarrowPhaseCollision/GjkPairDetector.cpp',
-                               'Bullet/NarrowPhaseCollision/MinkowskiPenetrationDepthSolver.cpp',
-                               'Bullet/NarrowPhaseCollision/PersistentManifold.cpp',
-                               'Bullet/NarrowPhaseCollision/RaycastCallback.cpp',
-                               'Bullet/NarrowPhaseCollision/SubSimplexConvexCast.cpp',
-                               'Bullet/NarrowPhaseCollision/VoronoiSimplexSolver.cpp',
-                               'Bullet/NarrowPhaseCollision/ManifoldContactAddResult.cpp',
-                                                               
-                               'BulletDynamics/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp',
-                               'BulletDynamics/CollisionDispatch/ConvexConvexAlgorithm.cpp',
-                               'BulletDynamics/CollisionDispatch/EmptyCollisionAlgorithm.cpp',
-                               'BulletDynamics/CollisionDispatch/ManifoldResult.cpp',
-                               'BulletDynamics/CollisionDispatch/ToiContactDispatcher.cpp',
-                               'BulletDynamics/CollisionDispatch/UnionFind.cpp',
-                               
-                               'BulletDynamics/ConstraintSolver/ContactConstraint.cpp',
-                               'BulletDynamics/ConstraintSolver/OdeConstraintSolver.cpp',
-                               #'BulletDynamics/ConstraintSolver/OdeConstraintSolver2.cpp',
-                               'BulletDynamics/ConstraintSolver/Point2PointConstraint.cpp',
-                               'BulletDynamics/ConstraintSolver/SimpleConstraintSolver.cpp',
-                               'BulletDynamics/ConstraintSolver/Solve2LinearConstraint.cpp',
-                               'BulletDynamics/ConstraintSolver/SorLcp.cpp',
-                               
-                               'BulletDynamics/Dynamics/BU_Joint.cpp',
-                               'BulletDynamics/Dynamics/ContactJoint.cpp',
-                               'BulletDynamics/Dynamics/RigidBody.cpp',
-                                       ]
+sources = [         'Bullet/BroadphaseCollision/BroadphaseProxy.cpp',
+                'Bullet/BroadphaseCollision/CollisionAlgorithm.cpp',
+                'Bullet/BroadphaseCollision/CollisionDispatcher.cpp',
+                'Bullet/BroadphaseCollision/SimpleBroadphase.cpp',
+                
+                'Bullet/CollisionShapes/BoxShape.cpp',
+                'Bullet/CollisionShapes/CollisionShape.cpp',
+                'Bullet/CollisionShapes/ConeShape.cpp',
+                'Bullet/CollisionShapes/ConvexHullShape.cpp',
+                'Bullet/CollisionShapes/ConvexShape.cpp',
+                'Bullet/CollisionShapes/CylinderShape.cpp',
+                'Bullet/CollisionShapes/MinkowskiSumShape.cpp',
+                'Bullet/CollisionShapes/MultiSphereShape.cpp',
+                'Bullet/CollisionShapes/PolyhedralConvexShape.cpp',
+                'Bullet/CollisionShapes/Simplex1to4Shape.cpp',
+                'Bullet/CollisionShapes/SphereShape.cpp',
+                'Bullet/CollisionShapes/StridingMeshInterface.cpp',
+                'Bullet/CollisionShapes/TriangleMesh.cpp',
+                'Bullet/CollisionShapes/TriangleMeshShape.cpp',
+                'Bullet/CollisionShapes/BvhTriangleMeshShape.cpp',
+                'Bullet/CollisionShapes/ConvexTriangleCallback.cpp',
+                'Bullet/CollisionShapes/EmptyShape.cpp',
+                'Bullet/CollisionShapes/OptimizedBvh.cpp',
+                'Bullet/CollisionShapes/TriangleCallback.cpp',
+                'Bullet/CollisionShapes/TriangleIndexVertexArray.cpp',
+                                            
+                'Bullet/NarrowPhaseCollision/BU_AlgebraicPolynomialSolver.cpp',
+                'Bullet/NarrowPhaseCollision/BU_Collidable.cpp',
+                'Bullet/NarrowPhaseCollision/BU_CollisionPair.cpp',
+                'Bullet/NarrowPhaseCollision/BU_EdgeEdge.cpp',
+                'Bullet/NarrowPhaseCollision/BU_Screwing.cpp',
+                'Bullet/NarrowPhaseCollision/BU_VertexPoly.cpp',
+                'Bullet/NarrowPhaseCollision/ContinuousConvexCollision.cpp',
+                'Bullet/NarrowPhaseCollision/ConvexCast.cpp',
+                'Bullet/NarrowPhaseCollision/GjkConvexCast.cpp',
+                'Bullet/NarrowPhaseCollision/GjkPairDetector.cpp',
+                'Bullet/NarrowPhaseCollision/MinkowskiPenetrationDepthSolver.cpp',
+                'Bullet/NarrowPhaseCollision/PersistentManifold.cpp',
+                'Bullet/NarrowPhaseCollision/RaycastCallback.cpp',
+                'Bullet/NarrowPhaseCollision/SubSimplexConvexCast.cpp',
+                'Bullet/NarrowPhaseCollision/VoronoiSimplexSolver.cpp',
+                'Bullet/NarrowPhaseCollision/ManifoldContactAddResult.cpp',
+                                
+                'BulletDynamics/CollisionDispatch/ConvexConcaveCollisionAlgorithm.cpp',
+                'BulletDynamics/CollisionDispatch/ConvexConvexAlgorithm.cpp',
+                'BulletDynamics/CollisionDispatch/EmptyCollisionAlgorithm.cpp',
+                'BulletDynamics/CollisionDispatch/ManifoldResult.cpp',
+                'BulletDynamics/CollisionDispatch/ToiContactDispatcher.cpp',
+                'BulletDynamics/CollisionDispatch/UnionFind.cpp',
+                
+                'BulletDynamics/ConstraintSolver/ContactConstraint.cpp',
+                'BulletDynamics/ConstraintSolver/OdeConstraintSolver.cpp',
+                'BulletDynamics/ConstraintSolver/Point2PointConstraint.cpp',
+                'BulletDynamics/ConstraintSolver/SimpleConstraintSolver.cpp',
+                'BulletDynamics/ConstraintSolver/Solve2LinearConstraint.cpp',
+                'BulletDynamics/ConstraintSolver/SorLcp.cpp',
+                
+                'BulletDynamics/Dynamics/BU_Joint.cpp',
+                'BulletDynamics/Dynamics/ContactJoint.cpp',
+                'BulletDynamics/Dynamics/RigidBody.cpp']
 
-bullet_env.Append (CPPPATH = ['.',
-                             'Bullet',
-                             'BulletDynamics',
-                             'LinearMath'
-                             ])
-source_files = bullet_sources 
+#sources = env.Glob('Bullet/BroadPhaseCollision/*.cpp')
+#sources += env.Glob('Bullet/CollisionShapes/*.cpp')
+#sources += env.Glob('Bullet/NarrowPhaseCollision/*.cpp')
+#sources += env.Glob('BulletDynamics/CollisionDispatch/*.cpp')
+#sources += env.Glob('BulletDynamics/ConstraintSolver/*.cpp')
+#sources += env.Glob('BulletDynamics/Dynamics/*.cpp')
 
-bullet_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_bullet', source=bullet_sources)
+incs = '. Bullet BulletDynamics LinearMath'
+
+env.BlenderLib ( libname = 'extern_bullet', sources=sources, includes=Split(incs), defines=Split(defs), libtype='game2', priority=20, compileflags=cflags )
index 927ca3a6a0d73a796bd774c87f8108d2487d57ae..2d767cfc58d4235c051d0e5eb1852fe0cd6a2953 100644 (file)
@@ -2,38 +2,34 @@
 import sys
 import os
 
-qhull_env = Environment(ENV = os.environ)
-
-# Import the C flags set in the SConstruct file
-Import ('cflags')
-Import ('defines')
-Import ('user_options_dict')
+Import('env')
+defs = ''
+cflags = []
 if sys.platform=='linux2' or sys.platform=='linux-i386':
-       qhull_env.Append (CCFLAGS = ['-O2', '-ansi'])
-elif sys.platform=='win32':
-       qhull_env.Append (CCFLAGS = ['/O2'])
+   cflags += ['-O2','-ansi']
+elif env['OURPLATFORM']=='win32-vc':
+   cflags += ['/O2']
+elif env['OURPLATFORM']=='win32-mingw':
+   cflags += ['-O2']
 elif sys.platform=='sunos':
-       qhull_env.Append (CCFLAGS = ['Xc', '-v', '-fast'])
+   cflags += ['Xc', '-v', '-fast']
 elif sys.platform=='darwin':
-       qhull_env.Append (CCFLAGS = ['-O2', '-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4'])
-else:
-       qhull_env.Append (CCFLAGS = cflags)
-qhull_env.Append (CPPDEFINES = defines)
+   cflags += ['-O2', '-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4']
+
+sources = ['src/geom.c',
+    'src/geom2.c',
+    'src/global.c',
+    'src/io.c',
+    'src/mem.c',
+    'src/merge.c',
+    'src/poly.c',
+    'src/poly2.c',
+    'src/qhull.c',
+    'src/qset.c',
+    'src/stat.c',
+    'src/user.c']
 
-source_files = ['src/geom.c',
-                'src/geom2.c',
-                'src/global.c',
-                'src/io.c',
-                'src/mem.c',
-                'src/merge.c',
-                'src/poly.c',
-                'src/poly2.c',
-                'src/qhull.c',
-                'src/qset.c',
-                'src/stat.c',
-                'src/user.c']
 
-qhull_env.Append (CPPPATH = ['include',
-                             'src'])
+incs = 'include src'
 
-qhull_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_qhull', source=source_files)
+env.BlenderLib ( 'extern_qhull', sources, Split(incs), Split(defs), libtype='game2', priority=50, compileflags = cflags)
index 00402d640e807a980540335aff43388a802b7f51..673a9951ea450c9c654e015643b8c5e786a19dbe 100644 (file)
@@ -1,29 +1,23 @@
 #!/usr/bin/python
 import sys
-import os
 
-solid_env = Environment(ENV = os.environ)
+Import('env')
 
-# Import the C flags set in the SConstruct file
-Import ('cflags')
-#Import ('cxxflags')
-#Import ('defines')
-Import ('user_options_dict')
-#defines = ['QHULL', '_LIB']
-defines = ['USE_DOUBLES','QHULL', '_LIB']
-#cflags = []
-cxxflags = []
+defs = 'USE_DOUBLES QHULL _LIB'
+cflags = []
 
-if sys.platform=='win32':
-       defines += ['WIN32','NDEBUG', '_WINDOWS', '_LIB']
-       #cflags += ['/MT', '/W3', '/GX', '/O2', '/Op']
-       cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6']
+if env['OURPLATFORM']=='win32-vc':
+    defs += ' WIN32 NDEBUG _WINDOWS _LIB'
+    cflags += ['/MT', '/W3', '/GX', '/Og', '/Ot', '/Ob1', '/Op', '/G6']
+elif env['OURPLATFORM']=='win32-mingw':
+    defs += ' NDEBUG'
+    cflags += ['-O2']
 elif sys.platform=='linux2' or sys.platform=='linux-i386' or sys.platform=='freebsd4' or sys.platform=='freebsd5':
-       defines += ['NDEBUG']
-       cflags += ['-O2']
+    defs += ' NDEBUG'
+    cflags += ['-O2']
 elif sys.platform=='darwin' :
-       defines += ['NDEBUG']
-       cflags += ['-O2','-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4']
+    defs += ' NDEBUG'
+    cflags += ['-O2','-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4']
 
 else:
     print "################################################"
@@ -33,45 +27,8 @@ else:
     print "and cflags / cxxflags to the"
     print "extern/solid/SConscript file"
 
-solid_env.Append (CCFLAGS = cflags)
-solid_env.Append (CPPFLAGS = cxxflags)
+sources = env.Glob('src/*.cpp') + env.Glob('src/convex/*.cpp') + env.Glob('src/complex/*.cpp') + env.Glob('src/broad/*.cpp')
 
-solid_env.Append (CPPDEFINES = defines)
+incs = 'include src src/broad src/complex src/convex ../qhull/include'
 
-solid_sources = ['src/DT_C-api.cpp',
-                'src/DT_Encounter.cpp',
-                'src/DT_Object.cpp',
-                'src/DT_RespTable.cpp',
-                'src/DT_Scene.cpp']
-
-convex_sources = ['src/convex/DT_Accuracy.cpp',
-                'src/convex/DT_Box.cpp',
-                'src/convex/DT_Cone.cpp',
-                'src/convex/DT_Convex.cpp',
-                'src/convex/DT_Cylinder.cpp',
-                'src/convex/DT_Facet.cpp',
-                'src/convex/DT_LineSegment.cpp',
-                'src/convex/DT_PenDepth.cpp',
-                'src/convex/DT_Point.cpp',
-                'src/convex/DT_Polyhedron.cpp',
-                'src/convex/DT_Polytope.cpp',
-                'src/convex/DT_Sphere.cpp',
-                'src/convex/DT_Triangle.cpp']
-                
-complex_sources = ['src/complex/DT_BBoxTree.cpp',
-                'src/complex/DT_Complex.cpp']
-
-broad_sources = ['src/broad/BP_C-api.cpp',
-                'src/broad/BP_EndpointList.cpp',
-                'src/broad/BP_Proxy.cpp',
-                'src/broad/BP_Scene.cpp']
-
-solid_env.Append (CPPPATH = ['include',
-                             'src',
-                             'src/broad',
-                             'src/complex',
-                             'src/convex',
-                             '../qhull/include'])
-source_files = solid_sources + convex_sources + complex_sources + broad_sources
-
-solid_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_solid', source=source_files)
+env.BlenderLib ( libname='extern_solid', sources=sources, includes=Split(incs), defines=Split(defs), libtype='game2', priority=45 , compileflags = cflags)
index ec6a61f6c71da1dc8de5f807d357cfd96ea87ba8..606a81ae923de8b29cc75d28e18116bbd18e0581 100644 (file)
@@ -13,6 +13,10 @@ SConscript(['SoundSystem/SConscript',
             'elbeem/SConscript',
             'opennl/SConscript'])
 
+# NEW_CSG was intended for intern/csg, but
+# getting it to compile is difficult
+# intern/bsp has been used anyway, so
+# perhaps get rid of intern/csg?
 NEW_CSG='false'
 
 if NEW_CSG=='false':
index 0ff757b54a70714bda82b7a1dd1a9cc307eac1c7..d06b28e7c2dea3ac33c558f64f55c510b3c54257 100644 (file)
@@ -1,47 +1,17 @@
 #!/usr/bin/python
-import sys
 
-Import ('user_options_dict')
-Import ('extra_includes')
-Import ('library_env')
+Import ('env')
 
-soundsys_env = library_env.Copy ()
+sources = env.Glob('dummy/*.cpp') + env.Glob('intern/*.cpp')
 
-source_files = ['dummy/SND_DummyDevice.cpp',
-                'intern/SND_AudioDevice.cpp',
-                'intern/SND_C-api.cpp',
-                'intern/SND_CDObject.cpp',
-                'intern/SND_DeviceManager.cpp',
-                'intern/SND_IdObject.cpp',
-                'intern/SND_Scene.cpp',
-                'intern/SND_SoundListener.cpp',
-                'intern/SND_SoundObject.cpp',
-                'intern/SND_Utils.cpp',
-                'intern/SND_WaveCache.cpp',
-                'intern/SND_WaveSlot.cpp']
+incs = '. intern ../moto/include ../string dummy openal sdl'
+defs = ''
+if env['WITH_BF_OPENAL'] == 1:
+    sources += env.Glob('openal/*.cpp') + env.Glob('sdl/*.cpp')
+    incs += ' ' + env['BF_OPENAL_INC']
+    incs += ' ' + env['BF_SDL_INC']
 
-soundsys_env.Append (CPPPATH = ['.',
-                                '../SoundSystem',
-                                'intern',
-                                '../moto/include',
-                                '../string',
-                                'dummy',
-                                'openal',
-                                'sdl'])
+if env['WITH_BF_OPENAL'] == 0:
+    defs = 'NO_SOUND'
 
-if user_options_dict['USE_OPENAL'] == 1:
-    source_files += ['openal/SND_OpenALDevice.cpp',
-                     'openal/pthread_cancel.cpp',
-                    'sdl/SND_SDLCDDevice.cpp']
-    soundsys_env.Append (CPPPATH=user_options_dict['OPENAL_INCLUDE'])
-    soundsys_env.Append (CPPPATH=user_options_dict['SDL_INCLUDE'])
-        
-if user_options_dict['USE_FMOD'] == 1:
-    source_files += ['fmod/SND_FmodDevice.cpp']
-
-if user_options_dict['USE_OPENAL'] == 0 and user_options_dict['USE_FMOD'] == 0:
-    soundsys_env.Append (CPPDEFINES = 'NO_SOUND')
-
-soundsys_env.Append (CPPPATH = extra_includes)
-
-soundsys_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/soundsystem', source=source_files)
+env.BlenderLib ('blender_sndsys', sources, Split(incs), Split(defs), libtype=['core','player2'], priority = [20,10] )
index 3c2bf973c14f6c7c1a566c1505c962698e7d1514..614f8ec87ea8abe4a3e825ef74afc6515cfd29fe 100644 (file)
@@ -1,24 +1,10 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-bmfont_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = ['intern/BMF_Api.cpp',
-                'intern/BMF_BitmapFont.cpp',
-                'intern/BMF_font_helv10.cpp',
-                'intern/BMF_font_helv12.cpp',
-                'intern/BMF_font_helvb10.cpp',
-                'intern/BMF_font_helvb12.cpp',
-                'intern/BMF_font_helvb14.cpp',
-                'intern/BMF_font_helvb8.cpp',
-                'intern/BMF_font_scr12.cpp',
-                'intern/BMF_font_scr14.cpp',
-                'intern/BMF_font_scr15.cpp']
+incs = '. intern'
+incs += ' ' + env['BF_OPENGL_INC']
+defs = ''
 
-bmfont_env.Append (CPPPATH = ['.',
-                              '../bmfont',
-                              'intern'])
-
-bmfont_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
-bmfont_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_BMF', source=source_files)
+env.BlenderLib ('blender_BMF', sources, Split(incs), Split(defs), libtype='intern', priority = 20 )
index a0df706e9f772b392f6ff144aa2570c985d58a7d..afd4ff24d6e44f1a5733b6e302c44b415f6cae45 100644 (file)
@@ -1,34 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-bop_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = [
-               'intern/BOP_BBox.cpp',
-               'intern/BOP_BSPNode.cpp',
-               'intern/BOP_BSPTree.cpp',
-               'intern/BOP_Edge.cpp',
-               'intern/BOP_Face.cpp',
-               'intern/BOP_Face2Face.cpp',
-               'intern/BOP_Interface.cpp',
-               'intern/BOP_Material.cpp',
-               'intern/BOP_MaterialContainer.cpp',
-               'intern/BOP_MathUtils.cpp',
-               'intern/BOP_Merge.cpp',
-               'intern/BOP_Mesh.cpp',
-               'intern/BOP_Segment.cpp',
-               'intern/BOP_Splitter.cpp',
-               'intern/BOP_Tag.cpp',
-               'intern/BOP_Triangulator.cpp',
-               'intern/BOP_Vertex.cpp'
-               ]
+incs = '. intern extern ../moto/include ../container ../memutil'
 
-bop_env.Append (CPPPATH = [    '.',
-                                                       'intern',
-                                                       'extern',
-                                                       '#intern/moto/include',
-                                                       '#intern/container',
-                                                       '#intern/memutil'])
-
-bop_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_bop', source=source_files)
+env.BlenderLib ('blender_bop', sources, Split(incs) , [], libtype='common', priority = 5 )
index 1563a3cd31923ba897365b40a4337b6e83ab9384..6dc3deb710956c32ebae9020e429c2f0dc5d8d35 100644 (file)
@@ -1,25 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-bsp_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = ['intern/BSP_CSGHelper.cpp',
-                'intern/BSP_CSGMesh.cpp',
-                'intern/BSP_CSGMeshBuilder.cpp',
-                'intern/BSP_CSGMeshSplitter.cpp',
-                'intern/BSP_CSGNCMeshSplitter.cpp',
-                'intern/BSP_CSGUserData.cpp',
-                'intern/BSP_FragNode.cpp',
-                'intern/BSP_FragTree.cpp',
-                'intern/BSP_MeshFragment.cpp',
-                'intern/BSP_MeshPrimitives.cpp',
-                'intern/BSP_Triangulate.cpp',
-                'intern/CSG_BooleanOps.cpp']
+incs = 'intern ../container ../moto/include ../memutil'
 
-bsp_env.Append (CPPPATH = ['intern',
-                           '../container',
-                           '../moto/include',
-                           '../memutil'])
-
-bsp_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_BSP', source=source_files)
+env.BlenderLib ('blender_BSP', sources, Split(incs), [], libtype='core', priority=15 )
index a7e7c7d39e7f1878066c37c686f252e65823fa70..c58cf72ff89d5f6c6769840281a3b33ccfc81ee4 100644 (file)
@@ -1,11 +1,7 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-cont_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
+incs = '.'
 
-source_files = ['intern/CTR_List.cpp']
-
-cont_env.Append (CPPPATH = ['.','../container'])
-
-cont_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_CTR', source=source_files)
+env.BlenderLib ('blender_CTR', sources, Split(incs) , [], libtype='intern', priority = 5 )
index e06cd2c73e6e79ecae15298379baa6a12a7dcfa0..84d718e5b673377ae2bf5c6921836fe1bfcb5047 100644 (file)
@@ -1,30 +1,8 @@
 #!/usr/bin/python
-csg_env = Environment()
+Import('env')
 
-# Import the C flags set in the SConstruct file
-Import ('cflags')
-Import ('cxxflags')
-Import ('defines')
-csg_env.Append (CCFLAGS = cflags)
-csg_env.Append (CXXFLAGS = cxxflags)
-csg_env.Append (CPPDEFINES = defines)
+sources = env.Glob('intern/*.cpp') + env.Glob('intern/*.inl')
 
-source_files = ['intern/CSG_BBoxTree.cpp',
-                               'intern/CSG_ConnectedMeshWrapper.inl',
-                               'intern/CSG_Math.inl',
-                               'intern/CSG_Triangulate.inl',
-                               'intern/blender/CSG_CsgOp.cpp',
-                               'intern/blender/CSG_Interface.cpp',
-                               'intern/CSG_BooleanOp.inl',
-                               'intern/CSG_MeshWrapper.inl',
-                               'intern/MT_Line3.cpp'
-                               ]
+incs = 'intern ../container ../moto/include ../memutil intern/blender extern'
 
-csg_env.Append (CPPPATH = ['intern',
-                           '../container',
-                           '../moto/include',
-                           '../memutil',
-                           'intern/blender',
-                           'extern'])
-
-csg_env.Library (target='#/lib/blender_BSP', source=source_files)
+env.BlenderLib ('blender_BSP', sources, Split(incs) , [], libtype='blender', priority=15)
index 181efb4eaf98fc63db490befd6c36ec33e11760c..4ba7dbdba4cdc5aff8b3ed9455f9c22690c16722 100644 (file)
@@ -1,22 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-dec_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = ['intern/LOD_EdgeCollapser.cpp',
-                'intern/LOD_ExternNormalEditor.cpp',
-                'intern/LOD_FaceNormalEditor.cpp',
-                'intern/LOD_ManMesh2.cpp',
-                'intern/LOD_MeshPrimitives.cpp',
-                'intern/LOD_QSDecimator.cpp',
-                'intern/LOD_QuadricEditor.cpp',
-                'intern/LOD_decimation.cpp']
+incs = '. ../moto/include ../container ../memutil'
 
-dec_env.Append (CPPPATH = ['intern',
-                           'extern',
-                           '../moto/include',
-                           '../container',
-                           '../memutil'])
-
-dec_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_LOD', source=source_files)
+env.BlenderLib ('blender_LOD', sources, Split(incs) , [], libtype=['core','common', 'player2'], priority = [10, 20, 5] )
index 3ef20b9be3af4aa302a94a4ce6d510c2135d82cb..45050aff599cf347b9757dbbce5673f6e47b7dcd 100644 (file)
@@ -1,55 +1,23 @@
 #!/usr/bin/python
-Import ('library_env')
-Import('user_options_dict');
-Import('use_fluidsim');
-
-elbeem_env = library_env.Copy();
-elbeem_env.Append(CPPDEFINES= 'NOGUI');
-elbeem_env.Append(CPPDEFINES= [('ELBEEM_BLENDER',1)] );
-               
-if use_fluidsim=='false':
-       # print "El'Beem Fluid Simulation Disabled..." # debug
-       elbeem_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE'])
-       # dummy interface build
-       Sources = [ 
-               "intern/utilities.cpp",
-               "intern/blenderdummy.cpp"
-                       ]; # sources
-else:
-       # print "Including El'Beem Fluid Simulation..." # debug
-       elbeem_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE'])
-       elbeem_env.Append (CPPPATH = user_options_dict['Z_INCLUDE'])
-       elbeem_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
-
-       # main build----------------------------------------
-       Sources = [ 
-
-               "intern/cfgparser.cpp",
-               "intern/cfglexer.cpp",
-
-               "intern/attributes.cpp",
-               "intern/elbeem.cpp",
-               "intern/isosurface.cpp",
-               "intern/ntl_blenderdumper.cpp",
-               "intern/ntl_bsptree.cpp",
-               "intern/ntl_geometrymodel.cpp",
-               "intern/ntl_geometryobject.cpp",
-               "intern/ntl_lightobject.cpp",
-               "intern/ntl_ray.cpp",
-               "intern/ntl_scene.cpp",
-               "intern/ntl_world.cpp",
-               "intern/parametrizer.cpp",
-               "intern/particletracer.cpp",
-               "intern/simulation_object.cpp",
-               "intern/utilities.cpp",
-               "intern/blendercall.cpp",
-
-               "intern/solver_init.cpp",
-               "intern/solver_interface.cpp",
-               "intern/solver_main.cpp",
-               "intern/solver_util.cpp"
-
-               ]; # sources
-
-elbeem_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_elbeem', source=Sources)
-
+import sys
+Import('env')
+#if use_fluidsim=='false':
+#   # print "El'Beem Fluid Simulation Disabled..." # debug
+#   elbeem_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE'])
+#   elbeem_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
+#   elbeem_env.Append(CPPDEFINES= 'ELBEEM_DUMMIES');
+#   # dummy interface build
+#   Sources = [ 
+#       "intern/utilities.cpp",
+#       "intern/blenderdummy.cpp"
+#           ]; # sources
+
+sources = env.Glob('intern/*.cpp')
+
+defs = 'NOGUI ELBEEM_BLENDER=1'
+if sys.platform=='win32':
+    defs += ' USE_MSVC6FIXES'
+incs = env['BF_PNG_INC'] + ' ' + env['BF_ZLIB_INC'] + ' ' +env['BF_SDL_INC']
+
+env.BlenderLib ('blender_elbeem', sources, Split(incs), Split(defs), libtype='blender', priority=0 )
index 23a741bb3b9102aa6ed0e3c454508f9db2cc8d15..6009b14767f4348a6911e05dc09e8d600bec567f 100644 (file)
@@ -1,42 +1,30 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
-Import ('window_system')
+import sys
+import os
 
-ghost_env = library_env.Copy ()
+Import ('env')
 
-source_files = ['intern/GHOST_Buttons.cpp',
-                'intern/GHOST_C-api.cpp',
-                'intern/GHOST_CallbackEventConsumer.cpp',
-                'intern/GHOST_DisplayManager.cpp',
-                'intern/GHOST_EventManager.cpp',
-                'intern/GHOST_EventPrinter.cpp',
-                'intern/GHOST_ISystem.cpp',
-                'intern/GHOST_ModifierKeys.cpp',
-                'intern/GHOST_Rect.cpp',
-                'intern/GHOST_System.cpp',
-                'intern/GHOST_TimerManager.cpp',
-                'intern/GHOST_Window.cpp',
-                'intern/GHOST_WindowManager.cpp']
+window_system = sys.platform
 
-if window_system == 'X11':
-    source_files += ['intern/GHOST_DisplayManagerX11.cpp',
-                     'intern/GHOST_SystemX11.cpp',
-                     'intern/GHOST_WindowX11.cpp']
-elif window_system == 'WIN32':
-    source_files += ['intern/GHOST_DisplayManagerWin32.cpp',
-                     'intern/GHOST_SystemWin32.cpp',
-                     'intern/GHOST_WindowWin32.cpp']
-elif window_system == 'CARBON':
-    source_files += ['intern/GHOST_DisplayManagerCarbon.cpp',
-                     'intern/GHOST_SystemCarbon.cpp',
-                     'intern/GHOST_WindowCarbon.cpp']
-else:
-    print "Unknown window system specified."
+sources = env.Glob('intern/*.cpp')
+
+pf = ['GHOST_DisplayManager', 'GHOST_System', 'GHOST_Window']
 
-ghost_env.Append (CPPPATH = ['.',
-                             '../ghost',
-                             '../string'])
+if window_system == 'linux2':
+       for f in pf:
+               sources.remove('intern' + os.sep + f + 'Win32.cpp')
+               sources.remove('intern' + os.sep + f + 'Carbon.cpp')
+elif window_system == 'win32':
+       for f in pf:
+               sources.remove('intern' + os.sep + f + 'X11.cpp')
+               sources.remove('intern' + os.sep + f + 'Carbon.cpp')
+elif window_system == 'darwin':
+       for f in pf:
+               sources.remove('intern' + os.sep + f + 'Win32.cpp')
+               sources.remove('intern' + os.sep + f + 'X11.cpp')
+else:
+       print "Unknown window system specified."
+       Exit()
 
-ghost_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
-ghost_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_GHOST', source=source_files)
+incs = '. ../string ' + env['BF_OPENGL_INC']
+env.BlenderLib ('blender_GHOST', sources, Split(incs), [], libtype='core', priority = 25 ) 
index 4044aa82e4f0d9cc1694a9da3cdbb8dcb96722f7..519dbe8eedfda776aba4a6c5009b414fad83feb0 100644 (file)
@@ -1,11 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
 
-guardal_env = library_env.Copy ()
+Import('env')
 
-source_files = ['intern/mallocn.c']
+sources = env.Glob('intern/*.c')
+incs = '.'
 
-guardal_env.Append (CPPPATH = ['../guardedalloc'])
-
-guardal_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_guardedalloc', source=source_files)
+env.BlenderLib ('blender_guardedalloc', sources, Split(incs), [], libtype='intern', priority = 0 )
index 7ef8a9b9d11ee95344c26ad8c1f9ac93ac51401f..81bf61dfcd84bdd896d3d8b3db8f8648669f7878 100644 (file)
@@ -1,17 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-iksolver_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = ['intern/IK_QTask.cpp',
-                'intern/IK_QJacobianSolver.cpp',
-                'intern/IK_QSegment.cpp',
-                'intern/IK_QJacobian.cpp',
-                'intern/IK_Solver.cpp']
+incs = 'intern ../moto/include ../memutil'
 
-iksolver_env.Append (CPPPATH = ['intern',
-                                '../moto/include',
-                                '../memutil'])
-
-iksolver_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_IK', source=source_files)
+env.BlenderLib ('blender_IK', sources, Split(incs), [], libtype='blender', priority=10 )
index febb6364a0535e17947247d024c184d17cded87c..4d17f13f2143f0145ac9dee5c60447a7d7a3fe7a 100644 (file)
@@ -1,11 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-memutil_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = ['intern/MEM_RefCountedC-Api.cpp']
+incs = '.'
 
-memutil_env.Append (CPPPATH = ['.','../memutil'])
-
-memutil_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_MEM', source=source_files)
+env.BlenderLib ('blender_MEM', sources, Split(incs), [], libtype='intern', priority = 10 )
index b0956c15dd2e29affdf9e5a319736e0fd2823a55..44e2fae76f327a4010d8fece3f20961e51754e9a 100644 (file)
@@ -1,22 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-moto_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = ['intern/MT_Assert.cpp',
-               'intern/MT_CmMatrix4x4.cpp',
-                'intern/MT_Matrix3x3.cpp',
-                'intern/MT_Matrix4x4.cpp',
-                'intern/MT_Plane3.cpp',
-                'intern/MT_Point3.cpp',
-                'intern/MT_Quaternion.cpp',
-                'intern/MT_Transform.cpp',
-                'intern/MT_Vector2.cpp',
-                'intern/MT_Vector3.cpp',
-                'intern/MT_Vector4.cpp',
-                'intern/MT_random.cpp']
+incs = 'include'
 
-moto_env.Append (CPPPATH = ['include'])
-
-moto_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_MT', source=source_files)
+env.BlenderLib ('blender_MT', sources, Split(incs), [], libtype=['intern','game','game2'], priority = [15, 55,100] )
index 4e0260c7f337d33662c56ebc017ddadef8fdea54..b1cbdeb8ba32680aeae8f7155b461703efcacff4 100644 (file)
@@ -1,43 +1,9 @@
-Import ('user_options_dict')
-Import ('library_env')
+#!/usr/bin/python
+Import ('env')
 
-opennl_env = library_env.Copy ()
+sources = env.Glob('intern/*.c') + env.Glob('superlu/*.c')
 
-source_files = ['intern/opennl.c',
-                'superlu/colamd.c',
-                'superlu/get_perm_c.c',
-                'superlu/heap_relax_snode.c',
-                'superlu/lsame.c',
-                'superlu/memory.c',
-                'superlu/mmd.c',
-                'superlu/relax_snode.c',
-                'superlu/scolumn_bmod.c',
-                'superlu/scolumn_dfs.c',
-                'superlu/scopy_to_ucol.c',
-                'superlu/sgssv.c',
-                'superlu/sgstrf.c',
-                'superlu/sgstrs.c',
-                'superlu/smemory.c',
-                'superlu/smyblas2.c',
-                'superlu/sp_coletree.c',
-                'superlu/sp_ienv.c',
-                'superlu/sp_preorder.c',
-                'superlu/spanel_bmod.c',
-                'superlu/spanel_dfs.c',
-                'superlu/spivotL.c',
-                'superlu/spruneL.c',
-                'superlu/ssnode_bmod.c',
-                'superlu/ssnode_dfs.c',
-                'superlu/ssp_blas2.c',
-                'superlu/ssp_blas3.c',
-                'superlu/strsv.c',
-                'superlu/superlu_timer.c',
-                'superlu/sutil.c',
-                'superlu/util.c',
-                'superlu/xerbla.c']
+incs = 'extern superlu'
 
-opennl_env.Append (CPPPATH = ['extern',
-                              'superlu'])
-
-opennl_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_ONL', source=source_files)
+env.BlenderLib ('blender_ONL', sources, Split(incs), [], libtype='core', priority=55 )
 
index 16833832d0dba469178a84d22610e5632427d4fe..423904ff86884bdbf8fcc75ec9c7576cf5297bca 100644 (file)
@@ -1,11 +1,7 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-string_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
+incs = '.'
 
-source_files = ['intern/STR_String.cpp']
-
-string_env.Append (CPPPATH = ['.', '../string'])
-
-string_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_STR', source=source_files)
+env.BlenderLib ('blender_STR', sources, Split(incs), [], libtype='core', priority = 30 )
index f5ace6e8be73ae1592748917d340f879fe7c85a4..fb215ba37963384fe7197bc4fa6aaec5da7c49f3 100644 (file)
@@ -1,8 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
+Import ('env')
 
 SConscript(['blender/SConscript',
-            'kernel/SConscript',
-            'creator/SConscript'])
-if user_options_dict['BUILD_GAMEENGINE'] == 1:
-    SConscript (['gameengine/SConscript'])
+                       'kernel/SConscript',
+                       'creator/SConscript'])
+if env['WITH_BF_GAMEENGINE'] == 1:
+       SConscript (['gameengine/SConscript'])
index 926dc75e7eaeff5b3c9459f32f88592a493d0ecf..ba821355e2327229c18a1b9c25ae1528eb614ece 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-Import ('user_options_dict')
+Import ('env')
 
 SConscript(['avi/SConscript',
             'blenkernel/SConscript',
@@ -16,11 +16,11 @@ SConscript(['avi/SConscript',
             'src/SConscript',
             'yafray/SConscript'])
 
-if user_options_dict['USE_OPENEXR'] == 1:
-    SConscript (['imbuf/intern/openexr/SConscript'])
-
-if user_options_dict['USE_INTERNATIONAL'] == 1:
+if env['WITH_BF_FREETYPE'] == 1:
     SConscript (['ftfont/SConscript'])
 
-if user_options_dict['USE_QUICKTIME'] == 1:
+if env['WITH_BF_OPENEXR'] == 1:
+    SConscript (['imbuf/intern/openexr/SConscript'])
+
+if env['WITH_BF_QUICKTIME'] == 1:
     SConscript (['quicktime/SConscript'])
index 56eaff26f0f535c0608e82415e772f6523460ef5..6c2faa5329d4371234a57dabc49e13f54623e135 100644 (file)
@@ -1,22 +1,10 @@
 #!/usr/bin/python
-Import ('extra_includes')
-Import ('user_options_dict')
-Import ('library_env')
+#Import ('extra_includes')
+Import ('env')
 
-avi_env = library_env.Copy ()
+sources = env.Glob('intern/*.c')
 
-source_files = ['intern/avi.c',
-                'intern/avirgb.c',
-                'intern/codecs.c',
-                'intern/endian.c',
-                'intern/mjpeg.c',
-                'intern/options.c',
-                'intern/rgb32.c']
+incs = '. #/intern/guardedalloc'
+incs += ' ' + env['BF_JPEG_INC']
 
-avi_env.Append (CPPPATH = ['.',
-                           '../avi',
-                           '#/intern/guardedalloc'])
-
-avi_env.Append (CPPPATH=user_options_dict['JPEG_INCLUDE'])
-avi_env.Append (CPPPATH=extra_includes)
-avi_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_avi', source=source_files)
+env.BlenderLib ('blender_avi', sources, Split(incs), [], libtype='core', priority = 90 )
index ea7740926475ea7dfb03cc3ccaf33a9299ebebc7..df709db5a0baf821b1e2e2578394b79b8a159570 100644 (file)
@@ -1,81 +1,32 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-blenkernel_env = library_env.Copy ()
+sources = env.Glob('intern/*.c')
 
-source_files = ['intern/constraint.c',
-               'intern/depsgraph.c',
-                'intern/DerivedMesh.c',
-                'intern/group.c',
-                'intern/icons.c',
-                'intern/material.c',
-                'intern/sca.c',
-                'intern/world.c',
-                'intern/curve.c',
-                'intern/mball.c',
-                'intern/scene.c',
-                'intern/writeavi.c',
-                'intern/action.c',
-                'intern/deform.c',
-                'intern/image.c',
-                'intern/mesh.c',
-                'intern/modifier.c',
-                'intern/screen.c',
-                'intern/anim.c',
-                'intern/displist.c',
-                'intern/ipo.c',
-                'intern/nla.c',
-                'intern/sound.c',
-                'intern/armature.c',
-                'intern/effect.c',
-                'intern/key.c',
-                'intern/object.c',
-                'intern/CCGSubSurf.c',
-                'intern/subsurf_ccg.c',
-                'intern/blender.c',
-                'intern/exotic.c',
-                'intern/lattice.c',
-                'intern/packedFile.c',
-                'intern/text.c',
-                'intern/script.c',
-                'intern/bmfont.c',
-                'intern/font.c',
-                'intern/library.c',
-                'intern/property.c',
-                'intern/softbody.c',
-               'intern/node.c',
-               'intern/node_shaders.c',
-               'intern/node_composite.c',
-               'intern/colortools.c',
-                'intern/texture.c']
+incs = '. #/intern/guardedalloc ../include ../blenlib ../makesdna'
+incs += ' ../python ../render/extern/include #/intern/decimation/extern'
+incs += ' ../imbuf ../avi #/intern/elbeem/extern'
+incs += ' #/intern/iksolver/extern ../blenloader ../quicktime'
 
-blenkernel_env.Append (CPPPATH = ['.',
-                                  '../blenkernel',
-                                  '#/intern/guardedalloc',
-                                  '../include',
-                                  '../blenlib',
-                                  '../makesdna',
-                                  '../python',
-                                  '../render/extern/include',
-                                  '../../../intern/decimation/extern',
-                                  '../imbuf',
-                                  '../avi',
-                                 '../quicktime',
-                                  '#/intern/elbeem/extern',
-                                  '#/intern/iksolver/extern',
-                                  '../blenloader'])
+incs += ' ' + env['BF_OPENGL_INC']
+incs += ' ' + env['BF_ZLIB_INC']
+incs += ' ' + env['BF_SDL_INC']
 
-if user_options_dict['USE_INTERNATIONAL'] == 1:
-    blenkernel_env.Append (CPPDEFINES = 'WITH_FREETYPE2')
+defs = ''
 
-#fixme: if user_options_dict['USE_CCGSUBSURFLIB'] == 1:
-#    blenkernel_env.Append (CPPDEFINES = 'WITH_CCGSUBSURF')
+if env['WITH_BF_FREETYPE'] == 1:
+    defs += 'WITH_FREETYPE2'
 
-blenkernel_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenkernel', source=source_files)
+if env['WITH_BF_OPENEXR'] == 1:
+    defs += ' WITH_OPENEXR'
 
-SConscript(['bad_level_call_stubs/SConscript'])
+if env['WITH_BF_QUICKTIME'] == 1:
+    defs += ' WITH_QUICKTIME'
+    incs += ' ' + env['BF_QUICKTIME_INC']
 
-blenkernel_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
-blenkernel_env.Append (CPPPATH = user_options_dict['Z_INCLUDE'])
-blenkernel_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
+defs += ' WITH_CCGSUBSURF'
+
+if env['WITH_BF_PLAYER']:
+    SConscript(['bad_level_call_stubs/SConscript'])
+
+env.BlenderLib ( libname = 'blenkernel', sources = sources, includes = Split(incs), defines = Split(defs), libtype='core', priority = 65 )
index 1cb06ecc43d6622efdd9ceef0d570908fbfd43c3..278c74a38f661c3f4e5bc59062fee0f7600ff14f 100644 (file)
@@ -1,27 +1,14 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-blenkernel_blc_env = library_env.Copy ()
+sources = 'stubs.c'
 
-source_files = ['stubs.c'
-                ]
-blenkernel_blc_env.Append (CPPPATH = ['.',
-                                  '..',
-                                  '../../render/extern/include',
-                                  '#/intern/iksolver/extern',
-                                  '../../blenlib',
-                                  '../../include',
-                                  '../../makesdna'])
-"""
-,
-                                  '#/intern/guardedalloc',
-                                  '../python',
-                                  '../imbuf',
-                                  '../avi',
-                                  '../blenloader']
-"""
-if user_options_dict['USE_INTERNATIONAL'] == 1:
-    blenkernel_blc_env.Append (CPPDEFINES = 'WITH_FREETYPE2')
+incs = '. .. ../../render/extern/include'
+incs += ' #/intern/iksolver/extern ../../blenlib'
+incs += ' ../../include ../../makesdna'
 
-blenkernel_blc_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenkernel_blc', source=source_files)
+defs = ''
+if env['WITH_BF_FREETYPE'] == 1:
+    defs += 'WITH_FREETYPE2'
+
+env.BlenderLib ('blenkernel_blc', sources = Split(sources), includes=Split(incs), defines=Split(defs), libtype='player2',priority=0 )
index e6b50a4e2ff864b770d2fe0c0cc48e9594686f7b..99c48c74fb2ce824d035960c8138ba1606fb0dc9 100644 (file)
@@ -1,47 +1,15 @@
 #!/usr/bin/python
-Import ('extra_includes')
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-blenlib_env = library_env.Copy ()
+sources = env.Glob('intern/*.c')
 
-source_files = ['intern/BLI_dynstr.c',
-                'intern/BLI_ghash.c',
-                'intern/edgehash.c',
-                'intern/BLI_linklist.c',
-                'intern/BLI_memarena.c',
-                'intern/arithb.c',
-                'intern/dynlib.c',
-                'intern/fileops.c',
-                'intern/gsqueue.c',
-                'intern/matrixops.c',
-                'intern/noise.c',
-                'intern/psfont.c',
-                'intern/rand.c',
-                'intern/rct.c',
-                'intern/scanfill.c',
-                'intern/storage.c',
-                'intern/time.c',
-                'intern/util.c',
-                'intern/vectorops.c',
-                'intern/freetypefont.c',
-               'intern/jitter.c',
-               'intern/threads.c',
-                'intern/winstuff.c']
+incs = '. ../makesdna ../blenkernel #/intern/guardedalloc ../include'
+incs += ' ' + env['BF_FREETYPE_INC']
+incs += ' ' + env['BF_ZLIB_INC']
+incs += ' ' + env['BF_SDL_INC']
+defs = ''
 
+if env['WITH_BF_FREETYPE'] == 1:
+    defs = 'WITH_FREETYPE2'
 
-blenlib_env.Append (CPPPATH = ['.',
-                               '../blenlib',
-                               '../makesdna',
-                               '../blenkernel',
-                               '#/intern/guardedalloc',
-                               '../include'])
-
-if user_options_dict['USE_INTERNATIONAL'] == 1:
-    blenlib_env.Append (CPPDEFINES = 'WITH_FREETYPE2')
-
-blenlib_env.Append (CPPPATH = extra_includes)
-blenlib_env.Prepend (CPPPATH = user_options_dict['FREETYPE_INCLUDE'])
-blenlib_env.Append (CPPPATH = user_options_dict['Z_INCLUDE'])
-blenlib_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
-blenlib_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenlib', source=source_files)
+env.BlenderLib ( 'blender_blenlib', sources, Split(incs), Split(defs), libtype='core', priority = 85 )
index 62a652e41746af1a97108053a4f4f71995fced19..33e30e56793a4b76d6801bc5402bd9a8cf5482af 100644 (file)
@@ -1,28 +1,13 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-blenloader_env = library_env.Copy ()
+sources = env.Glob('intern/*.c')
 
-source_files = ['intern/genfile.c',
-                'intern/readblenentry.c',
-                'intern/undofile.c',
-                'intern/readfile.c',
-                'intern/writefile.c']
+incs = '. #/intern/guardedalloc ../blenlib ../blenkernel'
+incs += ' ../makesdna ../readblenfile ../include'
+incs += ' ../python ../../kernel/gen_messaging'
+incs += ' ../render/extern/include'
 
-blenloader_env.Append (CPPPATH = ['.',
-                                  '../blenloader',
-                                  '#/intern/guardedalloc',
-                                  '../blenlib',
-                                  '../blenkernel',
-                                  '../makesdna',
-                                  '../readblenfile',
-                                  '../include',
-                                  '../python',
-                                  '../../kernel/gen_messaging',
-                                  '../render/extern/include',
-                                  '../writestreamglue',
-                                  '../readstreamglue'])
+incs += ' ' + env['BF_ZLIB_INC']
 
-blenloader_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenloader', source=source_files)
-blenloader_env.Append (CPPPATH = user_options_dict['Z_INCLUDE'])
+env.BlenderLib ( 'blender_blenloader', sources, Split(incs), [], libtype='core', priority = 70 )
index 21b89b74d243c77294c7b1270723c1905f95d787..f1ba8b3af74cbc9f0b03f4afae1bc573e0ef7a42 100644 (file)
@@ -1,17 +1,14 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-blenplugin_env = library_env.Copy ()
+sources = env.Glob('intern/*.c')
 
-source_files = ['intern/pluginapi.c']
+incs = '. .. #/intern/guardedalloc ../blenlib ../imbuf ../makesdna'
 
-blenplugin_env.Append (CPPPATH = ['.',
-                                  '..',
-                                  '../blenpluginapi',
-                                  '#/intern/guardedalloc',
-                                  '../blenlib',
-                                  '../imbuf',
-                                  '../makesdna'])
+defs = []
 
-blenplugin_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blenpluginapi', source=source_files)
+if env['WITH_BF_QUICKTIME'] == 1:
+       defs.append('WITH_QUICKTIME')
+       incs += ' ' + env['BF_QUICKTIME_INC']
+
+env.BlenderLib ( libname = 'blender_blenpluginapi', sources = sources, includes = Split(incs), defines = defs, libtype='core', priority = 75 )
index 50cd37d6526eb4c5bc26f793fadb20537fafe15e..9d9da82fac23fdc54af4345b6219d648d4398a47 100644 (file)
@@ -1,23 +1,15 @@
 #!/usr/bin/python
-Import ('extra_includes')
-Import ('user_options_dict')
-Import ('library_env')
+import sys
+Import ('env')
 
-ftf_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = ['intern/FTF_Api.cpp',
-                'intern/FTF_TTFont.cpp']
-
-include_paths = ['.',
-               'intern',
-               '../blenkernel',
-               '../blenlib',
-               '../makesdna']
+incs = '. intern ../blenkernel ../blenlib ../makesdna'
+incs += ' ' + env['BF_FTGL_INC']
+incs += ' ' + env['BF_FREETYPE_INC']
+incs += ' ' + env['BF_GETTEXT_INC']
                  
-ftf_env.Append(CPPPATH = extra_includes)
-ftf_env.Append(CPPPATH = include_paths)
-ftf_env.Prepend (CPPPATH = user_options_dict['FTGL_INCLUDE'])
-ftf_env.Prepend (CPPPATH = user_options_dict['FREETYPE_INCLUDE'])
-ftf_env.Prepend (CPPPATH = user_options_dict['GETTEXT_INCLUDE'])
-ftf_env.Append(CPPDEFINES = 'FTGL_STATIC_LIBRARY')
-ftf_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_FTF', source=source_files)
+defs = 'FTGL_STATIC_LIBRARY'
+if sys.platform == 'win32':
+       defs += ' _WIN32 USE_GETTEXT_DLL'
+env.BlenderLib ( 'blender_FTF', sources, Split(incs), Split(defs), libtype='international', priority=0 )
index c73c0593a863fc4fe26ccb197740d76f3927e440..938e306e7f6f8c33b170af9074930926a85ed283 100644 (file)
@@ -1,56 +1,23 @@
 #!/usr/bin/python
-Import ('extra_includes')
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-imbuf_env = library_env.Copy ()
+sources = env.Glob('intern/*.c')
 
-#if user_options_dict['USE_OPENEXR'] == 1:
-#    SConscript (['intern/openexr/SConscript'])
+incs = '. ../makesdna #/intern/guardedalloc ../blenlib'
+incs += ' ../avi ../quicktime ../blenkernel'
 
-source_files = ['intern/allocimbuf.c',
-                'intern/amiga.c',
-                'intern/anim.c',
-                'intern/anim5.c',
-                'intern/antialias.c',
-                'intern/bitplanes.c',
-                'intern/bmp.c',
-                'intern/cmap.c',
-                'intern/cspace.c',
-                'intern/data.c',
-                'intern/dither.c',
-                'intern/divers.c',
-                'intern/dynlibtiff.c',
-                'intern/filter.c',
-                'intern/ham.c',
-                'intern/hamx.c',
-                'intern/iff.c',
-                'intern/imageprocess.c',
-                'intern/iris.c',
-                'intern/jpeg.c',
-                'intern/png.c',
-                'intern/radiance_hdr.c',
-                'intern/readimage.c',
-                'intern/rectop.c',
-                'intern/rotate.c',
-                'intern/scaling.c',
-                'intern/targa.c',
-                'intern/tiff.c',
-                'intern/util.c',
-                'intern/writeimage.c']
+incs += ' ' + env['BF_JPEG_INC']
+incs += ' ' + env['BF_PNG_INC']
+incs += ' ' + env['BF_TIFF_INC']
+incs += ' ' + env['BF_ZLIB_INC']
 
-imbuf_env.Append (CPPPATH = ['.',
-                             '../imbuf',
-                             '../makesdna',
-                             '#/intern/guardedalloc',
-                             '../blenlib',
-                             '../avi',
-                             '../quicktime',
-                             '../blenkernel'])
+defs = []
 
-imbuf_env.Append (CPPPATH = user_options_dict['JPEG_INCLUDE'])
-imbuf_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE'])
-imbuf_env.Append (CPPPATH = user_options_dict['TIFF_INCLUDE'])
-imbuf_env.Append (CPPPATH = user_options_dict['Z_INCLUDE'])
-imbuf_env.Append (CPPPATH = extra_includes)
-imbuf_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_imbuf', source=source_files)
+if env['WITH_BF_OPENEXR'] == 1:
+    defs.append('WITH_OPENEXR')
+
+if env['WITH_BF_QUICKTIME']==1:
+       incs += ' ' + env['BF_QUICKTIME_INC']
+       defs.append('WITH_QUICKTIME')
+
+env.BlenderLib ( libname = 'blender_imbuf', sources = sources, includes = Split(incs), defines = defs, libtype='core', priority = 80 )
index 22b61500cc24bd8fe457630fc03e0bff533b27f5..ec7b9b3518df62d7f5ec283e6a1fdef47f943155 100644 (file)
@@ -1,22 +1,17 @@
 #!/usr/bin/python
-Import ('extra_includes')
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-openexr_env = library_env.Copy ()
+source_files = ['openexr_api.cpp']
 
-source_files = ['openexr_api.cpp'
-                ]
+incs = ['.',
+       '../../../blenkernel',
+       '../../',
+       '..',
+       '../../../blenlib',
+       '../../../makesdna']
+incs += Split(env['BF_OPENEXR_INC'])
 
-include_paths = ['.',
-               '../../../blenkernel',
-               '../../',
-               '..',
-               '../../../blenlib',
-               '../../../makesdna']
+defs = []
                  
-openexr_env.Append(CPPPATH = extra_includes)
-openexr_env.Append(CPPPATH = include_paths)
-openexr_env.Prepend (CPPPATH = user_options_dict['OPENEXR_INCLUDE'])
-#ftf_env.Append(CPPDEFINES = 'FTGL_STATIC_LIBRARY')
-openexr_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_openexr', source=source_files)
+#openexr_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_openexr', source=source_files)
+env.BlenderLib ('blender_openexr', source_files, incs, defs, libtype='core', priority = 90)
index ed4564a3348cade7accf2bbf14188b62b415fc4b..a2a60c3428beb492c1e7aec8e8a3feade2191205 100644 (file)
@@ -1,15 +1,6 @@
-#!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+#!/usr/bin/env python
+Import ('env')
 
-img_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = ['intern/IMG_Api.cpp',
-                'intern/IMG_BrushRGBA32.cpp',
-                'intern/IMG_CanvasRGBA32.cpp',
-                'intern/IMG_Line.cpp',
-                'intern/IMG_Pixmap.cpp',
-                'intern/IMG_PixmapRGBA32.cpp',
-                'intern/IMG_Rect.cpp']
-
-img_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_img', source=source_files)
+env.BlenderLib ( 'blender_img', sources, [], [], libtype='core', priority = 35 )
index c9b352365ff66962a15954353d47bdbaa2d0346a..3978f8bbf48140b3b92365fcad2c9da9e0652fe6 100644 (file)
@@ -1,14 +1,11 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
-
-makesdna_env = library_env.Copy ()
+Import ('env')
 
 objs = []
 
 o = SConscript('intern/SConscript')
 objs.append (o)
 
-makesdna_env.Append (CPPPATH = ['#/intern/guardedalloc'])
+incs = '#/intern/guardedalloc'
 
-makesdna_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_makesdna', source=objs)
+env.BlenderLib ( 'blender_makesdna', objs, Split(incs), [], libtype='common', priority = 10 )
index e30f14f69cece5d8cf1dba253a75a70237653c6e..2e18528aaa4fb00f25a22f45c6413ad8aa112b7e 100644 (file)
@@ -2,33 +2,39 @@
 import sys
 import os
 
-Import ('cflags')
-Import ('defines')
-Import ('user_options_dict')
+#Import ('cflags')
+#Import ('defines')
+Import ('env')
+cflags = ''
+defines = []
+root_build_dir=env['BF_BUILDDIR']
 
 # TODO: make sure the makesdna program does not get installed on the system.
 source_files = ['makesdna.c']
 
-makesdna_tool = Environment (ENV = os.environ, CCFLAGS='-DBASE_HEADER="\\"source/blender/makesdna/\\"" ')
+makesdna_tool = env.Copy()
+dna = env.Copy()
+makesdna_tool.Append(CCFLAGS = '-DBASE_HEADER="\\"source/blender/makesdna/\\"" ')
+#makesdna_tool = Environment (ENV = os.environ, CCFLAGS='-DBASE_HEADER="\\"source/blender/makesdna/\\"" ')
 
 makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
                                  '../../makesdna'])
 
-makesdna_tool.Replace (CC = user_options_dict['HOST_CC'])
-makesdna_tool.Replace (PATH = user_options_dict['PATH'])
+#makesdna_tool.Replace (CC = user_options_dict['HOST_CC'])
+#makesdna_tool.Replace (PATH = user_options_dict['PATH'])
 
 if sys.platform != 'cygwin':
-       makesdna_tool.Append (CCFLAGS = cflags)
-       makesdna_tool.Append (LINKFLAGS = user_options_dict['PLATFORM_LINKFLAGS'])
+    makesdna_tool.Append (CCFLAGS = cflags)
+    #makesdna_tool.Append (LINKFLAGS = user_options_dict['PLATFORM_LINKFLAGS'])
 makesdna_tool.Append (CPPDEFINES = defines)
-makesdna_tool.Append (LIBPATH = '#'+user_options_dict['BUILD_DIR']+'/lib')
+makesdna_tool.Append (LIBPATH = '#'+root_build_dir+'/lib')
 makesdna_tool.Append (LIBS = 'blender_guardedalloc')
-makesdna_tool.Program (target = '#'+user_options_dict['BUILD_DIR']+'makesdna', source = source_files)
+makesdna_tool.Program (target = '#'+root_build_dir+'makesdna', source = source_files)
 
-dna = Environment (ENV = os.environ)
+#dna = Environment (ENV = os.environ)
 dna_dict = dna.Dictionary()
-makesdna_name = user_options_dict['BUILD_DIR']+'makesdna' + dna_dict['PROGSUFFIX']
+makesdna_name = root_build_dir+'makesdna' + dna_dict['PROGSUFFIX']
 dna.Depends ('dna.c', '#'+makesdna_name)
-dna.Command ('dna.c', '', user_options_dict['BUILD_DIR']+"makesdna $TARGET")
+dna.Command ('dna.c', '', root_build_dir+"makesdna $TARGET")
 obj = 'intern/dna.c'
 Return ('obj')
index aedafd84e962a048b0a0c9a1f74a164a4c72a5e3..a0622849465c582ffc87951486680d5eaa1364d1 100644 (file)
@@ -1,81 +1,18 @@
 #!/usr/bin/python
-Import ('extra_includes')
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-python_env = library_env.Copy ()
+sources = Split('BPY_interface.c BPY_menus.c') + env.Glob('api2_2x/*.c')
 
-source_files = ['BPY_interface.c',
-                'BPY_menus.c',
-                'api2_2x/Armature.c',
-                'api2_2x/BezTriple.c',
-                'api2_2x/BGL.c',
-                'api2_2x/Blender.c',
-                'api2_2x/Bone.c',
-                'api2_2x/Camera.c',
-                'api2_2x/CurNurb.c',
-                'api2_2x/Curve.c',
-                'api2_2x/Draw.c',
-                'api2_2x/Effect.c',
-                'api2_2x/Font.c',
-                'api2_2x/EXPP_interface.c',
-                'api2_2x/Ipocurve.c',
-                'api2_2x/Ipo.c',
-                'api2_2x/Key.c',
-                'api2_2x/Lamp.c',
-                'api2_2x/Lattice.c',
-                'api2_2x/Library.c',
-                'api2_2x/MTex.c',
-                'api2_2x/Material.c',
-                'api2_2x/Mathutils.c',
-                'api2_2x/Mesh.c',
-                'api2_2x/Metaball.c',
-                'api2_2x/NLA.c',
-                'api2_2x/Noise.c',
-                'api2_2x/NMesh.c',
-                'api2_2x/Object.c',
-                'api2_2x/Pose.c',
-                'api2_2x/point.c',
-                'api2_2x/Registry.c',
-                'api2_2x/Scene.c',
-                'api2_2x/Sound.c',
-                'api2_2x/Sys.c',
-                'api2_2x/Types.c',
-                'api2_2x/Window.c',
-                'api2_2x/World.c',
-                'api2_2x/Pose.c',
-                'api2_2x/Image.c',
-                'api2_2x/Text.c',
-                'api2_2x/Text3d.c',
-                'api2_2x/Texture.c',
-                'api2_2x/Noise.c',
-                'api2_2x/charRGBA.c',
-                'api2_2x/constant.c',
-                'api2_2x/euler.c',
-                'api2_2x/gen_utils.c',
-                'api2_2x/logic.c',
-                'api2_2x/matrix.c',
-                'api2_2x/quat.c',
-                'api2_2x/rgbTuple.c',
-                'api2_2x/sceneRender.c',
-                'api2_2x/sceneRadio.c',
-                'api2_2x/sceneTimeLine.c',
-                'api2_2x/vector.c',
-                'api2_2x/windowTheme.c']
+incs = 'api2_2x ../blenkernel ../blenlib ../blenloader'
+incs += ' ../render/extern/include ../radiosity/extern/include'
+incs += ' ../makesdna #intern/guardedalloc #intern/bmfont ../imbuf ../include'
+incs += ' ' + env['BF_PYTHON_INC']
+incs += ' ' + env['BF_OPENGL_INC']
 
-python_env.Append (CPPPATH = ['api2_2x',
-                              '../blenkernel',
-                              '../blenlib',
-                              '../blenloader',
-                              '../render/extern/include',
-                              '../radiosity/extern/include',
-                              '../makesdna',
-                              '#/intern/guardedalloc',
-                              '#/intern/bmfont',
-                              '../imbuf',
-                              '../include'])
+defs = []
 
-python_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-python_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
-python_env.Append (CPPPATH = extra_includes)
-python_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_python', source=source_files)
+if env['WITH_BF_QUICKTIME']==1:
+       incs += ' ' + env['BF_QUICKTIME_INC']
+       defs.append('WITH_QUICKTIME')
+
+env.BlenderLib ( libname='blender_python', sources = Split(sources), includes = Split(incs), defines = defs, libtype=['core','game2'], priority = [60,115] )
index f47611bbb139bc922c097ae8346fcdc77cb1bba0..dafbb865bf66e39fc9a42fa845017a1422793881 100644 (file)
@@ -1,26 +1,22 @@
 #!/usr/bin/python
-Import ('extra_includes')
-Import ('user_options_dict')
-Import ('library_env')
-
-quicktime_env = library_env.Copy ()
-
-quicktime_env.Append (CPPPATH = extra_includes)
+Import ('env')
 
 source_files = ['apple/quicktime_import.c',
                 'apple/quicktime_export.c']
 
-quicktime_env.Append (CPPPATH = ['.',
-                                 '../quicktime',
-                                 '../makesdna',
-                                 '#/intern/guardedalloc',
-                                 '../blenlib',
-                                 '../blenkernel',
-                                 '../avi',
-                                 '../imbuf',
-                                 '../imbuf/intern',
-                                 '../blenloader',
-                                 '../render/extern/include',
-                                 '../include'])
+incs  = ['.',
+                '../quicktime',
+                '../makesdna',
+                '#/intern/guardedalloc',
+                '../blenlib',
+                '../blenkernel',
+                '../avi',
+                '../imbuf',
+                '../imbuf/intern',
+                '../blenloader',
+                '../render/extern/include',
+                '../include']
+
+incs.append(env['BF_QUICKTIME_INC'])
 
-quicktime_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_quicktime', source=source_files)
+env.BlenderLib ('blender_quicktime', sources=source_files, includes=incs, defines=['WITH_QUICKTIME'], libtype='core', priority=95)
index 0c7205e6a830fb574bf593e988466ed5293d1b1e..102f79683f9e25344176e6aa1c8992e637437bc6 100644 (file)
@@ -1,26 +1,12 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-rad_env = library_env.Copy ()
+sources = env.Glob('intern/source/*.c')
 
-source_files = ['intern/source/raddisplay.c',
-                'intern/source/radfactors.c',
-                'intern/source/radrender.c',
-                'intern/source/radio.c',
-                'intern/source/radnode.c',
-                'intern/source/radpostprocess.c',
-                'intern/source/radpreprocess.c']
+incs = 'extern/include ../blenlib ../blenkernel ../makesdna ../include'
+incs += ' #/intern/guardedalloc ../render/extern/include'
+incs += ' ../render/intern/include'
 
-rad_env.Append (CPPPATH = ['extern/include',
-                           '../blenlib',
-                           '../blenkernel',
-                           '../makesdna',
-                           '../include',
-                           '#/intern/guardedalloc',
-                           '../render/extern/include',
-                           '../render/intern/include'])
+incs += ' ' + env['BF_OPENGL_INC']
 
-rad_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
-
-rad_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_radiosity', source=source_files)
+env.BlenderLib ( 'blender_radiosity', sources, Split(incs), [], libtype='core', priority=50 )
index 1f0909b1f84201135df2efec99361337b0bf9c69..901871ad2984e48b3d865f6161acb9d299511514 100644 (file)
@@ -1,20 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-readblenfile_env = library_env.Copy ()
+sources = env.Glob('intern/*.c')
 
-source_files = ['intern/BLO_readblenfile.c']
+incs = '.  ../blenloader ../blenloader/intern ../blenkernel ../blenlib ../makesdna ../../kernel/gen_messaging'
 
-readblenfile_env.Append (CPPPATH = ['.',
-
-'../readblenfile',
-                                                                       '../readstreamglue',
-                                                                       '../blenloader',
-                                                                       '../blenloader/intern',
-                                                                       '../blenkernel',
-                                                                       '../blenlib',
-                                                                       '../makesdna',
-                                                                       '../../kernel/gen_messaging'])
-
-readblenfile_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_readblenfile', source=source_files)
+env.BlenderLib ( 'blender_readblenfile', sources, Split(incs), [], libtype='common', priority = 0 )
index 256d4b16d8648b204f3f3442e27c126845b67518..b6243ecbcfb854477eb9d44d208cdcc4d0ea2f0d 100644 (file)
@@ -1,39 +1,18 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-render_env = library_env.Copy ()
+sources = env.Glob('intern/source/*.c')
 
-source_files = ['intern/source/convertblender.c',
-                'intern/source/edgeRender.c',
-                'intern/source/envmap.c',
-                'intern/source/gammaCorrectionTables.c',
-                'intern/source/imagetexture.c',
-                'intern/source/initrender.c',
-                'intern/source/pixelblending.c',
-                'intern/source/pixelshading.c',
-               'intern/source/pipeline.c',
-                'intern/source/ray.c',
-                'intern/source/rendercore.c',
-                'intern/source/renderdatabase.c',
-                'intern/source/shadbuf.c',
-                'intern/source/texture.c',
-                'intern/source/zbuf.c']
+incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna'
+incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf'
+incs += ' ../quicktime ../include ../../kernel/gen_messaging ../yafray'
 
+incs += ' ' + env['BF_SDL_INC']
 
-render_env.Append (CPPPATH = ['intern/include',
-                              '#/intern/guardedalloc',
-                              '../blenlib',
-                              '../makesdna',
-                              'extern/include',
-                              '../blenkernel',
-                              '../radiosity/extern/include',
-                              '../imbuf',
-                              '../quicktime',
-                              '../include',
-                              '../../kernel/gen_messaging',
-                              '../yafray'])
+defs = []
 
-render_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
+if env['WITH_BF_QUICKTIME'] == 1:
+       defs.append('WITH_QUICKTIME')
+       incs += ' ' + env['BF_QUICKTIME_INC']
 
-render_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_render', source=source_files)
+env.BlenderLib ( libname = 'blender_render', sources = sources, includes = Split(incs), defines=defs, libtype='core', priority=45 )
index bc5d9a3baa427baf589340b4eefffa63bf518597..1243e81609fd9ad664b83a69d420a566019c51e1 100644 (file)
 #!/usr/bin/python
-Import ('extra_includes')
-Import ('user_options_dict')
-Import ('library_env')
-Import ('defines')
+Import ('env')
 
-src_env = library_env.Copy ()
-src_env.Append (CCFLAGS = user_options_dict['SDL_CFLAGS'])
-src_env.Append(CPPDEFINES = defines)
+# TODO: src_env.Append (CCFLAGS = user_options_dict['SDL_CFLAGS'])
 
-source_files = ['B.blend.c',
-                'Bfont.c',
-                'bfont.ttf.c',
-                'blenderbuttons.c',
-                'booleanops.c',
-                'booleanops_mesh.c',
-                'buttons_editing.c',
-                'buttons_logic.c',
-                'buttons_object.c',
-                'buttons_scene.c',
-                'buttons_script.c',
-                'buttons_shading.c',
-                'butspace.c',
-                'cmap.tga.c',
-                'cmovie.tga.c',
-                'cursors.c',
-                'drawaction.c',
-               'drawarmature.c',
-                'drawdeps.c',
-                'drawimage.c',
-                'drawimasel.c',
-                'drawipo.c',
-                'drawmesh.c',
-                'drawnla.c',
-                'drawobject.c',
-                'drawoops.c',
-                'drawscene.c',
-                'drawscript.c',
-                'drawseq.c',
-                'drawsound.c',
-                'drawtext.c',
-                'drawtime.c',
-                'drawview.c',
-               'drawnode.c',
-                'edit.c',
-                'editaction.c',
-                'editarmature.c',
-                'editconstraint.c',
-                'editcurve.c',
-                'editdeform.c',
-                'editface.c',
-                'editfont.c',
-                'editgroup.c',
-                'editimasel.c',
-                'editipo.c',
-                'editipo_lib.c',
-                'editipo_mods.c',
-                'editkey.c',
-                'editlattice.c',
-                'editmball.c',
-                'editmesh.c',
-               'editnode.c',
-                'editmesh_add.c',
-                'editmesh_lib.c',
-                'editmesh_loop.c',
-                'editmesh_mods.c',
-                'editmesh_tools.c',
-                'editmode_undo.c',
-                'editnla.c',
-                'editobject.c',
-                'editoops.c',
-                'editscreen.c',
-                'editseq.c',
-                'editsima.c',
-                'editsound.c',
-                'edittime.c',
-                'editview.c',
-                'eventdebug.c',
-                'filesel.c',
-                'fluidsim.c',
-                'ghostwinlay.c',
-                'glutil.c',
-                'headerbuttons.c',
-                'header_action.c',
-                'header_buttonswin.c',
-                'header_filesel.c',
-                'header_image.c',
-                'header_imasel.c',
-                'header_info.c',
-                'header_ipo.c',
-                'header_nla.c',
-                'header_oops.c',
-                'header_script.c',
-                'header_seq.c',
-                'header_sound.c',
-                'header_text.c',
-                'header_time.c',
-                'header_view3d.c',
-               'header_node.c',
-                'imagepaint.c',
-                'imasel.c',
-                'interface.c',
-                'interface_panel.c',
-                'interface_draw.c',
-                'interface_icons.c',
-                'keyval.c',
-                'lorem.c',
-                'mainqueue.c',
-                'meshtools.c',
-                'mywindow.c',
-                'oops.c',
-                'outliner.c',
-                'splash.jpg.c',
-                'parametrizer.c',
-                'playanim.c',
-                'poseobject.c',
-                'previewrender.c',
-                'preview.blend.c',
-                'renderwin.c',
-                'resources.c',
-                'scrarea.c',
-                'screendump.c',
-                'sequence.c',
-                'seqaudio.c',
-                'space.c',
-                'spacetypes.c',
-                'swapbuffers.c',
-                'toets.c',
-                'toolbox.c',
-                'transform.c',
-                'transform_generics.c',
-                'transform_numinput.c',
-                'transform_constraints.c',
-                'transform_conversions.c',
-                'transform_manipulator.c',
-                'unwrapper.c',
-                'usiblender.c',
-                'view.c',
-                'vpaint.c',
-                'writeavicodec.c',
-                'writeimage.c',
-                'writemovie.c',
-                'language.c']
+sources = env.Glob('*.c')
 
-src_env.Append (CPPPATH = ['#/intern/guardedalloc',
-                           '../blenlib',
-                           '../makesdna',
-                           '../blenkernel',
-                           '../include',
-                           '#/intern/bmfont',
-                           '../imbuf',
-                           '../render/extern/include',
-                           '#/intern/bsp/extern',
-                           '../radiosity/extern/include',
-                           '#/intern/decimation/extern',
-                           '../blenloader',
-                           '../python',
-                           '../../kernel/gen_system',
-                           '#/intern/SoundSystem',
-                           '../readstreamglue',
-                           '../img',
-                           '../quicktime',
-                           '#/intern/elbeem/extern',
-                           '#/intern/ghost',
-                           '#/intern/opennl/extern'])
+incs = ' #/intern/guardedalloc ../blenlib ../makesdna ../blenkernel'
+incs += ' ../include #/intern/bmfont ../imbuf ../render/extern/include'
+incs += ' #/intern/bsp/extern ../renderconverter ../radiosity/extern/include'
+incs += ' #/intern/decimation/extern ../blenloader ../python'
+incs += ' ../../kernel/gen_system #/intern/SoundSystem ../readstreamglue'
+incs += ' ../img ../quicktime #/intern/elbeem/extern'
+incs += ' #/intern/ghost #/intern/opennl/extern'
 
-src_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-src_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
-src_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
+incs += ' ' + env['BF_PYTHON_INC']
+incs += ' ' + env['BF_SDL_INC']
+incs += ' ' + env['BF_OPENGL_INC']
 
-if user_options_dict['USE_INTERNATIONAL'] == 1:
-    src_env.Append (CPPPATH=['../ftfont'])
-    src_env.Append (CPPDEFINES = 'INTERNATIONAL')
-    src_env.Append (CPPDEFINES = 'FTGL_STATIC_LIBRARY')
+defs = []
 
-if user_options_dict['USE_BUILDINFO'] == 1:
-    src_env.Append (CPPDEFINES = 'NAN_BUILDINFO')
+if env['WITH_BF_FREETYPE'] == 1:
+    incs += ' ../ftfont'
+    defs.append('INTERNATIONAL')
+    defs.append('FTGL_STATIC_LIBRARY')
 
-src_env.Append (CPPPATH=extra_includes)
+if env['WITH_BF_OPENEXR'] == 1:
+    defs.append('WITH_OPENEXR')
 
-src_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_blendersrc', source=source_files)
+if env['WITH_BF_QUICKTIME']==1:
+    incs += ' ' + env['BF_QUICKTIME_INC']
+    defs.append('WITH_QUICKTIME')
+
+# TODO buildinfo
+#if env['USE_BUILDINFO'] == 1:
+#    defs += ' NAN_BUILDINFO'
+
+env.BlenderLib ( libname = 'src', sources = sources, includes = Split(incs), defines = defs, libtype=['core', 'intern'], priority = [5, 25] )
index a50ed2243fe0079f1aabae6a24b0552f709d252e..8da3b16fbfeb5a42dc885ce8f222b770aea787a8 100644 (file)
@@ -1,22 +1,9 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-yafray_env = library_env.Copy ()
+sources = env.Glob('intern/*.cpp')
 
-source_files = ['intern/yafray_Render.cpp',
-                'intern/export_File.cpp',
-                'intern/export_Plugin.cpp',
-                'intern/yafexternal.cpp',
-                'intern/api.cpp']
+incs = '#/intern/guardedalloc ../blenlib ../makesdna ../blenkernel'
+incs += ' ../imbuf ../include ../render/extern/include ../render/intern/include'
 
-yafray_env.Append (CPPPATH = ['#/intern/guardedalloc',
-                              '../blenlib',
-                              '../makesdna',
-                              '../blenkernel',
-                              '../imbuf',
-                              '../include',
-                              '../render/extern/include',
-                              '../render/intern/include'])
-
-yafray_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_yafray', source=source_files)
+env.BlenderLib ( 'blender_yafray', sources, Split(incs), [], libtype='blender', priority=5 )
index 412bb82e854e81892f273025be20e3c7ab19d1e2..9bc49b2fc308ec5060959bdf716a266cce7a5dec 100644 (file)
@@ -1,25 +1,18 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-creator_env = library_env.Copy ()
+sources = 'creator.c'
 
-source_files = ['creator.c']
+incs = '#/intern/guardedalloc ../blender/blenlib ../blender/blenkernel'
+incs += ' ../blender/include ../blender/blenloader ../blender/imbuf'
+incs += ' ../blender/renderconverter ../blender/render/extern/include'
+incs += ' ../blender/python ../blender/makesdna ../kernel/gen_messaging'
+incs += ' ../kernel/gen_system'
+incs += ' ' + env['BF_OPENGL_INC']
 
-creator_env.Append (CPPPATH = ['#/intern/guardedalloc',
-                               '../blender/blenlib',
-                               '../blender/blenkernel',
-                               '../blender/include',
-                               '../blender/blenloader',
-                               '../blender/imbuf',
-                               '../blender/render/extern/include',
-                               '../blender/python',
-                               '../blender/makesdna',
-                               '../kernel/gen_messaging',
-                               '../kernel/gen_system'])
-creator_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
+defs = []
+if env['WITH_BF_QUICKTIME']==1:
+    incs += ' ' + env['BF_QUICKTIME_INC']
+    defs.append('WITH_QUICKTIME')
 
-if user_options_dict['USE_QUICKTIME'] == 1:
-    creator_env.Append (CPPDEFINES = ['WITH_QUICKTIME'])
-
-creator_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_creator', source=source_files)
+env.BlenderLib ( libname = 'blender_creator', sources = Split(sources), includes = Split(incs), defines = defs, libtype='core', priority = 1 )
index f586e72ad444f35a46e03cd7c4d6d6d2d27aa28e..8db4513f84174390dc87e3a57c73275f0df6924d 100755 (executable)
@@ -1,55 +1,29 @@
 #!/usr/bin/python
 import sys
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-kx_blenderhook_env = library_env.Copy ()
+sources = env.Glob('*.cpp')
 
-source_files = ['KX_BlenderSystem.cpp',
-                'KX_BlenderRenderTools.cpp',
-                'KX_BlenderMouseDevice.cpp',
-                'KX_BlenderKeyboardDevice.cpp',
-                'KX_BlenderInputDevice.cpp',
-                'KX_BlenderGL.cpp',
-                'KX_BlenderCanvas.cpp',
-                'BL_KetsjiEmbedStart.cpp']
+incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc'
+incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #intern/bmfont'
+incs += ' #source/gameengine/Converter #source/blender/imbuf'
+incs += ' #intern/ghost/include'
+incs += ' #intern/moto/include #source/gameengine/Ketsji #source/blender/blenlib'
+incs += ' #source/blender/blenkernel #source/blender #source/blender/include'
+incs += ' #source/blender/makesdna #source/gameengine/Rasterizer #source/gameengine/GameLogic'
+incs += ' #source/gameengine/Expressions #source/gameengine/Network'
+incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common'
+incs += ' #source/gameengine/Physics/Bullet #source/gameengine/Physics/Sumo'
+incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
+incs += ' #intern/SoundSystem #source/blender/misc #source/blender/blenloader'
 
-kx_blenderhook_env.Append (CPPPATH=['.',
-                                    '#source/kernel/gen_system',
-                                    '#intern/string',
-                                    '#intern/guardedalloc',
-                                    '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
-                                    '#intern/bmfont',
-                                    '#source/gameengine/Converter',
-                                    '#source/blender/imbuf',
-                                    '#intern/moto/include',
-                                    '#source/gameengine/Ketsji',
-                                    '#source/blender/blenlib',
-                                    '#source/blender/blenkernel',
-                                    '#source/blender',
-                                    '#source/blender/include',
-                                    '#source/blender/makesdna',
-                                    '#source/gameengine/Rasterizer',
-                                    '#source/gameengine/GameLogic',
-                                    '#source/gameengine/Expressions',
-                                    '#source/gameengine/Network',
-                                    '#source/gameengine/SceneGraph',
-                                    '#source/gameengine/Physics/common',
-                                    '#source/gameengine/Physics/Bullet',
-                                    '#source/gameengine/Physics/Sumo',
-                                    '#source/gameengine/Physics/Sumo/Fuzzics/include',
-                                    '#source/gameengine/Network/LoopBackNetwork',
-                                    '#intern/SoundSystem',
-                                    '#source/blender/misc',
-                                    '#source/blender/blenloader'
-                                    ])
+incs += ' ' + env['BF_PYTHON_INC']
+incs += ' ' + env['BF_SOLID_INC']
+incs += ' ' + env['BF_BULLET_INC']
+incs += ' ' + env['BF_OPENGL_INC']
 
-kx_blenderhook_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-kx_blenderhook_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
-kx_blenderhook_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE'])
-kx_blenderhook_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
+# TODO: 
+#if sys.platform=='win32':
+#      kx_blenderhook_env.Append (CXXFLAGS = ['/GR'])
 
-if sys.platform=='win32':
-    kx_blenderhook_env.Append (CXXFLAGS = ['/GR'])
-
-kx_blenderhook_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/KX_blenderhook', source=source_files)
+env.BlenderLib ( 'KX_blenderhook', sources, Split(incs), [], libtype=['game', 'game2'], priority=[0, 0] )
index 361aeed412063925013f1d6296f0c927e50a1b49..82a059ea05067120641c224ae5c2311a7032f843 100755 (executable)
@@ -1,67 +1,25 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-kx_converter_env = library_env.Copy ()
+sources = env.Glob('*.cpp')
 
-source_files = ['KX_IpoConvert.cpp',
-                'KX_ConvertSensors.cpp',
-                'KX_ConvertProperties.cpp',
-                'KX_ConvertControllers.cpp',
-                'KX_ConvertActuators.cpp',
-                'KX_BlenderSceneConverter.cpp',
-                'KX_BlenderScalarInterpolator.cpp',
-                'BlenderWorldInfo.cpp',
-                'BL_SkinMeshObject.cpp',
-                'BL_SkinDeformer.cpp',
-                'BL_MeshDeformer.cpp',
-                'BL_DeformableGameObject.cpp',
-                'BL_BlenderDataConversion.cpp',
-                'BL_ArmatureObject.cpp',
-                'BL_ActionActuator.cpp'
-                ]
+incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc'
+incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #intern/bmfont'
+incs += ' #intern/SoundSystem #intern/SoundSystem/include #intern/SoundSystem/openal'
+incs += ' #intern/SoundSystem/dummy #intern/SoundSystem/intern #source/gameengine/Converter'
+incs += ' #source/gameengine/BlenderRoutines #source/blender/imbuf'
+incs += ' #intern/moto/include #source/gameengine/Ketsji #source/gameengine/Ketsji/KXNetwork'
+incs += ' #source/blender/blenlib #source/blender/blenkernel #source/blender'
+incs += ' #source/blender/include #source/blender/makesdna #source/gameengine/Rasterizer'
+incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #source/gameengine/GameLogic'
+incs += ' #source/gameengine/Expressions #source/gameengine/Network #source/gameengine/SceneGraph'
+incs += ' #source/gameengine/Physics/common #source/gameengine/Physics/Bullet #source/gameengine/Physics/BlOde'
+incs += ' #source/gameengine/Physics/Dummy #source/gameengine/Physics/Sumo'
+incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
+incs += ' #source/blender/misc #source/blender/blenloader'
 
-kx_converter_env.Append (CPPPATH = ['.',
-                                    '#source/kernel/gen_system',
-                                    '#intern/string',
-                                    '#intern/guardedalloc',
-                                    '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
-                                    '#intern/bmfont',
-                                    '#intern/SoundSystem',
-                                    '#intern/SoundSystem/include',
-                                    '#intern/SoundSystem/openal',
-                                    '#intern/SoundSystem/dummy',
-                                    '#intern/SoundSystem/intern',
-                                    '#source/gameengine/Converter',
-                                    '#source/gameengine/BlenderRoutines',
-                                    '#source/blender/imbuf',
-                                    '#intern/moto/include',
-                                    '#source/gameengine/Ketsji',
-                                    '#source/gameengine/Ketsji/KXNetwork',
-                                    '#source/blender/blenlib',
-                                    '#source/blender/blenkernel',
-                                    '#source/blender',
-                                    '#source/blender/include',
-                                    '#source/blender/makesdna',
-                                    '#source/gameengine/Rasterizer',
-                                   '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
-                                    '#source/gameengine/GameLogic',
-                                    '#source/gameengine/Expressions',
-                                    '#source/gameengine/Network',
-                                    '#source/gameengine/SceneGraph',
-                                    '#source/gameengine/Physics/common',
-                                    '#source/gameengine/Physics/Bullet',
-                                    '#source/gameengine/Physics/BlOde',
-                                    '#source/gameengine/Physics/Dummy',
-                                    '#source/gameengine/Physics/Sumo',
-                                    '#source/gameengine/Physics/Sumo/Fuzzics/include',
-                                    '#source/gameengine/Network/LoopBackNetwork',
-                                    '#source/blender/misc',
-                                    '#source/blender/blenloader'
-                                    ])
+incs += ' ' + env['BF_PYTHON_INC']
+incs += ' ' + env['BF_SOLID_INC']
+incs += ' ' + env['BF_BULLET_INC']
 
-kx_converter_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-kx_converter_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
-kx_converter_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE'])
-
-kx_converter_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/KX_converter', source=source_files)
+env.BlenderLib ( 'KX_converter', sources, Split(incs), [], libtype='game', priority=5 )
index 212381cc0341a3143ca8f4fc3516e810e8e7e6ca..2fd3bf6fe75d684649295db74601a9b1a0cc7413 100755 (executable)
@@ -1,34 +1,9 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-expressions_env = library_env.Copy ()
+sources = env.Glob('*.cpp')
 
-source_files = ['BoolValue.cpp',
-                'ConstExpr.cpp',
-                'EmptyValue.cpp',
-                'ErrorValue.cpp',
-                'EXP_C-Api.cpp',
-                'Expression.cpp',
-                'FloatValue.cpp',
-                'IdentifierExpr.cpp',
-                'IfExpr.cpp',
-                'InputParser.cpp',
-                'IntValue.cpp',
-                'KX_HashedPtr.cpp',
-                'ListValue.cpp',
-                'Operator1Expr.cpp',
-                'Operator2Expr.cpp',
-                'PyObjectPlus.cpp',
-                'StringValue.cpp',
-                'Value.cpp',
-                'VectorValue.cpp']
+incs ='. #source/kernel/gen_system #intern/string #intern/moto/include'
+incs += ' ' + env['BF_PYTHON_INC']
 
-expressions_env.Append (CPPPATH = ['.',
-                                   '#source/kernel/gen_system',
-                                   '#intern/string',
-                                  '#intern/moto/include'])
-
-expressions_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-
-expressions_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_expressions', source=source_files)
+env.BlenderLib ( 'blender_expressions', sources, Split(incs), [], libtype='game', priority = 45 )
index 928667ea4c1d440703db12933a29a456a522481a..126c84eecb2bfc359c7686be4f7ef903e78f84c8 100755 (executable)
@@ -1,48 +1,12 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-sca_gamelogic_env = library_env.Copy ()
+sources = env.Glob('*.cpp') + env.Glob('Joystick/*.cpp')
 
-source_files = ['SCA_ANDController.cpp',
-                'SCA_AlwaysEventManager.cpp',
-                'SCA_AlwaysSensor.cpp',
-                'SCA_EventManager.cpp',
-                'SCA_ExpressionController.cpp',
-                'SCA_IActuator.cpp',
-                'SCA_IController.cpp',
-                'SCA_IInputDevice.cpp',
-                'SCA_ILogicBrick.cpp',
-                'SCA_IObject.cpp',
-                'SCA_IScene.cpp',
-                'SCA_ISensor.cpp',
-               'SCA_JoystickManager.cpp',
-               'SCA_JoystickSensor.cpp',
-                'SCA_KeyboardManager.cpp',
-                'SCA_KeyboardSensor.cpp',
-                'SCA_LogicManager.cpp',
-                'SCA_MouseManager.cpp',
-                'SCA_MouseSensor.cpp',
-                'SCA_ORController.cpp',
-                'SCA_PropertyActuator.cpp',
-                'SCA_PropertyEventManager.cpp',
-                'SCA_PropertySensor.cpp',
-                'SCA_PythonController.cpp',
-                'SCA_RandomActuator.cpp',
-                'SCA_RandomEventManager.cpp',
-                'SCA_RandomNumberGenerator.cpp',
-                'SCA_RandomSensor.cpp',
-                'SCA_TimeEventManager.cpp',
-               'Joystick/SCA_Joystick.cpp',
-               'Joystick/SCA_JoystickEvents.cpp']
+incs = '. #/source/kernel/gen_system #/intern/string'
+incs += ' #/source/gameengine/Expressions #/intern/moto/include'
 
-sca_gamelogic_env.Append (CPPPATH=['.',
-                                   '#/source/kernel/gen_system',
-                                   '#/intern/string',
-                                   '#/source/gameengine/Expressions',
-                                   '#/intern/moto/include'])
+incs += ' ' + env['BF_PYTHON_INC']
+incs += ' ' + env['BF_SDL_INC']
 
-sca_gamelogic_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-sca_gamelogic_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
-
-sca_gamelogic_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/SCA_GameLogic', source=source_files)
+env.BlenderLib ( 'SCA_GameLogic', sources, Split(incs), [], libtype='game', priority=30 )
index 08a9a7ace5fa4391ec8ea9bb50107c818d64e8fb..0b140bba8e7604460c63db0edf2e687512da45eb 100644 (file)
@@ -1,3 +1,3 @@
 #!/usr/bin/python
 SConscript(['common/SConscript',
-                       'ghost/SConscript'])
\ No newline at end of file
+            'ghost/SConscript'])
index 4983160d94b49778f7e03bd5c9ca4839d3255283..d229e8488a2bd9c6920fa9b62584a9aec8b49e24 100644 (file)
@@ -1,73 +1,72 @@
 #!/usr/bin/python
 import sys
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-gp_common_env = library_env.Copy()
 
 source_files = ['bmfont.cpp',
-                               'GPC_Canvas.cpp',
-                               'GPC_Engine.cpp',
-                               'GPC_KeyboardDevice.cpp',
-                               'GPC_MouseDevice.cpp',
-                               'GPC_PolygonMaterial.cpp',
-                               'GPC_RawImage.cpp',
-                               'GPC_RawLoadDotBlendArray.cpp',
-                               'GPC_RawLogoArrays.cpp',
-                               'GPC_RenderTools.cpp',
-                               'GPC_System.cpp']
+                'GPC_Canvas.cpp',
+                'GPC_Engine.cpp',
+                'GPC_KeyboardDevice.cpp',
+                'GPC_MouseDevice.cpp',
+                'GPC_PolygonMaterial.cpp',
+                'GPC_RawImage.cpp',
+                'GPC_RawLoadDotBlendArray.cpp',
+                'GPC_RawLogoArrays.cpp',
+                'GPC_RenderTools.cpp',
+                'GPC_System.cpp']
 
-gp_common_env.Append( CPPPATH = ['.',
-                                                               '#intern/string',
-                                                               '#intern/ghost',
-                                                               '#intern/guardedalloc',
-                                                               '#intern/bmfont',
-                                                               '#intern/moto/include',
-                                                               '#intern/SoundSystem',
-                                                               '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
-                                                               '#source/kernel/gen_system',
-                                                               '#source/kernel/gen_messaging',
-                                                               '#source/gameengine/Converter',
-                                                               '#source/blender/imbuf',
-                                                               '#source/gameengine/Ketsji',
-                                                               '#source/blender/blenlib',
-                                                               '#source/blender/blenkernel',
-                                                               '#source/blender',
-                                                               '#source/blender/include',
-                                                               '#source/blender/makesdna',
-                                                               '#source/gameengine/Rasterizer',
-                                                               '#source/gameengine/GameLogic',
-                                                               '#source/gameengine/Expressions',
-                                                               '#source/gameengine/Network',
-                                                               '#source/gameengine/SceneGraph',
-                                                               '#source/gameengine/Physics/common',
-                                                               '#source/gameengine/Physics/Sumo',
-                                                               '#source/gameengine/Physics/Sumo/Fuzzics/include',
-                                                               '#source/gameengine/Network/LoopBackNetwork',
-                                                               '#source/gameengine/GamePlayer/ghost',
-                                                               '#source/blender/misc',
-                                                               '#source/blender/blenloader'])
-                                                               
+incs = ['.',
+        '#intern/string',
+        '#intern/ghost',
+        '#intern/guardedalloc',
+        '#intern/bmfont',
+        '#intern/moto/include',
+        '#intern/SoundSystem',
+        '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
+        '#source/kernel/gen_system',
+        '#source/kernel/gen_messaging',
+        '#source/gameengine/Converter',
+        '#source/blender/imbuf',
+        '#source/gameengine/Ketsji',
+        '#source/blender/blenlib',
+        '#source/blender/blenkernel',
+        '#source/blender',
+        '#source/blender/include',
+        '#source/blender/makesdna',
+        '#source/gameengine/Rasterizer',
+        '#source/gameengine/GameLogic',
+        '#source/gameengine/Expressions',
+        '#source/gameengine/Network',
+        '#source/gameengine/SceneGraph',
+        '#source/gameengine/Physics/common',
+        '#source/gameengine/Physics/Sumo',
+        '#source/gameengine/Physics/Sumo/Fuzzics/include',
+        '#source/gameengine/Network/LoopBackNetwork',
+        '#source/gameengine/GamePlayer/ghost',
+        '#source/blender/misc',
+        '#source/blender/blenloader']
+                                
 #This is all plugin stuff!
 #if sys.platform=='win32':
-#      source_files += ['windows/GPW_Canvas.cpp',
-#                                       'windows/GPW_Engine.cpp',
-#                                       'windows/GPW_KeyboardDevice.cpp',
-#                                       'windows/GPW_System.cpp']
-#      gp_common_env.Append ( CPPPATH = ['windows'])
+#   source_files += ['windows/GPW_Canvas.cpp',
+#                    'windows/GPW_Engine.cpp',
+#                    'windows/GPW_KeyboardDevice.cpp',
+#                    'windows/GPW_System.cpp']
+#   gp_common_env.Append ( CPPPATH = ['windows'])
 #elif sys.platform=='linux2' or sys.platform=='linux-i386':
-#      source_files += ['unix/GPU_Canvas.cpp',
-#                                       'unix/GPU_Engine.cpp',
-#                                       'unix/GPU_KeyboardDevice.cpp',
-#                                       'unix/GPU_System.cpp']
-#      gp_common_env.Append ( CPPPATH = ['unix'])
+#   source_files += ['unix/GPU_Canvas.cpp',
+#                    'unix/GPU_Engine.cpp',
+#                    'unix/GPU_KeyboardDevice.cpp',
+#                    'unix/GPU_System.cpp']
+#   gp_common_env.Append ( CPPPATH = ['unix'])
 
-gp_common_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-gp_common_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
-gp_common_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE'])
-gp_common_env.Append (CPPPATH = user_options_dict['Z_INCLUDE'])
+incs += Split(env['BF_PYTHON_INC'])
+incs += Split(env['BF_SOLID_INC'])
+incs += Split(env['BF_PNG_INC'])
+incs += Split(env['BF_ZLIB_INC'])
 
+cflags=[]
 if sys.platform=='win32':
-    gp_common_env.Append (CXXFLAGS = ['/GR'])
+    cflags = ['/GR']
 
-gp_common_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/GPC_common', source=source_files)
+env.BlenderLib (libname='GPC_common', sources=source_files, includes=incs, defines = [], libtype=['player'], priority=[5], compileflags=cflags)
index f3dbf2aeed51b6b19ac46c6163fc1278420e539b..0d56a02a4a32cc9ca743462b38422d13f4e04a83 100644 (file)
@@ -1,52 +1,49 @@
 #!/usr/bin/python
 import sys
-Import ('user_options_dict')
-Import ('library_env')
-
-gp_ghost_env = library_env.Copy()
+Import ('env')
 
 source_files = ['GPG_Application.cpp',
-                               'GPG_Canvas.cpp',
-                               'GPG_ghost.cpp',
-                               'GPG_KeyboardDevice.cpp',
-                               'GPG_System.cpp']
-
-gp_ghost_env.Append( CPPPATH = ['.',
-                                                               '#intern/string',
-                                                               '#intern/ghost',
-                                                               '#intern/guardedalloc',
-                                                               '#intern/bmfont',
-                                                               '#intern/moto/include',
-                                                               '#intern/SoundSystem',
-                                                               '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
-                                                               '#source/kernel/gen_system',
-                                                               '#source/kernel/gen_messaging',
-                                                               '#source/gameengine/Converter',
-                                                               '#source/blender/imbuf',
-                                                               '#source/gameengine/Ketsji',
-                                                               '#source/blender/blenlib',
-                                                               '#source/blender/blenkernel',
-                                                               '#source/blender/readblenfile',
-                                                               '#source/blender',
-                                                               '#source/blender/include',
-                                                               '#source/blender/makesdna',
-                                                               '#source/gameengine/Rasterizer',
-                                                               '#source/gameengine/GameLogic',
-                                                               '#source/gameengine/Expressions',
-                                                               '#source/gameengine/Network',
-                                                               '#source/gameengine/SceneGraph',
-                                                               '#source/gameengine/Physics/common',
-                                                               '#source/gameengine/Physics/Sumo',
-                                                               '#source/gameengine/Physics/Sumo/Fuzzics/include',
-                                                               '#source/gameengine/Network/LoopBackNetwork',
-                                                               '#source/gameengine/GamePlayer/common',
-                                                               '#source/blender/misc',
-                                                               '#source/blender/blenloader'])
+                'GPG_Canvas.cpp',
+                'GPG_ghost.cpp',
+                'GPG_KeyboardDevice.cpp',
+                'GPG_System.cpp']
 
-gp_ghost_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-gp_ghost_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
+incs = ['.',
+        '#intern/string',
+        '#intern/ghost',
+        '#intern/guardedalloc',
+        '#intern/bmfont',
+        '#intern/moto/include',
+        '#intern/SoundSystem',
+        '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
+        '#source/kernel/gen_system',
+        '#source/kernel/gen_messaging',
+        '#source/gameengine/Converter',
+        '#source/blender/imbuf',
+        '#source/gameengine/Ketsji',
+        '#source/blender/blenlib',
+        '#source/blender/blenkernel',
+        '#source/blender/readblenfile',
+        '#source/blender',
+        '#source/blender/include',
+        '#source/blender/makesdna',
+        '#source/gameengine/Rasterizer',
+        '#source/gameengine/GameLogic',
+        '#source/gameengine/Expressions',
+        '#source/gameengine/Network',
+        '#source/gameengine/SceneGraph',
+        '#source/gameengine/Physics/common',
+        '#source/gameengine/Physics/Sumo',
+        '#source/gameengine/Physics/Sumo/Fuzzics/include',
+        '#source/gameengine/Network/LoopBackNetwork',
+        '#source/gameengine/GamePlayer/common',
+        '#source/blender/misc',
+        '#source/blender/blenloader']
 
+incs += Split(env['BF_PYTHON_INC'])
+incs += Split(env['BF_SOLID_INC'])
+cflags = []
 if sys.platform=='win32':
-    gp_ghost_env.Append (CXXFLAGS = ['/GR'])
+    cflags = ['/GR']
 
-gp_ghost_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/GPG_ghost', source=source_files)
\ No newline at end of file
+env.BlenderLib (libname='GPG_ghost', sources=source_files, includes = incs, defines = [], libtype='player',priority=0, compileflags=cflags)
index 820255a5ff4fab9b55c4e80afc7a71dfb477ca1d..7c0f3f1ab28dcefdb12d9f2d9a79a50cef446c59 100755 (executable)
@@ -1,25 +1,12 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-kx_network_env = library_env.Copy ()
+sources = env.Glob('*.cpp')
 
-source_files = ['KX_NetworkEventManager.cpp',
-                'KX_NetworkMessageActuator.cpp',
-                'KX_NetworkMessageSensor.cpp',
-                'KX_NetworkObjectActuator.cpp',
-                'KX_NetworkObjectSensor.cpp'
-                ]
+incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Ketsji'
+incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions'
+incs += ' #source/gameengine/Network'
 
-kx_network_env.Append (CPPPATH = ['.',
-                                  '#source/kernel/gen_system',
-                                  '#intern/string',
-                                  '#source/gameengine/Ketsji',
-                                  '#source/gameengine/GameLogic',
-                                  '#source/gameengine/Expressions',
-                                  '#source/gameengine/Network',
-                                 ])
+incs += ' ' + env['BF_PYTHON_INC']
 
-kx_network_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-
-kx_network_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/KX_network', source=source_files)
+env.BlenderLib ( 'KX_network', Split(sources), Split(incs), defines=[],libtype='game2', priority=5 )
index 26c982dc4f9560f82618b7d3e9710d08b0810a92..375f2679e216663b3ab8e0dabd5081441cd9610c 100644 (file)
 #!/usr/bin/python
 import sys
 
-Import ('user_options_dict')
-Import ('library_env')
-
-ketsji_env = library_env.Copy ()
-
-source_files = ['BL_Shader.cpp',
-               'BL_Material.cpp',
-               'BL_Texture.cpp',
-               'KX_WorldIpoController.cpp',
-                'KX_WorldInfo.cpp',
-                'KX_VisibilityActuator.cpp',
-                'KX_VertexProxy.cpp',
-                'KX_TrackToActuator.cpp',
-                'KX_TouchSensor.cpp',
-                'KX_TouchEventManager.cpp',
-                'KX_TimeLogger.cpp',
-                'KX_TimeCategoryLogger.cpp',
-                'KX_SoundActuator.cpp',
-                'KX_SG_NodeRelationships.cpp',
-               'KX_SG_BoneParentNodeRelationship.cpp',
-                'KX_SceneActuator.cpp',
-                'KX_Scene.cpp',
-                'KX_ScalingInterpolator.cpp',
-                'KX_ScalarInterpolator.cpp',
-                'KX_SCA_ReplaceMeshActuator.cpp',
-                'KX_SCA_EndObjectActuator.cpp',
-                'KX_SCA_AddObjectActuator.cpp',
-                'KX_RaySensor.cpp',
-                'KX_RayEventManager.cpp',
-               'KX_RayCast.cpp',
-                'KX_RadarSensor.cpp',
-                'KX_PyMath.cpp',
-                'KX_PythonInit.cpp',
-                'KX_PyConstraintBinding.cpp',
-                'KX_PositionInterpolator.cpp',
-               'KX_PolygonMaterial.cpp',
-                'KX_PhysicsObjectWrapper.cpp',
-                'KX_OrientationInterpolator.cpp',
-                'KX_ObjectActuator.cpp',
-                'KX_ObColorIpoSGController.cpp',
-                'KX_NearSensor.cpp',
-                'KX_MouseFocusSensor.cpp',
-                'KX_MotionState.cpp',
-                'KX_MeshProxy.cpp',
-                'KX_LightIpoSGController.cpp',
-                'KX_Light.cpp',
-                'KX_KetsjiEngine.cpp',
-                'KX_IpoActuator.cpp',
-                'KX_IPO_SGController.cpp',
-                'KX_IPhysicsController.cpp',
-                'KX_GameObject.cpp',
-                'KX_GameActuator.cpp',
-                'KX_EmptyObject.cpp',
-                'KX_ConvertPhysicsObjects.cpp',
-                'KX_ConstraintWrapper.cpp',
-                'KX_ConstraintActuator.cpp',
-                'KX_CDActuator.cpp',
-                'KX_CameraIpoSGController.cpp',
-                'KX_CameraActuator.cpp',
-                'KX_Camera.cpp',
-                'KX_BulletPhysicsController.cpp',
-                'KX_BlenderMaterial.cpp',
-                'KX_MaterialIpoController.cpp',
-               'KX_VehicleWrapper.cpp',
-                ]
-
-if user_options_dict['USE_PHYSICS'] == 'solid':
-    source_files += ['KX_SumoPhysicsController.cpp']
-    ketsji_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
-
-if user_options_dict['USE_PHYSICS'] == 'ode':
-    source_files += ['KX_OdePhysicsController.cpp']
-    ketsji_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
-
-
-ketsji_env.Append (CPPPATH = ['.',
-                              '#source/kernel/gen_system',
-                              '#intern/string',
-                              '#intern/guardedalloc',
-                              '#source/gameengine/Rasterizer/RAS_OpenGLRasterizer',
-                              '#intern/bmfont',
-                              '#intern/SoundSystem',
-                              '#intern/SoundSystem/include',
-                              '#intern/SoundSystem/openal',
-                              '#intern/SoundSystem/dummy',
-                              '#intern/SoundSystem/intern',
-                              '#source/gameengine/Converter',
-                              '#source/gameengine/BlenderRoutines',
-                              '#source/blender/imbuf',
-                              '#intern/moto/include',
-                              '#source/gameengine/Ketsji',
-                              '#source/gameengine/Ketsji/KXNetwork',
-                              '#source/blender/blenlib',
-                              '#source/blender/blenkernel',
-                              '#source/blender',
-                              '#source/blender/include',
-                              '#source/blender/makesdna',
-                              '#source/blender/python',
-                              '#source/gameengine/Rasterizer',
-                              '#source/gameengine/GameLogic',
-                              '#source/gameengine/Expressions',
-                              '#source/gameengine/Network',
-                              '#source/gameengine/SceneGraph',
-                              '#source/gameengine/Physics/common',
-                              '#source/gameengine/Physics/Bullet',
-                              '#source/gameengine/Physics/BlOde',
-                              '#source/gameengine/Physics/Dummy',
-                              '#source/gameengine/Physics/Sumo',
-                              '#source/gameengine/Physics/Sumo/include',
-                              '#source/gameengine/Physics/Sumo/Fuzzics/include',
-                              '#source/gameengine/Network/LoopBackNetwork',
-                              '#source/blender/misc',
-                              '#source/blender/blenloader'
-                             ])
-
-if sys.platform == 'win32':
-       ketsji_env.Append (CXXFLAGS = ['/GR'])
-       ketsji_env.Append ( CCFLAGS =['/Ox'])
-ketsji_env.Append (CPPPATH = user_options_dict['PYTHON_INCLUDE'])
-ketsji_env.Append (CPPPATH = user_options_dict['SDL_INCLUDE'])
-ketsji_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE'])
-
-ketsji_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/KX_ketsji', source=source_files)
+Import ('env')
+
+sources = env.Glob('*.cpp')
+
+incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc'
+incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #intern/bmfont'
+incs += ' #intern/SoundSystem #intern/SoundSystem/include #intern/SoundSystem/openal'
+incs += ' #intern/SoundSystem/dummy #intern/SoundSystem/intern #source/gameengine/Converter'
+incs += ' #source/gameengine/BlenderRoutines #source/blender/imbuf #intern/moto/include'
+incs += ' #source/gameengine/Ketsji #source/gameengine/Ketsji/KXNetwork #source/blender/blenlib'
+incs += ' #source/blender/blenkernel #source/blender #source/blender/include'
+incs += ' #source/blender/makesdna #source/blender/python #source/gameengine/Rasterizer'
+incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions #source/gameengine/Network'
+incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common #source/gameengine/Physics/Bullet'
+incs += ' #source/gameengine/Physics/BlOde #source/gameengine/Physics/Dummy'
+incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/include'
+incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
+incs += ' #source/blender/misc #source/blender/blenloader'
+
+#TODO:
+#if sys.platform == 'win32':
+#      ketsji_env.Append (CXXFLAGS = ['/GR'])
+#      ketsji_env.Append ( CCFLAGS =['/Ox'])
+
+incs += ' ' + env['BF_SOLID_INC']
+incs += ' ' + env['BF_PYTHON_INC']
+incs += ' ' + env['BF_SDL_INC']
+incs += ' ' + env['BF_BULLET_INC']
+
+env.BlenderLib ( 'KX_ketsji', sources, Split(incs), [], libtype='game', priority=25 )
index 333dff4d9875680c2e14f6d8d5ec85d3c2d02cdf..292abc8e7a999bd7655340639aa54a7155e98b0b 100755 (executable)
@@ -1,15 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-ng_loopbacknetwork_env = library_env.Copy ()
+sources = 'NG_LoopBackNetworkDeviceInterface.cpp'
 
-source_files = ['NG_LoopBackNetworkDeviceInterface.cpp']
+incs = '. #source/kernel/gen_system #intern/string #source/gameengine/Network'
 
-ng_loopbacknetwork_env.Append (CPPPATH=['.',
-                                        '#source/kernel/gen_system',
-                                        '#intern/string',
-                                        '#source/gameengine/Network',
-                                       ])
-
-ng_loopbacknetwork_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/NG_loopbacknetwork', source=source_files)
+env.BlenderLib ( 'NG_loopbacknetwork', Split(sources), Split(incs), defines=[],libtype='game2', priority=25 )
index 489bea7a970d8cf6f60984ac2af983bd0d573a05..998e6f36af33f29e44bc63efa1d7d3432745585b 100755 (executable)
@@ -1,17 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-ng_network_env = library_env.Copy ()
+sources = env.Glob('*.cpp') #'NG_NetworkMessage.cpp NG_NetworkObject.cpp NG_NetworkScene.cpp'
 
-source_files = ['NG_NetworkMessage.cpp',
-                'NG_NetworkObject.cpp',
-                'NG_NetworkScene.cpp']
+incs = '. #source/kernel/gen_system #intern/string #intern/moto/include'
 
-ng_network_env.Append (CPPPATH=['.',
-                                '#source/kernel/gen_system',
-                                '#intern/string',
-                               '#intern/moto/include'
-                               ])
-
-ng_network_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/NG_network', source=source_files)
+env.BlenderLib ( 'NG_network', sources, Split(incs), [], libtype='game2', priority=15 )
index 8d82f346757349a5ac758014a3192f835e4382bb..b9d7bed8880a5ceaee64411486e262f7c7654912 100644 (file)
@@ -1,22 +1,16 @@
 #!/usr/bin/python
 import sys
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-phy_bullet_env = library_env.Copy ()
+sources = 'CcdPhysicsEnvironment.cpp CcdPhysicsController.cpp'
 
-source_files = ['CcdPhysicsEnvironment.cpp',
-                'CcdPhysicsController.cpp'
-               ]
+incs = '. ../common'
 
-phy_bullet_env.Append (CPPPATH=['.', 
-                               '../common'])
+incs += ' ' + env['BF_BULLET_INC']
 
-phy_bullet_env.Append (CPPPATH = user_options_dict['BULLET_INCLUDE'])
+#TODO:
+#if sys.platform=='win32':
+#      phy_bullet_env.Append (CXXFLAGS = ['/GR'])
+# phy_bullet_env.Append (CCFLAGS =['/O2'])
 
-
-if sys.platform=='win32':
-       phy_bullet_env.Append (CXXFLAGS = ['/GR'])
-       phy_bullet_env.Append (CCFLAGS =['/O2'])
-
-phy_bullet_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/PHY_Bullet', source=source_files)
+env.BlenderLib ( 'PHY_Bullet', Split(sources), Split(incs), [], libtype='game', priority=15 )
index b5a642d4f9a85b9e7a0367e63f5ba03551386a15..781e88e456f26bc34eadcb0c7b84505c2b82e8fd 100755 (executable)
@@ -1,13 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-phy_dummy_env = library_env.Copy ()
+sources = 'DummyPhysicsEnvironment.cpp'
 
-source_files = ['DummyPhysicsEnvironment.cpp']
+incs = '. ../common'
 
-phy_dummy_env.Append (CPPPATH = ['.',
-                                 '../common'
-                                ])
-
-phy_dummy_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/PHY_Dummy', source=source_files)
+env.BlenderLib ( 'PHY_Dummy', Split(sources), Split(incs), [], libtype='game', priority=10 )
index b502a1ec6160c23757e57e3e499f51a4d684a721..7407aec469d028a088b407239554b8308de94a77 100755 (executable)
@@ -1,11 +1,8 @@
 #!/usr/bin/python
-import sys
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-phy_sumo_env = library_env.Copy ()
-
-source_files = ['SumoPHYCallbackBridge.cpp',
+sumoenv = env.Copy()
+sources = ['SumoPHYCallbackBridge.cpp',
                 'SumoPhysicsController.cpp',
                 'SumoPhysicsEnvironment.cpp',
                 'Fuzzics/src/SM_FhObject.cpp',
@@ -14,16 +11,16 @@ source_files = ['SumoPHYCallbackBridge.cpp',
                 'Fuzzics/src/SM_MotionState.cpp'
                ]
 
-phy_sumo_env.Append (CPPPATH = ['.',
-                                '../common',
-                                'Fuzzics/include',
-                                '#/intern/moto/include'
-                               ])
-
-phy_sumo_env.Append (CPPPATH = user_options_dict['SOLID_INCLUDE'])
+incs =['.',
+       '../common',
+       'Fuzzics/include',
+       '#/intern/moto/include'
+       ]
+incs += [sumoenv['BF_SOLID_INC']]
 
-if sys.platform=='win32':
-       phy_sumo_env.Append (CXXFLAGS = ['/GR'])
-       phy_sumo_env.Append ( CCFLAGS =['/O1'])
+if sumoenv['PLATFORM']=='win32':
+       sumoenv.Append (CXXFLAGS = ['/GR'])
+       sumoenv.Append ( CCFLAGS =['/O1'])
 
-phy_sumo_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/PHY_Sumo', source=source_files)
+#env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/PHY_Sumo', source=source_files)
+env.BlenderLib ( 'PHY_Sumo', sources, incs, [], libtype='game2', priority=30 )
index fbde29861e6ef30be94fad143cc984364d9d1088..b6cb78742ab6a12b0808a7165d0243417df7ea2c 100755 (executable)
@@ -1,16 +1,8 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-phy_physics_env = library_env.Copy ()
+sources = 'PHY_IMotionState.cpp PHY_IPhysicsController.cpp PHY_IPhysicsEnvironment.cpp'
 
-source_files = ['PHY_IMotionState.cpp',
-                'PHY_IPhysicsController.cpp',
-                'PHY_IPhysicsEnvironment.cpp']
+incs = '. ../Dummy #intern/moto/include'
 
-phy_physics_env.Append (CPPPATH = ['.',
-                                   '../Dummy',
-                                   '#intern/moto/include'
-                                  ])
-
-phy_physics_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/PHY_Physics', source=source_files)
+env.BlenderLib ( 'PHY_Physics', Split(sources), Split(incs), [], libtype=['game', 'game2'], priority=[20, 35] )
index 6baebd0fabcb8a0925587d5f00dab78efd51fe85..56183c88946717f38fa6b895cb57950f87393935 100755 (executable)
@@ -1,19 +1,9 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-ras_openglrasterizer_env = library_env.Copy ()
+sources = env.Glob('*.cpp') #'RAS_GLExtensionManager.cpp RAS_OpenGLRasterizer.cpp RAS_VAOpenGLRasterizer.cpp'
 
-source_files = ['RAS_GLExtensionManager.cpp',
-                'RAS_OpenGLRasterizer.cpp',
-                'RAS_VAOpenGLRasterizer.cpp']
+incs = '. #source/kernel/gen_system #intern/string #intern/moto/include #source/gameengine/Rasterizer'
+incs += ' ' + env['BF_OPENGL_INC']
 
-ras_openglrasterizer_env.Append (CPPPATH=['.',
-                                          '#source/kernel/gen_system',
-                                          '#intern/string',
-                                          '#intern/moto/include',
-                                          '#source/gameengine/Rasterizer'
-                                         ])
-ras_openglrasterizer_env.Append (CPPPATH = user_options_dict['OPENGL_INCLUDE'])
-
-ras_openglrasterizer_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/RAS_OpenGLRasterizer', source=source_files)
+env.BlenderLib ( 'RAS_OpenGLRasterizer', Split(sources), Split(incs), [], libtype='game', priority=40 )
index 358edb6c9de26b32d3f9054a13cbdbad5154a5af..1b833c8d7eedd6e77bcd6b5e2b204d9efbe78da3 100755 (executable)
@@ -1,27 +1,13 @@
 #!/usr/bin/python
 import sys
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-ras_rasterizer_env = library_env.Copy ()
+sources = env.Glob('*.cpp')
 
-source_files = ['RAS_BucketManager.cpp',
-                'RAS_FramingManager.cpp',
-                'RAS_IPolygonMaterial.cpp',
-                'RAS_IRenderTools.cpp',
-                'RAS_MaterialBucket.cpp',
-                'RAS_MeshObject.cpp',
-                'RAS_Polygon.cpp',
-                'RAS_TexVert.cpp',
-                'RAS_texmatrix.cpp']
+incs = '. #source/kernel/gen_system #intern/string #intern/moto/include'
 
-ras_rasterizer_env.Append (CPPPATH=['.',
-                                    '#source/kernel/gen_system',
-                                    '#intern/string',
-                                    '#intern/moto/include'
-                                   ])
+#TODO:
+#if sys.platform=='win32':
+#      ras_rasterizer_env.Append ( CCFLAGS =['/Ox'])
 
-if sys.platform=='win32':
-       ras_rasterizer_env.Append ( CCFLAGS =['/Ox'])
-
-ras_rasterizer_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/RAS_rasterizer', source=source_files)
+env.BlenderLib ( 'RAS_rasterizer', sources, Split(incs), [], libtype='game', priority=35 )
index ca4283944b59259e06074483eab2bdbde0c3eec2..c2750d19706c0f1aef58969af372b69d6ea4a07e 100644 (file)
@@ -1,5 +1,5 @@
 #!/usr/bin/python
-Import ('user_options_dict')
+Import ('env')
 
 SConscript(['BlenderRoutines/SConscript',
             'Converter/SConscript',
@@ -14,12 +14,14 @@ SConscript(['BlenderRoutines/SConscript',
             'Rasterizer/SConscript',
             'Rasterizer/RAS_OpenGLRasterizer/SConscript',
             'SceneGraph/SConscript',
-            'Physics/Bullet/SConscript'])
+            'Physics/Bullet/SConscript',
+            'Physics/Sumo/SConscript'
+            ])
 
-if user_options_dict['BUILD_BLENDER_PLAYER']:
-       SConscript(['GamePlayer/SConscript'])
+if env['WITH_BF_PLAYER']:
+    SConscript(['GamePlayer/SConscript'])
 
-if user_options_dict['USE_PHYSICS'] == 'solid':
-    SConscript(['Physics/Sumo/SConscript'])
-elif user_options_dict['USE_PHYSICS'] == 'ode':
-    SConscript(['Physics/BlOde/SConscript'])
+#if user_options_dict['USE_PHYSICS'] == 'solid':
+#    SConscript(['Physics/Sumo/SConscript'])
+#elif user_options_dict['USE_PHYSICS'] == 'ode':
+#    SConscript(['Physics/BlOde/SConscript'])
index 2905684d50ee652583aab62344fb94b6cbaa9d55..d34f41eb2afda8bcbe3e5c576acac62bebb30446 100755 (executable)
@@ -1,19 +1,9 @@
 #!/usr/bin/python
 
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-sg_scenegraph_env = library_env.Copy ()
+sources = env.Glob('*.cpp') #'SG_BBox.cpp SG_Controller.cpp SG_IObject.cpp SG_Node.cpp SG_Spatial.cpp SG_Tree.cpp'
 
-source_files = ['SG_BBox.cpp',
-                'SG_Controller.cpp',
-                'SG_IObject.cpp',
-                'SG_Node.cpp',
-                'SG_Spatial.cpp',
-                'SG_Tree.cpp']
+incs = '. #intern/moto/include'
 
-sg_scenegraph_env.Append (CPPPATH=['.',
-                                   '#intern/moto/include'
-                                  ])
-
-sg_scenegraph_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/SG_SceneGraph', source=source_files)
+env.BlenderLib ( 'SG_SceneGraph', sources, Split(incs), [], libtype='game', priority=50 )
index cb1dc0decbe630a45eecf323f3019f0c792b624e..373f50f1232da0537826cb47cc456844da86d505 100644 (file)
@@ -1,18 +1,10 @@
 #!/usr/bin/python
-Import ('user_options_dict')
-Import ('library_env')
+Import ('env')
 
-kernel_env = library_env.Copy ()
+sources = 'gen_messaging/intern/messaging.c gen_system/GEN_HashedPtr.cpp'
+sources += ' gen_system/GEN_Matrix4x4.cpp gen_system/SYS_SingletonSystem.cpp'
+sources += ' gen_system/SYS_System.cpp'
 
-source_files = ['gen_messaging/intern/messaging.c',
-                'gen_system/GEN_HashedPtr.cpp',
-                'gen_system/GEN_Matrix4x4.cpp',
-                'gen_system/SYS_SingletonSystem.cpp',
-                'gen_system/SYS_System.cpp']
+incs = 'gen_messaging gen_system #/intern/string #/intern/moto/include'
 
-kernel_env.Append (CPPPATH = ['gen_messaging',
-                              'gen_system',
-                              '#/intern/string',
-                              '#/intern/moto/include'])
-
-kernel_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_kernel', source=source_files)
+env.BlenderLib ( 'blender_kernel', Split(sources), Split(incs), [], libtype = ['common','game2'], priority = [15, 10] )
diff --git a/tools/Blender.py b/tools/Blender.py
new file mode 100644 (file)
index 0000000..0da2535
--- /dev/null
@@ -0,0 +1,323 @@
+#!/usr/bin/env python
+
+"""
+tools.BlenderEnvironment
+
+This environment builds on SCons.Script.SConscript.SConsEnvironment
+
+* library repository
+* custom printout
+* wrapper functions
+
+TODO: clean up and sanitise code - crosscheck with btools and SConstruct
+to kill any code duplication
+"""
+
+import os.path
+import string
+import glob
+import time
+import sys
+
+from SCons.Script.SConscript import SConsEnvironment
+import SCons.Action
+import SCons.Util
+import SCons.Builder
+import SCons.Tool
+import bcolors
+bc = bcolors.bcolors()
+
+Split = SCons.Util.Split
+Action = SCons.Action.Action
+Builder = SCons.Builder.Builder
+GetBuildPath = SConsEnvironment.GetBuildPath
+
+# a few globals
+root_build_dir = ''
+quickie = None # Anything else than None if BF_QUICK has been passed
+quicklist = [] # The list of libraries/programs to compile during a quickie
+program_list = [] # A list holding Nodes to final binaries, used to create installs
+arguments = None
+targets = None
+
+#some internals
+blenderdeps = [] # don't manipulate this one outside this module!
+
+##### LIB STUFF ##########
+
+possible_types = ['core'] # can be set in ie. SConstruct
+libs = {}
+def init_lib_dict():
+    for pt in possible_types:
+        libs[pt] = {}
+
+# helper func for add_lib_to_dict
+def internal_lib_to_dict(dict = None, libtype = None, libname = None, priority = 100):
+    if not libname in dict[libtype]:
+        done = None
+        while not done:
+            if dict[libtype].has_key(priority):
+                priority = priority + 1
+            else:
+                done = True
+        dict[libtype][priority] = libname
+
+# libtype and priority can both be lists, for defining lib in multiple places
+def add_lib_to_dict(dict = None, libtype = None, libname = None, priority = 100):
+    if not dict or not libtype or not libname:
+        print "Passed wrong arg"
+        Exit()
+
+    if type(libtype) is str and type(priority) is int:
+        internal_lib_to_dict(dict, libtype, libname, priority)
+    elif type(libtype) is list and type(priority) is list:
+        if len(libtype)==len(priority):
+            for lt, p in zip(libtype, priority):
+                internal_lib_to_dict(dict, lt, libname, p)
+        else:
+            print "libtype and priority lists are unequal in length"
+            Exit()
+    else:
+        print "Wrong type combinations for libtype and priority. Only str and int or list and list"
+        Exit()
+
+#libs = init_lib_dict(libs)
+
+def create_blender_liblist(lenv = None, libtype = None):
+    if not lenv or not libtype:
+        print "missing arg"
+
+    lst = []
+    if libtype in possible_types:
+        sortlist = []
+        for k,v in libs[libtype].iteritems():
+            sortlist.append(k)
+        sortlist.sort()
+        curlib = libs[libtype]
+        for sk in sortlist:
+            v = curlib[sk]
+        #for k,v in sorted(libs[libtype].iteritems()):
+            lst.append('#' + root_build_dir + 'lib/'+lenv['LIBPREFIX'] + v + lenv['LIBSUFFIX'])
+
+    return lst
+
+## TODO: static linking
+def setup_staticlibs(lenv):
+    statlibs = [
+        #here libs for static linking
+    ]
+    libincs = [
+        '/usr/lib',
+        lenv['BF_PYTHON_LIBPATH'],
+        lenv['BF_OPENGL_LIBPATH'],
+        lenv['BF_SDL_LIBPATH'],
+        lenv['BF_JPEG_LIBPATH'],
+        lenv['BF_TIFF_LIBPATH'],
+        lenv['BF_PNG_LIBPATH'],
+        lenv['BF_GETTEXT_LIBPATH'],
+        lenv['BF_ZLIB_LIBPATH'],
+        lenv['BF_OPENAL_LIBPATH'],
+        lenv['BF_FREETYPE_LIBPATH'],
+#        lenv['BF_QUICKTIME_LIBPATH'],
+        lenv['BF_ICONV_LIBPATH']
+        ]
+    libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
+
+    return statlibs, libincs
+
+def setup_syslibs(lenv):
+    syslibs = [
+        lenv['BF_PYTHON_LIB'],
+        lenv['BF_JPEG_LIB'],
+        lenv['BF_PNG_LIB'],
+        lenv['BF_ZLIB_LIB'],
+        lenv['BF_OPENAL_LIB'],
+        lenv['BF_FREETYPE_LIB'],
+        lenv['BF_GETTEXT_LIB']
+
+        #here libs for linking
+        ]
+    if lenv['OURPLATFORM']=='win32vc':
+            syslibs += Split(lenv['BF_ICONV_LIB'])
+    syslibs += Split(lenv['BF_TIFF_LIB'])
+    syslibs += Split(lenv['BF_OPENEXR_LIB'])
+    syslibs += Split(lenv['BF_SDL_LIB'])
+    syslibs += Split(lenv['BF_OPENGL_LIB'])
+    syslibs += Split(lenv['LLIBS'])
+
+    return syslibs
+
+def propose_priorities():
+    print bc.OKBLUE+"Priorities:"+bc.ENDC
+    for t in possible_types:
+        print bc.OKGREEN+"\t"+t+bc.ENDC
+        new_priority = 0
+        sortlist = []
+        for k,v in libs[t].iteritems():
+            sortlist.append(k)
+        sortlist.sort()
+        curlib = libs[t]
+        for sk in sortlist:
+            v = curlib[sk]
+            #for p,v in sorted(libs[t].iteritems()):
+            print "\t\t",new_priority, v
+            new_priority += 5
+
+## TODO: see if this can be made in an emitter
+def buildinfo(lenv, build_type):
+    """
+    Generate a buildinfo object
+    """
+    build_date = time.strftime ("%Y-%m-%d")
+    build_time = time.strftime ("%H:%M:%S")
+    obj = []
+    if True: #user_options_dict['USE_BUILDINFO'] == 1:
+        if sys.platform=='win32':
+            build_info_file = open("source/creator/winbuildinfo.h", 'w')
+            build_info_file.write("char *build_date=\"%s\";\n"%build_date)
+            build_info_file.write("char *build_time=\"%s\";\n"%build_time)
+            build_info_file.write("char *build_platform=\"win32\";\n")
+            build_info_file.write("char *build_type=\"dynamic\";\n")
+            build_info_file.close()
+            lenv.Append (CPPDEFINES = ['NAN_BUILDINFO', 'BUILD_DATE'])
+        else:
+            lenv.Append (CPPDEFINES = ['BUILD_TIME=\'"%s"\''%(build_time),
+                                        'BUILD_DATE=\'"%s"\''%(build_date),
+                                        'BUILD_TYPE=\'"dynamic"\'',
+                                        'NAN_BUILDINFO',
+                                        'BUILD_PLATFORM=\'"%s"\''%(sys.platform)])
+        obj = [lenv.Object (root_build_dir+'source/creator/%s_buildinfo'%build_type,
+                        [root_build_dir+'source/creator/buildinfo.c'])]
+    return obj
+
+##### END LIB STUFF ############
+
+##### ACTION STUFF #############
+
+def my_compile_print(target, source, env):
+    a = '%s' % (source[0])
+    d, f = os.path.split(a)
+    return bc.OKBLUE+"Compiling"+bc.ENDC +" ==> '"+bc.OKGREEN+"%s" % (f) + "'"+bc.ENDC
+
+def my_moc_print(target, source, env):
+    a = '%s' % (source[0])
+    d, f = os.path.split(a)
+    return bc.OKBLUE+"Creating MOC"+bc.ENDC+ " ==> '"+bc.OKGREEN+"%s" %(f) + "'"+bc.ENDC
+
+def my_linking_print(target, source, env):
+    t = '%s' % (target[0])
+    d, f = os.path.split(t)
+    return bc.OKBLUE+"Linking library"+bc.ENDC +" ==> '"+bc.OKGREEN+"%s" % (f) + "'"+bc.ENDC
+
+def my_program_print(target, source, env):
+    t = '%s' % (target[0])
+    d, f = os.path.split(t)
+    return bc.OKBLUE+"Linking program"+bc.ENDC +" ==> '"+bc.OKGREEN+"%s" % (f) + "'"+bc.ENDC
+
+def msvc_hack(env):
+    static_lib = SCons.Tool.createStaticLibBuilder(env)
+    program = SCons.Tool.createProgBuilder(env)
+    
+    env['BUILDERS']['Library'] = static_lib
+    env['BUILDERS']['StaticLibrary'] = static_lib
+    env['BUILDERS']['Program'] = program
+        
+def set_quiet_output(env):
+    mycaction = Action("$CCCOM", strfunction=my_compile_print)
+    myshcaction = Action("$SHCCCOM", strfunction=my_compile_print)
+    mycppaction = Action("$CXXCOM", strfunction=my_compile_print)
+    myshcppaction = Action("$SHCXXCOM", strfunction=my_compile_print)
+    mylibaction = Action("$ARCOM", strfunction=my_linking_print)
+    mylinkaction = Action("$LINKCOM", strfunction=my_program_print)
+
+    static_ob, shared_ob = SCons.Tool.createObjBuilders(env)
+    static_ob.add_action('.c', mycaction)
+    static_ob.add_action('.cpp', mycppaction)
+    shared_ob.add_action('.c', myshcaction)
+    shared_ob.add_action('.cpp', myshcppaction)
+
+    static_lib = SCons.Builder.Builder(action = mylibaction,
+                                       emitter = '$LIBEMITTER',
+                                       prefix = '$LIBPREFIX',
+                                       suffix = '$LIBSUFFIX',
+                                       src_suffix = '$OBJSUFFIX',
+                                       src_builder = 'StaticObject')
+
+    program = SCons.Builder.Builder(action = mylinkaction,
+                                    emitter = '$PROGEMITTER',
+                                    prefix = '$PROGPREFIX',
+                                    suffix = '$PROGSUFFIX',
+                                    src_suffix = '$OBJSUFFIX',
+                                    src_builder = 'Object',
+                                    target_scanner = SCons.Defaults.ProgScan)
+
+    env['BUILDERS']['Object'] = static_ob
+    env['BUILDERS']['StaticObject'] = static_ob
+    env['BUILDERS']['StaticLibrary'] = static_lib
+    env['BUILDERS']['Library'] = static_lib
+    env['BUILDERS']['Program'] = program
+
+
+#### END ACTION STUFF #########
+
+class BlenderEnvironment(SConsEnvironment):
+
+    def BlenderLib(self=None, libname=None, sources=None, includes=[], defines=[], libtype='common', priority = 100, compileflags=None):
+        if not self or not libname or not sources:
+            print bc.FAIL+'Cannot continue. Missing argument for BuildBlenderLib '+libname+bc.ENDC
+            Exit()
+        if libname in quickie or len(quickie)==0:
+            print bc.HEADER+'Configuring library '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC
+            lenv = self.Copy()
+            lenv.Append(CPPPATH=includes)
+            lenv.Append(CPPDEFINES=defines)
+            if lenv['WITH_BF_GAMEENGINE']:
+                    lenv.Append(CPPDEFINES=['GAMEBLENDER=1'])
+            if lenv['BF_DEBUG']:
+                    lenv.Append(CCFLAGS = lenv['BF_DEBUG_FLAGS'], CXXFLAGS = lenv['BF_DEBUG_FLAGS'])
+            if lenv['BF_PROFILE']:
+                    lenv.Append(CCFLAGS = lenv['BF_PROFILE_FLAGS'], CXXFLAGS = lenv['BF_PROFILE_FLAGS'])
+            if compileflags:
+                lenv.Append(CCFLAGS = compileflags)
+                lenv.Append(CXXFLAGS = compileflags)
+            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:
+            print bc.WARNING+'Not building '+bc.ENDC+bc.OKGREEN+libname+bc.ENDC+' for '+bc.OKBLUE+'BF_QUICK'+bc.ENDC
+        # note: libs is a global
+        add_lib_to_dict(libs, libtype, libname, priority)
+
+    def BlenderProg(self=None, builddir=None, progname=None, sources=None, includes=None, libs=None, libpath=None):
+        print bc.HEADER+'Configuring program '+bc.ENDC+bc.OKGREEN+progname+bc.ENDC
+        lenv = self.Copy()
+        if lenv['OURPLATFORM']=='win32-vc':
+            lenv.Append(LINKFLAGS = Split(lenv['PLATFORM_LINKFLAGS']))
+        if  lenv['OURPLATFORM']=='darwin':
+            lenv.Append(LINKFLAGS = lenv['PLATFORM_LINKFLAGS'])
+            lenv.Append(LINKFLAGS = lenv['BF_PYTHON_LINKFLAGS'])
+            lenv.Append(LINKFLAGS = lenv['BF_OPENGL_LINKFLAGS'])
+        lenv.Append(CPPPATH=includes)
+        lenv.Append(LIBPATH=libpath)
+        lenv.Append(LIBS=libs)
+        if lenv['WITH_BF_QUICKTIME']:
+             lenv.Append(LIBS = lenv['BF_QUICKTIME_LIB'])
+             lenv.Append(LIBPATH = lenv['BF_QUICKTIME_LIBPATH'])
+        prog = lenv.Program(target=builddir+'bin/'+progname, source=sources)
+        SConsEnvironment.Default(self, prog)
+        program_list.append(prog)
+
+## TODO: have register for libs/programs, so that we test only that
+#  which have expressed their need to be tested in their own sconscript
+    def BlenderUnitTest(env, source, **kwargs):
+        test = env.Program(source, **kwargs)
+        env.AddPostAction(test, test[0].abspath)
+        env.Alias('check', test)
+        env.AlwaysBuild(test)
+        return test
+
+    def Glob(lenv, pattern):
+        path = string.replace(GetBuildPath(lenv,'SConscript'),'SConscript', '')
+        files = []
+        for i in glob.glob(path + pattern):
+            files.append(string.replace(i, path, ''))
+        return files
diff --git a/tools/bcolors.py b/tools/bcolors.py
new file mode 100755 (executable)
index 0000000..b01bb78
--- /dev/null
@@ -0,0 +1,16 @@
+class bcolors:
+    HEADER = '\033[95m'
+    OKBLUE = '\033[94m'
+    OKGREEN = '\033[92m'
+    WARNING = '\033[93m'
+    FAIL = '\033[91m'
+    ENDC = '\033[0m'
+
+    def disable(self):
+        self.HEADER = ''
+        self.OKBLUE = ''
+        self.OKGREEN = ''
+        self.WARNING = ''
+        self.FAIL = ''
+        self.ENDC = ''
+
diff --git a/tools/btools.py b/tools/btools.py
new file mode 100755 (executable)
index 0000000..fbfe788
--- /dev/null
@@ -0,0 +1,257 @@
+import sys
+import StringIO
+import SCons.Options
+import SCons.Options.BoolOption
+
+Options = SCons.Options
+BoolOption = SCons.Options.BoolOption
+
+def print_arguments(args, bc):
+    if len(args):
+        for k,v in args.iteritems():
+            print '\t'+bc.OKBLUE+k+bc.ENDC+' = '+bc.OKGREEN + v + bc.ENDC
+    else:
+        print '\t'+bc.WARNING+'No  command-line arguments given'+bc.ENDC
+
+def validate_arguments(args, bc):
+    opts_list = [
+            'BF_PYTHON', 'BF_PYTHON_VERSION', 'BF_PYTHON_INC', 'BF_PYTHON_BINARY', 'BF_PYTHON_LIB', 'BF_PYTHON_LIBPATH', 'BF_PYTHON_LINKFLAGS',
+            'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH',
+            'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
+            'WITH_BF_FMOD',
+            'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH',
+            'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH',
+            'WITH_BF_PNG', 'BF_PNG', 'BF_PNG_INC', 'BF_PNG_LIB', 'BF_PNG_LIBPATH',
+            'WITH_BF_TIFF', 'BF_TIFF', 'BF_TIFF_INC', 'BF_TIFF_LIB', 'BF_TIFF_LIBPATH',
+            'WITH_BF_ZLIB', 'BF_ZLIB', 'BF_ZLIB_INC', 'BF_ZLIB_LIB', 'BF_ZLIB_LIBPATH',
+            'WITH_BF_GETTEXT', 'BF_GETTEXT', 'BF_GETTEXT_INC', 'BF_GETTEXT_LIB', 'BF_GETTEXT_LIBPATH',
+            'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
+            'WITH_BF_ODE', 'BF_ODE', 'BF_ODE_INC', 'BF_ODE_LIB',
+            'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
+            'BF_SOLID', 'BF_SOLID_INC',
+            'WITH_BF_FREETYPE', 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH',
+            'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
+            'WITH_BF_OPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC', 'BF_OPENGL_LINKFLAGS',
+            'WITH_BF_FTGL', 'BF_FTGL', 'BF_FTGL_INC', 'BF_FTGL_LIB',
+            'WITH_BF_PLAYER',
+            'CFLAGS', 'CCFLAGS', 'CPPFLAGS',
+            'REL_CFLAGS', 'REL_CCFLAGS',
+            'C_WARN', 'CC_WARN', 'LLIBS', 'PLATFORM_LINKFLAGS',
+            'BF_PROFILE_FLAGS' ]
+    arg_list = ['BF_DEBUG', 'BF_QUIET', 'BF_CROSS', 'BF_UPDATE',
+            'BF_INSTALLDIR', 'BF_TOOLSET', 'BF_BINNAME',
+            'BF_BUILDDIR', 'BF_FANCY', 'BF_QUICK', 'BF_PROFILE', 'BF_DEBUG',
+            'BF_PRIORITYLIST'
+           ]
+
+    all_list = opts_list + arg_list
+    okdict = {}
+
+    for k,v in args.iteritems():
+        if k in all_list:
+            okdict[k] = v
+        else:
+            print '\t'+bc.WARNING+'Invalid argument: '+bc.ENDC+k+'='+v
+
+    return okdict
+
+def print_targets(targs, bc):
+    if len(targs)>0:
+        for t in targs:
+            print '\t'+bc.OKBLUE+t+bc.ENDC
+    else:
+        print '\t'+bc.WARNING+'No targets given, using '+bc.ENDC+bc.OKGREEN+'default'+bc.ENDC
+
+def validate_targets(targs, bc):
+    valid_list = ['.', 'blender', 'blenderstatic', 'blenderplayer', 'webplugin',
+            'blendernogame', 'blenderstaticnogame', 'release',
+            'everything', 'clean', 'install-bin', 'install']
+    oklist = []
+    for t in targs:
+        if t in valid_list:
+            oklist.append(t)
+        else:
+            print '\t'+bc.WARNING+'Invalid target: '+bc.ENDC+t
+    return oklist
+
+    
+
+class idBuffering:
+    def buffered_spawn( self, sh, escape, cmd, args, env ):
+        stderr = StringIO.StringIO()
+        stdout = StringIO.StringIO()
+        command_string = ''
+        for i in args:
+            if ( len( command_string ) ):
+                command_string += ' '
+            command_string += i
+        try:
+            retval = self.env['PSPAWN']( sh, escape, cmd, args, env, stdout, stderr )
+        except OSError, x:
+            if x.errno != 10:
+                raise x
+            print 'OSError ignored on command: %s' % command_string
+            retval = 0
+        sys.stdout.write( stdout.getvalue() )
+        sys.stderr.write( stderr.getvalue() )
+        return retval
+
+# get a clean error output when running multiple jobs
+def SetupBufferedOutput( env ):
+    buf = idBuffering()
+    buf.env = env
+    env['SPAWN'] = buf.buffered_spawn
+
+
+def read_opts(cfg, args):
+    localopts = Options.Options(cfg, args)
+    localopts.AddOptions(
+        ('BF_PYTHON', 'base path for python', ''),
+        ('BF_PYTHON_VERSION', 'Python version to use', ''),
+        ('BF_PYTHON_INC', 'include path for Python headers', ''),
+        ('BF_PYTHON_BINARY', 'Path to the Python interpreter', ''),
+        ('BF_PYTHON_LIB', 'Python library', ''),
+        ('BF_PYTHON_LIBPATH', 'Library path', ''),
+        ('BF_PYTHON_LINKFLAGS', 'Python link flags', ''),
+
+        (BoolOption('WITH_BF_OPENAL', 'Use OpenAL if true', '')),
+        ('BF_OPENAL', 'base path for OpenAL', ''),
+        ('BF_OPENAL_INC', 'include path for python headers', ''),
+        ('BF_OPENAL_LIB', 'Path to OpenAL library', ''),
+        ('BF_OPENAL_LIBPATH', 'Path to OpenAL library', ''),
+
+        (BoolOption('WITH_BF_SDL', 'Use SDL if true', '')),
+        ('BF_SDL', 'SDL base path', ''),
+        ('BF_SDL_INC', 'SDL include path', ''),     #$(shell $(BF_SDL)/bin/sdl-config --cflags)
+        ('BF_SDL_LIB', 'SDL library', ''),      #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
+        ('BF_SDL_LIBPATH', 'SDL library path', ''),
+
+        (BoolOption('WITH_BF_FMOD', 'Use FMOD if true', 'false')),
+        #  BF_FMOD = $(LCGDIR)/fmod
+
+        (BoolOption('WITH_BF_OPENEXR', 'Use OPENEXR if true', 'true')),
+        ('BF_OPENEXR', 'OPENEXR base path', ''),
+        ('BF_OPENEXR_INC', 'OPENEXR include path', ''),
+        ('BF_OPENEXR_LIB', 'OPENEXR library', ''),
+        ('BF_OPENEXR_LIBPATH', 'OPENEXR library path', ''),
+
+        (BoolOption('WITH_BF_JPEG', 'Use JPEG if true', 'true')),
+        ('BF_JPEG', 'JPEG base path', ''),
+        ('BF_JPEG_INC', 'JPEG include path', ''),
+        ('BF_JPEG_LIB', 'JPEG library', ''),
+        ('BF_JPEG_LIBPATH', 'JPEG library path', ''),
+
+        (BoolOption('WITH_BF_PNG', 'Use PNG if true', 'true')),
+        ('BF_PNG', 'PNG base path', ''),
+        ('BF_PNG_INC', 'PNG include path', ''),
+        ('BF_PNG_LIB', 'PNG library', ''),
+        ('BF_PNG_LIBPATH', 'PNG library path', ''),
+
+        (BoolOption('WITH_BF_TIFF', 'Use TIFF if true', 'true')),
+        ('BF_TIFF', 'TIFF base path', ''),
+        ('BF_TIFF_INC', 'TIFF include path', ''),
+        ('BF_TIFF_LIB', 'TIFF library', ''),
+        ('BF_TIFF_LIBPATH', 'TIFF library path', ''),
+
+        (BoolOption('WITH_BF_ZLIB', 'Use ZLib if true', 'true')),
+        ('BF_ZLIB', 'ZLib base path', ''),
+        ('BF_ZLIB_INC', 'ZLib include path', ''),
+        ('BF_ZLIB_LIB', 'ZLib library', ''),
+        ('BF_ZLIB_LIBPATH', 'ZLib library path', ''),
+
+        (BoolOption('WITH_BF_GETTEXT', 'Use gettext if true', 'true')),
+        ('BF_GETTEXT', 'gettext base path', ''),
+        ('BF_GETTEXT_INC', 'gettext include path', ''),
+        ('BF_GETTEXT_LIB', 'gettext library', ''),
+        ('BF_GETTEXT_LIBPATH', 'gettext library path', ''),
+        
+        (BoolOption('WITH_BF_ICONV', 'Use iconv if true', 'true')),
+        ('BF_ICONV', 'iconv base path', ''),
+        ('BF_ICONV_INC', 'iconv include path', ''),
+        ('BF_ICONV_LIB', 'iconv library', ''),
+        ('BF_ICONV_LIBPATH', 'iconv library path', ''),
+        
+        (BoolOption('WITH_BF_GAMEENGINE', 'Build with gameengine' , 'true')),
+
+        (BoolOption('WITH_BF_ODE', 'Use ODE if true', 'true')),
+        ('BF_ODE', 'ODE base path', ''),
+        ('BF_ODE_INC', 'ODE include path' , ''),
+        ('BF_ODE_LIB', 'ODE library', ''),
+
+        (BoolOption('WITH_BF_BULLET', 'Use Bullet if true', 'true')),
+        ('BF_BULLET', 'Bullet base dir', ''),
+        ('BF_BULLET_INC', 'Bullet include path', ''),
+        ('BF_BULLET_LIB', 'Bullet library', ''),
+        
+        ('BF_SOLID', 'Solid base dir', '#/extern/solid'),
+        ('BF_SOLID_INC', 'Solid include path', ''),
+##
+##WITH_BF_NSPR = 'true'
+##BF_NSPR = $(LCGDIR)/nspr
+##BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
+##BF_NSPR_LIB = 
+### Uncomment the following line to use Mozilla inplace of netscape
+##CPPFLAGS += -DMOZ_NOT_NET
+### Location of MOZILLA/Netscape header files...
+##BF_MOZILLA = $(LCGDIR)/mozilla
+##BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
+##BF_MOZILLA_LIB = 
+### Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
+### if this is not set.
+##
+### Be paranoid regarding library creation (do not update archives)
+##BF_PARANOID = 'true'
+##
+### enable freetype2 support for text objects
+        (BoolOption('WITH_BF_FREETYPE', 'Use Freetype if true', 'true')),
+        ('BF_FREETYPE', 'Freetype base path', ''),
+        ('BF_FREETYPE_INC', 'Freetype include path', ''),
+        ('BF_FREETYPE_LIB', 'Freetype library', ''),
+        ('BF_FREETYPE_LIBPATH', 'Freetype library path', ''),
+
+        (BoolOption('WITH_BF_QUICKTIME', 'Use QuickTime if true', 'false')),
+        ('BF_QUICKTIME', 'QuickTime base path', ''),
+        ('BF_QUICKTIME_INC', 'QuickTime include path', ''),
+        ('BF_QUICKTIME_LIB', 'QuickTime library', ''),
+        ('BF_QUICKTIME_LIBPATH', 'QuickTime library path', ''),
+
+        (BoolOption('WITH_BF_OPENGL', 'Use MESA if true', 'true')),
+        ('BF_OPENGL', 'OpenGL base path', ''),
+        ('BF_OPENGL_INC', 'OpenGL include path', ''),
+        ('BF_OPENGL_LIB', 'OpenGL libraries', ''),
+        ('BF_OPENGL_LIBPATH', 'OpenGL library path', ''),
+        ('BF_OPENGL_LIB_STATIC', 'OpenGL static libraries', ''),
+        ('BF_OPENGL_LINKFLAGS', 'OpenGL link flags', ''),
+        
+        (BoolOption('WITH_BF_FTGL', 'Use FTGL if true', 'true')),
+        ('BF_FTGL', 'FTGL base path', ''),
+        ('BF_FTGL_INC', 'FTGL include path', ''),
+        ('BF_FTGL_LIB', 'FTGL libraries', ''),
+
+        (BoolOption('WITH_BF_PLAYER', 'Build blenderplayer if true', 'false')),
+
+        ('CFLAGS', 'C-compiler flags', ''),
+        ('CCFLAGS', 'C++-compiler flags', ''),
+        ('CPPFLAGS', 'Defines', ''),
+        ('REL_CFLAGS', 'C release flags', ''),
+        ('REL_CCFLAGS', 'C++ release flags', ''),
+
+        ('C_WARN', 'C warning flags', ''),
+        ('CC_WARN', 'C++ warning flags', ''),
+
+        ('LLIBS', 'Platform libs', ''),
+        ('PLATFORM_LINKFLAGS', 'Platform linkflags', ''),
+
+        (BoolOption('BF_PROFILE', 'Add profiling information if true', 'false')),
+        ('BF_PROFILE_FLAGS', 'Profiling flags', ''),
+
+        (BoolOption('BF_DEBUG', 'Add debug flags if true', 'false')),
+        ('BF_DEBUG_FLAGS', 'Debug flags', ''),
+        
+        ('BF_BUILDDIR', 'Build dir', ''),
+        ('BF_INSTALLDIR', 'Installation dir', '')
+
+    ) # end of opts.AddOptions()
+
+    return localopts
+
diff --git a/tools/crossmingw.py b/tools/crossmingw.py
new file mode 100755 (executable)
index 0000000..1c8924c
--- /dev/null
@@ -0,0 +1,189 @@
+#coments are #JB where this file was altered by Jasen Betts
+# email:  'n@tres'.join(['jase','hna.com'])
+
+"""tools.crossmingw
+
+Tool-specific initialization for MinGW (http://www.mingw.org/)
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# Copyright (c) 2001, 2002, 2003, 2004 The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+__revision__ = "/home/scons/scons/branch.0/branch.96/baseline/src/engine/SCons/Tool/mingw.py 0.96.91.D001 2005/09/08 09:14:36 knight"
+
+import os
+import os.path
+import string
+
+import SCons.Action
+import SCons.Builder
+import SCons.Tool
+import SCons.Util
+
+# This is what we search for to find mingw:
+prefixes = SCons.Util.Split("""
+    mingw32-
+    i386-mingw32msvc-
+    i486-mingw32msvc-
+    i586-mingw32msvc-
+    i686-mingw32msvc-
+""")
+
+def find(env):
+    for prefix in prefixes:
+        # First search in the SCons path and then the OS path:
+        if env.WhereIs(prefix + 'gcc') or SCons.Util.WhereIs(prefix + 'gcc'):
+            return prefix
+
+    return ''
+
+def shlib_generator(target, source, env, for_signature):
+    cmd = SCons.Util.CLVar(['$SHLINK', '$SHLINKFLAGS'])
+
+    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+    if dll: cmd.extend(['-o', dll])
+
+    cmd.extend(['$SOURCES', '$_LIBDIRFLAGS', '$_LIBFLAGS'])
+
+    implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
+    if implib: cmd.append('-Wl,--out-implib,'+implib.get_string(for_signature))
+
+    def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+    if def_target: cmd.append('-Wl,--output-def,'+def_target.get_string(for_signature))
+
+    return [cmd]
+
+def shlib_emitter(target, source, env):
+    dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+    no_import_lib = env.get('no_import_lib', 0)
+
+    if not dll:
+        raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
+
+    if not no_import_lib and \
+       not env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX'):
+
+        # Append an import library to the list of targets.
+        target.append(env.ReplaceIxes(dll,
+                                      'SHLIBPREFIX', 'SHLIBSUFFIX',
+                                      'LIBPREFIX', 'LIBSUFFIX'))
+
+    # Append a def file target if there isn't already a def file target
+    # or a def file source. There is no option to disable def file
+    # target emitting, because I can't figure out why someone would ever
+    # want to turn it off.
+    def_source = env.FindIxes(source, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+    def_target = env.FindIxes(target, 'WIN32DEFPREFIX', 'WIN32DEFSUFFIX')
+    if not def_source and not def_target:
+        target.append(env.ReplaceIxes(dll,
+                                      'SHLIBPREFIX', 'SHLIBSUFFIX',
+                                      'WIN32DEFPREFIX', 'WIN32DEFSUFFIX'))
+
+    return (target, source)
+
+#JB  """ I'm blindly susbstuting lines from the mingw.py
+#JB      file becase these lines cause python errors here. """
+#JB shlib_action = SCons.Action.Action(shlib_generator,generator=1)
+shlib_action = SCons.Action.CommandGenerator(shlib_generator)
+
+res_action = SCons.Action.Action('$RCCOM', '$RCCOMSTR')
+
+#JB """ changed for what was in mingw.py """
+#JB res_builder = SCons.Builder.Builder(action=res_action, suffix='.o',
+#JB                                    source_scanner=SCons.Tool.SourceFileScanner)
+
+res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.o',
+                                    source_scanner=SCons.Defaults.ObjSourceScan)
+
+#JB  SCons.Tool.SourceFileScanner.add_scanner('.rc', SCons.Defaults.CScan)
+SCons.Defaults.ObjSourceScan.add_scanner('.rc', SCons.Defaults.CScan)
+#JB """ no more changes """
+
+def generate(env):
+    mingw_prefix = find(env)
+
+    if mingw_prefix:
+        dir = os.path.dirname(env.WhereIs(mingw_prefix + 'gcc') or SCons.Util.WhereIs(mingw_prefix + 'gcc'))
+
+        # The mingw bin directory must be added to the path:
+        path = env['ENV'].get('PATH', [])
+        if not path:
+            path = []
+        if SCons.Util.is_String(path):
+            path = string.split(path, os.pathsep)
+
+        env['ENV']['PATH'] = string.join([dir] + path, os.pathsep)
+
+    # Most of mingw is the same as gcc and friends...
+    gnu_tools = ['gcc', 'g++', 'gnulink', 'ar', 'gas']
+    for tool in gnu_tools:
+        SCons.Tool.Tool(tool)(env)
+
+    #... but a few things differ:
+    env['CC'] = mingw_prefix + 'gcc'
+    env['SHCCFLAGS'] = SCons.Util.CLVar('$CCFLAGS')
+    env['CXX'] = mingw_prefix + 'g++'
+    env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
+    env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
+    env['SHLINKCOM']   = shlib_action
+    env['AR'] = mingw_prefix + 'ar'
+    env['RANLIB'] = mingw_prefix + 'ranlib'
+    env.Append(SHLIBEMITTER = [shlib_emitter])
+    env['LINK'] = mingw_prefix + 'gcc'
+    env['AS'] = mingw_prefix + 'as'
+    env['WIN32DEFPREFIX']        = ''
+    env['WIN32DEFSUFFIX']        = '.def'
+    env['SHOBJSUFFIX'] = '.o'
+    env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
+
+    env['RC'] = mingw_prefix + 'windres'
+    env['RCFLAGS'] = SCons.Util.CLVar('')
+    env['RCINCFLAGS'] = '$( ${_concat(RCINCPREFIX, CPPPATH, RCINCSUFFIX, __env__, RDirs, TARGET)} $)'
+    env['RCINCPREFIX'] = '--include-dir '
+    env['RCINCSUFFIX'] = ''
+    env['RCCOM'] = '$RC $RCINCFLAGS $RCINCPREFIX $SOURCE.dir $RCFLAGS -i $SOURCE -o $TARGET'
+    env['BUILDERS']['RES'] = res_builder
+
+    # Some setting from the platform also have to be overridden:
+    env['OBJPREFIX']      = ''
+    env['OBJSUFFIX']      = '.o'
+    env['LIBPREFIX']      = 'lib'
+    env['LIBSUFFIX']      = '.a'
+    env['SHOBJPREFIX']    = '$OBJPREFIX'
+    env['SHOBJSUFFIX']    = '$OBJSUFFIX'
+    env['PROGPREFIX']     = ''
+    env['PROGSUFFIX']     = '.exe'
+    env['LIBPREFIX']      = ''
+    env['LIBSUFFIX']      = '.lib'
+    env['SHLIBPREFIX']    = ''
+    env['SHLIBSUFFIX']    = '.dll'
+    env['LIBPREFIXES']    = [ '$LIBPREFIX' ]
+    env['LIBSUFFIXES']    = [ '$LIBSUFFIX' ]
+
+def exists(env):
+    return find(env)
diff --git a/tools/mstoolkit.py b/tools/mstoolkit.py
new file mode 100755 (executable)
index 0000000..ed64908
--- /dev/null
@@ -0,0 +1,353 @@
+"""tools.mstoolkit
+
+Tool-specific initialization for Microsoft Visual C/C++ Toolkit Commandline
+
+There normally shouldn't be any need to import this module directly.
+It will usually be imported through the generic SCons.Tool.Tool()
+selection method.
+
+"""
+
+#
+# Copyright (c) 2004 John Connors
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+
+import os.path
+import re
+import string
+import types
+
+import SCons.Action
+import SCons.Builder
+import SCons.Errors
+import SCons.Platform.win32
+import SCons.Tool
+import SCons.Util
+import SCons.Warnings
+
+CSuffixes = ['.c', '.C']
+CXXSuffixes = ['.cc', '.cpp', '.cxx', '.c++', '.C++']
+
+def get_msvctoolkit_paths():
+        """Return a 4-tuple of (INCLUDE, LIB, PATH, TOOLKIT) as the values of those
+        three environment variables that should be set in order to execute
+        the MSVC .NET tools properly, if the information wasn't available
+        from the registry."""
+
+        MSToolkitDir = None
+        paths = {}
+        exe_path = ''
+        lib_path = ''
+        include_path = ''
+
+        # First, we get the shell folder for this user:
+        if not SCons.Util.can_read_reg:
+                raise SCons.Errors.InternalError, "No Windows registry module was found"
+
+        # look for toolkit
+        if os.environ.has_key('VCToolkitInstallDir'):
+                MSToolkitDir = os.path.normpath(os.environ['VCToolkitInstallDir'])
+        else:
+                # last resort -- default install location
+                MSToolkitDir = r'C:\Program Files\Microsoft Visual C++ Toolkit 2003'
+
+        # look for platform sdk
+        if os.environ.has_key('MSSdk'):
+                PlatformSDKDir = os.path.normpath(os.environ['MSSdk'])
+        else:
+                try:
+                        PlatformSDKDir = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\MicrosoftSDK\Directories\Install Dir')[0]
+                        PlatformSDKDir = str(PlatformSDKDir)
+                except SCons.Util.RegError:
+                        raise SCons.Errors.InternalError, "The Platform SDK directory was not found in the registry or in the `MSSdk` environment variable."
+
+        # look for DX Sdk (expecting DX9)
+        # dxsdk docs have a directory key, look for it, extract path
+        #dxsdkdocs = ""
+        DXsdkDir = ""
+        #try:
+        #        dxsdkdocs = SCons.Util.RegGetValue(SCons.Util.HKEY_LOCAL_MACHINE, r'SOFTWARE\Microsoft\DirectX SDK\DX9SDK Doc Path')
+        #except SCons.Util.RegError:
+        #        raise SCons.Errors.InternalError, "The DXSDK directory was not found in the registry."
+        if os.environ.has_key('DXSDK_DIR'):
+                DXsdkDir = os.path.normpath(os.environ['DXSDK_DIR'])
+
+        #DXsdkDir = os.path.split(dxsdkdocs[0])[0]
+        DXsdkDir = os.path.split(DXsdkDir)[0]
+
+        include_path = r'%s\include;%s\include;%s\include' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
+        lib_path = r'%s\lib;%s\lib;%s\lib' % (MSToolkitDir, PlatformSDKDir, DXsdkDir)
+        exe_path = r'%s\bin;%s\bin\win95;%s\bin' % (MSToolkitDir, PlatformSDKDir, PlatformSDKDir)
+        return (include_path, lib_path, exe_path, PlatformSDKDir)
+
+def validate_vars(env):
+        """Validate the PDB, PCH, and PCHSTOP construction variables."""
+        if env.has_key('PCH') and env['PCH']:
+                if not env.has_key('PCHSTOP'):
+                        raise SCons.Errors.UserError, "The PCHSTOP construction must be defined if PCH is defined."
+                if not SCons.Util.is_String(env['PCHSTOP']):
+                        raise SCons.Errors.UserError, "The PCHSTOP construction variable must be a string: %r"%env['PCHSTOP']
+
+def pch_emitter(target, source, env):
+        """Sets up the PDB dependencies for a pch file, and adds the object
+        file target."""
+
+        validate_vars(env)
+
+        pch = None
+        obj = None
+
+        for t in target:
+                if SCons.Util.splitext(str(t))[1] == '.pch':
+                        pch = t
+                if SCons.Util.splitext(str(t))[1] == '.obj':
+                        obj = t
+
+        if not obj:
+                obj = SCons.Util.splitext(str(pch))[0]+'.obj'
+
+        target = [pch, obj] # pch must be first, and obj second for the PCHCOM to work
+
+        if env.has_key('PDB') and env['PDB']:
+                env.SideEffect(env['PDB'], target)
+                env.Precious(env['PDB'])
+
+        return (target, source)
+
+def object_emitter(target, source, env, parent_emitter):
+        """Sets up the PDB and PCH dependencies for an object file."""
+
+        validate_vars(env)
+
+        parent_emitter(target, source, env)
+
+        if env.has_key('PDB') and env['PDB']:
+                env.SideEffect(env['PDB'], target)
+                env.Precious(env['PDB'])
+
+        if env.has_key('PCH') and env['PCH']:
+                env.Depends(target, env['PCH'])
+
+        return (target, source)
+
+def static_object_emitter(target, source, env):
+        return object_emitter(target, source, env,
+                                                  SCons.Defaults.StaticObjectEmitter)
+
+def shared_object_emitter(target, source, env):
+        return object_emitter(target, source, env,
+                                                  SCons.Defaults.SharedObjectEmitter)
+
+pch_builder = SCons.Builder.Builder(action='$PCHCOM', suffix='.pch', emitter=pch_emitter)
+res_builder = SCons.Builder.Builder(action='$RCCOM', suffix='.res')
+
+def pdbGenerator(env, target, source, for_signature):
+        if target and env.has_key('PDB') and env['PDB']:
+                return ['/PDB:%s'%target[0].File(env['PDB']).get_string(for_signature),
+                                '/DEBUG']
+
+def win32ShlinkTargets(target, source, env, for_signature):
+        listCmd = []
+        dll = env.FindIxes(target, 'SHLIBPREFIX', 'SHLIBSUFFIX')
+        if dll: listCmd.append("/out:%s"%dll.get_string(for_signature))
+
+        implib = env.FindIxes(target, 'LIBPREFIX', 'LIBSUFFIX')
+        if implib: listCmd.append("/implib:%s"%implib.get_string(for_signature))
+
+        return listCmd
+
+def win32ShlinkSources(target, source, env, for_signature):
+        listCmd = []
+
+        deffile = env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX")
+        for src in source:
+                if src == deffile:
+                        # Treat this source as a .def file.
+                        listCmd.append("/def:%s" % src.get_string(for_signature))
+                else:
+                        # Just treat it as a generic source file.
+                        listCmd.append(src)
+        return listCmd
+
+def win32LibEmitter(target, source, env):
+        # SCons.Tool.msvc.validate_vars(env)
+
+        dll = env.FindIxes(target, "SHLIBPREFIX", "SHLIBSUFFIX")
+        no_import_lib = env.get('no_import_lib', 0)
+
+        if not dll:
+                raise SCons.Errors.UserError, "A shared library should have exactly one target with the suffix: %s" % env.subst("$SHLIBSUFFIX")
+
+        if env.get("WIN32_INSERT_DEF", 0) and \
+           not env.FindIxes(source, "WIN32DEFPREFIX", "WIN32DEFSUFFIX"):
+
+                # append a def file to the list of sources
+                source.append(env.ReplaceIxes(dll,
+                                                                          "SHLIBPREFIX", "SHLIBSUFFIX",
+                                                                          "WIN32DEFPREFIX", "WIN32DEFSUFFIX"))
+
+        if env.has_key('PDB') and env['PDB']:
+                env.SideEffect(env['PDB'], target)
+                env.Precious(env['PDB'])
+
+        if not no_import_lib and \
+           not env.FindIxes(target, "LIBPREFIX", "LIBSUFFIX"):
+                # Append an import library to the list of targets.
+                target.append(env.ReplaceIxes(dll,
+                                                                          "SHLIBPREFIX", "SHLIBSUFFIX",
+                                                                          "LIBPREFIX", "LIBSUFFIX"))
+                # and .exp file is created if there are exports from a DLL
+                target.append(env.ReplaceIxes(dll,
+                                                                          "SHLIBPREFIX", "SHLIBSUFFIX",
+                                                                          "WIN32EXPPREFIX", "WIN32EXPSUFFIX"))
+
+        return (target, source)
+
+def prog_emitter(target, source, env):
+        #SCons.Tool.msvc.validate_vars(env)
+
+        if env.has_key('PDB') and env['PDB']:
+                env.SideEffect(env['PDB'], target)
+                env.Precious(env['PDB'])
+
+        return (target,source)
+
+def RegServerFunc(target, source, env):
+        if env.has_key('register') and env['register']:
+                ret = regServerAction([target[0]], [source[0]], env)
+                if ret:
+                        raise SCons.Errors.UserError, "Unable to register %s" % target[0]
+                else:
+                        print "Registered %s sucessfully" % target[0]
+                return ret
+        return 0
+
+regServerAction = SCons.Action.Action("$REGSVRCOM")
+regServerCheck = SCons.Action.Action(RegServerFunc, None)
+shlibLinkAction = SCons.Action.Action('${TEMPFILE("$SHLINK $SHLINKFLAGS $_SHLINK_TARGETS $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $_SHLINK_SOURCES")}')
+compositeLinkAction = shlibLinkAction + regServerCheck
+
+def generate(env):
+        """Add Builders and construction variables for MSVC++ to an Environment."""
+        static_obj, shared_obj = SCons.Tool.createObjBuilders(env)
+
+        for suffix in CSuffixes:
+                static_obj.add_action(suffix, SCons.Defaults.CAction)
+                shared_obj.add_action(suffix, SCons.Defaults.ShCAction)
+
+        for suffix in CXXSuffixes:
+                static_obj.add_action(suffix, SCons.Defaults.CXXAction)
+                shared_obj.add_action(suffix, SCons.Defaults.ShCXXAction)
+
+        SCons.Tool.createStaticLibBuilder(env)
+        SCons.Tool.createSharedLibBuilder(env)
+        SCons.Tool.createProgBuilder(env)
+
+        env['CCPDBFLAGS'] = SCons.Util.CLVar(['${(PDB and "/Zi /Fd%s"%File(PDB)) or ""}'])
+        env['CCPCHFLAGS'] = SCons.Util.CLVar(['${(PCH and "/Yu%s /Fp%s"%(PCHSTOP or "",File(PCH))) or ""}'])
+        env['CCCOMFLAGS'] = '$CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo$TARGET $CCPCHFLAGS $CCPDBFLAGS'
+        env['CC']                 = 'cl'
+        env['CCFLAGS']    = SCons.Util.CLVar('/nologo')
+        env['CCCOM']      = '$CC $CCFLAGS $CCCOMFLAGS'
+        env['SHCC']               = '$CC'
+        env['SHCCFLAGS']  = SCons.Util.CLVar('$CCFLAGS')
+        env['SHCCCOM']    = '$SHCC $SHCCFLAGS $CCCOMFLAGS'
+        env['CXX']                = '$CC'
+        env['CXXFLAGS']   = SCons.Util.CLVar('$CCFLAGS $( /TP $)')
+        env['CXXCOM']     = '$CXX $CXXFLAGS $CCCOMFLAGS'
+        env['SHCXX']      = '$CXX'
+        env['SHCXXFLAGS'] = SCons.Util.CLVar('$CXXFLAGS')
+        env['SHCXXCOM']   = '$SHCXX $SHCXXFLAGS $CCCOMFLAGS'
+        env['CPPDEFPREFIX']  = '/D'
+        env['CPPDEFSUFFIX']  = ''
+        env['INCPREFIX']  = '/I'
+        env['INCSUFFIX']  = ''
+        env['OBJEMITTER'] = static_object_emitter
+        env['SHOBJEMITTER'] = shared_object_emitter
+        env['STATIC_AND_SHARED_OBJECTS_ARE_THE_SAME'] = 1
+
+        env['RC'] = 'rc'
+        env['RCFLAGS'] = SCons.Util.CLVar('')
+        env['RCCOM'] = '$RC $_CPPDEFFLAGS $_CPPINCFLAGS $RCFLAGS /fo$TARGET $SOURCES'
+        CScan = env.get_scanner('.c')
+        if CScan:
+                CScan.add_skey('.rc')
+        env['BUILDERS']['RES'] = res_builder
+
+        include_path, lib_path, exe_path, sdk_path = get_msvctoolkit_paths()
+        env.PrependENVPath('INCLUDE', include_path)
+        env.PrependENVPath('LIB', lib_path)
+        env.PrependENVPath('PATH', exe_path)
+
+        env['ENV']['CPU'] = 'i386'
+        env['ENV']['MSSDK'] = sdk_path
+        env['ENV']['BkOffice'] = sdk_path
+        env['ENV']['Basemake'] = sdk_path + "\\Include\\BKOffice.Mak"
+        env['ENV']['INETSDK'] = sdk_path
+        env['ENV']['MSSDK'] = sdk_path
+        env['ENV']['MSTOOLS'] = sdk_path
+        env['ENV']['TARGETOS'] = 'WINNT'
+        env['ENV']['APPVER'] = '5.0'
+
+        env['CFILESUFFIX'] = '.c'
+        env['CXXFILESUFFIX'] = '.cc'
+
+        env['PCHCOM'] = '$CXX $CXXFLAGS $CPPFLAGS $_CPPDEFFLAGS $_CPPINCFLAGS /c $SOURCES /Fo${TARGETS[1]} /Yc$PCHSTOP /Fp${TARGETS[0]} $CCPDBFLAGS'
+        env['BUILDERS']['PCH'] = pch_builder
+
+        env['AR']          = 'lib.exe' #'"' +sdk_path + '\\bin\\Win64\\lib.exe"'
+        env['ARFLAGS']     = SCons.Util.CLVar('/nologo')
+        env['ARCOM']       = "${TEMPFILE('$AR $ARFLAGS /OUT:$TARGET $SOURCES')}"
+
+        env['SHLINK']      = '$LINK'
+        env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS /dll')
+        env['_SHLINK_TARGETS'] = win32ShlinkTargets
+        env['_SHLINK_SOURCES'] = win32ShlinkSources
+        env['SHLINKCOM']   =  compositeLinkAction
+        env['SHLIBEMITTER']= win32LibEmitter
+        env['LINK'] =  'link.exe' #'"' +sdk_path + '\\bin\\Win64\\' + 'link.exe"'
+        env['LINKFLAGS']   = SCons.Util.CLVar('/nologo')
+        env['_PDB'] = pdbGenerator
+        env["TEMPFILE"] = SCons.Platform.win32.TempFileMunge
+        env['LINKCOM'] = '${TEMPFILE("$LINK $LINKFLAGS /OUT:$TARGET $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PDB $SOURCES")}'
+        env['PROGEMITTER'] = prog_emitter
+        env['LIBDIRPREFIX']='/LIBPATH:'
+        env['LIBDIRSUFFIX']=''
+        env['LIBLINKPREFIX']=''
+        env['LIBLINKSUFFIX']='$LIBSUFFIX'
+
+        env['WIN32DEFPREFIX']        = ''
+        env['WIN32DEFSUFFIX']        = '.def'
+        env['WIN32_INSERT_DEF']      = 0
+
+        env['WIN32EXPPREFIX']        = ''
+        env['WIN32EXPSUFFIX']        = '.exp'
+
+        env['REGSVRACTION'] = regServerCheck
+        env['REGSVR'] = os.path.join(SCons.Platform.win32.get_system_root(),'System32','regsvr32')
+        env['REGSVRFLAGS'] = '/s '
+        env['REGSVRCOM'] = '$REGSVR $REGSVRFLAGS $TARGET'
+
+
+def exists(env):
+        return env.Detect('cl')
\ No newline at end of file