Sequencer: invalidate current frame cache on sequence transform
[blender.git] / build_files / scons / config / darwin-config.py
index 38c8dca6cd21e569bcfc59533c49eb635713df79..1ce9416d5c403148956aaeae0ad2d26f23098220 100644 (file)
@@ -18,29 +18,31 @@ MACOSX_ARCHITECTURE = 'i386' # valid archs: ppc, i386, ppc64, x86_64
 
 
 cmd = 'uname -p'
 
 
 cmd = 'uname -p'
-MAC_PROC=commands.getoutput(cmd) 
+MAC_PROC=commands.getoutput(cmd)
 cmd = 'uname -r'
 cmd = 'uname -r'
-cmd_res=commands.getoutput(cmd) 
+cmd_res=commands.getoutput(cmd)
 
 if cmd_res[:1]=='7':
 
 if cmd_res[:1]=='7':
-       MAC_CUR_VER='10.3'
+    MAC_CUR_VER='10.3'
 elif cmd_res[:1]=='8':
 elif cmd_res[:1]=='8':
-       MAC_CUR_VER='10.4'
+    MAC_CUR_VER='10.4'
 elif cmd_res[:1]=='9':
 elif cmd_res[:1]=='9':
-       MAC_CUR_VER='10.5'
+    MAC_CUR_VER='10.5'
 elif cmd_res[:2]=='10':
 elif cmd_res[:2]=='10':
-       MAC_CUR_VER='10.6'
+    MAC_CUR_VER='10.6'
 elif cmd_res[:2]=='11':
 elif cmd_res[:2]=='11':
-       MAC_CUR_VER='10.7'
+    MAC_CUR_VER='10.7'
+elif cmd_res[:2]=='12':
+    MAC_CUR_VER='10.8'
 cmd = 'xcodebuild -version'
 cmd_xcode=commands.getoutput(cmd)
 cmd = 'xcodebuild -version'
 cmd_xcode=commands.getoutput(cmd)
-XCODE_CUR_VER=cmd_xcode
+XCODE_CUR_VER=cmd_xcode[6:][:3] # truncate output to major.minor version
 cmd = 'xcodebuild -showsdks'
 cmd_sdk=commands.getoutput(cmd)
 MACOSX_SDK_CHECK=cmd_sdk
 
 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
 cmd = 'xcodebuild -showsdks'
 cmd_sdk=commands.getoutput(cmd)
 MACOSX_SDK_CHECK=cmd_sdk
 
 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
-       USE_QTKIT=True # Carbon quicktime is not available for 64bit
+    USE_QTKIT=True # Carbon quicktime is not available for 64bit
 
 
 # Default target OSX settings per architecture
 
 
 # Default target OSX settings per architecture
@@ -48,57 +50,68 @@ if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
 
 if MACOSX_ARCHITECTURE == 'ppc' and MAC_CUR_VER == '10.4':
 # all releases are now made for 10.5 !
 
 if MACOSX_ARCHITECTURE == 'ppc' and MAC_CUR_VER == '10.4':
 # all releases are now made for 10.5 !
-#      MAC_MIN_VERS = '10.3'
-#      MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
-#      LCGDIR = '#../lib/darwin-6.1-powerpc'
-#      CC = 'gcc-3.3'
-#      CXX = 'g++-3.3'
-       MAC_MIN_VERS = '10.4'
-       MACOSX_DEPLOYMENT_TARGET = '10.4'
-       MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
-       LCGDIR = '#../lib/darwin-8.0.0-powerpc'
-       CC = 'gcc-4.0'
-       CXX = 'g++-4.0'
+#   MAC_MIN_VERS = '10.3'
+#   MACOSX_SDK='/Developer/SDKs/MacOSX10.3.9.sdk'
+#   LCGDIR = '#../lib/darwin-6.1-powerpc'
+#   CC = 'gcc-3.3'
+#   CXX = 'g++-3.3'
+    MAC_MIN_VERS = '10.4'
+    MACOSX_DEPLOYMENT_TARGET = '10.4'
+    MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
+    LCGDIR = '#../lib/darwin-8.0.0-powerpc'
+    CC = 'gcc-4.0'
+    CXX = 'g++-4.0'
 elif MACOSX_ARCHITECTURE == 'i386' and MAC_CUR_VER == '10.4':
 elif MACOSX_ARCHITECTURE == 'i386' and MAC_CUR_VER == '10.4':
-       MAC_MIN_VERS = '10.4'
-       MACOSX_DEPLOYMENT_TARGET = '10.4'
-       MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
-       LCGDIR = '#../lib/darwin-8.x.i386'
-       CC = 'gcc-4.0'
-       CXX = 'g++-4.0'
+    MAC_MIN_VERS = '10.4'
+    MACOSX_DEPLOYMENT_TARGET = '10.4'
+    MACOSX_SDK='/Developer/SDKs/MacOSX10.4u.sdk'
+    LCGDIR = '#../lib/darwin-8.x.i386'
+    CC = 'gcc-4.0'
+    CXX = 'g++-4.0'
 else :
 else :
-       if 'Mac OS X 10.5' in MACOSX_SDK_CHECK:
-               # OSX 10.5/6 with Xcode 3.x
-               MAC_MIN_VERS = '10.5'
-               MACOSX_DEPLOYMENT_TARGET = '10.5'
-               MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
-               LCGDIR = '#../lib/darwin-9.x.universal'
-               CC = 'gcc-4.2'
-               CXX = 'g++-4.2'
-       else:
-               # OSX 10.6/7 with Xcode 4.x
-               MAC_MIN_VERS = '10.6'
-               MACOSX_DEPLOYMENT_TARGET = '10.6'
-               MACOSX_SDK='/Developer/SDKs/MacOSX10.6.sdk'
-               LCGDIR = '#../lib/darwin-9.x.universal'
-               CC = 'gcc-4.2'
-               CXX = 'g++-4.2'
+    if 'Mac OS X 10.5' in MACOSX_SDK_CHECK:
+        # OSX 10.5/6 with Xcode 3.x
+        MAC_MIN_VERS = '10.5'
+        MACOSX_DEPLOYMENT_TARGET = '10.5'
+        MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
+        LCGDIR = '#../lib/darwin-9.x.universal'
+        CC = 'gcc-4.2'
+        CXX = 'g++-4.2'
+    elif 'Mac OS X 10.6' in MACOSX_SDK_CHECK:
+        # OSX 10.6/7 with Xcode 4.x
+        MAC_MIN_VERS = '10.6'
+        MACOSX_DEPLOYMENT_TARGET = '10.6'
+        MACOSX_SDK='/Developer/SDKs/MacOSX10.6.sdk'
+        LCGDIR = '#../lib/darwin-9.x.universal'
+        CC = 'gcc-4.2'
+        CXX = 'g++-4.2'
+    else:
+        # OSX 10.8 with Xcode 4.4 and higher (no 10.6sdk! )
+        MAC_MIN_VERS = '10.6'
+        MACOSX_DEPLOYMENT_TARGET = '10.6'
+        MACOSX_SDK='/Developer/SDKs/MacOSX10.7.sdk'
+        LCGDIR = '#../lib/darwin-9.x.universal'
+        CC = 'gcc'
+        CXX = 'g++'
 
 LIBDIR = '${LCGDIR}'
 
 
 LIBDIR = '${LCGDIR}'
 
+if XCODE_CUR_VER >= '4.3':  ## since version 4.3, XCode and developer dir are bundled ##
+       MACOSX_SDK = '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform' + MACOSX_SDK
+
 #############################################################################
 ###################          Dependency settings           ##################
 #############################################################################
 
 #Defaults openMP to true if compiler handles it ( only gcc 4.6.1 and newer )
 # if your compiler does not have accurate suffix you may have to enable it by hand !
 #############################################################################
 ###################          Dependency settings           ##################
 #############################################################################
 
 #Defaults openMP to true if compiler handles it ( only gcc 4.6.1 and newer )
 # if your compiler does not have accurate suffix you may have to enable it by hand !
-if CC.endswith('4.6.1'):
+if CC[:-2].endswith('4.6'):
     WITH_BF_OPENMP = True  # multithreading for fluids, cloth, sculpt and smoke
 else:
     WITH_BF_OPENMP = False
 
 # enable ffmpeg  support
     WITH_BF_OPENMP = True  # multithreading for fluids, cloth, sculpt and smoke
 else:
     WITH_BF_OPENMP = False
 
 # enable ffmpeg  support
-WITH_BF_FFMPEG = True  # -DWITH_FFMPEG
+WITH_BF_FFMPEG = True
 BF_FFMPEG = LIBDIR + '/ffmpeg'
 BF_FFMPEG_INC = "${BF_FFMPEG}/include"
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
 BF_FFMPEG = LIBDIR + '/ffmpeg'
 BF_FFMPEG_INC = "${BF_FFMPEG}/include"
 BF_FFMPEG_LIBPATH='${BF_FFMPEG}/lib'
@@ -109,32 +122,32 @@ BF_PYTHON_VERSION = '3.2'
 WITH_OSX_STATICPYTHON = True
 
 if WITH_OSX_STATICPYTHON:
 WITH_OSX_STATICPYTHON = True
 
 if WITH_OSX_STATICPYTHON:
-       # python 3.2 uses precompiled libraries in bf svn /lib by default
-
-       BF_PYTHON = LIBDIR + '/python'
-       BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
-       # BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
-       BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
-       BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
-       # BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
+    # python 3.2 uses precompiled libraries in bf svn /lib by default
+
+    BF_PYTHON = LIBDIR + '/python'
+    BF_PYTHON_INC = '${BF_PYTHON}/include/python${BF_PYTHON_VERSION}'
+    # BF_PYTHON_BINARY = '${BF_PYTHON}/bin/python${BF_PYTHON_VERSION}'
+    BF_PYTHON_LIB = 'python${BF_PYTHON_VERSION}'
+    BF_PYTHON_LIBPATH = '${BF_PYTHON}/lib/python${BF_PYTHON_VERSION}'
+    # BF_PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'System']
 else:
 else:
-       # python 3.2 uses Python-framework additionally installed in /Library/Frameworks
-       
-       BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
-       BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}m'
-       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-3.2m'
-       
+    # python 3.2 uses Python-framework additionally installed in /Library/Frameworks
+
+    BF_PYTHON = '/Library/Frameworks/Python.framework/Versions/'
+    BF_PYTHON_INC = '${BF_PYTHON}${BF_PYTHON_VERSION}/include/python${BF_PYTHON_VERSION}m'
+    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-3.2m'
+
 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 and ulterior
 if MAC_PROC == 'powerpc':
 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 and ulterior
 if MAC_PROC == 'powerpc':
-       BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal'
+    BF_OPENAL = '#../lib/darwin-8.0.0-powerpc/openal'
 else :
 else :
-       BF_OPENAL = LIBDIR + '/openal'
+    BF_OPENAL = LIBDIR + '/openal'
 
 WITH_BF_STATICOPENAL = False
 BF_OPENAL_INC = '${BF_OPENAL}/include' # only headers from libdir needed for proper use of framework !!!!
 
 WITH_BF_STATICOPENAL = False
 BF_OPENAL_INC = '${BF_OPENAL}/include' # only headers from libdir needed for proper use of framework !!!!
@@ -148,12 +161,12 @@ BF_CXX = '/usr'
 WITH_BF_STATICCXX = False
 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
 
 WITH_BF_STATICCXX = False
 BF_CXX_LIB_STATIC = '${BF_CXX}/lib/libstdc++.a'
 
-# TODO - set proper paths here (add precompiled to lib/ ? )
-WITH_BF_JACK = False
-BF_JACK = '/usr'
-BF_JACK_INC = '${BF_JACK}/include/jack'
+# we use simply jack framework
+WITH_BF_JACK = True
+BF_JACK = '/Library/Frameworks/Jackmp.framework'
+BF_JACK_INC = '${BF_JACK}/headers'
 BF_JACK_LIB = 'jack'
 BF_JACK_LIB = 'jack'
-BF_JACK_LIBPATH = '${BF_JACK}/lib'
+BF_JACK_LIBPATH = '${BF_JACK}'
 
 WITH_BF_SNDFILE = True
 BF_SNDFILE = LIBDIR + '/sndfile'
 
 WITH_BF_SNDFILE = True
 BF_SNDFILE = LIBDIR + '/sndfile'
@@ -217,6 +230,7 @@ BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
 
 WITH_BF_GAMEENGINE = True
 WITH_BF_PLAYER = True
 
 WITH_BF_GAMEENGINE = True
 WITH_BF_PLAYER = True
+WITH_BF_OCEANSIM = True
 
 WITH_BF_BULLET = True
 BF_BULLET = '#extern/bullet2/src'
 
 WITH_BF_BULLET = True
 BF_BULLET = '#extern/bullet2/src'
@@ -229,24 +243,6 @@ BF_FFTW3_INC = '${BF_FFTW3}/include'
 BF_FFTW3_LIB = 'libfftw3'
 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
 
 BF_FFTW3_LIB = 'libfftw3'
 BF_FFTW3_LIBPATH = '${BF_FFTW3}/lib'
 
-#WITH_BF_NSPR = True
-#BF_NSPR = $(LIBDIR)/nspr
-#BF_NSPR_INC = -I$(BF_NSPR)/include -I$(BF_NSPR)/include/nspr
-#BF_NSPR_LIB = 
-
-# Uncomment the following line to use Mozilla inplace of netscape
-#CPPFLAGS += -DMOZ_NOT_NET
-# Location of MOZILLA/Netscape header files...
-#BF_MOZILLA = $(LIBDIR)/mozilla
-#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
-#BF_MOZILLA_LIB =
-# Will fall back to look in BF_MOZILLA_INC/nspr and BF_MOZILLA_LIB
-# if this is not set.
-#
-# Be paranoid regarding library creation (do not update archives)
-#BF_PARANOID = True
-
-# enable freetype2 support for text objects
 BF_FREETYPE = LIBDIR + '/freetype'
 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
 BF_FREETYPE_LIB = 'freetype'
 BF_FREETYPE = LIBDIR + '/freetype'
 BF_FREETYPE_INC = '${BF_FREETYPE}/include ${BF_FREETYPE}/include/freetype2'
 BF_FREETYPE_LIB = 'freetype'
@@ -282,6 +278,25 @@ BF_PCRE_LIBPATH = '${BF_PCRE}/lib'
 #BF_EXPAT_LIB = 'expat'
 #BF_EXPAT_LIBPATH = '/usr/lib'
 
 #BF_EXPAT_LIB = 'expat'
 #BF_EXPAT_LIBPATH = '/usr/lib'
 
+# Cycles
+WITH_BF_CYCLES = True
+
+WITH_BF_OIIO = True
+BF_OIIO = LIBDIR + '/openimageio'
+BF_OIIO_INC = BF_OIIO + '/include'
+BF_OIIO_LIB = 'OpenImageIO'
+BF_OIIO_LIBPATH = BF_OIIO + '/lib'
+
+WITH_BF_BOOST = True
+BF_BOOST = LIBDIR + '/boost'
+BF_BOOST_INC = BF_BOOST + '/include'
+BF_BOOST_LIB = 'boost_date_time-mt boost_filesystem-mt boost_regex-mt boost_system-mt boost_thread-mt'
+BF_BOOST_LIBPATH = BF_BOOST + '/lib'
+
+WITH_BF_CYCLES_CUDA_BINARIES = False
+BF_CYCLES_CUDA_NVCC = '/usr/local/cuda/bin/nvcc'
+BF_CYCLES_CUDA_BINARIES_ARCH = ['sm_13', 'sm_20', 'sm_21']
+
 #Ray trace optimization
 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'i386':
     WITH_BF_RAYOPTIMIZATION = True
 #Ray trace optimization
 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'i386':
     WITH_BF_RAYOPTIMIZATION = True
@@ -302,9 +317,9 @@ WITH_BF_3DMOUSE = True
 BF_QUIET = '1' # suppress verbose output
 
 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
 BF_QUIET = '1' # suppress verbose output
 
 if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64':
-       ARCH_FLAGS = ['-m64']
+    ARCH_FLAGS = ['-m64']
 else:
 else:
-       ARCH_FLAGS = ['-m32']
+    ARCH_FLAGS = ['-m32']
 
 CFLAGS = []
 CXXFLAGS = []
 
 CFLAGS = []
 CXXFLAGS = []
@@ -313,53 +328,53 @@ CCFLAGS = ['-pipe','-funsigned-char']
 CPPFLAGS = list(ARCH_FLAGS)
 
 if WITH_GHOST_COCOA:
 CPPFLAGS = list(ARCH_FLAGS)
 
 if WITH_GHOST_COCOA:
-       PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
+    PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Cocoa','-framework','Carbon','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
 else:
 else:
-       PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
+    PLATFORM_LINKFLAGS = ['-fexceptions','-framework','CoreServices','-framework','Foundation','-framework','IOKit','-framework','AppKit','-framework','Carbon','-framework','AGL','-framework','AudioUnit','-framework','AudioToolbox','-framework','CoreAudio','-framework','OpenAL']+ARCH_FLAGS
 
 if WITH_BF_QUICKTIME:
 
 if WITH_BF_QUICKTIME:
-       if USE_QTKIT:
-               PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QTKit']
-       else:
-               PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
+    if USE_QTKIT:
+        PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QTKit']
+    else:
+        PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','QuickTime']
 
 if not WITH_OSX_STATICPYTHON:
 
 if not WITH_OSX_STATICPYTHON:
-               PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','Python']
+    PLATFORM_LINKFLAGS = PLATFORM_LINKFLAGS+['-framework','Python']
 
 
 #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
 
 
 #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
-#for 10.7.sdk, SystemStubs needs to be excluded (lib doesn't exist anymore)
-if MACOSX_DEPLOYMENT_TARGET == '10.7':
-       LLIBS = ['stdc++']
+#for 10.7.sdk, SystemStubs needs to be excluded (lib doesn't exist anymore)
+if MACOSX_SDK.endswith("10.7.sdk") or MACOSX_SDK.endswith("10.8.sdk"):
+    LLIBS = ['stdc++']
 else:
 else:
-       LLIBS = ['stdc++', 'SystemStubs']
+    LLIBS = ['stdc++', 'SystemStubs']
 
 # some flags shuffling for different OS versions
 if MAC_MIN_VERS == '10.3':
 
 # some flags shuffling for different OS versions
 if MAC_MIN_VERS == '10.3':
-       CCFLAGS = ['-fuse-cxa-atexit'] + CCFLAGS
-       PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit'] + PLATFORM_LINKFLAGS
-       LLIBS.append('crt3.o')
-       
+    CCFLAGS = ['-fuse-cxa-atexit'] + CCFLAGS
+    PLATFORM_LINKFLAGS = ['-fuse-cxa-atexit'] + PLATFORM_LINKFLAGS
+    LLIBS.append('crt3.o')
+
 if USE_SDK:
 if USE_SDK:
-       SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS,'-arch',MACOSX_ARCHITECTURE]    
-       PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS,'-Wl','-isysroot',MACOSX_SDK,'-arch',MACOSX_ARCHITECTURE]+PLATFORM_LINKFLAGS
-       CCFLAGS=SDK_FLAGS+CCFLAGS
-       CXXFLAGS=SDK_FLAGS+CXXFLAGS
+    SDK_FLAGS=['-isysroot', MACOSX_SDK,'-mmacosx-version-min='+MAC_MIN_VERS,'-arch',MACOSX_ARCHITECTURE]
+    PLATFORM_LINKFLAGS = ['-mmacosx-version-min='+MAC_MIN_VERS,'-Wl','-isysroot',MACOSX_SDK,'-arch',MACOSX_ARCHITECTURE]+PLATFORM_LINKFLAGS
+    CCFLAGS=SDK_FLAGS+CCFLAGS
+    CXXFLAGS=SDK_FLAGS+CXXFLAGS
 
 
-#Intel Macs are CoreDuo and Up 
+#Intel Macs are CoreDuo and Up
 if MACOSX_ARCHITECTURE == 'i386' or MACOSX_ARCHITECTURE == 'x86_64':
 if MACOSX_ARCHITECTURE == 'i386' or MACOSX_ARCHITECTURE == 'x86_64':
-       REL_CFLAGS = []
-       REL_CXXFLAGS = []
-       REL_CCFLAGS = ['-DNDEBUG', '-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mfpmath=sse']
+    REL_CFLAGS = []
+    REL_CXXFLAGS = []
+    REL_CCFLAGS = ['-DNDEBUG', '-O2','-ftree-vectorize','-msse','-msse2','-msse3','-mfpmath=sse']
 else:
 else:
-       CCFLAGS += ['-fno-strict-aliasing']
-       REL_CFLAGS = []
-       REL_CXXFLAGS = []
-       REL_CCFLAGS = ['-DNDEBUG', '-O2']
+    CCFLAGS += ['-fno-strict-aliasing']
+    REL_CFLAGS = []
+    REL_CXXFLAGS = []
+    REL_CCFLAGS = ['-DNDEBUG', '-O2']
 
 # Intel 64bit Macs are Core2Duo and up
 if MACOSX_ARCHITECTURE == 'x86_64':
 
 # Intel 64bit Macs are Core2Duo and up
 if MACOSX_ARCHITECTURE == 'x86_64':
-       REL_CCFLAGS += ['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
+    REL_CCFLAGS += ['-march=core2','-mssse3','-with-tune=core2','-enable-threads']
 
 CC_WARN = ['-Wall']
 C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']
 
 CC_WARN = ['-Wall']
 C_WARN = ['-Wno-char-subscripts', '-Wpointer-arith', '-Wcast-align', '-Wdeclaration-after-statement', '-Wno-unknown-pragmas', '-Wstrict-prototypes']