summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2016-10-17 12:43:53 +0900
committerDaniel Silverstone <dsilvers@digital-scurf.org>2016-10-17 12:43:53 +0900
commitda6230a7fb557b928e538b49ce1b53ecbe5deb84 (patch)
treead01ccd7d6ce0b1f50e0b990c8d37d130e6faeac
parent9bf3cd359f67dc3caea0cf6f493fc01672cc42c4 (diff)
downloadsupple-da6230a7fb557b928e538b49ce1b53ecbe5deb84.tar.gz
Move wrapper path from supple.host into supple.capiv1.0.7
-rw-r--r--Makefile5
-rw-r--r--lib/supple/capi.c2
-rw-r--r--lib/supple/host.lua2
3 files changed, 6 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index adaff8f..47530df 100644
--- a/Makefile
+++ b/Makefile
@@ -31,7 +31,8 @@ INCS := -I/usr/include/lua$(LUA_VER)
OPT := -O0 -g
WARN := -Wall -Werror
DEFS := -D'LUA_INTERP_NAME="$(LUA_INTERP_NAME)"' \
- -D'LUA_INTERP_PATH="$(LUA_INTERP_PATH)"'
+ -D'LUA_INTERP_PATH="$(LUA_INTERP_PATH)"' \
+ -D'WRAPPER_PATH="$(WRAPPER_PATH)"'
CFLAGS := $(INCS) $(OPT) $(WARN) $(DEFS) $(CFLAGS)
LFLAGS := -O1 -g $(LFLAGS)
@@ -51,7 +52,7 @@ testwrapper: src/wrapper.c
-chown root:root $@ && chmod u+s $@
ls -l $@
-COPY_LMOD := sed -e's!@@WRAPPER_BIN@@!$(WRAPPER_PATH)!g;/START_TEST_SUPPLE/,/END_TEST_SUPPLE/d'
+COPY_LMOD := sed -e'/START_TEST_SUPPLE/,/END_TEST_SUPPLE/d'
install: build
mkdir -p $(LINST_ROOT)/supple
diff --git a/lib/supple/capi.c b/lib/supple/capi.c
index e12521d..8d724ca 100644
--- a/lib/supple/capi.c
+++ b/lib/supple/capi.c
@@ -463,5 +463,7 @@ luaopen_supple_capi(lua_State *L)
lua_pushcclosure(L, supple_capi_next, 0);
lua_pushcclosure(L, supple_capi_pairs, 1);
lua_setfield(L, -2, "pairs");
+ lua_pushliteral(L, WRAPPER_PATH);
+ lua_setfield(L, -2, "wrapper_path");
return 1;
}
diff --git a/lib/supple/host.lua b/lib/supple/host.lua
index 8cab3f7..967bb15 100644
--- a/lib/supple/host.lua
+++ b/lib/supple/host.lua
@@ -56,7 +56,7 @@ local function simplify(t, memo)
end
local function run_wrapper()
- local wrapperpath = "@@WRAPPER_BIN@@"
+ local wrapperpath = capi.wrapper_path
-- START_TEST_SUPPLE
wrapperpath = os.getenv "SUPPLE_TEST_WRAPPER"
-- END_TEST_SUPPLE