OpenSubdiv: Commit of OpenSubdiv integration into Blender
[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.4'
30 WITH_OSX_STATICPYTHON = True
31
32 # python 3.4 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 = 'SDL2' #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 WITH_BF_JPEG = True
86 BF_JPEG = LIBDIR + '/jpeg'
87 BF_JPEG_INC = '${BF_JPEG}/include'
88 BF_JPEG_LIB = 'jpeg'
89 BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
90
91 WITH_BF_OPENJPEG = True
92 BF_OPENJPEG = '#extern/libopenjpeg'
93 BF_OPENJPEG_LIB = ''
94 BF_OPENJPEG_INC = '${BF_OPENJPEG}'
95 BF_OPENJPEG_LIBPATH='${BF_OPENJPEG}/lib'
96
97 WITH_BF_PNG = True
98 BF_PNG = LIBDIR + '/png'
99 BF_PNG_INC = '${BF_PNG}/include'
100 BF_PNG_LIB = 'png'
101 BF_PNG_LIBPATH = '${BF_PNG}/lib'
102
103 WITH_BF_TIFF = True
104 BF_TIFF = LIBDIR + '/tiff'
105 BF_TIFF_INC = '${BF_TIFF}/include'
106 BF_TIFF_LIB = 'tiff'
107 BF_TIFF_LIBPATH = '${BF_TIFF}/lib'
108
109 WITH_BF_ZLIB = True
110 BF_ZLIB = '/usr'
111 #BF_ZLIB_INC = '${BF_ZLIB}/include' # don't use this, it breaks -isysroot ${MACOSX_SDK}
112 BF_ZLIB_LIB = 'z'
113
114 WITH_BF_INTERNATIONAL = True
115
116 WITH_BF_GAMEENGINE = True
117 WITH_BF_PLAYER = True
118 WITH_BF_OCEANSIM = True
119
120 WITH_BF_BULLET = True
121 BF_BULLET = '#extern/bullet2/src'
122 BF_BULLET_INC = '${BF_BULLET}'
123 BF_BULLET_LIB = 'extern_bullet'
124
125 WITH_BF_FFTW3 = True
126 BF_FFTW3 = LIBDIR + '/fftw3'
127 BF_FFTW3_INC = '${BF_FFTW3}/include'
128 BF_FFTW3_LIB = 'libfftw3'
129 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
130
131 BF_FREETYPE = LIBDIR + '/freetype'
132 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
133 BF_FREETYPE_LIB = 'freetype'
134 BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
135
136 WITH_BF_QUICKTIME = True
137
138 WITH_BF_ICONV = True
139 BF_ICONV = '/usr'
140 BF_ICONV_INC = '${BF_ICONV}/include'
141 BF_ICONV_LIB = 'iconv'
142 #BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
143
144 # Mesa Libs should go here if your using them as well....
145 WITH_BF_STATICOPENGL = True
146 BF_OPENGL_LIB = 'GL GLU'
147 BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
148 BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
149
150 #OpenCollada flags
151 WITH_BF_COLLADA = True
152 BF_COLLADA = '#source/blender/collada'
153 BF_COLLADA_INC = '${BF_COLLADA}'
154 BF_COLLADA_LIB = 'bf_collada'
155 BF_OPENCOLLADA = LIBDIR + '/opencollada'
156 BF_OPENCOLLADA_INC = '${BF_OPENCOLLADA}/include'
157 BF_OPENCOLLADA_LIB = 'OpenCOLLADASaxFrameworkLoader OpenCOLLADAFramework OpenCOLLADABaseUtils OpenCOLLADAStreamWriter MathMLSolver GeneratedSaxParser xml2 buffer ftoa'
158 BF_OPENCOLLADA_LIBPATH = LIBDIR + '/opencollada'
159 BF_PCRE = LIBDIR + '/opencollada'
160 BF_PCRE_LIB = 'pcre'
161 BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
162 #BF_EXPAT = '/usr'
163 #BF_EXPAT_LIB = 'expat'
164 #BF_EXPAT_LIBPATH = '/usr/lib'
165
166 # Cycles
167 WITH_BF_CYCLES = True
168
169 #OSL
170
171 WITH_BF_CYCLES_OSL = True
172 BF_OSL = LIBDIR + '/osl'
173 BF_OSL_INC = '${BF_OSL}/include'
174 # note oslexec would passed via program linkflags, which is needed to
175 # make llvm happy with osl_allocate_closure_component
176 #BF_OSL_LIB = 'oslcomp oslquery'
177 BF_OSL_LIBPATH = '${BF_OSL}/lib'
178 BF_OSL_COMPILER = '${BF_OSL}/bin/oslc'
179
180 WITH_BF_LLVM = True
181 BF_LLVM = LIBDIR + '/llvm'
182 BF_LLVM_LIB = 'LLVMBitReader LLVMJIT LLVMipo LLVMVectorize LLVMBitWriter LLVMX86CodeGen LLVMX86Desc LLVMX86Info LLVMX86AsmPrinter ' + \
183     'LLVMX86Utils LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMInstCombine LLVMTransformUtils LLVMipa LLVMAnalysis LLVMExecutionEngine ' + \
184     'LLVMTarget LLVMMC LLVMCore LLVMSupport LLVMObject'
185 BF_LLVM_LIBPATH = '${BF_LLVM}/lib'
186
187 WITH_BF_OIIO = True
188 BF_OIIO = LIBDIR + '/openimageio'
189 BF_OIIO_INC = '${BF_OIIO}/include'
190 BF_OIIO_LIB = 'OpenImageIO'
191 BF_OIIO_LIBPATH = '${BF_OIIO}/lib'
192
193 WITH_BF_OCIO = True
194 BF_OCIO = LIBDIR + '/opencolorio'
195 BF_OCIO_INC = '${BF_OCIO}/include'
196 BF_OCIO_LIB = 'OpenColorIO tinyxml yaml-cpp'
197 BF_OCIO_LIBPATH = '${BF_OCIO}/lib'
198
199 WITH_BF_BOOST = True
200 BF_BOOST = LIBDIR + '/boost'
201 BF_BOOST_INC = '${BF_BOOST}/include'
202 BF_BOOST_LIB = 'boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt boost_wave-mt'
203 BF_BOOST_LIB_INTERNATIONAL = 'boost_locale-mt'
204 BF_BOOST_LIBPATH = '${BF_BOOST}/lib'
205
206 WITH_BF_CYCLES_CUDA_BINARIES = False
207 BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
208 BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_20', 'sm_21', 'sm_30', 'sm_35', 'sm_50', 'sm_52']
209
210 #Freestyle
211 WITH_BF_FREESTYLE = True
212
213 #OpenMP ( will be checked for compiler support and turned off eventually )
214 WITH_BF_OPENMP = True
215
216 WITH_BF_OPENSUBDIV = False
217 BF_OPENSUBDIV = LIBDIR + '/opensubdiv'
218 BF_OPENSUBDIV_INC = '${BF_OPENSUBDIV}/include'
219 BF_OPENSUBDIV_LIB = 'osdCPU osdGPU'
220 BF_OPENSUBDIV_LIBPATH = '${BF_OPENSUBDIV}/lib'
221
222 #Ray trace optimization
223 WITH_BF_RAYOPTIMIZATION = True
224 BF_RAYOPTIMIZATION_SSE_FLAGS = []
225
226 # SpaceNavigator and related 3D mice, driver must be 3DxWare 10 Beta 4 (Mac OS X) or later !
227 WITH_BF_3DMOUSE = True
228
229 #############################################################################
230 ###################  various compile settings and flags    ##################
231 #############################################################################
232
233 BF_QUIET = '1' # suppress verbose output
234
235 CFLAGS = []
236 CXXFLAGS = []
237 CCFLAGS = ['-pipe','-funsigned-char']
238 CPPFLAGS = []
239
240 PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']
241
242 LLIBS = ['stdc++']
243
244 REL_CFLAGS = []
245 REL_CXXFLAGS = []
246 REL_CCFLAGS = ['-O2']
247
248 CC_WARN = ['-Wall']
249 C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']
250 CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
251
252 ##FIX_STUBS_WARNINGS = -Wno-unused
253
254 ##LOPTS = --dynamic
255 ##DYNLDFLAGS = -shared $(LDFLAGS)
256
257 BF_PROFILE_CCFLAGS = ['-pg', '-g ']
258 BF_PROFILE_LINKFLAGS = ['-pg']
259 BF_PROFILE = False
260
261 BF_DEBUG = False
262 BF_DEBUG_CCFLAGS = ['-g']
263
264 #############################################################################
265 ###################           Output directories           ##################
266 #############################################################################
267
268 BF_BUILDDIR='../build/darwin'
269 BF_INSTALLDIR='../install/darwin'