bb64/build.sh
2025-05-17 09:56:15 +12:00

20 lines
693 B
Bash
Executable File

#!/bin/bash
set -e
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
OUTPUT_DIR="$SCRIPT_DIR/output"
mkdir -p "$OUTPUT_DIR"
# Build for x86_64 with musl static linking
if [[ $(uname -m) == "x86_64" ]]; then
echo "Building for x86_64 (musl static)..."
x86_64-linux-musl-g++ -O2 -static -o "$OUTPUT_DIR/bb64.amd64" bb64.cpp b64ed.cpp
echo "Built bb64.amd64 (x86_64, static)"
fi
# Build for arm64 (musl static) if cross-compiler available
if command -v aarch64-linux-musl-g++ &>/dev/null; then
echo "Building for arm64 (musl static)..."
aarch64-linux-musl-g++ -O2 -static -o "$OUTPUT_DIR/bb64.arm64" bb64.cpp b64ed.cpp
echo "Built bb64.arm64 (arm64, static)"
fi