[Chore](env) add error information when DORIS_GCC_HOME not set well (#14249)

This commit is contained in:
Pxl
2022-11-15 15:45:35 +08:00
committed by GitHub
parent 87544a017f
commit e298696baf

12
env.sh
View File

@ -161,8 +161,18 @@ if [[ -z "${DORIS_BIN_UTILS}" ]]; then
export DORIS_BIN_UTILS='/usr/bin/'
fi
if [[ -z "${DORIS_GCC_HOME}" ]]; then
DORIS_GCC_HOME="$(dirname "$(which gcc)")/.."
export DORIS_GCC_HOME
fi
if [[ ! -f "${DORIS_GCC_HOME}/bin/gcc" ]]; then
echo "Error: wrong directory DORIS_GCC_HOME=${DORIS_GCC_HOME}"
exit 1
fi
# export CLANG COMPATIBLE FLAGS
CLANG_COMPATIBLE_FLAGS="$(echo | "${DORIS_GCC_HOME:-"$(dirname "$(which gcc)")/.."}/bin/gcc" -Wp,-v -xc++ - -fsyntax-only 2>&1 |
CLANG_COMPATIBLE_FLAGS="$(echo | "${DORIS_GCC_HOME}/bin/gcc" -Wp,-v -xc++ - -fsyntax-only 2>&1 |
grep -E '^\s+/' | awk '{print "-I" $1}' | tr '\n' ' ')"
export CLANG_COMPATIBLE_FLAGS