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