scons patch from jensverwiebe

fix a silly bug in version detection, - added an OSX sdk-check

jensverwiebe, needs to get commit access!, but will apply his patches for now.
This commit is contained in:
Campbell Barton 2011-08-07 16:54:40 +00:00
parent 479c203dad
commit 577293569a
3 changed files with 41 additions and 26 deletions

@ -253,8 +253,15 @@ if 'blenderlite' in B.targets:
if k not in B.arguments: if k not in B.arguments:
env[k] = v env[k] = v
# detect presence of 3D_CONNEXION_CLIENT_LIBRARY for OSX # Extended OSX_SDK and 3D_CONNEXION_CLIENT_LIBRARY detection for OSX
if env['OURPLATFORM']=='darwin': if env['OURPLATFORM']=='darwin':
print B.bc.OKGREEN + "Detected Xcode version: -- " + B.bc.ENDC + env['XCODE_CUR_VER'][:9] + " --"
print "Available " + env['MACOSX_SDK_CHECK']
if not 'Mac OS X 10.5' in env['MACOSX_SDK_CHECK']:
print B.bc.OKGREEN + "MacOSX10.5.sdk not available:" + B.bc.ENDC + " using MacOSX10.6.sdk"
else:
print B.bc.OKGREEN + "Found recommended sdk :" + B.bc.ENDC + " using MacOSX10.5.sdk"
# for now, Mac builders must download and install the driver framework from 3Dconnexion # for now, Mac builders must download and install the driver framework from 3Dconnexion
# necessary header file lives here when installed: # necessary header file lives here when installed:
# /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h # /Library/Frameworks/3DconnexionClient.framework/Versions/Current/Headers/ConnexionClientAPI.h

@ -1,9 +1,7 @@
# #
# Note : if you want to alter this file # Note : if you want to alter this file
# copy it as a whole in the upper folder # setup a user-config.py in main directory
# as user-config.py # and set the wanted values there
# dont create a new file with only some
# vars changed.
import commands import commands
@ -21,17 +19,23 @@ 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)
MAC_CUR_VER='10.5' # by default (test below fails on my 10.5 PowerPC)
if cmd_res[:2]=='7': if cmd_res[:1]=='7':
MAC_CUR_VER='10.3' MAC_CUR_VER='10.3'
elif cmd_res[:2]=='8': elif cmd_res[:1]=='8':
MAC_CUR_VER='10.4' MAC_CUR_VER='10.4'
elif cmd_res[:2]=='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'
cmd = 'xcodebuild -version'
cmd_xcode=commands.getoutput(cmd)
XCODE_CUR_VER=cmd_xcode
cmd = 'xcodebuild -showsdks'
cmd_sdk=commands.getoutput(cmd)
MACOSX_SDK_CHECK=cmd_sdk
if MACOSX_ARCHITECTURE == 'x86_64' or MACOSX_ARCHITECTURE == 'ppc64': 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
@ -60,21 +64,23 @@ elif MACOSX_ARCHITECTURE == 'i386' and MAC_CUR_VER == '10.4':
LCGDIR = '#../lib/darwin-8.x.i386' LCGDIR = '#../lib/darwin-8.x.i386'
CC = 'gcc-4.0' CC = 'gcc-4.0'
CXX = 'g++-4.0' CXX = 'g++-4.0'
elif MAC_CUR_VER >= '10.6':
# OSX 10.6 and 10.7 developer tools do not come with sdk < 10.6 anymore !
MAC_MIN_VERS = '10.6'
MACOSX_DEPLOYMENT_TARGET = '10.6'
MACOSX_SDK='/Developer/SDKs/MacOSX10.6.sdk'
LCGDIR = '#../lib/darwin-9.x.universal'
CC = 'llvm-gcc-4.2'
CXX = 'llvm-g++-4.2'
else : else :
MAC_MIN_VERS = '10.5' if 'Mac OS X 10.5' in MACOSX_SDK_CHECK:
MACOSX_DEPLOYMENT_TARGET = '10.5' # OSX 10.5/6 with Xcode 3.x
MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk' MAC_MIN_VERS = '10.5'
LCGDIR = '#../lib/darwin-9.x.universal' MACOSX_DEPLOYMENT_TARGET = '10.5'
CC = 'gcc-4.2' MACOSX_SDK='/Developer/SDKs/MacOSX10.5.sdk'
CXX = 'g++-4.2' 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'
LIBDIR = '${LCGDIR}' LIBDIR = '${LCGDIR}'
@ -200,7 +206,7 @@ BF_GETTEXT_LIB = 'intl'
BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib' BF_GETTEXT_LIBPATH = '${BF_GETTEXT}/lib'
WITH_BF_GAMEENGINE = True WITH_BF_GAMEENGINE = True
WITH_BF_PLAYER = False WITH_BF_PLAYER = True
WITH_BF_BULLET = True WITH_BF_BULLET = True
BF_BULLET = '#extern/bullet2/src' BF_BULLET = '#extern/bullet2/src'
@ -251,7 +257,7 @@ BF_OPENGL_LIBPATH = '/System/Library/Frameworks/OpenGL.framework/Libraries'
BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL'] BF_OPENGL_LINKFLAGS = ['-framework', 'OpenGL']
#OpenCollada flags #OpenCollada flags
WITH_BF_COLLADA = False WITH_BF_COLLADA = True
BF_COLLADA = '#source/blender/collada' BF_COLLADA = '#source/blender/collada'
BF_COLLADA_INC = '${BF_COLLADA}' BF_COLLADA_INC = '${BF_COLLADA}'
BF_COLLADA_LIB = 'bf_collada' BF_COLLADA_LIB = 'bf_collada'

@ -149,7 +149,7 @@ def validate_arguments(args, bc):
'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS', 'BF_PROFILE_CFLAGS', 'BF_PROFILE_CCFLAGS', 'BF_PROFILE_CXXFLAGS', 'BF_PROFILE_LINKFLAGS',
'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS', 'BF_DEBUG_CFLAGS', 'BF_DEBUG_CCFLAGS', 'BF_DEBUG_CXXFLAGS',
'C_WARN', 'CC_WARN', 'CXX_WARN', 'C_WARN', 'CC_WARN', 'CXX_WARN',
'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE', 'LLIBS', 'PLATFORM_LINKFLAGS','MACOSX_ARCHITECTURE', 'MACOSX_SDK_CHECK', 'XCODE_CUR_VER',
] ]
@ -462,6 +462,8 @@ def read_opts(env, cfg, args):
('LLIBS', 'Platform libs', []), ('LLIBS', 'Platform libs', []),
('PLATFORM_LINKFLAGS', 'Platform linkflags', []), ('PLATFORM_LINKFLAGS', 'Platform linkflags', []),
('MACOSX_ARCHITECTURE', 'python_arch.zip select', ''), ('MACOSX_ARCHITECTURE', 'python_arch.zip select', ''),
('MACOSX_SDK_CHECK', 'detect available OSX sdk`s', ''),
('XCODE_CUR_VER', 'detect XCode version', ''),
(BoolVariable('BF_PROFILE', 'Add profiling information if true', False)), (BoolVariable('BF_PROFILE', 'Add profiling information if true', False)),
('BF_PROFILE_CFLAGS', 'C only profiling flags', []), ('BF_PROFILE_CFLAGS', 'C only profiling flags', []),