diff options
author | Cem Keylan <cem@ckyln.com> | 2021-04-01 14:52:14 +0300 |
---|---|---|
committer | Cem Keylan <cem@ckyln.com> | 2021-04-01 14:52:14 +0300 |
commit | f2baa0686f9688c9896a967757ba13af2ab14497 (patch) | |
tree | 81d7b06dbf524e307069cd009075b9e7bd4a153c /extra/bearssl/build | |
parent | 11a05be4ac3bb1271762b1de1336124e7f7883e9 (diff) | |
download | repository-f2baa0686f9688c9896a967757ba13af2ab14497.tar.gz |
bearssl: move to extra
Diffstat (limited to 'extra/bearssl/build')
-rwxr-xr-x | extra/bearssl/build | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/extra/bearssl/build b/extra/bearssl/build new file mode 100755 index 00000000..c0e5e7f2 --- /dev/null +++ b/extra/bearssl/build @@ -0,0 +1,27 @@ +#!/bin/sh -e + +for patch in *.patch; do + patch -p1 < "$patch" +done + +kinstall() { + mkdir -p "${3%/*}"; cp "$2" "$3" + chmod "$1" "$3" +} + +make "CC=${CC:=cc}" "AR=${AR:=ar}" LD=$CC + +# Build static binary for bearssl, word splitting on CFLAGS is intentional. +# shellcheck disable=2086 +"$CC" -static $CFLAGS \ + -I ./inc \ + -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" |