1#!/bin/bash 2# Copyright (c) Huawei Technologies Co., Ltd. 2020-2030. All rights reserved. 3set -e 4 5while getopts "o:i:t:h" arg 6do 7 case "${arg}" in 8 "o") 9 OUT_DIR=${OPTARG} 10 ;; 11 "i") 12 SOURCE_DIR=${OPTARG} 13 ;; 14 "h") 15 echo "help" 16 ;; 17 ?) 18 echo "unkonw argument" 19 exit 1 20 ;; 21 esac 22done 23 24 25ndk_dir=$(ls ${SOURCE_DIR}/lib/|more |grep ohos |grep -v mipsel |grep -v riscv |awk '{print $NF}') 26 27for i in $ndk_dir 28do 29 find ${OUT_DIR}/lib/$i -name 'libc++.a' -type f -exec bash -c 'echo "INPUT(-lc++_static -lc++abi)" > $1' _ {} \; 30 find ${OUT_DIR}/lib/$i -name 'libc++.so' -type f -exec bash -c 'echo "INPUT(-lc++_shared)" > $1' _ {} \; 31done 32 33cp -rfp ${SOURCE_DIR}/lib ${OUT_DIR} 34cp -rfp ${SOURCE_DIR}/include ${OUT_DIR} 35 36