More changes for new build system.
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
for i in SM.sdkInfo:
|
||||
sdk = SM.sdkInfo[i]
|
||||
name = 'bintools.ext.' + sdk['ext']
|
||||
|
||||
compiler = SM.DefaultHL2Compiler('extensions/bintools', i, True, '')
|
||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit'))
|
||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit', 'x86'))
|
||||
|
||||
if i != 'ep1':
|
||||
compiler['CDEFINES'].append('HOOKING_ENABLED')
|
||||
|
||||
extension = AMBuild.AddJob(name)
|
||||
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
|
||||
SM.PreSetupHL2Job(extension, binary, i)
|
||||
binary.AddSourceFiles('extensions/bintools', [
|
||||
'extension.cpp',
|
||||
'CallMaker.cpp',
|
||||
'CallWrapper.cpp',
|
||||
'HookWrapper.cpp',
|
||||
'jit_call.cpp',
|
||||
'jit_hook.cpp',
|
||||
'sdk/smsdk_ext.cpp'
|
||||
])
|
||||
SM.PostSetupHL2Job(extension, binary, i)
|
||||
SM.AutoVersion('extensions/bintools', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
compiler = SM.DefaultExtCompiler('extensions/clientprefs')
|
||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
||||
|
||||
extension = AMBuild.AddJob('clientprefs.ext')
|
||||
binary = Cpp.LibraryBuilder('clientprefs.ext', AMBuild, extension, compiler)
|
||||
binary.AddSourceFiles('extensions/clientprefs', [
|
||||
'extension.cpp',
|
||||
'cookie.cpp',
|
||||
'menus.cpp',
|
||||
'natives.cpp',
|
||||
'query.cpp',
|
||||
'sdk/smsdk_ext.cpp'
|
||||
])
|
||||
SM.AutoVersion('extensions/clientprefs', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
sdk = SM.sdkInfo['ep1']
|
||||
compiler = SM.DefaultHL2Compiler('extensions/cstrike', 'ep1')
|
||||
|
||||
name = 'game.cstrike.ext.' + sdk['ext']
|
||||
extension = AMBuild.AddJob(name)
|
||||
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
|
||||
SM.PreSetupHL2Job(extension, binary, 'ep1')
|
||||
binary.AddSourceFiles('extensions/cstrike', [
|
||||
'extension.cpp',
|
||||
'natives.cpp',
|
||||
'RegNatives.cpp',
|
||||
'timeleft.cpp',
|
||||
'sdk/smsdk_ext.cpp'
|
||||
])
|
||||
SM.PostSetupHL2Job(extension, binary, 'ep1')
|
||||
SM.AutoVersion('extensions/cstrike', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python :
|
||||
import os.path
|
||||
import ambuild.command as command
|
||||
import ambuild.osutil as osutil
|
||||
|
||||
def BuildCURL():
|
||||
curl = AMBuild.AddJob('curl')
|
||||
if AMBuild.target['platform'] == 'linux':
|
||||
if not osutil.FileExists(os.path.join(AMBuild.outputFolder, 'curl', 'Makefile')):
|
||||
args = ['/bin/bash',
|
||||
os.path.join(AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'configure'),
|
||||
'--enable-static',
|
||||
'--disable-shared',
|
||||
'--disable-ldap',
|
||||
'--without-ssl',
|
||||
'--without-libidn',
|
||||
'--without-libssh2',
|
||||
'--without-zlib']
|
||||
curl.AddCommand(command.DirectCommand(args))
|
||||
curl.AddCommand(command.DirectCommand(['make']))
|
||||
else:
|
||||
args = ['vcbuild',
|
||||
os.path.join(AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'lib',
|
||||
'build_libcurl.vcproj'),
|
||||
'LIB Release']
|
||||
curl.AddCommand(command.DirectCommand(args))
|
||||
#die "Unable to find libcurl.lib!\n" unless (-f "LIB-Release\\libcurl.lib");
|
||||
|
||||
BuildCURL()
|
||||
|
||||
compiler = SM.DefaultExtCompiler('extensions/curl')
|
||||
extension = AMBuild.AddJob('webternet.ext')
|
||||
binary = Cpp.LibraryBuilder('webternet.ext', AMBuild, extension, compiler)
|
||||
|
||||
curlPath = [AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'include']
|
||||
compiler['CXXINCLUDES'].append(os.path.join(*curlPath))
|
||||
compiler['CDEFINES'].append('CURL_STATICLIB')
|
||||
|
||||
binary.AddSourceFiles('extensions/curl', [
|
||||
'extension.cpp',
|
||||
'curlapi.cpp',
|
||||
'sdk/smsdk_ext.cpp',
|
||||
])
|
||||
|
||||
if AMBuild.target['platform'] == 'linux':
|
||||
path = os.path.join(AMBuild.outputFolder,
|
||||
'curl',
|
||||
'lib',
|
||||
'.libs',
|
||||
'libcurl.a')
|
||||
binary['POSTLINKFLAGS'].append('-lrt')
|
||||
binary.AddObjectFiles([path])
|
||||
elif AMBuild.target['platform'] == 'windows':
|
||||
path = os.path.join(AMBuild.sourceFolder,
|
||||
'extensions',
|
||||
'curl',
|
||||
'curl-src',
|
||||
'lib',
|
||||
'LIB-Release',
|
||||
'libcurl.lib')
|
||||
if os.path.isfile(path):
|
||||
binary.RelinkIfNewer(path)
|
||||
binary['POSTLINKFLAGS'].extend([path, 'ws2_32.lib'])
|
||||
|
||||
SM.AutoVersion('extensions/curl', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
compiler = SM.DefaultExtCompiler('extensions/geoip')
|
||||
|
||||
extension = AMBuild.AddJob('geoip.ext')
|
||||
binary = Cpp.LibraryBuilder('geoip.ext', AMBuild, extension, compiler)
|
||||
binary.AddSourceFiles('extensions/geoip', [
|
||||
'extension.cpp',
|
||||
'GeoIP.c',
|
||||
'sdk/smsdk_ext.cpp'
|
||||
])
|
||||
if AMBuild.target['platform'] == 'windows':
|
||||
binary['POSTLINKFLAGS'].append('wsock32.lib')
|
||||
SM.AutoVersion('extensions/geoip', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
compiler = SM.DefaultExtCompiler('extensions/mysql')
|
||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['MYSQL5'], 'include'))
|
||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
||||
|
||||
extension = AMBuild.AddJob('dbi.mysql.ext')
|
||||
binary = Cpp.LibraryBuilder('dbi.mysql.ext', AMBuild, extension, compiler)
|
||||
|
||||
if AMBuild.target['platform'] == 'linux':
|
||||
lib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'libmysqlclient_r.a')
|
||||
link = [lib,
|
||||
'-lz',
|
||||
'-lpthread',
|
||||
'-lm']
|
||||
binary.RelinkIfNewer(lib)
|
||||
binary['POSTLINKFLAGS'].extend(link)
|
||||
elif AMBuild.target['platform'] == 'windows':
|
||||
mylib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'opt', 'mysqlclient.lib')
|
||||
zlib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'opt', 'zlib.lib')
|
||||
binary.RelinkIfNewer(mylib)
|
||||
binary.RelinkIfNewer(zlib)
|
||||
binary['POSTLINKFLAGS'].extend([mylib, zlib, 'wsock32.lib'])
|
||||
|
||||
|
||||
binary.AddSourceFiles('extensions/mysql', [
|
||||
'sdk/smsdk_ext.cpp',
|
||||
'mysql/MyBasicResults.cpp',
|
||||
'mysql/MyBoundResults.cpp',
|
||||
'mysql/MyDatabase.cpp',
|
||||
'mysql/MyDriver.cpp',
|
||||
'mysql/MyStatement.cpp',
|
||||
'extension.cpp'
|
||||
])
|
||||
SM.AutoVersion('extensions/mysql', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
compiler = SM.DefaultExtCompiler('extensions/regex')
|
||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
||||
|
||||
extension = AMBuild.AddJob('regex.ext')
|
||||
binary = Cpp.LibraryBuilder('regex.ext', AMBuild, extension, compiler)
|
||||
|
||||
if AMBuild.target['platform'] == 'linux':
|
||||
path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_linux', 'libpcre.a')
|
||||
elif AMBuild.target['platform'] == 'windows':
|
||||
path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_win', 'pcre.lib')
|
||||
|
||||
binary.RelinkIfNewer(path)
|
||||
binary['POSTLINKFLAGS'].append(path)
|
||||
|
||||
binary.AddSourceFiles('extensions/regex', [
|
||||
'extension.cpp',
|
||||
'CRegEx.cpp',
|
||||
'sdk/smsdk_ext.cpp',
|
||||
])
|
||||
SM.AutoVersion('extensions/regex', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
for i in SM.sdkInfo:
|
||||
compiler = SM.DefaultHL2Compiler('extensions/sdktools', i)
|
||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit'))
|
||||
compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit', 'x86'))
|
||||
|
||||
if i != 'ep1':
|
||||
compiler['CDEFINES'].append('HOOKING_ENABLED')
|
||||
|
||||
sdk = SM.sdkInfo[i]
|
||||
name = 'sdktools.ext.' + sdk['ext']
|
||||
extension = AMBuild.AddJob(name)
|
||||
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
|
||||
SM.PreSetupHL2Job(extension, binary, i)
|
||||
binary.AddSourceFiles('extensions/sdktools', [
|
||||
'extension.cpp',
|
||||
'inputnatives.cpp',
|
||||
'output.cpp',
|
||||
'outputnatives.cpp',
|
||||
'tempents.cpp',
|
||||
'tenatives.cpp',
|
||||
'teamnatives.cpp',
|
||||
'trnatives.cpp',
|
||||
'vcaller.cpp',
|
||||
'vcallbuilder.cpp',
|
||||
'vdecoder.cpp',
|
||||
'vglobals.cpp',
|
||||
'vhelpers.cpp',
|
||||
'vnatives.cpp',
|
||||
'voice.cpp',
|
||||
'vsound.cpp',
|
||||
'vstringtable.cpp',
|
||||
'sdk/smsdk_ext.cpp'
|
||||
])
|
||||
SM.PostSetupHL2Job(extension, binary, i)
|
||||
SM.AutoVersion('extensions/sdktools', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
compiler = SM.DefaultExtCompiler('extensions/sqlite')
|
||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
||||
|
||||
compiler['CDEFINES'].extend(['SQLITE_OMIT_LOAD_EXTENSION', 'SQLITE_THREADSAFE'])
|
||||
if AMBuild.target['platform'] == 'linux':
|
||||
compiler['POSTLINKFLAGS'].extend(['-ldl', '-lpthread'])
|
||||
|
||||
extension = AMBuild.AddJob('dbi.sqlite.ext')
|
||||
binary = Cpp.LibraryBuilder('dbi.sqlite.ext', AMBuild, extension, compiler)
|
||||
files = [
|
||||
'sdk/smsdk_ext.cpp', 'sdk/sm_memtable.cpp', 'extension.cpp',
|
||||
'driver/SqDatabase.cpp', 'driver/SqDriver.cpp', 'driver/SqQuery.cpp',
|
||||
'driver/SqResults.cpp', 'sqlite-source/alter.c', 'sqlite-source/analyze.c',
|
||||
'sqlite-source/attach.c', 'sqlite-source/auth.c', 'sqlite-source/btree.c',
|
||||
'sqlite-source/build.c', 'sqlite-source/callback.c', 'sqlite-source/complete.c',
|
||||
'sqlite-source/date.c', 'sqlite-source/delete.c', 'sqlite-source/expr.c',
|
||||
'sqlite-source/func.c', 'sqlite-source/hash.c', 'sqlite-source/insert.c',
|
||||
'sqlite-source/legacy.c', 'sqlite-source/main.c', 'sqlite-source/malloc.c',
|
||||
'sqlite-source/opcodes.c', 'sqlite-source/os.c',
|
||||
'sqlite-source/pager.c', 'sqlite-source/parse.c', 'sqlite-source/pragma.c',
|
||||
'sqlite-source/prepare.c', 'sqlite-source/printf.c', 'sqlite-source/random.c',
|
||||
'sqlite-source/select.c', 'sqlite-source/table.c', 'sqlite-source/tokenize.c',
|
||||
'sqlite-source/trigger.c', 'sqlite-source/update.c', 'sqlite-source/utf.c',
|
||||
'sqlite-source/util.c', 'sqlite-source/vacuum.c', 'sqlite-source/vdbe.c',
|
||||
'sqlite-source/vdbeapi.c', 'sqlite-source/vdbeaux.c', 'sqlite-source/vdbeblob.c',
|
||||
'sqlite-source/vdbefifo.c', 'sqlite-source/vdbemem.c', 'sqlite-source/vtab.c',
|
||||
'sqlite-source/where.c', 'sqlite-source/btmutex.c', 'sqlite-source/journal.c',
|
||||
'sqlite-source/mem1.c', 'sqlite-source/mem2.c', 'sqlite-source/mutex.c'
|
||||
]
|
||||
if AMBuild.target['platform'] == 'windows':
|
||||
files.extend(['sqlite-source/mutex_w32.c', 'sqlite-source/os_win.c'])
|
||||
elif AMBuild.target['platform'] == 'linux':
|
||||
files.extend(['sqlite-source/mutex_unix.c', 'sqlite-source/os_unix.c'])
|
||||
binary.AddSourceFiles('extensions/sqlite', files)
|
||||
SM.AutoVersion('extensions/sqlite', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
sdk = SM.sdkInfo['ep2v']
|
||||
compiler = SM.DefaultHL2Compiler('extensions/tf2', 'ep2v')
|
||||
if compiler.cc.name == 'gcc':
|
||||
compiler['CFLAGS'].append('-Wno-parentheses')
|
||||
|
||||
name = 'game.tf2.ext.' + sdk['ext']
|
||||
extension = AMBuild.AddJob(name)
|
||||
binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler)
|
||||
SM.PreSetupHL2Job(extension, binary, 'ep2v')
|
||||
binary.AddSourceFiles('extensions/tf2', [
|
||||
'extension.cpp',
|
||||
'natives.cpp',
|
||||
'RegNatives.cpp',
|
||||
'util.cpp',
|
||||
'criticals.cpp',
|
||||
'CDetour/detours.cpp',
|
||||
'sdk/smsdk_ext.cpp',
|
||||
'asm/asm.c'
|
||||
])
|
||||
SM.PostSetupHL2Job(extension, binary, 'ep2v')
|
||||
SM.AutoVersion('extensions/tf2', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
compiler = SM.DefaultExtCompiler('extensions/topmenus')
|
||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
||||
|
||||
extension = AMBuild.AddJob('topmenus.ext')
|
||||
binary = Cpp.LibraryBuilder('topmenus.ext', AMBuild, extension, compiler)
|
||||
binary.AddSourceFiles('extensions/topmenus', [
|
||||
'extension.cpp',
|
||||
'smn_topmenus.cpp',
|
||||
'TopMenu.cpp',
|
||||
'TopMenuManager.cpp',
|
||||
'sdk/smsdk_ext.cpp',
|
||||
'sdk/sm_memtable.cpp'
|
||||
])
|
||||
SM.AutoVersion('extensions/topmenus', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
# vim: set ts=2 sw=2 tw=99 noet ft=python:
|
||||
import os
|
||||
|
||||
compiler = SM.DefaultExtCompiler('extensions/updater')
|
||||
compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook'))
|
||||
|
||||
extension = AMBuild.AddJob('updater.ext')
|
||||
binary = Cpp.LibraryBuilder('updater.ext', AMBuild, extension, compiler)
|
||||
binary.AddSourceFiles('extensions/updater', [
|
||||
'extension.cpp',
|
||||
'MemoryDownloader.cpp',
|
||||
'Updater.cpp',
|
||||
'md5.cpp',
|
||||
'sdk/smsdk_ext.cpp'
|
||||
])
|
||||
SM.AutoVersion('extensions/updater', binary)
|
||||
binary.SendToJob()
|
||||
|
||||
Reference in New Issue
Block a user