added static openal and openexr options for scons.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Sep 2008 06:31:55 +0000 (06:31 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Sep 2008 06:31:55 +0000 (06:31 +0000)
also added a target 'blenderlite' - turns almost everything off, compressed binary is ~3.4meg

SConstruct
config/darwin-config.py
config/linux2-config.py
config/linuxcross-config.py
config/openbsd3-config.py
config/sunos5-config.py
config/win32-mingw-config.py
config/win32-vc-config.py
tools/Blender.py
tools/btools.py

index 4c3bbf8fad7179b85152d47b24fcbbecf8b129fc..92547bf6756c5b8b5681035e33e276f5ccf72f93 100644 (file)
@@ -248,6 +248,19 @@ if 'blenderplayer' in B.targets:
 if 'blendernogame' in B.targets:
     env['WITH_BF_GAMEENGINE'] = False
 
+if 'blenderlite' in B.targets:
+    env['WITH_BF_GAMEENGINE'] = False
+    env['WITH_BF_OPENAL'] = False
+    env['WITH_BF_OPENEXR'] = False
+    env['WITH_BF_ICONV'] = False
+    env['WITH_BF_INTERNATIONAL'] = False
+    env['WITH_BF_OPENJPEG'] = False
+    env['WITH_BF_FFMPEG'] = False
+    env['WITH_BF_QUICKTIME'] = False
+    env['WITH_BF_YAFRAY'] = False
+    env['WITH_BF_REDCODE'] = False
+    env['WITH_BF_FTGL'] = False
+
 # 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']
@@ -488,6 +501,10 @@ if not env['WITH_BF_GAMEENGINE']:
     blendernogame = env.Alias('blendernogame', B.program_list)
     Depends(blendernogame,installtarget)
 
+if 'blenderlite' in B.targets:
+       blenderlite = env.Alias('blenderlite', B.program_list)
+       Depends(blenderlite,installtarget)
+
 Depends(nsiscmd, allinstall)
 
 Default(B.program_list)
index 48455d2ce8cc739459da428a3a4747cad459885c..70d2281b1f7daa2190b7b14e28911accc8745575 100644 (file)
@@ -87,10 +87,13 @@ if MAC_PROC == 'powerpc':
        BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal'
 else :
        BF_OPENAL = LIBDIR + '/openal'
-       
+
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'openal'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
@@ -102,10 +105,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = '${LCGDIR}/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index 36cbac6df10243996261a136733b8493f80e081c..f2df9b86c6bf5320ed70783da4c5abcbc40dd21d 100644 (file)
@@ -14,12 +14,16 @@ BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
 BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION}.a'
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = '/usr'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'openal'
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
+
 # some distros have a separate libalut
 # if you get linker complaints, you need to uncomment the line below
 # BF_OPENAL_LIB = 'openal alut'  
+# BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a ${BF_OPENAL}/lib/libalut.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = '/usr' #$(shell sdl-config --prefix)
@@ -30,14 +34,17 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = '/usr'
 # when compiling with your own openexr lib you might need to set...
 # BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
 
 BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 # BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
 
+
 WITH_BF_DDS = 'true'
 
 WITH_BF_JPEG = 'true'
index e6c4e8769b42dee8621414b15044f9857bbe6111..3172a4a060c084c0c2cc5ff35f379c95b18eabc0 100644 (file)
@@ -14,10 +14,13 @@ BF_PYTHON_LIB = 'python25'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'openal_static'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = LIBDIR + '/sdl'
@@ -34,10 +37,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = LIBDIR + '/gcc/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = ' Half IlmImf Iex '
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index f7f254973af9b42b106713d7be106af4a81fc05d..5ef3d90f168afcfbde0be7115a0cfb3f983d9869 100644 (file)
@@ -9,10 +9,12 @@ BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}/config'
 
 WITH_BF_OPENAL = 'false'
+# WITH_BF_STATICOPENAL = 'false'
 #BF_OPENAL = LIBDIR + '/openal'
 #BF_OPENAL_INC = '${BF_OPENAL}/include'
 #BF_OPENAL_LIB = 'openal'
 #BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+#BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
@@ -24,9 +26,12 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'false'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = '/usr/local'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index b3ca0e267ff117a4b6be809178da8e325b13fd42..84e2f57bd3eb878cb33b052372c4c2731b788e33 100644 (file)
@@ -9,10 +9,13 @@ BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_
 BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = '/usr/local'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
 BF_OPENAL_LIB = 'openal'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 WITH_BF_SDL = 'true'
 BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
@@ -24,10 +27,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = '/usr/local'
 BF_OPENEXR_INC = ['${BF_OPENEXR}/include', '${BF_OPENEXR}/include/OpenEXR' ]
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
 BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index d9fd6ce8d4f18657649148ccd0a81c8b4c410442..4ff93bf7078a294e8f4cb215dc0e16b2bf4f0542 100644 (file)
@@ -12,10 +12,13 @@ BF_PYTHON_LIB = 'python25'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include'
 BF_OPENAL_LIB = 'dxguid openal_static'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 WITH_BF_FFMPEG = 'false'
 BF_FFMPEG_LIB = 'avformat swscale avcodec avutil xvidcore x264'
@@ -37,10 +40,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = LIBDIR + '/gcc/openexr'
 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
 BF_OPENEXR_LIB = ' Half IlmImf Iex '
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index 02e5dbb7f8fa5438630388b93bdeac3c55ef9c81..725cd7133da2cb0deab939793abe8cf358d3868f 100644 (file)
@@ -19,10 +19,13 @@ BF_PYTHON_LIB = 'python25'
 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
 
 WITH_BF_OPENAL = 'true'
+WITH_BF_STATICOPENAL = 'false'
 BF_OPENAL = LIBDIR + '/openal'
 BF_OPENAL_INC = '${BF_OPENAL}/include ${BF_OPENAL}/include/AL '
 BF_OPENAL_LIB = 'dxguid openal_static'
 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 
 WITH_BF_ICONV = 'true'
 BF_ICONV = LIBDIR + '/iconv'
@@ -45,10 +48,13 @@ WITH_BF_FMOD = 'false'
 BF_FMOD = LIBDIR + '/fmod'
 
 WITH_BF_OPENEXR = 'true'
+WITH_BF_STATICOPENEXR = 'false'
 BF_OPENEXR = LIBDIR + '/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 IlmThread '
 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib_msvc'
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_OPENEXR_LIB_STATIC = '${BF_OPENEXR}/lib/libHalf.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_OPENEXR}/lib/libIex.a ${BF_OPENEXR}/lib/libImath.a ${BF_OPENEXR}/lib/libIlmThread.a'
 
 WITH_BF_DDS = 'true'
 
index 3f928ff8c97312193d511508968118607f17db1b..b5f32f2455151064ec6b6ad7dd92ad7b786273a5 100644 (file)
@@ -117,15 +117,21 @@ def setup_staticlibs(lenv):
         lenv['BF_ZLIB_LIBPATH'],
         lenv['BF_ICONV_LIBPATH']
         ]
-    libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
+    
+    
     libincs += Split(lenv['BF_FFMPEG_LIBPATH'])
-
+    
+    if lenv['WITH_BF_OPENEXR']:
+        libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
+        if lenv['WITH_BF_STATICOPENEXR']:
+            statlibs += Split(lenv['BF_OPENEXR_LIB_STATIC'])
     if lenv['WITH_BF_INTERNATIONAL']:
         libincs += Split(lenv['BF_GETTEXT_LIBPATH'])
         libincs += Split(lenv['BF_FREETYPE_LIBPATH'])
     if lenv['WITH_BF_OPENAL']:
         libincs += Split(lenv['BF_OPENAL_LIBPATH'])
-
+        if lenv['WITH_BF_STATICOPENAL']:
+            statlibs += Split(lenv['BF_OPENAL_LIB_STATIC'])
     if lenv['WITH_BF_STATICOPENGL']:
         statlibs += Split(lenv['BF_OPENGL_LIB_STATIC'])
 
@@ -154,13 +160,15 @@ def setup_syslibs(lenv):
         syslibs += Split(lenv['BF_FREETYPE_LIB'])
         syslibs += Split(lenv['BF_GETTEXT_LIB'])
     if lenv['WITH_BF_OPENAL']:
-       syslibs += Split(lenv['BF_OPENAL_LIB'])
+        if not lenv['WITH_BF_STATICOPENAL']:
+            syslibs += Split(lenv['BF_OPENAL_LIB'])
     if lenv['WITH_BF_OPENMP'] and lenv['CC'] != 'icc':
         syslibs += ['gomp']
     if lenv['WITH_BF_ICONV']:
         syslibs += Split(lenv['BF_ICONV_LIB'])
     if lenv['WITH_BF_OPENEXR']:
-        syslibs += Split(lenv['BF_OPENEXR_LIB'])
+        if not lenv['WITH_BF_STATICOPENEXR']:
+            syslibs += Split(lenv['BF_OPENEXR_LIB'])
     if lenv['WITH_BF_FFMPEG']:
         syslibs += Split(lenv['BF_FFMPEG_LIB'])
     syslibs += Split(lenv['BF_SDL_LIB'])
index afcc83d20024b18087bf6f255e868900f5b406f2..be23b1d702410faade984b81d6402276992582c2 100755 (executable)
@@ -28,11 +28,11 @@ def print_arguments(args, bc):
 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_STATICPYTHON', 'BF_PYTHON_LIB_STATIC',
-            'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH',
+            'WITH_BF_OPENAL', 'BF_OPENAL', 'BF_OPENAL_INC', 'BF_OPENAL_LIB', 'BF_OPENAL_LIBPATH', 'WITH_BF_STATICOPENAL', 'BF_OPENAL_LIB_STATIC',
             'WITH_BF_SDL', 'BF_SDL', 'BF_SDL_INC', 'BF_SDL_LIB', 'BF_SDL_LIBPATH',
             'BF_PTHREADS', 'BF_PTHREADS_INC', 'BF_PTHREADS_LIB', 'BF_PTHREADS_LIBPATH',
             'WITH_BF_FMOD',
-            'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH',
+            'WITH_BF_OPENEXR', 'BF_OPENEXR', 'BF_OPENEXR_INC', 'BF_OPENEXR_LIB', 'BF_OPENEXR_LIBPATH', 'WITH_BF_STATICOPENEXR', 'BF_OPENEXR_LIB_STATIC',
             'WITH_BF_DDS',
             'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG',  'BF_FFMPEG_INC',
             'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH',
@@ -94,7 +94,7 @@ def print_targets(targs, bc):
 
 def validate_targets(targs, bc):
     valid_list = ['.', 'blender', 'blenderstatic', 'blenderplayer', 'webplugin',
-            'blendernogame', 'blenderstaticnogame', 'release',
+            'blendernogame', 'blenderstaticnogame', 'blenderlite', 'release',
             'everything', 'clean', 'install-bin', 'install', 'nsis']
     oklist = []
     for t in targs:
@@ -139,6 +139,7 @@ def read_opts(cfg, args):
         ('VERSE_BUILD_DIR', 'Target directory for intermediate files.', "${BF_BUILDDIR}/extern/verse"),
         ('VERSE_REGEN_PROTO', 'Whether to regenerate the protocol files', 'yes'),
         ('BF_DEBUG_LIBS', 'list of libraries to build with debug symbols'),
+
         ('BF_PYTHON', 'base path for python', ''),
         ('BF_PYTHON_VERSION', 'Python version to use', ''),
         ('BF_PYTHON_INC', 'include path for Python headers', ''),
@@ -148,13 +149,17 @@ def read_opts(cfg, args):
         ('BF_PYTHON_LIBPATH', 'Library path', ''),
         ('BF_PYTHON_LINKFLAGS', 'Python link flags', ''),
         (BoolOption('WITH_BF_STATICPYTHON', 'Staticly link to python', 'false')),
+
         (BoolOption('BF_NO_ELBEEM', 'Disable Fluid Sim', 'false')),
         (BoolOption('WITH_BF_YAFRAY', 'Enable Yafray', 'true')),
+
         (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_LIB_STATIC', 'Path to OpenAL static library', ''),
         ('BF_OPENAL_LIBPATH', 'Path to OpenAL library', ''),
+        (BoolOption('WITH_BF_STATICOPENAL', 'Staticly link to openal', 'false')),
 
         (BoolOption('WITH_BF_SDL', 'Use SDL if true', '')),
         ('BF_SDL', 'SDL base path', ''),
@@ -171,10 +176,12 @@ def read_opts(cfg, args):
         #  BF_FMOD = $(LCGDIR)/fmod
 
         (BoolOption('WITH_BF_OPENEXR', 'Use OPENEXR if true', 'true')),
+        (BoolOption('WITH_BF_STATICOPENEXR', 'Staticly link to OpenEXR', 'false')),
         ('BF_OPENEXR', 'OPENEXR base path', ''),
         ('BF_OPENEXR_INC', 'OPENEXR include path', ''),
         ('BF_OPENEXR_LIB', 'OPENEXR library', ''),
         ('BF_OPENEXR_LIBPATH', 'OPENEXR library path', ''),
+        ('BF_OPENEXR_LIB_STATIC', 'OPENEXR static library', ''),
 
         (BoolOption('WITH_BF_DDS', 'Use DDS if true', 'true')),