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