Quicktime: remove backend with the old quicktime API, and keep the QTKit backend.
[blender-staging.git] / build_files / buildbot / config / user-config-mac-i386.py
1 #
2 # Note : if you want to alter this file
3 # copy it as a whole in the upper folder
4 # as user-config.py
5 # dont create a new file with only some
6 # vars changed.
7
8 import commands
9
10 # IMPORTANT NOTE : OFFICIAL BUILDS SHOULD BE DONE WITH SDKs
11 USE_SDK=True
12
13 #############################################################################
14 ###################     Cocoa & architecture settings      ##################
15 #############################################################################
16
17 MACOSX_ARCHITECTURE = 'i386' # valid archs: ppc, i386, ppc64, x86_64
18
19
20 cmd = 'uname -p'
21 MAC_PROC=commands.getoutput(cmd)
22 cmd = 'uname -r'
23 cmd_res=commands.getoutput(cmd)
24
25 if cmd_res[:1]=='9':
26     MAC_CUR_VER='10.5'
27 elif cmd_res[:2]=='10':
28     MAC_CUR_VER='10.6'
29 elif cmd_res[:2]=='11':
30     MAC_CUR_VER='10.7'
31 elif cmd_res[:2]=='12':
32     MAC_CUR_VER='10.8'
33 elif cmd_res[:2]=='13':
34     MAC_CUR_VER='10.9'
35 cmd = 'xcodebuild -version'
36 cmd_xcode=commands.getoutput(cmd)
37 XCODE_CUR_VER=cmd_xcode[6:][:3] # truncate output to major.minor version
38 cmd = 'xcodebuild -showsdks'
39 cmd_sdk=commands.getoutput(cmd)
40 MACOSX_SDK_CHECK=cmd_sdk
41 cmd = 'xcode-select --print-path'
42 XCODE_SELECT_PATH=commands.getoutput(cmd)
43 if XCODE_SELECT_PATH.endswith("/Contents/Developer"):
44         XCODE_BUNDLE=XCODE_SELECT_PATH[:-19]
45 else:
46         XCODE_BUNDLE=XCODE_SELECT_PATH
47
48
49 # Default target OSX settings per architecture
50 # Can be customized
51
52 if 'Mac OS X 10.5' in MACOSX_SDK_CHECK:
53         # OSX 10.5/6 with Xcode 3.x
54         MAC_MIN_VERS = '10.5'
55         MACOSX_DEPLOYMENT_TARGET = '10.5'
56         MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
57         LCGDIR = '#../lib/darwin-9.x.universal'
58         CC = 'gcc-4.2'
59         CXX = 'g++-4.2'
60 elif 'Mac OS X 10.6' in MACOSX_SDK_CHECK:
61         # OSX 10.6/7 with Xcode 4.x
62         MAC_MIN_VERS = '10.6'
63         MACOSX_DEPLOYMENT_TARGET = '10.6'
64         MACOSX_SDK='/Developer/SDKs/MacOSX10.6.sdk'
65         LCGDIR = '#../lib/darwin-9.x.universal'
66         CC = 'gcc-4.2'
67         CXX = 'g++-4.2'
68 else:
69         # OSX 10.8 with Xcode 4.4 and higher (no 10.6sdk! )
70         MAC_MIN_VERS = '10.6'
71         MACOSX_DEPLOYMENT_TARGET = '10.6'
72         MACOSX_SDK='/Developer/SDKs/MacOSX10.8.sdk'
73         LCGDIR = '#../lib/darwin-9.x.universal'
74         CC = 'gcc'
75         CXX = 'g++'
76
77 LIBDIR = '${LCGDIR}'
78
79 if XCODE_CUR_VER >= '4.3':  ## since version 4.3, XCode and developer dir are bundled ##
80         MACOSX_SDK = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform' + MACOSX_SDK
81
82 #############################################################################
83 ###################          Dependency settings           ##################
84 #############################################################################
85
86 #Defaults openMP to true if compiler handles it ( only gcc 4.6.1 and newer )
87 # if your compiler does not have accurate suffix you may have to enable it by hand !
88 if CC[:-2].endswith('4.6'):
89     WITH_BF_OPENMP = True  # multithreading for fluids, cloth, sculpt and smoke
90 else:
91     WITH_BF_OPENMP = False
92
93 # enable ffmpeg  support
94 WITH_BF_FFMPEG = True
95 BF_FFMPEG = LIBDIR + '/ffmpeg'
96 BF_FFMPEG_INC = "${BF_FFMPEG}/include"
97 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
98 BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg bz2'
99 #bz2 is a standard osx dynlib
100
101 BF_PYTHON_VERSION = '3.3'
102 WITH_OSX_STATICPYTHON = True
103
104 if WITH_OSX_STATICPYTHON:
105     # python 3.3 uses precompiled libraries in bf svn /lib by default
106
107     BF_PYTHON = LIBDIR + '/python'
108     BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}m'
109     # BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
110     BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}m'
111     BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
112     # BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
113 else:
114     # python 3.2 uses Python-framework additionally installed in /Library/Frameworks
115
116     BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
117     BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}m'
118     BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
119     #BF_PYTHON_LIB = ''
120     BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config-${BF_PYTHON_VERSION}m'
121
122 WITH_BF_OPENAL = True
123 #different lib must be used  following version of gcc
124 # for gcc 3.3
125 #BF_OPENAL = LIBDIR + '/openal'
126 # for gcc 3.4 and ulterior
127 if MAC_PROC == 'powerpc':
128     BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal'
129 else :
130     BF_OPENAL = LIBDIR + '/openal'
131
132 WITH_BF_STATICOPENAL = False
133 BF_OPENAL_INC = '${BF_OPENAL}/include' # only headers from libdir needed for proper use of framework !!!!
134 #BF_OPENAL_LIB = 'openal'
135 #BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
136 # Warning, this static lib configuration is untested! users of this OS please confirm.
137 #BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
138
139 # Warning, this static lib configuration is untested! users of this OS please confirm.
140 BF_CXX = '/usr'
141 WITH_BF_STATICCXX = False
142 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
143
144 # we use simply jack framework
145 WITH_BF_JACK = True
146 BF_JACK = '/Library/Frameworks/Jackmp.framework'
147 BF_JACK_INC = '${BF_JACK}/headers'
148 #BF_JACK_LIB = 'jack' # not used due framework
149 BF_JACK_LIBPATH = '${BF_JACK}'
150
151 WITH_BF_SNDFILE = True
152 BF_SNDFILE = LIBDIR + '/sndfile'
153 BF_SNDFILE_INC = '${BF_SNDFILE}/include'
154 BF_SNDFILE_LIB = 'sndfile FLAC ogg vorbis vorbisenc'
155 BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib ${BF_FFMPEG}/lib' #ogg libs are stored in ffmpeg dir
156
157 WITH_BF_SDL = True
158 BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
159 BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
160 BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
161 BF_SDL_LIBPATH = '${BF_SDL}/lib'
162
163 WITH_BF_OPENEXR = True
164 WITH_BF_STATICOPENEXR = False
165 BF_OPENEXR = '${LCGDIR}/openexr'
166 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
167 BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
168 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
169 # Warning, this static lib configuration is untested! users of this OS please confirm.
170 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'
171
172 WITH_BF_DDS = True
173
174 #Color Management System
175 WITH_BF_LCMS = False
176 BF_LCMS = LIBDIR + '/lcms'
177 BF_LCMS_INC = '${BF_LCMS}/include'
178 BF_LCMS_LIB = 'lcms'
179 BF_LCMS_LIBPATH = '${BF_LCMS}/lib'
180
181 WITH_BF_JPEG = True
182 BF_JPEG = LIBDIR + '/jpeg'
183 BF_JPEG_INC = '${BF_JPEG}/include'
184 BF_JPEG_LIB = 'jpeg'
185 BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
186
187 WITH_BF_PNG = True
188 BF_PNG = LIBDIR + '/png'
189 BF_PNG_INC = '${BF_PNG}/include'
190 BF_PNG_LIB = 'png'
191 BF_PNG_LIBPATH = '${BF_PNG}/lib'
192
193 WITH_BF_TIFF = True
194 BF_TIFF = LIBDIR + '/tiff'
195 BF_TIFF_INC = '${BF_TIFF}/include'
196 BF_TIFF_LIB = 'tiff'
197 BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
198
199 WITH_BF_ZLIB = True
200 BF_ZLIB = '/usr'
201 BF_ZLIB_INC = '${BF_ZLIB}/include'
202 BF_ZLIB_LIB = 'z'
203
204 WITH_BF_INTERNATIONAL = True
205
206 WITH_BF_GAMEENGINE = True
207 WITH_BF_PLAYER = True
208 WITH_BF_OCEANSIM = True
209
210 WITH_BF_BULLET = True
211 BF_BULLET = '#extern/bullet2/src'
212 BF_BULLET_INC = '${BF_BULLET}'
213 BF_BULLET_LIB = 'extern_bullet'
214
215 WITH_BF_FFTW3 = True
216 BF_FFTW3 = LIBDIR + '/fftw3'
217 BF_FFTW3_INC = '${BF_FFTW3}/include'
218 BF_FFTW3_LIB = 'libfftw3'
219 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
220
221 BF_FREETYPE = LIBDIR + '/freetype'
222 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
223 BF_FREETYPE_LIB = 'freetype'
224 BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
225
226 WITH_BF_QUICKTIME = True
227
228 WITH_BF_ICONV = True
229 BF_ICONV = '/usr'
230 BF_ICONV_INC = '${BF_ICONV}/include'
231 BF_ICONV_LIB = 'iconv'
232 #BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
233
234 # Mesa Libs should go here if your using them as well....
235 WITH_BF_STATICOPENGL = True
236 BF_OPENGL_LIB = 'GL GLU'
237 BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
238 BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
239
240 #OpenCollada flags
241 WITH_BF_COLLADA = True
242 BF_COLLADA = '#source/blender/collada'
243 BF_COLLADA_INC = '${BF_COLLADA}'
244 BF_COLLADA_LIB = 'bf_collada'
245 BF_OPENCOLLADA = LIBDIR + '/opencollada'
246 BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
247 BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa'
248 BF_OPENCOLLADA_LIBPATH = LIBDIR + '/opencollada'
249 BF_PCRE = LIBDIR + '/opencollada'
250 BF_PCRE_LIB = 'pcre'
251 BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
252 #BF_EXPAT = '/usr'
253 #BF_EXPAT_LIB = 'expat'
254 #BF_EXPAT_LIBPATH = '/usr/lib'
255
256 # Cycles
257 WITH_BF_CYCLES = True
258
259 #OSL
260
261 WITH_BF_CYCLES_OSL = True
262 BF_OSL = LIBDIR + '/osl'
263 BF_OSL_INC = '${BF_OSL}/include'
264 # note oslexec would passed via program linkflags, which is needed to
265 # make llvm happy with osl_allocate_closure_component
266 #BF_OSL_LIB = 'oslcomp oslquery'
267 BF_OSL_LIBPATH = '${BF_OSL}/lib'
268 BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
269
270 WITH_BF_LLVM = True
271 BF_LLVM = LIBDIR + '/llvm'
272 BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
273     'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
274     'LLVMTarget LLVMMC LLVMCore LLVMSupport'
275 BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
276
277 WITH_BF_OIIO = True
278 BF_OIIO = LIBDIR + '/openimageio'
279 BF_OIIO_INC = '${BF_OIIO}/include'
280 BF_OIIO_LIB = 'OpenImageIO'
281 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
282
283 WITH_BF_OCIO = True
284 BF_OCIO = LIBDIR + '/opencolorio'
285 BF_OCIO_INC = '${BF_OCIO}/include'
286 BF_OCIO_LIB = 'OpenColorIO tinyxml yaml-cpp'
287 BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
288
289 WITH_BF_BOOST = True
290 BF_BOOST = LIBDIR + '/boost'
291 BF_BOOST_INC = '${BF_BOOST}/include'
292 BF_BOOST_LIB = 'boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt boost_wave-mt'
293 BF_BOOST_LIB_INTERNATIONAL = 'boost_locale-mt'
294 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
295
296 WITH_BF_CYCLES_CUDA_BINARIES = True
297 BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
298 BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
299
300 #Freestyle
301 WITH_BF_FREESTYLE = True
302
303 #Ray trace optimization
304 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'i386':
305     WITH_BF_RAYOPTIMIZATION = True
306 else:
307     WITH_BF_RAYOPTIMIZATION = False
308 if MACOSX_ARCHITECTURE == 'i386':
309     BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse']
310 elif MACOSX_ARCHITECTURE == 'x86_64':
311     BF_RAYOPTIMIZATION_SSE_FLAGS = ['-msse','-msse2']
312
313 # SpaceNavigator and related 3D mice, driver must be 3DxWare 10 Beta 4 (Mac OS X) or later !
314 WITH_BF_3DMOUSE = True
315
316 #############################################################################
317 ###################  various compile settings and flags    ##################
318 #############################################################################
319
320 BF_QUIET = '1' # suppress verbose output
321
322 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
323     ARCH_FLAGS = ['-m64']
324 else:
325     ARCH_FLAGS = ['-m32']
326
327 CFLAGS = []
328 CXXFLAGS = []
329 CCFLAGS = ['-pipe','-funsigned-char']
330
331 CPPFLAGS = list(ARCH_FLAGS)
332
333 PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
334
335 if WITH_BF_QUICKTIME:
336     PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QTKit']
337
338 if not WITH_OSX_STATICPYTHON:
339     PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','Python']
340
341
342 #for > 10.7.sdk, SystemStubs needs to be excluded (lib doesn't exist anymore)
343 if MACOSX_SDK.endswith("10.7.sdk") or MACOSX_SDK.endswith("10.8.sdk") or MACOSX_SDK.endswith("10.9.sdk"):
344     LLIBS = ['stdc++']
345 else:
346     LLIBS = ['stdc++', 'SystemStubs']
347
348 if USE_SDK:
349     SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS,'-arch',MACOSX_ARCHITECTURE]
350     PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS,'-Wl','-isysroot',MACOSX_SDK,'-arch',MACOSX_ARCHITECTURE]+PLATFORM_LINKFLAGS
351     CCFLAGS=SDK_FLAGS+CCFLAGS
352     CXXFLAGS=SDK_FLAGS+CXXFLAGS
353
354 #Intel Macs are CoreDuo and Up
355 if MACOSX_ARCHITECTURE == 'i386' or MACOSX_ARCHITECTURE == 'x86_64':
356     REL_CFLAGS = []
357     REL_CXXFLAGS = []
358     REL_CCFLAGS = ['-DNDEBUG', '-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mfpmath=sse']
359 else:
360     CCFLAGS += ['-fno-strict-aliasing']
361     REL_CFLAGS = []
362     REL_CXXFLAGS = []
363     REL_CCFLAGS = ['-DNDEBUG', '-O2']
364
365 # Intel 64bit Macs are Core2Duo and up
366 if MACOSX_ARCHITECTURE == 'x86_64':
367     REL_CCFLAGS += ['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
368
369 CC_WARN = ['-Wall']
370 C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']
371 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
372
373 ##FIX_STUBS_WARNINGS = -Wno-unused
374
375 ##LOPTS = --dynamic
376 ##DYNLDFLAGS = -shared $(LDFLAGS)
377
378 BF_PROFILE_CCFLAGS = ['-pg', '-g ']
379 BF_PROFILE_LINKFLAGS = ['-pg']
380 BF_PROFILE = False
381
382 BF_DEBUG = False
383 BF_DEBUG_CCFLAGS = ['-g', '-D_DEBUG']
384
385 #############################################################################
386 ###################           Output directories           ##################
387 #############################################################################
388
389 BF_BUILDDIR='../build/darwin'
390 BF_INSTALLDIR='../install/darwin'