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>
Tue, 27 Sep 2022 21:24:59 +0000 (22:24 +0100)
Gbp-Pq: Name configure-clang-variable.patch

configure.ac

index 1bb09aa55d81c9cc138bcfe624d605e4939d0d93..dcc2e170351e4374569dc22bb5ff692b4f1120ca 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"