diff options
Diffstat (limited to '.github/scripts/build-hamlib-linux.sh')
| -rwxr-xr-x | .github/scripts/build-hamlib-linux.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/.github/scripts/build-hamlib-linux.sh b/.github/scripts/build-hamlib-linux.sh new file mode 100755 index 00000000..11676c56 --- /dev/null +++ b/.github/scripts/build-hamlib-linux.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ "$#" -ne 2 ]; then + echo "Usage: build-hamlib-linux.sh REF PREFIX" >&2 + exit 2 +fi + +ref="$1" +prefix="$2" + +git init hamlib-src +git -C hamlib-src remote add origin https://github.com/Hamlib/Hamlib.git +git -C hamlib-src fetch --depth 1 origin "$ref" +git -C hamlib-src checkout --detach FETCH_HEAD +actual_commit="$(git -C hamlib-src rev-parse HEAD)" +if [[ "$ref" =~ ^[0-9a-f]{40}$ ]] && [ "$actual_commit" != "$ref" ]; then + echo "Hamlib source mismatch: expected $ref, got $actual_commit" >&2 + exit 1 +fi +cd hamlib-src +./bootstrap +./configure \ + --prefix="$prefix" \ + --disable-shared --enable-static \ + --without-cxx-binding \ + --without-readline \ + --without-indi \ + CFLAGS="-g -O2 -fPIC -fdata-sections -ffunction-sections" \ + LDFLAGS="-Wl,--gc-sections" +make -j"$(nproc)" +make install |
