Files
MeowOS-For-R3P2/patch_v2/ncm_app/build_demo.sh
T

20 lines
1.0 KiB
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/bin/bash
# 复现宿主 + MIPS 版 HTTPS/加密 demo 与 RSA raw 校验。
# 依赖:先运行 build_mbedtls.sh(产出 out/mbedtls/{host,mipsel}/*.a)。
# 宿主 = 本机(此工作区为 aarch64);MIPS = qemu-mipsel 可跑(静态链)。
. ./libs_common.sh
INC="-I$VENDOR/mbedtls/include -I$VENDOR/jsmn"
HOST_LIBS="-L$OUT/mbedtls/host -lmbedtls -lmbedx509 -lmbedcrypto"
MIPS_LIBS="$OUT/mbedtls/mipsel/libmbedtls.a $OUT/mbedtls/mipsel/libmbedx509.a $OUT/mbedtls/mipsel/libmbedcrypto.a"
echo "==> host https_unikey"
$CC_HOST -O2 $INC demo/https_unikey.c $HOST_LIBS -o demo/https_unikey -lpthread -lm \
&& echo " built demo/https_unikey" \
&& { [ -f /etc/ssl/certs/ca-certificates.crt ] && timeout 45 ./demo/https_unikey | tail -4; }
echo "==> mipsel https_unikey (静态)"
$CC_MIPS -O2 -static -Wl,--gc-sections $INC demo/https_unikey.c $MIPS_LIBS -o out/https_unikey_mipsel -lpthread -lm \
&& echo " built out/https_unikey_mipsel" && size out/https_unikey_mipsel \
&& timeout 90 qemu-mipsel ./out/https_unikey_mipsel | tail -4