]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - aclocal.m4
ncurses 6.2 - patch 20210612
[ncurses.git] / aclocal.m4
index ffa2515d9f5f4fecdd2b3e4c24e327579a54ef5d..d48cde0cb286353455c854e8f5da394a3f3f2dc2 100644 (file)
@@ -29,7 +29,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.954 2021/03/20 16:02:03 tom Exp $
+dnl $Id: aclocal.m4,v 1.961 2021/05/19 23:35:25 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -794,24 +794,35 @@ AC_SUBST(BUILD_EXEEXT)
 AC_SUBST(BUILD_OBJEXT)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_C11_NORETURN version: 1 updated: 2021/03/20 12:00:25
+dnl CF_C11_NORETURN version: 3 updated: 2021/03/28 11:36:23
 dnl ---------------
 AC_DEFUN([CF_C11_NORETURN],
 [
+AC_MSG_CHECKING(if you want to use C11 _Noreturn feature)
+CF_ARG_ENABLE(stdnoreturn,
+       [  --enable-stdnoreturn    enable C11 _Noreturn feature for diagnostics],
+       [enable_stdnoreturn=yes],
+       [enable_stdnoreturn=no])
+AC_MSG_RESULT($enable_stdnoreturn)
+
+if test $enable_stdnoreturn = yes; then
 AC_CACHE_CHECK([for C11 _Noreturn feature], cf_cv_c11_noreturn,
        [AC_TRY_COMPILE([
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdnoreturn.h>
-static void giveup(void) { exit(0); }
+static _Noreturn void giveup(void) { exit(0); }
        ],
        [if (feof(stdin)) giveup()],
        cf_cv_c11_noreturn=yes,
        cf_cv_c11_noreturn=no)
        ])
+else
+       cf_cv_c11_noreturn=no,
+fi
 
 if test "$cf_cv_c11_noreturn" = yes; then
-       AC_DEFINE(HAVE_STDNORETURN_H, 1)
+       AC_DEFINE(HAVE_STDNORETURN_H, 1,[Define if <stdnoreturn.h> header is available and working])
        AC_DEFINE_UNQUOTED(STDC_NORETURN,_Noreturn,[Define if C11 _Noreturn keyword is supported])
        HAVE_STDNORETURN_H=1
 else
@@ -819,6 +830,7 @@ else
 fi
 
 AC_SUBST(HAVE_STDNORETURN_H)
+AC_SUBST(STDC_NORETURN)
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_CC_ENV_FLAGS version: 10 updated: 2020/12/31 18:40:20
@@ -1316,21 +1328,34 @@ if test "$cf_cv_check_gpm_wgetch" != yes ; then
 fi
 ])])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_LIBTOOL_VERSION version: 1 updated: 2013/04/06 18:03:09
+dnl CF_CHECK_LIBTOOL_VERSION version: 2 updated: 2021/05/01 16:24:34
 dnl ------------------------
 dnl Show the version of libtool
 dnl
 dnl Save the version in a cache variable - this is not entirely a good thing,
 dnl but the version string from libtool is very ugly, and for bug reports it
 dnl might be useful to have the original string.
+dnl
+dnl There is an imitation in OpenBSD, which has no apparent use other than to
+dnl deny that it is GNU libtool.  Just ignore it.
 AC_DEFUN([CF_CHECK_LIBTOOL_VERSION],[
 if test -n "$LIBTOOL" && test "$LIBTOOL" != none
 then
        AC_MSG_CHECKING(version of $LIBTOOL)
        CF_LIBTOOL_VERSION
        AC_MSG_RESULT($cf_cv_libtool_version)
-       if test -z "$cf_cv_libtool_version" ; then
-               AC_MSG_ERROR(This is not GNU libtool)
+       if test -n "$cf_cv_libtool_version"
+       then
+               cf_check_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' -e 's,[[()]],...,g' -e 's,[[ ]],-,g' -e '2,$d'`
+               case "x$cf_check_libtool_version" in
+               (*...GNU-libtool...*)
+                       ;;
+               (*)
+                       AC_MSG_ERROR(This is not GNU libtool)
+                       ;;
+               esac
+       else
+               AC_MSG_ERROR(No version found for $LIBTOOL)
        fi
 else
        AC_MSG_ERROR(GNU libtool has not been found)
@@ -1887,7 +1912,7 @@ CF_ARG_DISABLE(gnat-projects,
 AC_MSG_RESULT($enable_gnat_projects)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_DISABLE_LEAKS version: 8 updated: 2021/01/05 20:05:09
+dnl CF_DISABLE_LEAKS version: 9 updated: 2021/04/03 16:41:50
 dnl ----------------
 dnl Combine no-leak checks with the libraries or tools that are used for the
 dnl checks.
@@ -1900,9 +1925,9 @@ AC_REQUIRE([CF_WITH_VALGRIND])
 AC_MSG_CHECKING(if you want to perform memory-leak testing)
 AC_ARG_ENABLE(leaks,
        [  --disable-leaks         test: free permanent memory, analyze leaks],
-       [enable_leaks=no],
+       [enable_leaks=$enableval],
        [enable_leaks=yes])
-dnl TODO - drop with_no_leaks
+dnl with_no_leaks is more readable...
 if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi
 AC_MSG_RESULT($with_no_leaks)
 
@@ -5082,11 +5107,14 @@ AC_SUBST(BROKEN_LINKER)
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LINK_FUNCS version: 9 updated: 2017/01/21 11:11:02
+dnl CF_LINK_FUNCS version: 11 updated: 2021/04/18 14:08:47
 dnl -------------
 dnl Most Unix systems have both link and symlink, a few don't have symlink.
 dnl A few non-Unix systems implement symlink, but not link.
 dnl A few non-systems implement neither (or have nonfunctional versions).
+dnl
+dnl This allows for a 2-second difference in modification times to allow for
+dnl some marginal NFS implementations.
 AC_DEFUN([CF_LINK_FUNCS],
 [
 AC_CHECK_HEADERS( \
@@ -5105,6 +5133,7 @@ else
                cf_cv_link_funcs=
                for cf_func in link symlink ; do
                        AC_TRY_RUN([
+#include <stdio.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #ifdef HAVE_UNISTD_H
@@ -5113,19 +5142,26 @@ else
 int main(void)
 {
        int fail = 0;
-       char *src = "config.log";
+       char *src = "conftest.tmp";
        char *dst = "conftest.chk";
-       struct stat src_sb;
-       struct stat dst_sb;
-
-       stat(src, &src_sb);
-       fail = ($cf_func("config.log", "conftest.chk") < 0)
-           || (stat(dst, &dst_sb) < 0)
-           || (dst_sb.st_mtime != src_sb.st_mtime);
+       struct stat src_sb, dst_sb;
+       FILE *fp = fopen(src, "w");
+       if (fp == 0) { fail = 3; } else {
+               fclose(fp); stat(src, &src_sb);
+               if ($cf_func(src, dst) < 0) {
+                       fail = 1;
+               } else if (stat(dst, &dst_sb) < 0) {
+                       fail = 2;
+               } else {
+                       long diff = (dst_sb.st_mtime - src_sb.st_mtime);
+                       if (diff < 0) diff = -diff;
+                       if (diff > 2) fail = 3;
+               }
+       }
 #ifdef HAVE_UNLINK
-       unlink(dst);
+       unlink(dst); unlink(src);
 #else
-       remove(dst);
+       remove(dst); remove(src);
 #endif
        ${cf_cv_main_return:-return} (fail);
 }
@@ -8105,15 +8141,21 @@ AC_DEFUN([CF_UPPER],
 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 8 updated: 2012/10/06 08:57:51
+dnl CF_UTF8_LIB version: 9 updated: 2021/05/19 19:35:25
 dnl -----------
 dnl Check for multibyte support, and if not found, utf8 compatibility library
 AC_DEFUN([CF_UTF8_LIB],
 [
+AC_HAVE_HEADERS(wchar.h)
 AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
        cf_save_LIBS="$LIBS"
        AC_TRY_LINK([
-#include <stdlib.h>],[putwc(0,0);],
+#include <stdlib.h>
+#include <stdio.h>
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+],[putwc(0,0);],
        [cf_cv_utf8_lib=yes],
        [CF_FIND_LINKAGE([
 #include <libutf8.h>],[putwc(0,0);],utf8,
@@ -9407,7 +9449,7 @@ fi
 AC_SUBST(no_x11_rgb)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 57 updated: 2021/01/01 16:53:59
+dnl CF_XOPEN_SOURCE version: 58 updated: 2021/05/01 17:49:36
 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,
@@ -9472,7 +9514,15 @@ case "$host_os" in
 (netbsd*)
        cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
        ;;
-(openbsd[[4-9]]*)
+(openbsd[[6-9]]*)
+       # OpenBSD 6.x has broken locale support, both compile-time and runtime.
+       # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html
+       # Abusing the conformance level is a workaround.
+       AC_MSG_WARN(this system does not provide usable locale support)
+       cf_xopen_source="-D_BSD_SOURCE"
+       cf_XOPEN_SOURCE=700
+       ;;
+(openbsd[[4-5]]*)
        # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
        cf_xopen_source="-D_BSD_SOURCE"
        cf_XOPEN_SOURCE=600