diff --git a/AMBuildScript b/AMBuildScript new file mode 100644 index 00000000..ac6c7cbb --- /dev/null +++ b/AMBuildScript @@ -0,0 +1,349 @@ +# 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.plugins = {} + self.libpc300 = None + self.amxxpc = None + self.metamod_path = None + self.hlsdk_path = None + self.mysql_path = None + self.generated_headers = None + self.csx_app = None + + def detectProductVersion(self): + builder.AddConfigureFile('product.version') + builder.AddConfigureFile('.git/HEAD') + + # 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.cxxflags += [ + '-Wno-invalid-offsetof', + ] + + cfg.linkflags += ['-m32'] + + have_gcc = cxx.name == 'gcc' + have_clang = cxx.name == 'clang' + + if have_clang or (have_gcc and cxx.majorVersion >= 4): + cfg.cflags += ['-fvisibility=hidden'] + cfg.cxxflags += ['-fvisibility-inlines-hidden'] + if (have_gcc and cxx.minorVersion >= 7) or (have_clang and cxx.majorVersion >= 3): + cfg.cxxflags += ['-Wno-delete-non-virtual-dtor'] + + if have_gcc: + cfg.cflags += ['-Wno-parentheses'] + elif have_clang: + cfg.cflags += ['-Wno-logical-op-parentheses'] + + cfg.cxxflags += [ + '-fno-exceptions', + '-fno-rtti', + ] + elif cxx.name == 'msvc': + if builder.options.debug == '1': + cfg.cflags += ['/MTd'] + cfg.linkflags += ['/NODEFAULTLIB:libcmt'] + else: + cfg.cflags += ['/MT'] + cfg.defines += [ + '_CRT_SECURE_NO_DEPRECATE', + '_CRT_SECURE_NO_WARNINGS', + '_CRT_NONSTDC_NO_DEPRECATE', + '_ITERATOR_DEBUG_LEVEL=0', + ] + cfg.cflags += [ + '/W3', + ] + cfg.cxxflags += [ + '/EHsc', + '/GR-', + '/TP', + ] + cfg.linkflags += [ + '/MACHINE:X86', + '/SUBSYSTEM:WINDOWS', + 'kernel32.lib', + 'user32.lib', + 'gdi32.lib', + 'winspool.lib', + 'comdlg32.lib', + 'advapi32.lib', + 'shell32.lib', + 'ole32.lib', + 'oleaut32.lib', + 'uuid.lib', + 'odbc32.lib', + 'odbccp32.lib', + ] + + # Optimization + if builder.options.opt == '1': + cfg.defines += ['NDEBUG'] + if cxx.behavior == 'gcc': + cfg.cflags += ['-O2'] + elif cxx.behavior == 'msvc': + cfg.cflags += ['/Ox'] + cfg.linkflags += ['/OPT:ICF', '/OPT:REF'] + + # Debugging + if builder.options.debug == '1': + cfg.defines += ['DEBUG', '_DEBUG'] + if cxx.behavior == 'msvc': + cfg.cflags += ['/Od', '/RTC1'] + + # This needs to be after our optimization flags which could otherwise disable it. + if cxx.name == 'msvc': + # Don't omit the frame pointer. + cfg.cflags += ['/Oy-'] + + # Platform-specifics + if builder.target_platform == 'linux': + cfg.defines += ['_LINUX', 'POSIX', 'LINUX'] + cfg.postlink += ['-ldl'] + if cxx.name == 'gcc': + cfg.postlink += ['-static-libgcc'] + elif cxx.name == 'clang': + cfg.postlink += ['-lgcc_eh'] + elif builder.target_platform == 'mac': + cfg.defines += ['OSX', '_OSX', 'POSIX'] + cfg.postlink += [ + '-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', + 'AMBUILD', + ] + + cfg.includes += [os.path.join(builder.buildPath, 'includes')] + return + + # + # 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.compiler.rcdefines += [ + 'BINARY_NAME="{0}"'.format(binary.outputFile), + 'AMBUILD', + 'RC_COMPILE', + ] + 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 += AMXX.generated_headers + return binary + + def ModuleBuilder(self, context, compiler, name): + compiler.cxxincludes += [ + os.path.join(context.currentSourcePath, 'sdk'), + ] + + if builder.target_platform == 'mac' or builder.target_platform == 'windows': + 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.compiler.rcdefines += [ + 'BINARY_NAME="{0}"'.format(binary.outputFile), + 'AMBUILD', + 'RC_COMPILE', + ] + binary.compiler.sourcedeps += AMXX.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' or builder.target_platform == 'windows': + 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() + +AMXX.generated_headers = builder.RunScript( + 'support/Versioning', + { 'AMXX': AMXX } +) + +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', + 'plugins/AMBuilder', + ], + { + 'AMXX': AMXX + } +) + +# The csstats.dat reader is Windows-only. +if builder.target_platform == 'windows': + builder.RunScript('dlls/cstrike/csx/WinCSX/AMBuilder', { 'AMXX': AMXX }) + +# Finally, do packaging. +builder.RunScript('support/PackageScript', { 'AMXX': AMXX }) diff --git a/amxmodx/AMBuilder b/amxmodx/AMBuilder new file mode 100644 index 00000000..034ff488 --- /dev/null +++ b/amxmodx/AMBuilder @@ -0,0 +1,100 @@ +# 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'), + ] +elif builder.target_platform == 'windows': + jit_objects = [ + binary.Dep('JIT/amxexecn.obj'), + binary.Dep('JIT/amxjitsn.obj'), + binary.Dep('JIT/helpers-x86.obj'), + binary.Dep('JIT/natives-x86.obj'), + ] + +binary.compiler.linkflags += jit_objects + +if builder.target_platform == 'linux': + binary.compiler.linkflags += [binary.Dep('zlib/libz.a')] +elif builder.target_platform == 'mac': + binary.compiler.linkflags += [binary.Dep('zlib/libz-darwin.a')] +elif builder.target_platform == 'windows': + binary.compiler.linkflags += [binary.Dep('zlib\\zlib.lib')] + +if builder.target_platform == 'mac': + binary.compiler.postlink += [ + '-Wl,-read_only_relocs,suppress' + ] + +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', +] + +if builder.target_platform == 'windows': + binary.sources += ['version.rc'] + +AMXX.binaries += [builder.Add(binary)] diff --git a/amxmodx/amxmodx.cpp b/amxmodx/amxmodx.cpp index ab5617d0..78617190 100755 --- a/amxmodx/amxmodx.cpp +++ b/amxmodx/amxmodx.cpp @@ -39,7 +39,7 @@ #include "CFlagManager.h" #include "nongpl_matches.h" #include "format.h" -#include "svn_version.h" +#include extern CFlagManager FlagMan; CVector DynamicAdmins; diff --git a/amxmodx/amxxlog.cpp b/amxmodx/amxxlog.cpp index 9f469ca7..1e27bdc5 100755 --- a/amxmodx/amxxlog.cpp +++ b/amxmodx/amxxlog.cpp @@ -44,7 +44,7 @@ #define vsnprintf _vsnprintf #endif -#include "svn_version.h" +#include CLog::CLog() { diff --git a/amxmodx/meta_api.cpp b/amxmodx/meta_api.cpp index e67ed0d7..0e5e194c 100755 --- a/amxmodx/meta_api.cpp +++ b/amxmodx/meta_api.cpp @@ -50,7 +50,7 @@ #include "datastructs.h" #include "CFlagManager.h" -#include "svn_version.h" +#include #include "trie_natives.h" plugin_info_t Plugin_info = diff --git a/amxmodx/srvcmd.cpp b/amxmodx/srvcmd.cpp index 06ba94a9..018eaa5e 100755 --- a/amxmodx/srvcmd.cpp +++ b/amxmodx/srvcmd.cpp @@ -30,7 +30,7 @@ */ #include "amxmodx.h" -#include "svn_version.h" +#include void amx_command() { diff --git a/amxmodx/svn_version.h b/amxmodx/svn_version.h deleted file mode 100644 index 5a0af9d4..00000000 --- a/amxmodx/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -#define SVN_VERSION_STRING "1.8.2-dev" -#define SVN_VERSION_DWORD 1,8,2,0 -#define SVN_VERSION_PRODUCT "1.8.2" -#define SVN_BUILD_ID SVN_VERSION_STRING " 9:7ff502465eae" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/amxmodx/svn_version.tpl b/amxmodx/svn_version.tpl deleted file mode 100644 index 7ac5a99e..00000000 --- a/amxmodx/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -#define SVN_VERSION_STRING "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" -#define SVN_VERSION_DWORD $PMAJOR$,$PMINOR$,$PREVISION$,0 -#define SVN_VERSION_PRODUCT "$PMAJOR$.$PMINOR$.$PREVISION$" -#define SVN_BUILD_ID SVN_VERSION_STRING " $BUILD_ID$" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/amxmodx/version.rc b/amxmodx/version.rc index 9b7a81e0..48e839ce 100755 --- a/amxmodx/version.rc +++ b/amxmodx/version.rc @@ -6,7 +6,13 @@ // Generated from the TEXTINCLUDE 2 resource. // #include "winres.h" -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION_DWORD 1, 8, 3, 0 +# define SVN_VERSION_STRING "dev-local" +# define SVN_VERSION SVN_VERSION_STRING +#endif ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -49,7 +55,7 @@ BEGIN VALUE "LegalCopyright", "Copyright (c) 2004-2007, AMX Mod X Dev Team" VALUE "OriginalFilename", "amxmodx_mm.dll" VALUE "ProductName", "AMX Mod X" - VALUE "ProductVersion", SVN_VERSION_PRODUCT + VALUE "ProductVersion", SVN_VERSION END END BLOCK "VarFileInfo" diff --git a/compiler/amxxpc/AMBuilder b/compiler/amxxpc/AMBuilder new file mode 100644 index 00000000..b154773b --- /dev/null +++ b/compiler/amxxpc/AMBuilder @@ -0,0 +1,35 @@ +# 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 != 'windows': + binary.compiler.cxxflags.remove('-fno-exceptions') + +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.defines += ['_MBCS'] + binary.compiler.linkflags += [binary.Dep('zlib.lib')] + binary.compiler.linkflags.remove('/SUBSYSTEM:WINDOWS') + binary.compiler.linkflags.append('/SUBSYSTEM:CONSOLE') + +binary.sources = [ + 'amx.cpp', + 'amxxpc.cpp', + 'Binary.cpp', +] + +if builder.target_platform == 'windows': + binary.sources += ['amxxpc1.rc'] + +AMXX.amxxpc = 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/amxxpc/amxxpc.cpp b/compiler/amxxpc/amxxpc.cpp index f24572ff..a3784818 100755 --- a/compiler/amxxpc/amxxpc.cpp +++ b/compiler/amxxpc/amxxpc.cpp @@ -69,7 +69,7 @@ int main(int argc, char **argv) exit(0); } - pc_printf("Welcome to the AMX Mod X %s Compiler.\n", VERSION_STRING); + pc_printf("Welcome to the AMX Mod X %s Compiler.\n", SVN_VERSION); pc_printf("Copyright (c) 1997-2013 ITB CompuPhase, AMX Mod X Team\n\n"); if (argc < 2) diff --git a/compiler/amxxpc/amxxpc.h b/compiler/amxxpc/amxxpc.h index eb28e697..b601a8b3 100755 --- a/compiler/amxxpc/amxxpc.h +++ b/compiler/amxxpc/amxxpc.h @@ -1,7 +1,7 @@ #ifndef _AMXXSC_INCLUDE_H #define _AMXXSC_INCLUDE_H -#define VERSION_STRING "1.8.1-300" +#include #define MAGIC_HEADER2 0x414D5858 #define MAGIC_VERSION 0x0300 diff --git a/compiler/libpc300/AMBuilder b/compiler/libpc300/AMBuilder new file mode 100644 index 00000000..87e59f61 --- /dev/null +++ b/compiler/libpc300/AMBuilder @@ -0,0 +1,41 @@ +# 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', +] + +if builder.target_platform == 'windows': + binary.sources+= ['libpawnc.rc'] + +AMXX.libpc300 = builder.Add(binary) diff --git a/compiler/libpc300/sc.h b/compiler/libpc300/sc.h index 02bb9053..69479cab 100755 --- a/compiler/libpc300/sc.h +++ b/compiler/libpc300/sc.h @@ -763,6 +763,7 @@ SC_VDECL int sc_needsemicolon;/* semicolon required to terminate expressions? */ SC_VDECL int sc_dataalign; /* data alignment value */ SC_VDECL int sc_alignnext; /* must frame of the next function be aligned? */ SC_VDECL int pc_docexpr; /* must expression be attached to documentation comment? */ +SC_VDECL int sc_showincludes; /* show include files? */ SC_VDECL int curseg; /* 1 if currently parsing CODE, 2 if parsing DATA */ SC_VDECL cell sc_stksize; /* stack size */ SC_VDECL cell sc_amxlimit; /* abstract machine size limit */ diff --git a/compiler/libpc300/sc1.c b/compiler/libpc300/sc1.c index 54702e23..a67daf20 100755 --- a/compiler/libpc300/sc1.c +++ b/compiler/libpc300/sc1.c @@ -487,7 +487,9 @@ int pc_compile(int argc, char *argv[]) tname=NULL; sname=NULL; #else - tname=tempnam(NULL,"pawn"); + char *buffer = strdup(P_tmpdir "/pawn.XXXXXX"); + close(mkstemp(buffer)); + tname=buffer; #endif ftmp=(FILE*)pc_createsrc(tname); for (fidx=0; (sname=get_sourcefile(fidx))!=NULL; fidx++) { @@ -1013,6 +1015,9 @@ static void parseoptions(int argc,char **argv,char *oname,char *ename,char *pnam hwndFinish=(HWND)0; break; #endif + case 'h': + sc_showincludes = 1; + break; case 'i': strncpy(str,option_value(ptr),sizeof str); /* set name of include directory */ str[sizeof(str)-1]='\0'; @@ -1295,7 +1300,8 @@ static void setconfig(char *root) insert_path(path); /* same for the codepage root */ #if !defined NO_CODEPAGE - *ptr='\0'; + if (ptr) + *ptr='\0'; if (!cp_path(path,"codepage")) error(109,path); /* codepage path */ #endif diff --git a/compiler/libpc300/sc2.c b/compiler/libpc300/sc2.c index 79451d19..f6961e39 100755 --- a/compiler/libpc300/sc2.c +++ b/compiler/libpc300/sc2.c @@ -142,6 +142,9 @@ static char *extensions[] = { ".inc", ".p", ".pawn" }; *ext='\0'; /* restore filename */ return FALSE; } /* if */ + if (sc_showincludes && sc_status==statFIRST) { + fprintf(stdout, "Note: including file: %s\n", name); + } PUSHSTK_P(inpf); PUSHSTK_P(inpfname); /* pointer to current file name */ PUSHSTK_P(curlibrary); diff --git a/compiler/libpc300/scvars.c b/compiler/libpc300/scvars.c index 0da106f2..f265f184 100755 --- a/compiler/libpc300/scvars.c +++ b/compiler/libpc300/scvars.c @@ -85,6 +85,7 @@ SC_VDEFINE int sc_rationaltag=0; /* tag for rational numbers */ SC_VDEFINE int rational_digits=0; /* number of fractional digits */ SC_VDEFINE int sc_allowproccall=0; /* allow/detect tagnames in lex() */ SC_VDEFINE short sc_is_utf8=FALSE; /* is this source file in UTF-8 encoding */ +SC_VDEFINE int sc_showincludes=0; /* show include files */ SC_VDEFINE constvalue sc_automaton_tab = { NULL, "", 0, 0}; /* automaton table */ SC_VDEFINE constvalue sc_state_tab = { NULL, "", 0, 0}; /* state table */ 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/cstrike/sdk/moduleconfig.h b/dlls/cstrike/cstrike/sdk/moduleconfig.h index 144e75e8..d3bf9a63 100755 --- a/dlls/cstrike/cstrike/sdk/moduleconfig.h +++ b/dlls/cstrike/cstrike/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "CStrike" diff --git a/dlls/cstrike/cstrike/svn_version.h b/dlls/cstrike/cstrike/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/cstrike/cstrike/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/cstrike/cstrike/svn_version.tpl b/dlls/cstrike/cstrike/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/cstrike/cstrike/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/cstrike/csx/WinCSX/AMBuilder b/dlls/cstrike/csx/WinCSX/AMBuilder new file mode 100644 index 00000000..3fdaa468 --- /dev/null +++ b/dlls/cstrike/csx/WinCSX/AMBuilder @@ -0,0 +1,22 @@ +# vim: set sts=2 ts=8 sw=2 tw=99 et ft=python: +import os.path + +binary = AMXX.Program(builder, 'WinCSX') + +binary.compiler.includes += [ + os.path.join(builder.currentSourcePath, 'resources'), +] +binary.compiler.defines += ['_MBCS'] +binary.compiler.linkflags += [ + 'comctl32.lib', +] + +binary.sources = [ + 'CRank.cpp', + 'WinCSX.cpp', + 'stdafx.cpp', + 'resources/WinCSX.rc', +] + +AMXX.csx_app = builder.Add(binary) + diff --git a/dlls/cstrike/csx/sdk/moduleconfig.h b/dlls/cstrike/csx/sdk/moduleconfig.h index aed008dd..5c0cf65c 100755 --- a/dlls/cstrike/csx/sdk/moduleconfig.h +++ b/dlls/cstrike/csx/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "CSX" diff --git a/dlls/cstrike/csx/svn_version.h b/dlls/cstrike/csx/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/cstrike/csx/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/cstrike/csx/svn_version.tpl b/dlls/cstrike/csx/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/cstrike/csx/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/dodfun/sdk/moduleconfig.h b/dlls/dod/dodfun/sdk/moduleconfig.h index e7877006..c65407f0 100755 --- a/dlls/dod/dodfun/sdk/moduleconfig.h +++ b/dlls/dod/dodfun/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "DoD Fun" diff --git a/dlls/dod/dodfun/svn_version.h b/dlls/dod/dodfun/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/dod/dodfun/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/dod/dodfun/svn_version.tpl b/dlls/dod/dodfun/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/dod/dodfun/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/dod/dodx/sdk/moduleconfig.h b/dlls/dod/dodx/sdk/moduleconfig.h index 6cf72b93..75d3c809 100755 --- a/dlls/dod/dodx/sdk/moduleconfig.h +++ b/dlls/dod/dodx/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "DoDX" diff --git a/dlls/dod/dodx/svn_version.h b/dlls/dod/dodx/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/dod/dodx/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/dod/dodx/svn_version.tpl b/dlls/dod/dodx/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/dod/dodx/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/engine/sdk/moduleconfig.h b/dlls/engine/sdk/moduleconfig.h index f85da06a..b71dfce8 100755 --- a/dlls/engine/sdk/moduleconfig.h +++ b/dlls/engine/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "Engine" diff --git a/dlls/engine/svn_version.h b/dlls/engine/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/engine/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/engine/svn_version.tpl b/dlls/engine/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/engine/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/fakemeta/sdk/moduleconfig.h b/dlls/fakemeta/sdk/moduleconfig.h index c42e1aa6..ea9804b9 100755 --- a/dlls/fakemeta/sdk/moduleconfig.h +++ b/dlls/fakemeta/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "FakeMeta" diff --git a/dlls/fakemeta/svn_version.h b/dlls/fakemeta/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/fakemeta/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/fakemeta/svn_version.tpl b/dlls/fakemeta/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/fakemeta/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/fun/sdk/moduleconfig.h b/dlls/fun/sdk/moduleconfig.h index 9f59f293..5c0883d1 100755 --- a/dlls/fun/sdk/moduleconfig.h +++ b/dlls/fun/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "Fun" diff --git a/dlls/fun/svn_version.h b/dlls/fun/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/fun/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/fun/svn_version.tpl b/dlls/fun/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/fun/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/geoip/AMBuilder b/dlls/geoip/AMBuilder new file mode 100644 index 00000000..cd3ce025 --- /dev/null +++ b/dlls/geoip/AMBuilder @@ -0,0 +1,15 @@ +# 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', +] + +if builder.target_platform == 'windows': + binary.compiler.postlink += ['ws2_32.lib'] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/geoip/sdk/moduleconfig.h b/dlls/geoip/sdk/moduleconfig.h index dbb5bcc7..837e67a4 100755 --- a/dlls/geoip/sdk/moduleconfig.h +++ b/dlls/geoip/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "GeoIP" diff --git a/dlls/geoip/svn_version.h b/dlls/geoip/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/geoip/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/geoip/svn_version.tpl b/dlls/geoip/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/geoip/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/hamsandwich/sdk/moduleconfig.h b/dlls/hamsandwich/sdk/moduleconfig.h index 167cea64..05bc2b0a 100644 --- a/dlls/hamsandwich/sdk/moduleconfig.h +++ b/dlls/hamsandwich/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "../svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "Ham Sandwich" diff --git a/dlls/hamsandwich/svn_version.h b/dlls/hamsandwich/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/hamsandwich/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/hamsandwich/svn_version.tpl b/dlls/hamsandwich/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/hamsandwich/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/mysqlx/AMBuilder b/dlls/mysqlx/AMBuilder new file mode 100644 index 00000000..d62905b9 --- /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.linkflags += [ + os.path.join(AMXX.mysql_path, 'lib', 'libmysqlclient_r.a'), + '-lz', + '-lpthread', + '-lm' + ] + elif builder.target_platform is 'windows': + binary.compiler.linkflags += [ + 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/mysqlx/sdk/moduleconfig.h b/dlls/mysqlx/sdk/moduleconfig.h index c76de407..460b3435 100755 --- a/dlls/mysqlx/sdk/moduleconfig.h +++ b/dlls/mysqlx/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif /** Module info * -The logtag is the tag that the module's log messages will be diff --git a/dlls/mysqlx/svn_version.h b/dlls/mysqlx/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/mysqlx/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/mysqlx/svn_version.tpl b/dlls/mysqlx/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/mysqlx/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/ns/sdk/moduleconfig.h b/dlls/ns/sdk/moduleconfig.h index d1c297b3..951bad32 100755 --- a/dlls/ns/sdk/moduleconfig.h +++ b/dlls/ns/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "../svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "NS" diff --git a/dlls/ns/svn_version.h b/dlls/ns/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/ns/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/ns/svn_version.tpl b/dlls/ns/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/ns/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/nvault/sdk/moduleconfig.h b/dlls/nvault/sdk/moduleconfig.h index eef49b09..31d9818a 100755 --- a/dlls/nvault/sdk/moduleconfig.h +++ b/dlls/nvault/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "nVault" diff --git a/dlls/nvault/svn_version.h b/dlls/nvault/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/nvault/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/nvault/svn_version.tpl b/dlls/nvault/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/nvault/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/regex/AMBuilder b/dlls/regex/AMBuilder new file mode 100644 index 00000000..d1436354 --- /dev/null +++ b/dlls/regex/AMBuilder @@ -0,0 +1,21 @@ +# 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.compiler.defines += ['PCRE_STATIC'] + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'module.cpp', + 'CRegEx.cpp', +] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/regex/sdk/moduleconfig.h b/dlls/regex/sdk/moduleconfig.h index 930aaa95..60bfca55 100755 --- a/dlls/regex/sdk/moduleconfig.h +++ b/dlls/regex/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "RegEx" diff --git a/dlls/regex/svn_version.h b/dlls/regex/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/regex/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/regex/svn_version.tpl b/dlls/regex/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/regex/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/sockets/AMBuilder b/dlls/sockets/AMBuilder new file mode 100644 index 00000000..cbdf3ad8 --- /dev/null +++ b/dlls/sockets/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, 'sockets') + +binary.sources = [ + 'sdk/amxxmodule.cpp', + 'sockets.cpp', +] + +if builder.target_platform == 'windows': + binary.compiler.postlink += ['wsock32.lib', 'ws2_32.lib'] + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/sockets/sdk/moduleconfig.h b/dlls/sockets/sdk/moduleconfig.h index df9a52ff..10c55440 100755 --- a/dlls/sockets/sdk/moduleconfig.h +++ b/dlls/sockets/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "Sockets" diff --git a/dlls/sockets/svn_version.h b/dlls/sockets/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/sockets/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/sockets/svn_version.tpl b/dlls/sockets/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/sockets/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/sqlite/AMBuilder b/dlls/sqlite/AMBuilder new file mode 100644 index 00000000..3d2903df --- /dev/null +++ b/dlls/sqlite/AMBuilder @@ -0,0 +1,85 @@ +# 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'), + os.path.join(builder.currentSourcePath, 'sqlite-source'), +] +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', + '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/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', +] + +if builder.target_platform == 'windows': + binary.sources += [ + 'thread/WinThreads.cpp', + 'sqlite-source/os_win.c', + ] +else: + binary.sources += [ + 'thread/PosixThreads.cpp', + 'sqlite-source/os_unix.c', + ] + + +AMXX.modules += [builder.Add(binary)] diff --git a/dlls/sqlite/sdk/moduleconfig.h b/dlls/sqlite/sdk/moduleconfig.h index 8285554b..9e9a2b45 100755 --- a/dlls/sqlite/sdk/moduleconfig.h +++ b/dlls/sqlite/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "SQLite" diff --git a/dlls/sqlite/svn_version.h b/dlls/sqlite/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/sqlite/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/sqlite/svn_version.tpl b/dlls/sqlite/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/sqlite/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/tfcx/sdk/moduleconfig.h b/dlls/tfcx/sdk/moduleconfig.h index 6d01f64c..f4074df3 100755 --- a/dlls/tfcx/sdk/moduleconfig.h +++ b/dlls/tfcx/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "TfcX" diff --git a/dlls/tfcx/svn_version.h b/dlls/tfcx/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/tfcx/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/tfcx/svn_version.tpl b/dlls/tfcx/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/tfcx/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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/tsfun/sdk/moduleconfig.h b/dlls/ts/tsfun/sdk/moduleconfig.h index 2add7899..cc1c5fb4 100755 --- a/dlls/ts/tsfun/sdk/moduleconfig.h +++ b/dlls/ts/tsfun/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "TSFun Wrapper" diff --git a/dlls/ts/tsfun/svn_version.h b/dlls/ts/tsfun/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/ts/tsfun/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/ts/tsfun/svn_version.tpl b/dlls/ts/tsfun/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/ts/tsfun/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ 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)] diff --git a/dlls/ts/tsx/sdk/moduleconfig.h b/dlls/ts/tsx/sdk/moduleconfig.h index 9ef1e09f..046c8ee2 100755 --- a/dlls/ts/tsx/sdk/moduleconfig.h +++ b/dlls/ts/tsx/sdk/moduleconfig.h @@ -3,7 +3,11 @@ #ifndef __MODULECONFIG_H__ #define __MODULECONFIG_H__ -#include "svn_version.h" +#if defined AMBUILD +# include +#else +# define SVN_VERSION "dev-local" +#endif // Module info #define MODULE_NAME "TSX" diff --git a/dlls/ts/tsx/svn_version.h b/dlls/ts/tsx/svn_version.h deleted file mode 100644 index 707c452e..00000000 --- a/dlls/ts/tsx/svn_version.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "1.8.2-dev" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/dlls/ts/tsx/svn_version.tpl b/dlls/ts/tsx/svn_version.tpl deleted file mode 100644 index 7af4e530..00000000 --- a/dlls/ts/tsx/svn_version.tpl +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _INCLUDE_SVN_VERSION_H_ -#define _INCLUDE_SVN_VERSION_H_ - -/** This file is auto-generated by build scripts. Do not edit it unless you know what you're doing. */ -/** Do not commit the generated .h file, as it will only mess up SVN revision numbers. */ - -#define SVN_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" - -#endif //_INCLUDE_SVN_VERSION_H_ diff --git a/installer/builder/ABuilder.cs b/installer/builder/ABuilder.cs deleted file mode 100755 index 50a37960..00000000 --- a/installer/builder/ABuilder.cs +++ /dev/null @@ -1,249 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; - -namespace AMXXRelease -{ - //This class specifies the process that builds a release. - //It also implements the functions that are unlikely to change from mod to mod. - public abstract class ABuilder - { - protected Config m_Cfg; - - public virtual void OnBuild() - { - } - - public virtual void CreateDir(string dir) - { - Directory.CreateDirectory(dir); - } - - public virtual bool Build(Config cfg, Build build) - { - m_Cfg = cfg; - - OnBuild(); - - int num = build.GetMods(); - - AMod mod; - for (int i=0; i=0; i--) - { - if ((input[i] == '\\' || input[i] == '/') && i != input.Length-1) - { - return input.Substring(i+1, input.Length-i-1); - } - } - - return input; - } - - public virtual bool BuildModModules(AMod mod) - { - int num = mod.GetModules(); - - Module module; - string binary, basedir; - - basedir = m_Cfg.OutputPath(); - basedir += "\\" + mod.GetModPath(); - basedir = PropSlashes(basedir); - - string dir; - for (int i=0; i= 1) - { - key = s[0]; - if (s.GetLength(0) >= 2) - { - for(int i=1; i - /// Summary description for ModCstrike. - /// - public class ModCstrike : AMod - { - public ModCstrike() - { - AddModules(); - AddPlugins(); - } - - public override sealed string GetName() - { - return "cstrike"; - } - - private void AddPlugins() - { - AddPlugin("miscstats"); - AddPlugin("stats_logging"); - AddPlugin("statsx"); - AddPlugin("restmenu"); - - Plugin csstats = new Plugin("csstats"); - csstats.outdir = "data"; - m_Plugins.Add(csstats); - } - - public override sealed bool CopyExtraFiles(ABuilder ab, string basedir, string source) - { - - if (System.Environment.OSVersion.Platform == System.PlatformID.Unix) - { - } else { - File.Copy(source + "\\dlls\\cstrike\\csx\\msvc10\\Release\\WinCSX.exe", - basedir + "\\data\\WinCSX.exe", - true); - } - - return true; - } - - private void AddModules() - { - Module csx = new Module("csx"); - csx.sourcedir = "dlls\\cstrike\\csx"; - - Module cstrike = new Module("cstrike"); - cstrike.sourcedir = "dlls\\cstrike\\cstrike"; - - m_Modules.Add(csx); - m_Modules.Add(cstrike); - } - } -} diff --git a/installer/builder/ModDoD.cs b/installer/builder/ModDoD.cs deleted file mode 100755 index 9b04d573..00000000 --- a/installer/builder/ModDoD.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; - -namespace AMXXRelease -{ - //Day of Defeat - public class ModDoD : AMod - { - public ModDoD() - { - AddModules(); - AddPlugins(); - } - - public override sealed string GetName() - { - return "dod"; - } - - private void AddPlugins() - { - AddPlugin("stats"); - AddPlugin("plmenu"); - AddPlugin("stats_logging"); - AddPlugin("statssounds"); - - Plugin pl = AddPlugin("dodstats"); - pl.outdir = "data"; - } - - private void AddModules() - { - Module dodx = new Module("dodx"); - dodx.sourcedir = "dlls\\dod\\dodx"; - - Module dodfun = new Module("dodfun"); - dodfun.sourcedir = "dlls\\dod\\dodfun"; - - m_Modules.Add(dodx); - m_Modules.Add(dodfun); - } - } -} - diff --git a/installer/builder/ModEsf.cs b/installer/builder/ModEsf.cs deleted file mode 100755 index f2b48aad..00000000 --- a/installer/builder/ModEsf.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; - -namespace AMXXRelease -{ - //Earth's Special Forces - public class ModEsf : AMod - { - public ModEsf() - { - AddPlugins(); - } - - public override sealed string GetName() - { - return "esf"; - } - - private void AddPlugins() - { - AddPlugin("EvolutionX.Core"); - } - } -} diff --git a/installer/builder/ModNs.cs b/installer/builder/ModNs.cs deleted file mode 100755 index ccd0d4bf..00000000 --- a/installer/builder/ModNs.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; - -namespace AMXXRelease -{ - //Natural Selection - public class ModNs : AMod - { - public ModNs() - { - AddModules(); - AddPlugins(); - } - - public override sealed string GetName() - { - return "ns"; - } - - private void AddPlugins() - { - AddPlugin("mapchooser"); - AddPlugin("nextmap"); - AddPlugin("timeleft"); - AddPlugin("idlekicker"); - AddPlugin("nscommands"); - AddPlugin("unstuck"); - AddPlugin("plmenu"); - } - - private void AddModules() - { - Module ns = new Module("ns"); - - m_Modules.Add(ns); - } - } -} diff --git a/installer/builder/ModTFC.cs b/installer/builder/ModTFC.cs deleted file mode 100755 index c7c27799..00000000 --- a/installer/builder/ModTFC.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; - -namespace AMXXRelease -{ - //Team Fortress Classic - public class ModTFC : AMod - { - public ModTFC() - { - AddModules(); - AddPlugins(); - } - - public override sealed string GetName() - { - return "tfc"; - } - - private void AddPlugins() - { - AddPlugin("plmenu"); - AddPlugin("stats_logging"); - AddPlugin("statssounds"); - AddPlugin("stats"); - Plugin pl = AddPlugin("tfcstats"); - pl.outdir = "data"; - } - - private void AddModules() - { - Module tfcx = new Module("tfcx"); - - m_Modules.Add(tfcx); - } - } -} diff --git a/installer/builder/ModTs.cs b/installer/builder/ModTs.cs deleted file mode 100755 index 8d318ae2..00000000 --- a/installer/builder/ModTs.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; - -namespace AMXXRelease -{ - //The Specialists - public class ModTs : AMod - { - public ModTs() - { - AddModules(); - AddPlugins(); - } - - public override sealed string GetName() - { - return "ts"; - } - - private void AddPlugins() - { - AddPlugin("stats"); - AddPlugin("stats_logging"); - AddPlugin("statssounds"); - Plugin pl = AddPlugin("tsstats"); - pl.outdir = "data"; - } - - private void AddModules() - { - Module tsx = new Module("tsx"); - tsx.sourcedir = "dlls\\ts\\tsx"; - - Module tsfun = new Module("tsfun"); - tsfun.sourcedir = "dlls\\ts\\tsfun"; - - m_Modules.Add(tsx); - m_Modules.Add(tsfun); - } - } -} diff --git a/installer/builder/Properties/AssemblyInfo.cs b/installer/builder/Properties/AssemblyInfo.cs deleted file mode 100644 index 1f2a7388..00000000 --- a/installer/builder/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("AMXX Build Tool")] -[assembly: AssemblyDescription("Build scripts for AMX Mod X")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("AlliedModders, LLC")] -[assembly: AssemblyProduct("AMXX Build Tool")] -[assembly: AssemblyCopyright("(C)Copyright 2004-2008 AlliedModders, LLC")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("83e54c68-616e-4392-9a12-7ff5a27865d4")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/installer/builder/Win32Builder.cs b/installer/builder/Win32Builder.cs deleted file mode 100755 index 2ef63ad3..00000000 --- a/installer/builder/Win32Builder.cs +++ /dev/null @@ -1,100 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; - -namespace AMXXRelease -{ - //Build process for Windows (32bit) - public class Win32Builder : ABuilder - { - private string m_AmxxPc; - - public override void OnBuild() - { - m_AmxxPc = PropSlashes(m_Cfg.GetSourceTree() + "\\plugins\\amxxpc.exe"); - } - - public override void CompressDir(string target, string dir) - { - ProcessStartInfo info = new ProcessStartInfo(); - - info.FileName = m_Cfg.CompressPath(); - info.WorkingDirectory = dir; - info.Arguments = "-r \"" + target + "-windows.zip\" " + "*.*"; - info.UseShellExecute = false; - - Process p = Process.Start(info); - p.WaitForExit(); - } - - public override void AmxxPc(string inpath, string args) - { - ProcessStartInfo info = new ProcessStartInfo(); - - info.WorkingDirectory = PropSlashes(m_Cfg.GetSourceTree() + "\\plugins"); - info.FileName = (string)m_AmxxPc.Clone(); - info.Arguments = inpath + ".sma"; - if (args != null) - info.Arguments += " " + args; - info.UseShellExecute = false; - info.RedirectStandardOutput = true; - info.RedirectStandardError = true; - - Process p = Process.Start(info); - Console.WriteLine(p.StandardOutput.ReadToEnd() + "\n"); - p.WaitForExit(); - } - - public override string GetLibExt() - { - return ".dll"; - } - - public override string BuildModule(Module module) - { - ProcessStartInfo info = new ProcessStartInfo(); - - string dir = m_Cfg.GetSourceTree() + "\\" + module.sourcedir; - if (module.bindir != null) - dir += "\\" + module.bindir; - string file = dir; - if (module.bindir == null) - file += "\\" + module.bindir; - file += "\\" + module.build + "\\" + module.projname + ".dll"; - file = PropSlashes(file); - - if (File.Exists(file)) - File.Delete(file); - - string args = m_Cfg.MakeOpts(); - if (args != null) - { - info.Arguments = args + " "; - } - else - { - info.Arguments = ""; - } - - info.WorkingDirectory = PropSlashes(dir); - info.FileName = m_Cfg.DevenvPath(); - info.Arguments += module.vcproj + ".sln" + " /p:Configuration=" + module.build + " /t:Rebuild"; - info.UseShellExecute = false; - info.RedirectStandardOutput = true; - info.RedirectStandardError = true; - - Process p = Process.Start(info); - Console.WriteLine(p.StandardOutput.ReadToEnd()); - p.WaitForExit(); - p.Close(); - - if (!File.Exists(file)) - { - return null; - } - - return file; - } - } -} - diff --git a/installer/builder/builder.csproj b/installer/builder/builder.csproj deleted file mode 100755 index 1109b1fe..00000000 --- a/installer/builder/builder.csproj +++ /dev/null @@ -1,69 +0,0 @@ - - - - Debug - AnyCPU - 8.0.50727 - 2.0 - {93EF9F0C-2C25-428C-A13F-B7B7E46B22BB} - Exe - Properties - builder - builder - v2.0 - - - 2.0 - - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - AllRules.ruleset - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - AllRules.ruleset - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/installer/builder/builder.exe b/installer/builder/builder.exe deleted file mode 100755 index 53e78956..00000000 Binary files a/installer/builder/builder.exe and /dev/null differ diff --git a/installer/builder/builder.sln b/installer/builder/builder.sln deleted file mode 100755 index 1420cb6e..00000000 --- a/installer/builder/builder.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "builder", "builder.csproj", "{93EF9F0C-2C25-428C-A13F-B7B7E46B22BB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {93EF9F0C-2C25-428C-A13F-B7B7E46B22BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {93EF9F0C-2C25-428C-A13F-B7B7E46B22BB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {93EF9F0C-2C25-428C-A13F-B7B7E46B22BB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {93EF9F0C-2C25-428C-A13F-B7B7E46B22BB}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/installer/builder/linux32.info b/installer/builder/linux32.info deleted file mode 100755 index a4171d38..00000000 --- a/installer/builder/linux32.info +++ /dev/null @@ -1,6 +0,0 @@ -compress = /bin/tar -source = /home/users/dvander/amxmodx/trunk -makeopts = -output = /home/users/dvander/done -devenv = /usr/bin/make -release = amxmodx-1.8.1 diff --git a/installer/builder/linux64.info b/installer/builder/linux64.info deleted file mode 100755 index dcfa5f53..00000000 --- a/installer/builder/linux64.info +++ /dev/null @@ -1,6 +0,0 @@ -compress = /bin/tar -source = /home/dvander/code/amxx -makeopts = amd64 -output = /home/dvander/done -devenv = /usr/bin/make -release = amxmodx-1.8.1 diff --git a/installer/builder/mac.info b/installer/builder/mac.info deleted file mode 100644 index c3aa4618..00000000 --- a/installer/builder/mac.info +++ /dev/null @@ -1,6 +0,0 @@ -compress = /usr/bin/zip -source = /Users/Scott/Code/hl/amxmodx-central -makeopts = -output = /Users/Scott/Code/hl/amxmodx-bin -devenv = /usr/bin/make -release = amxmodx-1.8.2 diff --git a/installer/builder/win32.info b/installer/builder/win32.info deleted file mode 100755 index 71bbabbf..00000000 --- a/installer/builder/win32.info +++ /dev/null @@ -1,6 +0,0 @@ -compress = C:\WINDOWS\zip.exe -source = c:\temp\amxmodx -makeopts = -output = c:\temp\done -devenv = C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe -release = amxmodx-1.8.1 diff --git a/modules.versions b/modules.versions deleted file mode 100644 index 519a5b2d..00000000 --- a/modules.versions +++ /dev/null @@ -1,104 +0,0 @@ -[PRODUCT] -major = 1 -minor = 8 -revision = 3 - -[core] -folder = amxmodx -in = svn_version.tpl -out = svn_version.h - -[plugins] -folder = plugins/include -in = svn_version.tpl -out = svn_version.inc - -[cstrike] -folder = dlls/cstrike/cstrike -in = svn_version.tpl -out = svn_version.h - -[csx] -folder = dlls/cstrike/csx -in = svn_version.tpl -out = svn_version.h - -[dodfun] -folder = dlls/dod/dodfun -in = svn_version.tpl -out = svn_version.h - -[dodx] -folder = dlls/dod/dodx -in = svn_version.tpl -out = svn_version.h - -[engine] -folder = dlls/engine -in = svn_version.tpl -out = svn_version.h - -[fakemeta] -folder = dlls/fakemeta -in = svn_version.tpl -out = svn_version.h - -[fun] -folder = dlls/fun -in = svn_version.tpl -out = svn_version.h - -[geoip] -folder = dlls/geoip -in = svn_version.tpl -out = svn_version.h - -[mysqlx] -folder = dlls/mysqlx -in = svn_version.tpl -out = svn_version.h - -[ns] -folder = dlls/ns -in = svn_version.tpl -out = svn_version.h - -[nvault] -folder = dlls/nvault -in = svn_version.tpl -out = svn_version.h - -[regex] -folder = dlls/regex -in = svn_version.tpl -out = svn_version.h - -[sockets] -folder = dlls/sockets -in = svn_version.tpl -out = svn_version.h - -[sqlite] -folder = dlls/sqlite -in = svn_version.tpl -out = svn_version.h - -[tfcx] -folder = dlls/tfcx -in = svn_version.tpl -out = svn_version.h - -[tsx] -folder = dlls/ts/tsx -in = svn_version.tpl -out = svn_version.h - -[tsfun] -folder = dlls/ts/tsfun -in = svn_version.tpl -out = svn_version.h - -[hamsandwich] -folder = dlls/hamsandwich -in = svn_version.tpl -out = svn_version.h diff --git a/plugins/AMBuilder b/plugins/AMBuilder new file mode 100644 index 00000000..059f7991 --- /dev/null +++ b/plugins/AMBuilder @@ -0,0 +1,114 @@ +# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python: +import os + +files = [ + 'admin.sma', + 'adminchat.sma', + 'admincmd.sma', + 'adminhelp.sma', + 'adminslots.sma', + 'adminvote.sma', + 'antiflood.sma', + 'imessage.sma', + 'mapchooser.sma', + 'mapsmenu.sma', + 'menufront.sma', + 'multilingual.sma', + 'nextmap.sma', + 'pausecfg.sma', + 'plmenu.sma', + 'scrollmsg.sma', + 'statscfg.sma', + 'telemenu.sma', + 'timeleft.sma', + 'cmdmenu.sma', + 'pluginmenu.sma', + 'cstrike/csstats.sma', + 'cstrike/miscstats.sma', + 'cstrike/restmenu.sma', + 'cstrike/stats_logging.sma', + 'cstrike/statsx.sma', + 'dod/dodstats.sma', + 'dod/plmenu.sma', + 'dod/stats.sma', + 'dod/stats_logging.sma', + 'dod/statssounds.sma', + 'esf/EvolutionX.Core.sma', + 'ns/idlekicker.sma', + 'ns/mapchooser.sma', + 'ns/nextmap.sma', + 'ns/nscommands.sma', + 'ns/timeleft.sma', + 'ns/unstuck.sma', + 'ns/plmenu.sma', + 'tfc/plmenu.sma', + 'tfc/stats.sma', + 'tfc/stats_logging.sma', + 'tfc/statssounds.sma', + 'tfc/tfcstats.sma', + 'ts/stats.sma', + 'ts/stats_logging.sma', + 'ts/statssounds.sma', + 'ts/tsstats.sma', +] + +_, (libpc300,) = builder.AddCopy(AMXX.libpc300.binary, builder.localFolder) +_, (amxxpc,) = builder.AddCopy(AMXX.amxxpc.binary, builder.localFolder) + +amxxpc_argv = [ + os.path.join(os.curdir, 'amxxpc'), + '-i' + os.path.relpath(os.path.join(builder.buildPath, 'includes'), + os.path.join(builder.buildPath, builder.buildFolder)), + '-i' + os.path.relpath(os.path.join(builder.sourcePath, 'plugins', 'include'), + os.path.join(builder.buildPath, builder.buildFolder)), + '-h', +] + +def build_plugin(script_path, amxx_file, extra_argv = []): + script_folder = os.path.dirname(amxx_file) + if len(script_folder): + builder.AddFolder(script_folder) + + inputs = [ + # Note, use the ones we locally copied, not the originals! Otherwise they + # could copy out of order. + amxxpc, + libpc300, + script_path, + ] + outputs = [ + amxx_file + ] + + argv = amxxpc_argv + extra_argv + [ + script_path, + '-o' + amxx_file, + ] + + cmd_entry, (amx_entry,) = builder.AddCommand( + inputs = inputs, + argv = argv, + outputs = outputs, + dep_type = 'msvc', + weak_inputs = AMXX.generated_headers + ) + AMXX.plugins[amxx_file] = amx_entry + +for script_file in files: + script_path = os.path.join(builder.currentSourcePath, script_file) + amxx_file = os.path.splitext(script_file)[0] + '.amxx' + + build_plugin(script_path, amxx_file) + +# admin_sql.amxx is generated from admin.sma. +build_plugin( + script_path = os.path.join(builder.currentSourcePath, 'admin.sma'), + amxx_file = 'admin_sql.amxx', + extra_argv = ['USING_SQL=1'] +) + +# amxmod_compat is multi-file. +build_plugin( + script_path = os.path.join(builder.currentSourcePath, 'amxmod_compat', 'amxmod_compat.sma'), + amxx_file = 'amxmod_compat.amxx' +) diff --git a/plugins/amxxpc b/plugins/amxxpc deleted file mode 100755 index 5f060f06..00000000 Binary files a/plugins/amxxpc and /dev/null differ diff --git a/plugins/amxxpc.exe b/plugins/amxxpc.exe deleted file mode 100755 index 760fe2d0..00000000 Binary files a/plugins/amxxpc.exe and /dev/null differ diff --git a/plugins/amxxpc32.dll b/plugins/amxxpc32.dll deleted file mode 100755 index 969e69d0..00000000 Binary files a/plugins/amxxpc32.dll and /dev/null differ diff --git a/plugins/amxxpc32.dylib b/plugins/amxxpc32.dylib deleted file mode 100644 index d8281c57..00000000 Binary files a/plugins/amxxpc32.dylib and /dev/null differ diff --git a/plugins/amxxpc32.so b/plugins/amxxpc32.so deleted file mode 100755 index c6aa6b74..00000000 Binary files a/plugins/amxxpc32.so and /dev/null differ diff --git a/plugins/amxxpc_osx b/plugins/amxxpc_osx deleted file mode 100755 index d0cd8f80..00000000 Binary files a/plugins/amxxpc_osx and /dev/null differ diff --git a/plugins/dlsym b/plugins/dlsym deleted file mode 100755 index da54533f..00000000 Binary files a/plugins/dlsym and /dev/null differ diff --git a/plugins/dlsym.c b/plugins/dlsym.c deleted file mode 100755 index b93280bb..00000000 --- a/plugins/dlsym.c +++ /dev/null @@ -1,43 +0,0 @@ -/* by David "BAILOPAN" Anderson - * No warranties of any kind - * License: I hereby grant this work to the public domain and make no copyright claims. - */ -#include -#include -#include -#include - -int main(int argc, char **argv) -{ - char *file=NULL; - void *dl= NULL; - FILE *fp = NULL; - char path[PATH_MAX]; - if (argc != 2) - { - printf("Usage: dlsym \n"); - exit(0); - } - file = argv[1]; - realpath(file, path); - fp = fopen(path, "rb"); - if (!fp) - { - printf("File not found.\n"); - exit(0); - } - - dl = dlopen(path, RTLD_NOW); - - if (dl) - { - printf("Shared module loaded. Handle: %p\n", dl); - dlclose(dl); - dl = NULL; - } else { - printf("Shared module failed to load: %s\n", dlerror()); - } - - exit(0); -} - diff --git a/plugins/include/svn_version.inc b/plugins/include/svn_version.inc index 2701890f..d609cebc 100644 --- a/plugins/include/svn_version.inc +++ b/plugins/include/svn_version.inc @@ -11,6 +11,9 @@ #endif #define _svnversion_included -#define AMXX_VERSION 1.82 -#define AMXX_VERSION_NUM 182 -stock const AMXX_VERSION_STR[] = "1.8.2"; +#tryinclude +#if !defined _amxmodx_version_included + #define AMXX_VERSION 1.83 + #define AMXX_VERSION_NUM 183 + stock const AMXX_VERSION_STR[] = "1.8.3-dev"; +#endif diff --git a/plugins/include/svn_version.tpl b/plugins/include/svn_version.tpl deleted file mode 100644 index db49387a..00000000 --- a/plugins/include/svn_version.tpl +++ /dev/null @@ -1,16 +0,0 @@ -/* AMX Mod X constants -* -* by the AMX Mod X Development Team -* originally developed by OLO -* -* This file is provided as is (no warranties). -*/ - -#if defined _svnversion_included - #endinput -#endif -#define _svnversion_included - -#define AMXX_VERSION $PMAJOR$.$PMINOR$$PREVISION$ -#define AMXX_VERSION_NUM $PMAJOR$$PMINOR$$PREVISION$ -stock const AMXX_VERSION_STR[] = "$PMAJOR$.$PMINOR$.$PREVISION$"; diff --git a/support/PackageScript b/support/PackageScript new file mode 100644 index 00000000..2e47ea33 --- /dev/null +++ b/support/PackageScript @@ -0,0 +1,366 @@ +# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python: +import os + +builder.SetBuildFolder('packages') + +ModPackages = { + 'cstrike': 'cstrike', + 'dod': 'dod', + 'esf': 'esf', + 'ns': 'ns', + 'tfc': 'tfc', + 'tfcx': 'tfc', + 'ts': 'ts', +} + +folder_list = [ + 'base/addons/amxmodx/configs', + 'base/addons/amxmodx/data', + 'base/addons/amxmodx/data/lang', + 'base/addons/amxmodx/dlls', + 'base/addons/amxmodx/logs', + 'base/addons/amxmodx/modules', + 'base/addons/amxmodx/plugins', + 'base/addons/amxmodx/scripting', + 'base/addons/amxmodx/scripting/amxmod_compat', + 'base/addons/amxmodx/scripting/include', + 'base/addons/amxmodx/scripting/include/amxmod_compat', + 'base/addons/amxmodx/scripting/testsuite', + 'cstrike/addons/amxmodx/configs', + 'cstrike/addons/amxmodx/data', + 'cstrike/addons/amxmodx/plugins', + 'cstrike/addons/amxmodx/modules', + 'cstrike/addons/amxmodx/scripting', + 'dod/addons/amxmodx/configs', + 'dod/addons/amxmodx/data', + 'dod/addons/amxmodx/plugins', + 'dod/addons/amxmodx/modules', + 'dod/addons/amxmodx/scripting', + 'esf/addons/amxmodx/configs', + 'esf/addons/amxmodx/plugins', + 'esf/addons/amxmodx/scripting', + 'ns/addons/amxmodx/configs', + 'ns/addons/amxmodx/plugins', + 'ns/addons/amxmodx/modules', + 'ns/addons/amxmodx/scripting', + 'tfc/addons/amxmodx/configs', + 'tfc/addons/amxmodx/data', + 'tfc/addons/amxmodx/plugins', + 'tfc/addons/amxmodx/modules', + 'tfc/addons/amxmodx/scripting', + 'ts/addons/amxmodx/configs', + 'ts/addons/amxmodx/data', + 'ts/addons/amxmodx/plugins', + 'ts/addons/amxmodx/modules', + 'ts/addons/amxmodx/scripting', +] + +def split_all(path): + parts = [] + while True: + head, tail = os.path.split(path) + if head == path or tail == path: + parts.insert(0, path) + break + path = head + parts.insert(0, tail) + return parts + +# Create the distribution folder hierarchy. +folder_map = {} +for folder in folder_list: + norm_folder = os.path.normpath(folder) + folder_map[folder] = builder.AddFolder(norm_folder) + +# Copy core dlls. +for dll in AMXX.binaries: + builder.AddCopy(dll.binary, folder_map['base/addons/amxmodx/dlls']) + +# Copy modules. +for module in AMXX.modules: + parts = split_all(module.binary.path) + if parts[1] in ModPackages: + package = ModPackages[parts[1]] + else: + package = 'base' + builder.AddCopy(module.binary, folder_map[package + '/addons/amxmodx/modules']) + +# Copy the compiler. +builder.AddCopy(AMXX.amxxpc.binary, folder_map['base/addons/amxmodx/scripting']) +builder.AddCopy(AMXX.libpc300.binary, folder_map['base/addons/amxmodx/scripting']) + +# Copy plugins. +StatsPlugins = ['csstats.amxx'] +for amxx_file in AMXX.plugins: + amxx_entry = AMXX.plugins[amxx_file] + package = os.path.dirname(amxx_file) + output_folder = '/addons/amxmodx/plugins' + if not len(package): + package = 'base' + else: + # Ugh - statsx plugins go into a random folder. + name = os.path.basename(amxx_file) + if name == package + 'stats.amxx' or name in StatsPlugins: + output_folder = '/addons/amxmodx/data' + + builder.AddCopy(amxx_entry, folder_map[package + output_folder]) + + # If it was in a mod package, we can cheat and copy it to scripting since + # none of them are multi-file. + if package != 'base': + base_file, _ = os.path.splitext(os.path.basename(amxx_file)) + source_file = os.path.join( + builder.sourcePath, + 'plugins', + package, + base_file + '.sma' + ) + builder.AddCopy(source_file, folder_map[package + '/addons/amxmodx/scripting']) + +# Copy the generated version .inc. +for generated_header in AMXX.generated_headers: + if 'inc' in generated_header.path: + builder.AddCopy(generated_header, folder_map['base/addons/amxmodx/scripting/include']) + break + +# Copy WinCSX. +if builder.target_platform == 'windows': + builder.AddCopy(AMXX.csx_app.binary, folder_map['cstrike/addons/amxmodx/data']) + +# Copy configuration files for each mod. +configs = [ + 'amxx.cfg', + 'clcmds.ini', + 'cmds.ini', + 'configs.ini', + 'core.ini', + 'custommenuitems.cfg', + 'cvars.ini', + 'hamdata.ini', + 'maps.ini', + 'miscstats.ini', + 'modules.ini', + 'plugins.ini', + 'speech.ini', + 'sql.cfg', + 'users.ini', + 'cstrike/amxx.cfg', + 'cstrike/cmds.ini', + 'cstrike/core.ini', + 'cstrike/cvars.ini', + 'cstrike/maps.ini', + 'cstrike/modules.ini', + 'cstrike/plugins.ini', + 'cstrike/stats.ini', + 'dod/core.ini', + 'dod/cvars.ini', + 'dod/maps.ini', + 'dod/modules.ini', + 'dod/plugins.ini', + 'esf/modules.ini', + 'esf/plugins.ini', + 'ns/amxx.cfg', + 'ns/clcmds.ini', + 'ns/cmds.ini', + 'ns/cvars.ini', + 'ns/maps.ini', + 'ns/modules.ini', + 'ns/plugins.ini', + 'ns/speech.ini', + 'ns/users.ini', + 'tfc/core.ini', + 'tfc/cvars.ini', + 'tfc/maps.ini', + 'tfc/modules.ini', + 'tfc/plugins.ini', + 'ts/core.ini', + 'ts/maps.ini', + 'ts/modules.ini', + 'ts/plugins.ini', +] +for config in configs: + cfg_folder, cfg_file = os.path.split(config) + if len(cfg_folder): + out_folder = cfg_folder + '/addons/amxmodx/configs' + else: + out_folder = 'base/addons/amxmodx/configs' + builder.AddCopy( + source = os.path.join(builder.sourcePath, 'configs', config), + output_path = folder_map[out_folder] + ) + +# Copy core scripting files. +scripting_files = [ + 'admin.sma', + 'adminchat.sma', + 'admincmd.sma', + 'adminhelp.sma', + 'adminslots.sma', + 'adminvote.sma', + 'antiflood.sma', + 'cmdmenu.sma', + 'imessage.sma', + 'mapchooser.sma', + 'mapsmenu.sma', + 'menufront.sma', + 'multilingual.sma', + 'nextmap.sma', + 'pausecfg.sma', + 'plmenu.sma', + 'scrollmsg.sma', + 'statscfg.sma', + 'telemenu.sma', + 'timeleft.sma', + 'pluginmenu.sma', + 'amxmod_compat/amxmod_compat.sma', + 'amxmod_compat/core.sma', + 'amxmod_compat/mysql.sma', + 'amxmod_compat/vexdum.sma', + 'testsuite/admins_test.sma', + 'testsuite/arraytest.sma', + 'testsuite/callfunc_test.sma', + 'testsuite/fakemeta_tests.sma', + 'testsuite/fmttest.sma', + 'testsuite/fwdtest1.sma', + 'testsuite/fwdtest2.sma', + 'testsuite/logtest.sma', + 'testsuite/menutest.sma', + 'testsuite/native_test.sma', + 'testsuite/nvault_test.sma', + 'testsuite/sorttest.sma', + 'testsuite/sqlxtest.sma', + 'testsuite/sqlxtest.sq3', + 'testsuite/sqlxtest.sql', + 'testsuite/trietest.sma', + 'include/amxconst.inc', + 'include/amxmisc.inc', + 'include/amxmodx.inc', + 'include/core.inc', + 'include/csstats.inc', + 'include/cstrike.inc', + 'include/csx.inc', + 'include/dbi.inc', + 'include/dodconst.inc', + 'include/dodfun.inc', + 'include/dodstats.inc', + 'include/dodx.inc', + 'include/engine.inc', + 'include/engine_const.inc', + 'include/engine_stocks.inc', + 'include/esf.inc', + 'include/esf_const.inc', + 'include/fakemeta.inc', + 'include/fakemeta_const.inc', + 'include/fakemeta_stocks.inc', + 'include/file.inc', + 'include/float.inc', + 'include/fun.inc', + 'include/geoip.inc', + 'include/lang.inc', + 'include/ns.inc', + 'include/ns2amx.inc', + 'include/ns_const.inc', + 'include/nvault.inc', + 'include/regex.inc', + 'include/sockets.inc', + 'include/string.inc', + 'include/tfcconst.inc', + 'include/tfcstats.inc', + 'include/tfcx.inc', + 'include/tsconst.inc', + 'include/tsfun.inc', + 'include/tsstats.inc', + 'include/tsx.inc', + 'include/vault.inc', + 'include/xs.inc', + 'include/cellarray.inc', + 'include/celltrie.inc', + 'include/fakemeta_util.inc', + 'include/ham_const.inc', + 'include/hamsandwich.inc', + 'include/hlsdk_const.inc', + 'include/message_const.inc', + 'include/message_stocks.inc', + 'include/messages.inc', + 'include/newmenus.inc', + 'include/sorting.inc', + 'include/sqlx.inc', + 'include/svn_version.inc', + 'include/time.inc', + 'include/vector.inc', + 'include/amxmod_compat/VexdUM.inc', + 'include/amxmod_compat/VexdUM_const.inc', + 'include/amxmod_compat/VexdUM_stock.inc', + 'include/amxmod_compat/Vexd_Utilities.inc', + 'include/amxmod_compat/amxmod.inc', + 'include/amxmod_compat/maths.inc', + 'include/amxmod_compat/mysql.inc', + 'include/amxmod_compat/translator.inc', + 'include/amxmod_compat/xtrafun.inc', +] +for filename in scripting_files: + output_folder = 'base/addons/amxmodx/scripting' + inner_folder = os.path.dirname(filename) + if len(inner_folder): + output_folder += '/' + inner_folder + builder.AddCopy( + source = os.path.join(builder.sourcePath, 'plugins', filename), + output_path = folder_map[output_folder] + ) + +# Copy weird things. +weirdfiles = [ + ('dlls/geoip/GeoIP.dat', 'base/addons/amxmodx/data'), + ('plugins/esf/ESF_mod_tutorial.txt', 'esf/addons/amxmodx/scripting'), +] + +if builder.target_platform == 'windows': + weirdfiles += [ + ('plugins/compile.exe', 'base/addons/amxmodx/scripting'), + ] +else: + weirdfiles += [ + ('plugins/compile.sh', 'base/addons/amxmodx/scripting'), + ] + +for source, dest in weirdfiles: + builder.AddCopy( + source = os.path.join(builder.sourcePath, source), + output_path = folder_map[dest] + ) + +# Copy language data. +datafiles = [ + 'admin.txt', + 'adminchat.txt', + 'admincmd.txt', + 'adminhelp.txt', + 'adminslots.txt', + 'adminvote.txt', + 'antiflood.txt', + 'cmdmenu.txt', + 'common.txt', + 'imessage.txt', + 'languages.txt', + 'mapchooser.txt', + 'mapsmenu.txt', + 'menufront.txt', + 'miscstats.txt', + 'multilingual.txt', + 'nextmap.txt', + 'pausecfg.txt', + 'plmenu.txt', + 'restmenu.txt', + 'scrollmsg.txt', + 'stats_dod.txt', + 'statscfg.txt', + 'statsx.txt', + 'telemenu.txt', + 'timeleft.txt', + 'time.txt', +] +for datafile in datafiles: + builder.AddCopy( + source = os.path.join(builder.sourcePath, 'plugins', 'lang', datafile), + output_path = folder_map['base/addons/amxmodx/data/lang'] + ) diff --git a/support/Versioning b/support/Versioning new file mode 100644 index 00000000..ea01a5df --- /dev/null +++ b/support/Versioning @@ -0,0 +1,41 @@ +# vim: set ts=8 sts=2 sw=2 tw=99 et ft=python: +import os, sys + +builder.SetBuildFolder('/') + +includes = builder.AddFolder('includes') + +argv = [ + sys.executable, + os.path.join(builder.sourcePath, 'support', 'generate_headers.py'), + os.path.join(builder.sourcePath), + os.path.join(builder.buildPath, 'includes'), +] +outputs = [ + os.path.join(builder.buildFolder, 'includes', 'amxmodx_version.h'), + os.path.join(builder.buildFolder, 'includes', 'amxmodx_version.inc'), +] + +with open(os.path.join(builder.sourcePath, '.git', 'HEAD')) as fp: + git_state = fp.read().strip().split(':')[1].strip() + +git_head_path = os.path.join(builder.sourcePath, '.git', git_state) +if not os.path.exists(git_head_path): + git_head_path = os.path.join(builder.sourcePath, '.git', 'HEAD') + +sources = [ + os.path.join(builder.sourcePath, 'product.version'), + + # This is a hack, but we need some way to only run this script when HG changes. + git_head_path, + + # The script source is a dependency, of course... + argv[1] +] +cmd_node, output_nodes = builder.AddCommand( + inputs = sources, + argv = argv, + outputs = outputs +) + +rvalue = output_nodes diff --git a/support/buildbot/bootstrap.pl b/support/buildbot/bootstrap.pl index 8dd8fee5..5dc0055c 100755 --- a/support/buildbot/bootstrap.pl +++ b/support/buildbot/bootstrap.pl @@ -10,56 +10,46 @@ chdir($path); require 'helpers.pm'; #Go to main source dir -chdir(Build::PathFormat('../..')); +chdir(Build::PathFormat('../../..')); -#Do the annoying revision bumping. -#Linux needs some help here. -if ($^O eq "linux" || $^O eq "darwin") +#Get the source path. +our ($root) = getcwd(); + +my $reconf = 0; + +if (!(-f 'OUTPUT/.ambuild2/graph') || !(-f 'OUTPUT/.ambuild2/vars')) { + rmtree('OUTPUT'); + mkdir('OUTPUT') or die("Failed to create output folder: $!\n"); + chdir('OUTPUT'); + my ($result, $argn); + $argn = $#ARGV + 1; + print "Attempting to reconfigure...\n"; + my $conf_args = '--enable-optimize --no-color'; + if ($argn > 0 && $^O !~ /MSWin/) { + $result = `CC=$ARGV[0] CXX=$ARGV[0] python ../build/configure.py $conf_args`; + } else { + if ($^O =~ /MSWin/) { + $result = `C:\\Python27\\Python.exe ..\\build\\configure.py $conf_args`; + } else { + $result = `CC=clang CXX=clang python ../build/configure.py $conf_args`; + } + } + print "$result\n"; + if ($? != 0) { + die("Could not configure: $!\n"); + } +} + +sub IsNewer { - Build::Command("flip -u modules.versions"); - Build::Command("flip -u support/versionchanger.pl"); - Build::Command("chmod +x support/versionchanger.pl"); -} -Build::Command(Build::PathFormat('support/versionchanger.pl') . ' --buildstring="-dev"'); -#Build::Command(Build::PathFormat('support/versionchanger.pl')); + my ($file, $time) = (@_); -my $DEVENV = "C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\MSBuild.exe"; + my @s = stat($file); + my $mtime = $s[9]; + return $mtime > $time; +} -#Build the amxmodx builder tool. -chdir('installer/builder'); -if ($^O eq "linux" || $^O eq "darwin") { - Build::Command("make"); -} else { - Build::Command("\"$DEVENV\" builder.csproj /p:Configuration=Release /t:Rebuild"); -} -if (!(-f 'builder.exe')) { - die "Could not find build tool.\n"; -} -chdir('../..'); +exit(0); -if (-d '../OUTPUT') { - Build::Delete(Cwd::abs_path('../OUTPUT')); -} -Build::Command("mkdir " . Build::PathFormat('../OUTPUT')); -#Output directions on how to build. -open(DIRECTIONS, '>installer/builder/directions.info'); -if ($^O eq "linux") { - print DIRECTIONS "compress = /bin/tar\n"; -} elsif ($^O eq "darwin") { - print DIRECTIONS "compress = /usr/bin/zip\n"; -} else { - print DIRECTIONS "compress = C:\\WINDOWS\\zip.exe\n"; -} -print DIRECTIONS "source = " . Cwd::abs_path('.') . "\n"; -print DIRECTIONS "makeopts = \n"; -print DIRECTIONS "output = " . Cwd::abs_path('../OUTPUT') . "\n"; -if ($^O eq "linux" || $^O eq "darwin") { - print DIRECTIONS "devenv = /usr/bin/make\n"; -} else { - print DIRECTIONS "devenv = $DEVENV\n"; -} -print DIRECTIONS "release = amxmodx-" . Build::ProductVersion('product.version') . - "-hg" . Build::HgRevNum('.') . "\n"; -close(DIRECTIONS); diff --git a/support/buildbot/helpers.pm b/support/buildbot/helpers.pm index 704a7b17..05ce5945 100644 --- a/support/buildbot/helpers.pm +++ b/support/buildbot/helpers.pm @@ -9,6 +9,24 @@ our $SVN = "/usr/bin/svn"; our $SVN_USER = 'dvander'; our $SVN_ARGS = ''; +sub GitRevNum +{ + my ($path) = (@_); + my ($cd, $text, $rev); + + $cd = Cwd::cwd(); + chdir($path); + $text = `git rev-list --count HEAD`; + chdir($cd); + + chomp $text; + if ($text =~ /^(\d+)/) { + return $1; + } + + return 0; +} + sub HgRevNum { my ($path) = (@_); diff --git a/support/buildbot/package.pl b/support/buildbot/package.pl index 874b81de..2397f659 100755 --- a/support/buildbot/package.pl +++ b/support/buildbot/package.pl @@ -1,4 +1,5 @@ #!/usr/bin/perl +# vim: set ts=4 sts=4 sw=4 tw=99 noet: use strict; use Cwd; @@ -28,7 +29,7 @@ require 'helpers.pm'; my ($version); $version = Build::ProductVersion(Build::PathFormat('../../product.version')); -$version .= '-hg' . Build::HgRevNum('.'); +$version .= '-git' . Build::GitRevNum('.'); #Switch to the output folder. chdir(Build::PathFormat('../../../OUTPUT')); @@ -38,9 +39,33 @@ my (@packages,@mac_exclude); @mac_exclude = ('esf', 'ns', 'ts'); my ($major,$minor) = ($version =~ /^(\d+)\.(\d+)/); -$ftp_path .= "/$major.$minor"; + +my ($i); +for ($i = 0; $i <= $#packages; $i++) { + my ($filename); + next if (($^O eq "darwin") && ($packages[$i] ~~ @mac_exclude)); + + if ($^O eq "linux") { + $filename = "amxmodx-$version-" . $packages[$i] . "-linux.tar.gz"; + } elsif ($^O eq "darwin") { + $filename = "amxmodx-$version-" . $packages[$i] . "-mac.zip"; + } else { + $filename = "amxmodx-$version-" . $packages[$i] . "-windows.zip"; + } + unlink($filename); + + chdir(Build::PathFormat("packages/" . $packages[$i])); + if ($^O eq "linux") { + Build::Command("tar zcvf $filename addons"); + } else { + Build::Command("zip -r $filename addons"); + } + Build::Move($filename, Build::PathFormat('../../')); + chdir(Build::PathFormat('../..')); +} my ($ftp); +$ftp_path .= "/$major.$minor"; $ftp = Net::FTP->new($ftp_host, Debug => 0, Passive => 0) or die "Cannot connect to host $ftp_host: $@"; @@ -51,11 +76,10 @@ $ftp->login($ftp_user, $ftp_pass) if ($ftp_path ne '') { $ftp->cwd($ftp_path) - or die "Cannot change to folder $ftp_path: " . $ftp->message . "\n"; + or die "Cannot change to folder $ftp_path: " . $ftp->message . "\n"; } $ftp->binary(); -my ($i); for ($i = 0; $i <= $#packages; $i++) { my ($filename); if ($^O eq "linux") { diff --git a/support/buildbot/startbuild.pl b/support/buildbot/startbuild.pl index 255d2369..42ec2b6f 100755 --- a/support/buildbot/startbuild.pl +++ b/support/buildbot/startbuild.pl @@ -7,19 +7,22 @@ chdir($path); require 'helpers.pm'; -chdir('../../installer/builder'); +chdir('../../../OUTPUT'); -my $output; -if ($^O eq "linux" || $^O eq "darwin") { - $output = `mono builder.exe directions.info`; -} else { - $output = `builder.exe directions.info`; +my $argn = $#ARGV + 1; +if ($argn > 0) { + $ENV{CC} = $ARGV[0]; + $ENV{CXX} = $ARGV[0]; } -print $output . "\n"; -if (!($output =~ /Build succeeded/)) { - die "Build failed!\n"; -} else { +system("ambuild --no-color 2>&1"); + +if ($? != 0) +{ + die "Build failed: $!\n"; +} +else +{ exit(0); } diff --git a/support/generate_headers.py b/support/generate_headers.py new file mode 100644 index 00000000..c0c5b448 --- /dev/null +++ b/support/generate_headers.py @@ -0,0 +1,106 @@ +# vim: set ts=8 sts=2 sw=2 tw=99 et: +import re +import os, sys +import subprocess + +argv = sys.argv[1:] +if len(argv) < 2: + sys.stderr.write('Usage: generate_headers.py \n') + sys.exit(1) + +SourceFolder = os.path.abspath(os.path.normpath(argv[0])) +OutputFolder = os.path.normpath(argv[1]) + +class FolderChanger: + def __init__(self, folder): + self.old = os.getcwd() + self.new = folder + + def __enter__(self): + if self.new: + os.chdir(self.new) + + def __exit__(self, type, value, traceback): + os.chdir(self.old) + +def run_and_return(argv): + # Python 2.6 doesn't have check_output. + if hasattr(subprocess, 'check_output'): + text = subprocess.check_output(argv) + if str != bytes: + text = str(text, 'utf-8') + else: + p = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + output, ignored = p.communicate() + rval = p.poll() + if rval: + raise subprocess.CalledProcessError(rval, argv) + text = output.decode('utf8') + return text.strip() + +def get_git_version(): + revision_count = run_and_return(['git', 'rev-list', '--count', 'HEAD']) + revision_hash = run_and_return(['git', 'log', '--pretty=format:%h:%H', '-n', '1']) + shorthash, longhash = revision_hash.split(':') + + return revision_count, shorthash, longhash + +def output_version_headers(): + with FolderChanger(SourceFolder): + count, shorthash, longhash = get_git_version() + + with open(os.path.join(SourceFolder, 'product.version')) as fp: + contents = fp.read() + m = re.match('(\d+)\.(\d+)\.(\d+)-?(.*)', contents) + if m == None: + raise Exception('Could not detremine product version') + major, minor, release, tag = m.groups() + product = "{0}.{1}.{2}".format(major, minor, release) + fullstring = product + if tag != "": + fullstring += "-{0}".format(tag) + if tag == "dev": + fullstring += "+{0}".format(shorthash) + + with open(os.path.join(OutputFolder, 'amxmodx_version.h'), 'w') as fp: + fp.write(""" +#ifndef _AMXMODX_AUTO_VERSION_INFORMATION_H_ +#define _AMXMODX_AUTO_VERSION_INFORMATION_H_ + +#define SVN_VERSION_STRING "{fullstring}" +#define SVN_VERSION_DWORD {major}, {minor}, {release}, 0 +#define SVN_VERSION_PRODUCT "{product}" +#define SVN_VERSION SVN_VERSION_STRING +#define SVN_BUILD_ID "{count}:{longhash}" + +#endif // _AMXMODX_AUTO_VERSION_INFORMATION_H_ + """.format( + fullstring = fullstring, + major = major, + minor = minor, + release = release, + product = product, + count = count, + longhash = longhash + )) + + version_num = int(major) * 100 + int(minor) * 10 + int(release) + with open(os.path.join(OutputFolder, 'amxmodx_version.inc'), 'w') as fp: + fp.write(""" +#if defined _amxmodx_version_included + #endinput +#endif +#define _amxmodx_version_included + +#define AMXX_VERSION {major}.{minor}{release} +#define AMXX_VERSION_NUM {version_num} +stock const AMXX_VERSION_STR[] = "{fullstring}"; + """.format( + major = major, + minor = minor, + release = release, + version_num = version_num, + fullstring = fullstring + )) + +output_version_headers() diff --git a/support/versionchanger.pl b/support/versionchanger.pl deleted file mode 100755 index ce5f6f62..00000000 --- a/support/versionchanger.pl +++ /dev/null @@ -1,140 +0,0 @@ -#!/usr/bin/perl - -our %arguments = -( - 'config' => 'modules.versions', - 'major' => '1', - 'minor' => '0', - 'revision' => '0', - 'build' => undef, - 'path' => '', - 'buildstring' => '', -); - -my $arg; -foreach $arg (@ARGV) -{ - $arg =~ s/--//; - @arg = split(/=/, $arg); - $arguments{$arg[0]} = $arg[1]; -} - -#Set up path info -if ($arguments{'path'} ne "") -{ - if (!(-d $arguments{'path'})) - { - die "Unable to find path: " . $arguments{'path'} ."\n"; - } - chdir($arguments{'path'}); -} - -if (!open(CONFIG, $arguments{'config'})) -{ - die "Unable to open config file for reading: " . $arguments{'config'} . "\n"; -} - -our %modules; -my $cur_module = undef; -my $line; -while () -{ - chomp; - $line = $_; - if ($line =~ /^\[([^\]]+)\]$/) - { - $cur_module = $1; - next; - } - if (!$cur_module) - { - next; - } - if ($line =~ /^([^=]+) = (.+)$/) - { - $modules{$cur_module}{$1} = $2; - } -} - -close(CONFIG); - -#Copy global configuration options... -if (exists($modules{'PRODUCT'})) -{ - if (exists($modules{'PRODUCT'}{'major'})) - { - $arguments{'major'} = $modules{'PRODUCT'}{'major'}; - } - if (exists($modules{'PRODUCT'}{'minor'})) - { - $arguments{'minor'} = $modules{'PRODUCT'}{'minor'}; - } - if (exists($modules{'PRODUCT'}{'revision'})) - { - $arguments{'revision'} = $modules{'PRODUCT'}{'revision'}; - } -} - -#Get the global SVN revision if we have none -my $rev; -if ($arguments{'build'} == undef) -{ - my ($text); - $text = `hg identif -n -i`; - chomp $text; - $text =~ s/\+//g; - my ($id,$num) = split(/ /, $text); - $rev = "$num:$id"; -} -else -{ - $rev = int($arguments{'build'}); -} - -my $major = $arguments{'major'}; -my $minor = $arguments{'minor'}; -my $revision = $arguments{'revision'}; -my $buildstr = $arguments{'buildstring'}; - -#Go through everything now -my $mod_i; -while ( ($cur_module, $mod_i) = each(%modules) ) -{ - #Skip the magic one - if ($cur_module eq "PRODUCT") - { - next; - } - #Prepare path - my %mod = %{$mod_i}; - my $infile = $mod{'in'}; - my $outfile = $mod{'out'}; - if ($mod{'folder'}) - { - if (!(-d $mod{'folder'})) - { - die "Folder " . $mod{'folder'} . " not found.\n"; - } - $infile = $mod{'folder'} . '/' . $infile; - $outfile = $mod{'folder'} . '/' . $outfile; - } - if (!(-f $infile)) - { - die "File $infile is not a file.\n"; - } - #Start rewriting - open(INFILE, $infile) or die "Could not open file for reading: $infile\n"; - open(OUTFILE, '>'.$outfile) or die "Could not open file for writing: $outfile\n"; - while () - { - s/\$PMAJOR\$/$major/g; - s/\$PMINOR\$/$minor/g; - s/\$PREVISION\$/$revision/g; - s/\$BUILD_ID\$/$rev/g; - s/\$BUILD_STRING\$/$buildstr/g; - print OUTFILE $_; - } - close(OUTFILE); - close(INFILE); -} -