Patch [#5429] SCons patch for linux: support more libs to be linked statically
[blender.git] / build_files / scons / config / linux2-config.py
1 LCGDIR = '../lib/linux2'
2 LIBDIR = "${LCGDIR}"
3
4 BF_PYTHON = '/usr'
5 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib'
6 BF_PYTHON_VERSION = '3.1'
7 WITH_BF_STATICPYTHON = False
8 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
9 BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
10 BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}' #BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
11 BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
12 BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION}.a'
13
14 WITH_BF_OPENAL = True
15 WITH_BF_STATICOPENAL = False
16 BF_OPENAL = '/usr'
17 BF_OPENAL_INC = '${BF_OPENAL}/include'
18 BF_OPENAL_LIB = 'openal'
19 BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
20
21 BF_CXX = '/usr'
22 WITH_BF_STATICCXX = False
23 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
24
25 BF_LIBSAMPLERATE = '/usr'
26 BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
27 BF_LIBSAMPLERATE_LIB = 'samplerate'
28 BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
29
30 WITH_BF_JACK = False
31 BF_JACK = '/usr'
32 BF_JACK_INC = '${BF_JACK}/include/jack'
33 BF_JACK_LIB = 'jack'
34 BF_JACK_LIBPATH = '${BF_JACK}/lib'
35
36 WITH_BF_SNDFILE = False
37 BF_SNDFILE = '/usr'
38 BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
39 BF_SNDFILE_LIB = 'sndfile'
40 BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
41
42 WITH_BF_SDL = True
43 BF_SDL = '/usr' #$(shell sdl-config --prefix)
44 BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
45 BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
46
47 WITH_BF_OPENEXR = True
48 WITH_BF_STATICOPENEXR = False
49 BF_OPENEXR = '/usr'
50 # when compiling with your own openexr lib you might need to set...
51 # BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
52
53 BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
54 BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
55 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'
56 # BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
57
58
59 WITH_BF_DDS = True
60
61 WITH_BF_JPEG = True
62 BF_JPEG = '/usr'
63 BF_JPEG_INC = '${BF_JPEG}/include'
64 BF_JPEG_LIB = 'jpeg'
65
66 WITH_BF_PNG = True
67 BF_PNG = '/usr'
68 BF_PNG_INC = '${BF_PNG}/include'
69 BF_PNG_LIB = 'png'
70
71 WITH_BF_TIFF = True
72 BF_TIFF = '/usr'
73 BF_TIFF_INC = '${BF_TIFF}/include'
74 BF_TIFF_LIB = 'tiff'
75
76 WITH_BF_ZLIB = True
77 BF_ZLIB = '/usr'
78 BF_ZLIB_INC = '${BF_ZLIB}/include'
79 BF_ZLIB_LIB = 'z'
80
81 WITH_BF_INTERNATIONAL = True
82
83 BF_GETTEXT = '/usr'
84 BF_GETTEXT_INC = '${BF_GETTEXT}/include'
85 BF_GETTEXT_LIB = 'gettextlib'
86 BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
87 #WITH_BF_GETTEXT_STATIC = True
88 #BF_GETTEXT_LIB_STATIC = '${BF_GETTEXT}/lib/libgettextlib.a'
89
90 WITH_BF_GAMEENGINE = True
91 WITH_BF_PLAYER = False
92
93 WITH_BF_BULLET = True
94 BF_BULLET = '#extern/bullet2/src'
95 BF_BULLET_INC = '${BF_BULLET}'
96 BF_BULLET_LIB = 'extern_bullet'
97
98 # enable freetype2 support for text objects
99 BF_FREETYPE = '/usr'
100 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
101 BF_FREETYPE_LIB = 'freetype'
102 #WITH_BF_FREETYPE_STATIC = True
103 #BF_FREETYPE_LIB_STATIC = '${BF_FREETYPE}/lib/libfreetype.a'
104
105 WITH_BF_QUICKTIME = False # -DWITH_QUICKTIME
106 BF_QUICKTIME = '/usr/local'
107 BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
108
109 WITH_BF_ICONV = False
110 BF_ICONV = LIBDIR + "/iconv"
111 BF_ICONV_INC = '${BF_ICONV}/include'
112 BF_ICONV_LIB = 'iconv'
113 BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
114
115 WITH_BF_BINRELOC = True
116
117 # enable ffmpeg  support
118 WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
119 BF_FFMPEG = '/usr'
120 BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
121 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
122 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
123 #WITH_BF_STATICFFMPEG = True
124 #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'
125
126 # enable ogg, vorbis and theora in ffmpeg
127 WITH_BF_OGG = False  # -DWITH_OGG 
128 BF_OGG = '/usr'
129 BF_OGG_INC = '${BF_OGG}/include'
130 BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
131
132 WITH_BF_OPENJPEG = True 
133 BF_OPENJPEG = '#extern/libopenjpeg'
134 BF_OPENJPEG_LIB = ''
135 BF_OPENJPEG_INC = '${BF_OPENJPEG}'
136 BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
137
138 WITH_BF_FFTW3 = False
139 BF_FFTW3 = LIBDIR + '/usr'
140 BF_FFTW3_INC = '${BF_FFTW3}/include'
141 BF_FFTW3_LIB = 'fftw3'
142 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
143
144 WITH_BF_REDCODE = False  
145 BF_REDCODE = '#extern/libredcode'
146 BF_REDCODE_LIB = ''
147 # BF_REDCODE_INC = '${BF_REDCODE}/include'
148 BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
149 BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
150
151 # Mesa Libs should go here if your using them as well....
152 WITH_BF_STATICOPENGL = False
153 BF_OPENGL = '/usr'
154 BF_OPENGL_INC = '${BF_OPENGL}/include'
155 BF_OPENGL_LIB = 'GL GLU X11 Xi'
156 BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
157 BF_OPENGL_LIB_STATIC = '${BF_OPENGL_LIBPATH}/libGL.a ${BF_OPENGL_LIBPATH}/libGLU.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a ${BF_OPENGL_LIBPATH}/libX11.a ${BF_OPENGL_LIBPATH}/libXi.a ${BF_OPENGL_LIBPATH}/libXext.a ${BF_OPENGL_LIBPATH}/libXxf86vm.a'
158
159 WITH_BF_COLLADA = False
160 BF_COLLADA = '#source/blender/collada'
161 BF_COLLADA_INC = '${BF_COLLADA}'
162 BF_COLLADA_LIB = 'bf_collada'
163 BF_OPENCOLLADA = '/usr'
164 BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}'
165 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa'
166 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
167 BF_PCRE = ''
168 BF_PCRE_LIB = 'pcre'
169 BF_PCRE_LIBPATH = '/usr/lib'
170 BF_EXPAT = '/usr'
171 BF_EXPAT_LIB = 'expat'
172 BF_EXPAT_LIBPATH = '/usr/lib'
173
174 WITH_BF_OPENMP = True
175
176 #Ray trace optimization
177 WITH_BF_RAYOPTIMIZATION = True
178 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
179
180 ##
181 CC = 'gcc'
182 CXX = 'g++'
183 ##ifeq ($CPU),alpha)
184 ##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
185
186 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
187
188 CPPFLAGS = []
189 CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64']
190 if WITH_BF_FFMPEG:
191   # libavutil needs UINT64_C()
192   CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
193 REL_CFLAGS = ['-O2']
194 REL_CCFLAGS = ['-O2']
195 ##BF_DEPEND = True
196 ##
197 ##AR = ar
198 ##ARFLAGS = ruv
199 ##ARFLAGSQUIET = ru
200 ##
201 C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
202 CC_WARN = ['-Wall']
203 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
204
205
206 ##FIX_STUBS_WARNINGS = -Wno-unused
207
208 LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
209 ##LOPTS = --dynamic
210 ##DYNLDFLAGS = -shared $(LDFLAGS)
211
212 BF_PROFILE = False
213 BF_PROFILE_CCFLAGS = ['-pg','-g']
214 BF_PROFILE_LINKFLAGS = ['-pg']
215
216 BF_DEBUG = False
217 BF_DEBUG_CCFLAGS = ['-g']
218
219 BF_BUILDDIR = '../build/linux2'
220 BF_INSTALLDIR='../install/linux2'
221
222 #Link against pthread
223 PLATFORM_LINKFLAGS = ['-pthread']
224