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