2.5
[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}'
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_OPENEXR = True
104 WITH_BF_STATICOPENEXR = False
105 BF_OPENEXR = '${LCGDIR}/openexr'
106 BF_OPENEXR_INC = '${BF_OPENEXR}/include ${BF_OPENEXR}/include/OpenEXR'
107 BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
108 BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
109 # Warning, this static lib configuration is untested! users of this OS please confirm.
110 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'
111
112 WITH_BF_DDS = True
113
114 WITH_BF_JPEG = True
115 BF_JPEG = LIBDIR + '/jpeg'
116 BF_JPEG_INC = '${BF_JPEG}/include'
117 BF_JPEG_LIB = 'jpeg'
118 BF_JPEG_LIBPATH = '${BF_JPEG}/lib'
119
120 WITH_BF_PNG = True
121 BF_PNG = LIBDIR + '/png'
122 BF_PNG_INC = '${BF_PNG}/include'
123 BF_PNG_LIB = 'png'
124 BF_PNG_LIBPATH = '${BF_PNG}/lib'
125
126 BF_TIFF = LIBDIR + '/tiff'
127 BF_TIFF_INC = '${BF_TIFF}/include'
128
129 WITH_BF_ZLIB = True
130 BF_ZLIB = '/usr'
131 BF_ZLIB_INC = '${BF_ZLIB}/include'
132 BF_ZLIB_LIB = 'z'
133
134 WITH_BF_INTERNATIONAL = True
135
136 BF_GETTEXT = LIBDIR + '/gettext'
137 BF_GETTEXT_INC = '${BF_GETTEXT}/include'
138 BF_GETTEXT_LIB = 'intl'
139 BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
140
141 WITH_BF_GAMEENGINE=True
142 WITH_BF_PLAYER=True
143
144 WITH_BF_ODE = False
145 BF_ODE = LIBDIR + '/ode'
146 BF_ODE_INC = '${BF_ODE}/include'
147 BF_ODE_LIB = '${BF_ODE}/lib/libode.a'
148
149 WITH_BF_BULLET = True
150 BF_BULLET = '#extern/bullet2/src'
151 BF_BULLET_INC = '${BF_BULLET}'
152 BF_BULLET_LIB = 'extern_bullet'
153
154 BF_SOLID = '#extern/solid'
155 BF_SOLID_INC = '${BF_SOLID}'
156 BF_SOLID_LIB = 'extern_solid'
157
158 #WITH_BF_NSPR = True
159 #BF_NSPR = $(LIBDIR)/nspr
160 #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
161 #BF_NSPR_LIB = 
162
163 # Uncomment the following line to use Mozilla inplace of netscape
164 #CPPFLAGS += -DMOZ_NOT_NET
165 # Location of MOZILLA/Netscape header files...
166 #BF_MOZILLA = $(LIBDIR)/mozilla
167 #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
168 #BF_MOZILLA_LIB =
169 # Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
170 # if this is not set.
171 #
172 # Be paranoid regarding library creation (do not update archives)
173 #BF_PARANOID = True
174
175 # enable freetype2 support for text objects
176 BF_FREETYPE = LIBDIR + '/freetype'
177 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
178 BF_FREETYPE_LIB = 'freetype'
179 BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
180
181 WITH_BF_QUICKTIME = True # -DWITH_QUICKTIME
182
183 WITH_BF_ICONV = True
184 BF_ICONV = LIBDIR + "/iconv"
185 BF_ICONV_INC = '${BF_ICONV}/include'
186 BF_ICONV_LIB = 'iconv'
187 #BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
188
189 # Mesa Libs should go here if your using them as well....
190 WITH_BF_STATICOPENGL = True
191 BF_OPENGL_LIB = 'GL GLU'
192 BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
193 BF_OPENGL_LINKFLAGS = '-framework OpenGL'
194
195 CFLAGS = ['-pipe','-fPIC','-funsigned-char']
196
197 CPPFLAGS = ['-fpascal-strings']
198 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings']
199 CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char', '-fpascal-strings']
200 PLATFORM_LINKFLAGS = '-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime'
201
202 #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
203 LLIBS = ['stdc++', 'SystemStubs']
204
205 # some flags shuffling for different Os versions
206 if MAC_MIN_VERS == '10.3':
207         CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
208         CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
209         PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS
210         LLIBS.append('crt3.o')
211         
212 if USE_SDK==True:
213         SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS]        
214         PLATFORM_LINKFLAGS = '-mmacosx-version-min='+MAC_MIN_VERS+ ' -Wl,-syslibroot,' + MACOSX_SDK+" "+PLATFORM_LINKFLAGS
215         CCFLAGS=SDK_FLAGS+CCFLAGS
216         CXXFLAGS=SDK_FLAGS+CXXFLAGS
217         
218 # you can add -mssse3 if gcc >= 4.2
219 if MAC_PROC == 'i386':
220         REL_CFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
221         REL_CCFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
222 else:
223         CFLAGS = CFLAGS+['-fno-strict-aliasing']
224         CCFLAGS =  CCFLAGS+['-fno-strict-aliasing']
225         CXXFLAGS = CXXFLAGS+['-fno-strict-aliasing']
226         
227         REL_CFLAGS = ['-O2']
228         REL_CCFLAGS = ['-O2']
229
230 ##BF_DEPEND = True
231 ##
232 ##AR = ar
233 ##ARFLAGS = ruv
234 ##ARFLAGSQUIET = ru
235 ##
236 CC = 'gcc'
237 CXX = 'g++'
238 C_WARN = ['-Wdeclaration-after-statement']
239
240 CC_WARN = ['-Wall', '-Wno-long-double']
241
242 ##FIX_STUBS_WARNINGS = -Wno-unused
243
244 ##LOPTS = --dynamic
245 ##DYNLDFLAGS = -shared $(LDFLAGS)
246
247 BF_PROFILE_CCFLAGS = ['-pg', '-g ']
248 BF_PROFILE_LINKFLAGS = ['-pg']
249 BF_PROFILE = False
250
251 BF_DEBUG = False
252 BF_DEBUG_CCFLAGS = ['-g']
253
254 BF_BUILDDIR='../build/darwin'
255 BF_INSTALLDIR='../install/darwin'
256 BF_DOCDIR='../install/doc'