diff --git a/AMBuildScript b/AMBuildScript new file mode 100644 index 00000000..89712b15 --- /dev/null +++ b/AMBuildScript @@ -0,0 +1,286 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os +import sys +from ambuild.command import SymlinkCommand + +class SM: + def __init__(self): + self.compiler = Cpp.Compiler() + + #Build SDK info + self.sdkInfo = { } + self.sdkInfo['ep1'] = {'sdk': 'HL2SDK', 'ext': '1.ep1', 'def': '1', + 'name': 'EPISODEONE'} + self.sdkInfo['ep2'] = {'sdk': 'HL2SDKOB', 'ext': '2.ep2', 'def': '3', + 'name': 'ORANGEBOX'} + self.sdkInfo['ep2v'] = {'sdk': 'HL2SDKOBVALVE', 'ext': '2.ep2v', 'def': '4', + 'name': 'ORANGEBOXVALVE'} + self.sdkInfo['l4d'] = {'sdk': 'HL2SDKL4D', 'ext': '2.l4d', 'def': '5', + 'name': 'LEFT4DEAD'} + if AMBuild.target['platform'] == 'windows': + self.sdkInfo['darkm'] = {'sdk': 'HL2SDK-DARKM', 'ext': '2.darkm', 'def': '2', + 'name': 'DARKMESSIAH'} + + if AMBuild.mode == 'config': + #Detect compilers + self.compiler.DetectAll(AMBuild) + + #Detect variables + envvars = { 'MMSOURCE17': 'mmsource-1.7', + 'HL2SDK': 'hl2sdk', + 'HL2SDKOB': 'hl2sdk-ob', + 'HL2SDKL4D': 'hl2sdk-l4d', + 'HL2SDKOBVALVE': 'hl2sdk-ob-valve', + 'MYSQL5': 'mysql-5.0' + } + + #Dark Messiah is Windows-only + if AMBuild.target['platform'] == 'windows': + envvars['HL2SDK-DARKM'] = 'hl2sdk-darkm' + + #Must have a path for each envvar (file a bug if you don't like this) + for i in envvars: + if i in os.environ: + path = os.environ[i] + if not os.path.isdir(path): + raise Exception('Path for {0} was not found: {1}'.format(i, path)) + else: + head = os.getcwd() + while head != None and head != '/': + path = os.path.join(head, envvars[i]) + if os.path.isdir(path): + break + head, tail = os.path.split(head) + if head == None or head == '/': + raise Exception('Could not find a valid path for {0}'.format(i)) + AMBuild.cache.CacheVariable(i, path) + + #Set up defines + cxx = self.compiler.cxx + if isinstance(cxx, Cpp.GCC): + self.vendor = 'gcc' + self.compiler.AddToListVar('CDEFINES', 'stricmp=strcasecmp') + self.compiler.AddToListVar('CDEFINES', '_stricmp=strcasecmp') + self.compiler.AddToListVar('CDEFINES', '_snprintf=snprintf') + self.compiler.AddToListVar('CDEFINES', '_vsnprintf=vsnprintf') + self.compiler.AddToListVar('CFLAGS', '-pipe') + self.compiler.AddToListVar('CFLAGS', '-fno-strict-aliasing') + if cxx.majorVersion >= 4: + self.compiler.AddToListVar('CFLAGS', '-fvisibility=hidden') + self.compiler.AddToListVar('CXXFLAGS', '-fvisibility-inlines-hidden') + self.compiler.AddToListVar('CFLAGS', '-Wall') + self.compiler.AddToListVar('CFLAGS', '-Werror') + self.compiler.AddToListVar('CFLAGS', '-Wno-uninitialized') + self.compiler.AddToListVar('CFLAGS', '-Wno-unused') + self.compiler.AddToListVar('CFLAGS', '-Wno-switch') + self.compiler.AddToListVar('CFLAGS', '-mfpmath=sse') + self.compiler.AddToListVar('CFLAGS', '-msse') + self.compiler.AddToListVar('CFLAGS', '-m32') + self.compiler.AddToListVar('CFLAGS', '-static-libgcc') + self.compiler.AddToListVar('CXXFLAGS', '-fno-exceptions') + self.compiler.AddToListVar('CXXFLAGS', '-fno-rtti') + self.compiler.AddToListVar('CXXFLAGS', '-Wno-non-virtual-dtor') + self.compiler.AddToListVar('CDEFINES', 'HAVE_STDINT_H') + elif isinstance(cxx, Cpp.MSVC): + self.vendor = 'msvc' + if AMBuild.options.debug == '1': + self.compiler.AddToListVar('CFLAGS', '/MTd') + else: + self.compiler.AddToListVar('CFLAGS', '/MT') + self.compiler.AddToListVar('CDEFINES', '_CRT_SECURE_NO_DEPRECATE') + self.compiler.AddToListVar('CDEFINES', '_CRT_SECURE_NO_WARNINGS') + self.compiler.AddToListVar('CDEFINES', '_CRT_NONSTDC_NO_DEPRECATE') + self.compiler.AddToListVar('CXXFLAGS', '/EHsc') + self.compiler.AddToListVar('CXXFLAGS', '/GR-') + self.compiler.AddToListVar('CFLAGS', '/W3') + self.compiler.AddToListVar('CFLAGS', '/nologo') + self.compiler.AddToListVar('CFLAGS', '/Zi') + self.compiler.AddToListVar('CXXFLAGS', '/TP') + self.compiler.AddToListVar('POSTLINKFLAGS', '/MACHINE:X86') + self.compiler.AddToListVar('POSTLINKFLAGS', '/SUBSYSTEM:WINDOWS') + self.compiler.AddToListVar('POSTLINKFLAGS', 'kernel32.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'user32.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'gdi32.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'winspool.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'comdlg32.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'advapi32.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'shell32.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'ole32.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'oleaut32.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'uuid.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'odbc32.lib') + self.compiler.AddToListVar('POSTLINKFLAGS', 'odbccp32.lib') + + #Optimization + if AMBuild.options.opt == '1': + self.compiler.AddToListVar('CDEFINES', 'NDEBUG') + if self.vendor == 'gcc': + self.compiler.AddToListVar('CFLAGS', '-O3') + elif self.vendor == 'msvc': + self.compiler.AddToListVar('CFLAGS', '/Ot') + self.compiler.AddToListVar('POSTLINKFLAGS', '/OPT:ICF') + + #Debugging + if AMBuild.options.debug == '1': + self.compiler.AddToListVar('CDEFINES', 'DEBUG') + self.compiler.AddToListVar('CDEFINES', '_DEBUG') + if self.vendor == 'gcc': + self.compiler.AddToListVar('CFLAGS', '-g3') + elif self.vendor == 'msvc': + self.compiler.AddToListVar('CFLAGS', '/Od') + self.compiler.AddToListVar('CFLAGS', '/RTC1') + + #Platform-specifics + if AMBuild.target['platform'] == 'linux': + self.compiler.AddToListVar('CDEFINES', '_LINUX') + elif AMBuild.target['platform'] == 'windows': + self.compiler.AddToListVar('CDEFINES', 'WIN32') + self.compiler.AddToListVar('CDEFINES', '_WINDOWS') + + #Finish up + self.compiler.AddToListVar('CDEFINES', 'SOURCEMOD_BUILD') + self.compiler.AddToListVar('CDEFINES', 'SM_GENERATED_BUILD') + self.compiler.AddToListVar('CXXINCLUDES', + os.path.join(AMBuild.outputFolder, 'includes')) + self.compiler.ToConfig(AMBuild, 'compiler') + AMBuild.cache.CacheVariable('vendor', self.vendor) + self.targetMap = { } + AMBuild.cache.CacheVariable('targetMap', self.targetMap) + else: + self.compiler.FromConfig(AMBuild, 'compiler') + self.targetMap = AMBuild.cache['targetMap'] + + if AMBuild.target['platform'] == 'windows': + self.compiler.AddToListVar('RCINCLUDES', os.path.join(AMBuild.sourceFolder, 'public')) + self.mmsPath = AMBuild.cache['MMSOURCE17'] + + def DefaultCompiler(self): + return self.compiler.Clone() + + def JobMatters(self, jobname): + file = sys._getframe().f_code.co_filename + if AMBuild.mode == 'config': + self.targetMap[jobname] = file + return True + if len(AMBuild.args) == 0: + return True + if not jobname in AMBuild.args: + return False + + def DefaultExtCompiler(self, path): + compiler = self.DefaultCompiler() + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, path)) + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, path, 'sdk')) + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public')) + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'extensions')) + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'sourcepawn')) + return compiler + + def AutoVersion(self, folder, binary): + if AMBuild.target['platform'] != 'windows': + return + env = {'RCDEFINES': ['BINARY_NAME="' + binary.binaryFile + '"']} + binary.AddResourceFile(os.path.join(folder, 'version.rc' ), env) + + def PreSetupHL2Job(self, job, builder, sdk): + info = self.sdkInfo[sdk] + sdkPath = AMBuild.cache[info['sdk']] + if AMBuild.target['platform'] == 'linux': + if sdk == 'ep1': + staticLibs = os.path.join(sdkPath, 'linux_sdk') + else: + staticLibs = os.path.join(sdkPath, 'lib', 'linux') + workFolder = os.path.join(AMBuild.outputFolder, job.workFolder) + for i in ['tier1_i486.a', 'mathlib_i486.a', 'vstdlib_i486.so', 'tier0_i486.so']: + link = os.path.join(workFolder, i) + target = os.path.join(staticLibs, i) + try: + os.lstat(link) + except: + job.AddCommand(SymlinkCommand(link, target)) + elif AMBuild.target['platform'] == 'windows': + for lib in ['tier0', 'tier1', 'vstdlib', 'mathlib']: + libPath = os.path.join(sdkPath, 'lib', 'public', lib) + '.lib' + builder.RebuildIfNewer(libPath) + builder['POSTLINKFLAGS'].append(libPath) + + def PostSetupHL2Job(self, job, builder, sdk): + if AMBuild.target['platform'] == 'linux': + builder.AddObjectFiles(['tier1_i486.a', 'mathlib_i486.a']) + + def DefaultHL2Compiler(self, path, sdk, noLink = False, oldMms = '-legacy'): + compiler = self.DefaultExtCompiler(path) + + mms = 'core' + if sdk == 'ep1': + mms += oldMms + + compiler['CXXINCLUDES'].append(os.path.join(self.mmsPath, mms)) + compiler['CXXINCLUDES'].append(os.path.join(self.mmsPath, mms, 'sourcehook')) + + info = self.sdkInfo + compiler['CDEFINES'].extend(['SE_' + info[i]['name'] + '=' + info[i]['def'] for i in info]) + compiler['CDEFINES'].append('SE_DARKMESSIAH=2') + + paths = [['public'], ['public', 'engine'], ['public', 'mathlib'], ['public', 'vstdlib'], + ['public', 'tier0'], ['public', 'tier1']] + if sdk == 'ep1' or sdk == 'darkm': + paths.append(['public', 'dlls']) + else: + paths.append(['public', 'game', 'server']) + paths.append(['common']) + + info = self.sdkInfo[sdk] + sdkPath = AMBuild.cache[info['sdk']] + + compiler['CDEFINES'].append('SOURCE_ENGINE=' + info['def']) + + if sdk == 'ep1': + if AMBuild.target['platform'] == 'linux': + staticLibs = os.path.join(sdkPath, 'linux_sdk') + else: + if AMBuild.target['platform'] == 'linux': + staticLibs = os.path.join(sdkPath, 'lib', 'linux') + + for i in paths: + compiler['CXXINCLUDES'].append(os.path.join(sdkPath, *i)) + + if not noLink: + if AMBuild.target['platform'] == 'linux': + compiler['POSTLINKFLAGS'][0:0] = ['-lm'] + compiler['POSTLINKFLAGS'][0:0] = ['tier0_i486.so'] + compiler['POSTLINKFLAGS'][0:0] = ['vstdlib_i486.so'] + + return compiler + +sm = SM() +globals = { + 'SM': sm +} + +AMBuild.Include(os.path.join('tools', 'buildbot', 'Versioning'), globals) + +FileList = [ + ['loader', 'AMBuilder'], + ['core', 'AMBuilder'], + ['extensions', 'bintools', 'AMBuilder'], + ['extensions', 'clientprefs', 'AMBuilder'], + ['extensions', 'cstrike', 'AMBuilder'], + ['extensions', 'curl', 'AMBuilder'], + ['extensions', 'geoip', 'AMBuilder'], + ['extensions', 'mysql', 'AMBuilder'], + ['extensions', 'sdktools', 'AMBuilder'], + ['extensions', 'topmenus', 'AMBuilder'], + ['extensions', 'updater', 'AMBuilder'], + ['extensions', 'sqlite', 'AMBuilder'], + ['extensions', 'regex', 'AMBuilder'], + ['extensions', 'tf2', 'AMBuilder'], + ['sourcepawn', 'jit', 'AMBuilder'], + ['sourcepawn', 'compiler', 'AMBuilder'], + ['plugins', 'AMBuilder'], + ['tools', 'buildbot', 'PackageScript'] + ] + +for parts in FileList: + AMBuild.Include(os.path.join(*parts), globals) + diff --git a/core/AMBuilder b/core/AMBuilder new file mode 100644 index 00000000..05dd9844 --- /dev/null +++ b/core/AMBuilder @@ -0,0 +1,106 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +for i in SM.sdkInfo: + sdk = SM.sdkInfo[i] + name = 'sourcemod.' + sdk['ext'] + + compiler = SM.DefaultHL2Compiler('core', i) + compiler['CDEFINES'].append('SM_DEFAULT_THREADER') + + extension = AMBuild.AddJob(name) + binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler) + SM.PreSetupHL2Job(extension, binary, i) + files = [ + 'AdminCache.cpp', + 'ExtensionSys.cpp', + 'MenuStyle_Valve.cpp', + 'sm_crc32.cpp', + 'smn_entities.cpp', + 'smn_maplists.cpp', + 'sm_stringutil.cpp', + 'ADTFactory.cpp', + 'ForwardSys.cpp', + 'MenuVoting.cpp', + 'sm_memtable.cpp', + 'smn_events.cpp', + 'smn_menus.cpp', + 'sm_trie.cpp', + 'CDataPack.cpp', + 'frame_hooks.cpp', + 'NativeInvoker.cpp', + 'smn_admin.cpp', + 'smn_fakenatives.cpp', + 'smn_nextmap.cpp', + 'sourcemm_api.cpp', + 'ChatTriggers.cpp', + 'GameConfigs.cpp', + 'NativeOwner.cpp', + 'smn_adt_array.cpp', + 'smn_filesystem.cpp', + 'smn_player.cpp', + 'sourcemod.cpp', + 'concmd_cleaner.cpp', + 'HalfLife2.cpp', + 'NextMap.cpp', + 'smn_adt_stack.cpp', + 'smn_float.cpp', + 'smn_profiler.cpp', + 'TextParsers.cpp', + 'ConCmdManager.cpp', + 'HandleSys.cpp', + 'PhraseCollection.cpp', + 'smn_adt_trie.cpp', + 'smn_functions.cpp', + 'smn_sorting.cpp', + 'ThreadSupport.cpp', + 'ConVarManager.cpp', + 'LibrarySys.cpp', + 'PlayerManager.cpp', + 'smn_banning.cpp', + 'smn_gameconfigs.cpp', + 'smn_string.cpp', + 'TimerSys.cpp', + 'CoreConfig.cpp', + 'Logger.cpp', + 'PluginInfoDatabase.cpp', + 'smn_bitbuffer.cpp', + 'smn_halflife.cpp', + 'smn_textparse.cpp', + 'Translator.cpp', + 'MemoryUtils.cpp', + 'PluginSys.cpp', + 'smn_console.cpp', + 'smn_handles.cpp', + 'smn_timers.cpp', + 'UserMessages.cpp', + 'Database.cpp', + 'MenuManager.cpp', + 'Profiler.cpp', + 'smn_core.cpp', + 'smn_hudtext.cpp', + 'smn_usermsgs.cpp', + 'DebugReporter.cpp', + 'MenuStyle_Base.cpp', + 'ShareSys.cpp', + 'smn_database.cpp', + 'smn_keyvalues.cpp', + 'smn_vector.cpp', + 'EventManager.cpp', + 'MenuStyle_Radio.cpp', + 'sm_autonatives.cpp', + 'smn_datapacks.cpp', + 'smn_lang.cpp', + 'sm_srvcmds.cpp', + 'thread/ThreadWorker.cpp', + 'thread/BaseWorker.cpp' + ] + if AMBuild.target['platform'] == 'windows': + files.append('thread/WinThreads.cpp') + else: + files.append('thread/PosixThreads.cpp') + binary.AddSourceFiles('core', files) + SM.PostSetupHL2Job(extension, binary, i) + SM.AutoVersion('core', binary) + binary.SendToJob() + diff --git a/core/CoreConfig.cpp b/core/CoreConfig.cpp index 6e71ee57..5338c4f5 100644 --- a/core/CoreConfig.cpp +++ b/core/CoreConfig.cpp @@ -34,7 +34,7 @@ #include "sourcemod.h" #include "sourcemm_api.h" #include "sm_srvcmds.h" -#include "sm_version.h" +#include #include "sm_stringutil.h" #include "LibrarySys.h" #include "Logger.h" @@ -381,7 +381,7 @@ bool SM_ExecuteConfig(CPlugin *pl, AutoConfig *cfg, bool can_create) FILE *fp = fopen(file, "wt"); if (fp) { - fprintf(fp, "// This file was auto-generated by SourceMod (v%s)\n", SVN_FULL_VERSION); + fprintf(fp, "// This file was auto-generated by SourceMod (v%s)\n", SM_FULL_VERSION); fprintf(fp, "// ConVars for plugin \"%s\"\n", pl->GetFilename()); fprintf(fp, "\n\n"); diff --git a/core/Logger.cpp b/core/Logger.cpp index b2209258..0481b627 100644 --- a/core/Logger.cpp +++ b/core/Logger.cpp @@ -36,7 +36,7 @@ #include "Logger.h" #include "LibrarySys.h" #include "TimerSys.h" -#include "sm_version.h" +#include Logger g_Logger; @@ -149,7 +149,7 @@ void Logger::_NewMapFile() } else { char date[32]; strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime); - fprintf(fp, "L %s: SourceMod log file started (file \"L%02d%02d%03d.log\") (Version \"%s\")\n", date, curtime->tm_mon + 1, curtime->tm_mday, i, SVN_FULL_VERSION); + fprintf(fp, "L %s: SourceMod log file started (file \"L%02d%02d%03d.log\") (Version \"%s\")\n", date, curtime->tm_mon + 1, curtime->tm_mday, i, SM_FULL_VERSION); fclose(fp); } } @@ -356,7 +356,7 @@ void Logger::LogMessage(const char *vafmt, ...) char date[32]; m_DailyPrintHdr = false; strftime(date, sizeof(date), "%m/%d/%Y - %H:%M:%S", curtime); - fprintf(fp, "L %s: SourceMod log file session started (file \"L%04d%02d%02d.log\") (Version \"%s\")\n", date, curtime->tm_year + 1900, curtime->tm_mon + 1, curtime->tm_mday, SVN_FULL_VERSION); + fprintf(fp, "L %s: SourceMod log file session started (file \"L%04d%02d%02d.log\") (Version \"%s\")\n", date, curtime->tm_year + 1900, curtime->tm_mon + 1, curtime->tm_mday, SM_FULL_VERSION); } va_list ap; va_start(ap, vafmt); diff --git a/core/PlayerManager.cpp b/core/PlayerManager.cpp index afdd3991..1215c675 100644 --- a/core/PlayerManager.cpp +++ b/core/PlayerManager.cpp @@ -47,7 +47,7 @@ #include #include "GameConfigs.h" #include "ExtensionSys.h" -#include "sm_version.h" +#include PlayerManager g_Players; bool g_OnMapStarted = false; @@ -698,7 +698,7 @@ void PlayerManager::OnClientCommand(edict_t *pEntity) } ClientConsolePrint(pEntity, - "SourceMod %s, by AlliedModders LLC", SVN_FULL_VERSION); + "SourceMod %s, by AlliedModders LLC", SM_FULL_VERSION); ClientConsolePrint(pEntity, "To see running plugins, type \"sm plugins\""); ClientConsolePrint(pEntity, diff --git a/core/sm_srvcmds.cpp b/core/sm_srvcmds.cpp index d73dd95a..00235745 100644 --- a/core/sm_srvcmds.cpp +++ b/core/sm_srvcmds.cpp @@ -30,7 +30,7 @@ */ #include "sm_srvcmds.h" -#include "sm_version.h" +#include #include "sm_stringutil.h" #include "HandleSys.h" #include "CoreConfig.h" @@ -39,7 +39,7 @@ RootConsoleMenu g_RootMenu; -ConVar sourcemod_version("sourcemod_version", SVN_FULL_VERSION, FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY, "SourceMod Version"); +ConVar sourcemod_version("sourcemod_version", SM_FULL_VERSION, FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY, "SourceMod Version"); RootConsoleMenu::RootConsoleMenu() { @@ -280,7 +280,7 @@ void RootConsoleMenu::OnRootConsoleCommand(const char *cmdname, const CCommand & else if (strcmp(cmdname, "version") == 0) { ConsolePrint(" SourceMod Version Information:"); - ConsolePrint(" SourceMod Version: %s", SVN_FULL_VERSION); + ConsolePrint(" SourceMod Version: %s", SM_FULL_VERSION); ConsolePrint(" SourcePawn Engine: %s (build %s)", g_pSourcePawn2->GetEngineName(), g_pSourcePawn2->GetVersionString()); ConsolePrint(" SourcePawn API: v1 = %d, v2 = %d", g_pSourcePawn->GetEngineAPIVersion(), g_pSourcePawn2->GetAPIVersion()); ConsolePrint(" Compiled on: %s %s", __DATE__, __TIME__); diff --git a/core/sm_version.tpl b/core/sm_version.tpl deleted file mode 100644 index 6b28661a..00000000 --- a/core/sm_version.tpl +++ /dev/null @@ -1,48 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SOURCEMOD_VERSION_H_ -#define _INCLUDE_SOURCEMOD_VERSION_H_ - -/** - * @file Contains SourceMod version information. - */ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/core/smn_profiler.cpp b/core/smn_profiler.cpp index a359e1ff..4fa8eca1 100644 --- a/core/smn_profiler.cpp +++ b/core/smn_profiler.cpp @@ -34,9 +34,7 @@ //Note: Do not add this to Linux yet, i haven't done the HPET timing research (if even available) //nonetheless we need accurate counting -#if defined PLATFORM_LINUX -#error "Not supported" -#endif +#if !defined PLATFORM_LINUX struct Profiler { @@ -183,3 +181,5 @@ REGISTER_NATIVES(profilerNatives) {"StopProfiling", StopProfiling}, {NULL, NULL}, }; +#endif + diff --git a/core/sourcemm_api.cpp b/core/sourcemm_api.cpp index 94f92b7b..916fa60f 100644 --- a/core/sourcemm_api.cpp +++ b/core/sourcemm_api.cpp @@ -31,7 +31,7 @@ #include "sourcemod.h" #include "sourcemm_api.h" -#include "sm_version.h" +#include #include "Logger.h" #include "ExtensionSys.h" #include "concmd_cleaner.h" @@ -145,7 +145,7 @@ const char *SourceMod_Core::GetLicense() const char *SourceMod_Core::GetVersion() { - return SVN_FULL_VERSION; + return SM_FULL_VERSION; } const char *SourceMod_Core::GetDate() diff --git a/core/version.rc b/core/version.rc index 0e8331d8..3d3631d1 100644 --- a/core/version.rc +++ b/core/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "sm_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "SourceMod" VALUE "FileDescription", "SourceMod Core" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "sourcemod" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/bintools/AMBuilder b/extensions/bintools/AMBuilder new file mode 100644 index 00000000..611006c2 --- /dev/null +++ b/extensions/bintools/AMBuilder @@ -0,0 +1,30 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +for i in SM.sdkInfo: + sdk = SM.sdkInfo[i] + name = 'bintools.ext.' + sdk['ext'] + + compiler = SM.DefaultHL2Compiler('extensions/bintools', i, True, '') + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit')) + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit', 'x86')) + + if i != 'ep1': + compiler['CDEFINES'].append('HOOKING_ENABLED') + + extension = AMBuild.AddJob(name) + binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler) + SM.PreSetupHL2Job(extension, binary, i) + binary.AddSourceFiles('extensions/bintools', [ + 'extension.cpp', + 'CallMaker.cpp', + 'CallWrapper.cpp', + 'HookWrapper.cpp', + 'jit_call.cpp', + 'jit_hook.cpp', + 'sdk/smsdk_ext.cpp' + ]) + SM.PostSetupHL2Job(extension, binary, i) + SM.AutoVersion('extensions/bintools', binary) + binary.SendToJob() + diff --git a/extensions/bintools/extension.cpp b/extensions/bintools/extension.cpp index 276e1f5e..235878a4 100644 --- a/extensions/bintools/extension.cpp +++ b/extensions/bintools/extension.cpp @@ -1,5 +1,5 @@ /** - * vim: set ts=4 : + * vim: set ts=4 sw=4 tw=99 noet: * ============================================================================= * SourceMod BinTools Extension * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" #include "CallMaker.h" @@ -54,3 +55,14 @@ bool BinTools::SDK_OnLoad(char *error, size_t maxlength, bool late) return true; } + +const char *BinTools::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *BinTools::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + diff --git a/extensions/bintools/extension.h b/extensions/bintools/extension.h index 2bdbdb0c..d920c94f 100644 --- a/extensions/bintools/extension.h +++ b/extensions/bintools/extension.h @@ -81,6 +81,8 @@ public: * @return True if working, false otherwise. */ //virtual bool QueryRunning(char *error, size_t maxlength); + const char *GetVersion(); + const char *GetDate(); public: #if defined SMEXT_CONF_METAMOD /** diff --git a/extensions/bintools/sdk/smsdk_config.h b/extensions/bintools/sdk/smsdk_config.h index 39424418..a20c2f7c 100644 --- a/extensions/bintools/sdk/smsdk_config.h +++ b/extensions/bintools/sdk/smsdk_config.h @@ -31,7 +31,6 @@ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ -#include "svn_version.h" /** * @file smsdk_config.h @@ -41,12 +40,12 @@ /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "BinTools" #define SMEXT_CONF_DESCRIPTION "Low-level C/C++ Calling API" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "SAMPLE" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/bintools/svn_version.h b/extensions/bintools/svn_version.h deleted file mode 100644 index 5a7f5588..00000000 --- a/extensions/bintools/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod BinTools Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_BINTOOLS_VERSION_H_ -#define _INCLUDE_BINTOOLS_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_BINTOOLS_VERSION_H_ diff --git a/extensions/bintools/svn_version.tpl b/extensions/bintools/svn_version.tpl deleted file mode 100644 index 603604fc..00000000 --- a/extensions/bintools/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod BinTools Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_BINTOOLS_VERSION_H_ -#define _INCLUDE_BINTOOLS_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_BINTOOLS_VERSION_H_ diff --git a/extensions/bintools/version.rc b/extensions/bintools/version.rc index efb8e991..a8e9f049 100644 --- a/extensions/bintools/version.rc +++ b/extensions/bintools/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "BinTools Extension" VALUE "FileDescription", "SourceMod BinTools Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod BinTools Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod BinTools Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/clientprefs/AMBuilder b/extensions/clientprefs/AMBuilder new file mode 100644 index 00000000..09d26f0d --- /dev/null +++ b/extensions/clientprefs/AMBuilder @@ -0,0 +1,19 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +compiler = SM.DefaultExtCompiler('extensions/clientprefs') +compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook')) + +extension = AMBuild.AddJob('clientprefs.ext') +binary = Cpp.LibraryBuilder('clientprefs.ext', AMBuild, extension, compiler) +binary.AddSourceFiles('extensions/clientprefs', [ + 'extension.cpp', + 'cookie.cpp', + 'menus.cpp', + 'natives.cpp', + 'query.cpp', + 'sdk/smsdk_ext.cpp' + ]) +SM.AutoVersion('extensions/clientprefs', binary) +binary.SendToJob() + diff --git a/extensions/clientprefs/cookie.h b/extensions/clientprefs/cookie.h index 22fd26a9..72d52b20 100644 --- a/extensions/clientprefs/cookie.h +++ b/extensions/clientprefs/cookie.h @@ -33,6 +33,7 @@ #define _INCLUDE_SOURCEMOD_CLIENTPREFS_COOKIE_H_ #include "extension.h" +#include #include "sh_list.h" #include "sm_trie_tpl.h" diff --git a/extensions/clientprefs/extension.cpp b/extensions/clientprefs/extension.cpp index 126761d0..688f9905 100644 --- a/extensions/clientprefs/extension.cpp +++ b/extensions/clientprefs/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" /** @@ -430,5 +431,13 @@ bool Translate(char *buffer, return true; } +const char *ClientPrefs::GetVersion() +{ + return SM_FULL_VERSION; +} +const char *ClientPrefs::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} diff --git a/extensions/clientprefs/extension.h b/extensions/clientprefs/extension.h index 89e57031..9bd2d178 100644 --- a/extensions/clientprefs/extension.h +++ b/extensions/clientprefs/extension.h @@ -84,6 +84,9 @@ public: virtual void NotifyInterfaceDrop(SMInterface *pInterface); + const char *GetVersion(); + const char *GetDate(); + void DatabaseConnect(); bool AddQueryToQueue(TQueryOp *query); diff --git a/extensions/clientprefs/sdk/smsdk_config.h b/extensions/clientprefs/sdk/smsdk_config.h index 2cd8c6ea..dcee6314 100644 --- a/extensions/clientprefs/sdk/smsdk_config.h +++ b/extensions/clientprefs/sdk/smsdk_config.h @@ -37,17 +37,15 @@ * @brief Contains macros for configuring basic extension information. */ -#include "svn_version.h" - /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "Client Preferences" #define SMEXT_CONF_DESCRIPTION "Saves client preference settings" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "CLIENTPREFS" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/clientprefs/svn_version.h b/extensions/clientprefs/svn_version.h deleted file mode 100644 index 6ae2a2a7..00000000 --- a/extensions/clientprefs/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod SDKTools Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_CLIENTPREFS_VERSION_H_ -#define _INCLUDE_CLIENTPREFS_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_CLIENTPREFS_VERSION_H_ diff --git a/extensions/clientprefs/svn_version.tpl b/extensions/clientprefs/svn_version.tpl deleted file mode 100644 index 326eca01..00000000 --- a/extensions/clientprefs/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod SDKTools Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_CLIENTPREFS_VERSION_H_ -#define _INCLUDE_CLIENTPREFS_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_CLIENTPREFS_VERSION_H_ diff --git a/extensions/clientprefs/version.rc b/extensions/clientprefs/version.rc index 2a9f2806..e8ae08a8 100644 --- a/extensions/clientprefs/version.rc +++ b/extensions/clientprefs/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "Client Preferences Extension" VALUE "FileDescription", "SourceMod Client Preferences Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod Client Preferences Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod Client Preferences Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/cstrike/AMBuilder b/extensions/cstrike/AMBuilder new file mode 100644 index 00000000..89c33d19 --- /dev/null +++ b/extensions/cstrike/AMBuilder @@ -0,0 +1,21 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +sdk = SM.sdkInfo['ep1'] +compiler = SM.DefaultHL2Compiler('extensions/cstrike', 'ep1') + +name = 'game.cstrike.ext.' + sdk['ext'] +extension = AMBuild.AddJob(name) +binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler) +SM.PreSetupHL2Job(extension, binary, 'ep1') +binary.AddSourceFiles('extensions/cstrike', [ + 'extension.cpp', + 'natives.cpp', + 'RegNatives.cpp', + 'timeleft.cpp', + 'sdk/smsdk_ext.cpp' + ]) +SM.PostSetupHL2Job(extension, binary, 'ep1') +SM.AutoVersion('extensions/cstrike', binary) +binary.SendToJob() + diff --git a/extensions/cstrike/extension.cpp b/extensions/cstrike/extension.cpp index 345fb884..8cbd5e40 100644 --- a/extensions/cstrike/extension.cpp +++ b/extensions/cstrike/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" #include "RegNatives.h" #include "timeleft.h" @@ -250,3 +251,14 @@ bool CStrike::ProcessCommandTarget(cmd_target_info_t *info) return true; } + +const char *CStrike::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *CStrike::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + diff --git a/extensions/cstrike/extension.h b/extensions/cstrike/extension.h index 20a866a1..12c7dce0 100644 --- a/extensions/cstrike/extension.h +++ b/extensions/cstrike/extension.h @@ -86,6 +86,9 @@ public: void NotifyInterfaceDrop(SMInterface *pInterface); bool QueryInterfaceDrop(SMInterface *pInterface); + + const char *GetVersion(); + const char *GetDate(); public: bool ProcessCommandTarget(cmd_target_info_t *info); public: diff --git a/extensions/cstrike/sdk/smsdk_config.h b/extensions/cstrike/sdk/smsdk_config.h index d3860fa2..a522b074 100644 --- a/extensions/cstrike/sdk/smsdk_config.h +++ b/extensions/cstrike/sdk/smsdk_config.h @@ -37,17 +37,15 @@ * @brief Contains macros for configuring basic extension information. */ -#include "svn_version.h" - /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "CS:S Tools" #define SMEXT_CONF_DESCRIPTION "CS:S extended functionality" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "CSTRIKE" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/cstrike/svn_version.h b/extensions/cstrike/svn_version.h deleted file mode 100644 index f11b0778..00000000 --- a/extensions/cstrike/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod Counter-Strike:Source Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SDKTOOLS_VERSION_H_ -#define _INCLUDE_SDKTOOLS_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_SDKTOOLS_VERSION_H_ diff --git a/extensions/cstrike/svn_version.tpl b/extensions/cstrike/svn_version.tpl deleted file mode 100644 index fa07e088..00000000 --- a/extensions/cstrike/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod Counter-Strike:Source Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SDKTOOLS_VERSION_H_ -#define _INCLUDE_SDKTOOLS_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_SDKTOOLS_VERSION_H_ diff --git a/extensions/cstrike/version.rc b/extensions/cstrike/version.rc index 9f941b75..7bf56997 100644 --- a/extensions/cstrike/version.rc +++ b/extensions/cstrike/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "SourceMod CS:S Extension" VALUE "FileDescription", "SourceMod CS:S Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod CS:S Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod CS:S Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/curl/AMBuilder b/extensions/curl/AMBuilder new file mode 100644 index 00000000..dd4d6a4d --- /dev/null +++ b/extensions/curl/AMBuilder @@ -0,0 +1,67 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python : +import os.path +import ambuild.command as command +import ambuild.osutil as osutil + +def BuildCURL(): + curl = AMBuild.AddJob('curl') + if AMBuild.target['platform'] == 'linux': + if not osutil.FileExists(os.path.join(AMBuild.outputFolder, 'curl', 'Makefile')): + args = ['/bin/bash', + os.path.join(AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'configure'), + '--enable-static', + '--disable-shared', + '--disable-ldap', + '--without-ssl', + '--without-libidn', + '--without-libssh2', + '--without-zlib'] + curl.AddCommand(command.DirectCommand(args)) + curl.AddCommand(command.DirectCommand(['make'])) + else: + args = ['devenv.com', + '/Build', + 'LIB Release', + os.path.join(AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'lib', + 'build_libcurl.vcproj')] + curl.AddCommand(command.DirectCommand(args)) + #die "Unable to find libcurl.lib!\n" unless (-f "LIB-Release\\libcurl.lib"); + +BuildCURL() + +compiler = SM.DefaultExtCompiler('extensions/curl') +extension = AMBuild.AddJob('webternet.ext') +binary = Cpp.LibraryBuilder('webternet.ext', AMBuild, extension, compiler) + +curlPath = [AMBuild.sourceFolder, 'extensions', 'curl', 'curl-src', 'include'] +compiler['CXXINCLUDES'].append(os.path.join(*curlPath)) +compiler['CDEFINES'].append('CURL_STATICLIB') + +binary.AddSourceFiles('extensions/curl', [ + 'extension.cpp', + 'curlapi.cpp', + 'sdk/smsdk_ext.cpp', + ]) + +if AMBuild.target['platform'] == 'linux': + path = os.path.join(AMBuild.outputFolder, + 'curl', + 'lib', + '.libs', + 'libcurl.a') + binary['POSTLINKFLAGS'].append('-lrt') + binary.AddObjectFiles([path]) +elif AMBuild.target['platform'] == 'windows': + path = os.path.join(AMBuild.sourceFolder, + 'extensions', + 'curl', + 'curl-src', + 'lib', + 'LIB-Release', + 'libcurl.lib') + binary.RelinkIfNewer(path) + binary['POSTLINKFLAGS'].extend([path, 'ws2_32.lib']) + +SM.AutoVersion('extensions/curl', binary) +binary.SendToJob() + diff --git a/extensions/curl/curl-src/docs/libcurl/curl_version.html b/extensions/curl/curl-src/docs/libcurl/curl_version.html deleted file mode 100644 index d2f1032a..00000000 --- a/extensions/curl/curl-src/docs/libcurl/curl_version.html +++ /dev/null @@ -1,55 +0,0 @@ - -curl_version man page - - - - -

NAME

-

curl_version - returns the libcurl version string

SYNOPSIS

-

#include <curl/curl.h> -

char *curl_version( ); -

DESCRIPTION

-

Returns a human readable string with the version number of libcurl and some of its important components (like OpenSSL version).

RETURN VALUE

-

A pointer to a zero terminated string.

SEE ALSO

-

curl_version_info (3)

- This HTML page was made with roffit. - diff --git a/extensions/curl/curl-src/src/version.h b/extensions/curl/curl-src/src/version.h deleted file mode 100644 index c3701d73..00000000 --- a/extensions/curl/curl-src/src/version.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef __VERSION_H -#define __VERSION_H -/*************************************************************************** - * _ _ ____ _ - * Project ___| | | | _ \| | - * / __| | | | |_) | | - * | (__| |_| | _ <| |___ - * \___|\___/|_| \_\_____| - * - * Copyright (C) 1998 - 2008, Daniel Stenberg, , et al. - * - * This software is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at http://curl.haxx.se/docs/copyright.html. - * - * You may opt to use, copy, modify, merge, publish, distribute and/or sell - * copies of the Software, and permit persons to whom the Software is - * furnished to do so, under the terms of the COPYING file. - * - * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY - * KIND, either express or implied. - * - * $Id: version.h,v 1.94 2008-01-24 14:15:49 gknauf Exp $ - ***************************************************************************/ - -#include - -#define CURL_NAME "curl" -#define CURL_COPYRIGHT LIBCURL_COPYRIGHT -#define CURL_VERSION "7.19.2" -#define CURL_VERSION_MAJOR LIBCURL_VERSION_MAJOR -#define CURL_VERSION_MINOR LIBCURL_VERSION_MINOR -#define CURL_VERSION_PATCH LIBCURL_VERSION_PATCH -#define CURL_ID CURL_NAME " " CURL_VERSION " (" OS ") " - -#endif diff --git a/extensions/curl/extension.cpp b/extensions/curl/extension.cpp index e97f03d9..1f4a9c62 100644 --- a/extensions/curl/extension.cpp +++ b/extensions/curl/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" #include #include @@ -74,3 +75,14 @@ void CurlExt::SDK_OnUnload() { curl_global_cleanup(); } + +const char *CurlExt::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *CurlExt::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + diff --git a/extensions/curl/extension.h b/extensions/curl/extension.h index 76bc1fa1..ae7fad3c 100644 --- a/extensions/curl/extension.h +++ b/extensions/curl/extension.h @@ -81,6 +81,8 @@ public: * @return True if working, false otherwise. */ //virtual bool QueryRunning(char *error, size_t maxlength); + const char *GetVersion(); + const char *GetDate(); public: #if defined SMEXT_CONF_METAMOD /** diff --git a/extensions/curl/sdk/smsdk_config.h b/extensions/curl/sdk/smsdk_config.h index dc37eac1..ee2fbdf2 100644 --- a/extensions/curl/sdk/smsdk_config.h +++ b/extensions/curl/sdk/smsdk_config.h @@ -31,7 +31,6 @@ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ -#include "svn_version.h" /** * @file smsdk_config.h @@ -41,12 +40,12 @@ /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "Webternet" #define SMEXT_CONF_DESCRIPTION "Extension for interacting with URLs" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "WEB" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/curl/svn_version.h b/extensions/curl/svn_version.h deleted file mode 100644 index 17e555a9..00000000 --- a/extensions/curl/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod GeoIP Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_GEOIP_VERSION_H_ -#define _INCLUDE_GEOIP_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_GEOIP_VERSION_H_ diff --git a/extensions/curl/svn_version.tpl b/extensions/curl/svn_version.tpl deleted file mode 100644 index 679a3732..00000000 --- a/extensions/curl/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod GeoIP Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_GEOIP_VERSION_H_ -#define _INCLUDE_GEOIP_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_GEOIP_VERSION_H_ diff --git a/extensions/curl/version.rc b/extensions/curl/version.rc index f57045e3..407550ce 100644 --- a/extensions/curl/version.rc +++ b/extensions/curl/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "Webternet Extension" VALUE "FileDescription", "SourceMod Webternet Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod Webternet Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2009, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod Webternet Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/geoip/AMBuilder b/extensions/geoip/AMBuilder new file mode 100644 index 00000000..e9df90d8 --- /dev/null +++ b/extensions/geoip/AMBuilder @@ -0,0 +1,15 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +compiler = SM.DefaultExtCompiler('extensions/geoip') + +extension = AMBuild.AddJob('geoip.ext') +binary = Cpp.LibraryBuilder('geoip.ext', AMBuild, extension, compiler) +binary.AddSourceFiles('extensions/geoip', [ + 'extension.cpp', + 'GeoIP.c', + 'sdk/smsdk_ext.cpp' + ]) +if AMBuild.target['platform'] == 'windows': + binary['POSTLINKFLAGS'].append('wsock32.lib') +SM.AutoVersion('extensions/geoip', binary) +binary.SendToJob() + diff --git a/extensions/geoip/extension.cpp b/extensions/geoip/extension.cpp index e65485a7..a1b4eb1b 100644 --- a/extensions/geoip/extension.cpp +++ b/extensions/geoip/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" #include "GeoIP.h" @@ -67,6 +68,16 @@ void GeoIP_Extension::SDK_OnUnload() gi = NULL; } +const char *GeoIP_Extension::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *GeoIP_Extension::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + /******************************* * * * GEOIP NATIVE IMPLEMENTATIONS * @@ -131,3 +142,4 @@ const sp_nativeinfo_t geoip_natives[] = {"GeoipCountry", sm_Geoip_Country}, {NULL, NULL}, }; + diff --git a/extensions/geoip/extension.h b/extensions/geoip/extension.h index ff978e53..b06b225a 100644 --- a/extensions/geoip/extension.h +++ b/extensions/geoip/extension.h @@ -62,6 +62,9 @@ public: */ virtual void SDK_OnUnload(); + const char *GetVersion(); + const char *GetDate(); + /** * @brief This is called once all known extensions have been loaded. * Note: It is is a good idea to add natives here, if any are provided. diff --git a/extensions/geoip/sdk/smsdk_config.h b/extensions/geoip/sdk/smsdk_config.h index aeb9b32f..fa147344 100644 --- a/extensions/geoip/sdk/smsdk_config.h +++ b/extensions/geoip/sdk/smsdk_config.h @@ -31,7 +31,6 @@ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ -#include "svn_version.h" /** * @file smsdk_config.h @@ -41,12 +40,12 @@ /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "GeoIP" #define SMEXT_CONF_DESCRIPTION "Geographical IP information" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "GEOIP" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/geoip/svn_version.h b/extensions/geoip/svn_version.h deleted file mode 100644 index 17e555a9..00000000 --- a/extensions/geoip/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod GeoIP Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_GEOIP_VERSION_H_ -#define _INCLUDE_GEOIP_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_GEOIP_VERSION_H_ diff --git a/extensions/geoip/svn_version.tpl b/extensions/geoip/svn_version.tpl deleted file mode 100644 index 679a3732..00000000 --- a/extensions/geoip/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod GeoIP Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_GEOIP_VERSION_H_ -#define _INCLUDE_GEOIP_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_GEOIP_VERSION_H_ diff --git a/extensions/geoip/version.rc b/extensions/geoip/version.rc index 8fe65d23..a94221f4 100644 --- a/extensions/geoip/version.rc +++ b/extensions/geoip/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "GeoIP Extension" VALUE "FileDescription", "SourceMod GeoIP Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod GeoIP Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod GeoIP Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/mysql/AMBuilder b/extensions/mysql/AMBuilder new file mode 100644 index 00000000..1ad18d78 --- /dev/null +++ b/extensions/mysql/AMBuilder @@ -0,0 +1,38 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +compiler = SM.DefaultExtCompiler('extensions/mysql') +compiler['CXXINCLUDES'].append(os.path.join(AMBuild.cache['MYSQL5'], 'include')) +compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook')) + +extension = AMBuild.AddJob('dbi.mysql.ext') +binary = Cpp.LibraryBuilder('dbi.mysql.ext', AMBuild, extension, compiler) + +if AMBuild.target['platform'] == 'linux': + lib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'libmysqlclient_r.a') + link = [lib, + '-lz', + '-lpthread', + '-lm'] + binary.RelinkIfNewer(lib) + binary['POSTLINKFLAGS'].extend(link) +elif AMBuild.target['platform'] == 'windows': + mylib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'opt', 'mysqlclient.lib') + zlib = os.path.join(AMBuild.cache['MYSQL5'], 'lib', 'opt', 'zlib.lib') + binary.RelinkIfNewer(mylib) + binary.RelinkIfNewer(zlib) + binary['POSTLINKFLAGS'].extend([mylib, zlib, 'wsock32.lib']) + + +binary.AddSourceFiles('extensions/mysql', [ + 'sdk/smsdk_ext.cpp', + 'mysql/MyBasicResults.cpp', + 'mysql/MyBoundResults.cpp', + 'mysql/MyDatabase.cpp', + 'mysql/MyDriver.cpp', + 'mysql/MyStatement.cpp', + 'extension.cpp' + ]) +SM.AutoVersion('extensions/mysql', binary) +binary.SendToJob() + diff --git a/extensions/mysql/extension.cpp b/extensions/mysql/extension.cpp index 5607ef12..6e344cb5 100644 --- a/extensions/mysql/extension.cpp +++ b/extensions/mysql/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" #include "mysql/MyDriver.h" #include @@ -58,3 +59,14 @@ void DBI_MySQL::SDK_OnUnload() //:TODO: is this needed? //mysql_library_end(); } + +const char *DBI_MySQL::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *DBI_MySQL::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + diff --git a/extensions/mysql/extension.h b/extensions/mysql/extension.h index 489c5f68..e9a3feea 100644 --- a/extensions/mysql/extension.h +++ b/extensions/mysql/extension.h @@ -81,6 +81,8 @@ public: * @return True if working, false otherwise. */ //virtual bool QueryRunning(char *error, size_t maxlength); + const char *GetVersion(); + const char *GetDate(); public: #if defined SMEXT_CONF_METAMOD /** diff --git a/extensions/mysql/sdk/smsdk_config.h b/extensions/mysql/sdk/smsdk_config.h index 48ac2c2a..047ec0b9 100644 --- a/extensions/mysql/sdk/smsdk_config.h +++ b/extensions/mysql/sdk/smsdk_config.h @@ -37,17 +37,15 @@ * @brief Contains macros for configuring basic extension information. */ -#include "svn_version.h" - /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "MySQL-DBI" #define SMEXT_CONF_DESCRIPTION "MySQL driver implementation for DBI" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "MYSQL" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/mysql/svn_version.h b/extensions/mysql/svn_version.h deleted file mode 100644 index 53b0999b..00000000 --- a/extensions/mysql/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod MySQL Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_MYSQLEXT_VERSION_H_ -#define _INCLUDE_MYSQLEXT_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_MYSQLEXT_VERSION_H_ diff --git a/extensions/mysql/svn_version.tpl b/extensions/mysql/svn_version.tpl deleted file mode 100644 index 4badc53e..00000000 --- a/extensions/mysql/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod MySQL Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_MYSQLEXT_VERSION_H_ -#define _INCLUDE_MYSQLEXT_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_MYSQLEXT_VERSION_H_ diff --git a/extensions/mysql/version.rc b/extensions/mysql/version.rc index c50198d4..382e98c6 100644 --- a/extensions/mysql/version.rc +++ b/extensions/mysql/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "MySQL Extension" VALUE "FileDescription", "SourceMod MySQL Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod MySQL Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod MySQL Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/regex/AMBuilder b/extensions/regex/AMBuilder new file mode 100644 index 00000000..4e4db7ce --- /dev/null +++ b/extensions/regex/AMBuilder @@ -0,0 +1,25 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +compiler = SM.DefaultExtCompiler('extensions/regex') +compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook')) + +extension = AMBuild.AddJob('regex.ext') +binary = Cpp.LibraryBuilder('regex.ext', AMBuild, extension, compiler) + +if AMBuild.target['platform'] == 'linux': + path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_linux', 'libpcre.a') +elif AMBuild.target['platform'] == 'windows': + path = os.path.join(AMBuild.sourceFolder, 'extensions', 'regex', 'lib_win', 'pcre.lib') + +binary.RelinkIfNewer(path) +binary['POSTLINKFLAGS'].append(path) + +binary.AddSourceFiles('extensions/regex', [ + 'extension.cpp', + 'CRegEx.cpp', + 'sdk/smsdk_ext.cpp', + ]) +SM.AutoVersion('extensions/regex', binary) +binary.SendToJob() + diff --git a/extensions/regex/extension.cpp b/extensions/regex/extension.cpp index ee7d173a..53c9153e 100644 --- a/extensions/regex/extension.cpp +++ b/extensions/regex/extension.cpp @@ -29,8 +29,8 @@ * Version: $Id$ */ +#include #include "extension.h" - #include #include "pcre.h" #include "CRegEx.h" @@ -63,6 +63,16 @@ void RegexExtension::SDK_OnUnload() } +const char *RegexExtension::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *RegexExtension::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + static cell_t CompileRegex(IPluginContext *pCtx, const cell_t *params) { char *regex; diff --git a/extensions/regex/extension.h b/extensions/regex/extension.h index 681dade1..d90498e5 100644 --- a/extensions/regex/extension.h +++ b/extensions/regex/extension.h @@ -62,6 +62,9 @@ public: */ virtual void SDK_OnUnload(); + const char *GetVersion(); + const char *GetDate(); + /** * @brief This is called once all known extensions have been loaded. * Note: It is is a good idea to add natives here, if any are provided. diff --git a/extensions/regex/sdk/smsdk_config.h b/extensions/regex/sdk/smsdk_config.h index 719ed0c7..b7fc3df1 100644 --- a/extensions/regex/sdk/smsdk_config.h +++ b/extensions/regex/sdk/smsdk_config.h @@ -32,8 +32,6 @@ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ -#include "svn_version.h" - /** * @file smsdk_config.h * @brief Contains macros for configuring basic extension information. @@ -42,12 +40,12 @@ /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "Regex" #define SMEXT_CONF_DESCRIPTION "Provides regex natives for plugins" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "REGEX" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/regex/svn_version.h b/extensions/regex/svn_version.h deleted file mode 100644 index 56a22210..00000000 --- a/extensions/regex/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod Regular Expressions Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_REGEXEXT_VERSION_H_ -#define _INCLUDE_REGEXEXT_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_REGEXEXT_VERSION_H_ diff --git a/extensions/regex/svn_version.tpl b/extensions/regex/svn_version.tpl deleted file mode 100644 index 727d54ce..00000000 --- a/extensions/regex/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod Regular Expressions Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_REGEXEXT_VERSION_H_ -#define _INCLUDE_REGEXEXT_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_REGEXEXT_VERSION_H_ diff --git a/extensions/regex/version.rc b/extensions/regex/version.rc index 3f9ad39c..f072babb 100644 --- a/extensions/regex/version.rc +++ b/extensions/regex/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "SourceMod Regular Expression Extension" VALUE "FileDescription", "SourceMod Regular Expression Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod Regular Expression Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod Regular Expression Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/sdktools/AMBuilder b/extensions/sdktools/AMBuilder new file mode 100644 index 00000000..bd4d8556 --- /dev/null +++ b/extensions/sdktools/AMBuilder @@ -0,0 +1,40 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +for i in SM.sdkInfo: + compiler = SM.DefaultHL2Compiler('extensions/sdktools', i) + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit')) + compiler['CXXINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'jit', 'x86')) + + if i != 'ep1': + compiler['CDEFINES'].append('HOOKING_ENABLED') + + sdk = SM.sdkInfo[i] + name = 'sdktools.ext.' + sdk['ext'] + extension = AMBuild.AddJob(name) + binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler) + SM.PreSetupHL2Job(extension, binary, i) + binary.AddSourceFiles('extensions/sdktools', [ + 'extension.cpp', + 'inputnatives.cpp', + 'output.cpp', + 'outputnatives.cpp', + 'tempents.cpp', + 'tenatives.cpp', + 'teamnatives.cpp', + 'trnatives.cpp', + 'vcaller.cpp', + 'vcallbuilder.cpp', + 'vdecoder.cpp', + 'vglobals.cpp', + 'vhelpers.cpp', + 'vnatives.cpp', + 'voice.cpp', + 'vsound.cpp', + 'vstringtable.cpp', + 'sdk/smsdk_ext.cpp' + ]) + SM.PostSetupHL2Job(extension, binary, i) + SM.AutoVersion('extensions/sdktools', binary) + binary.SendToJob() + diff --git a/extensions/sdktools/extension.cpp b/extensions/sdktools/extension.cpp index 0cc78a1f..3ce0152b 100644 --- a/extensions/sdktools/extension.cpp +++ b/extensions/sdktools/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" #include #include "vcallbuilder.h" @@ -379,6 +380,16 @@ bool SDKTools::ProcessCommandTarget(cmd_target_info_t *info) return true; } +const char *SDKTools::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *SDKTools::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + class SDKTools_API : public ISDKTools { public: diff --git a/extensions/sdktools/extension.h b/extensions/sdktools/extension.h index 7e64aae4..df51272b 100644 --- a/extensions/sdktools/extension.h +++ b/extensions/sdktools/extension.h @@ -73,6 +73,8 @@ public: //public SDKExtension virtual bool QueryInterfaceDrop(SMInterface *pInterface); virtual void NotifyInterfaceDrop(SMInterface *pInterface); virtual void OnCoreMapStart(edict_t *pEdictList, int edictCount, int clientMax); + const char *GetVersion(); + const char *GetDate(); public: #if defined SMEXT_CONF_METAMOD virtual bool SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late); diff --git a/extensions/sdktools/sdk/smsdk_config.h b/extensions/sdktools/sdk/smsdk_config.h index c4b14539..837f4fce 100644 --- a/extensions/sdktools/sdk/smsdk_config.h +++ b/extensions/sdktools/sdk/smsdk_config.h @@ -37,17 +37,15 @@ * @brief Contains macros for configuring basic extension information. */ -#include "svn_version.h" - /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "SDK Tools" #define SMEXT_CONF_DESCRIPTION "Source SDK Tools" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "SDKTOOLS" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/sdktools/svn_version.h b/extensions/sdktools/svn_version.h deleted file mode 100644 index 2a8eff42..00000000 --- a/extensions/sdktools/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod SDKTools Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SDKTOOLS_VERSION_H_ -#define _INCLUDE_SDKTOOLS_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_SDKTOOLS_VERSION_H_ diff --git a/extensions/sdktools/svn_version.tpl b/extensions/sdktools/svn_version.tpl deleted file mode 100644 index e197ac1c..00000000 --- a/extensions/sdktools/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod SDKTools Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SDKTOOLS_VERSION_H_ -#define _INCLUDE_SDKTOOLS_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_SDKTOOLS_VERSION_H_ diff --git a/extensions/sdktools/vcallbuilder.cpp b/extensions/sdktools/vcallbuilder.cpp index b6eca41d..33a5932e 100644 --- a/extensions/sdktools/vcallbuilder.cpp +++ b/extensions/sdktools/vcallbuilder.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "vcallbuilder.h" #include "extension.h" diff --git a/extensions/sdktools/version.rc b/extensions/sdktools/version.rc index ffd0c54d..fb6a62a3 100644 --- a/extensions/sdktools/version.rc +++ b/extensions/sdktools/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "SDKTools Extension" VALUE "FileDescription", "SourceMod SDKTools Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod SDKTools Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod SDKTools Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/sqlite/AMBuilder b/extensions/sqlite/AMBuilder new file mode 100644 index 00000000..883a54cb --- /dev/null +++ b/extensions/sqlite/AMBuilder @@ -0,0 +1,40 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +compiler = SM.DefaultExtCompiler('extensions/sqlite') +compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook')) + +compiler['CDEFINES'].extend(['SQLITE_OMIT_LOAD_EXTENSION', 'SQLITE_THREADSAFE']) +if AMBuild.target['platform'] == 'linux': + compiler['POSTLINKFLAGS'].extend(['-ldl', '-lpthread']) + +extension = AMBuild.AddJob('dbi.sqlite.ext') +binary = Cpp.LibraryBuilder('dbi.sqlite.ext', AMBuild, extension, compiler) +files = [ + 'sdk/smsdk_ext.cpp', 'sdk/sm_memtable.cpp', 'extension.cpp', + 'driver/SqDatabase.cpp', 'driver/SqDriver.cpp', 'driver/SqQuery.cpp', + 'driver/SqResults.cpp', 'sqlite-source/alter.c', 'sqlite-source/analyze.c', + 'sqlite-source/attach.c', 'sqlite-source/auth.c', 'sqlite-source/btree.c', + 'sqlite-source/build.c', 'sqlite-source/callback.c', 'sqlite-source/complete.c', + 'sqlite-source/date.c', 'sqlite-source/delete.c', 'sqlite-source/expr.c', + 'sqlite-source/func.c', 'sqlite-source/hash.c', 'sqlite-source/insert.c', + 'sqlite-source/legacy.c', 'sqlite-source/main.c', 'sqlite-source/malloc.c', + 'sqlite-source/opcodes.c', 'sqlite-source/os.c', + 'sqlite-source/pager.c', 'sqlite-source/parse.c', 'sqlite-source/pragma.c', + 'sqlite-source/prepare.c', 'sqlite-source/printf.c', 'sqlite-source/random.c', + 'sqlite-source/select.c', 'sqlite-source/table.c', 'sqlite-source/tokenize.c', + 'sqlite-source/trigger.c', 'sqlite-source/update.c', 'sqlite-source/utf.c', + 'sqlite-source/util.c', 'sqlite-source/vacuum.c', 'sqlite-source/vdbe.c', + 'sqlite-source/vdbeapi.c', 'sqlite-source/vdbeaux.c', 'sqlite-source/vdbeblob.c', + 'sqlite-source/vdbefifo.c', 'sqlite-source/vdbemem.c', 'sqlite-source/vtab.c', + 'sqlite-source/where.c', 'sqlite-source/btmutex.c', 'sqlite-source/journal.c', + 'sqlite-source/mem1.c', 'sqlite-source/mem2.c', 'sqlite-source/mutex.c' + ] +if AMBuild.target['platform'] == 'windows': + files.extend(['sqlite-source/mutex_w32.c', 'sqlite-source/os_win.c']) +elif AMBuild.target['platform'] == 'linux': + files.extend(['sqlite-source/mutex_unix.c', 'sqlite-source/os_unix.c']) +binary.AddSourceFiles('extensions/sqlite', files) +SM.AutoVersion('extensions/sqlite', binary) +binary.SendToJob() + diff --git a/extensions/sqlite/extension.cpp b/extensions/sqlite/extension.cpp index 960f86bf..829dc278 100644 --- a/extensions/sqlite/extension.cpp +++ b/extensions/sqlite/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" #include "driver/SqDriver.h" @@ -70,3 +71,14 @@ size_t UTIL_Format(char *buffer, size_t maxlength, const char *fmt, ...) return len; } } + +const char *SqliteExt::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *SqliteExt::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + diff --git a/extensions/sqlite/extension.h b/extensions/sqlite/extension.h index c6f89db9..033060b6 100644 --- a/extensions/sqlite/extension.h +++ b/extensions/sqlite/extension.h @@ -62,6 +62,9 @@ public: */ virtual void SDK_OnUnload(); + const char *GetVersion(); + const char *GetDate(); + /** * @brief This is called once all known extensions have been loaded. * Note: It is is a good idea to add natives here, if any are provided. diff --git a/extensions/sqlite/sdk/smsdk_config.h b/extensions/sqlite/sdk/smsdk_config.h index 8911183b..2f6cb852 100644 --- a/extensions/sqlite/sdk/smsdk_config.h +++ b/extensions/sqlite/sdk/smsdk_config.h @@ -32,8 +32,6 @@ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ -#include "svn_version.h" - /** * @file smsdk_config.h * @brief Contains macros for configuring basic extension information. @@ -42,12 +40,12 @@ /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "SQLite" #define SMEXT_CONF_DESCRIPTION "SQLite Driver" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "SQLITE" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/sqlite/svn_version.h b/extensions/sqlite/svn_version.h deleted file mode 100644 index b6a02538..00000000 --- a/extensions/sqlite/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod SQLite Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SQLITEEXT_VERSION_H_ -#define _INCLUDE_SQLITEEXT_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_SQLITEEXT_VERSION_H_ diff --git a/extensions/sqlite/svn_version.tpl b/extensions/sqlite/svn_version.tpl deleted file mode 100644 index 566c386c..00000000 --- a/extensions/sqlite/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod SQLite Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SQLITEEXT_VERSION_H_ -#define _INCLUDE_SQLITEEXT_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_SQLITEEXT_VERSION_H_ diff --git a/extensions/sqlite/version.rc b/extensions/sqlite/version.rc index 4d39e024..7c93cd4c 100644 --- a/extensions/sqlite/version.rc +++ b/extensions/sqlite/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "SQLite Extension" VALUE "FileDescription", "SourceMod SQLite Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod SQLite Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod SQLite Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/tf2/AMBuilder b/extensions/tf2/AMBuilder new file mode 100644 index 00000000..f1006018 --- /dev/null +++ b/extensions/tf2/AMBuilder @@ -0,0 +1,24 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +sdk = SM.sdkInfo['ep2v'] +compiler = SM.DefaultHL2Compiler('extensions/tf2', 'ep2v') + +name = 'game.tf2.ext.' + sdk['ext'] +extension = AMBuild.AddJob(name) +binary = Cpp.LibraryBuilder(name, AMBuild, extension, compiler) +SM.PreSetupHL2Job(extension, binary, 'ep2v') +binary.AddSourceFiles('extensions/tf2', [ + 'extension.cpp', + 'natives.cpp', + 'RegNatives.cpp', + 'util.cpp', + 'criticals.cpp', + 'CDetour/detours.cpp', + 'sdk/smsdk_ext.cpp', + 'asm/asm.c' + ]) +SM.PostSetupHL2Job(extension, binary, 'ep2v') +SM.AutoVersion('extensions/tf2', binary) +binary.SendToJob() + diff --git a/extensions/tf2/extension.cpp b/extensions/tf2/extension.cpp index a7a5f09f..bf644d35 100644 --- a/extensions/tf2/extension.cpp +++ b/extensions/tf2/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" #include "util.h" #include "RegNatives.h" @@ -115,6 +116,16 @@ bool TF2Tools::SDK_OnLoad(char *error, size_t maxlength, bool late) return true; } +const char *TF2Tools::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *TF2Tools::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + bool TF2Tools::SDK_OnMetamodLoad(ISmmAPI *ismm, char *error, size_t maxlen, bool late) { GET_V_IFACE_CURRENT(GetEngineFactory, engine, IVEngineServer, INTERFACEVERSION_VENGINESERVER); diff --git a/extensions/tf2/extension.h b/extensions/tf2/extension.h index ac94d966..5fcf6cfe 100644 --- a/extensions/tf2/extension.h +++ b/extensions/tf2/extension.h @@ -86,6 +86,9 @@ public: //SDKExtension void NotifyInterfaceDrop(SMInterface *pInterface); bool QueryInterfaceDrop(SMInterface *pInterface); + + const char *GetVersion(); + const char *GetDate(); public: //ICommandTargetProcessor bool ProcessCommandTarget(cmd_target_info_t *info); public: //IConCommandBaseAccessor diff --git a/extensions/tf2/sdk/smsdk_config.h b/extensions/tf2/sdk/smsdk_config.h index fe342bd2..971372bc 100644 --- a/extensions/tf2/sdk/smsdk_config.h +++ b/extensions/tf2/sdk/smsdk_config.h @@ -37,17 +37,15 @@ * @brief Contains macros for configuring basic extension information. */ -#include "svn_version.h" - /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "TF2 Tools" #define SMEXT_CONF_DESCRIPTION "TF2 extended functionality" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "TF2" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/tf2/svn_version.h b/extensions/tf2/svn_version.h deleted file mode 100644 index 2712962d..00000000 --- a/extensions/tf2/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod Team Fortress 2 Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SDKTOOLS_VERSION_H_ -#define _INCLUDE_SDKTOOLS_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_SDKTOOLS_VERSION_H_ diff --git a/extensions/tf2/svn_version.tpl b/extensions/tf2/svn_version.tpl deleted file mode 100644 index bf0be39f..00000000 --- a/extensions/tf2/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod Team Fortress 2 Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SDKTOOLS_VERSION_H_ -#define _INCLUDE_SDKTOOLS_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_SDKTOOLS_VERSION_H_ diff --git a/extensions/tf2/version.rc b/extensions/tf2/version.rc index ba3aeace..9dcf930a 100644 --- a/extensions/tf2/version.rc +++ b/extensions/tf2/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "SourceMod TF2 Extension" VALUE "FileDescription", "SourceMod TF2 Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod TF2 Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod TF2 Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/topmenus/AMBuilder b/extensions/topmenus/AMBuilder new file mode 100644 index 00000000..ce393598 --- /dev/null +++ b/extensions/topmenus/AMBuilder @@ -0,0 +1,19 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +compiler = SM.DefaultExtCompiler('extensions/topmenus') +compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook')) + +extension = AMBuild.AddJob('topmenus.ext') +binary = Cpp.LibraryBuilder('topmenus.ext', AMBuild, extension, compiler) +binary.AddSourceFiles('extensions/topmenus', [ + 'extension.cpp', + 'smn_topmenus.cpp', + 'TopMenu.cpp', + 'TopMenuManager.cpp', + 'sdk/smsdk_ext.cpp', + 'sdk/sm_memtable.cpp' + ]) +SM.AutoVersion('extensions/topmenus', binary) +binary.SendToJob() + diff --git a/extensions/topmenus/extension.cpp b/extensions/topmenus/extension.cpp index eb2e7579..784866c5 100644 --- a/extensions/topmenus/extension.cpp +++ b/extensions/topmenus/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include "extension.h" #include "TopMenuManager.h" #include "smn_topmenus.h" @@ -64,3 +65,13 @@ void TopMenuExtension::SDK_OnUnload() plsys->RemovePluginsListener(&g_TopMenus); } +const char *TopMenuExtension::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *TopMenuExtension::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + diff --git a/extensions/topmenus/extension.h b/extensions/topmenus/extension.h index f5d94769..f0ccea9e 100644 --- a/extensions/topmenus/extension.h +++ b/extensions/topmenus/extension.h @@ -61,6 +61,9 @@ public: * @brief This is called right before the extension is unloaded. */ virtual void SDK_OnUnload(); + + const char *GetVersion(); + const char *GetDate(); }; #endif // _INCLUDE_SOURCEMOD_EXTENSION_PROPER_H_ diff --git a/extensions/topmenus/sdk/smsdk_config.h b/extensions/topmenus/sdk/smsdk_config.h index c119c5a7..140733b2 100644 --- a/extensions/topmenus/sdk/smsdk_config.h +++ b/extensions/topmenus/sdk/smsdk_config.h @@ -37,17 +37,15 @@ * @brief Contains macros for configuring basic extension information. */ -#include "svn_version.h" - /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "Top Menus" #define SMEXT_CONF_DESCRIPTION "Creates sorted nested menus" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "TOPMENUS" #define SMEXT_CONF_LICENSE "GPLv3" -#define SMEXT_CONF_DATESTRING __DATE__ " " __TIME__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/topmenus/svn_version.h b/extensions/topmenus/svn_version.h deleted file mode 100644 index 08fea949..00000000 --- a/extensions/topmenus/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod TopMenus Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SQLITEEXT_VERSION_H_ -#define _INCLUDE_SQLITEEXT_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_SQLITEEXT_VERSION_H_ diff --git a/extensions/topmenus/svn_version.tpl b/extensions/topmenus/svn_version.tpl deleted file mode 100644 index 9405f327..00000000 --- a/extensions/topmenus/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod TopMenus Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SQLITEEXT_VERSION_H_ -#define _INCLUDE_SQLITEEXT_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_SQLITEEXT_VERSION_H_ diff --git a/extensions/topmenus/version.rc b/extensions/topmenus/version.rc index be0703e8..f86f2721 100644 --- a/extensions/topmenus/version.rc +++ b/extensions/topmenus/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "TopMenus Extension" VALUE "FileDescription", "SourceMod TopMenus Extension" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "SourceMod TopMenus Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod TopMenus Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/extensions/updater/AMBuilder b/extensions/updater/AMBuilder new file mode 100644 index 00000000..3e1f9711 --- /dev/null +++ b/extensions/updater/AMBuilder @@ -0,0 +1,18 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +compiler = SM.DefaultExtCompiler('extensions/updater') +compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook')) + +extension = AMBuild.AddJob('updater.ext') +binary = Cpp.LibraryBuilder('updater.ext', AMBuild, extension, compiler) +binary.AddSourceFiles('extensions/updater', [ + 'extension.cpp', + 'MemoryDownloader.cpp', + 'Updater.cpp', + 'md5.cpp', + 'sdk/smsdk_ext.cpp' + ]) +SM.AutoVersion('extensions/updater', binary) +binary.SendToJob() + diff --git a/extensions/updater/Updater.cpp b/extensions/updater/Updater.cpp index 54572301..8fbae98e 100644 --- a/extensions/updater/Updater.cpp +++ b/extensions/updater/Updater.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include #include "extension.h" #include "Updater.h" @@ -355,7 +356,7 @@ void UpdateReader::PerformUpdate(const char *url) xfer = webternet->CreateSession(); xfer->SetFailOnHTTPError(true); - form->AddString("version", SVN_FULL_VERSION); + form->AddString("version", SM_FULL_VERSION); form->AddString("build", SM_BUILD_UNIQUEID); unsigned int num_files = 0; @@ -401,3 +402,4 @@ UpdatePart *UpdateReader::DetachParts() return first; } + diff --git a/extensions/updater/extension.cpp b/extensions/updater/extension.cpp index f58339e8..f9258c44 100644 --- a/extensions/updater/extension.cpp +++ b/extensions/updater/extension.cpp @@ -29,6 +29,7 @@ * Version: $Id$ */ +#include #include #include #include @@ -245,3 +246,14 @@ void AddUpdateError(const char *fmt, ...) update_errors.push_back(new String(buffer)); } + +const char *SmUpdater::GetVersion() +{ + return SM_FULL_VERSION; +} + +const char *SmUpdater::GetDate() +{ + return SM_BUILD_TIMESTAMP; +} + diff --git a/extensions/updater/extension.h b/extensions/updater/extension.h index 3029c994..fb772a5b 100644 --- a/extensions/updater/extension.h +++ b/extensions/updater/extension.h @@ -54,6 +54,8 @@ public: /* SDKExtension */ public: /* IExtension */ bool QueryInterfaceDrop(SMInterface *pInterface); void NotifyInterfaceDrop(SMInterface *pInterface); + const char *GetVersion(); + const char *GetDate(); public: /* IThread */ void RunThread(IThreadHandle *pHandle); void OnTerminate(IThreadHandle *pHandle, bool cancel); diff --git a/extensions/updater/sdk/smsdk_config.h b/extensions/updater/sdk/smsdk_config.h index fda8eb95..900a70f4 100644 --- a/extensions/updater/sdk/smsdk_config.h +++ b/extensions/updater/sdk/smsdk_config.h @@ -31,7 +31,6 @@ #ifndef _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ #define _INCLUDE_SOURCEMOD_EXTENSION_CONFIG_H_ -#include "svn_version.h" /** * @file smsdk_config.h @@ -41,12 +40,12 @@ /* Basic information exposed publicly */ #define SMEXT_CONF_NAME "Automatic Updater" #define SMEXT_CONF_DESCRIPTION "Updates SourceMod gamedata files" -#define SMEXT_CONF_VERSION SVN_FULL_VERSION +#define SMEXT_CONF_VERSION "" #define SMEXT_CONF_AUTHOR "AlliedModders LLC" #define SMEXT_CONF_URL "http://www.sourcemod.net/" #define SMEXT_CONF_LOGTAG "UPDATER" #define SMEXT_CONF_LICENSE "GPL" -#define SMEXT_CONF_DATESTRING __DATE__ +#define SMEXT_CONF_DATESTRING "" /** * @brief Exposes plugin's main interface. diff --git a/extensions/updater/svn_version.h b/extensions/updater/svn_version.h deleted file mode 100644 index b11848f5..00000000 --- a/extensions/updater/svn_version.h +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod GeoIP Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_UPDATER_VERSION_H_ -#define _INCLUDE_UPDATER_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_UPDATER_VERSION_H_ diff --git a/extensions/updater/svn_version.tpl b/extensions/updater/svn_version.tpl deleted file mode 100644 index b7c5b638..00000000 --- a/extensions/updater/svn_version.tpl +++ /dev/null @@ -1,44 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod GeoIP Extension - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_UPDATER_VERSION_H_ -#define _INCLUDE_UPDATER_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_UPDATER_VERSION_H_ diff --git a/extensions/updater/version.rc b/extensions/updater/version.rc index 4cff2cfb..2f1fba61 100644 --- a/extensions/updater/version.rc +++ b/extensions/updater/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "Automatic Updater" VALUE "FileDescription", "SourceMod Automatic Updater" - VALUE "FileVersion", SVN_FILE_VERSION + VALUE "FileVersion", SM_FILE_VERSION VALUE "InternalName", "SourceMod Updater Extension" VALUE "LegalCopyright", "Copyright (c) 2004-2009, AlliedModders LLC" VALUE "OriginalFilename", BINARY_NAME VALUE "ProductName", "SourceMod Updater Extension" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/loader/AMBuilder b/loader/AMBuilder new file mode 100644 index 00000000..ddad32fc --- /dev/null +++ b/loader/AMBuilder @@ -0,0 +1,21 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os.path + +compiler = SM.DefaultCompiler() +compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core')) +compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook')) + +if AMBuild.target['platform'] == 'windows': + name = 'sourcemod_mm' +elif AMBuild.target['platform'] == 'linux': + name = 'sourcemod_mm_i486' + compiler['POSTLINKFLAGS'].extend(['-ldl']) + +loader = AMBuild.AddJob('loader') +binary = Cpp.LibraryBuilder(name, AMBuild, loader, compiler) +binary.AddSourceFiles('loader', [ + 'loader.cpp' + ]) +SM.AutoVersion('loader', binary) +binary.SendToJob() + diff --git a/loader/svn_version.h b/loader/svn_version.h deleted file mode 100644 index 47f853da..00000000 --- a/loader/svn_version.h +++ /dev/null @@ -1,48 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SOURCEMOD_VERSION_H_ -#define _INCLUDE_SOURCEMOD_VERSION_H_ - -/** - * @file Contains SourceMod version information. - */ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/loader/svn_version.tpl b/loader/svn_version.tpl deleted file mode 100644 index 6b28661a..00000000 --- a/loader/svn_version.tpl +++ /dev/null @@ -1,48 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SOURCEMOD_VERSION_H_ -#define _INCLUDE_SOURCEMOD_VERSION_H_ - -/** - * @file Contains SourceMod version information. - */ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/loader/version.rc b/loader/version.rc index ebd54169..f21a42a1 100644 --- a/loader/version.rc +++ b/loader/version.rc @@ -9,7 +9,7 @@ // #include "winres.h" -#include "svn_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -29,8 +29,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -47,12 +47,12 @@ BEGIN BEGIN VALUE "Comments", "SourceMod Loader" VALUE "FileDescription", "SourceMod Loader" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "sourcemod" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", "sourcemod_mm.dll" VALUE "ProductName", "SourceMod Loader" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/plugins/AMBuilder b/plugins/AMBuilder new file mode 100644 index 00000000..6763f4c1 --- /dev/null +++ b/plugins/AMBuilder @@ -0,0 +1,50 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os +import os.path +import ambuild.osutil as osutil +import ambuild.command as command + +files = [ + 'adminhelp.sp', + 'antiflood.sp', + 'basecomm.sp', + 'clientprefs.sp', + 'nextmap.sp', + 'reservedslots.sp', + 'adminmenu.sp', + 'basebans.sp', + 'basetriggers.sp', + 'funcommands.sp', + 'nominations.sp', + 'rockthevote.sp', + 'admin-sql-prefetch.sp', + 'basechat.sp', + 'basevotes.sp', + 'funvotes.sp', + 'playercommands.sp', + 'sounds.sp', + 'admin-sql-threaded.sp', + 'basecommands.sp', + 'mapchooser.sp', + 'randomcycle.sp', + 'sql-admin-manager.sp' + ] + +plugins = AMBuild.AddJob('plugins') + +spcomp = os.path.join(AMBuild.outputFolder, 'spcomp', 'spcomp') +includes = os.path.relpath(os.path.join(AMBuild.sourceFolder, 'plugins', 'include'), + os.path.join(AMBuild.outputFolder, 'plugins')) + +#This one has to be special +sp = os.path.join(AMBuild.sourceFolder, 'plugins', 'admin-flatfile', 'admin-flatfile.sp') +args = [spcomp, '-i' + includes, sp] +plugins.AddCommand(command.DirectCommand(args)) + +#Do the normal ones +for file in files: + sp = os.path.join(AMBuild.sourceFolder, 'plugins', file) + args = [spcomp, '-i' + includes, sp] + plugins.AddCommand(command.DirectCommand(args)) + + diff --git a/plugins/include/version.tpl b/plugins/include/version.tpl deleted file mode 100644 index a09b9866..00000000 --- a/plugins/include/version.tpl +++ /dev/null @@ -1,42 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This file is part of the SourceMod/SourcePawn SDK. - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -#if defined _version_included - #endinput -#endif -#define _version_included - -#define SOURCEMOD_V_MAJOR $PMAJOR$ /**< SourceMod Major version */ -#define SOURCEMOD_V_MINOR $PMINOR$ /**< SourceMod Minor version */ -#define SOURCEMOD_V_RELEASE $PREVISION$ /**< SourceMod Release version */ - -#define SOURCEMOD_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$$BUILD_STRING$" /**< SourceMod version string (major.minor.release.build) */ diff --git a/product.version b/product.version index e8ea05db..3ef5fad4 100644 --- a/product.version +++ b/product.version @@ -1 +1 @@ -1.2.4 +1.2.4-dev diff --git a/core/sm_version.h b/public/sourcemod_version.h similarity index 71% rename from core/sm_version.h rename to public/sourcemod_version.h index 47f853da..1180c2af 100644 --- a/core/sm_version.h +++ b/public/sourcemod_version.h @@ -29,20 +29,24 @@ * Version: $Id$ */ -/** - * Autogenerated by build scripts - */ - -#ifndef _INCLUDE_SOURCEMOD_VERSION_H_ -#define _INCLUDE_SOURCEMOD_VERSION_H_ +#ifndef _INCLUDE_SOURCEMOD_VERSION_INFORMATION_H_ +#define _INCLUDE_SOURCEMOD_VERSION_INFORMATION_H_ /** * @file Contains SourceMod version information. + * @brief This file will redirect to an autogenerated version if being compiled via + * the build scripts. */ -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 +#if defined SM_GENERATED_BUILD +#include +#else +#define SM_BUILD_STRING "-pdev" +#define SM_BUILD_UNIQUEID "2650:5d34bc3edbfa" SM_BUILD_STRING +#define SM_FULL_VERSION "1.2.3" SM_BUILD_STRING +#define SM_FILE_VERSION 1,2,3,0 +#endif +#define SM_BUILD_TIMESTAMP __DATE__ " " __TIME__ + +#endif /* _INCLUDE_SOURCEMOD_VERSION_INFORMATION_H_ */ -#endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/sourcepawn/compiler/AMBuilder b/sourcepawn/compiler/AMBuilder new file mode 100644 index 00000000..5d25562e --- /dev/null +++ b/sourcepawn/compiler/AMBuilder @@ -0,0 +1,63 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +compiler = SM.DefaultCompiler() +compiler['CINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public')) +compiler['CINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'public', 'sourcepawn')) +compiler['CINCLUDES'].append(os.path.join(AMBuild.sourceFolder, 'sourcepawn', 'compiler')) + +if compiler.cc.name == 'gcc': + compiler['CFLAGS'].extend(['-Wno-parentheses', '-Wno-format']) + compiler['POSTLINKFLAGS'].extend(['-lgcc', '-lm']) +elif compiler.cc.name == 'msvc': + compiler['POSTLINKFLAGS'].remove('/SUBSYSTEM:WINDOWS') + compiler['POSTLINKFLAGS'].append('/SUBSYSTEM:CONSOLE') + +if AMBuild.target['platform'] == 'linux': + compiler['CDEFINES'].extend(['LINUX', 'HAVE_STDINT_H', 'AMX_ANSIONLY', 'ENABLE_BINRELOC']) + +extension = AMBuild.AddJob('spcomp') +binary = Cpp.ExecutableBuilder('spcomp', AMBuild, extension, compiler) +files = [ + 'libpawnc.c', + 'lstring.c', + 'memfile.c', + 'pawncc.c', + 'sc1.c', + 'sc2.c', + 'sc3.c', + 'sc4.c', + 'sc5.c', + 'sc6.c', + 'sc7.c', + 'scexpand.c', + 'sci18n.c', + 'sclist.c', + 'scmemfil.c', + 'scstate.c', + 'sctracker.c', + 'scvars.c', + 'sp_file.c', + 'zlib/adler32.c', + 'zlib/compress.c', + 'zlib/crc32.c', + 'zlib/deflate.c', + 'zlib/gzio.c', + 'zlib/infback.c', + 'zlib/inffast.c', + 'zlib/inflate.c', + 'zlib/inftrees.c', + 'zlib/trees.c', + 'zlib/uncompr.c', + 'zlib/zutil.c' + ] +if AMBuild.target['platform'] == 'linux': + files.append('binreloc.c') +binary.AddSourceFiles('sourcepawn/compiler', files) + +if AMBuild.target['platform'] == 'windows': + env = {'RCDEFINES': ['BINARY_NAME="' + binary.binaryFile + '"']} + binary.AddResourceFile('sourcepawn/compiler/libpawnc.rc', env) + +binary.SendToJob() + diff --git a/sourcepawn/compiler/libpawnc.rc b/sourcepawn/compiler/libpawnc.rc index f84f9c93..e47c3306 100644 --- a/sourcepawn/compiler/libpawnc.rc +++ b/sourcepawn/compiler/libpawnc.rc @@ -4,7 +4,7 @@ #else # include #endif -#include "svn_version.h" +#include AppIcon ICON "pawn.ico" @@ -19,8 +19,8 @@ AppIcon ICON "pawn.ico" #define VERSIONPRODUCTNAME "smcomp\0" VS_VERSION_INFO VERSIONINFO -FILEVERSION SVN_FILE_VERSION -PRODUCTVERSION SVN_FILE_VERSION +FILEVERSION SM_FILE_VERSION +PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x0000003FL FILEFLAGS 0 #if defined(WIN32) @@ -36,12 +36,12 @@ BEGIN BEGIN VALUE "CompanyName", "(C)1998-2006 ITB CompuPhase, AlliedModders LLC\0" VALUE "FileDescription", VERSIONDESCRIPTION - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", VERSIONNAME VALUE "LegalCopyright", "(C)1998-2006 ITB CompuPhase, AlliedModders LLC\0" VALUE "OriginalFilename", VERSIONNAME VALUE "ProductName", VERSIONPRODUCTNAME - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END diff --git a/sourcepawn/compiler/pawncc.c b/sourcepawn/compiler/pawncc.c index 5701ca49..8d591a26 100644 --- a/sourcepawn/compiler/pawncc.c +++ b/sourcepawn/compiler/pawncc.c @@ -8,6 +8,11 @@ #include "amxdbg.h" #include "osdefs.h" #include "zlib/zlib.h" +#if defined LINUX +#include +#elif defined WIN32 +#include +#endif enum FileSections { diff --git a/sourcepawn/compiler/sc1.c b/sourcepawn/compiler/sc1.c index 1a99d06c..a92688b2 100644 --- a/sourcepawn/compiler/sc1.c +++ b/sourcepawn/compiler/sc1.c @@ -38,6 +38,7 @@ #if defined LINUX || defined __FreeBSD__ || defined __OpenBSD__ #include #include /* from BinReloc, see www.autopackage.org */ + #include #endif #if defined FORTIFY @@ -65,7 +66,7 @@ #include "lstring.h" #include "sc.h" -#include "svn_version.h" +#include #include "sctracker.h" #define VERSION_STR "3.2.3636" #define VERSION_INT 0x0302 @@ -172,7 +173,7 @@ static int *wqptr; /* pointer to next entry */ static HWND hwndFinish = 0; #endif -SC_VDECL int glbstringread = 0; +int glbstringread = 0; char g_tmpfile[_MAX_PATH] = {0}; /* "main" of the compiler @@ -1226,7 +1227,7 @@ static void setconfig(char *root) static void setcaption(void) { - pc_printf("SourcePawn Compiler " SVN_FULL_VERSION "\n"); + pc_printf("SourcePawn Compiler " SM_FULL_VERSION "\n"); pc_printf("Copyright (c) 1997-2006, ITB CompuPhase, (C)2004-2008 AlliedModders, LLC\n\n"); } diff --git a/sourcepawn/compiler/sc2.c b/sourcepawn/compiler/sc2.c index cb9a90ba..21bcccd3 100644 --- a/sourcepawn/compiler/sc2.c +++ b/sourcepawn/compiler/sc2.c @@ -58,6 +58,13 @@ static short skiplevel; /* level at which we started skipping (including nested static unsigned char term_expr[] = ""; static int listline=-1; /* "current line" for the list file */ +#if defined __GNUC__ +static double pow10(double d) +{ + return pow(10, d); +} +#endif + /* pushstk & popstk * @@ -602,26 +609,6 @@ static int htoi(cell *val,const unsigned char *curptr) return (int)(ptr-curptr); } -#if defined __GNUC__ -static double pow10(int value) -{ - double res=1.0; - while (value>=4) { - res*=10000.0; - value-=5; - } /* while */ - while (value>=2) { - res*=100.0; - value-=2; - } /* while */ - while (value>=1) { - res*=10.0; - value-=1; - } /* while */ - return res; -} -#endif - /* ftoi * * Attempts to interpret a numeric symbol as a rational number, either as @@ -954,7 +941,7 @@ static int command(void) if (skiplevel==iflevel) preproc_expr(&val,NULL); /* get, but ignore the expression */ else - lptr=strchr(lptr,'\0'); + lptr=(unsigned char*)strchr((char*)lptr,'\0'); } /* if */ } else { /* previous conditions were all FALSE */ @@ -965,7 +952,7 @@ static int command(void) if (skiplevel==iflevel) { preproc_expr(&val,NULL); /* get value (or 0 on error) */ } else { - lptr=strchr(lptr,'\0'); + lptr=(unsigned char*)strchr((char*)lptr,'\0'); val=0; } /* if */ ifstack[iflevel-1]=(char)(val ? PARSEMODE : SKIPMODE); diff --git a/sourcepawn/compiler/sclinux.h b/sourcepawn/compiler/sclinux.h index 868539ea..a3b15b4b 100644 --- a/sourcepawn/compiler/sclinux.h +++ b/sourcepawn/compiler/sclinux.h @@ -16,7 +16,6 @@ */ #include "getch.h" -#define stricmp(a,b) strcasecmp(a,b) #define strnicmp(a,b,c) strncasecmp(a,b,c) /* diff --git a/sourcepawn/compiler/svn_version.h b/sourcepawn/compiler/svn_version.h deleted file mode 100644 index 1b7ea750..00000000 --- a/sourcepawn/compiler/svn_version.h +++ /dev/null @@ -1,27 +0,0 @@ -/** - * vim: set ts=4 : - * =============================================================== - * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. - * =============================================================== - * - * This file is not open source and may not be copied without explicit - * written permission of AlliedModders LLC. This file may not be redistributed - * in whole or significant part. - * For information, see LICENSE.txt or http://www.sourcemod.net/license.php - * - * Version: $Id$ - */ - -#ifndef _INCLUDE_SOURCEMOD_VERSION_H_ -#define _INCLUDE_SOURCEMOD_VERSION_H_ - -/** - * @file Contains SourceMod version information. - */ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/sourcepawn/compiler/svn_version.tpl b/sourcepawn/compiler/svn_version.tpl deleted file mode 100644 index 902b4393..00000000 --- a/sourcepawn/compiler/svn_version.tpl +++ /dev/null @@ -1,27 +0,0 @@ -/** - * vim: set ts=4 : - * =============================================================== - * SourceMod (C)2004-2008 AlliedModders LLC. All rights reserved. - * =============================================================== - * - * This file is not open source and may not be copied without explicit - * written permission of AlliedModders LLC. This file may not be redistributed - * in whole or significant part. - * For information, see LICENSE.txt or http://www.sourcemod.net/license.php - * - * Version: $Id$ - */ - -#ifndef _INCLUDE_SOURCEMOD_VERSION_H_ -#define _INCLUDE_SOURCEMOD_VERSION_H_ - -/** - * @file Contains SourceMod version information. - */ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_SOURCEMOD_VERSION_H_ diff --git a/sourcepawn/compiler/zlib/crc32.c b/sourcepawn/compiler/zlib/crc32.c index 32814c20..5e8c44be 100644 --- a/sourcepawn/compiler/zlib/crc32.c +++ b/sourcepawn/compiler/zlib/crc32.c @@ -19,6 +19,7 @@ one thread to use crc32(). */ +#include #ifdef MAKECRCH # include # ifndef DYNAMIC_CRC_TABLE diff --git a/sourcepawn/compiler/zlib/deflate.c b/sourcepawn/compiler/zlib/deflate.c index 529f716b..f58dee25 100644 --- a/sourcepawn/compiler/zlib/deflate.c +++ b/sourcepawn/compiler/zlib/deflate.c @@ -49,6 +49,7 @@ /* @(#) $Id$ */ +#include #include "deflate.h" const char deflate_copyright[] = diff --git a/sourcepawn/compiler/zlib/infback.c b/sourcepawn/compiler/zlib/infback.c index 1e03e1ba..0056928e 100644 --- a/sourcepawn/compiler/zlib/infback.c +++ b/sourcepawn/compiler/zlib/infback.c @@ -10,6 +10,7 @@ inflate_fast() can be used with either inflate.c or infback.c. */ +#include #include "zutil.h" #include "inftrees.h" #include "inflate.h" diff --git a/sourcepawn/compiler/zlib/inffast.c b/sourcepawn/compiler/zlib/inffast.c index fa31cad9..20ef523d 100644 --- a/sourcepawn/compiler/zlib/inffast.c +++ b/sourcepawn/compiler/zlib/inffast.c @@ -3,6 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ +#include #include "zutil.h" #include "inftrees.h" #include "inflate.h" diff --git a/sourcepawn/compiler/zlib/inflate.c b/sourcepawn/compiler/zlib/inflate.c index 33ea9029..f4606b62 100644 --- a/sourcepawn/compiler/zlib/inflate.c +++ b/sourcepawn/compiler/zlib/inflate.c @@ -80,6 +80,7 @@ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. */ +#include #include "zutil.h" #include "inftrees.h" #include "inflate.h" diff --git a/sourcepawn/compiler/zlib/inftrees.c b/sourcepawn/compiler/zlib/inftrees.c index 38ded81c..a1406443 100644 --- a/sourcepawn/compiler/zlib/inftrees.c +++ b/sourcepawn/compiler/zlib/inftrees.c @@ -3,6 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ +#include #include "zutil.h" #include "inftrees.h" diff --git a/sourcepawn/compiler/zlib/trees.c b/sourcepawn/compiler/zlib/trees.c index 7a048028..6ca02864 100644 --- a/sourcepawn/compiler/zlib/trees.c +++ b/sourcepawn/compiler/zlib/trees.c @@ -33,6 +33,7 @@ /* #define GEN_TREES_H */ +#include #include "deflate.h" #ifdef DEBUG diff --git a/sourcepawn/compiler/zlib/zutil.c b/sourcepawn/compiler/zlib/zutil.c index 0f4bd787..56e552f4 100644 --- a/sourcepawn/compiler/zlib/zutil.c +++ b/sourcepawn/compiler/zlib/zutil.c @@ -5,6 +5,7 @@ /* @(#) $Id$ */ +#include #include "zutil.h" #ifndef NO_DUMMY_DECL diff --git a/sourcepawn/jit/AMBuilder b/sourcepawn/jit/AMBuilder new file mode 100644 index 00000000..e3ce4282 --- /dev/null +++ b/sourcepawn/jit/AMBuilder @@ -0,0 +1,43 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os + +compiler = SM.DefaultCompiler() +base = AMBuild.sourceFolder +compiler['CXXINCLUDES'].append(os.path.join(SM.mmsPath, 'core', 'sourcehook')) +compiler['CXXINCLUDES'].append(os.path.join(base, 'sourcepawn', 'jit')) +compiler['CXXINCLUDES'].append(os.path.join(base, 'sourcepawn', 'jit', 'x86')) +compiler['CXXINCLUDES'].append(os.path.join(base, 'public')) +compiler['CXXINCLUDES'].append(os.path.join(base, 'public', 'sourcepawn')) +compiler['CXXINCLUDES'].append(os.path.join(base, 'public', 'jit')) +compiler['CXXINCLUDES'].append(os.path.join(base, 'public', 'jit', 'x86')) +compiler['CXXINCLUDES'].append(os.path.join(base, 'knight', 'shared')) + +extension = AMBuild.AddJob('sourcepawn.jit.x86') +binary = Cpp.LibraryBuilder('sourcepawn.jit.x86', AMBuild, extension, compiler) +binary.AddSourceFiles('sourcepawn/jit', [ + 'BaseRuntime.cpp', + 'engine2.cpp', + 'dll_exports.cpp', + 'jit_function.cpp', + 'sp_vm_basecontext.cpp', + 'sp_vm_engine.cpp', + 'sp_vm_function.cpp', + 'x86/jit_x86.cpp', + 'x86/opcode_helpers.cpp', + 'zlib/adler32.c', + 'zlib/compress.c', + 'zlib/crc32.c', + 'zlib/deflate.c', + 'zlib/gzio.c', + 'zlib/infback.c', + 'zlib/inffast.c', + 'zlib/inflate.c', + 'zlib/inftrees.c', + 'zlib/trees.c', + 'zlib/uncompr.c', + 'zlib/zutil.c', + '../../knight/shared/KeCodeAllocator.cpp' + ]) +SM.AutoVersion('sourcepawn/jit', binary) +binary.SendToJob() + diff --git a/sourcepawn/jit/engine2.cpp b/sourcepawn/jit/engine2.cpp index ad4aa9a8..9044aae6 100644 --- a/sourcepawn/jit/engine2.cpp +++ b/sourcepawn/jit/engine2.cpp @@ -1,9 +1,9 @@ +#include #include #include #include #include "engine2.h" #include "x86/jit_x86.h" -#include "jit_version.h" #include "zlib/zlib.h" #include "BaseRuntime.h" #include "sp_vm_engine.h" @@ -149,7 +149,7 @@ const char *SourcePawnEngine2::GetEngineName() const char *SourcePawnEngine2::GetVersionString() { - return SVN_FULL_VERSION; + return SM_FULL_VERSION; } IProfiler *SourcePawnEngine2::GetProfiler() diff --git a/sourcepawn/jit/jit_version.h b/sourcepawn/jit/jit_version.h deleted file mode 100644 index db168940..00000000 --- a/sourcepawn/jit/jit_version.h +++ /dev/null @@ -1,40 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -#ifndef _INCLUDE_JIT_VERSION_H_ -#define _INCLUDE_JIT_VERSION_H_ - -#define SM_BUILD_STRING "-dev" -#define SM_BUILD_UNIQUEID "2757:4d62987ed79b" SM_BUILD_STRING -#define SVN_FULL_VERSION "1.2.4" SM_BUILD_STRING -#define SVN_FILE_VERSION 1,2,4,0 - -#endif //_INCLUDE_JIT_VERSION_H_ diff --git a/sourcepawn/jit/jit_version.tpl b/sourcepawn/jit/jit_version.tpl deleted file mode 100644 index a154d6d4..00000000 --- a/sourcepawn/jit/jit_version.tpl +++ /dev/null @@ -1,40 +0,0 @@ -/** - * vim: set ts=4 : - * ============================================================================= - * SourceMod - * Copyright (C) 2004-2008 AlliedModders LLC. All rights reserved. - * ============================================================================= - * - * This program is free software; you can redistribute it and/or modify it under - * the terms of the GNU General Public License, version 3.0, as published by the - * Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License along with - * this program. If not, see . - * - * As a special exception, AlliedModders LLC gives you permission to link the - * code of this program (as well as its derivative works) to "Half-Life 2," the - * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software - * by the Valve Corporation. You must obey the GNU General Public License in - * all respects for all other code used. Additionally, AlliedModders LLC grants - * this exception to all derivative works. AlliedModders LLC defines further - * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007), - * or . - * - * Version: $Id$ - */ - -#ifndef _INCLUDE_JIT_VERSION_H_ -#define _INCLUDE_JIT_VERSION_H_ - -#define SM_BUILD_STRING "$BUILD_STRING$" -#define SM_BUILD_UNIQUEID "$BUILD_ID$" SM_BUILD_STRING -#define SVN_FULL_VERSION "$PMAJOR$.$PMINOR$.$PREVISION$" SM_BUILD_STRING -#define SVN_FILE_VERSION $PMAJOR$,$PMINOR$,$PREVISION$,0 - -#endif //_INCLUDE_JIT_VERSION_H_ diff --git a/sourcepawn/jit/version.rc b/sourcepawn/jit/version.rc index 5aa4d331..5e05f84e 100644 --- a/sourcepawn/jit/version.rc +++ b/sourcepawn/jit/version.rc @@ -8,7 +8,7 @@ // #include "winres.h" -#include "jit_version.h" +#include ///////////////////////////////////////////////////////////////////////////// #undef APSTUDIO_READONLY_SYMBOLS @@ -28,8 +28,8 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // VS_VERSION_INFO VERSIONINFO - FILEVERSION SVN_FILE_VERSION - PRODUCTVERSION SVN_FILE_VERSION + FILEVERSION SM_FILE_VERSION + PRODUCTVERSION SM_FILE_VERSION FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -46,12 +46,12 @@ BEGIN BEGIN VALUE "Comments", "SourcePawn JIT" VALUE "FileDescription", "SourcePawn JIT/Virtual Machine" - VALUE "FileVersion", SVN_FULL_VERSION + VALUE "FileVersion", SM_FULL_VERSION VALUE "InternalName", "sourcemod" VALUE "LegalCopyright", "Copyright (c) 2004-2008, AlliedModders LLC" VALUE "OriginalFilename", "sourcepawn.jit.x86.dll" VALUE "ProductName", "SourcePawn JIT" - VALUE "ProductVersion", SVN_FULL_VERSION + VALUE "ProductVersion", SM_FULL_VERSION END END BLOCK "VarFileInfo" diff --git a/sourcepawn/jit/x86/jit_x86.cpp b/sourcepawn/jit/x86/jit_x86.cpp index 27ad9e09..60e7a933 100644 --- a/sourcepawn/jit/x86/jit_x86.cpp +++ b/sourcepawn/jit/x86/jit_x86.cpp @@ -35,7 +35,6 @@ #include "jit_x86.h" #include "opcode_helpers.h" #include -#include "../jit_version.h" #include "../sp_vm_engine.h" #include "../engine2.h" #include "../BaseRuntime.h" diff --git a/sourcepawn/jit/zlib/crc32.c b/sourcepawn/jit/zlib/crc32.c index 32814c20..5e8c44be 100644 --- a/sourcepawn/jit/zlib/crc32.c +++ b/sourcepawn/jit/zlib/crc32.c @@ -19,6 +19,7 @@ one thread to use crc32(). */ +#include #ifdef MAKECRCH # include # ifndef DYNAMIC_CRC_TABLE diff --git a/sourcepawn/jit/zlib/deflate.c b/sourcepawn/jit/zlib/deflate.c index 529f716b..f58dee25 100644 --- a/sourcepawn/jit/zlib/deflate.c +++ b/sourcepawn/jit/zlib/deflate.c @@ -49,6 +49,7 @@ /* @(#) $Id$ */ +#include #include "deflate.h" const char deflate_copyright[] = diff --git a/sourcepawn/jit/zlib/infback.c b/sourcepawn/jit/zlib/infback.c index 1e03e1ba..0056928e 100644 --- a/sourcepawn/jit/zlib/infback.c +++ b/sourcepawn/jit/zlib/infback.c @@ -10,6 +10,7 @@ inflate_fast() can be used with either inflate.c or infback.c. */ +#include #include "zutil.h" #include "inftrees.h" #include "inflate.h" diff --git a/sourcepawn/jit/zlib/inffast.c b/sourcepawn/jit/zlib/inffast.c index fa31cad9..20ef523d 100644 --- a/sourcepawn/jit/zlib/inffast.c +++ b/sourcepawn/jit/zlib/inffast.c @@ -3,6 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ +#include #include "zutil.h" #include "inftrees.h" #include "inflate.h" diff --git a/sourcepawn/jit/zlib/inflate.c b/sourcepawn/jit/zlib/inflate.c index 33ea9029..f4606b62 100644 --- a/sourcepawn/jit/zlib/inflate.c +++ b/sourcepawn/jit/zlib/inflate.c @@ -80,6 +80,7 @@ * The history for versions after 1.2.0 are in ChangeLog in zlib distribution. */ +#include #include "zutil.h" #include "inftrees.h" #include "inflate.h" diff --git a/sourcepawn/jit/zlib/inftrees.c b/sourcepawn/jit/zlib/inftrees.c index 38ded81c..a1406443 100644 --- a/sourcepawn/jit/zlib/inftrees.c +++ b/sourcepawn/jit/zlib/inftrees.c @@ -3,6 +3,7 @@ * For conditions of distribution and use, see copyright notice in zlib.h */ +#include #include "zutil.h" #include "inftrees.h" diff --git a/sourcepawn/jit/zlib/trees.c b/sourcepawn/jit/zlib/trees.c index 7a048028..6ca02864 100644 --- a/sourcepawn/jit/zlib/trees.c +++ b/sourcepawn/jit/zlib/trees.c @@ -33,6 +33,7 @@ /* #define GEN_TREES_H */ +#include #include "deflate.h" #ifdef DEBUG diff --git a/sourcepawn/jit/zlib/zutil.c b/sourcepawn/jit/zlib/zutil.c index 0f4bd787..56e552f4 100644 --- a/sourcepawn/jit/zlib/zutil.c +++ b/sourcepawn/jit/zlib/zutil.c @@ -5,6 +5,7 @@ /* @(#) $Id$ */ +#include #include "zutil.h" #ifndef NO_DUMMY_DECL diff --git a/tools/buildbot/PackageScript b/tools/buildbot/PackageScript new file mode 100644 index 00000000..5e95dc83 --- /dev/null +++ b/tools/buildbot/PackageScript @@ -0,0 +1,226 @@ +# vim: set ts=2 sw=2 tw=99 noet ft=python: +import os +import shutil +import ambuild.osutil as osutil +from ambuild.command import Command + +job = AMBuild.AddJob('package') + +class DestroyPath(Command): + def __init__(self, folder): + Command.__init__(self) + self.folder = folder + + def destroy(self, path): + entries = os.listdir(path) + for entry in entries: + newpath = os.path.join(path, entry) + if os.path.isdir(newpath): + self.destroy(newpath) + os.rmdir(newpath) + elif os.path.isfile(newpath): + os.remove(newpath) + + def run(self, runner, job): + runner.PrintOut('rm -rf {0}/*'.format(self.folder)) + self.destroy(self.folder) + +class CreateFolders(Command): + def __init__(self, folders): + Command.__init__(self) + self.folders = folders + + def run(self, runner, job): + for folder in self.folders: + path = os.path.join(*folder) + runner.PrintOut('mkdir {0}'.format(path)) + os.makedirs(path) + +#Shallow folder copy +class CopyFolder(Command): + def __init__(self, fromList, toList, excludes = []): + Command.__init__(self) + self.fromPath = os.path.join(AMBuild.sourceFolder, *fromList) + self.toPath = os.path.join(*toList) + self.excludes = excludes + + def run(self, runner, job): + entries = os.listdir(self.fromPath) + for entry in entries: + if entry in self.excludes: + continue + path = os.path.join(self.fromPath, entry) + if not os.path.isfile(path): + continue + runner.PrintOut('copy {0} to {1}'.format(path, self.toPath)) + shutil.copy(path, self.toPath) + +#Single file copy +class CopyFile(Command): + def __init__(self, fromFile, toPath): + Command.__init__(self) + self.fromFile = fromFile + self.toPath = toPath + + def run(self, runner, job): + runner.PrintOut('copy {0} to {1}'.format(self.fromFile, self.toPath)) + shutil.copy(self.fromFile, self.toPath) + + +folders = [['addons', 'sourcemod', 'bin'], + ['addons', 'sourcemod', 'plugins', 'disabled'], + ['addons', 'sourcemod', 'gamedata'], + ['addons', 'sourcemod', 'gamedata', 'core.games'], + ['addons', 'sourcemod', 'gamedata', 'sdktools.games'], + ['addons', 'sourcemod', 'configs', 'geoip'], + ['addons', 'sourcemod', 'translations'], + ['addons', 'sourcemod', 'logs'], + ['addons', 'sourcemod', 'extensions'], + ['addons', 'sourcemod', 'data'], + ['addons', 'sourcemod', 'scripting', 'include'], + ['addons', 'sourcemod', 'scripting', 'admin-flatfile'], + ['addons', 'sourcemod', 'scripting', 'adminmenu'], + ['addons', 'sourcemod', 'scripting', 'testsuite'], + ['cfg', 'sourcemod'], + ['addons', 'sourcemod', 'configs', 'sql-init-scripts'], + ['addons', 'sourcemod', 'configs', 'sql-init-scripts', 'mysql'], + ['addons', 'sourcemod', 'configs', 'sql-init-scripts', 'sqlite'], + ['addons', 'sourcemod', 'scripting', 'basecommands'], + ['addons', 'sourcemod', 'scripting', 'basecomm'], + ['addons', 'sourcemod', 'scripting', 'funvotes'], + ['addons', 'sourcemod', 'scripting', 'basevotes'], + ['addons', 'sourcemod', 'scripting', 'basebans'], + ['addons', 'sourcemod', 'scripting', 'funcommands'], + ['addons', 'sourcemod', 'scripting', 'playercommands'], + ['addons', 'metamod'], + ] + +#Setup +job.AddCommand(DestroyPath(os.path.join(AMBuild.outputFolder, 'package'))) +job.AddCommand(CreateFolders(folders)) + +#Copy Folders +job.AddCommand(CopyFolder(['configs'], ['addons', 'sourcemod', 'configs'])) +job.AddCommand(CopyFolder(['configs', 'geoip'], ['addons', 'sourcemod', 'configs', 'geoip'])) +job.AddCommand(CopyFolder(['configs', 'cfg'], ['cfg', 'sourcemod'])) +job.AddCommand(CopyFolder(['configs', 'metamod'], ['addons', 'metamod'])) +job.AddCommand(CopyFolder(['configs', 'sql-init-scripts'], + ['addons', 'sourcemod', 'configs', 'sql-init-scripts'])) +job.AddCommand(CopyFolder(['configs', 'sql-init-scripts', 'mysql'], + ['addons', 'sourcemod', 'configs', 'sql-init-scripts', 'mysql'])) +job.AddCommand(CopyFolder(['configs', 'sql-init-scripts', 'sqlite'], + ['addons', 'sourcemod', 'configs', 'sql-init-scripts', 'sqlite'])) +job.AddCommand(CopyFolder(['gamedata'], ['addons', 'sourcemod', 'gamedata'])) +job.AddCommand(CopyFolder(['gamedata', 'sdktools.games'], + ['addons', 'sourcemod', 'gamedata', 'sdktools.games'])) +job.AddCommand(CopyFolder(['gamedata', 'core.games'], + ['addons', 'sourcemod', 'gamedata', 'core.games'])) +job.AddCommand(CopyFolder(['plugins'], ['addons', 'sourcemod', 'scripting'], ['AMBuilder'])) +job.AddCommand(CopyFolder(['plugins', 'include'], + ['addons', 'sourcemod', 'scripting', 'include'])) +job.AddCommand(CopyFolder(['translations'], ['addons', 'sourcemod', 'translations'])) +job.AddCommand(CopyFolder(['public', 'licenses'], ['addons', 'sourcemod'])) +job.AddCommand(CopyFolder(['plugins', 'admin-flatfile'], + ['addons', 'sourcemod', 'scripting', 'admin-flatfile'])) +job.AddCommand(CopyFolder(['plugins', 'adminmenu'], + ['addons', 'sourcemod', 'scripting', 'adminmenu'])) +job.AddCommand(CopyFolder(['plugins', 'testsuite'], + ['addons', 'sourcemod', 'scripting', 'testsuite'])) +job.AddCommand(CopyFolder(['plugins', 'basecommands'], + ['addons', 'sourcemod', 'scripting', 'basecommands'])) +job.AddCommand(CopyFolder(['plugins', 'basecomm'], + ['addons', 'sourcemod', 'scripting', 'basecomm'])) +job.AddCommand(CopyFolder(['plugins', 'funvotes'], + ['addons', 'sourcemod', 'scripting', 'funvotes'])) +job.AddCommand(CopyFolder(['plugins', 'basevotes'], + ['addons', 'sourcemod', 'scripting', 'basevotes'])) +job.AddCommand(CopyFolder(['plugins', 'basebans'], + ['addons', 'sourcemod', 'scripting', 'basebans'])) +job.AddCommand(CopyFolder(['plugins', 'funcommands'], + ['addons', 'sourcemod', 'scripting', 'funcommands'])) +job.AddCommand(CopyFolder(['plugins', 'playercommands'], + ['addons', 'sourcemod', 'scripting', 'playercommands'])) + +defPlugins = [ + 'admin-flatfile', + 'adminhelp', + 'antiflood', + 'basecommands', + 'reservedslots', + 'basetriggers', + 'nextmap', + 'basechat', + 'funcommands', + 'basevotes', + 'funvotes', + 'basebans', + 'basecomm', + 'adminmenu', + 'playercommands', + 'clientprefs', + 'sounds' +] + +disPlugins = [ + 'admin-sql-prefetch', + 'admin-sql-threaded', + 'sql-admin-manager', + 'mapchooser', + 'randomcycle', + 'rockthevote', + 'nominations' +] + +commands = [] +for plugin in defPlugins: + commands.append(CopyFile(os.path.join('..', 'plugins', plugin + '.smx'), + os.path.join('addons', 'sourcemod', 'plugins'))) + +for plugin in disPlugins: + commands.append(CopyFile(os.path.join('..', 'plugins', plugin + '.smx'), + os.path.join('addons', 'sourcemod', 'plugins', 'disabled'))) +job.AddCommandGroup(commands) + +bincopies = [] + +def AddNormalLibrary(name, dest): + dest = os.path.join('addons', 'sourcemod', dest) + bincopies.append(CopyFile(os.path.join('..', name, name + osutil.SharedLibSuffix()), dest)) + +def AddHL2Library(name, dest): + for i in SM.sdkInfo: + sdk = SM.sdkInfo[i] + AddNormalLibrary(name + '.' + sdk['ext'], dest) + +if AMBuild.target['platform'] == 'linux': + bincopies.append(CopyFile(os.path.join('..', 'loader', 'sourcemod_mm_i486.so'), + os.path.join('addons', 'sourcemod', 'bin'))) +elif AMBuild.target['platform'] == 'windows': + bincopies.append(CopyFile(os.path.join('..', 'loader', 'sourcemod_mm.dll'), + os.path.join('addons', 'sourcemod', 'bin'))) + +AddHL2Library('sourcemod', 'bin') +AddNormalLibrary('sourcepawn.jit.x86', 'bin') +AddNormalLibrary('geoip.ext', 'extensions') +AddNormalLibrary('dbi.mysql.ext', 'extensions') +AddNormalLibrary('dbi.sqlite.ext', 'extensions') +AddNormalLibrary('game.cstrike.ext.1.ep1', 'extensions') +AddNormalLibrary('game.tf2.ext.2.ep2v', 'extensions') +AddNormalLibrary('topmenus.ext', 'extensions') +AddNormalLibrary('regex.ext', 'extensions') +AddNormalLibrary('webternet.ext', 'extensions') +AddNormalLibrary('clientprefs.ext', 'extensions') +AddNormalLibrary('updater.ext', 'extensions') +AddHL2Library('bintools.ext', 'extensions') +AddHL2Library('sdktools.ext', 'extensions') + +bincopies.append(CopyFile(os.path.join('..', 'spcomp', 'spcomp' + osutil.ExecutableSuffix()), + os.path.join('addons', 'sourcemod', 'scripting'))) + +job.AddCommandGroup(bincopies) + +if AMBuild.target['platform'] == 'windows': + job.AddCommand(CopyFile( + os.path.join(AMBuild.sourceFolder, 'sourcepawn', 'batchtool', 'compile.exe'), + os.path.join('addons', 'sourcemod', 'scripting'))) + diff --git a/tools/builder/ABuilder.cs b/tools/builder/ABuilder.cs deleted file mode 100644 index dd2a34fa..00000000 --- a/tools/builder/ABuilder.cs +++ /dev/null @@ -1,202 +0,0 @@ -using System; -using System.IO; -using System.Diagnostics; - -namespace builder -{ - public abstract class ABuilder - { - public Config cfg; - - public ABuilder() - { - } - - public abstract bool BuildLibrary(Package pkg, Library lib); - - public abstract string GetPawnCompilerName(); - - public bool CompilePlugin(Package pkg, Plugin pl) - { - string local_dir = Config.PathFormat("{0}/{1}/addons/sourcemod/scripting", cfg.pkg_path, pkg.GetBaseFolder()); - - string filepath = null; - if (pl.Folder != null) - { - filepath = Config.PathFormat("{0}/{1}", pl.Folder, pl.Source); - } - else - { - filepath = pl.Source; - } - - ProcessStartInfo info = new ProcessStartInfo(); - info.WorkingDirectory = local_dir; - info.FileName = Config.PathFormat("{0}/{1}", local_dir, GetPawnCompilerName()); - info.Arguments = filepath + ".sp"; - info.UseShellExecute = false; - info.RedirectStandardOutput = true; - info.RedirectStandardError = true; - - Process p = Process.Start(info); - string output = p.StandardOutput.ReadToEnd() + "\n"; - output += p.StandardError.ReadToEnd(); - p.WaitForExit(); - p.Close(); - - Console.WriteLine(output); - - string binary = Config.PathFormat("{0}/{1}/addons/sourcemod/scripting/{2}.smx", cfg.pkg_path, pkg.GetBaseFolder(), pl.Source); - if (!File.Exists(binary)) - { - Console.WriteLine("Could not find binary: " + binary); - return false; - } - - string new_loc; - if (pl.disabled) - { - new_loc = Config.PathFormat("{0}/{1}/addons/sourcemod/plugins/disabled/{2}.smx", cfg.pkg_path, pkg.GetBaseFolder(), pl.Source); - } - else - { - new_loc = Config.PathFormat("{0}/{1}/addons/sourcemod/plugins/{2}.smx", cfg.pkg_path, pkg.GetBaseFolder(), pl.Source); - } - - try - { - if (File.Exists(new_loc)) - { - File.Delete(new_loc); - } - File.Move(binary, new_loc); - } - catch (System.Exception e) - { - Console.WriteLine(e.Message); - return false; - } - - return true; - } - - public bool CopyFile(Package pkg, string source, string dest) - { - string from = Config.PathFormat("{0}/{1}", - cfg.source_path, - source); - string to = Config.PathFormat("{0}/{1}/{2}", - cfg.pkg_path, - pkg.GetBaseFolder(), - dest); - - File.Copy(from, to, true); - - return true; - } - - /** dest can be null to mean root base folder */ - public void CopyFolder(Package pkg, string source, string dest, string [] omits) - { - string from_base = Config.PathFormat("{0}/{1}", cfg.source_path, source); - string to_base = null; - - if (dest == null) - { - to_base = Config.PathFormat("{0}/{1}", - cfg.pkg_path, - pkg.GetBaseFolder()); - } - else - { - to_base = Config.PathFormat("{0}/{1}/{2}", - cfg.pkg_path, - pkg.GetBaseFolder(), - dest); - } - - string [] files = Directory.GetFiles(from_base); - string file; - - for (int i=0; i. For example, if your KeyFile is -// located in the project directory, you would specify the AssemblyKeyFile -// attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")] -// (*) Delay Signing is an advanced option - see the Microsoft .NET Framework -// documentation for more information on this. -// -[assembly: AssemblyDelaySign(false)] -[assembly: AssemblyKeyFile("")] -[assembly: AssemblyKeyName("")] diff --git a/tools/builder/Config.cs b/tools/builder/Config.cs deleted file mode 100644 index d5096219..00000000 --- a/tools/builder/Config.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System; -using System.IO; -using System.Text; - -namespace builder -{ - [Flags] - public enum BasePlatform - { - Platform_Windows, - Platform_Linux - }; - - public class Config - { - public string source_path; - public string pkg_path; - public string builder_path; - public string build_options; - public string pdb_log_file; - public builder.BasePlatform Platform; - - public Config() - { - if ((int)System.Environment.OSVersion.Platform == 128) - { - Platform = BasePlatform.Platform_Linux; - } - else - { - Platform = BasePlatform.Platform_Windows; - } - } - - public static string PathFormat(string format, params string [] args) - { - string temp = string.Format(format, args); - return temp.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar); - } - - public bool ReadFromFile(string file) - { - bool read = true; - StreamReader sr = null; - try - { - sr = new StreamReader(file); - - string line; - string delim = "\t \n\r\v"; - string split = "="; - - while ( (line = sr.ReadLine()) != null ) - { - line = line.Trim(delim.ToCharArray()); - if (line.Length < 1 || line[0] == ';') - { - continue; - } - string [] s = line.Split(split.ToCharArray()); - string key, val = ""; - if (s.GetLength(0) >= 1) - { - key = s[0]; - if (s.GetLength(0) >= 2) - { - for (int i=1; i"); - return; - } - - Config cfg = new Config(); - if (!cfg.ReadFromFile(args[0])) - { - return; - } - - /* :TODO: Add path validation */ - - ABuilder bld = null; - - if (cfg.Platform == BasePlatform.Platform_Linux) - { - bld = new LinuxBuilder(cfg); - } - else if (cfg.Platform == BasePlatform.Platform_Windows) - { - bld = new Win32Builder(cfg); - /* Do not delete this file anymore. We don't support rebuilds, and thus the file - * is guaranteed to be wiped by buildbot. - */ - /*if (cfg.pdb_log_file != null && File.Exists(cfg.pdb_log_file)) - { - File.Delete(cfg.pdb_log_file); - }*/ - } - - try - { - bld.BuildPackage(new PkgCore()); - } - catch (System.Exception e) - { - Console.WriteLine("Build failed, exception: " + e.Message); - Environment.Exit(1); - } - - Environment.Exit(0); - } - } -} diff --git a/tools/builder/Makefile b/tools/builder/Makefile deleted file mode 100644 index 0e888927..00000000 --- a/tools/builder/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -CS = mcs -NAME = builder -BINARY = $(NAME).exe - -OBJECTS = ABuilder.cs AssemblyInfo.cs Config.cs LinuxBuilder.cs Win32Builder.cs \ - Package.cs PkgCore.cs Main.cs - -default: all - -all: $(OBJECTS) - $(CS) $(OBJECTS) -out:$(BINARY) - -clean: - rm -rf $(BINARY) - diff --git a/tools/builder/Package.cs b/tools/builder/Package.cs deleted file mode 100644 index 8e79e596..00000000 --- a/tools/builder/Package.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; - -namespace builder -{ - public enum ReleaseMode : int - { - ReleaseMode_Release, - ReleaseMode_Debug, - }; - - public enum BuildMode : int - { - BuildMode_Simple, - BuildMode_OldMetamod, - BuildMode_DarkMessiah, - BuildMode_Episode1, - BuildMode_Episode2, - BuildMode_Episode2Valve, - BuildMode_Left4Dead - }; - - public class Library - { - public Library() - { - has_platform_ext = false; - is_executable = false; - release_mode = ReleaseMode.ReleaseMode_Release; - build_mode = BuildMode.BuildMode_Simple; - platform = BasePlatform.Platform_Linux | BasePlatform.Platform_Windows; - } - public string binary_name; /* Name of binary */ - public string source_path; /* Local path to library build scripts */ - public ReleaseMode release_mode; /* Release mode */ - public BuildMode build_mode; /* Build mode */ - public string package_path; /* Final relative path */ - public bool has_platform_ext; /* Add extra platform extension? */ - public string vcproj_name; /* Project file, NULL for standard */ - public bool is_executable; /* If this is an EXE instead of a DLL */ - public BasePlatform platform; /* Platforms for which the binary should be built */ - }; - - public class Plugin - { - public Plugin(string file) - { - Source = file; - disabled = false; - } - public Plugin (string file, string folder) - { - Source = file; - Folder = folder; - disabled = false; - } - public Plugin (string file, bool is_disabled) - { - Source = file; - disabled = is_disabled; - } - public string Folder; /* Source folder relative to scripting (null for default) */ - public string Source; /* Source file name */ - public bool disabled; /* Is the plugin disabled? */ - }; - - public abstract class Package - { - /** - * Must return the root compression point. - */ - public abstract void GetCompressBases(ref string path, ref string folder); - - /** - * Must return the base package output folder. - */ - public abstract string GetBaseFolder(); - - /** - * Must return the list of folders to create. - */ - public abstract string [] GetFolders(); - - /** - * Called when file to file copies must be performed - */ - public abstract void OnCopyFiles(ABuilder builder); - - /** - * Called when dir to dir copies must be performed - */ - public abstract void OnCopyFolders(ABuilder builder); - - /** - * Called to build libraries - */ - public abstract Library [] GetLibraries(); - - /** - * Called to get package name - */ - public abstract string GetPackageName(); - - /** - * Called to get a plugin list - */ - public abstract Plugin [] GetPlugins(); - } -} diff --git a/tools/builder/PkgCore.cs b/tools/builder/PkgCore.cs deleted file mode 100644 index 447b7a01..00000000 --- a/tools/builder/PkgCore.cs +++ /dev/null @@ -1,403 +0,0 @@ -using System; -using System.Collections; - -namespace builder -{ - public class PkgCore : Package - { - private ArrayList libraries; - private ArrayList plugins; - private ArrayList folders; - - public PkgCore() - { - } - - public override string GetBaseFolder() - { - return "base"; - } - - public override void GetCompressBases(ref string path, ref string folder) - { - path = "base"; - folder = "addons"; - } - - public override string GetPackageName() - { - return "sourcemod-core"; - } - - /** - * Must return the list of folders to create. - */ - public override string [] GetFolders() - { - if (folders != null) - { - return (string [])folders.ToArray(typeof(string)); - } - - folders = new ArrayList(); - - folders.Add("addons/sourcemod/bin"); - folders.Add("addons/sourcemod/plugins/disabled"); - folders.Add("addons/sourcemod/gamedata"); - folders.Add("addons/sourcemod/gamedata/core.games"); - folders.Add("addons/sourcemod/gamedata/sdktools.games"); - folders.Add("addons/sourcemod/configs/geoip"); - folders.Add("addons/sourcemod/translations"); - folders.Add("addons/sourcemod/logs"); - folders.Add("addons/sourcemod/extensions"); - folders.Add("addons/sourcemod/data"); - folders.Add("addons/sourcemod/scripting/include"); - folders.Add("addons/sourcemod/scripting/admin-flatfile"); - folders.Add("addons/sourcemod/scripting/adminmenu"); - folders.Add("addons/sourcemod/scripting/testsuite"); - folders.Add("cfg/sourcemod"); - folders.Add("addons/sourcemod/configs/sql-init-scripts"); - folders.Add("addons/sourcemod/configs/sql-init-scripts/mysql"); - folders.Add("addons/sourcemod/configs/sql-init-scripts/sqlite"); - folders.Add("addons/sourcemod/scripting/basecommands"); - folders.Add("addons/sourcemod/scripting/basecomm"); - folders.Add("addons/sourcemod/scripting/funvotes"); - folders.Add("addons/sourcemod/scripting/basevotes"); - folders.Add("addons/sourcemod/scripting/basebans"); - folders.Add("addons/sourcemod/scripting/funcommands"); - folders.Add("addons/sourcemod/scripting/playercommands"); - folders.Add("addons/metamod"); - - return (string [])folders.ToArray(typeof(string)); - } - - /** - * Called when file to file copies must be performed - */ - public override void OnCopyFiles(ABuilder builder) - { - builder.CopyFile(this, "sourcepawn/batchtool/compile.exe", "addons/sourcemod/scripting/compile.exe"); - } - - /** - * Called when dir to dir copies must be performed - */ - public override void OnCopyFolders(ABuilder builder) - { - builder.CopyFolder(this, "configs", "addons/sourcemod/configs", null); - builder.CopyFolder(this, "configs/geoip", "addons/sourcemod/configs/geoip", null); - builder.CopyFolder(this, "configs/cfg", "cfg/sourcemod", null); - builder.CopyFolder(this, "configs/metamod", "addons/metamod", null); - builder.CopyFolder(this, - "configs/sql-init-scripts", - "addons/sourcemod/configs/sql-init-scripts", - null); - builder.CopyFolder(this, - "configs/sql-init-scripts/mysql", - "addons/sourcemod/configs/sql-init-scripts/mysql", - null); - builder.CopyFolder(this, - "configs/sql-init-scripts/sqlite", - "addons/sourcemod/configs/sql-init-scripts/sqlite", - null); - - string [] plugin_omits = new string[1]; - plugin_omits[0] = "spcomp.exe"; - - string [] include_omits = new string[1]; - include_omits[0] = "version.tpl"; - - builder.CopyFolder(this, "gamedata", "addons/sourcemod/gamedata", null); - builder.CopyFolder(this, "gamedata/sdktools.games", "addons/sourcemod/gamedata/sdktools.games", null); - builder.CopyFolder(this, "gamedata/core.games", "addons/sourcemod/gamedata/core.games", null); - builder.CopyFolder(this, "plugins", "addons/sourcemod/scripting", plugin_omits); - builder.CopyFolder(this, "plugins/include", "addons/sourcemod/scripting/include", include_omits); - builder.CopyFolder(this, "translations", "addons/sourcemod/translations", null); - builder.CopyFolder(this, "public/licenses", "addons/sourcemod", null); - builder.CopyFolder(this, "plugins/admin-flatfile", "addons/sourcemod/scripting/admin-flatfile", null); - builder.CopyFolder(this, "plugins/adminmenu", "addons/sourcemod/scripting/adminmenu", null); - builder.CopyFolder(this, "plugins/testsuite", "addons/sourcemod/scripting/testsuite", null); - builder.CopyFolder(this, "plugins/basecommands", "addons/sourcemod/scripting/basecommands", null); - builder.CopyFolder(this, "plugins/basecomm", "addons/sourcemod/scripting/basecomm", null); - builder.CopyFolder(this, "plugins/funvotes", "addons/sourcemod/scripting/funvotes", null); - builder.CopyFolder(this, "plugins/basevotes", "addons/sourcemod/scripting/basevotes", null); - builder.CopyFolder(this, "plugins/basebans", "addons/sourcemod/scripting/basebans", null); - builder.CopyFolder(this, "plugins/funcommands", "addons/sourcemod/scripting/funcommands", null); - builder.CopyFolder(this, "plugins/playercommands", "addons/sourcemod/scripting/playercommands", null); - } - - /** - * Called to build libraries - */ - public override Library [] GetLibraries() - { - if (libraries != null) - { - return (Library [])libraries.ToArray(typeof(Library)); - } - - libraries = new ArrayList(); - - Library lib = new Library(); - lib.package_path = "addons/sourcemod/bin"; - lib.source_path = "loader"; - lib.binary_name = "sourcemod_mm"; - lib.vcproj_name = "loader"; - lib.build_mode = BuildMode.BuildMode_Simple; - lib.has_platform_ext = true; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/bin"; - lib.source_path = "core"; - lib.binary_name = "sourcemod.1.ep1"; - lib.vcproj_name = "sourcemod_mm"; - lib.build_mode = BuildMode.BuildMode_OldMetamod; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/bin"; - lib.source_path = "core"; - lib.binary_name = "sourcemod.2.darkm"; - lib.vcproj_name = "sourcemod_mm"; - lib.build_mode = BuildMode.BuildMode_DarkMessiah; - lib.platform = BasePlatform.Platform_Windows; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/bin"; - lib.source_path = "core"; - lib.binary_name = "sourcemod.2.ep2"; - lib.vcproj_name = "sourcemod_mm"; - lib.build_mode = BuildMode.BuildMode_Episode2; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/bin"; - lib.source_path = "core"; - lib.binary_name = "sourcemod.2.ep2v"; - lib.vcproj_name = "sourcemod_mm"; - lib.build_mode = BuildMode.BuildMode_Episode2Valve; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/bin"; - lib.source_path = "core"; - lib.binary_name = "sourcemod.2.l4d"; - lib.vcproj_name = "sourcemod_mm"; - lib.build_mode = BuildMode.BuildMode_Left4Dead; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/bin"; - lib.source_path = "sourcepawn/jit"; - lib.binary_name = "sourcepawn.jit.x86"; - lib.vcproj_name = "jit-x86"; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/scripting"; - lib.source_path = "sourcepawn/compiler"; - lib.binary_name = "spcomp"; - lib.is_executable = true; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/geoip"; - lib.binary_name = "geoip.ext"; - lib.vcproj_name = "geoip"; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/bintools"; - lib.binary_name = "bintools.ext.1.ep1"; - lib.vcproj_name = "bintools"; - lib.build_mode = BuildMode.BuildMode_OldMetamod; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/bintools"; - lib.binary_name = "bintools.ext.2.darkm"; - lib.vcproj_name = "bintools"; - lib.build_mode = BuildMode.BuildMode_DarkMessiah; - lib.platform = BasePlatform.Platform_Windows; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/bintools"; - lib.binary_name = "bintools.ext.2.ep2"; - lib.vcproj_name = "bintools"; - lib.build_mode = BuildMode.BuildMode_Episode2; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/bintools"; - lib.binary_name = "bintools.ext.2.ep2v"; - lib.vcproj_name = "bintools"; - lib.build_mode = BuildMode.BuildMode_Episode2Valve; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/bintools"; - lib.binary_name = "bintools.ext.2.l4d"; - lib.vcproj_name = "bintools"; - lib.build_mode = BuildMode.BuildMode_Left4Dead; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/mysql"; - lib.binary_name = "dbi.mysql.ext"; - lib.vcproj_name = "sm_mysql"; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/sdktools"; - lib.binary_name = "sdktools.ext.1.ep1"; - lib.vcproj_name = "sdktools"; - lib.build_mode = BuildMode.BuildMode_OldMetamod; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/sdktools"; - lib.binary_name = "sdktools.ext.2.darkm"; - lib.vcproj_name = "sdktools"; - lib.build_mode = BuildMode.BuildMode_DarkMessiah; - lib.platform = BasePlatform.Platform_Windows; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/sdktools"; - lib.binary_name = "sdktools.ext.2.ep2"; - lib.vcproj_name = "sdktools"; - lib.build_mode = BuildMode.BuildMode_Episode2; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/sdktools"; - lib.binary_name = "sdktools.ext.2.ep2v"; - lib.vcproj_name = "sdktools"; - lib.build_mode = BuildMode.BuildMode_Episode2Valve; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/sdktools"; - lib.binary_name = "sdktools.ext.2.l4d"; - lib.vcproj_name = "sdktools"; - lib.build_mode = BuildMode.BuildMode_Left4Dead; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/sqlite"; - lib.binary_name = "dbi.sqlite.ext"; - lib.vcproj_name = "sm_sqlite"; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/cstrike"; - lib.binary_name = "game.cstrike.ext.1.ep1"; - lib.vcproj_name = "cstrike"; - lib.build_mode = BuildMode.BuildMode_OldMetamod; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/topmenus"; - lib.binary_name = "topmenus.ext"; - lib.vcproj_name = "topmenus"; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/tf2"; - lib.binary_name = "game.tf2.ext.2.ep2v"; - lib.vcproj_name = "tf2"; - lib.build_mode = BuildMode.BuildMode_Episode2Valve; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/regex"; - lib.binary_name = "regex.ext"; - lib.vcproj_name = "regex"; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/clientprefs"; - lib.binary_name = "clientprefs.ext"; - lib.vcproj_name = "clientprefs"; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/curl"; - lib.binary_name = "webternet.ext"; - lib.vcproj_name = "curl"; - libraries.Add(lib); - - lib = new Library(); - lib.package_path = "addons/sourcemod/extensions"; - lib.source_path = "extensions/updater"; - lib.binary_name = "updater.ext"; - lib.vcproj_name = "updater"; - libraries.Add(lib); - - return (Library [])libraries.ToArray(typeof(Library)); - } - - /** - * Called to build plugins - */ - public override Plugin [] GetPlugins() - { - if (plugins != null) - { - return (Plugin [])plugins.ToArray(typeof(Plugin)); - } - - plugins = new ArrayList(); - - plugins.Add(new Plugin("admin-flatfile", "admin-flatfile")); - plugins.Add(new Plugin("adminhelp")); - plugins.Add(new Plugin("antiflood")); - plugins.Add(new Plugin("basecommands")); - plugins.Add(new Plugin("reservedslots")); - plugins.Add(new Plugin("basetriggers")); - plugins.Add(new Plugin("nextmap")); - plugins.Add(new Plugin("basechat")); - plugins.Add(new Plugin("funcommands")); - plugins.Add(new Plugin("basevotes")); - plugins.Add(new Plugin("funvotes")); - plugins.Add(new Plugin("admin-sql-prefetch", true)); - plugins.Add(new Plugin("admin-sql-threaded", true)); - plugins.Add(new Plugin("sql-admin-manager", true)); - plugins.Add(new Plugin("basebans")); - plugins.Add(new Plugin("mapchooser", true)); - plugins.Add(new Plugin("basecomm")); - plugins.Add(new Plugin("randomcycle", true)); - plugins.Add(new Plugin("rockthevote", true)); - plugins.Add(new Plugin("adminmenu")); - plugins.Add(new Plugin("playercommands")); - plugins.Add(new Plugin("clientprefs")); - plugins.Add(new Plugin("nominations", true)); - plugins.Add(new Plugin("sounds")); - - return (Plugin [])plugins.ToArray(typeof(Plugin)); - } - } -} - diff --git a/tools/builder/Win32Builder.cs b/tools/builder/Win32Builder.cs deleted file mode 100644 index b681b51d..00000000 --- a/tools/builder/Win32Builder.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System; -using System.IO; -using System.Diagnostics; - -namespace builder -{ - public class Win32Builder : ABuilder - { - public Win32Builder(Config _cfg) - { - cfg = _cfg; - } - - public override string GetPawnCompilerName() - { - return "spcomp.exe"; - } - - public override bool BuildLibrary(Package pkg, Library lib) - { - ProcessStartInfo info = new ProcessStartInfo(); - - string path = Config.PathFormat("{0}/{1}/msvc9", - cfg.source_path, - lib.source_path); - - /* PlatformExt ignored for us */ - string binName = lib.binary_name + (lib.is_executable ? ".exe" : ".dll"); - - string config_name = "Unknown"; - - if (lib.release_mode == ReleaseMode.ReleaseMode_Release) - { - config_name = "Release"; - } - else if (lib.release_mode == ReleaseMode.ReleaseMode_Debug) - { - config_name = "Debug"; - } - - if (lib.build_mode == BuildMode.BuildMode_DarkMessiah) - { - config_name = config_name + " - Dark Messiah"; - } - if (lib.build_mode == BuildMode.BuildMode_Episode1) - { - config_name = config_name + " - Episode 1"; - } - else if (lib.build_mode == BuildMode.BuildMode_Episode2) - { - config_name = config_name + " - Orange Box"; - } - else if (lib.build_mode == BuildMode.BuildMode_Episode2Valve) - { - config_name = config_name + " - Orange Box Valve"; - } - else if (lib.build_mode == BuildMode.BuildMode_OldMetamod) - { - config_name = config_name + " - Old Metamod"; - } - else if (lib.build_mode == BuildMode.BuildMode_Left4Dead) - { - config_name = config_name + " - Left 4 Dead"; - } - - string binpath = Config.PathFormat("{0}/{1}/{2}", - path, - config_name, - binName); - - if (File.Exists(binpath)) - { - File.Delete(binpath); - } - - string project_file = null; - if (lib.vcproj_name != null) - { - project_file = lib.vcproj_name + ".vcproj"; - } - else - { - project_file = lib.binary_name + ".vcproj"; - } - - info.WorkingDirectory = path; - info.FileName = cfg.builder_path; - info.UseShellExecute = false; - info.RedirectStandardOutput = true; - info.RedirectStandardError = true; - - if (cfg.build_options != null) - { - info.Arguments = cfg.build_options + " "; - } - - info.Arguments += "/rebuild \"" + project_file + "\" \"" + config_name + "\""; - - Process p = Process.Start(info); - Console.WriteLine(p.StandardOutput.ReadToEnd()); - p.WaitForExit(); - p.Close(); - - if (!File.Exists(binpath)) - { - return false; - } - - path = Config.PathFormat("{0}/{1}/{2}/{3}", - cfg.pkg_path, - pkg.GetBaseFolder(), - lib.package_path, - binName); - File.Copy(binpath, path, true); - - /* On Windows we optionally log the PDB path */ - if (!lib.is_executable && cfg.pdb_log_file != null) - { - FileStream fs = File.Open(cfg.pdb_log_file, FileMode.Append, FileAccess.Write); - StreamWriter sw = new StreamWriter(fs); - sw.WriteLine(binpath.Replace(".dll", ".pdb")); - sw.Close(); - } - - return true; - } - } -} diff --git a/tools/builder/build-linux.cfg b/tools/builder/build-linux.cfg deleted file mode 100644 index edec9b66..00000000 --- a/tools/builder/build-linux.cfg +++ /dev/null @@ -1,4 +0,0 @@ -OutputBase = /home/dvander/bin -SourceBase = /home/dvander/sourcemod/trunk -BuilderPath = /usr/bin/make - diff --git a/tools/builder/build-win32.cfg b/tools/builder/build-win32.cfg deleted file mode 100644 index a560006e..00000000 --- a/tools/builder/build-win32.cfg +++ /dev/null @@ -1,3 +0,0 @@ -OutputBase = c:\real\done -SourceBase = r:\sourcemod\trunk -BuilderPath = C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\devenv.com diff --git a/tools/builder/builder.csproj b/tools/builder/builder.csproj deleted file mode 100644 index f7de7e19..00000000 --- a/tools/builder/builder.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - Local - 8.0.30729 - 2.0 - {BFC4EB78-4C3E-4C81-8EAD-5A1A2F126512} - Debug - AnyCPU - - - - - builder - - - JScript - Grid - IE50 - false - Exe - builder - OnBuildSuccess - - - - - 0.0 - - - - - bin\Debug\ - false - 285212672 - false - - - DEBUG;TRACE - - - true - 4096 - false - - - false - false - false - false - 4 - full - prompt - - - bin\Release\ - false - 285212672 - false - - - TRACE - - - false - 4096 - false - - - true - false - false - false - 4 - none - prompt - - - - System - - - System.Data - - - System.XML - - - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - - - - - - - - \ No newline at end of file diff --git a/tools/builder/builder.sln b/tools/builder/builder.sln deleted file mode 100644 index 51bc1f44..00000000 --- a/tools/builder/builder.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "builder", "builder.csproj", "{BFC4EB78-4C3E-4C81-8EAD-5A1A2F126512}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BFC4EB78-4C3E-4C81-8EAD-5A1A2F126512}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BFC4EB78-4C3E-4C81-8EAD-5A1A2F126512}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BFC4EB78-4C3E-4C81-8EAD-5A1A2F126512}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BFC4EB78-4C3E-4C81-8EAD-5A1A2F126512}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/tools/versionchanger.pl b/tools/versionchanger.pl deleted file mode 100755 index ce5f6f62..00000000 --- a/tools/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); -} -