提交 d9525530 编写于 作者: C Carter Tazio Schonwald

provide an error at at configure time if gcc, and g++ point to a mixture of...

provide an error at  at configure time if gcc, and g++ point to a mixture of clang and gcc. Fixes issue #10959
Signed-off-by: NCarter Tazio Schonwald <carter.schonwald@gmail.com>
上级 8d52dfba
......@@ -559,6 +559,27 @@ then
step_msg "on OS X 10.9, forcing use of clang"
CFG_ENABLE_CLANG=1
putvar CFG_ENABLE_CLANG
else
# on OS X, with xcode 5 and newer, certain developers may have
# cc, gcc and g++ point to a mixture of clang and gcc
# if so, this will create very strange build errors
# this last stanza is to detect some such problems and save the future rust
# contributor some time solving that issue.
# this detection could be generalized to other OSes aside from OS X
# but the issue seems most likely to happen on OS X
chk_cc () {
$1 --version 2> /dev/null | grep -q $2
}
# check that gcc, cc and g++ all point to the same compiler.
# note that for xcode 5, g++ points to clang, not clang++
if !((chk_cc gcc clang && chk_cc g++ clang) ||
(chk_cc gcc gcc &&( chk_cc g++ g++ || chk g++ gcc))) then
err "the gcc and g++ in your path point to different compilers.
Check which versions are in your path with cc --version and g++ --version.
To resolve this problem, either fix your PATH or run configure with --enable-clang"
fi
fi
fi
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册