Smoke:
[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 # Note : should be true, but openal simply dont work on intel
90 if MAC_PROC == 'i386':
91         WITH_BF_OPENAL = False
92 else:
93         WITH_BF_OPENAL = True
94 #different lib must be used  following version of gcc
95 # for gcc 3.3
96 #BF_OPENAL = LIBDIR + '/openal'
97 # for gcc 3.4 and ulterior
98 if MAC_PROC == 'powerpc':
99         BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal'
100 else :
101         BF_OPENAL = LIBDIR + '/openal'
102
103 WITH_BF_STATICOPENAL = False
104 BF_OPENAL_INC = '${BF_OPENAL}/include'
105 BF_OPENAL_LIB = 'openal'
106 BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib'
107 # Warning, this static lib configuration is untested! users of this OS please confirm.
108 BF_OPENAL_LIB_STATIC = '${BF_OPENAL}/lib/libopenal.a'
109
110 # Warning, this static lib configuration is untested! users of this OS please confirm.
111 BF_CXX = '/usr'
112 WITH_BF_STATICCXX = False
113 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
114
115 BF_LIBSAMPLERATE = LIBDIR + '/SRC'
116 BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
117 BF_LIBSAMPLERATE_LIB = 'samplerate'
118 BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
119
120 WITH_BF_SDL = True
121 BF_SDL = LIBDIR + '/sdl' #$(shell sdl-config --prefix)
122 BF_SDL_INC = '${BF_SDL}/include' #$(shell $(BF_SDL)/bin/sdl-config --cflags)
123 BF_SDL_LIB = 'SDL' #BF_SDL #$(shell $(BF_SDL)/bin/sdl-config --libs) -lSDL_mixer
124 BF_SDL_LIBPATH = '${BF_SDL}/lib'
125
126 WITH_BF_OPENEXR = True
127 WITH_BF_STATICOPENEXR = False
128 BF_OPENEXR = '${LCGDIR}/openexr'
129 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
130 BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
131 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
132 # Warning, this static lib configuration is untested! users of this OS please confirm.
133 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'
134
135 WITH_BF_DDS = True
136
137 WITH_BF_JPEG = True
138 BF_JPEG = LIBDIR + '/jpeg'
139 BF_JPEG_INC = '${BF_JPEG}/include'
140 BF_JPEG_LIB = 'jpeg'
141 BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
142
143 WITH_BF_PNG = True
144 BF_PNG = LIBDIR + '/png'
145 BF_PNG_INC = '${BF_PNG}/include'
146 BF_PNG_LIB = 'png'
147 BF_PNG_LIBPATH = '${BF_PNG}/lib'
148
149 BF_TIFF = LIBDIR + '/tiff'
150 BF_TIFF_INC = '${BF_TIFF}/include'
151
152 WITH_BF_ZLIB = True
153 BF_ZLIB = '/usr'
154 BF_ZLIB_INC = '${BF_ZLIB}/include'
155 BF_ZLIB_LIB = 'z'
156
157 WITH_BF_INTERNATIONAL = True
158
159 BF_GETTEXT = LIBDIR + '/gettext'
160 BF_GETTEXT_INC = '${BF_GETTEXT}/include'
161 BF_GETTEXT_LIB = 'intl'
162 BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
163
164 WITH_BF_GAMEENGINE=True
165 WITH_BF_PLAYER = False
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 WITH_BF_FFTW3 = False
173 BF_FFTW3 = LIBDIR + '/fftw3'
174 BF_FFTW3_INC = '${BF_FFTW3}/include'
175 BF_FFTW3_LIB = 'libfftw'
176 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
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 BF_LIBSAMPLERATE = LIBDIR + '/samplerate'
210 BF_LIBSAMPLERATE_INC = '${BF_LIBSAMPLERATE}/include'
211 BF_LIBSAMPLERATE_LIB = 'samplerate'
212 BF_LIBSAMPLERATE_LIBPATH = '${BF_LIBSAMPLERATE}/lib'
213
214 # Mesa Libs should go here if your using them as well....
215 WITH_BF_STATICOPENGL = True
216 BF_OPENGL_LIB = 'GL GLU'
217 BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
218 BF_OPENGL_LINKFLAGS = '-framework OpenGL'
219
220 CFLAGS = ['-pipe','-fPIC','-funsigned-char']
221
222 CPPFLAGS = ['-fpascal-strings']
223 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings']
224 CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char', '-fpascal-strings']
225 PLATFORM_LINKFLAGS = '-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime'
226
227 #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
228 LLIBS = ['stdc++', 'SystemStubs']
229
230 # some flags shuffling for different Os versions
231 if MAC_MIN_VERS == '10.3':
232         CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
233         CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
234         PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS
235         LLIBS.append('crt3.o')
236         
237 if USE_SDK==True:
238         SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS]        
239         PLATFORM_LINKFLAGS = '-mmacosx-version-min='+MAC_MIN_VERS+ ' -Wl,-syslibroot,' + MACOSX_SDK+" "+PLATFORM_LINKFLAGS
240         CCFLAGS=SDK_FLAGS+CCFLAGS
241         CXXFLAGS=SDK_FLAGS+CXXFLAGS
242         
243 # you can add -mssse3 if gcc >= 4.2
244 if MAC_PROC == 'i386':
245         REL_CFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
246         REL_CCFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
247 else:
248         CFLAGS = CFLAGS+['-fno-strict-aliasing']
249         CCFLAGS =  CCFLAGS+['-fno-strict-aliasing']
250         CXXFLAGS = CXXFLAGS+['-fno-strict-aliasing']
251         
252         REL_CFLAGS = ['-O2']
253         REL_CCFLAGS = ['-O2']
254
255 ##BF_DEPEND = True
256 ##
257 ##AR = ar
258 ##ARFLAGS = ruv
259 ##ARFLAGSQUIET = ru
260 ##
261 CC = 'gcc'
262 CXX = 'g++'
263 C_WARN = ['-Wdeclaration-after-statement']
264
265 CC_WARN = ['-Wall', '-Wno-long-double']
266
267 ##FIX_STUBS_WARNINGS = -Wno-unused
268
269 ##LOPTS = --dynamic
270 ##DYNLDFLAGS = -shared $(LDFLAGS)
271
272 BF_PROFILE_CCFLAGS = ['-pg', '-g ']
273 BF_PROFILE_LINKFLAGS = ['-pg']
274 BF_PROFILE = False
275
276 BF_DEBUG = False
277 BF_DEBUG_CCFLAGS = ['-g']
278
279 BF_BUILDDIR='../build/darwin'
280 BF_INSTALLDIR='../install/darwin'
281 BF_DOCDIR='../install/doc'