Patch [#5429] SCons patch for linux: support more libs to be linked statically
Contributed by Rui Campos, adapted for current trunk This was a very ancient patch on my todo list (mid-December 2006). Some things already were done, so I added now ffmpeg and freetype support for linking statically. FFMPEG part is untested further from my part so if you run into problems with that, please report.
This commit is contained in:
parent
0b40901bab
commit
f647ba1ce5
|
@ -84,6 +84,8 @@ BF_GETTEXT = '/usr'
|
|||
BF_GETTEXT_INC = '${BF_GETTEXT}/include'
|
||||
BF_GETTEXT_LIB = 'gettextlib'
|
||||
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
|
||||
#WITH_BF_GETTEXT_STATIC = True
|
||||
#BF_GETTEXT_LIB_STATIC = '${BF_GETTEXT}/lib/libgettextlib.a'
|
||||
|
||||
WITH_BF_GAMEENGINE = True
|
||||
WITH_BF_PLAYER = False
|
||||
|
@ -97,6 +99,8 @@ BF_BULLET_LIB = 'extern_bullet'
|
|||
BF_FREETYPE = '/usr'
|
||||
BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
|
||||
BF_FREETYPE_LIB = 'freetype'
|
||||
#WITH_BF_FREETYPE_STATIC = True
|
||||
#BF_FREETYPE_LIB_STATIC = '${BF_FREETYPE}/lib/libfreetype.a'
|
||||
|
||||
WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME
|
||||
BF_QUICKTIME = '/usr/local'
|
||||
|
@ -116,6 +120,8 @@ BF_FFMPEG = '/usr'
|
|||
BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
|
||||
BF_FFMPEG_INC = '${BF_FFMPEG}/include'
|
||||
BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
|
||||
#WITH_BF_STATICFFMPEG = True
|
||||
#BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH/libavcodec.a ${BF_FFMPEG_LIBPATH}/libswscale.a ${BF_FFMPEG_LIBPATH}/libavutil.a ${BF_FFMPEG_LIBPATH}/libavdevice.a'
|
||||
|
||||
# enable ogg, vorbis and theora in ffmpeg
|
||||
WITH_BF_OGG = False # -DWITH_OGG
|
||||
|
|
|
@ -153,10 +153,14 @@ def setup_staticlibs(lenv):
|
|||
libincs += Split(lenv['BF_TIFF_LIBPATH'])
|
||||
if lenv['WITH_BF_FFTW3']:
|
||||
libincs += Split(lenv['BF_FFTW3_LIBPATH'])
|
||||
if lenv['WITH_BF_FFMPEG'] and lenv['WITH_BF_STATICFFMPEG']:
|
||||
statlibs += Split(lenv['BF_FFMPEG_LIB_STATIC'])
|
||||
if lenv['WITH_BF_INTERNATIONAL']:
|
||||
libincs += Split(lenv['BF_GETTEXT_LIBPATH'])
|
||||
if lenv['WITH_BF_GETTEXT_STATIC']:
|
||||
statlibs += Split(lenv['BF_GETTEXT_LIB_STATIC'])
|
||||
if lenv['WITH_BF_FREETYPE_STATIC']:
|
||||
statlibs += Split(lenv['BF_FREETYPE_LIB_STATIC'])
|
||||
if lenv['WITH_BF_OPENAL']:
|
||||
libincs += Split(lenv['BF_OPENAL_LIBPATH'])
|
||||
if lenv['WITH_BF_STATICOPENAL']:
|
||||
|
@ -197,7 +201,8 @@ def setup_syslibs(lenv):
|
|||
lenv['BF_LIBSAMPLERATE_LIB']
|
||||
]
|
||||
|
||||
syslibs += Split(lenv['BF_FREETYPE_LIB'])
|
||||
if not lenv['WITH_BF_FREETYPE_STATIC']:
|
||||
syslibs += Split(lenv['BF_FREETYPE_LIB'])
|
||||
if lenv['WITH_BF_PYTHON'] and not lenv['WITH_BF_STATICPYTHON']:
|
||||
if lenv['BF_DEBUG'] and lenv['OURPLATFORM'] in ('win32-vc', 'win64-vc', 'win32-mingw'):
|
||||
syslibs.append(lenv['BF_PYTHON_LIB']+'_d')
|
||||
|
@ -220,7 +225,7 @@ def setup_syslibs(lenv):
|
|||
syslibs += Split(lenv['BF_OPENEXR_LIB'])
|
||||
if lenv['WITH_BF_TIFF']:
|
||||
syslibs += Split(lenv['BF_TIFF_LIB'])
|
||||
if lenv['WITH_BF_FFMPEG']:
|
||||
if lenv['WITH_BF_FFMPEG'] and not lenv['WITH_BF_STATICFFMPEG']:
|
||||
syslibs += Split(lenv['BF_FFMPEG_LIB'])
|
||||
if lenv['WITH_BF_OGG']:
|
||||
syslibs += Split(lenv['BF_OGG_LIB'])
|
||||
|
|
|
@ -38,6 +38,7 @@ def validate_arguments(args, bc):
|
|||
'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_CINEON', 'WITH_BF_HDR',
|
||||
'WITH_BF_FFMPEG', 'BF_FFMPEG_LIB','BF_FFMPEG_EXTRA', 'BF_FFMPEG', 'BF_FFMPEG_INC',
|
||||
'WITH_BF_STATICFFMPEG', 'BF_FFMPEG_LIB_STATIC',
|
||||
'WITH_BF_OGG', 'BF_OGG', 'BF_OGG_LIB',
|
||||
'WITH_BF_JPEG', 'BF_JPEG', 'BF_JPEG_INC', 'BF_JPEG_LIB', 'BF_JPEG_LIBPATH',
|
||||
'WITH_BF_OPENJPEG', 'BF_OPENJPEG', 'BF_OPENJPEG_INC', 'BF_OPENJPEG_LIB', 'BF_OPENJPEG_LIBPATH',
|
||||
|
@ -50,7 +51,7 @@ def validate_arguments(args, bc):
|
|||
'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
|
||||
'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
|
||||
'BF_WINTAB', 'BF_WINTAB_INC',
|
||||
'WITH_BF_FREETYPE', 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH',
|
||||
'WITH_BF_FREETYPE', 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH', 'BF_FREETYPE_LIB_STATIC', 'WITH_BF_FREETYPE_STATIC',
|
||||
'WITH_BF_QUICKTIME', 'BF_QUICKTIME', 'BF_QUICKTIME_INC', 'BF_QUICKTIME_LIB', 'BF_QUICKTIME_LIBPATH',
|
||||
'WITH_BF_FFTW3', 'BF_FFTW3', 'BF_FFTW3_INC', 'BF_FFTW3_LIB', 'BF_FFTW3_LIBPATH',
|
||||
'WITH_BF_STATICOPENGL', 'BF_OPENGL', 'BF_OPENGL_INC', 'BF_OPENGL_LIB', 'BF_OPENGL_LIBPATH', 'BF_OPENGL_LIB_STATIC',
|
||||
|
@ -236,6 +237,8 @@ def read_opts(env, cfg, args):
|
|||
|
||||
('BF_FFMPEG_INC', 'FFMPEG includes', ''),
|
||||
('BF_FFMPEG_LIBPATH', 'FFMPEG library path', ''),
|
||||
(BoolVariable('WITH_BF_STATICFFMPEG', 'Use static FFMPEG if true', False)),
|
||||
('BF_FFMPEG_LIB_STATIC', 'Static FFMPEG libraries', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_OGG', 'Use OGG, THEORA, VORBIS in FFMPEG if true',
|
||||
False)),
|
||||
|
@ -311,29 +314,14 @@ def read_opts(env, cfg, args):
|
|||
('BF_CXX', 'c++ base path for libstdc++, only used when static linking', ''),
|
||||
(BoolVariable('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
|
||||
##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
|
||||
|
||||
(BoolVariable('WITH_BF_FREETYPE', 'Use FreeType2 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', ''),
|
||||
(BoolVariable('WITH_BF_FREETYPE_STATIC', 'Use Static Freetype if true', False)),
|
||||
('BF_FREETYPE_LIB_STATIC', 'Static Freetype library', ''),
|
||||
|
||||
(BoolVariable('WITH_BF_OPENMP', 'Use OpenMP if true', False)),
|
||||
('BF_OPENMP', 'Base path to OpenMP (used when cross-compiling with older versions of WinGW)', ''),
|
||||
|
|
Loading…
Reference in New Issue