ncurses 6.3 - patch 20220729

+ fixes to build with dietlibc:
  + add configure check for fpathconf (report by Georg Lehner).
  + add configure check for math sine/cosine, needed in test/tclock,
    and eliminate pow() from test/hanoi (report by Georg Lehner).
  + use wcsnlen as an alternative to wmemchr if it is not found
    (adapted from patch by Georg Lehner).
+ trim out some unwanted linker options from ncurses*config and .pc
  files seen in Fedora 36+.
This commit is contained in:
Thomas E. Dickey 2022-07-29 21:04:24 +00:00
parent 6662c1ccb4
commit 3183ac61c6
23 changed files with 2833 additions and 2620 deletions

12
NEWS
View File

@ -26,7 +26,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.3836 2022/07/24 10:06:18 tom Exp $
-- $Id: NEWS,v 1.3839 2022/07/28 20:18:34 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -46,6 +46,16 @@ See the AUTHORS file for the corresponding full names.
Changes through 1.9.9e did not credit all contributions;
it is not possible to add this information.
20220729
+ fixes to build with dietlibc:
+ add configure check for fpathconf (report by Georg Lehner).
+ add configure check for math sine/cosine, needed in test/tclock,
and eliminate pow() from test/hanoi (report by Georg Lehner).
+ use wcsnlen as an alternative to wmemchr if it is not found
(adapted from patch by Georg Lehner).
+ trim out some unwanted linker options from ncurses*config and .pc
files seen in Fedora 36+.
20220724
+ add portability notes for delscreen and delwin in manual.
+ improve pthread-configuration for test/worm.c, test/rain.c

View File

@ -1 +1 @@
5:0:10 6.3 20220724
5:0:10 6.3 20220729

40
aclocal.m4 vendored
View File

@ -29,7 +29,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: aclocal.m4,v 1.1004 2022/02/05 17:48:07 tom Exp $
dnl $Id: aclocal.m4,v 1.1007 2022/07/27 23:34:31 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
@ -6094,7 +6094,7 @@ CF_UPPER(cf_map_lib_basename,$2)
eval $1="\$${cf_map_lib_basename}_NAME"
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MATH_LIB version: 10 updated: 2020/12/31 18:40:20
dnl CF_MATH_LIB version: 11 updated: 2022/07/27 19:01:48
dnl -----------
dnl Checks for libraries. At least one UNIX system, Apple Macintosh
dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler
@ -6104,18 +6104,42 @@ AC_DEFUN([CF_MATH_LIB],
AC_CACHE_CHECK(if -lm needed for math functions,
cf_cv_need_libm,[
AC_TRY_LINK([
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
],
[double x = rand(); printf("result = %g\\n", ]ifelse([$2],,sin(x),$2)[)],
[cf_cv_need_libm=no],
[cf_cv_need_libm=yes])])
if test "$cf_cv_need_libm" = yes
then
ifelse($1,,[
CF_ADD_LIB(m)
],[$1=-lm])
cf_save_LIBS="$LIBS"
LIBS="$LIBS -lm"
AC_CACHE_CHECK(if -lm is available for math functions,
cf_cv_have_libm,[
AC_TRY_LINK([
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
],
[double x = rand(); printf("result = %g\\n", ]ifelse([$2],,sin(x),$2)[)],
[cf_cv_have_libm=yes],
[cf_cv_have_libm=no])])
LIBS="$cf_save_LIBS"
if test "$cf_cv_have_libm" = yes
then
ifelse($1,,[CF_ADD_LIB(m)],[$1=-lm])
fi
else
cf_cv_have_libm=yes
fi
if test "$cf_cv_have_libm" = yes
then
AC_DEFINE(HAVE_MATH_FUNCS,1,[Define to 1 if math functions are available])
fi
])
dnl ---------------------------------------------------------------------------

1941
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ dnl***************************************************************************
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
dnl $Id: configure.in,v 1.744 2022/04/17 00:26:25 tom Exp $
dnl $Id: configure.in,v 1.746 2022/07/28 20:14:30 tom Exp $
dnl Process this file with autoconf to produce a configure script.
dnl
dnl For additional information, see
@ -38,7 +38,7 @@ dnl https://invisible-island.net/autoconf/my-autoconf.html
dnl
dnl ---------------------------------------------------------------------------
AC_PREREQ(2.52.20210101)
AC_REVISION($Revision: 1.744 $)
AC_REVISION($Revision: 1.746 $)
AC_INIT(ncurses/base/lib_initscr.c)
AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin)
@ -967,7 +967,7 @@ if test "x$with_widec" = xyes ; then
# with_overwrite=no
NCURSES_CH_T=cchar_t
AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs)
AC_CHECK_FUNCS(putwc btowc wctob wmemchr mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs)
if test "x$ac_cv_func_putwc" != xyes ; then
CF_UTF8_LIB
if test "$cf_cv_utf8_lib" != no ; then
@ -1816,6 +1816,7 @@ CF_LINK_DATAONLY
### Checks for library functions.
AC_CHECK_FUNCS( \
fpathconf \
getcwd \
getegid \
geteuid \

View File

@ -26,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.1494 2022/07/24 09:45:40 tom Exp $
# $Id: dist.mk,v 1.1495 2022/07/29 19:45:25 tom Exp $
# Makefile for creating ncurses distributions.
#
# This only needs to be used directly as a makefile by developers, but
@ -38,7 +38,7 @@ SHELL = /bin/sh
# These define the major/minor/patch versions of ncurses.
NCURSES_MAJOR = 6
NCURSES_MINOR = 3
NCURSES_PATCH = 20220724
NCURSES_PATCH = 20220729
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -1,4 +1,4 @@
# $Id: ncurses_defs,v 1.99 2022/04/09 21:34:05 tom Exp $
# $Id: ncurses_defs,v 1.101 2022/07/28 20:15:27 tom Exp $
##############################################################################
# Copyright 2018-2021,2022 Thomas E. Dickey #
# Copyright 2000-2016,2017 Free Software Foundation, Inc. #
@ -68,6 +68,7 @@ HAVE_EXIT_TERMINFO 1
HAVE_FCNTL_H
HAVE_FILTER 1
HAVE_FORM_H
HAVE_FPATHCONF
HAVE_GETBEGX 1
HAVE_GETCURX 1
HAVE_GETCWD
@ -105,6 +106,7 @@ HAVE_LINK
HAVE_LOCALECONV
HAVE_LOCALE_H
HAVE_LONG_FILE_NAMES
HAVE_MATH_FUNCS
HAVE_MATH_H
HAVE_MBLEN
HAVE_MBRLEN
@ -212,6 +214,7 @@ HAVE_WCSTOMBS
HAVE_WCTOB
HAVE_WCTOMB
HAVE_WCTYPE_H
HAVE_WMEMCHR
HAVE_WINSDELLN 1
HAVE_WINSSTR 1
HAVE_WORKING_POLL

View File

@ -1,5 +1,5 @@
#!@SHELL@
# $Id: gen-pkgconfig.in,v 1.53 2022/07/16 17:07:38 tom Exp $
# $Id: gen-pkgconfig.in,v 1.54 2022/07/26 20:19:50 tom Exp $
##############################################################################
# Copyright 2018-2021,2022 Thomas E. Dickey #
# Copyright 2009-2015,2018 Free Software Foundation, Inc. #
@ -98,6 +98,9 @@ do
-Wl,--dynamic-linker*) # ignore ELF interpreter
continue
;;
-Wl,--as-needed|-Wl,--build-id=*|-Wl,-dT,*|-Wl,-T,*)
continue
;;
-L*)
lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
[ -d "$lib_check" ] || continue

View File

@ -1,5 +1,5 @@
#!@SHELL@
# $Id: ncurses-config.in,v 1.51 2022/07/16 17:07:38 tom Exp $
# $Id: ncurses-config.in,v 1.52 2022/07/26 21:36:28 tom Exp $
##############################################################################
# Copyright 2018-2021,2022 Thomas E. Dickey #
# Copyright 2006-2015,2017 Free Software Foundation, Inc. #
@ -113,6 +113,9 @@ do
-Wl,--dynamic-linker*) # ignore ELF interpreter
continue
;;
-Wl,--as-needed|-Wl,--build-id=*|-Wl,-dT,*|-Wl,-T,*)
continue
;;
-L*)
lib_check=`echo "x$opt" | sed -e 's/^.-L//'`
[ -d "$lib_check" ] || continue

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2020 Thomas E. Dickey *
* Copyright 2020,2022 Thomas E. Dickey *
* Copyright 1998-2009,2010 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@ -49,7 +49,7 @@
#include <curses.priv.h>
MODULE_ID("$Id: lib_kernel.c,v 1.34 2020/11/21 22:05:58 tom Exp $")
MODULE_ID("$Id: lib_kernel.c,v 1.35 2022/07/28 20:14:51 tom Exp $")
#ifdef TERMIOS
static int
@ -59,7 +59,7 @@ _nc_vdisable(void)
#if defined(_POSIX_VDISABLE) && HAVE_UNISTD_H
value = _POSIX_VDISABLE;
#endif
#if defined(_PC_VDISABLE)
#if defined(_PC_VDISABLE) && HAVE_FPATHCONF
if (value == -1) {
value = (int) fpathconf(0, _PC_VDISABLE);
if (value == -1) {

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2019-2020,2021 Thomas E. Dickey *
* Copyright 2019-2021,2022 Thomas E. Dickey *
* Copyright 2001-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@ -37,7 +37,7 @@
#include <curses.priv.h>
#include <wchar.h>
MODULE_ID("$Id: lib_cchar.c,v 1.37 2021/06/17 21:11:08 tom Exp $")
MODULE_ID("$Id: lib_cchar.c,v 1.38 2022/07/27 08:03:16 tom Exp $")
/*
* The SuSv2 description leaves some room for interpretation. We'll assume wch
@ -122,10 +122,13 @@ getcchar(const cchar_t *wcval,
wchar_t *wp;
int len;
#if HAVE_WMEMCHR
len = ((wp = wmemchr(wcval->chars, L'\0', (size_t) CCHARW_MAX))
? (int) (wp - wcval->chars)
: CCHARW_MAX);
#else
len = wcsnlen(wcval->chars, CCHARW_MAX);
#endif
if (wch == NULL) {
/*
* If the value is a null, set the length to 1.

View File

@ -1,8 +1,8 @@
ncurses6 (6.3+20220724) unstable; urgency=low
ncurses6 (6.3+20220729) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 24 Jul 2022 05:45:41 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 26 Jul 2022 10:04:04 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.3+20220724) unstable; urgency=low
ncurses6 (6.3+20220729) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 24 Jul 2022 05:45:41 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 26 Jul 2022 10:04:04 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.3+20220724) unstable; urgency=low
ncurses6 (6.3+20220729) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 24 Jul 2022 05:45:41 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Tue, 26 Jul 2022 10:04:04 -0400
ncurses6 (5.9-20120608) unstable; urgency=low

View File

@ -1,4 +1,4 @@
; $Id: mingw-ncurses.nsi,v 1.534 2022/07/24 09:45:40 tom Exp $
; $Id: mingw-ncurses.nsi,v 1.535 2022/07/26 14:04:04 tom Exp $
; TODO add examples
; TODO bump ABI to 6
@ -10,7 +10,7 @@
!define VERSION_MAJOR "6"
!define VERSION_MINOR "3"
!define VERSION_YYYY "2022"
!define VERSION_MMDD "0724"
!define VERSION_MMDD "0729"
!define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
!define MY_ABI "5"

View File

@ -3,7 +3,7 @@
Summary: shared libraries for terminal handling
Name: mingw32-ncurses6
Version: 6.3
Release: 20220724
Release: 20220729
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

@ -1,7 +1,7 @@
Summary: shared libraries for terminal handling
Name: ncurses6
Version: 6.3
Release: 20220724
Release: 20220729
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

@ -1,7 +1,7 @@
Summary: Curses library with POSIX thread support.
Name: ncursest6
Version: 6.3
Release: 20220724
Release: 20220729
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

40
test/aclocal.m4 vendored
View 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.203 2022/01/23 00:22:31 tom Exp $
dnl $Id: aclocal.m4,v 1.205 2022/07/27 23:35:25 tom Exp $
dnl
dnl Author: Thomas E. Dickey
dnl
@ -2488,7 +2488,7 @@ AC_SUBST(MAKE_UPPER_TAGS)
AC_SUBST(MAKE_LOWER_TAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_MATH_LIB version: 10 updated: 2020/12/31 18:40:20
dnl CF_MATH_LIB version: 11 updated: 2022/07/27 19:01:48
dnl -----------
dnl Checks for libraries. At least one UNIX system, Apple Macintosh
dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler
@ -2498,18 +2498,42 @@ AC_DEFUN([CF_MATH_LIB],
AC_CACHE_CHECK(if -lm needed for math functions,
cf_cv_need_libm,[
AC_TRY_LINK([
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
],
[double x = rand(); printf("result = %g\\n", ]ifelse([$2],,sin(x),$2)[)],
[cf_cv_need_libm=no],
[cf_cv_need_libm=yes])])
if test "$cf_cv_need_libm" = yes
then
ifelse($1,,[
CF_ADD_LIB(m)
],[$1=-lm])
cf_save_LIBS="$LIBS"
LIBS="$LIBS -lm"
AC_CACHE_CHECK(if -lm is available for math functions,
cf_cv_have_libm,[
AC_TRY_LINK([
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
],
[double x = rand(); printf("result = %g\\n", ]ifelse([$2],,sin(x),$2)[)],
[cf_cv_have_libm=yes],
[cf_cv_have_libm=no])])
LIBS="$cf_save_LIBS"
if test "$cf_cv_have_libm" = yes
then
ifelse($1,,[CF_ADD_LIB(m)],[$1=-lm])
fi
else
cf_cv_have_libm=yes
fi
if test "$cf_cv_have_libm" = yes
then
AC_DEFINE(HAVE_MATH_FUNCS,1,[Define to 1 if math functions are available])
fi
])
dnl ---------------------------------------------------------------------------

3328
test/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2019-2020,2021 Thomas E. Dickey *
* Copyright 2019-2021,2022 Thomas E. Dickey *
* Copyright 1998-2014,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@ -42,7 +42,7 @@
*
* Date: 05.Nov.90
*
* $Id: hanoi.c,v 1.42 2021/05/08 20:44:44 tom Exp $
* $Id: hanoi.c,v 1.44 2022/07/28 00:31:22 tom Exp $
*/
#include <test.priv.h>
@ -125,6 +125,15 @@ InitTiles(void)
Pegs[2].Count = 0;
}
static int
two2n(int n)
{
int result = 1;
while (n-- > 0)
result *= 2;
return result;
}
static void
DisplayTiles(void)
{
@ -134,7 +143,7 @@ DisplayTiles(void)
erase();
MvAddStr(1, 24, "T O W E R S O F H A N O I");
MvAddStr(3, 34, "SJR 1990");
MvPrintw(19, 5, "Moves : %d of %.0f", NMoves, pow(2.0, (float) NTiles) - 1);
MvPrintw(19, 5, "Moves : %d of %d", NMoves, two2n(NTiles) - 1);
(void) attrset(A_REVERSE);
MvAddStr(BASELINE, 8,
" ");

View File

@ -1,9 +1,9 @@
/* $Id: tclock.c,v 1.42 2020/12/26 17:56:36 tom Exp $ */
/* $Id: tclock.c,v 1.43 2022/07/27 19:23:01 tom Exp $ */
#define NEED_TIME_H
#include <test.priv.h>
#if HAVE_MATH_H
#if HAVE_MATH_H && HAVE_MATH_FUNCS
#include <math.h>
@ -289,7 +289,7 @@ main(int argc, char *argv[])
int
main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
{
printf("This program requires the development header math.h\n");
printf("This program requires the header math.h and trignometric functions\n");
ExitProgram(EXIT_FAILURE);
}
#endif

View File

@ -30,7 +30,7 @@
/****************************************************************************
* Author: Thomas E. Dickey 1996-on *
****************************************************************************/
/* $Id: test.priv.h,v 1.202 2022/07/16 18:49:01 tom Exp $ */
/* $Id: test.priv.h,v 1.203 2022/07/27 08:26:39 tom Exp $ */
#ifndef __TEST_PRIV_H
#define __TEST_PRIV_H 1
@ -171,6 +171,10 @@
#define HAVE_LOCALE_H 0
#endif
#ifndef HAVE_MATH_FUNCS
#define HAVE_MATH_FUNCS 0
#endif
#ifndef HAVE_MATH_H
#define HAVE_MATH_H 0
#endif