Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use CC_BASENAME to simplify mpicc check
  • Loading branch information
erlend-aasland committed Apr 13, 2024
commit f33f1f50b7883070d8396046f2548bd4db2fa4c8
11 changes: 7 additions & 4 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 4 additions & 7 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,9 @@ AC_PROG_GREP
AC_PROG_SED
AC_PROG_EGREP

dnl GNU Autoconf recommends the use of expr instead of basename.
AS_VAR_SET([CC_BASENAME], [$(expr "//$CC" : '.*/\(.*\)')])

dnl detect compiler name
dnl check for xlc before clang, newer xlc's can use clang as frontend.
dnl check for GCC last, other compilers set __GNUC__, too.
Expand All @@ -1011,9 +1014,7 @@ EOF

if $CPP $CPPFLAGS conftest.c >conftest.out 2>/dev/null; then
ac_cv_cc_name=`grep -v '^#' conftest.out | grep -v '^ *$' | tr -d ' '`
if test $(expr "//$CC" : '.*/\(.*\)') = "mpicc"; then
ac_cv_cc_name="mpicc"
fi
AS_VAR_IF([CC_BASENAME], [mpicc], [ac_cv_cc_name=mpicc])
else
ac_cv_cc_name="unknown"
fi
Expand All @@ -1037,10 +1038,6 @@ AC_CACHE_CHECK([for GCC compatible compiler],
[ac_cv_gcc_compat=yes],
[ac_cv_gcc_compat=no])])


dnl GNU Autoconf recommends the use of expr instead of basename.
AS_VAR_SET([CC_BASENAME], [$(expr "//$CC" : '.*/\(.*\)')])

AC_SUBST([CXX])

preset_cxx="$CXX"
Expand Down