From cc17d0dbcafad35c94e33b2db18e466f7b956108 Mon Sep 17 00:00:00 2001 From: Saveliy Skresanov Date: Mon, 25 Mar 2013 21:14:27 +0700 Subject: [PATCH] Forgot to "git rm" some files. --- SConscript | 324 ------------------- SConstruct | 2 - site_scons/site_tools/gch/__init__.py | 126 -------- site_scons/site_tools/gch/__init__.pyc | Bin 3815 -> 0 bytes site_scons/site_tools/mfprogram/__init__.py | 241 -------------- site_scons/site_tools/mfprogram/__init__.pyc | Bin 7378 -> 0 bytes site_scons/site_tools/mfprogram/relpath.py | 73 ----- 7 files changed, 766 deletions(-) delete mode 100644 SConscript delete mode 100644 SConstruct delete mode 100644 site_scons/site_tools/gch/__init__.py delete mode 100644 site_scons/site_tools/gch/__init__.pyc delete mode 100644 site_scons/site_tools/mfprogram/__init__.py delete mode 100644 site_scons/site_tools/mfprogram/__init__.pyc delete mode 100644 site_scons/site_tools/mfprogram/relpath.py diff --git a/SConscript b/SConscript deleted file mode 100644 index 69aa6fefd..000000000 --- a/SConscript +++ /dev/null @@ -1,324 +0,0 @@ -import os, sys, subprocess, time - - -##Fix for long command line - http://scons.org/wiki/LongCmdLinesOnWin32 -class ourSpawn: - def ourspawn(self, sh, escape, cmd, args, env): - newargs = ' '.join(args[1:]) - cmdline = cmd + " " + newargs - startupinfo = subprocess.STARTUPINFO() - startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW - proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False, env = env) - data, err = proc.communicate() - rv = proc.wait() - if rv: - print "=====" - print err - print "=====" - return rv - -def SetupSpawn( env ): - if sys.platform == 'win32': - buf = ourSpawn() - buf.ourenv = env - env['SPAWN'] = buf.ourspawn - -AddOption('--opengl',dest="opengl",action='store_true',default=False,help="Build with OpenGL interface support.") -AddOption('--opengl-renderer',dest="opengl-renderer",action='store_true',default=False,help="Build with OpenGL renderer support. (requires --opengl)") -AddOption('--renderer',dest="renderer",action='store_true',default=False,help="Save renderer") -AddOption('--win',dest="win",action='store_true',default=False,help="Windows platform target.") -AddOption('--lin',dest="lin",action='store_true',default=False,help="Linux platform target") -AddOption('--macosx',dest="macosx",action='store_true',default=False,help="Mac OS X platform target") -AddOption('--rpi',dest="rpi",action='store_true',default=False,help="Raspbain platform target") -AddOption('--64bit',dest="_64bit",action='store_true',default=False,help="64-bit platform target") -AddOption('--static',dest="static",action="store_true",default=False,help="Static linking, reduces external library dependancies but increased file size") -AddOption('--pthreadw32-static',dest="ptw32-static",action="store_true",default=False,help="Use PTW32_STATIC_LIB for pthreadw32 headers") -AddOption('--python-ver',dest="pythonver",default=False,help="Python version to use for generator.py") -AddOption('--release',dest="release",action='store_true',default=False,help="Enable optimisations (Will slow down compiling)") -AddOption('--lua-dir',dest="lua-dir",default=False,help="Directory for lua includes") -AddOption('--sdl-dir',dest="sdl-dir",default=False,help="Directory for SDL includes") -AddOption('--tool',dest="toolprefix",default=False,help="Prefix") -AddOption('--sse',dest="sse",action='store_true',default=False,help="Enable SSE optimisations") -AddOption('--sse2',dest="sse2",action='store_true',default=False,help="Enable SSE2 optimisations") -AddOption('--sse3',dest="sse3",action='store_true',default=False,help="Enable SSE3 optimisations") -AddOption('--x86',dest="x86",action='store_true',default=True,help="Target Intel x86 platform") - -AddOption('--debugging', dest="debug", action="store_true", default=False, help="Enable debug options") -AddOption('--beta',dest="beta",action='store_true',default=False,help="Beta build.") -AddOption('--save-version',dest="save-version",default=False,help="Save version.") -AddOption('--minor-version',dest="minor-version",default=False,help="Minor version.") -AddOption('--build-number',dest="build-number",default=False,help="Build number.") -AddOption('--snapshot',dest="snapshot",action='store_true',default=False,help="Snapshot build.") -AddOption('--snapshot-id',dest="snapshot-id",default=False,help="Snapshot build ID.") -AddOption('--stable',dest="stable",default=True,help="Non snapshot build") - -AddOption('--aao', dest="everythingAtOnce", action='store_true', default=False, help="Compile the whole game without generating intermediate objects (very slow), enable this when using compilers like clang or mscc that don't support -fkeep-inline-functions") - -if((not GetOption('lin')) and (not GetOption('win')) and (not GetOption('rpi')) and (not GetOption('macosx'))): - print "You must specify a platform to target" - raise SystemExit(1) - -if(GetOption('win')): - env = Environment(tools = ['mingw'], ENV = os.environ) -else: - env = Environment(tools = ['default'], ENV = os.environ) - -if GetOption("toolprefix"): - env['CC'] = GetOption("toolprefix")+env['CC'] - env['CXX'] = GetOption("toolprefix")+env['CXX'] - if GetOption('win'): - env['RC'] = GetOption("toolprefix")+env['RC'] - -#Check for headers and libraries -if not GetOption("macosx"): - conf = Configure(env) - - try: - env.ParseConfig('sdl-config --cflags') - env.ParseConfig('sdl-config --libs') - except: - if not conf.CheckLib("SDL"): - print "libSDL not found or not installed" - raise SystemExit(1) - - if(GetOption("sdl-dir")): - if not conf.CheckCHeader(GetOption("sdl-dir") + '/SDL.h'): - print "sdl headers not found or not installed" - raise SystemExit(1) - else: - env.Append(CPPPATH=[GetOption("sdl-dir")]) - - #Find correct lua include dir - try: - env.ParseConfig('pkg-config --cflags lua5.1') - except: - if(GetOption("lua-dir")): - if not conf.CheckCHeader(GetOption("lua-dir") + '/lua.h'): - print "lua5.1 headers not found or not installed" - raise SystemExit(1) - else: - env.Append(CPPPATH=[GetOption("lua-dir")]) - - #Check for FFT lib - if not conf.CheckLib('fftw3f') and not conf.CheckLib('fftw3f-3'): - print "libfftw3f not found or not installed" - raise SystemExit(1) - - #Check for Bzip lib - if not conf.CheckLib('bz2'): - print "libbz2 not found or not installed" - raise SystemExit(1) - - #Check for zlib - if not conf.CheckLib('z'): - print "libz not found or not installed" - raise SystemExit(1) - - if not conf.CheckCHeader("bzlib.h"): - print "bzip2 headers not found" - raise SystemExit(1) - - #Check for Lua lib - if not GetOption("macosx"): - if not conf.CheckLib('lua5.1') and not conf.CheckLib('lua-5.1') and not conf.CheckLib('lua51') and not conf.CheckLib('lua'): - print "liblua not found or not installed" - raise SystemExit(1) - - env = conf.Finish(); -else: - env.Append(LIBS=['z', 'bz2', 'fftw3f']) - -env.Append(CPPPATH=['src/', 'data/', 'generated/']) -env.Append(CCFLAGS=['-w', '-std=c++98', '-fkeep-inline-functions']) -env.Append(LIBS=['pthread', 'm']) -env.Append(CPPDEFINES=["LUACONSOLE", "GRAVFFT", "_GNU_SOURCE", "USE_STDINT", "_POSIX_C_SOURCE=200112L"]) - -if GetOption("ptw32-static"): - env.Append(CPPDEFINES=['PTW32_STATIC_LIB']); - -if(GetOption('static')): - env.Append(LINKFLAGS=['-static-libgcc']) - -if(GetOption('renderer')): - env.Append(CPPDEFINES=['RENDERER']) -else: - env.Append(CPPDEFINES=["USE_SDL"]) - -if(GetOption('rpi')): - if(GetOption('opengl')): - env.ParseConfig('pkg-config --libs glew gl glu') - openGLLibs = ['GL'] - env.Append(LIBS=['X11', 'rt']) - env.Append(CPPDEFINES=["LIN"]) - -if(GetOption('win')): - openGLLibs = ['opengl32', 'glew32'] - env.Prepend(LIBS=['mingw32', 'ws2_32', 'SDLmain', 'regex']) - env.Append(CCFLAGS=['-std=gnu++98']) - env.Append(LIBS=['winmm', 'gdi32']) - env.Append(CPPDEFINES=["WIN"]) - env.Append(LINKFLAGS=['-mwindows']) - if(GetOption('_64bit')): - env.Append(CPPDEFINES=['__CRT__NO_INLINE']) - env.Append(LINKFLAGS=['-Wl,--stack=16777216']) -if(GetOption('lin')): - if(GetOption('opengl')): - env.ParseConfig('pkg-config --libs glew gl glu') - openGLLibs = ['GL'] - env.Append(LIBS=['X11', 'rt']) - env.Append(CPPDEFINES=["LIN"]) - if GetOption('_64bit'): - env.Append(LINKFLAGS=['-m64']) - env.Append(CCFLAGS=['-m64']) - else: - env.Append(LINKFLAGS=['-m32']) - env.Append(CCFLAGS=['-m32']) -if(GetOption('macosx')): - env.Append(CPPDEFINES=["MACOSX"]) - env.Append(CCFLAGS=['-I/Library/Frameworks/SDL.framework/Headers']) - env.Append(CCFLAGS=['-I/Library/Frameworks/Lua.framework/Headers']) - env.Append(LINKFLAGS=['-lfftw3f']) - env.Append(LINKFLAGS=['-framework']) - env.Append(LINKFLAGS=['SDL']) - env.Append(LINKFLAGS=['-framework']) - env.Append(LINKFLAGS=['Lua']) - env.Append(LINKFLAGS=['-framework']); - env.Append(LINKFLAGS=['Cocoa']) - #env.Append(LINKFLAGS=['-framework SDL']) - #env.Append(LINKFLAGS=['-framework Lua']) - #env.Append(LINKFLAGS=['-framework Cocoa']) - if GetOption('_64bit'): - env.Append(LINKFLAGS=['-m64']) - env.Append(CCFLAGS=['-m64']) - else: - env.Append(LINKFLAGS=['-m32']) - env.Append(CCFLAGS=['-m32']) - -if GetOption('_64bit'): - env.Append(CPPDEFINES=["_64BIT"]) - -if(GetOption('beta')): - env.Append(CPPDEFINES='BETA') - - -if(not GetOption('snapshot') and not GetOption('beta') and not GetOption('release') and not GetOption('stable')): - env.Append(CPPDEFINES='SNAPSHOT_ID=0') - env.Append(CPPDEFINES='SNAPSHOT') -elif(GetOption('snapshot') or GetOption('snapshot-id')): - if(GetOption('snapshot-id')): - env.Append(CPPDEFINES=['SNAPSHOT_ID=' + GetOption('snapshot-id')]) - else: - env.Append(CPPDEFINES=['SNAPSHOT_ID=' + str(int(time.time()))]) - env.Append(CPPDEFINES='SNAPSHOT') -elif(GetOption('stable')): - env.Append(CPPDEFINES='STABLE') - -if(GetOption('save-version')): - env.Append(CPPDEFINES=['SAVE_VERSION=' + GetOption('save-version')]) - -if(GetOption('minor-version')): - env.Append(CPPDEFINES=['MINOR_VERSION=' + GetOption('minor-version')]) - -if(GetOption('build-number')): - env.Append(CPPDEFINES=['BUILD_NUM=' + GetOption('build-number')]) - -if(GetOption('x86')): - env.Append(CPPDEFINES='X86') - -if(GetOption('debug')): - env.Append(CPPDEFINES='DEBUG') - env.Append(CCFLAGS='-g') - -if(GetOption('sse')): - env.Append(CCFLAGS='-msse') - env.Append(CPPDEFINES='X86_SSE') - -if(GetOption('sse2')): - env.Append(CCFLAGS='-msse2') - env.Append(CPPDEFINES='X86_SSE2') - -if(GetOption('sse3')): - env.Append(CCFLAGS='-msse3') - env.Append(CPPDEFINES='X86_SSE3') - -if(GetOption('opengl')): - env.Append(CPPDEFINES=["OGLI", "PIX32OGL"]) - env.Append(LIBS=openGLLibs) - -if(GetOption('opengl') and GetOption('opengl-renderer')): - env.Append(CPPDEFINES=["OGLR"]) -elif(GetOption('opengl-renderer')): - print "opengl-renderer requires opengl" - raise SystemExit(1) - -sources=Glob("src/*.cpp") -if(GetOption('macosx')): - sources +=["SDLMain.m"] -if(GetOption('win')): - sources += env.RES('resources/powder-res.rc') -sources+=Glob("src/*/*.cpp") -sources+=Glob("src/simulation/elements/*.cpp") -sources+=Glob("src/simulation/tools/*.cpp") -sources+=Glob("src/client/requestbroker/*.cpp") - -#for source in sources: -# print str(source) - -if(GetOption('win')): - sources = filter(lambda source: not 'src\\simulation\\Gravity.cpp' in str(source), sources) - sources = filter(lambda source: not 'src/simulation/Gravity.cpp' in str(source), sources) - -SetupSpawn(env) - -programName = "powder" - -if(GetOption('renderer')): - programName = "render" - -if(GetOption('win')): - if(GetOption('renderer')): - programName = "Render" - else: - programName = "Powder" - -if(GetOption('_64bit')): - programName += "64" - -if(not (GetOption('sse2') or GetOption('sse3'))): - programName += "-legacy" - -if(GetOption('macosx')): - programName += "-x" - -if(GetOption('win')): - programName += ".exe" - -if(GetOption('release')): - if GetOption('macosx'): - env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer']) - else: - env.Append(CCFLAGS=['-O3', '-ftree-vectorize', '-funsafe-math-optimizations', '-ffast-math', '-fomit-frame-pointer', '-funsafe-loop-optimizations', '-Wunsafe-loop-optimizations']) - - -if(GetOption('pythonver')): - pythonVer = GetOption('pythonver') -elif(GetOption('lin')): - pythonVer = "python2" -else: - pythonVer = "python" - -if(GetOption('win')): - envCopy = env.Clone() - envCopy.Append(CCFLAGS=['-mincoming-stack-boundary=2']) - sources+=envCopy.Object('src/simulation/Gravity.cpp') - -env.Command(['generated/ElementClasses.cpp', 'generated/ElementClasses.h'], Glob('src/simulation/elements/*.cpp'), pythonVer + " generator.py elements $TARGETS $SOURCES") -sources+=Glob("generated/ElementClasses.cpp") - -env.Command(['generated/ToolClasses.cpp', 'generated/ToolClasses.h'], Glob('src/simulation/tools/*.cpp'), pythonVer + " generator.py tools $TARGETS $SOURCES") -sources+=Glob("generated/ToolClasses.cpp") - -env.Decider('MD5') -t=env.Program(target=programName, source=sources) -Default(t) diff --git a/SConstruct b/SConstruct deleted file mode 100644 index 81456fde4..000000000 --- a/SConstruct +++ /dev/null @@ -1,2 +0,0 @@ -AddOption('--builddir',dest="builddir",default="build",help="Directory to build to.") -SConscript('SConscript', variant_dir=GetOption('builddir'), duplicate=0) diff --git a/site_scons/site_tools/gch/__init__.py b/site_scons/site_tools/gch/__init__.py deleted file mode 100644 index 31d2e5ecd..000000000 --- a/site_scons/site_tools/gch/__init__.py +++ /dev/null @@ -1,126 +0,0 @@ -# -# SCons builder for gcc's precompiled headers -# Copyright (C) 2006 Tim Blechmann -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# 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; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -# 1.1 -# -# 09-11-2011 Pedro Larroy: Fixed dependency emitter not working with variant dir -# -# - - -import SCons.Action -import SCons.Builder -import SCons.Scanner.C -import SCons.Util -import SCons.Script -import os - -SCons.Script.EnsureSConsVersion(0,96,92) - -GchAction = SCons.Action.Action('$GCHCOM', '$GCHCOMSTR') -GchShAction = SCons.Action.Action('$GCHSHCOM', '$GCHSHCOMSTR') - -def gen_suffix(env, sources): - return sources[0].get_suffix() + env['GCHSUFFIX'] - -GchShBuilder = SCons.Builder.Builder(action = GchShAction, - source_scanner = SCons.Scanner.C.CScanner(), - suffix = gen_suffix) - -GchBuilder = SCons.Builder.Builder(action = GchAction, - source_scanner = SCons.Scanner.C.CScanner(), - suffix = gen_suffix) - -def header_path(node): - h_path = node.abspath - idx = h_path.rfind('.gch') - if idx != -1: - h_path = h_path[0:idx] - if not os.path.isfile(h_path): - raise SCons.Errors.StopError("can't find header file: {0}".format(h_path)) - return h_path - - else: - raise SCons.Errors.StopError("{0} file doesn't have .gch extension".format(h_path)) - - -def static_pch_emitter(target,source,env): - SCons.Defaults.StaticObjectEmitter( target, source, env ) - scanner = SCons.Scanner.C.CScanner() - path = scanner.path(env) - - deps = scanner(source[0], env, path) - if env.get('Gch'): - h_path = header_path(env['Gch']) - if h_path in [x.abspath for x in deps]: - #print 'Found dep. on pch: ', target[0], ' -> ', env['Gch'] - env.Depends(target, env['Gch']) - - return (target, source) - -def shared_pch_emitter(target,source,env): - SCons.Defaults.SharedObjectEmitter( target, source, env ) - - scanner = SCons.Scanner.C.CScanner() - path = scanner.path(env) - deps = scanner(source[0], env, path) - - if env.get('GchSh'): - h_path = header_path(env['GchSh']) - if h_path in [x.abspath for x in deps]: - #print 'Found dep. on pch (shared): ', target[0], ' -> ', env['Gch'] - env.Depends(target, env['GchSh']) - - return (target, source) - -def generate(env): - """ - Add builders and construction variables for the Gch builder. - """ - env.Append(BUILDERS = { - 'gch': env.Builder( - action = GchAction, - target_factory = env.fs.File, - ), - 'gchsh': env.Builder( - action = GchShAction, - target_factory = env.fs.File, - ), - }) - - try: - bld = env['BUILDERS']['Gch'] - bldsh = env['BUILDERS']['GchSh'] - except KeyError: - bld = GchBuilder - bldsh = GchShBuilder - env['BUILDERS']['Gch'] = bld - env['BUILDERS']['GchSh'] = bldsh - - env['GCHCOM'] = '$CXX -Wall -o $TARGET -x c++-header -c $CXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCE' - env['GCHSHCOM'] = '$CXX -o $TARGET -x c++-header -c $SHCXXFLAGS $CCFLAGS $_CCCOMCOM $SOURCE' - env['GCHSUFFIX'] = '.gch' - - for suffix in SCons.Util.Split('.c .C .cc .cxx .cpp .c++'): - env['BUILDERS']['StaticObject'].add_emitter( suffix, static_pch_emitter ) - env['BUILDERS']['SharedObject'].add_emitter( suffix, shared_pch_emitter ) - - -def exists(env): - return env.Detect('g++') diff --git a/site_scons/site_tools/gch/__init__.pyc b/site_scons/site_tools/gch/__init__.pyc deleted file mode 100644 index 827f6e7650a77f865ca013ed0c2f556e6720cbbe..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3815 zcmds4-EtdM67Ctva^zUH6B2`2U?;4%qFt3G3W`)gxd0>ENp?d*%_N&t3Ra9~#?~mZ zB<38uoWj1r`!MY7zRuq4JMaMTeSOBZ!UeS#_y$SS)2C0L-~ReXl^+{(|7-o_%S6i0 zEZ(2tF>iSyDSn;|MV@O}_@GEK(*!F@%sp_O{&+v@49wxM zu$?c9@m>+{@8_evPPf(S*omD?IwrSS&m`lKajYGWho-Za^gF#?KFV#c*PgsAmmihO z-{ykcf_SzD8Yea%kL&`)x(`ekk49Ocy>811kHH=D=~5FA;PG(}Cmt_lp!ag>$%!w= z0G2N=DpF*6UlmGjLC^X!sK}s7DO61?c18v@;xVlfl1`4U?>!mmWk(kpP<>Sc9uYNp zgomaI+QzvR0}2822Z(Tx+cwzEM`_T{;xsG353`Sh@7_BxtLVpDB|$pQ3|0H_VHR+r zAUm?z$lzw0G^m;>-Z7Kd_OT<8f|KGrB4cB@y7q80x#1eB6m?-4y~eGg7#Bvd5!vxX zo7%BEF7{)q_|a)b<22KbeotrQh3DzfWkKUArgt}^%e{}LSppHS?k#%rUcfR*j_cC|rPbp=Wc*{V*>4!I=8U6{xJOEkk zK6@6dJ&lLMU~L?%KHdoLZaogxj)J7sS}SwoS`tug`@zQD2wb;hdfhIHC;Wod=+Tp~ zyQKlEEUE6D&;4t&qQd%r<|V*bI%z#d#4!_xc#ENjwUeOT4cZA_$XFX3svV)2-LhKpY%qx;w>QjH^A4(`Ewq={)+d8moP~1;q_^d zU`BuB%dmkDeYp>OEl`*s6W@eFIwXFxgtP^sr>?k+ZoPaA!;3k3P@WNuP z?TqZ~#uI1>*FLi^QRF0Lx^H*2x^^{DW40DIF4@tDdIEPQTPT40Q7q_U~Z~KpeU|HWErw7CA6XrSn h>oSjevHbeW{!Q 1: - #Looks like the user specified many sources and SCons created 1 target - #targets are implicit, but the builder doesn't know how to handle - #suffixes for multiple target files, so we'll do it here - objdir = env.get('OBJDIR', '') - #target = [os.path.join( - # objdir, - # os.path.splitext( - # os.path.basename(str(i)))[0] + '.o' ) for i in source] - elif len(source) == 1 and 'OBJDIR' in env: - target = os.path.join( - env['OBJDIR'], - os.path.splitext( - os.path.basename(str(source[0])))[0] + '.o' ) - else: - #targets are explicit, we need to check their validity - tgt_names = [os.path.splitext( - os.path.basename(str(i)))[0] for i in target] - src_names = [os.path.splitext( - os.path.basename(str(i)))[0] for i in source] - tgt_dirs = [os.path.dirname(str(i)) for i in target] - if sorted(tgt_names) != sorted(src_names): - raise ValueError, "target files do not have obvious one-one relationship to source files" - if len(set(src_names)) != len(src_names): - raise ValueError, "source files may not include identically named files in different directories" - if len(set(tgt_dirs)) != 1: - raise ValueError, "Target files must all be in same directory" - - for t in target: - env.Precious(t) - return target, source - -def MFProgramGenerator(source, target, env, for_signature): - #Rebuild everything if - # a) the number of dependencies has changed - # b) any target does not exist - # c) the build command has changed - #Else rebuild only those c files that have changed_since_last_build - #The signature of this builder should always be the same, because the - #multifile compile is always functionally equivalent to rebuilding - #everything - - if for_signature: - pared_sources = source - else: - #First a sanity check - assert len(set([os.path.splitext(str(i))[1] for i in source])) == 1, \ - "All source files must have the same extension." - pared_sources = [] - src_names = [os.path.splitext(os.path.basename(str(i)))[0] - for i in source] - tgt_names = [os.path.splitext(os.path.basename(str(t)))[0] - for t in target] - ni = target[0].get_binfo() - oi = target[0].get_stored_info().binfo - if ni.bactsig != oi.bactsig: - #Command line has changed - pared_sources = source - else: - for i in range(len(tgt_names)): - t = target[i] - tgt_name = tgt_names[i] - if not t.exists(): - #a target does not exist - pared_sources = source - break - bi = t.get_stored_info().binfo - then = bi.bsourcesigs + bi.bdependsigs + bi.bimplicitsigs - children = t.children() - if len(children) != len(then): - #the number of dependencies has changed - pared_sources = source - break - for child, prev_ni in zip(children, then): - if child.changed_since_last_build(t, prev_ni) and \ - not t in pared_sources: - #If child is a source file, not an explicit or implicit - #dependency, then it is not truly a dependency of any target - #except that with the same basename. This is a limitation - #of SCons.node, which assumes that all sources of a Node - #are dependencies of all targets. So we check for that case - #here and only rebuild as necessary. - src_name = os.path.splitext(os.path.basename(str(child)))[0] - if src_name not in tgt_names or src_name == tgt_name: - s = source[src_names.index(tgt_name)] - pared_sources.append(s) - assert len(pared_sources) > 0 - destdir = str(target[0].dir) - #finding sconscript_dir is a bit of a hack. It assumes that the source - #files are always going to be in the same directory as the SConscript file - #which is not necessarily true. BUG BY Alan Somers - sconscript_dir = os.path.dirname(str(pared_sources[0])) - prefixed_sources = [relpath(str(i), destdir) for i in pared_sources] - prefixed_sources_str = ' '.join([str(i) for i in prefixed_sources]) - lang_ext = os.path.splitext(prefixed_sources[0])[1] - tgt_names2 = [os.path.splitext(os.path.basename(str(t)))[0] - for t in target] - - _CPPPATH = [] - if 'CPPPATH' in env: - for i in env['CPPPATH']: - #if i[0] == '#': - ##_CPPPATH.append(relpath(i[1:], destdir)) - _CPPPATH.append(i) - #else: - # _CPPPATH.append(relpath(os.path.join(sconscript_dir, i), - # destdir)) - - defines = "" - for t in env['CPPDEFINES']: - defines += ("-D"+str(t)+" ") - - _CPPINCFLAGS = ['-I' + i for i in _CPPPATH] - _CCOMCOM = '$CPPFLAGS $_CPPDEFFLAGS $defines %s' % ' '.join(_CPPINCFLAGS) - - libstr = "" - for t in env['LIBS']: - libstr += ("-l"+t+" ") - - if lang_ext == '.c' : - _CCCOM = 'cd %s && $CC $CFLAGS $CCFLAGS %s %s $LINKFLAGS %s -o %s' % \ - (destdir, _CCOMCOM, prefixed_sources_str, libstr, tgt_names2[0]) - #XXX BUG BY Alan Somers. $CCCOMSTR gets substituted using the full list of target files, - #not prefixed_sources - cmd = SCons.Script.Action(env.subst(_CCCOM), "$CCCOMSTR") - elif lang_ext in ['.cc', '.cpp']: - _CXXCOM = 'cd %s && $CXX $CXXFLAGS $CCFLAGS %s %s $LINKFLAGS %s -o %s' % \ - (destdir, _CCOMCOM, prefixed_sources_str, libstr, tgt_names2[0]) - cmd = SCons.Script.Action(env.subst(_CXXCOM), "$CXXCOMSTR") - else: - assert False, "Unknown source file extension %s" % lang_ext - return cmd - -def generate(env): - """Adds the MFObject builder to your environment""" - MFProgramBld = env.Builder(generator = MFProgramGenerator, - emitter = MFProgramEmitter, - suffix = '.o', - source_scanner=SCons.Tool.SourceFileScanner) - MFProgramBld.get_single_executor = new.instancemethod(MF_get_single_executor, - MFProgramBld, MFProgramBld.__class__) - - env.Append(BUILDERS = {'MFProgram': MFProgramBld}) \ No newline at end of file diff --git a/site_scons/site_tools/mfprogram/__init__.pyc b/site_scons/site_tools/mfprogram/__init__.pyc deleted file mode 100644 index b31c41db0eab628f4aadb5c755a7f78778493dbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7378 zcmcIpTXP&o74Dv0t+cXaNmeXbzK&xj*~GTQrO1VZfUHXp*os&=k>kYKjAlmCtafKs z(<51?cB?4N3sn@w4}b>>9-)c~6i`&5{JV?h}l^pVs8np@F! z=;n*L>${ojJ@C@dO*Y)sxg<8OpTv7%oJC0ttW7TsqIlDN;mQkc6uV?F_S&Hl-m#!k zS0c8{HL_dBqcSp|n2Z48OQ)Gcag76635`j8*>Vt?EQrz?KuQ|3jNZ&v(hg^uX0MfI zGb?GbnR@Lun3$Qnc5No>WS!28iL$U^z^Sp_EJ<2sroGXz*fWhr6h~R3G2MBX4RS%h zk?;6b^^WIi;ac-(BI9H^g!*nshfDrB$^N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odmL&jx`MmEGHmZ?89TU$A8o7Q_?xA#~YA2`x&KxD7MR zy+JNNIls{6zH+=~cLS=HUx%zdiZK+`JkgDt?=0P#U#PDNt%E~Zu89|-2gwUL^%nZ| zH`)9EjabGV`~V?!#8siYh${c8Efk7Q#o+^4HHuBh_0)Ry zJ@iB#=Ap5&;|}nX1_Q15Z2Jomg`Jpb7HsS6%kdOHu1J|nL?;g19)uhTE#^=J(mRfd m7Ul4UEo{C?=V{ms!E%P2AxLA~87)<-=U=Q=s-^0))$qT=Yi#}i diff --git a/site_scons/site_tools/mfprogram/relpath.py b/site_scons/site_tools/mfprogram/relpath.py deleted file mode 100644 index 59e19710f..000000000 --- a/site_scons/site_tools/mfprogram/relpath.py +++ /dev/null @@ -1,73 +0,0 @@ -#PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 -#-------------------------------------------- -# -#1. This LICENSE AGREEMENT is between the Python Software Foundation -#("PSF"), and the Individual or Organization ("Licensee") accessing and -#otherwise using this software ("Python") in source or binary form and -#its associated documentation. -# -#2. Subject to the terms and conditions of this License Agreement, PSF hereby -#grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, -#analyze, test, perform and/or display publicly, prepare derivative works, -#distribute, and otherwise use Python alone or in any derivative version, -#provided, however, that PSF's License Agreement and PSF's notice of copyright, -#i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -#Python Software Foundation; All Rights Reserved" are retained in Python alone or -#in any derivative version prepared by Licensee. -# -#3. In the event Licensee prepares a derivative work that is based on -#or incorporates Python or any part thereof, and wants to make -#the derivative work available to others as provided herein, then -#Licensee hereby agrees to include in any such work a brief summary of -#the changes made to Python. -# -#4. PSF is making Python available to Licensee on an "AS IS" -#basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -#IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND -#DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -#FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT -#INFRINGE ANY THIRD PARTY RIGHTS. -# -#5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -#FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -#A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, -#OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. -# -#6. This License Agreement will automatically terminate upon a material -#breach of its terms and conditions. -# -#7. Nothing in this License Agreement shall be deemed to create any -#relationship of agency, partnership, or joint venture between PSF and -#Licensee. This License Agreement does not grant permission to use PSF -#trademarks or trade name in a trademark sense to endorse or promote -#products or services of Licensee, or any third party. -# -#8. By copying, installing or otherwise using Python, Licensee -#agrees to be bound by the terms and conditions of this License -#Agreement. - - - -# Changelog: -# 3-12-2010 Alan Somers Copied verbatim from posixpath.py in Python 2.6.4 - - - -from os.path import * - -def relpath(path, start=curdir): - """Return a relative version of a path""" - - if not path: - raise ValueError("no path specified") - - start_list = abspath(start).split(sep) - path_list = abspath(path).split(sep) - - # Work out how much of the filepath is shared by start and path. - i = len(commonprefix([start_list, path_list])) - - rel_list = [pardir] * (len(start_list)-i) + path_list[i:] - if not rel_list: - return curdir - return join(*rel_list) \ No newline at end of file