scons options BF_CXX, WITH_BF_STATICCXX, BF_CXX_LIB_STATIC for static linking to...
authorCampbell Barton <ideasman42@gmail.com>
Thu, 18 Sep 2008 03:05:02 +0000 (03:05 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 18 Sep 2008 03:05:02 +0000 (03:05 +0000)
SConstruct
config/darwin-config.py
config/linux2-config.py
config/linuxcross-config.py
config/sunos5-config.py
config/win32-vc-config.py
tools/Blender.py
tools/btools.py

index 92547bf6756c5b8b5681035e33e276f5ccf72f93..356f116e29030bbcc8d4bc1d3193fd2a32ae63a2 100644 (file)
@@ -241,6 +241,13 @@ if len(B.quickdebug) > 0 and printdebug != 0:
     for l in B.quickdebug:
         print "\t" + l
 
+# remove stdc++ from LLIBS if we are building a statc linked CXXFLAGS
+if env['WITH_BF_STATICCXX']:
+    if 'stdc++' in env['LLIBS']:
+        env['LLIBS'] = env['LLIBS'].replace('stdc++', ' ')
+    else:
+        print '\tcould not remove stdc++ library from LLIBS, WITH_BF_STATICCXX may not work for your platform'
+
 # check target for blenderplayer. Set WITH_BF_PLAYER if found on cmdline
 if 'blenderplayer' in B.targets:
     env['WITH_BF_PLAYER'] = True
index 70d2281b1f7daa2190b7b14e28911accc8745575..0eb275dcaf4c9efe0718b19241795d00795090e6 100644 (file)
@@ -95,6 +95,11 @@ 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'
 
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_CXX = '/usr'
+WITH_BF_STATICCXX = 'false'
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+
 WITH_BF_SDL = 'true'
 BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
 BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
index f2df9b86c6bf5320ed70783da4c5abcbc40dd21d..cd7e6659af1cc7d3cd2a0a30431f0059a9ad7cdd 100644 (file)
@@ -25,6 +25,10 @@ BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
 # BF_OPENAL_LIB = 'openal alut'  
 # BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a ${BF_OPENAL}/lib/libalut.a'
 
+BF_CXX = '/usr'
+WITH_BF_STATICCXX = 'false'
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+
 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)
index 3172a4a060c084c0c2cc5ff35f379c95b18eabc0..9d58512151b6ff0e9c222cb51bf6b13c943b5f5b 100644 (file)
@@ -22,6 +22,11 @@ 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'
 
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_CXX = '/usr'
+WITH_BF_STATICCXX = 'false'
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+
 WITH_BF_SDL = 'true'
 BF_SDL = LIBDIR + '/sdl'
 BF_SDL_INC = '${BF_SDL}/include'
index 84e2f57bd3eb878cb33b052372c4c2731b788e33..bfb1513ca3f545066a25ba15722ffb8cd4c59530 100644 (file)
@@ -17,6 +17,11 @@ 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'
 
+# Warning, this static lib configuration is untested! users of this OS please confirm.
+BF_CXX = '/usr'
+WITH_BF_STATICCXX = 'false'
+BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+
 WITH_BF_SDL = 'true'
 BF_SDL = '/usr/local' #$(shell sdl-config --prefix)
 BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
index 725cd7133da2cb0deab939793abe8cf358d3868f..063d1461def1a4f811e8870ca95d2050fca02012 100644 (file)
@@ -27,6 +27,11 @@ 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'
 
+# TODO - are these useful on win32?
+# BF_CXX = '/usr'
+# WITH_BF_STATICCXX = 'false'
+# BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
+
 WITH_BF_ICONV = 'true'
 BF_ICONV = LIBDIR + '/iconv'
 BF_ICONV_INC = '${BF_ICONV}/include'
index b5f32f2455151064ec6b6ad7dd92ad7b786273a5..2a63ca5b697ff0c65ef5eaf97710e6b8409c13ff 100644 (file)
@@ -120,7 +120,8 @@ def setup_staticlibs(lenv):
     
     
     libincs += Split(lenv['BF_FFMPEG_LIBPATH'])
-    
+    if lenv['WITH_BF_STATICCXX']:
+        statlibs += Split(lenv['BF_CXX_LIB_STATIC'])
     if lenv['WITH_BF_OPENEXR']:
         libincs += Split(lenv['BF_OPENEXR_LIBPATH'])
         if lenv['WITH_BF_STATICOPENEXR']:
index be23b1d702410faade984b81d6402276992582c2..ffefef06a5a528efcfa02a7f85f5db27c6beecc2 100755 (executable)
@@ -55,8 +55,9 @@ def validate_arguments(args, bc):
             'CFLAGS', 'CCFLAGS', 'CPPFLAGS', 
             'REL_CFLAGS', 'REL_CCFLAGS',
             'C_WARN', 'CC_WARN', 'LLIBS', 'PLATFORM_LINKFLAGS',
-            'BF_PROFILE_FLAGS', 'LCGDIR', 'WITH_BF_VERSE', 
-            'BF_VERSE_INCLUDE',
+            'BF_PROFILE_FLAGS', 'LCGDIR',
+            'BF_CXX', 'WITH_BF_STATICCXX', 'BF_CXX_LIB_STATIC'
+            'WITH_BF_VERSE', 'BF_VERSE_INCLUDE',
             'VERSE_BUILD_BINARY', 'VERSE_BUILD_DIR', 'VERSE_REGEN_PROTO',
             'BF_TWEAK_MODE', 'BF_SPLIT_SRC',
             'WITHOUT_BF_INSTALL',
@@ -256,6 +257,9 @@ def read_opts(cfg, args):
         ('BF_SOLID_INC', 'Solid include path', ''),
         ('BF_WINTAB', 'WinTab base dir', ''),
         ('BF_WINTAB_INC', 'WinTab include dir', ''),
+        ('BF_CXX', 'c++ base path for libstdc++, only used when static linking', ''),
+        ('WITH_BF_STATICCXX', 'static link to stdc++', 'false'),
+        ('BF_CXX_LIB_STATIC', 'static library path for stdc++', ''),
 ##
 ##WITH_BF_NSPR = 'true'
 ##BF_NSPR = $(LCGDIR)/nspr