代码拉取完成,页面将自动刷新
#!/bin/bash
# This compiler wrapper removes e.g. -mno-sse4.2 if both -mno-sse4.2 and -msse4.2 are specified
set -e
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
#echo "ORIG_ARGS: $@" >> "$DIR/x86_64_cxx_wrapper.log"
args=()
containsElement () {
local e match="$1"
shift
for e; do [[ "$e" == "$match" ]] && return 0; done
return 1
}
removeElement () {
new_args=()
for v in "${args[@]}"; do
if [[ $v != "$1" ]]; then
new_args+=($v)
fi
done
args=("${new_args[@]}")
}
for var in "$@"
do
ADD=1
if [[ $var == "-mno-sse4.1" ]]; then
ADD=0
if ! containsElement "-msse4.1" "${args[@]}" && ! containsElement "-msse4.2" "${args[@]}"; then
args+=("$var")
fi
fi
if [[ $var == "-mno-sse4.2" ]]; then
ADD=0
if ! containsElement "-msse4.2" "${args[@]}"; then
args+=("$var")
fi
fi
if [[ $var == "-mno-sse4a" ]]; then
ADD=0
if ! containsElement "-msse4a" "${args[@]}" && ! containsElement "-msse4.2" "${args[@]}" && ! containsElement "-msse4.1" "${args[@]}"; then
args+=("$var")
fi
fi
if [[ $var == "-mno-sse3" ]]; then
ADD=0
if ! containsElement "-msse3" "${args[@]}" && ! containsElement "-mssse3" "${args[@]}" && ! containsElement "-msse4a" "${args[@]}" && ! containsElement "-msse4.2" "${args[@]}" && ! containsElement "-msse4.1" "${args[@]}"; then
args+=("$var")
fi
fi
if [[ $var == "-msse4.1" ]]; then
removeElement "-mno-sse4.1"
removeElement "-mno-sse4a"
fi
if [[ $var == "-msse4.2" ]]; then
removeElement "-mno-sse4.2"
removeElement "-mno-sse4.1"
removeElement "-mno-sse4a"
fi
if [[ $var == "-msse4a" ]]; then
removeElement "-mno-sse4a"
fi
if [[ $var == "-msse3" ]]; then
removeElement "-mno-sse3"
fi
if [[ $var == "-mssse3" ]]; then
removeElement "-mno-sse3"
fi
if [[ $ADD == 1 ]]; then
args+=("$var")
fi
done
CXX=$(cat "$DIR/cxx_path")
#echo "ARGS: ${args[@]}" >> "$DIR/x86_64_cxx_wrapper.log"
exec $CXX ${args[@]}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。