[PATCH] Check for clang-cl.exe after cl.exe
Antonin Décimo <[email protected]> Thu, 13 Nov 2025 23:02:02 +0100
| Newsgroups | gmane.comp.sysutils.autoconf.patches |
|---|---|
| Message-ID | <[email protected]> |
> clang-cl is an alternative command-line interface to Clang, designed
> for compatibility with the Visual C++ compiler, cl.exe.
https://clang.llvm.org/docs/UsersManual.html#clang-cl
---
lib/autoconf/c.m4 | 5 ++++-
tests/data/gnulib_std_gnu11_2020_08_17.m4 | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
index 689e506d..fa6965b3 100644
--- a/lib/autoconf/c.m4
+++ b/lib/autoconf/c.m4
@@ -483,6 +483,9 @@ fi
if test -z "$CC"; then
AC_CHECK_TOOLS(CC, cl.exe)
fi
+if test -z "$CC"; then
+ AC_CHECK_TOOLS(CC, clang-cl.exe)
+fi
if test -z "$CC"; then
AC_CHECK_TOOL(CC, clang)
fi
@@ -699,7 +702,7 @@ if test -z "$CXX"; then
else
AC_CHECK_TOOLS(CXX,
[m4_default([$1],
- [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])],
+ [g++ c++ gpp aCC CC cxx cc++ cl.exe clang-cl.exe FCC KCC RCC xlC_r xlC clang++])],
g++)
fi
fi
diff --git a/tests/data/gnulib_std_gnu11_2020_08_17.m4 b/tests/data/gnulib_std_gnu11_2020_08_17.m4
index 21f7cc7a..77ec5558 100644
--- a/tests/data/gnulib_std_gnu11_2020_08_17.m4
+++ b/tests/data/gnulib_std_gnu11_2020_08_17.m4
@@ -58,6 +58,9 @@ fi
if test -z "$CC"; then
AC_CHECK_TOOLS(CC, cl.exe)
fi
+if test -z "$CC"; then
+ AC_CHECK_TOOLS(CC, clang-cl.exe)
+fi
if test -z "$CC"; then
AC_CHECK_TOOL(CC, clang)
fi
@@ -126,7 +129,7 @@ if test -z "$CXX"; then
else
AC_CHECK_TOOLS(CXX,
[m4_default([$1],
- [g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++])],
+ [g++ c++ gpp aCC CC cxx cc++ cl.exe clang-cl.exe FCC KCC RCC xlC_r xlC clang++])],
g++)
fi
fi
--
2.51.2