aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kramkowski <tk@the-tk.com>2021-08-06 17:18:20 +0100
committerTomasz Kramkowski <tk@the-tk.com>2021-08-06 17:18:20 +0100
commit0d86d7df3cf62ed0a010197f2963842311b0a4b8 (patch)
tree786c4d2a23652ebf63ee5affe88cf7e41221794a
parent98e18c714bf1668e9c041f1be4abcab548f22294 (diff)
downloadpack-0d86d7df3cf62ed0a010197f2963842311b0a4b8.tar.gz
pack-0d86d7df3cf62ed0a010197f2963842311b0a4b8.tar.xz
pack-0d86d7df3cf62ed0a010197f2963842311b0a4b8.zip
make do-link executable from /usr/bin/env
On openbsd the script interpreter of an interpreter script can't be an interpreter script (script(7)) so do-link must be ran with /usr/bin/env which means the type parameter needs to be a variable set in the do file.
-rwxr-xr-xdo-link5
-rwxr-xr-xlibpack.do3
-rwxr-xr-xtest.do3
-rwxr-xr-xtest_gen.do3
4 files changed, 8 insertions, 6 deletions
diff --git a/do-link b/do-link
index 189e899..76ca11b 100755
--- a/do-link
+++ b/do-link
@@ -1,8 +1,7 @@
#!/usr/bin/env bash
set -e
-type=$1
-. "$2" # .do file which we are "interpreting"
+. "$1" # .do file which we are "interpreting"
redo-ifchange "$0" "link-$type.tool" "${objects[@]}"
-shift 2
+shift
. "./link-$type.tool"
"${cmd[@]}"
diff --git a/libpack.do b/libpack.do
index 9fa753d..8cd27f6 100755
--- a/libpack.do
+++ b/libpack.do
@@ -1,2 +1,3 @@
-#!./do-link library
+#!/usr/bin/env ./do-link
+type=library
objects=(common.o pack.o trace.o unpack.o ieee754b.o)
diff --git a/test.do b/test.do
index 5ebdb6e..9b8f93b 100755
--- a/test.do
+++ b/test.do
@@ -1,2 +1,3 @@
-#!./do-link executable
+#!/usr/bin/env ./do-link
+type=executable
objects=(common.o pack.o test.o trace.o unpack.o ieee754b.o)
diff --git a/test_gen.do b/test_gen.do
index cffe9df..b4b480a 100755
--- a/test_gen.do
+++ b/test_gen.do
@@ -1,2 +1,3 @@
-#!./do-link executable-host
+#!/usr/bin/env ./do-link
+type=executable-host
objects=(test_gen.o)