]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/aclocal.m4
ncurses 6.2 - patch 20201128
[ncurses.git] / test / aclocal.m4
index 813527050143cb3362a1fdbb346365f71cc1fff0..affadafcde276340bc490cffae07efbaf7bf8465 100644 (file)
@@ -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.184 2020/10/31 20:05:07 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: 4 updated: 2020/10/31 15:46:50
+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,18 +598,36 @@ 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
        do
                AC_MSG_CHECKING(if option $cf_clang_opt works)
+               cf_save_CFLAGS="$CFLAGS"
+               CFLAGS="$CFLAGS $cf_clang_opt"
                AC_TRY_LINK([
                        #include <stdio.h>],[
                        printf("hello!\n");],[
                        cf_clang_optok=yes],[
                        cf_clang_optok=no])
                AC_MSG_RESULT($cf_clang_optok)
+               CFLAGS="$cf_save_CFLAGS"
                if test $cf_clang_optok = yes; then
                        CF_VERBOSE(adding option $cf_clang_opt)
                        CF_APPEND_TEXT(CFLAGS,$cf_clang_opt)
@@ -2339,7 +2357,7 @@ ifelse($1,,[
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_MIXEDCASE_FILENAMES version: 7 updated: 2015/04/12 15:39:00
+dnl CF_MIXEDCASE_FILENAMES version: 8 updated: 2020/11/14 10:12:15
 dnl ----------------------
 dnl Check if the file-system supports mixed-case filenames.  If we're able to
 dnl create a lowercase name and see it as uppercase, it doesn't support that.
@@ -2348,7 +2366,7 @@ AC_DEFUN([CF_MIXEDCASE_FILENAMES],
 AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
 if test "$cross_compiling" = yes ; then
        case $target_alias in
-       (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
+       (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*)
                cf_cv_mixedcase=no
                ;;
        (*)