AMBuildScript
changeset 2993 76da4d93e0d6
parent 2991 4663c6df82ab
child 2998 94e008ed3db9
     1.1 --- a/AMBuildScript	Thu May 13 04:20:41 2010 -0500
     1.2 +++ b/AMBuildScript	Thu May 13 04:22:31 2010 -0500
     1.3 @@ -147,6 +147,7 @@
     1.4  				                                      '/Developer/SDKs/MacOSX10.5.sdk'])
     1.5  				self.compiler.AddToListVar('POSTLINKFLAGS', '-mmacosx-version-min=10.5')
     1.6  				self.compiler.AddToListVar('POSTLINKFLAGS', ['-arch', 'i386'])
     1.7 +				self.compiler.AddToListVar('POSTLINKFLAGS', '-lstdc++')
     1.8  			elif AMBuild.target['platform'] == 'windows':
     1.9  				self.compiler.AddToListVar('CDEFINES', 'WIN32')
    1.10  				self.compiler.AddToListVar('CDEFINES', '_WINDOWS')
    1.11 @@ -223,6 +224,16 @@
    1.12  						os.lstat(link)
    1.13  					except:
    1.14  						job.AddCommand(SymlinkCommand(link, target))
    1.15 +		elif AMBuild.target['platform'] == 'darwin':
    1.16 +			staticLibs = os.path.join(sdkPath, 'lib', 'mac')
    1.17 +			workFolder = os.path.join(AMBuild.outputFolder, job.workFolder)
    1.18 +			for i in ['tier1_i486.a', 'mathlib_i486.a', 'libvstdlib.dylib', 'libtier0.dylib']:
    1.19 +				link = os.path.join(workFolder, i)
    1.20 +				target = os.path.join(staticLibs, i)
    1.21 +				try:
    1.22 +					os.lstat(link)
    1.23 +				except:
    1.24 +					job.AddCommand(SymlinkCommand(link, target))
    1.25  		elif AMBuild.target['platform'] == 'windows':
    1.26  			for lib in ['tier0', 'tier1', 'vstdlib', 'mathlib']:
    1.27  				libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib'
    1.28 @@ -230,7 +241,7 @@
    1.29  				builder['POSTLINKFLAGS'].append(libPath)
    1.30  
    1.31  	def PostSetupHL2Job(self, job, builder, sdk):
    1.32 -		if AMBuild.target['platform'] == 'linux':
    1.33 +		if AMBuild.target['platform'] in ['linux', 'darwin']:
    1.34  			builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a'])
    1.35  
    1.36  	def DefaultHL2Compiler(self, path, sdk, noLink = False, oldMms = '-legacy'):
    1.37 @@ -267,6 +278,8 @@
    1.38  		else:
    1.39  			if AMBuild.target['platform'] == 'linux':
    1.40  				staticLibs = os.path.join(sdkPath, 'lib', 'linux')
    1.41 +			elif AMBuild.target['platform'] == 'darwin':
    1.42 +				staticLibs = os.path.join(sdkPath, 'lib', 'mac')
    1.43  
    1.44  		for i in paths:
    1.45  			compiler['CXXINCLUDES'].append(os.path.join(sdkPath, *i))
    1.46 @@ -279,7 +292,10 @@
    1.47  					compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.so']
    1.48  				else:
    1.49  					compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so']
    1.50 -					compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so']				
    1.51 +					compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so']
    1.52 +			elif AMBuild.target['platform'] == 'darwin':
    1.53 +				compiler['POSTLINKFLAGS'][0:0] = ['libtier0.dylib']
    1.54 +				compiler['POSTLINKFLAGS'][0:0] = ['libvstdlib.dylib']
    1.55  
    1.56  		return compiler
    1.57