X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Faclocal.m4;h=affadafcde276340bc490cffae07efbaf7bf8465;hp=5219775413ef48488ecec70ade66f8633f516149;hb=31dcb6fc49a6814a67cdc21db26390752e743d7f;hpb=07694efddddede22a2b43d09656e988bd0d962a9 diff --git a/test/aclocal.m4 b/test/aclocal.m4 index 52197754..affadafc 100644 --- a/test/aclocal.m4 +++ b/test/aclocal.m4 @@ -27,7 +27,7 @@ dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl -dnl $Id: aclocal.m4,v 1.186 2020/11/20 23:52:27 tom Exp $ +dnl $Id: aclocal.m4,v 1.187 2020/11/26 22:37:55 tom Exp $ dnl dnl Author: Thomas E. Dickey dnl @@ -568,7 +568,7 @@ if test "$cf_have_curses_lib" = no; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CLANG_COMPILER version: 5 updated: 2020/11/20 18:52:27 +dnl CF_CLANG_COMPILER version: 6 updated: 2020/11/26 17:37:55 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does @@ -598,7 +598,22 @@ make an error AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) fi +CLANG_VERSION=none + if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then + case "$CC" in + (c[[1-9]][[0-9]]|*/c[[1-9]][[0-9]]) + AC_MSG_WARN(replacing broken compiler alias $CC) + CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`" + CC=clang + ;; + esac + + AC_MSG_CHECKING(version of $CC) + CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" + test -z "$CLANG_VERSION" && CLANG_VERSION=unknown + AC_MSG_RESULT($CLANG_VERSION) + for cf_clang_opt in \ -Qunused-arguments \ -Wno-error=implicit-function-declaration