6106142f8a98beb6a2a61c03c9ababea49764e4a
[blender.git] / build_files / scons / config / linux-config.py
1 from Modules.FindPython import FindPython
2
3 py = FindPython()
4
5 BF_PYTHON_ABI_FLAGS = py['ABI_FLAGS']
6 BF_PYTHON = py['PYTHON']
7 BF_PYTHON_LIBPATH = py['LIBPATH']
8 BF_PYTHON_LIBPATH_ARCH = py['LIBPATH_ARCH']
9 BF_PYTHON_CONFIG = py['CONFIG']
10 BF_PYTHON_VERSION = py['VERSION']
11 WITH_BF_STATICPYTHON = False
12 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS} ' + BF_PYTHON_CONFIG
13 BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
14 BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}'  # BF_PYTHON+'/lib/python'+BF_PYTHON_VERSION+'/config/libpython'+BF_PYTHON_VERSION+'.a'
15 BF_PYTHON_LINKFLAGS = ['-Xlinker', '-export-dynamic']
16 BF_PYTHON_LIB_STATIC = '${BF_PYTHON_LIBPATH_ARCH}/libpython${BF_PYTHON_VERSION}${BF_PYTHON_ABI_FLAGS}.a'
17
18 WITH_BF_OPENAL = True
19 WITH_BF_STATICOPENAL = False
20 BF_OPENAL = '/usr'
21 BF_OPENAL_INC = '${BF_OPENAL}/include'
22 BF_OPENAL_LIB = 'openal'
23 BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
24
25 BF_CXX = '/usr'
26 WITH_BF_STATICCXX = False
27 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
28
29 WITH_BF_JACK = False
30 BF_JACK = '/usr'
31 BF_JACK_INC = '${BF_JACK}/include/jack'
32 BF_JACK_LIB = 'jack'
33 BF_JACK_LIBPATH = '${BF_JACK}/lib'
34
35 WITH_BF_SNDFILE = False
36 WITH_BF_STATICSNDFILE = 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 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'
42
43 WITH_BF_SDL = True
44 BF_SDL = '/usr' #$(shell sdl-config --prefix)
45 BF_SDL_INC = '${BF_SDL}/include/SDL' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
46 BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
47
48 WITH_BF_OPENEXR = True
49 WITH_BF_STATICOPENEXR = False
50 BF_OPENEXR = '/usr'
51 # when compiling with your own openexr lib you might need to set...
52 # BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR ${BF_OPENEXR}/include'
53
54 BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
55 BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
56 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'
57 # BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
58
59
60 WITH_BF_DDS = True
61
62 WITH_BF_JPEG = True
63 BF_JPEG = '/usr'
64 BF_JPEG_INC = '${BF_JPEG}/include'
65 BF_JPEG_LIB = 'jpeg'
66
67 WITH_BF_PNG = True
68 BF_PNG = '/usr'
69 BF_PNG_INC = '${BF_PNG}/include'
70 BF_PNG_LIB = 'png'
71
72 WITH_BF_TIFF = True
73 BF_TIFF = '/usr'
74 BF_TIFF_INC = '${BF_TIFF}/include'
75 BF_TIFF_LIB = 'tiff'
76
77 WITH_BF_ZLIB = True
78 BF_ZLIB = '/usr'
79 BF_ZLIB_INC = '${BF_ZLIB}/include'
80 BF_ZLIB_LIB = 'z'
81
82 WITH_BF_INTERNATIONAL = True
83
84 WITH_BF_GAMEENGINE = True
85 WITH_BF_PLAYER = True
86 WITH_BF_OCEANSIM = True
87
88 WITH_BF_BULLET = True
89 BF_BULLET = '#extern/bullet2/src'
90 BF_BULLET_INC = '${BF_BULLET}'
91 BF_BULLET_LIB = 'extern_bullet'
92
93 WITH_BF_ELTOPO = False
94 BF_LAPACK = '/usr'
95 BF_LAPACK_LIB = 'lapack3gf blas clapack'
96 BF_LAPACK_LIBPATH = '${BF_LAPACK}/lib'
97
98 BF_FREETYPE = '/usr'
99 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
100 BF_FREETYPE_LIB = 'freetype'
101 #BF_FREETYPE_LIB_STATIC = '${BF_FREETYPE}/lib/libfreetype.a'
102
103 WITH_BF_QUICKTIME = False
104 BF_QUICKTIME = '/usr/local'
105 BF_QUICKTIME_INC = '${BF_QUICKTIME}/include'
106
107 WITH_BF_ICONV = False
108 BF_ICONV = "/usr"
109 BF_ICONV_INC = '${BF_ICONV}/include'
110 BF_ICONV_LIB = 'iconv'
111 BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
112
113 WITH_BF_BINRELOC = True
114
115 # enable ffmpeg  support
116 WITH_BF_FFMPEG = True
117 BF_FFMPEG = '/usr'
118 BF_FFMPEG_LIB = 'avformat avcodec swscale avutil avdevice'
119 BF_FFMPEG_INC = '${BF_FFMPEG}/include'
120 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
121 #WITH_BF_STATICFFMPEG = True
122 #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'
123
124 # enable ogg, vorbis and theora in ffmpeg
125 WITH_BF_OGG = False
126 BF_OGG = '/usr'
127 BF_OGG_INC = '${BF_OGG}/include'
128 BF_OGG_LIB = 'ogg vorbis vorbisenc theoraenc theoradec'
129
130 WITH_BF_OPENJPEG = True 
131 BF_OPENJPEG = '#extern/libopenjpeg'
132 BF_OPENJPEG_LIB = ''
133 BF_OPENJPEG_INC = '${BF_OPENJPEG}'
134 BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
135
136 WITH_BF_FFTW3 = False
137 WITH_BF_STATICFFTW3 = False
138 BF_FFTW3 = '/usr'
139 BF_FFTW3_INC = '${BF_FFTW3}/include'
140 BF_FFTW3_LIB = 'fftw3'
141 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
142 BF_FFTW3_LIB_STATIC = '${BF_FFTW3_LIBPATH}/libfftw3.a'
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}/include/opencollada'
165 BF_OPENCOLLADA_LIB = 'OpenCOLLADAStreamWriter OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils GeneratedSaxParser UTF MathMLSolver pcre buffer ftoa'
166 BF_OPENCOLLADA_LIBPATH = '${BF_OPENCOLLADA}/lib/opencollada'
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_JEMALLOC = False
175 WITH_BF_STATICJEMALLOC = False
176 BF_JEMALLOC = '/usr'
177 BF_JEMALLOC_INC = '${BF_JEMALLOC}/include'
178 BF_JEMALLOC_LIBPATH = '${BF_JEMALLOC}/lib'
179 BF_JEMALLOC_LIB = 'jemalloc'
180 BF_JEMALLOC_LIB_STATIC = '${BF_JEMALLOC_LIBPATH}/libjemalloc.a'
181
182 WITH_BF_OIIO = False
183 WITH_BF_STATICOIIO = False
184 BF_OIIO = '/usr'
185 BF_OIIO_INC = '${BF_OIIO}/include'
186 BF_OIIO_LIB = 'OpenImageIO'
187 BF_OIIO_LIB_STATIC = '${BF_OIIO_LIBPATH}/libOpenImageIO.a ${BF_OPENEXR}/lib/libIlmImf.a ${BF_JPEG}/lib/libjpeg.a'
188 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
189
190 WITH_BF_OCIO = False
191 WITH_BF_STATICOCIO = False
192 BF_OCIO = '/usr'
193 BF_OCIO_INC = '${BF_OCIO}/include'
194 BF_OCIO_LIB = 'OpenColorIO yaml-cpp tinyxml'
195 BF_OCIO_LIB_STATIC = '${BF_OCIO_LIBPATH}/libOpenColorIO.a ${BF_OCIO_LIBPATH}/libtinyxml.a ${BF_OCIO_LIBPATH}/libyaml-cpp.a'
196 BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
197
198 WITH_BF_BOOST = True
199 WITH_BF_STATICBOOST = False
200 BF_BOOST = '/usr'
201 BF_BOOST_INC = '${BF_BOOST}/include'
202 BF_BOOST_LIB = 'boost_filesystem boost_regex boost_system boost_thread boost_date_time'
203 BF_BOOST_LIB_STATIC = '${BF_BOOST_LIBPATH}/libboost_filesystem.a ${BF_BOOST_LIBPATH}/libboost_date_time.a ' + \
204     '${BF_BOOST_LIBPATH}/libboost_regex.a ${BF_BOOST_LIBPATH}/libboost_locale.a ${BF_BOOST_LIBPATH}/libboost_system.a' + \
205     '${BF_BOOST_LIBPATH}/libboost_thread.a'
206 BF_BOOST_LIB_INTERNATIONAL = 'boost_locale'
207 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
208
209 WITH_BF_CYCLES = WITH_BF_OIIO and WITH_BF_BOOST
210
211 WITH_BF_CYCLES_CUDA_BINARIES = False
212 BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
213 BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
214
215 WITH_BF_OPENMP = True
216
217 #Ray trace optimization
218 WITH_BF_RAYOPTIMIZATION = True
219 BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-pthread']
220
221 #SpaceNavigator and friends
222 WITH_BF_3DMOUSE = True
223 WITH_BF_STATIC3DMOUSE = False
224 BF_3DMOUSE = '/usr'
225 BF_3DMOUSE_INC = '${BF_3DMOUSE}/include'
226 BF_3DMOUSE_LIBPATH = '${BF_3DMOUSE}/lib'
227 BF_3DMOUSE_LIB = 'spnav'
228 BF_3DMOUSE_LIB_STATIC = '${BF_3DMOUSE_LIBPATH}/libspnav.a'
229
230 #Freestyle
231 WITH_BF_FREESTYLE = True
232
233 ##
234 CC = 'gcc'
235 CXX = 'g++'
236
237 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
238 CXXFLAGS = []
239
240 CPPFLAGS = []
241 # g++ 4.6, only needed for bullet
242 CXXFLAGS += ['-fpermissive']
243 if WITH_BF_FFMPEG:
244     # libavutil needs UINT64_C()
245     CXXFLAGS += ['-D__STDC_CONSTANT_MACROS', ]
246 REL_CFLAGS = []
247 REL_CXXFLAGS = []
248 REL_CCFLAGS = ['-DNDEBUG', '-O2']
249
250 C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wunused-parameter', '-Wstrict-prototypes', '-Werror=declaration-after-statement', '-Werror=implicit-function-declaration', '-Werror=return-type']
251 CC_WARN = ['-Wall']
252 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
253
254 LLIBS = ['util', 'c', 'm', 'dl', 'pthread', 'stdc++']
255
256 BF_PROFILE = False
257 BF_PROFILE_CCFLAGS = ['-pg','-g']
258 BF_PROFILE_LINKFLAGS = ['-pg']
259
260 BF_DEBUG = False
261 BF_DEBUG_CCFLAGS = ['-g', '-D_DEBUG']
262
263 BF_BUILDDIR = '../build/linux'
264 BF_INSTALLDIR='../install/linux'
265
266 #Link against pthread
267 PLATFORM_LINKFLAGS = ['-pthread']
268
269 #Fix for LLVM conflict with Mesa llvmpipe
270 if WITH_BF_LLVM:
271     PLATFORM_LINKFLAGS += ['-Wl,--version-script=source/creator/blender.map']