]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - aclocal.m4
ncurses 6.2 - patch 20210828
[ncurses.git] / aclocal.m4
index 56f61cc462ad5742e4dacbf50c4f6d7f33710d53..5f0b7a9e899ad10542d656a477a3b61697d5ade5 100644 (file)
@@ -29,7 +29,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.973 2021/08/12 00:35:34 tom Exp $
+dnl $Id: aclocal.m4,v 1.974 2021/08/28 20:24:23 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -415,6 +415,21 @@ 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 ----------------
+dnl Use CF_ADD_CFLAGS after first checking for potential redefinitions.
+dnl $1 = flags to add
+dnl $2 = if given makes this macro verbose.
+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])
+done
+CF_ADD_CFLAGS([$1],[$2])
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55
 dnl --------------
 dnl use this macro for appending text without introducing an extra blank at
@@ -6843,6 +6858,36 @@ case "$cf_cv_regex_hdrs" in
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_REMOVE_CFLAGS version: 1 updated: 2021/08/28 15:20:37
+dnl ----------------
+dnl Remove a given option from CFLAGS/CPPFLAGS
+dnl $1 = option to remove
+dnl $2 = variable to update
+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
+       ifelse([$3],,,[CF_VERBOSE(removing old option $1 from $2)])
+       $2="$cf_new_cflag"
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
 dnl ----------------
 dnl Remove all -U and -D options that refer to the given symbol from a list
@@ -8158,7 +8203,7 @@ else
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_TRY_XOPEN_SOURCE version: 2 updated: 2018/06/20 20:23:13
+dnl CF_TRY_XOPEN_SOURCE version: 3 updated: 2021/08/28 15:20:37
 dnl -------------------
 dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we
 dnl can define it successfully.
@@ -8193,7 +8238,7 @@ if test "$cf_cv_xopen_source" != no ; then
        CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
        CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
        cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
-       CF_ADD_CFLAGS($cf_temp_xopen_source)
+       CF_APPEND_CFLAGS($cf_temp_xopen_source)
 fi
 ])
 dnl ---------------------------------------------------------------------------
@@ -9598,7 +9643,7 @@ fi
 AC_SUBST(no_x11_rgb)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 58 updated: 2021/05/01 17:49:36
+dnl CF_XOPEN_SOURCE version: 59 updated: 2021/08/28 15:20:37
 dnl ---------------
 dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
 dnl or adapt to the vendor's definitions to get equivalent functionality,
@@ -9703,7 +9748,7 @@ case "$host_os" in
 esac
 
 if test -n "$cf_xopen_source" ; then
-       CF_ADD_CFLAGS($cf_xopen_source,true)
+       CF_APPEND_CFLAGS($cf_xopen_source,true)
 fi
 
 dnl In anything but the default case, we may have system-specific setting