Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/make-autotools.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ ifeq (%(compiler),host)
# the "plain" host compiler.
%(mmake)-cfg-env := %(config_env_extra) \
CPP="$(HOST_CPP)" \
CXXCPP="$(HOST_CPP)" \
CXXCPP="$(strip $(%(mmake)-HOST_CXX) -E)" \
CC="$(strip $(%(mmake)-HOST_CC) $(%(mmake)-HOST_CFLAGS) -I$(CROSSTOOLSDIR)/include)" \
CXX="$(strip $(%(mmake)-HOST_CXX) $(%(mmake)-HOST_CXXFLAGS) -I$(CROSSTOOLSDIR)/include)" \
LDFLAGS="-L$(CROSSTOOLSDIR)/lib $(USER_LDFLAGS)"
Expand Down
6 changes: 4 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -5187,13 +5187,15 @@ if test "$IS_SUN_COMPILER" -ne "0"; then
HOST_TOOLCHAIN_SUFFIX=
HOST_TOOLCHAIN_FAMILY=sun
fi
CC_PROG=`echo $CC_BASE | sed -e 's| .*||' -e 's|.*/||'`

IS_LLVM_COMPILER=`echo $HOST_COMPILER_VERSION | grep -i -c -E 'LLVM|clang'`
if test "$IS_LLVM_COMPILER" -ne "0"; then
if test "$CC_BASE" != "gcc"; then
if test "$CC_PROG" != "gcc"; then
HOST_TOOLCHAIN_CC=clang
HOST_TOOLCHAIN_CXX=clang++
HOST_TOOLCHAIN_PREFIX=llvm-
HOST_TOOLCHAIN_SUFFIX="`echo $CC_BASE | sed -e \"s|clang||g\"`"
HOST_TOOLCHAIN_SUFFIX="`echo $CC_PROG | sed -e \"s|clang||g\"`"
HOST_TOOLCHAIN_FAMILY=llvm
else
IS_GNU_COMPILER=1
Expand Down
9 changes: 7 additions & 2 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,18 @@ if test "$IS_SUN_COMPILER" -ne "0"; then
HOST_TOOLCHAIN_SUFFIX=
HOST_TOOLCHAIN_FAMILY=sun
fi
dnl AC_PROG_CC leaves the standard flag it picked in CC, so CC_BASE is a
dnl command line ("gcc -std=gnu23"). The guard and the derived binutils
dnl names below want the program name.
CC_PROG=`echo $CC_BASE | sed -e 's| .*||' -e 's|.*/||'`

IS_LLVM_COMPILER=`echo $HOST_COMPILER_VERSION | grep -i -c -E 'LLVM|clang'`
if test "$IS_LLVM_COMPILER" -ne "0"; then
if test "$CC_BASE" != "gcc"; then
if test "$CC_PROG" != "gcc"; then
HOST_TOOLCHAIN_CC=clang
HOST_TOOLCHAIN_CXX=clang++
HOST_TOOLCHAIN_PREFIX=llvm-
HOST_TOOLCHAIN_SUFFIX="`echo $CC_BASE | sed -e \"s|clang||g\"`"
HOST_TOOLCHAIN_SUFFIX="`echo $CC_PROG | sed -e \"s|clang||g\"`"
HOST_TOOLCHAIN_FAMILY=llvm
else
IS_GNU_COMPILER=1
Expand Down
Loading