Skip to content

Commit 4ce10da

Browse files
authoredApr 12, 2024··
gh-96398: Detect emcc and mpicc in compiler names in configure (#117819)
- emcc defines __EMSCRIPTEN__ - mpicc doesn't define anything in particular; detect it using basename
1 parent 2d3d9b4 commit 4ce10da

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed
 

‎configure

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac

+6-1
Original file line numberDiff line numberDiff line change
@@ -992,7 +992,9 @@ dnl check for GCC last, other compilers set __GNUC__, too.
992992
dnl msvc is listed for completeness.
993993
AC_CACHE_CHECK([for CC compiler name], [ac_cv_cc_name], [
994994
cat > conftest.c <<EOF
995-
#if defined(__INTEL_COMPILER) || defined(__ICC)
995+
#if defined(__EMSCRIPTEN__)
996+
emcc
997+
#elif defined(__INTEL_COMPILER) || defined(__ICC)
996998
icc
997999
#elif defined(__ibmxl__) || defined(__xlc__) || defined(__xlC__)
9981000
xlc
@@ -1009,6 +1011,9 @@ EOF
10091011
10101012
if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
10111013
ac_cv_cc_name=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
1014+
if $(expr "//$CC" : '.*/\(.*\)') = "mpicc"; then
1015+
ac_cv_cc_name="mpicc"
1016+
fi
10121017
else
10131018
ac_cv_cc_name="unknown"
10141019
fi

0 commit comments

Comments
 (0)