summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-12-28 16:13:08 (GMT)
committerRemko Tronçon <git@el-tramo.be>2014-01-03 11:09:06 (GMT)
commit0b19dc7292b7672c9fbb711a411c392bc5b2bb34 (patch)
treed5af147193d52a3e63d348dd794ca92cdd934974 /Sluift/SConscript
parent5a89265623214164fa7ce36721de05183d53058d (diff)
downloadswift-contrib-0b19dc7292b7672c9fbb711a411c392bc5b2bb34.zip
swift-contrib-0b19dc7292b7672c9fbb711a411c392bc5b2bb34.tar.bz2
Sluift: Custom console/interpreter
- Prints results of each command (if it can be interpreted as an expression) - Stores results of last command in _1, _2, ... - Supports tab completion - Compatible with Lua 5.2 Other changes: - Add support for specifying custom editline library - Don't load sluift into global namespace. Tab completion should be convenient enough. Change-Id: I2a26346469d67c281d09d47cacaa0b267f5ea9f9
Diffstat (limited to 'Sluift/SConscript')
-rw-r--r--Sluift/SConscript24
1 files changed, 4 insertions, 20 deletions
diff --git a/Sluift/SConscript b/Sluift/SConscript
index c8f1108..116c5f1 100644
--- a/Sluift/SConscript
+++ b/Sluift/SConscript
@@ -47,22 +47,10 @@ elif env["SCONS_STAGE"] == "build" :
if sluift_env["PLATFORM"] == "win32" :
sluift_env.Append(CPPDEFINES = ["SLUIFT_BUILD_DLL"])
- # Generate a customized lua.c
- sluift_env["SLUIFT_VERSION"] = Version.getBuildVersion(env.Dir("#").abspath, "sluift")
- def patchLua(env, target, source) :
- f = open(source[0].abspath, "r")
- contents = f.read()
- f.close()
- if env["PLATFORM"] == "win32" :
- key = "Z"
- else :
- key = "D"
- contents = contents.replace("LUA_RELEASE", "\"== Sluift XMPP Console (%(version)s) == \\nPress Ctrl-%(key)s to exit\"" % {"version": source[1].get_contents(), "key" : key})
- contents = contents.replace("LUA_COPYRIGHT", "")
- f = open(target[0].abspath, "w")
- f.write(contents)
- f.close()
- sluift_env.Command("lua.c", ["#/3rdParty/Lua/src/lua.c", sluift_env.Value(sluift_env["SLUIFT_VERSION"])], env.Action(patchLua, cmdstr = "$GENCOMSTR"))
+ # Generate Version.h
+ version_header = "#pragma once\n\n"
+ version_header += "#define SLUIFT_VERSION_STRING \"" + Version.getBuildVersion(env.Dir("#").abspath, "sluift") + "\"\n"
+ sluift_env.WriteVal("Version.h", sluift_env.Value(version_header))
# Generate core.cpp
def generate_embedded_lua(env, target, source) :
@@ -74,10 +62,6 @@ elif env["SCONS_STAGE"] == "build" :
f.close()
sluift_env.Command("core.c", ["core.lua"], env.Action(generate_embedded_lua, cmdstr="$GENCOMSTR"))
- if sluift_env.get("HAVE_READLINE", False) :
- sluift_env.Append(CPPDEFINES = ["LUA_USE_READLINE"])
- sluift_env.MergeFlags(sluift_env["READLINE_FLAGS"])
-
sluift_env.WriteVal("dll.c", sluift_env.Value(""))
sluift_sources = [env.File(x) for x in sluift_sources]