Fixed crash when trying to perform transformation in Clip Editor without clip opened
[blender.git] / build_files / scons / config / linux-config.py
1 # find library directory
2 import platform
3 import os
4 from Modules.FindPython import FindPython
5
6 bitness = platform.architecture()[0]
7 if bitness == '64bit':
8     LCGDIR = '../lib/linux64'
9 else:
10     LCGDIR = '../lib/linux'
11 LIBDIR = "#${LCGDIR}"
12
13 py = FindPython()
14
15 BF_PYTHON_ABI_FLAGS = py['ABI_FLAGS']
16 BF_PYTHON = py['PYTHON']
17 BF_PYTHON_LIBPATH = py['LIBPATH']
18 BF_PYTHON_VERSION = py['VERSION']
19 WITH_BF_STATICPYTHON = False
20 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}'
21 BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
22 BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}'  # BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
23 BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
24 BF_PYTHON_LIB_STATIC = '${BF_PYTHON}/lib/libpython${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}.a'
25
26 WITH_BF_OPENAL = True
27 WITH_BF_STATICOPENAL = False
28 BF_OPENAL = '/usr'
29 BF_OPENAL_INC = '${BF_OPENAL}/include'
30 BF_OPENAL_LIB = 'openal'
31 BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
32
33 BF_CXX = '/usr'
34 WITH_BF_STATICCXX = False
35 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
36
37 WITH_BF_JACK = False
38 BF_JACK = '/usr'
39 BF_JACK_INC = '${BF_JACK}/include/jack'
40 BF_JACK_LIB = 'jack'
41 BF_JACK_LIBPATH = '${BF_JACK}/lib'
42
43 WITH_BF_SNDFILE = False
44 WITH_BF_STATICSNDFILE = False
45 BF_SNDFILE = '/usr'
46 BF_SNDFILE_INC = '${BF_SNDFILE}/include/sndfile'
47 BF_SNDFILE_LIB = 'sndfile'
48 BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib'
49 BF_SNDFILE_LIB_STATIC = '${BF_SNDFILE}/lib/libsndfile.a ${BF_OGG}/lib/libvorbis.a ${BF_OGG}/lib/libFLAC.a ${BF_OGG}/lib/libvorbisenc.a ${BF_OGG}/lib/libogg.a'
50
51 WITH_BF_SDL = True
52 BF_SDL = '/usr' #$(shell sdl-config --prefix)
53 BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
54 BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
55
56 WITH_BF_OPENEXR = True
57 WITH_BF_STATICOPENEXR = False
58 BF_OPENEXR = '/usr'
59 # when compiling with your own openexr lib you might need to set...
60 # BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
61
62 BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
63 BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
64 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'
65 # BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
66
67
68 WITH_BF_DDS = True
69
70 WITH_BF_JPEG = True
71 BF_JPEG = '/usr'
72 BF_JPEG_INC = '${BF_JPEG}/include'
73 BF_JPEG_LIB = 'jpeg'
74
75 WITH_BF_PNG = True
76 BF_PNG = '/usr'
77 BF_PNG_INC = '${BF_PNG}/include'
78 BF_PNG_LIB = 'png'
79
80 WITH_BF_TIFF = True
81 BF_TIFF = '/usr'
82 BF_TIFF_INC = '${BF_TIFF}/include'
83 BF_TIFF_LIB = 'tiff'
84
85 WITH_BF_ZLIB = True
86 BF_ZLIB = '/usr'
87 BF_ZLIB_INC = '${BF_ZLIB}/include'
88 BF_ZLIB_LIB = 'z'
89
90 WITH_BF_INTERNATIONAL = True
91
92 BF_GETTEXT = '/usr'
93 BF_GETTEXT_INC = '${BF_GETTEXT}/include'
94 BF_GETTEXT_LIB = 'gettextlib'
95 BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
96 #WITH_BF_GETTEXT_STATIC = True
97 #BF_GETTEXT_LIB_STATIC = '${BF_GETTEXT}/lib/libgettextlib.a'
98
99 WITH_BF_GAMEENGINE = True
100 WITH_BF_PLAYER = True
101 WITH_BF_OCEANSIM = True
102
103 WITH_BF_BULLET = True
104 BF_BULLET = '#extern/bullet2/src'
105 BF_BULLET_INC = '${BF_BULLET}'
106 BF_BULLET_LIB = 'extern_bullet'
107
108 BF_FREETYPE = '/usr'
109 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
110 BF_FREETYPE_LIB = 'freetype'
111 #BF_FREETYPE_LIB_STATIC = '${BF_FREETYPE}/lib/libfreetype.a'
112
113 WITH_BF_QUICKTIME = False
114 BF_QUICKTIME = '/usr/local'
115 BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
116
117 WITH_BF_ICONV = False
118 BF_ICONV = LIBDIR + "/iconv"
119 BF_ICONV_INC = '${BF_ICONV}/include'
120 BF_ICONV_LIB = 'iconv'
121 BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
122
123 WITH_BF_BINRELOC = True
124
125 # enable ffmpeg  support
126 WITH_BF_FFMPEG = True
127 BF_FFMPEG = LIBDIR + '/ffmpeg'
128 if os.path.exists(LCGDIR + '/ffmpeg'):
129     WITH_BF_STATICFFMPEG = True
130     BF_FFMPEG_LIB_STATIC = '${BF_FFMPEG_LIBPATH}/libavformat.a ${BF_FFMPEG_LIBPATH}/libswscale.a ' + \
131         '${BF_FFMPEG_LIBPATH}/libavcodec.a ${BF_FFMPEG_LIBPATH}/libavdevice.a ${BF_FFMPEG_LIBPATH}/libavutil.a ' + \
132         '${BF_FFMPEG_LIBPATH}/libxvidcore.a ${BF_FFMPEG_LIBPATH}/libx264.a ${BF_FFMPEG_LIBPATH}/libmp3lame.a ' + \
133         '${BF_FFMPEG_LIBPATH}/libvpx.a ${BF_FFMPEG_LIBPATH}/libvorbis.a ${BF_FFMPEG_LIBPATH}/libogg.a ' + \
134         '${BF_FFMPEG_LIBPATH}/libvorbisenc.a ${BF_FFMPEG_LIBPATH}/libtheora.a ' + \
135         '${BF_FFMPEG_LIBPATH}/libschroedinger-1.0.a ${BF_FFMPEG_LIBPATH}/liborc-0.4.a ${BF_FFMPEG_LIBPATH}/libdirac_encoder.a ' + \
136         '${BF_FFMPEG_LIBPATH}/libfaad.a'
137 else:
138     BF_FFMPEG = '/usr'
139 BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
140 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
141 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
142 #WITH_BF_STATICFFMPEG = True
143 #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'
144
145 # enable ogg, vorbis and theora in ffmpeg
146 WITH_BF_OGG = False
147 BF_OGG = '/usr'
148 BF_OGG_INC = '${BF_OGG}/include'
149 BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
150
151 WITH_BF_OPENJPEG = True 
152 BF_OPENJPEG = '#extern/libopenjpeg'
153 BF_OPENJPEG_LIB = ''
154 BF_OPENJPEG_INC = '${BF_OPENJPEG}'
155 BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
156
157 WITH_BF_FFTW3 = False
158 WITH_BF_STATICFFTW3 = False
159 BF_FFTW3 = '/usr'
160 BF_FFTW3_INC = '${BF_FFTW3}/include'
161 BF_FFTW3_LIB = 'fftw3'
162 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
163 BF_FFTW3_LIB_STATIC = '${BF_FFTW3_LIBPATH}/libfftw3.a'
164
165 WITH_BF_REDCODE = False  
166 BF_REDCODE = '#extern/libredcode'
167 BF_REDCODE_LIB = ''
168 # BF_REDCODE_INC = '${BF_REDCODE}/include'
169 BF_REDCODE_INC = '${BF_REDCODE}/../' #C files request "libredcode/format.h" which is in "#extern/libredcode/format.h", stupid but compiles for now.
170 BF_REDCODE_LIBPATH='${BF_REDCODE}/lib'
171
172 # Mesa Libs should go here if your using them as well....
173 WITH_BF_STATICOPENGL = False
174 BF_OPENGL = '/usr'
175 BF_OPENGL_INC = '${BF_OPENGL}/include'
176 BF_OPENGL_LIB = 'GL GLU X11 Xi'
177 BF_OPENGL_LIBPATH = '/usr/X11R6/lib'
178 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'
179
180 WITH_BF_COLLADA = False
181 BF_COLLADA = '#source/blender/collada'
182 BF_COLLADA_INC = '${BF_COLLADA}'
183 BF_COLLADA_LIB = 'bf_collada'
184 BF_OPENCOLLADA = '/usr'
185 BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}'
186 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa'
187 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib'
188 BF_PCRE = ''
189 BF_PCRE_LIB = 'pcre'
190 BF_PCRE_LIBPATH = '/usr/lib'
191 BF_EXPAT = '/usr'
192 BF_EXPAT_LIB = 'expat'
193 BF_EXPAT_LIBPATH = '/usr/lib'
194
195 WITH_BF_JEMALLOC = False
196 WITH_BF_STATICJEMALLOC = False
197 BF_JEMALLOC = '/usr'
198 BF_JEMALLOC_INC = '${BF_JEMALLOC}/include'
199 BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
200 BF_JEMALLOC_LIB = 'jemalloc'
201 BF_JEMALLOC_LIB_STATIC = '${BF_JEMALLOC_LIBPATH}/libjemalloc.a'
202
203 WITH_BF_OIIO = True
204 WITH_BF_STATICOIIO = False
205 BF_OIIO = LIBDIR + '/oiio'
206 if not os.path.exists(LCGDIR + '/oiio'):
207     WITH_BF_OIIO = False
208     BF_OIIO = '/usr'
209 BF_OIIO_INC = BF_OIIO + '/include'
210 BF_OIIO_LIB = 'OpenImageIO'
211 BF_OIIO_LIBPATH = BF_OIIO + '/lib'
212
213 WITH_BF_BOOST = True
214 WITH_BF_STATICBOOST = False
215 BF_BOOST = LIBDIR + '/boost'
216 if not os.path.exists(LCGDIR + '/boost'):
217     WITH_BF_BOOST = False
218     BF_BOOST = '/usr'
219 BF_BOOST_INC = BF_BOOST + '/include'
220 BF_BOOST_LIB = 'boost_date_time boost_filesystem boost_regex boost_system boost_thread'
221 BF_BOOST_LIBPATH = BF_BOOST + '/lib'
222
223 WITH_BF_CYCLES = WITH_BF_OIIO and WITH_BF_BOOST
224
225 WITH_BF_CYCLES_CUDA_BINARIES = False
226 BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
227 BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21']
228
229 WITH_BF_OPENMP = True
230
231 #Ray trace optimization
232 WITH_BF_RAYOPTIMIZATION = True
233 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
234
235 #SpaceNavigator and friends
236 WITH_BF_3DMOUSE = True
237 WITH_BF_STATIC3DMOUSE = False
238 BF_3DMOUSE = '/usr'
239 BF_3DMOUSE_INC = '${BF_3DMOUSE}/include'
240 BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
241 BF_3DMOUSE_LIB = 'spnav'
242 BF_3DMOUSE_LIB_STATIC = '${BF_3DMOUSE_LIBPATH}/libspnav.a'
243
244 ##
245 CC = 'gcc'
246 CXX = 'g++'
247 ##ifeq ($CPU),alpha)
248 ##   CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee
249
250 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
251 CXXFLAGS = []
252
253 CPPFLAGS = []
254 # g++ 4.6, only needed for bullet
255 CXXFLAGS += ['-fpermissive']
256 if WITH_BF_FFMPEG:
257     # libavutil needs UINT64_C()
258     CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
259 REL_CFLAGS = []
260 REL_CXXFLAGS = []
261 REL_CCFLAGS = ['-DNDEBUG', '-O2']
262 ##BF_DEPEND = True
263 ##
264 ##AR = ar
265 ##ARFLAGS = ruv
266 ##ARFLAGSQUIET = ru
267 ##
268 C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Wstrict-prototypes', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type']
269 CC_WARN = ['-Wall']
270 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
271
272
273 ##FIX_STUBS_WARNINGS = -Wno-unused
274
275 LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
276 ##LOPTS = --dynamic
277 ##DYNLDFLAGS = -shared $(LDFLAGS)
278
279 BF_PROFILE = False
280 BF_PROFILE_CCFLAGS = ['-pg','-g']
281 BF_PROFILE_LINKFLAGS = ['-pg']
282
283 BF_DEBUG = False
284 BF_DEBUG_CCFLAGS = ['-g', '-D_DEBUG']
285
286 BF_BUILDDIR = '../build/linux'
287 BF_INSTALLDIR='../install/linux'
288
289 #Link against pthread
290 PLATFORM_LINKFLAGS = ['-pthread']
291