FFmpeg upgrade to revision 12758 (avformat version 52.13): support libavdevice for...
[blender.git] / config / darwin-config.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 BF_PYTHON_VERSION = '2.3'
14
15 cmd = 'uname -p'
16 MAC_PROC=commands.getoutput(cmd) 
17 cmd = 'uname -r'
18 cmd_res=commands.getoutput(cmd) 
19 if cmd_res[0]=='7':
20         MAC_CUR_VER='10.3'
21 elif cmd_res[0]=='8':
22         MAC_CUR_VER='10.4'
23 else:
24         MAC_CUR_VER='10.5'
25
26 if MAC_PROC == 'powerpc':
27         LCGDIR = '#../lib/darwin-6.1-powerpc'
28 else :
29         LCGDIR = '#../lib/darwin-8.x.i386'
30 LIBDIR = '${LCGDIR}'
31
32 if MAC_PROC== 'powerpc' and BF_PYTHON_VERSION == '2.3':
33         MAC_MIN_VERS = '10.3'
34         MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
35 else:
36         MAC_MIN_VERS = '10.4'
37         MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
38
39
40 # enable ffmpeg  support
41 WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
42 BF_FFMPEG = "#extern/ffmpeg"
43 # trick : The version of ffmpeg in extern/ffmpeg uses explicit libav.. directory in #include statements
44 #         To keep Blender compatible with older versions, I add ${BF_FFMPEG} to the inc dir so that ffmpeg
45 #         finds the files directly in extern/ffmpeg/libav... while blender finds them in
46 #         extern/ffmpeg/include. 
47 BF_FFMPEG_INC = '${BF_FFMPEG}/include ${BF_FFMPEG}'
48 if USE_SDK==True:
49         BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS
50 #BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
51 #BF_FFMPEG_LIB = 'avformat.a avcodec.a avutil.a'
52
53 WITH_BF_VERSE = False
54 BF_VERSE = "#extern/verse/dist"
55 BF_VERSE_LIBPATH = "${BF_BUILDDIR}/extern/verse/dist"
56 BF_VERSE_INCLUDE = BF_VERSE
57 BF_VERSE_LIBS = "libverse"
58
59 # python.org libs install in /library we want to use that for 2.5 
60 #
61 # if you want py2.5 on leopard without installing
62 # change value to BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
63 # BEWARE: in that case it will work only on leopard
64
65 if BF_PYTHON_VERSION=='2.3':
66         BF_PYTHON = '/System/Library/Frameworks/Python.framework/Versions/'
67 else:
68         BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
69
70 BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}'
71 BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}'
72 BF_PYTHON_LIB = ''
73 BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config'
74 BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System -framework Python'
75 if MAC_CUR_VER=='10.3' or  MAC_CUR_VER=='10.4':
76         BF_PYTHON_LINKFLAGS ='-u __dummy '+BF_PYTHON_LINKFLAGS
77         
78 BF_QUIET = '1'
79 WITH_BF_OPENMP = '0'
80
81 # Note : should be true, but openal simply dont work on intel
82 if MAC_PROC == 'i386':
83         WITH_BF_OPENAL = False
84 else:
85         WITH_BF_OPENAL = True
86 #different lib must be used  following version of gcc
87 # for gcc 3.3
88 #BF_OPENAL = LIBDIR + '/openal'
89 # for gcc 3.4 and ulterior
90 if MAC_PROC == 'powerpc':
91         BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal'
92 else :
93         BF_OPENAL = LIBDIR + '/openal'
94
95 WITH_BF_STATICOPENAL = False
96 BF_OPENAL_INC = '${BF_OPENAL}/include'
97 BF_OPENAL_LIB = 'openal'
98 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
99 # Warning, this static lib configuration is untested! users of this OS please confirm.
100 BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
101
102 # Warning, this static lib configuration is untested! users of this OS please confirm.
103 BF_CXX = '/usr'
104 WITH_BF_STATICCXX = False
105 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
106
107 WITH_BF_SDL = True
108 BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
109 BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
110 BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
111 BF_SDL_LIBPATH = '${BF_SDL}/lib'
112
113 WITH_BF_FMOD = False
114 BF_FMOD = LIBDIR + '/fmod'
115
116 WITH_BF_OPENEXR = True
117 WITH_BF_STATICOPENEXR = False
118 BF_OPENEXR = '${LCGDIR}/openexr'
119 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
120 BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
121 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
122 # Warning, this static lib configuration is untested! users of this OS please confirm.
123 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'
124
125 WITH_BF_DDS = True
126
127 WITH_BF_JPEG = True
128 BF_JPEG = LIBDIR + '/jpeg'
129 BF_JPEG_INC = '${BF_JPEG}/include'
130 BF_JPEG_LIB = 'jpeg'
131 BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
132
133 WITH_BF_PNG = True
134 BF_PNG = LIBDIR + '/png'
135 BF_PNG_INC = '${BF_PNG}/include'
136 BF_PNG_LIB = 'png'
137 BF_PNG_LIBPATH = '${BF_PNG}/lib'
138
139 BF_TIFF = LIBDIR + '/tiff'
140 BF_TIFF_INC = '${BF_TIFF}/include'
141
142 WITH_BF_ZLIB = True
143 BF_ZLIB = '/usr'
144 BF_ZLIB_INC = '${BF_ZLIB}/include'
145 BF_ZLIB_LIB = 'z'
146
147 WITH_BF_INTERNATIONAL = True
148
149 BF_GETTEXT = LIBDIR + '/gettext'
150 BF_GETTEXT_INC = '${BF_GETTEXT}/include'
151 BF_GETTEXT_LIB = 'intl'
152 BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
153
154 WITH_BF_FTGL = True
155 BF_FTGL = '#extern/bFTGL'
156 BF_FTGL_INC = '${BF_FTGL}/include'
157 BF_FTGL_LIB = 'extern_ftgl'
158
159 WITH_BF_GAMEENGINE=True
160 WITH_BF_PLAYER=True
161
162 WITH_BF_ODE = False
163 BF_ODE = LIBDIR + '/ode'
164 BF_ODE_INC = '${BF_ODE}/include'
165 BF_ODE_LIB = '${BF_ODE}/lib/libode.a'
166
167 WITH_BF_BULLET = True
168 BF_BULLET = '#extern/bullet2/src'
169 BF_BULLET_INC = '${BF_BULLET}'
170 BF_BULLET_LIB = 'extern_bullet'
171
172 BF_SOLID = '#extern/solid'
173 BF_SOLID_INC = '${BF_SOLID}'
174 BF_SOLID_LIB = 'extern_solid'
175
176 WITH_BF_YAFRAY = True
177
178 #WITH_BF_NSPR = True
179 #BF_NSPR = $(LIBDIR)/nspr
180 #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
181 #BF_NSPR_LIB = 
182
183 # Uncomment the following line to use Mozilla inplace of netscape
184 #CPPFLAGS += -DMOZ_NOT_NET
185 # Location of MOZILLA/Netscape header files...
186 #BF_MOZILLA = $(LIBDIR)/mozilla
187 #BF_MOZILLA_INC = -I$(BF_MOZILLA)/include/mozilla/nspr -I$(BF_MOZILLA)/include/mozilla -I$(BF_MOZILLA)/include/mozilla/xpcom -I$(BF_MOZILLA)/include/mozilla/idl
188 #BF_MOZILLA_LIB =
189 # Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
190 # if this is not set.
191 #
192 # Be paranoid regarding library creation (do not update archives)
193 #BF_PARANOID = True
194
195 # enable freetype2 support for text objects
196 BF_FREETYPE = LIBDIR + '/freetype'
197 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
198 BF_FREETYPE_LIB = 'freetype'
199 BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
200
201 WITH_BF_QUICKTIME = True # -DWITH_QUICKTIME
202
203 WITH_BF_ICONV = True
204 BF_ICONV = LIBDIR + "/iconv"
205 BF_ICONV_INC = '${BF_ICONV}/include'
206 BF_ICONV_LIB = 'iconv'
207 #BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
208
209 # Mesa Libs should go here if your using them as well....
210 WITH_BF_STATICOPENGL = True
211 BF_OPENGL_LIB = 'GL GLU'
212 BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
213 BF_OPENGL_LINKFLAGS = '-framework OpenGL'
214
215 CFLAGS = ['-pipe','-fPIC','-funsigned-char']
216
217 CPPFLAGS = ['-fpascal-strings']
218 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings']
219 CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char', '-fpascal-strings']
220 PLATFORM_LINKFLAGS = '-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime'
221
222 #note to build succesfully on 10.3.9 SDK you need to patch  10.3.9 by adding the SystemStubs.a lib from 10.4
223 LLIBS = ['stdc++', 'SystemStubs']
224
225 # some flags shuffling for different Os versions
226 if MAC_MIN_VERS == '10.3':
227         CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
228         CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
229         PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS
230         LLIBS.append('crt3.o')
231         
232 if USE_SDK==True:
233         SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS]        
234         PLATFORM_LINKFLAGS = '-mmacosx-version-min='+MAC_MIN_VERS+ ' -Wl,-syslibroot,' + MACOSX_SDK+" "+PLATFORM_LINKFLAGS
235         CCFLAGS=SDK_FLAGS+CCFLAGS
236         CXXFLAGS=SDK_FLAGS+CXXFLAGS
237         
238 # you can add -mssse3 if gcc >= 4.2
239 if MAC_PROC == 'i386':
240         REL_CFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
241         REL_CCFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
242 else:
243         CFLAGS = CFLAGS+['-fno-strict-aliasing']
244         CCFLAGS =  CCFLAGS+['-fno-strict-aliasing']
245         CXXFLAGS = CXXFLAGS+['-fno-strict-aliasing']
246         
247         REL_CFLAGS = ['-O2']
248         REL_CCFLAGS = ['-O2']
249
250 ##BF_DEPEND = True
251 ##
252 ##AR = ar
253 ##ARFLAGS = ruv
254 ##ARFLAGSQUIET = ru
255 ##
256 CC = 'gcc'
257 CXX = 'g++'
258 C_WARN = ['-Wdeclaration-after-statement']
259
260 CC_WARN = ['-Wall', '-Wno-long-double']
261
262 ##FIX_STUBS_WARNINGS = -Wno-unused
263
264 ##LOPTS = --dynamic
265 ##DYNLDFLAGS = -shared $(LDFLAGS)
266
267 BF_PROFILE_CCFLAGS = ['-pg', '-g ']
268 BF_PROFILE_LINKFLAGS = ['-pg']
269 BF_PROFILE = False
270
271 BF_DEBUG = False
272 BF_DEBUG_CCFLAGS = ['-g']
273
274 BF_BUILDDIR='../build/darwin'
275 BF_INSTALLDIR='../install/darwin'
276 BF_DOCDIR='../install/doc'