aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCem Keylan <cem@ckyln.com>2020-06-12 10:52:55 +0300
committerCem Keylan <cem@ckyln.com>2020-06-12 10:52:55 +0300
commit7a3aa7ad7a13c769c09f1ce043343c0ebec41e25 (patch)
treef4a06be7b8f6ad56eac04a5aa5c553883567a938
parent0356c23f80d7e086396f411f57ea33e30870d04b (diff)
downloadrepository-7a3aa7ad7a13c769c09f1ce043343c0ebec41e25.tar.gz
bearssl: link binary statically
-rwxr-xr-xcore/bearssl/build21
-rw-r--r--core/bearssl/version2
2 files changed, 19 insertions, 4 deletions
diff --git a/core/bearssl/build b/core/bearssl/build
index 6eac3f50..88cfba4f 100755
--- a/core/bearssl/build
+++ b/core/bearssl/build
@@ -1,9 +1,24 @@
#!/bin/sh -e
+kinstall() {
+ mkdir -p "${3%/*}"; cp "$2" "$3"
+ chmod "$1" "$3"
+}
+
make
-install -Dm755 build/brssl "$1/usr/bin/brssl"
-install -Dm644 build/libbearssl.a "$1/usr/lib/libbearssl.a"
-install -Dm644 build/libbearssl.so "$1/usr/lib/libbearssl.so"
+# Build static binary for bearssl, word splitting on CFLAGS is intentional.
+# shellcheck disable=2086
+"${CC:-cc}" \
+ -static $CFLAGS \
+ -include tools/brssl.h \
+ tools/*.c \
+ build/libbearssl.a \
+ -o brssl
+
+
+kinstall 755 brssl "$1/usr/bin/brssl"
+kinstall 644 build/libbearssl.a "$1/usr/lib/libbearssl.a"
+kinstall 755 build/libbearssl.so "$1/usr/lib/libbearssl.so"
mv inc "$1/usr/include"
diff --git a/core/bearssl/version b/core/bearssl/version
index 424287d7..28c26d58 100644
--- a/core/bearssl/version
+++ b/core/bearssl/version
@@ -1 +1 @@
-0.6 1
+0.6 2