09dc32f082ad3e7c97c74f52ed2d7a753546b5aa
[blender.git] / build_files / scons / config / darwin-config.py
1 import commands
2
3 #############################################################################
4 ###################     Compiler & architecture settings      ##################
5 #############################################################################
6
7 MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
8 MACOSX_SDK='' # set an sdk name like '10.7' or leave empty for automatic choosing highest available
9 MACOSX_DEPLOYMENT_TARGET = '10.6'
10
11 # gcc always defaults to the system standard compiler linked by a shim or symlink
12 CC = 'gcc'
13 CXX = 'g++'
14 LCGDIR = '#../lib/darwin-9.x.universal'
15 LIBDIR = '${LCGDIR}'
16
17 #############################################################################
18 ###################          Dependency settings           ##################
19 #############################################################################
20
21 # enable ffmpeg  support
22 WITH_BF_FFMPEG = True
23 BF_FFMPEG = LIBDIR + '/ffmpeg'
24 BF_FFMPEG_INC = "${BF_FFMPEG}/include"
25 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
26 BF_FFMPEG_LIB = 'avcodec avdevice avformat avutil mp3lame swscale x264 xvidcore theora theoradec theoraenc vorbis vorbisenc vorbisfile ogg bz2'
27 #bz2 is a standard osx dynlib
28
29 BF_PYTHON_VERSION = '3.3'
30 WITH_OSX_STATICPYTHON = True
31
32 # python 3.3 uses precompiled libraries in bf svn /lib by default
33 BF_PYTHON = LIBDIR + '/python'
34 BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}m'
35 # BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
36 BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}m'
37 BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
38 # BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
39
40 WITH_BF_OPENAL = True
41 BF_OPENAL = LIBDIR + '/openal'
42
43 WITH_BF_STATICOPENAL = False
44 BF_OPENAL_INC = '${BF_OPENAL}/include' # only headers from libdir needed for proper use of framework !!!!
45 #BF_OPENAL_LIB = 'openal'
46 #BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
47 # Warning, this static lib configuration is untested! users of this OS please confirm.
48 #BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
49
50 # Warning, this static lib configuration is untested! users of this OS please confirm.
51 BF_CXX = '/usr'
52 WITH_BF_STATICCXX = False
53 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
54
55 # we use simply jack framework
56 WITH_BF_JACK = True
57 BF_JACK = '/Library/Frameworks/Jackmp.framework'
58 BF_JACK_INC = '${BF_JACK}/headers'
59 #BF_JACK_LIB = 'jack' # not used due framework
60 BF_JACK_LIBPATH = '${BF_JACK}'
61
62 WITH_BF_SNDFILE = True
63 BF_SNDFILE = LIBDIR + '/sndfile'
64 BF_SNDFILE_INC = '${BF_SNDFILE}/include'
65 BF_SNDFILE_LIB = 'sndfile FLAC ogg vorbis vorbisenc'
66 BF_SNDFILE_LIBPATH = '${BF_SNDFILE}/lib ${BF_FFMPEG}/lib' #ogg libs are stored in ffmpeg dir
67
68 WITH_BF_SDL = True
69 BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
70 BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
71 BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
72 BF_SDL_LIBPATH = '${BF_SDL}/lib'
73
74 WITH_BF_OPENEXR = True
75 WITH_BF_STATICOPENEXR = False
76 BF_OPENEXR = '${LCGDIR}/openexr'
77 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
78 BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
79 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
80 # Warning, this static lib configuration is untested! users of this OS please confirm.
81 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'
82
83 WITH_BF_DDS = True
84
85 #Color Management System
86 WITH_BF_LCMS = False
87 BF_LCMS = LIBDIR + '/lcms'
88 BF_LCMS_INC = '${BF_LCMS}/include'
89 BF_LCMS_LIB = 'lcms'
90 BF_LCMS_LIBPATH = '${BF_LCMS}/lib'
91
92 WITH_BF_JPEG = True
93 BF_JPEG = LIBDIR + '/jpeg'
94 BF_JPEG_INC = '${BF_JPEG}/include'
95 BF_JPEG_LIB = 'jpeg'
96 BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
97
98 WITH_BF_PNG = True
99 BF_PNG = LIBDIR + '/png'
100 BF_PNG_INC = '${BF_PNG}/include'
101 BF_PNG_LIB = 'png'
102 BF_PNG_LIBPATH = '${BF_PNG}/lib'
103
104 WITH_BF_TIFF = True
105 BF_TIFF = LIBDIR + '/tiff'
106 BF_TIFF_INC = '${BF_TIFF}/include'
107 BF_TIFF_LIB = 'tiff'
108 BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
109
110 WITH_BF_ZLIB = True
111 BF_ZLIB = '/usr'
112 BF_ZLIB_INC = '${BF_ZLIB}/include'
113 BF_ZLIB_LIB = 'z'
114
115 WITH_BF_INTERNATIONAL = True
116
117 WITH_BF_GAMEENGINE = True
118 WITH_BF_PLAYER = True
119 WITH_BF_OCEANSIM = True
120
121 WITH_BF_BULLET = True
122 BF_BULLET = '#extern/bullet2/src'
123 BF_BULLET_INC = '${BF_BULLET}'
124 BF_BULLET_LIB = 'extern_bullet'
125
126 WITH_BF_FFTW3 = True
127 BF_FFTW3 = LIBDIR + '/fftw3'
128 BF_FFTW3_INC = '${BF_FFTW3}/include'
129 BF_FFTW3_LIB = 'libfftw3'
130 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
131
132 BF_FREETYPE = LIBDIR + '/freetype'
133 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
134 BF_FREETYPE_LIB = 'freetype'
135 BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
136
137 WITH_BF_QUICKTIME = True
138
139 WITH_BF_ICONV = True
140 BF_ICONV = '/usr'
141 BF_ICONV_INC = '${BF_ICONV}/include'
142 BF_ICONV_LIB = 'iconv'
143 #BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
144
145 # Mesa Libs should go here if your using them as well....
146 WITH_BF_STATICOPENGL = True
147 BF_OPENGL_LIB = 'GL GLU'
148 BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
149 BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
150
151 #OpenCollada flags
152 WITH_BF_COLLADA = True
153 BF_COLLADA = '#source/blender/collada'
154 BF_COLLADA_INC = '${BF_COLLADA}'
155 BF_COLLADA_LIB = 'bf_collada'
156 BF_OPENCOLLADA = LIBDIR + '/opencollada'
157 BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
158 BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser UTF xml2 buffer ftoa'
159 BF_OPENCOLLADA_LIBPATH = LIBDIR + '/opencollada'
160 BF_PCRE = LIBDIR + '/opencollada'
161 BF_PCRE_LIB = 'pcre'
162 BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
163 #BF_EXPAT = '/usr'
164 #BF_EXPAT_LIB = 'expat'
165 #BF_EXPAT_LIBPATH = '/usr/lib'
166
167 # Cycles
168 WITH_BF_CYCLES = True
169
170 #OSL
171
172 WITH_BF_CYCLES_OSL = True
173 BF_OSL = LIBDIR + '/osl'
174 BF_OSL_INC = '${BF_OSL}/include'
175 # note oslexec would passed via program linkflags, which is needed to
176 # make llvm happy with osl_allocate_closure_component
177 #BF_OSL_LIB = 'oslcomp oslquery'
178 BF_OSL_LIBPATH = '${BF_OSL}/lib'
179 BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
180
181 WITH_BF_LLVM = True
182 BF_LLVM = LIBDIR + '/llvm'
183 BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
184     'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
185     'LLVMTarget LLVMMC LLVMCore LLVMSupport'
186 BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
187
188 WITH_BF_OIIO = True
189 BF_OIIO = LIBDIR + '/openimageio'
190 BF_OIIO_INC = '${BF_OIIO}/include'
191 BF_OIIO_LIB = 'OpenImageIO'
192 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
193
194 WITH_BF_OCIO = True
195 BF_OCIO = LIBDIR + '/opencolorio'
196 BF_OCIO_INC = '${BF_OCIO}/include'
197 BF_OCIO_LIB = 'OpenColorIO tinyxml yaml-cpp'
198 BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
199
200 WITH_BF_BOOST = True
201 BF_BOOST = LIBDIR + '/boost'
202 BF_BOOST_INC = '${BF_BOOST}/include'
203 BF_BOOST_LIB = 'boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt boost_wave-mt'
204 BF_BOOST_LIB_INTERNATIONAL = 'boost_locale-mt'
205 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
206
207 WITH_BF_CYCLES_CUDA_BINARIES = False
208 BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
209 BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35']
210
211 #Freestyle
212 WITH_BF_FREESTYLE = True
213
214 #OpenMP ( will be checked for compiler support and turned off eventually )
215 WITH_BF_OPENMP = True
216
217 #Ray trace optimization
218 WITH_BF_RAYOPTIMIZATION = True
219 BF_RAYOPTIMIZATION_SSE_FLAGS = []
220
221 # SpaceNavigator and related 3D mice, driver must be 3DxWare 10 Beta 4 (Mac OS X) or later !
222 WITH_BF_3DMOUSE = True
223
224 #############################################################################
225 ###################  various compile settings and flags    ##################
226 #############################################################################
227
228 BF_QUIET = '1' # suppress verbose output
229
230 CFLAGS = []
231 CXXFLAGS = []
232 CCFLAGS = ['-pipe','-funsigned-char']
233 CPPFLAGS = []
234
235 PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']
236
237 LLIBS = ['stdc++']
238
239 REL_CFLAGS = []
240 REL_CXXFLAGS = []
241 REL_CCFLAGS = ['-DNDEBUG', '-O2']
242
243 CC_WARN = ['-Wall']
244 C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']
245 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
246
247 ##FIX_STUBS_WARNINGS = -Wno-unused
248
249 ##LOPTS = --dynamic
250 ##DYNLDFLAGS = -shared $(LDFLAGS)
251
252 BF_PROFILE_CCFLAGS = ['-pg', '-g ']
253 BF_PROFILE_LINKFLAGS = ['-pg']
254 BF_PROFILE = False
255
256 BF_DEBUG = False
257 BF_DEBUG_CCFLAGS = ['-g', '-D_DEBUG']
258
259 #############################################################################
260 ###################           Output directories           ##################
261 #############################################################################
262
263 BF_BUILDDIR='../build/darwin'
264 BF_INSTALLDIR='../install/darwin'