summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2017-07-23 20:10:22 +0100
committerDaniel Silverstone <dsilvers@digital-scurf.org>2017-07-23 20:10:22 +0100
commit38dfc0477f228d06d952528c91a59a31940b95d7 (patch)
tree819c174384b9a9944b2194105556d92ab17e62f1
parent43b72e84b40d68efe1d8395c31d5ab83f58501c7 (diff)
downloadsupple-38dfc0477f228d06d952528c91a59a31940b95d7.tar.gz
Remove supple_paths.h because it was confusing dh-lua
Sadly, the approach Richard took to introduce supple_paths.h broke the Debian packaging because dh-lua doesn't use the Makefile. I looked at ways to use it, but because dh-lua builds for all the versions of Lua at once, it can't easily work as-is. Trying to add support for the different Lua versions in Makefile turned out to be a pain, so instead I merged the defines support into the rest of the defines we use. It's less elegant but should be equivalent.
-rw-r--r--Makefile11
-rw-r--r--src/supple_paths.h.in3
-rw-r--r--src/wrapper.c2
3 files changed, 5 insertions, 11 deletions
diff --git a/Makefile b/Makefile
index 8f6533e..99a4f76 100644
--- a/Makefile
+++ b/Makefile
@@ -32,8 +32,8 @@ LUA_INTERP_PATH := $(shell which lua$(LUA_VER))
# to bake LUA_PATH and LUA_CPATH environment variables into the sandbox binary.
# They can't be set at runtime for security reasons.
BAKE_SUPPLE_PATHS := 0
-SUPPLE_LUA_PATH := ""
-SUPPLE_LUA_CPATH := ""
+SUPPLE_LUA_PATH :=
+SUPPLE_LUA_CPATH :=
ifeq ($(BAKE_SUPPLE_PATHS), 1)
DEF_BAKE_SUPPLE_PATHS=-DBAKE_SUPPLE_PATHS
@@ -46,6 +46,8 @@ OPT := -O0 -g
WARN := -Wall -Werror
DEFS := -D'LUA_INTERP_NAME="$(LUA_INTERP_NAME)"' \
-D'LUA_INTERP_PATH="$(LUA_INTERP_PATH)"' \
+ -D'SUPPLE_LUA_PATH="$(SUPPLE_LUA_PATH)"' \
+ -D'SUPPLE_LUA_CPATH="$(SUPPLE_LUA_CPATH)"' \
-D'WRAPPER_PATH="$(WRAPPER_PATH)"' $(DEF_BAKE_SUPPLE_PATHS)
CFLAGS := $(INCS) $(OPT) $(WARN) $(DEFS) $(CFLAGS)
@@ -59,10 +61,7 @@ LFLAGS := -O1 -g $(LFLAGS)
build: $(CMOD_TARGETS) wrapper
-src/supple_paths.h: src/supple_paths.h.in
- sed -e 's|@@SUPPLE_LUA_PATH@@|$(SUPPLE_LUA_PATH)|' -e 's|@@SUPPLE_LUA_CPATH@@|$(SUPPLE_LUA_CPATH)|' < $< > $@
-
-wrapper: src/wrapper.c src/supple_paths.h
+wrapper: src/wrapper.c
$(CC) $(LFLAGS) $(CFLAGS) -o $@ $< $(LIB_LUA)
testwrapper: src/wrapper.c
diff --git a/src/supple_paths.h.in b/src/supple_paths.h.in
deleted file mode 100644
index 7ed0b0b..0000000
--- a/src/supple_paths.h.in
+++ /dev/null
@@ -1,3 +0,0 @@
-
-#define SUPPLE_LUA_PATH "@@SUPPLE_LUA_PATH@@"
-#define SUPPLE_LUA_CPATH "@@SUPPLE_LUA_CPATH@@"
diff --git a/src/wrapper.c b/src/wrapper.c
index c7ed535..a8a33da 100644
--- a/src/wrapper.c
+++ b/src/wrapper.c
@@ -18,8 +18,6 @@
#include <stdlib.h>
#include <stdio.h>
-#include "supple_paths.h"
-
typedef struct {
int retcode;
} prot_args;