server: Add support for statically linking libgcc and libstdc++

(cherry picked from commit be7bfdfac3)
This commit is contained in:
Rémi Verschelde 2018-02-22 19:06:11 +01:00
parent 46b594054c
commit 689dfcd9ec
1 changed files with 5 additions and 0 deletions

View File

@ -22,6 +22,7 @@ def get_opts():
from SCons.Variables import BoolVariable
return [
BoolVariable('use_llvm', 'Use the LLVM compiler', False),
BoolVariable('use_static_cpp', 'Link libgcc and libstdc++ statically for better portability', False),
]
@ -135,3 +136,7 @@ def configure(env):
env.Append(CPPFLAGS=['-DSERVER_ENABLED', '-DUNIX_ENABLED'])
env.Append(LIBS=['pthread'])
env.Append(LIBS=['dl'])
# Link those statically for portability
if env['use_static_cpp']:
env.Append(LINKFLAGS=['-static-libgcc', '-static-libstdc++'])