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