aboutsummaryrefslogtreecommitdiff
path: root/extra/bearssl/build
blob: 4ee354ae9012d56c22b4debb0def81368113afdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh -e

for patch in *.patch; do
    patch -p1 < "$patch"
done

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

clinst -Dm755 brssl               "$1/usr/bin/brssl"
clinst -Dm644 build/libbearssl.a  "$1/usr/lib/libbearssl.a"
clinst -Dm755 build/libbearssl.so "$1/usr/lib/libbearssl.so"
clinst -Dm644 -t "$1/usr/include" inc/*.h