]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/aclocal.m4
ncurses 6.4 - patch 20230415
[ncurses.git] / test / aclocal.m4
index 538ead1356744111406164690fd364acf6ed9d12..440d99fe73860f8d16b15279e147e1b9e813cb7d 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.213 2023/02/25 13:45:56 tom Exp $
+dnl $Id: aclocal.m4,v 1.215 2023/04/15 20:01:23 tom Exp $
 dnl
 dnl Author: Thomas E. Dickey
 dnl
@@ -1852,7 +1852,7 @@ rm -rf ./conftest*
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_VERSION version: 8 updated: 2019/09/07 13:38:36
+dnl CF_GCC_VERSION version: 9 updated: 2023/03/05 14:30:13
 dnl --------------
 dnl Find version of gcc, and (because icc/clang pretend to be gcc without being
 dnl compatible), attempt to determine if icc/clang is actually used.
@@ -1861,7 +1861,7 @@ AC_REQUIRE([AC_PROG_CC])
 GCC_VERSION=none
 if test "$GCC" = yes ; then
        AC_MSG_CHECKING(version of $CC)
-       GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+       GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^[[^(]]*([[^)]][[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
        test -z "$GCC_VERSION" && GCC_VERSION=unknown
        AC_MSG_RESULT($GCC_VERSION)
 fi
@@ -4381,7 +4381,7 @@ esac
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 64 updated: 2023/02/18 17:41:25
+dnl CF_XOPEN_SOURCE version: 66 updated: 2023/04/03 04:19: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,
@@ -4390,6 +4390,18 @@ dnl
 dnl Parameters:
 dnl    $1 is the nominal value for _XOPEN_SOURCE
 dnl    $2 is the nominal value for _POSIX_C_SOURCE
+dnl
+dnl The default case prefers _XOPEN_SOURCE over _POSIX_C_SOURCE if the
+dnl implementation predefines it, because X/Open and most implementations agree
+dnl that the latter is a legacy or "aligned" value.
+dnl
+dnl Because _XOPEN_SOURCE is preferred, if defining _POSIX_C_SOURCE turns
+dnl that off, then refrain from setting _POSIX_C_SOURCE explicitly.
+dnl
+dnl References:
+dnl https://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html
+dnl https://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html
+dnl https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html
 AC_DEFUN([CF_XOPEN_SOURCE],[
 AC_REQUIRE([AC_CANONICAL_HOST])
 AC_REQUIRE([CF_POSIX_VISIBLE])
@@ -4429,7 +4441,7 @@ case "$host_os" in
        cf_xopen_source="-D_SGI_SOURCE"
        cf_XOPEN_SOURCE=
        ;;
-(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys)
+(linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*)
        CF_GNU_SOURCE($cf_XOPEN_SOURCE)
        ;;
 (minix*)
@@ -4481,8 +4493,8 @@ case "$host_os" in
        cf_save_xopen_cppflags="$CPPFLAGS"
        CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
        # Some of these niche implementations use copy/paste, double-check...
-       if test "$cf_cv_xopen_source" != no ; then
-               CF_VERBOSE(checking if _POSIX_C_SOURCE inteferes)
+       if test "$cf_cv_xopen_source" = no ; then
+               CF_VERBOSE(checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE)
                AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY,,[
                        AC_MSG_WARN(_POSIX_C_SOURCE definition is not usable)
                        CPPFLAGS="$cf_save_xopen_cppflags"])