X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=1d8668553cbc7cdf2d6c76c7a829977b43ea8b68;hp=ba09e6e9e7679a0044408787bce0d41d7b2abdbf;hb=2ba352d86b57bddd1dd2a6e20892f380c34180b7;hpb=3e37c7d3fa122563a9d88168926f61286ef30cd3;ds=sidebyside diff --git a/aclocal.m4 b/aclocal.m4 index ba09e6e9..1d866855 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.913 2020/05/23 23:46:10 tom Exp $ +dnl $Id: aclocal.m4,v 1.931 2020/09/12 22:30:53 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -158,23 +158,6 @@ AC_DEFUN([CF_ADD_ADAFLAGS],[ AC_SUBST(ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CXXFLAGS version: 1 updated: 2020/04/04 16:16:13 -dnl --------------- -dnl Copy non-preprocessor flags to $CXXFLAGS, preprocessor flags to $CPPFLAGS -dnl The second parameter if given makes this macro verbose. -dnl -dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, -dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily -dnl confused by the quotes (which require backslashes to keep them usable). -AC_DEFUN([CF_ADD_CXXFLAGS], -[ -cf_save_CXXFLAGS="$CFLAGS" -CFLAGS="$CXXFLAGS" -CF_ADD_CFLAGS($1 ifelse($2,,,[,$2])) -CXXFLAGS="$CFLAGS" -CFLAGS="$cf_save_CXXFLAGS" -])dnl -dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 14 updated: 2020/04/04 16:16:13 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS @@ -262,6 +245,23 @@ fi AC_SUBST(EXTRA_CPPFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_CXXFLAGS version: 1 updated: 2020/04/04 16:16:13 +dnl --------------- +dnl Copy non-preprocessor flags to $CXXFLAGS, preprocessor flags to $CPPFLAGS +dnl The second parameter if given makes this macro verbose. +dnl +dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, +dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily +dnl confused by the quotes (which require backslashes to keep them usable). +AC_DEFUN([CF_ADD_CXXFLAGS], +[ +cf_save_CXXFLAGS="$CFLAGS" +CFLAGS="$CXXFLAGS" +CF_ADD_CFLAGS($1 ifelse($2,,,[,$2])) +CXXFLAGS="$CFLAGS" +CFLAGS="$cf_save_CXXFLAGS" ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_INCDIR version: 15 updated: 2018/06/20 20:23:13 @@ -1450,7 +1450,7 @@ main(void) ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35 +dnl CF_CLANG_COMPILER version: 3 updated: 2020/08/28 04:10:22 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 @@ -1481,6 +1481,10 @@ 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) +fi ]) dnl --------------------------------------------------------------------------- dnl CF_CONST_X_STRING version: 4 updated: 2020/03/10 18:53:47 @@ -1989,6 +1993,36 @@ if test "x$with_string_hacks" = "xyes"; then fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_WARNINGS version: 7 updated: 2020/08/29 09:05:21 +dnl ------------------ +dnl Configure-option to enable gcc warnings +dnl +dnl $1 = extra options to add, if supported +dnl $2 = option for checking attributes. By default, this is done when +dnl warnings are enabled. For other values: +dnl yes: always do this, e.g., to use in generated library-headers +dnl no: never do this +AC_DEFUN([CF_ENABLE_WARNINGS],[ +if ( test "$GCC" = yes || test "$GXX" = yes ) +then +CF_FIX_WARNINGS(CFLAGS) +CF_FIX_WARNINGS(CPPFLAGS) +CF_FIX_WARNINGS(LDFLAGS) +AC_MSG_CHECKING(if you want to turn on gcc warnings) +CF_ARG_ENABLE(warnings, + [ --enable-warnings test: turn on gcc compiler warnings], + [with_warnings=yes], + [with_warnings=no]) +AC_MSG_RESULT($with_warnings) +if test "$with_warnings" = "yes" +then + ifelse($2,,[CF_GCC_ATTRIBUTES]) + CF_GCC_WARNINGS($1) +fi +ifelse($2,yes,[CF_GCC_ATTRIBUTES]) +fi +])dnl +dnl --------------------------------------------------------------------------- dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 dnl -------- dnl Check if 'errno' is declared in @@ -2217,6 +2251,40 @@ AC_DEFUN([CF_FIXUP_ADAFLAGS],[ AC_MSG_RESULT($ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_FIX_WARNINGS version: 2 updated: 2020/08/28 15:08:28 +dnl --------------- +dnl Warning flags do not belong in CFLAGS, CPPFLAGS, etc. Any of gcc's +dnl "-Werror" flags can interfere with configure-checks. Those go into +dnl EXTRA_CFLAGS. +dnl +dnl $1 = variable name to repair +define([CF_FIX_WARNINGS],[ +if ( test "$GCC" = yes || test "$GXX" = yes ) +then + case [$]$1 in + (*-Werror=*) + CF_VERBOSE(repairing $1: [$]$1) + cf_temp_flags= + for cf_temp_scan in [$]$1 + do + case "x$cf_temp_scan" in + (x-Werror=*) + CF_APPEND_TEXT(EXTRA_CFLAGS,"$cf_temp_scan") + ;; + (*) + CF_APPEND_TEXT(cf_temp_flags,"$cf_temp_scan") + ;; + esac + done + $1="$cf_temp_flags" + CF_VERBOSE(... fixed [$]$1) + CF_VERBOSE(... extra $EXTRA_CFLAGS) + ;; + esac +fi +AC_SUBST(EXTRA_CFLAGS) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_FOPEN_BIN_R version: 2 updated: 2019/12/31 08:53:54 dnl -------------- dnl Check if fopen works when the "b" (binary) flag is added to the mode @@ -2532,14 +2600,14 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 18 updated: 2020/03/10 18:53:47 +dnl CF_GCC_ATTRIBUTES version: 19 updated: 2020/08/29 09:05:21 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], [ -if test "$GCC" = yes +if ( test "$GCC" = yes || test "$GXX" = yes ) then cat > conftest.i <