X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=3cecb0a552b5aa8ef58225962f2adf02b9b6a629;hp=225dc220881f97a8ccc52d0635eb0439ff3a9be8;hb=d1cc319afccb0d472465718a748664e7cef00840;hpb=7884aa084f9440fd964f14fe31853a5f85db5104 diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 225dc220..3cecb0a5 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.162 2020/09/26 23:08:42 tom Exp $ +dnl $Id: aclocal.m4,v 1.163 2020/10/31 20:04:06 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -719,7 +719,7 @@ case $cf_cv_gnat_version in esac ]) dnl --------------------------------------------------------------------------- -dnl CF_CLANG_COMPILER version: 3 updated: 2020/08/28 04:10:22 +dnl CF_CLANG_COMPILER version: 4 updated: 2020/10/31 15:46:50 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 @@ -738,21 +738,34 @@ ifelse([$2],,CLANG_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" - ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" AC_TRY_COMPILE([],[ #ifdef __clang__ #else make an error #endif ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes -cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) fi -if test "x$CLANG_COMPILER" = "xyes" ; then - CF_APPEND_TEXT(CFLAGS,-Wno-error=implicit-function-declaration) +if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then + for cf_clang_opt in \ + -Qunused-arguments \ + -Wno-error=implicit-function-declaration + do + AC_MSG_CHECKING(if option $cf_clang_opt works) + AC_TRY_LINK([ + #include ],[ + printf("hello!\n");],[ + cf_clang_optok=yes],[ + cf_clang_optok=no]) + AC_MSG_RESULT($cf_clang_optok) + if test $cf_clang_optok = yes; then + CF_VERBOSE(adding option $cf_clang_opt) + CF_APPEND_TEXT(CFLAGS,$cf_clang_opt) + fi + done fi ]) dnl ---------------------------------------------------------------------------