From b3949f7796ea2cdae4b689694df662b2b934b0bb Mon Sep 17 00:00:00 2001 From: Jeffrey Walton Date: Thu, 30 Jul 2020 09:31:03 -0400 Subject: [PATCH] Update configure.sh script --- TestScripts/configure.sh | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/TestScripts/configure.sh b/TestScripts/configure.sh index 85dcb788..52ae2562 100755 --- a/TestScripts/configure.sh +++ b/TestScripts/configure.sh @@ -45,6 +45,7 @@ fi SUN_COMPILER=$(${CXX} -V 2>/dev/null | ${GREP} -i -c -E 'CC: (Sun|Studio)') XLC_COMPILER=$(${CXX} -qversion 2>/dev/null | ${GREP} -i -c "IBM XL") +CLANG_COMPILER=$(${CXX} --version 2>/dev/null | ${GREP} -i -c -E 'clang|llvm') if [[ "$SUN_COMPILER" -ne 0 ]] then @@ -62,18 +63,35 @@ then IS_IA32=0 IS_ARM32=0 IS_ARMV8=0 - IS_PPC=$(uname -m 2>&1 | ${GREP} -v 64 | ${GREP} -c -E 'ppc|powerpc') + IS_PPC=$(uname -m 2>&1 | ${GREP} -c -E 'ppc|powerpc') IS_PPC64=$(uname -m 2>&1 | ${GREP} -c -E 'ppc64|powerpc64') +elif [[ "$CLANG_COMPILER" -ne 0 ]] +then + IS_X86=$(${CXX} ${CXXFLAGS} -dM -E - &1 | ${GREP} -c -E 'i386|i486|i585|i686') - IS_X64=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -c -E 'i86pc|x86_64|amd64') - IS_IA32=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -c -E 'i86pc|i386|i486|i585|i686|x86_64|amd64') + IS_X86=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -i -c -E 'i386|i486|i585|i686') + IS_X64=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -i -c -E 'i86pc|x86_64|amd64') + IS_IA32=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -i -c -E 'i86pc|i386|i486|i585|i686|x86_64|amd64') IS_ARM32=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -i -c -E 'arm|armhf|armv7|eabihf|armv8') IS_ARMV8=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -i -c -E 'aarch32|aarch64|arm64') - IS_PPC=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -v 64 | ${GREP} -c -E 'ppc|powerpc') - IS_PPC64=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -c -E 'ppc64|powerpc64') + IS_PPC=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -i -c -E 'ppc|powerpc') + IS_PPC64=$(${CXX} ${CXXFLAGS} -dumpmachine 2>&1 | ${GREP} -i -c -E 'ppc64|powerpc64') fi +# =========================================================================== +# ================================== Fixups ================================= +# =========================================================================== + +if [[ "${IS_X64}" -ne 0 ]]; then IS_X86=0; fi +if [[ "${IS_ARMV8}" -ne 0 ]]; then IS_ARM32=0; fi +if [[ "${IS_PPC64}" -ne 0 ]]; then IS_PPC=0; fi + # =========================================================================== # =================================== Info ================================== # ===========================================================================