configure: Introduce CLANG variable
authorHilko Bengen <bengen@debian.org>
Tue, 22 Jan 2019 17:10:47 +0000 (18:10 +0100)
committerSascha Steinbiss <satta@debian.org>
Fri, 15 Sep 2023 19:18:47 +0000 (20:18 +0100)
Gbp-Pq: Name configure-clang-variable.patch

configure.ac

index 7eaeda1534838a90f65586db8e2b559e0cf431f3..354c962febcde8ea0da7ca50621acd588f22da40 100644 (file)
 
     AC_SUBST([CLANG])
 
+    AC_ARG_WITH([clang],
+                [CLANG compiler],
+                [CLANG="$withval"],
+                [AS_IF([test "$compiler" = clang],
+                       [CLANG="$CC"],
+                       [AC_PATH_PROG([CLANG],[clang])])])
+
+    AC_SUBST([CLANG])
+
     case "$compiler" in
         clang)
             CLANG_CFLAGS="-Wextra -Werror-implicit-function-declaration -Wno-error=unused-command-line-argument"