diff options
author | Jean-Luc Peurière <jlp@nerim.net> | 2008-04-28 01:21:21 +0400 |
---|---|---|
committer | Jean-Luc Peurière <jlp@nerim.net> | 2008-04-28 01:21:21 +0400 |
commit | 7c99131ecebb4039e66ab742d40f0912910485b6 (patch) | |
tree | 066cdfc2519b61b7f9c6776ad9bb9604347272bb | |
parent | 9101d5689fb71c97a3366fb3120083efc10fe8e1 (diff) |
attempt for an universal Os X config file
should work both on intel and powerpc
from 10.36 (ppc only) to 10.5
please test
-rw-r--r-- | config/darwin-config.py | 99 |
1 files changed, 82 insertions, 17 deletions
diff --git a/config/darwin-config.py b/config/darwin-config.py index 5a9b343a0bd..91acd86e893 100644 --- a/config/darwin-config.py +++ b/config/darwin-config.py @@ -1,10 +1,48 @@ -LCGDIR = '#../lib/darwin-6.1-powerpc' +# +# Note : if you want to alter this file +# copy it as a whole in the upper folder +# as user-config.py +# dont create a new file with only some +# vars changed. + +import commands + +# IMPORTANT NOTE : OFFICIAL BUILDS SHOULD BE DONE WITH SDKs +USE_SDK='true' + +BF_PYTHON_VERSION = '2.3' + +cmd = 'uname -p' +MAC_PROC=commands.getoutput(cmd) +cmd = 'uname -r' +cmd_res=commands.getoutput(cmd) +if cmd_res[0]=='7': + MAC_CUR_VER='10.3' +elif cmd_res[0]=='8': + MAC_CUR_VER='10.4' +else: + MAC_CUR_VER='10.5' + +if MAC_PROC == 'powerpc': + LCGDIR = '#../lib/darwin-6.1-powerpc' +else : + LCGDIR = '#../lib/darwin-8.x.i386' LIBDIR = '${LCGDIR}' +if MAC_PROC== 'powerpc' and BF_PYTHON_VERSION == '2.3': + MAC_MIN_VERS = '10.3' + MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk' +else: + MAC_MIN_VERS = '10.4' + MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk' + + # enable ffmpeg support WITH_BF_FFMPEG = 'true' # -DWITH_FFMPEG BF_FFMPEG = "#extern/ffmpeg" BF_FFMPEG_INC = '${BF_FFMPEG}/include' +if USE_SDK=='true': + BF_FFMPEG_EXTRA = '-isysroot '+MACOSX_SDK+' -mmacosx-version-min='+MAC_MIN_VERS #BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib' #BF_FFMPEG_LIB = 'avformat.a avcodec.a avutil.a' @@ -14,8 +52,12 @@ BF_VERSE_LIBPATH = "${BF_BUILDDIR}/extern/verse/dist" BF_VERSE_INCLUDE = BF_VERSE BF_VERSE_LIBS = "libverse" -# python.org libs install in /library -BF_PYTHON_VERSION = '2.5' +# python.org libs install in /library we want to use that for 2.5 +# +# if you want py2.5 on leopard without installing +# change value to BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/' +# BEWARE: in that case it will work only on leopard + if BF_PYTHON_VERSION=='2.3': BF_PYTHON = '/System/Library/Frameworks/Python.framework/Versions/' else: @@ -25,15 +67,23 @@ BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERS BF_PYTHON_BINARY = '${BF_PYTHON}${BF_PYTHON_VERSION}/bin/python${BF_PYTHON_VERSION}' BF_PYTHON_LIB = '' BF_PYTHON_LIBPATH = '${BF_PYTHON}${BF_PYTHON_VERSION}/lib/python${BF_PYTHON_VERSION}/config' -BF_PYTHON_LINKFLAGS = '-u __dummy -u _PyMac_Error -framework System -framework Python' +BF_PYTHON_LINKFLAGS = '-u _PyMac_Error -framework System -framework Python' +if MAC_CUR_VER=='10.3' or MAC_CUR_VER=='10.4': + BF_PYTHON_LINKFLAGS ='-u __dummy '+BF_PYTHON_LINKFLAGS + +BF_QUIET = '1' +WITH_BF_OPENMP = '0' WITH_BF_OPENAL = 'true' #different lib must be used following version of gcc # for gcc 3.3 #BF_OPENAL = LIBDIR + '/openal' -# for gcc 3.4 -BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal' - +# for gcc 3.4 and ulterior +if MAC_PROC == 'powerpc': + BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal' +else : + BF_OPENAL = LIBDIR + '/openal' + BF_OPENAL_INC = '${BF_OPENAL}/include' BF_OPENAL_LIB = 'openal' BF_OPENAL_LIBPATH = '${BF_OPENAL}/lib' @@ -143,20 +193,36 @@ BF_OPENGL_LIB = 'GL GLU' BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries' BF_OPENGL_LINKFLAGS = '-framework OpenGL' -## -##CC = gcc -##CCC = g++ -##ifeq ($CPU),alpha) -## CFLAGS += -pipe -fPIC -funsigned-char -fno-strict-aliasing -mieee - CFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing'] CPPFLAGS = ['-fpascal-strings'] CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing', '-fpascal-strings'] -CXXFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing', '-fpascal-strings'] +CXXFLAGS = [ '-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing', '-fpascal-strings'] PLATFORM_LINKFLAGS = '-fexceptions -framework CoreServices -framework Foundation -framework IOKit -framework AppKit -framework Carbon -framework AGL -framework AudioUnit -framework AudioToolbox -framework CoreAudio -framework QuickTime' -REL_CFLAGS = ['-O2'] -REL_CCFLAGS = ['-O2'] + +#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 +LLIBS = 'stdc++ SystemStubs' + +# some flags shuffling for different Os versions +if MAC_MIN_VERS == '10.3': + CFLAGS = ['-fuse-cxa-atexit']+CFLAGS + CXXFLAGS = ['-fuse-cxa-atexit']+CXXFLAGS + PLATFORM_LINKFLAGS = '-fuse-cxa-atexit '+PLATFORM_LINKFLAGS + LLIBS = LLIBS + ' crt3.o' + +if USE_SDK=='true': + SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS] + PLATFORM_LINKFLAGS = '-mmacosx-version-min='+MAC_MIN_VERS+ ' -Wl,-syslibroot,' + MACOSX_SDK+" "+PLATFORM_LINKFLAGS + CCFLAGS=SDK_FLAGS+CCFLAGS + CXXFLAGS=SDK_FLAGS+CXXFLAGS + +if MAC_PROC == 'i386': + REL_CFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mssse3'] + REL_CCFLAGS = ['-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mssse3'] +else: + REL_CFLAGS = ['-O2'] + REL_CCFLAGS = ['-O2'] + ##BF_DEPEND = 'true' ## ##AR = ar @@ -171,7 +237,6 @@ CC_WARN = ' -Wall -Wno-long-double' ##FIX_STUBS_WARNINGS = -Wno-unused -LLIBS = 'stdc++ SystemStubs' ##LOPTS = --dynamic ##DYNLDFLAGS = -shared $(LDFLAGS) |