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