diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-09-18 07:05:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-09-18 07:05:02 +0400 |
commit | 8d1163c639253e76fec3f69fead716a51068ea37 (patch) | |
tree | 8e72786b11aaef86cbe0a6459dec908a5864065d | |
parent | beb7738a299579e771295e013961ef3af139d1e5 (diff) |
scons options BF_CXX, WITH_BF_STATICCXX, BF_CXX_LIB_STATIC for static linking to stdc++ because of problems running blender on some systems.
-rw-r--r-- | SConstruct | 7 | ||||
-rw-r--r-- | config/darwin-config.py | 5 | ||||
-rw-r--r-- | config/linux2-config.py | 4 | ||||
-rw-r--r-- | config/linuxcross-config.py | 5 | ||||
-rw-r--r-- | config/sunos5-config.py | 5 | ||||
-rw-r--r-- | config/win32-vc-config.py | 5 | ||||
-rw-r--r-- | tools/Blender.py | 3 | ||||
-rwxr-xr-x | tools/btools.py | 8 |
8 files changed, 39 insertions, 3 deletions
diff --git a/SConstruct b/SConstruct index 92547bf6756..356f116e290 100644 --- a/SConstruct +++ b/SConstruct @@ -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 diff --git a/config/darwin-config.py b/config/darwin-config.py index 70d2281b1f7..0eb275dcaf4 100644 --- a/config/darwin-config.py +++ b/config/darwin-config.py @@ -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) diff --git a/config/linux2-config.py b/config/linux2-config.py index f2df9b86c6b..cd7e6659af1 100644 --- a/config/linux2-config.py +++ b/config/linux2-config.py @@ -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) diff --git a/config/linuxcross-config.py b/config/linuxcross-config.py index 3172a4a060c..9d58512151b 100644 --- a/config/linuxcross-config.py +++ b/config/linuxcross-config.py @@ -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' diff --git a/config/sunos5-config.py b/config/sunos5-config.py index 84e2f57bd3e..bfb1513ca3f 100644 --- a/config/sunos5-config.py +++ b/config/sunos5-config.py @@ -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) diff --git a/config/win32-vc-config.py b/config/win32-vc-config.py index 725cd7133da..063d1461def 100644 --- a/config/win32-vc-config.py +++ b/config/win32-vc-config.py @@ -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' diff --git a/tools/Blender.py b/tools/Blender.py index b5f32f24551..2a63ca5b697 100644 --- a/tools/Blender.py +++ b/tools/Blender.py @@ -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']: diff --git a/tools/btools.py b/tools/btools.py index be23b1d7024..ffefef06a5a 100755 --- a/tools/btools.py +++ b/tools/btools.py @@ -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 |