Files
Velix-MPV-Core/scripts/build-openssl-ohos.sh
T

33 lines
979 B
Bash
Executable File

#!/bin/sh
set -eu
. "$(dirname -- "$0")/setup-ohos-env.sh"
SOURCE=$OHOS_BUILD_ROOT/sources/openssl
BUILD=$OHOS_BUILD_ROOT/build/openssl
LOG=$OHOS_BUILD_ROOT/logs/openssl.log
JOBS=$(sysctl -n hw.ncpu)
test -f "$SOURCE/Configure" || "$PROJECT_ROOT/scripts/fetch-phase1-sources.sh"
mkdir -p "$BUILD" "$PREFIX" "$OHOS_BUILD_ROOT/logs"
cd "$BUILD"
if ! CC="$CC --target=$TARGET --sysroot=$OHOS_SYSROOT -D__MUSL__ -fPIC" \
CXX="$CXX --target=$TARGET --sysroot=$OHOS_SYSROOT -D__MUSL__ -fPIC" \
AR="$AR" RANLIB="$RANLIB" \
perl "$SOURCE/Configure" linux-aarch64 \
no-shared no-tests no-apps no-docs no-module \
--prefix="$PREFIX" --openssldir=/etc/ssl --libdir=lib > "$LOG" 2>&1; then
tail -n 140 "$LOG" >&2
exit 1
fi
if ! make -j"$JOBS" >> "$LOG" 2>&1; then
tail -n 180 "$LOG" >&2
exit 1
fi
make install_sw >> "$LOG" 2>&1
"$PROJECT_ROOT/scripts/verify-static-archive.sh" "$PREFIX/lib/libcrypto.a" "$PREFIX/lib/libssl.a"
"$PKG_CONFIG" --modversion openssl