X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Faclocal.m4;h=02025f837309bde6275e0a0523fe29578dbe7b81;hb=87154b424ea0f67c2965d00e861ddfb134082d94;hp=68ba3af7035b6860537320a82a977aefc278d6a4;hpb=643ec2bf782cd02efafe3ccdeaea8920a404645e;p=ncurses.git diff --git a/test/aclocal.m4 b/test/aclocal.m4 index 68ba3af7..02025f83 100644 --- a/test/aclocal.m4 +++ b/test/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright 2018-2020,2021 Thomas E. Dickey * +dnl Copyright 2018-2021,2022 Thomas E. Dickey * dnl Copyright 2003-2017,2018 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * @@ -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.199 2021/09/04 10:39:46 tom Exp $ +dnl $Id: aclocal.m4,v 1.203 2022/01/23 00:22:31 tom Exp $ dnl dnl Author: Thomas E. Dickey dnl @@ -345,7 +345,7 @@ ifelse([$5],NONE,,[{ test -z "$5" || test "x$5" = xNONE || test "x$4" != "x$5"; } ])dnl dnl --------------------------------------------------------------------------- -dnl CF_APPEND_CFLAGS version: 1 updated: 2021/08/28 15:20:37 +dnl CF_APPEND_CFLAGS version: 3 updated: 2021/09/05 17:25:40 dnl ---------------- dnl Use CF_ADD_CFLAGS after first checking for potential redefinitions. dnl $1 = flags to add @@ -354,10 +354,14 @@ define([CF_APPEND_CFLAGS], [ for cf_add_cflags in $1 do - CF_REMOVE_CFLAGS($cf_add_cflags,CFLAGS,[$2]) - CF_REMOVE_CFLAGS($cf_add_cflags,CPPFLAGS,[$2]) + case "x$cf_add_cflags" in + (x-[[DU]]*) + CF_REMOVE_CFLAGS($cf_add_cflags,CFLAGS,[$2]) + CF_REMOVE_CFLAGS($cf_add_cflags,CPPFLAGS,[$2]) + ;; + esac + CF_ADD_CFLAGS([$cf_add_cflags],[$2]) done -CF_ADD_CFLAGS([$1],[$2]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55 @@ -565,7 +569,7 @@ AC_TRY_LINK([#include ],[printf("Hello world");],, fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_CURSES_LIB version: 3 updated: 2021/01/04 19:45:09 +dnl CF_CHECK_CURSES_LIB version: 4 updated: 2021/09/05 17:25:40 dnl ------------------- dnl $1 = nominal library name, used also for header lookup dnl $2 = suffix to append to library name @@ -587,10 +591,11 @@ elif test "x${PKG_CONFIG:=none}" != xnone; then AC_MSG_CHECKING(if the $1$2 package files work) + cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_save_LIBS="$LIBS" - CF_ADD_CFLAGS(`$PKG_CONFIG --cflags "$1$2"`) + CF_APPEND_CFLAGS(`$PKG_CONFIG --cflags "$1$2"`) CF_ADD_LIBS(`$PKG_CONFIG --libs "$1$2"`) AC_TRY_LINK([#include <$1.h>], @@ -604,13 +609,14 @@ elif test "x${PKG_CONFIG:=none}" != xnone; then [cf_have_curses_lib=no]) AC_MSG_RESULT($cf_have_curses_lib) test "$cf_have_curses_lib" = maybe && cf_have_curses_lib=yes - if test "$cf_have_curses_lib" != "yes" + if test "$cf_have_curses_lib" = "yes" then - CPPFLAGS="$cf_save_CPPFLAGS" - LIBS="$cf_save_LIBS" - else CF_UPPER(cf_upper,have_lib$1) AC_DEFINE_UNQUOTED($cf_upper,1) + else + CFLAGS="$cf_save_CFLAGS" + CPPFLAGS="$cf_save_CPPFLAGS" + LIBS="$cf_save_LIBS" fi fi fi @@ -1612,7 +1618,7 @@ ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FIX_WARNINGS version: 3 updated: 2020/12/31 18:40:20 +dnl CF_FIX_WARNINGS version: 4 updated: 2021/12/16 18:22:31 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 @@ -1624,11 +1630,13 @@ 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=format*) + CF_APPEND_TEXT(cf_temp_flags,$cf_temp_scan) + ;; (x-Werror=*) CF_APPEND_TEXT(EXTRA_CFLAGS,$cf_temp_scan) ;; @@ -1637,9 +1645,13 @@ then ;; esac done - $1="$cf_temp_flags" - CF_VERBOSE(... fixed [$]$1) - CF_VERBOSE(... extra $EXTRA_CFLAGS) + if test "x[$]$1" != "x$cf_temp_flags" + then + CF_VERBOSE(repairing $1: [$]$1) + $1="$cf_temp_flags" + CF_VERBOSE(... fixed [$]$1) + CF_VERBOSE(... extra $EXTRA_CFLAGS) + fi ;; esac fi @@ -3175,9 +3187,11 @@ else fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 11 updated: 2021/01/01 13:31:04 +dnl CF_PKG_CONFIG version: 12 updated: 2021/10/10 20:18:09 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. +dnl +dnl Sets $PKG_CONFIG to the pathname of the pkg-config program. AC_DEFUN([CF_PKG_CONFIG], [ AC_MSG_CHECKING(if you want to use pkg-config) @@ -3389,7 +3403,7 @@ esac AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REMOVE_CFLAGS version: 1 updated: 2021/08/28 15:20:37 +dnl CF_REMOVE_CFLAGS version: 3 updated: 2021/09/05 17:25:40 dnl ---------------- dnl Remove a given option from CFLAGS/CPPFLAGS dnl $1 = option to remove @@ -3398,25 +3412,13 @@ dnl $3 = nonempty to allow verbose message define([CF_REMOVE_CFLAGS], [ cf_tmp_cflag=`echo "x$1" | sed -e 's/^.//' -e 's/=.*//'` -cf_old_cflag="[$]$2" - -case "[$]$2" in -(*$1=*) - cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag=[[^ ]]*%%g"` - ;; -(*$1\ *) - cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%${cf_tmp_cflag}.%%"` - ;; -(*$1) - cf_old_cflag=`echo "x$cf_old_cflag" | sed -e 's/^.//' -e "s%$cf_tmp_cflag%%"` - ;; -esac - -if test "[$]$2" != "$cf_old_cflag" ; -then +while true +do + cf_old_cflag=`echo "x[$]$2" | sed -e 's/^.//' -e 's/[[ ]][[ ]]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[[^ ]][[^ ]]*\\)\?%%" -e 's/^[[ ]]*//' -e 's%[[ ]][[ ]]*-D% -D%g' -e 's%[[ ]][[ ]]*-I% -I%g'` + test "[$]$2" != "$cf_old_cflag" || break ifelse([$3],,,[CF_VERBOSE(removing old option $1 from $2)]) - $2="$cf_new_cflag" -fi + $2="$cf_old_cflag" +done ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50