From c4e90ce8650e6a2feca4d744d35814cad9d36164 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 8 Feb 2014 01:14:15 -0800 Subject: [PATCH] Initial import of AMBuild infrastructure for C++ projects. Former-commit-id: 53baa4f8c25525674f5e71f8f6ff2663928500ab --- AMBuildScript | 260 +++++++++++++++++++++++++++++++++ amxmodx/AMBuilder | 84 +++++++++++ compiler/amxxpc/AMBuilder | 26 ++++ compiler/amxxpc/amx.cpp | 2 +- compiler/libpc300/AMBuilder | 38 +++++ configure.py | 31 ++++ dlls/cstrike/cstrike/AMBuilder | 13 ++ dlls/cstrike/csx/AMBuilder | 15 ++ dlls/dod/dodfun/AMBuilder | 16 ++ dlls/dod/dodx/AMBuilder | 17 +++ dlls/engine/AMBuilder | 16 ++ dlls/fakemeta/AMBuilder | 20 +++ dlls/fun/AMBuilder | 11 ++ dlls/geoip/AMBuilder | 12 ++ dlls/hamsandwich/AMBuilder | 19 +++ dlls/mysqlx/AMBuilder | 48 ++++++ dlls/ns/AMBuilder | 25 ++++ dlls/nvault/AMBuilder | 14 ++ dlls/regex/AMBuilder | 19 +++ dlls/sockets/AMBuilder | 11 ++ dlls/sqlite/AMBuilder | 74 ++++++++++ dlls/tfcx/AMBuilder | 17 +++ dlls/ts/tsfun/AMBuilder | 10 ++ dlls/ts/tsx/AMBuilder | 17 +++ 24 files changed, 814 insertions(+), 1 deletion(-) create mode 100644 AMBuildScript create mode 100644 amxmodx/AMBuilder create mode 100644 compiler/amxxpc/AMBuilder create mode 100644 compiler/libpc300/AMBuilder create mode 100644 configure.py create mode 100644 dlls/cstrike/cstrike/AMBuilder create mode 100644 dlls/cstrike/csx/AMBuilder create mode 100644 dlls/dod/dodfun/AMBuilder create mode 100644 dlls/dod/dodx/AMBuilder create mode 100644 dlls/engine/AMBuilder create mode 100644 dlls/fakemeta/AMBuilder create mode 100644 dlls/fun/AMBuilder create mode 100644 dlls/geoip/AMBuilder create mode 100644 dlls/hamsandwich/AMBuilder create mode 100644 dlls/mysqlx/AMBuilder create mode 100644 dlls/ns/AMBuilder create mode 100644 dlls/nvault/AMBuilder create mode 100644 dlls/regex/AMBuilder create mode 100644 dlls/sockets/AMBuilder create mode 100644 dlls/sqlite/AMBuilder create mode 100644 dlls/tfcx/AMBuilder create mode 100644 dlls/ts/tsfun/AMBuilder create mode 100644 dlls/ts/tsx/AMBuilder diff --git a/AMBuildScript b/AMBuildScript new file mode 100644 index 00000000..9c1dd5c9 --- /dev/null +++ b/AMBuildScript @@ -0,0 +1,260 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python : +import os + +class AMXXConfig(object): + def __init__(self): + self.binaries = [] + self.modules = [] + self.libpc300 = None + self.metamod_path = None + self.hlsdk_path = None + self.mysql_path = None + + def detectProductVersion(self): + builder.AddConfigureFile('product.version') + + # For OS X dylib versioning + import re + with open(os.path.join(builder.sourcePath, 'product.version'), 'r') as fp: + productContents = fp.read() + m = re.match('(\d+)\.(\d+)\.(\d+).*', productContents) + if m == None: + self.productVersion = '1.0.0' + else: + major, minor, release = m.groups() + self.productVersion = '{0}.{1}.{2}'.format(major, minor, release) + + def detectMetamod(self): + if len(builder.options.metamod_path): + self.metamod_path = os.path.join(builder.originalCwd, builder.options.metamod_path) + if not os.path.exists(os.path.join(self.metamod_path, 'metamod')): + raise Exception('Metamod path does not exist: {0}'.format(builder.options.metamod_path)) + else: + try_paths = [ + os.path.join(builder.sourcePath, '..', 'metamod'), + os.path.join(builder.sourcePath, '..', 'metamod-am'), + ] + for try_path in try_paths: + if os.path.exists(os.path.join(try_path, 'metamod')): + self.metamod_path = os.path.normpath(try_path) + break + if not self.metamod_path: + raise Exception('Could not find the source code to Metamod! Try passing --metamod to configure.py.') + + def detectHlsdk(self): + if len(builder.options.hlsdk_path): + self.hlsdk_path = os.path.join(builder.originalCwd, builder.options.hlsdk_path) + if not os.path.exists(self.hlsdk_path): + raise Exception('Metamod path does not exist: {0}'.format(builder.options.hlsdk_path)) + else: + try_paths = [ + os.path.join(builder.sourcePath, '..', 'hlsdk'), + ] + for try_path in try_paths: + if os.path.exists(try_path): + self.hlsdk_path = os.path.normpath(try_path) + break + if not self.hlsdk_path: + raise Exception('Could not find the HLSDK! Try passing --hlsdk to configure.py.') + + def detectMysql(self): + if builder.options.disable_mysql: + return + + if len(builder.options.mysql_path): + self.mysql_path = os.path.join(builder.originalCwd, builder.options.mysql_path) + if not os.path.exists(self.mysql_path): + raise Exception('Metamod path does not exist: {0}'.format(builder.options.mysql_path)) + else: + try_paths = [ + os.path.join(builder.sourcePath, '..', 'mysql-5.0'), + ] + for try_path in try_paths: + if os.path.exists(try_path): + self.mysql_path = os.path.normpath(try_path) + break + if not self.mysql_path: + raise Exception('Could not find MySQL! Try passing --mysql to configure.py.') + + def configure(self): + builder.AddConfigureFile('pushbuild.txt') + + cfg = builder.DetectCompilers() + cxx = cfg.cxx + + if cxx.behavior == 'gcc': + cfg.cflags += [ + '-pipe', + '-fno-strict-aliasing', + '-Wall', + '-Werror', + '-Wno-uninitialized', + '-Wno-unused', + '-Wno-switch', + '-m32', + ] + + cfg.linkflags += ['-m32'] + + have_gcc = cxx.name == 'gcc' + have_clang = cxx.name == 'clang' + + if have_gcc: + cfg.cflags += ['-Wno-parentheses'] + elif have_clang: + cfg.cflags += ['-Wno-logical-op-parentheses'] + + # Platform-specifics + if builder.target_platform == 'linux': + cfg.defines += ['_LINUX', 'POSIX', 'LINUX'] + if cxx.name == 'gcc': + cfg.linkflags += ['-static-libgcc'] + elif cxx.name == 'clang': + cfg.linkflags += ['-lgcc_eh'] + elif builder.target_platform == 'mac': + cfg.defines += ['OSX', '_OSX', 'POSIX'] + cfg.linkflags += [ + '-mmacosx-version-min=10.5', + '-arch', 'i386', + '-lstdc++', + '-stdlib=libstdc++', + ] + cfg.cxxflags += ['-stdlib=libstdc++'] + elif builder.target_platform == 'windows': + cfg.defines += ['WIN32', '_WINDOWS'] + + # Finish up. + cfg.defines += [ + 'AMX_NOPROPLIST', + 'PAWN_CELL_SIZE=32', + ] + + # + # Low-level compiler and binary construction. + # + + def MMCompiler(self, context): + compiler = context.compiler.clone() + compiler.cxxincludes += [ + os.path.join(self.metamod_path, 'metamod'), + os.path.join(self.hlsdk_path, 'common'), + os.path.join(self.hlsdk_path, 'dlls'), + os.path.join(self.hlsdk_path, 'engine'), + os.path.join(self.hlsdk_path, 'game_shared'), + os.path.join(self.hlsdk_path, 'public'), + os.path.join(self.hlsdk_path, 'pm_shared'), + ] + return compiler + + def LibraryBuilder(self, context, compiler, name): + binary = compiler.Library(name) + binary.compiler.cxxincludes += [os.path.join(context.currentSourcePath)] + if builder.target_platform == 'windows': + #binary.sources += ['version.rc'] + #binary.compiler.rcdefines += [ + # 'BINARY_NAME="{0}"'.format(binary.outputFile), + # 'SM_GENERATED_BUILD', + # 'RC_COMPILE', + #] + pass + elif builder.target_platform == 'mac': + binary.compiler.postlink += [ + '-compatibility_version', '1.0.0', + '-current_version', self.productVersion + ] + #binary.compiler.linkflags += [self.versionlib] + #binary.compiler.sourcedeps += SM.generated_headers + return binary + + def ModuleBuilder(self, context, compiler, name): + compiler.cxxincludes += [ + os.path.join(context.currentSourcePath, 'sdk'), + ] + + if builder.target_platform == 'mac': + name = name + '_amxx' + elif builder.target_platform == 'linux': + name = name + '_amxx_i386' + + return self.LibraryBuilder(context, compiler, name) + + def ProgramBuilder(self, context, compiler, name): + binary = compiler.Program(name) + binary.compiler.cxxincludes += [os.path.join(context.currentSourcePath)] + # if builder.target_platform == 'windows': + # binary.sources += ['version.rc'] + # binary.compiler.rcdefines += [ + # 'BINARY_NAME="{0}"'.format(binary.outputFile), + # 'SM_GENERATED_BUILD', + # 'RC_COMPILE', + # ] + # binary.compiler.linkflags += [self.versionlib] + # binary.compiler.sourcedeps += SM.generated_headers + return binary + + # + # High level job construction for libraries, metamod plugins, modules, and + # executables. + # + + def Library(self, context, name): + compiler = context.compiler.clone() + return self.LibraryBuilder(context, compiler, name) + + def MetaPlugin(self, context, name): + compiler = self.MMCompiler(context) + + if builder.target_platform == 'mac': + name = name + '_mm' + elif builder.target_platform == 'linux': + name = name + '_mm_i386' + + return self.LibraryBuilder(context, compiler, name) + + def Module(self, context, name): + compiler = context.compiler.clone() + return self.ModuleBuilder(context, compiler, name) + + def MetaModule(self, context, name): + compiler = self.MMCompiler(context) + return self.ModuleBuilder(context, compiler, name) + + def Program(self, context, name): + compiler = context.compiler.clone() + return self.ProgramBuilder(context, compiler, name) + +AMXX = AMXXConfig() +AMXX.detectProductVersion() +AMXX.detectMetamod() +AMXX.detectHlsdk() +AMXX.detectMysql() +AMXX.configure() + +builder.RunBuildScripts( + [ + 'amxmodx/AMBuilder', + 'compiler/amxxpc/AMBuilder', + 'compiler/libpc300/AMBuilder', + 'dlls/cstrike/cstrike/AMBuilder', + 'dlls/cstrike/csx/AMBuilder', + 'dlls/dod/dodfun/AMBuilder', + 'dlls/dod/dodx/AMBuilder', + 'dlls/engine/AMBuilder', + 'dlls/fakemeta/AMBuilder', + 'dlls/fun/AMBuilder', + 'dlls/geoip/AMBuilder', + 'dlls/hamsandwich/AMBuilder', + 'dlls/mysqlx/AMBuilder', + 'dlls/ns/AMBuilder', + 'dlls/nvault/AMBuilder', + 'dlls/regex/AMBuilder', + 'dlls/sockets/AMBuilder', + 'dlls/sqlite/AMBuilder', + 'dlls/tfcx/AMBuilder', + 'dlls/ts/tsfun/AMBuilder', + 'dlls/ts/tsx/AMBuilder', + ], + { + 'AMXX': AMXX + } +) diff --git a/amxmodx/AMBuilder b/amxmodx/AMBuilder new file mode 100644 index 00000000..81787fc8 --- /dev/null +++ b/amxmodx/AMBuilder @@ -0,0 +1,84 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaPlugin(builder, 'amxmodx') + +binary.compiler.defines += [ + 'JIT', + 'ASM32', + 'HAVE_STDINT_H', +] + +if builder.target_platform == 'mac': + jit_objects = [ + binary.Dep('JIT/amxexecn-darwin.o'), + binary.Dep('JIT/amxjitsn-darwin.o'), + binary.Dep('JIT/natives-darwin-x86.o'), + binary.Dep('JIT/helpers-darwin-x86.o'), + ] +elif builder.target_platform == 'linux': + jit_objects = [ + binary.Dep('JIT/amxexecn.o'), + binary.Dep('JIT/amxjitsn.o'), + binary.Dep('JIT/natives-x86.o'), + binary.Dep('JIT/helpers-x86.o'), + ] + +if builder.target_platform == 'linux': + binary.compiler.postlink += [binary.Dep('zlib/libz.a')] +elif builder.target_platform == 'mac': + binary.compiler.postlink += [binary.Dep('zlib/libz-darwin.a')] +elif builder.target_platform == 'windows': + binary.compiler.postlink += [binary.Dep('zlib\\zlib.lib')] + +binary.sources = [ + 'meta_api.cpp', + 'CFile.cpp', + 'CVault.cpp', + 'vault.cpp', + 'float.cpp', + 'file.cpp', + 'modules.cpp', + 'CMisc.cpp', + 'CTask.cpp', + 'string.cpp', + 'amxmodx.cpp', + 'CEvent.cpp', + 'CCmd.cpp', + 'CLogEvent.cpp', + 'srvcmd.cpp', + 'strptime.cpp', + 'amxcore.cpp', + 'amxtime.cpp', + 'power.cpp', + 'amxxlog.cpp', + 'fakemeta.cpp', + 'amxxfile.cpp', + 'CLang.cpp', + 'md5.cpp', + 'emsg.cpp', + 'CForward.cpp', + 'CPlugin.cpp', + 'CModule.cpp', + 'CMenu.cpp', + 'util.cpp', + 'amx.cpp', + 'amxdbg.cpp', + 'natives.cpp', + 'newmenus.cpp', + 'debugger.cpp', + 'optimizer.cpp', + 'format.cpp', + 'messages.cpp', + 'libraries.cpp', + 'vector.cpp', + 'sorting.cpp', + 'amxmod_compat.cpp', + 'nongpl_matches.cpp', + 'CFlagManager.cpp', + 'datastructs.cpp', + 'trie_natives.cpp', +] +binary.compiler.linkflags += jit_objects + +AMXX.binaries += [builder.Add(binary)] diff --git a/compiler/amxxpc/AMBuilder b/compiler/amxxpc/AMBuilder new file mode 100644 index 00000000..5cac7eb1 --- /dev/null +++ b/compiler/amxxpc/AMBuilder @@ -0,0 +1,26 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.Program(builder, 'amxxpc') + +binary.compiler.defines += [ + 'AMX_ANSIONLY', +] + +if builder.target_platform == 'linux': + binary.compiler.postlink += [ + '-ldl', + binary.Dep('libz.a'), + ] +elif builder.target_platform == 'mac': + binary.compiler.postlink += [binary.Dep('libz-darwin.a')] +elif builder.target_platform == 'windows': + binary.compiler.postlink += [binary.Dep('zlib.lib')] + +binary.sources = [ + 'amx.cpp', + 'amxxpc.cpp', + 'Binary.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/compiler/amxxpc/amx.cpp b/compiler/amxxpc/amx.cpp index 9e63576e..a7f5da7a 100755 --- a/compiler/amxxpc/amx.cpp +++ b/compiler/amxxpc/amx.cpp @@ -775,7 +775,7 @@ static void expand(unsigned char *code, long codesize, long memsize) do { codesize--; /* no input byte should be shifted out completely */ - assert(shift<8*sizeof(cell)); + assert(size_t(shift)<8*sizeof(cell)); /* we work from the end of a sequence backwards; the final code in * a sequence may not have the continuation bit set */ assert(shift>0 || (code[(size_t)codesize] & 0x80)==0); diff --git a/compiler/libpc300/AMBuilder b/compiler/libpc300/AMBuilder new file mode 100644 index 00000000..cad9cc6f --- /dev/null +++ b/compiler/libpc300/AMBuilder @@ -0,0 +1,38 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.Library(builder, 'amxxpc32') + +binary.compiler.includes += [builder.currentSourcePath] + +if builder.target_platform in ['mac', 'linux']: + binary.compiler.defines += ['ENABLE_BINRELOC'] + binary.compiler.postlink += ['-lm', '-lpthread'] + +binary.compiler.defines += [ + 'NO_MAIN', + 'PAWNC_DLL', + 'HAVE_STDINT_H', +] + +binary.sources = [ + 'sc1.c', + 'sc2.c', + 'sc3.c', + 'sc4.c', + 'sc5.c', + 'sc6.c', + 'sc7.c', + 'scvars.c', + 'scmemfil.c', + 'scstate.c', + 'sclist.c', + 'sci18n.c', + 'scexpand.c', + 'pawncc.c', + 'libpawnc.c', + 'prefix.c', + 'memfile.c', +] + +AMXX.libpc300 = [builder.Add(binary)] diff --git a/configure.py b/configure.py new file mode 100644 index 00000000..ac300c98 --- /dev/null +++ b/configure.py @@ -0,0 +1,31 @@ +# vim: set ts=2 sw=2 tw=99 noet: +import sys +try: + from ambuild2 import run +except: + try: + import ambuild + sys.stderr.write('It looks like you have AMBuild 1 installed, but this project uses AMBuild 2.\n') + sys.stderr.write('Upgrade to the latest version of AMBuild to continue.\n') + except: + sys.stderr.write('AMBuild must be installed to build this project.\n') + sys.stderr.write('http://www.alliedmods.net/ambuild\n') + sys.exit(1) + +run = run.PrepareBuild(sourcePath=sys.path[0]) +run.default_build_folder = 'obj-' + run.target_platform +run.options.add_option('--enable-debug', action='store_const', const='1', dest='debug', + help='Enable debugging symbols') +run.options.add_option('--enable-optimize', action='store_const', const='1', dest='opt', + help='Enable optimization') +run.options.add_option('--no-mysql', action='store_true', default=False, dest='disable_mysql', + help='Disable building MySQL extension') +run.options.add_option('--breakpad-dump', action='store_true', dest='breakpad_dump', + default=False, help='Dump and upload breakpad symbols') +run.options.add_option('--metamod', type='string', dest='metamod_path', default='', + help='Path to Metamod source code') +run.options.add_option('--hlsdk', type='string', dest='hlsdk_path', default='', + help='Path to the HLSDK') +run.options.add_option('--mysql', type='string', dest='mysql_path', default='', + help='Path to MySQL') +run.Configure() diff --git a/dlls/cstrike/cstrike/AMBuilder b/dlls/cstrike/cstrike/AMBuilder new file mode 100644 index 00000000..dbb36069 --- /dev/null +++ b/dlls/cstrike/cstrike/AMBuilder @@ -0,0 +1,13 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'cstrike') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'CstrikePlayer.cpp', + 'cstrike.cpp', + 'CstrikeHacks.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/cstrike/csx/AMBuilder b/dlls/cstrike/csx/AMBuilder new file mode 100644 index 00000000..3f1546ff --- /dev/null +++ b/dlls/cstrike/csx/AMBuilder @@ -0,0 +1,15 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'csx') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'CRank.cpp', + 'CMisc.cpp', + 'meta_api.cpp', + 'rank.cpp', + 'usermsg.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/dod/dodfun/AMBuilder b/dlls/dod/dodfun/AMBuilder new file mode 100644 index 00000000..cdc4c875 --- /dev/null +++ b/dlls/dod/dodfun/AMBuilder @@ -0,0 +1,16 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'dodfun') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'NBase.cpp', + 'CMisc.cpp', + 'NPD.cpp', + 'Utils.cpp', + 'usermsg.cpp', + 'moduleconfig.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/dod/dodx/AMBuilder b/dlls/dod/dodx/AMBuilder new file mode 100644 index 00000000..458b79cb --- /dev/null +++ b/dlls/dod/dodx/AMBuilder @@ -0,0 +1,17 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'dodx') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'CRank.cpp', + 'CMisc.cpp', + 'NBase.cpp', + 'NRank.cpp', + 'usermsg.cpp', + 'Utils.cpp', + 'moduleconfig.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/engine/AMBuilder b/dlls/engine/AMBuilder new file mode 100644 index 00000000..a49bdc64 --- /dev/null +++ b/dlls/engine/AMBuilder @@ -0,0 +1,16 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'engine') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'amxxapi.cpp', + 'engine.cpp', + 'entity.cpp', + 'globals.cpp', + 'forwards.cpp', + 'amxmod_compat.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/fakemeta/AMBuilder b/dlls/fakemeta/AMBuilder new file mode 100644 index 00000000..a6ce3273 --- /dev/null +++ b/dlls/fakemeta/AMBuilder @@ -0,0 +1,20 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'fakemeta') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'dllfunc.cpp', + 'engfunc.cpp', + 'fakemeta_amxx.cpp', + 'pdata.cpp', + 'forward.cpp', + 'fm_tr.cpp', + 'pev.cpp', + 'glb.cpp', + 'fm_tr2.cpp', + 'misc.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/fun/AMBuilder b/dlls/fun/AMBuilder new file mode 100644 index 00000000..11679f83 --- /dev/null +++ b/dlls/fun/AMBuilder @@ -0,0 +1,11 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'fun') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'fun.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/geoip/AMBuilder b/dlls/geoip/AMBuilder new file mode 100644 index 00000000..8d0b0d01 --- /dev/null +++ b/dlls/geoip/AMBuilder @@ -0,0 +1,12 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.Module(builder, 'geoip') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'GeoIP.c', + 'geoip_amxx.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/hamsandwich/AMBuilder b/dlls/hamsandwich/AMBuilder new file mode 100644 index 00000000..b368071e --- /dev/null +++ b/dlls/hamsandwich/AMBuilder @@ -0,0 +1,19 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'hamsandwich') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'amxx_api.cpp', + 'config_parser.cpp', + 'hook_callbacks.cpp', + 'hook_native.cpp', + 'srvcmd.cpp', + 'call_funcs.cpp', + 'hook_create.cpp', + 'DataHandler.cpp', + 'pdata.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/mysqlx/AMBuilder b/dlls/mysqlx/AMBuilder new file mode 100644 index 00000000..8e590054 --- /dev/null +++ b/dlls/mysqlx/AMBuilder @@ -0,0 +1,48 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +if AMXX.mysql_path: + binary = AMXX.MetaModule(builder, 'mysql') + + binary.compiler.cxxincludes += [ + os.path.join(AMXX.mysql_path, 'include'), + os.path.join(builder.currentSourcePath, 'mysql'), + os.path.join(builder.currentSourcePath, 'thread'), + ] + + binary.compiler.defines += [ + 'SM_DEFAULT_THREADER', + 'stricmp=strcasecmp', + ] + + if builder.target_platform is 'linux' or builder.target_platform is 'mac': + binary.compiler.postlink += [ + os.path.join(AMXX.mysql_path, 'lib', 'libmysqlclient_r.a'), + '-lz', + '-lpthread', + '-lm' + ] + elif builder.target_platform is 'windows': + binary.compiler.postlink += [ + os.path.join(AMXX.mysql_path, 'lib', 'opt', 'mysqlclient.lib'), + os.path.join(AMXX.mysql_path, 'lib', 'opt', 'zlib.lib'), + 'wsock32.lib' + ] + + binary.sources = [ + 'basic_sql.cpp', + 'handles.cpp', + 'module.cpp', + 'threading.cpp', + 'sdk/amxxmodule.cpp', + 'oldcompat_sql.cpp', + 'thread/BaseWorker.cpp', + 'thread/ThreadWorker.cpp', + 'thread/PosixThreads.cpp', + 'mysql/MysqlQuery.cpp', + 'mysql/MysqlResultSet.cpp', + 'mysql/MysqlDatabase.cpp', + 'mysql/MysqlDriver.cpp', + ] + + AMXX.modules += [builder.Add(binary)] diff --git a/dlls/ns/AMBuilder b/dlls/ns/AMBuilder new file mode 100644 index 00000000..cb199fb9 --- /dev/null +++ b/dlls/ns/AMBuilder @@ -0,0 +1,25 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'ns') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'dllapi.cpp', + 'utils.cpp', + 'amxxapi.cpp', + 'engineapi.cpp', + 'TitleManager.cpp', + 'ParticleManager.cpp', + 'MessageHandler.cpp', + 'GameManager.cpp', + 'natives/general.cpp', + 'natives/player.cpp', + 'natives/player_memory.cpp', + 'natives/structure.cpp', + 'natives/weapons.cpp', + 'natives/particles.cpp', + 'natives/memberfuncs.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/nvault/AMBuilder b/dlls/nvault/AMBuilder new file mode 100644 index 00000000..3cb1e0e9 --- /dev/null +++ b/dlls/nvault/AMBuilder @@ -0,0 +1,14 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.Module(builder, 'nvault') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'amxxapi.cpp', + 'Binary.cpp', + 'Journal.cpp', + 'NVault.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/regex/AMBuilder b/dlls/regex/AMBuilder new file mode 100644 index 00000000..cdb16f33 --- /dev/null +++ b/dlls/regex/AMBuilder @@ -0,0 +1,19 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.Module(builder, 'regex') + +if builder.target_platform == 'linux': + binary.compiler.postlink += [binary.Dep('lib_linux/libpcre.a')] +elif builder.target_platform == 'mac': + binary.compiler.postlink += [binary.Dep('lib_darwin/libpcre.a')] +elif builder.target_platform == 'windows': + binary.compiler.postlink += [binary.Dep('lib_win\\pcre.lib')] + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'module.cpp', + 'CRegEx.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/sockets/AMBuilder b/dlls/sockets/AMBuilder new file mode 100644 index 00000000..f6e7cd15 --- /dev/null +++ b/dlls/sockets/AMBuilder @@ -0,0 +1,11 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.Module(builder, 'sockets') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'sockets.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/sqlite/AMBuilder b/dlls/sqlite/AMBuilder new file mode 100644 index 00000000..62c06cd4 --- /dev/null +++ b/dlls/sqlite/AMBuilder @@ -0,0 +1,74 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'sqlite') +binary.compiler.cxxincludes += [ + os.path.join(builder.currentSourcePath, 'sqlitepp'), + os.path.join(builder.currentSourcePath, 'thread'), +] +binary.compiler.defines += [ + 'SM_DEFAULT_THREADER', + 'stricmp=strcasecmp', +] + +if builder.target_platform == 'linux': + binary.compiler.postlink += ['-lpthread'] + +binary.sources = [ + 'basic_sql.cpp', + 'handles.cpp', + 'module.cpp', + 'threading.cpp', + 'sdk/amxxmodule.cpp', + 'oldcompat_sql.cpp', + 'thread/BaseWorker.cpp', + 'thread/ThreadWorker.cpp', + 'thread/PosixThreads.cpp', + 'sqlitepp/SqliteQuery.cpp', + 'sqlitepp/SqliteResultSet.cpp', + 'sqlitepp/SqliteDatabase.cpp', + 'sqlitepp/SqliteDriver.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/loadext.c', + 'sqlite-source/main.c', + 'sqlite-source/opcodes.c', + 'sqlite-source/os.c', + 'sqlite-source/os_unix.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/vdbefifo.c', + 'sqlite-source/vdbemem.c', + 'sqlite-source/vtab.c', + 'sqlite-source/where.c', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/tfcx/AMBuilder b/dlls/tfcx/AMBuilder new file mode 100644 index 00000000..b297f772 --- /dev/null +++ b/dlls/tfcx/AMBuilder @@ -0,0 +1,17 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'tfcx') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'CRank.cpp', + 'CMisc.cpp', + 'NBase.cpp', + 'NRank.cpp', + 'usermsg.cpp', + 'Utils.cpp', + 'moduleconfig.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/ts/tsfun/AMBuilder b/dlls/ts/tsfun/AMBuilder new file mode 100644 index 00000000..58a82734 --- /dev/null +++ b/dlls/ts/tsfun/AMBuilder @@ -0,0 +1,10 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'tsfun') + +binary.sources = [ + 'sdk/amxxmodule.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/ts/tsx/AMBuilder b/dlls/ts/tsx/AMBuilder new file mode 100644 index 00000000..8b7bc52e --- /dev/null +++ b/dlls/ts/tsx/AMBuilder @@ -0,0 +1,17 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.MetaModule(builder, 'tsx') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'CMisc.cpp', + 'CRank.cpp', + 'NBase.cpp', + 'NRank.cpp', + 'Utils.cpp', + 'moduleconfig.cpp', + 'usermsg.cpp', +] + +AMXX.modules += [builder.Add(binary)]