svn merge -r 21041:21301 https://svn.blender.org/svnroot/bf-blender/branches/blender2...
[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_BULLET = True
145 BF_BULLET = '#extern/bullet2/src'
146 BF_BULLET_INC = '${BF_BULLET}'
147 BF_BULLET_LIB = 'extern_bullet'
148
149 #WITH_BF_NSPR = True
150 #BF_NSPR = $(LIBDIR)/nspr
151 #BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
152 #BF_NSPR_LIB = 
153
154 # Uncomment the following line to use Mozilla inplace of netscape
155 #CPPFLAGS += -DMOZ_NOT_NET
156 # Location of MOZILLA/Netscape header files...
157 #BF_MOZILLA = $(LIBDIR)/mozilla
158 #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
159 #BF_MOZILLA_LIB =
160 # Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
161 # if this is not set.
162 #
163 # Be paranoid regarding library creation (do not update archives)
164 #BF_PARANOID = True
165
166 # enable freetype2 support for text objects
167 BF_FREETYPE = LIBDIR + '/freetype'
168 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
169 BF_FREETYPE_LIB = 'freetype'
170 BF_FREETYPE_LIBPATH = '${BF_FREETYPE}/lib'
171
172 WITH_BF_QUICKTIME = True # -DWITH_QUICKTIME
173
174 WITH_BF_ICONV = True
175 BF_ICONV = LIBDIR + "/iconv"
176 BF_ICONV_INC = '${BF_ICONV}/include'
177 BF_ICONV_LIB = 'iconv'
178 #BF_ICONV_LIBPATH = '${BF_ICONV}/lib'
179
180 # Mesa Libs should go here if your using them as well....
181 WITH_BF_STATICOPENGL = True
182 BF_OPENGL_LIB = 'GL GLU'
183 BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
184 BF_OPENGL_LINKFLAGS = '-framework OpenGL'
185
186 CFLAGS = ['-pipe','-fPIC','-funsigned-char']
187
188 CPPFLAGS = ['-fpascal-strings']
189 CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fpascal-strings']
190 CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char', '-fpascal-strings']
191 PLATFORM_LINKFLAGS = '-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime'
192
193 #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
194 LLIBS = ['stdc++', 'SystemStubs']
195
196 # some flags shuffling for different Os versions
197 if MAC_MIN_VERS == '10.3':
198         CFLAGS = ['-fuse-cxa-atexit']+CFLAGS
199         CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS
200         PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS
201         LLIBS.append('crt3.o')
202         
203 if USE_SDK==True:
204         SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS]        
205         PLATFORM_LINKFLAGS = '-mmacosx-version-min='+MAC_MIN_VERS+ ' -Wl,-syslibroot,' + MACOSX_SDK+" "+PLATFORM_LINKFLAGS
206         CCFLAGS=SDK_FLAGS+CCFLAGS
207         CXXFLAGS=SDK_FLAGS+CXXFLAGS
208         
209 # you can add -mssse3 if gcc >= 4.2
210 if MAC_PROC == 'i386':
211         REL_CFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
212         REL_CCFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3']
213 else:
214         CFLAGS = CFLAGS+['-fno-strict-aliasing']
215         CCFLAGS =  CCFLAGS+['-fno-strict-aliasing']
216         CXXFLAGS = CXXFLAGS+['-fno-strict-aliasing']
217         
218         REL_CFLAGS = ['-O2']
219         REL_CCFLAGS = ['-O2']
220
221 ##BF_DEPEND = True
222 ##
223 ##AR = ar
224 ##ARFLAGS = ruv
225 ##ARFLAGSQUIET = ru
226 ##
227 CC = 'gcc'
228 CXX = 'g++'
229 C_WARN = ['-Wdeclaration-after-statement']
230
231 CC_WARN = ['-Wall', '-Wno-long-double']
232
233 ##FIX_STUBS_WARNINGS = -Wno-unused
234
235 ##LOPTS = --dynamic
236 ##DYNLDFLAGS = -shared $(LDFLAGS)
237
238 BF_PROFILE_CCFLAGS = ['-pg', '-g ']
239 BF_PROFILE_LINKFLAGS = ['-pg']
240 BF_PROFILE = False
241
242 BF_DEBUG = False
243 BF_DEBUG_CCFLAGS = ['-g']
244
245 BF_BUILDDIR='../build/darwin'
246 BF_INSTALLDIR='../install/darwin'
247 BF_DOCDIR='../install/doc'