ncurses 6.2 - patch 20210418

+ improve CF_LINK_FUNCS by ensuring that the source-file is closed
  before linking to the target.
+ add "check" rules for headers in c++, progs and test-directories.
+ build-fix for termsort module when configured with termcap (reports
  by Rajeev V Pillai, Rudi Heitbaum).
This commit is contained in:
Thomas E. Dickey 2021-04-19 00:00:48 +00:00
parent a5fe3726f7
commit 7f4b9f3906
23 changed files with 145 additions and 87 deletions

9
NEWS
View File

@ -26,7 +26,7 @@
-- sale, use or other dealings in this Software without prior written --
-- authorization. --
-------------------------------------------------------------------------------
-- $Id: NEWS,v 1.3653 2021/04/17 22:26:02 tom Exp $
-- $Id: NEWS,v 1.3656 2021/04/18 18:13:32 tom Exp $
-------------------------------------------------------------------------------
This is a log of changes that ncurses has gone through since Zeyd started
@ -46,6 +46,13 @@ 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.
20210418
+ improve CF_LINK_FUNCS by ensuring that the source-file is closed
before linking to the target.
+ add "check" rules for headers in c++, progs and test-directories.
+ build-fix for termsort module when configured with termcap (reports
by Rajeev V Pillai, Rudi Heitbaum).
20210417
+ extend --disable-pkg-ldflags option to also control whether $LDFLAGS
from the build is provided in -config and .pc files (Debian #986764).

View File

@ -1 +1 @@
5:0:10 6.2 20210417
5:0:10 6.2 20210418

38
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.957 2021/04/03 20:43:02 tom Exp $
dnl $Id: aclocal.m4,v 1.958 2021/04/18 18:12:13 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
@ -5094,7 +5094,7 @@ AC_SUBST(BROKEN_LINKER)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_LINK_FUNCS version: 10 updated: 2021/04/03 15:45: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.
@ -5120,6 +5120,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
@ -5128,27 +5129,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);
if ($cf_func("config.log", "conftest.chk") < 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;
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);
}

View File

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.129 2021/03/20 10:14:27 tom Exp $
# $Id: Makefile.in,v 1.130 2021/04/18 15:13:58 tom Exp $
##############################################################################
# Copyright 2018-2020,2021 Thomas E. Dickey #
# Copyright 1998-2015,2016 Free Software Foundation, Inc. #
@ -259,6 +259,18 @@ etip.h: $(srcdir)/etip.h.in $(srcdir)/edit_cfg.sh
cp $(srcdir)/etip.h.in $@
$(SHELL) $(srcdir)/edit_cfg.sh ../include/ncurses_cfg.h $@
# Verify that each header-file can be compiled without including another.
check::
@$(SHELL) -c "for header in *.h;\
do \
[ \$${header} = etip.h ] && continue; \
echo \"** testing \$${header}\" ; \
echo \"#include <\$${header}>\" >headers.cc; \
echo \"int main(int argc, char **argv) { (void) argc; (void) argv; return 0; }\" >>headers.cc; \
$(CXX) -c $(CXXFLAGS) $(CPPFLAGS) headers.cc; \
done"
-@rm -f headers.*
###############################################################################
# The remainder of this file is automatically generated during configuration
###############################################################################

34
configure vendored
View File

@ -9426,6 +9426,7 @@ else
#line 9426 "configure"
#include "confdefs.h"
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
@ -9434,27 +9435,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);
if ($cf_func("config.log", "conftest.chk") < 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;
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);
}

View File

@ -26,7 +26,7 @@
# use or other dealings in this Software without prior written #
# authorization. #
##############################################################################
# $Id: dist.mk,v 1.1410 2021/04/17 10:16:06 tom Exp $
# $Id: dist.mk,v 1.1411 2021/04/18 10:23:11 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 = 2
NCURSES_PATCH = 20210417
NCURSES_PATCH = 20210418
# We don't append the patch to the version, since this only applies to releases
VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)

View File

@ -40,14 +40,14 @@
#define CUR SP_TERMTYPE
#endif
MODULE_ID("$Id: lib_print.c,v 1.29 2021/04/17 16:12:54 tom Exp $")
MODULE_ID("$Id: lib_print.c,v 1.30 2021/04/18 14:58:57 tom Exp $")
NCURSES_EXPORT(int)
NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len)
/* ship binary character data to the printer via mc4/mc5/mc5p */
{
int result;
char *mybuf, *switchon;
char *mybuf = NULL, *switchon;
size_t onsize, offsize;
size_t need;

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2018-2019,2020 Thomas E. Dickey *
* Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@ -57,7 +57,7 @@
#include <sys/types.h>
#include <tic.h>
MODULE_ID("$Id: read_termcap.c,v 1.98 2020/02/02 23:34:34 tom Exp $")
MODULE_ID("$Id: read_termcap.c,v 1.99 2021/04/18 11:43:38 tom Exp $")
#if !PURE_TERMINFO
@ -1064,14 +1064,16 @@ _nc_read_termcap_entry(const char *const tn, TERMTYPE2 *const tp)
}
}
#define PRIVATE_CAP "%s/.termcap"
#define PRIVATE_CAP "%.*s/.termcap"
if (use_terminfo_vars() && (h = getenv("HOME")) != NULL && *h != '\0'
&& (strlen(h) + sizeof(PRIVATE_CAP)) < PATH_MAX) {
/* user's .termcap, if any, should override it */
_nc_STRCPY(envhome, h, sizeof(envhome));
_nc_SPRINTF(pathbuf, _nc_SLIMIT(sizeof(pathbuf))
PRIVATE_CAP, envhome);
PRIVATE_CAP,
(int) (sizeof(pathbuf) - sizeof(PRIVATE_CAP)),
envhome);
ADD_TC(pathbuf, filecount);
}
}

View File

@ -1,8 +1,8 @@
ncurses6 (6.2+20210417) unstable; urgency=low
ncurses6 (6.2+20210418) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Apr 2021 06:16:07 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 18 Apr 2021 06:23:11 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.2+20210417) unstable; urgency=low
ncurses6 (6.2+20210418) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Apr 2021 06:16:07 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 18 Apr 2021 06:23:11 -0400
ncurses6 (5.9-20131005) unstable; urgency=low

View File

@ -1,8 +1,8 @@
ncurses6 (6.2+20210417) unstable; urgency=low
ncurses6 (6.2+20210418) unstable; urgency=low
* latest weekly patch
-- Thomas E. Dickey <dickey@invisible-island.net> Sat, 17 Apr 2021 06:16:07 -0400
-- Thomas E. Dickey <dickey@invisible-island.net> Sun, 18 Apr 2021 06:23:11 -0400
ncurses6 (5.9-20120608) unstable; urgency=low

View File

@ -1,4 +1,4 @@
; $Id: mingw-ncurses.nsi,v 1.453 2021/04/17 10:16:06 tom Exp $
; $Id: mingw-ncurses.nsi,v 1.454 2021/04/18 10:23:11 tom Exp $
; TODO add examples
; TODO bump ABI to 6
@ -10,7 +10,7 @@
!define VERSION_MAJOR "6"
!define VERSION_MINOR "2"
!define VERSION_YYYY "2021"
!define VERSION_MMDD "0417"
!define VERSION_MMDD "0418"
!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.2
Release: 20210417
Release: 20210418
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.2
Release: 20210417
Release: 20210418
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.2
Release: 20210417
Release: 20210418
License: X11
Group: Development/Libraries
Source: ncurses-%{version}-%{release}.tgz

View File

@ -1,10 +1,10 @@
#!/bin/sh
# $Id: MKtermsort.sh,v 1.13 2020/02/02 23:34:34 tom Exp $
# $Id: MKtermsort.sh,v 1.16 2021/04/18 20:12:50 tom Exp $
#
# MKtermsort.sh -- generate indirection vectors for the various sort methods
#
##############################################################################
# Copyright 2020 Thomas E. Dickey #
# Copyright 2020,2021 Thomas E. Dickey #
# Copyright 1998-2015,2017 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -48,14 +48,25 @@ DATA=${2-../include/Caps}
data=data$$
trap 'rm -f $data' 1 2 3 15
sed -e 's/[ ][ ]*/ /g' < $DATA >$data
sed -e 's/[ ][ ]*/ /g' < "$DATA" >$data
DATA=$data
echo "/*";
echo " * termsort.c --- sort order arrays for use by infocmp.";
echo " *";
echo " * Note: this file is generated using MKtermsort.sh, do not edit by hand.";
echo " */";
cat <<EOF
/*
* termsort.h --- sort order arrays for use by infocmp.
*
* Note: this file is generated using MKtermsort.sh, do not edit by hand.
*/
#ifndef _TERMSORT_H
#define _TERMSORT_H 1
#include <curses.h>
#ifndef DUMP_ENTRY_H
typedef unsigned PredType;
typedef unsigned PredIdx;
#endif
EOF
echo "static const PredIdx bool_terminfo_sort[] = {";
$AWK <$DATA '
@ -165,7 +176,11 @@ $3 == "str" && substr($7, 1, 1) == "-" {print "\tFALSE,\t/* ", $2, " */";
$3 == "str" && substr($7, 1, 1) == "Y" {print "\tTRUE,\t/* ", $2, " */"; valid = count++; }
END { printf "#define OK_str_from_termcap %d\n", valid; }
'
echo "};";
echo "";
cat <<EOF
};
#endif /* _TERMSORT_H */
EOF
rm -f $data

View File

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.109 2021/04/17 15:32:22 tom Exp $
# $Id: Makefile.in,v 1.110 2021/04/18 11:32:39 tom Exp $
##############################################################################
# Copyright 2020,2021 Thomas E. Dickey #
# Copyright 1998-2016,2018 Free Software Foundation, Inc. #
@ -133,7 +133,7 @@ LINT_OPTS = @LINT_OPTS@
LINT_LIBS = -lncurses @LIBS@
AUTO_SRC = \
termsort.c \
termsort.h \
transform.h
# tic relies on direct access to the terminfo database
@ -292,7 +292,7 @@ DEPS_TSET = \
tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h
@ECHO_LD@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@
termsort.c: $(srcdir)/MKtermsort.sh
termsort.h: $(srcdir)/MKtermsort.sh
$(SHELL) $(srcdir)/MKtermsort.sh $(AWK) $(srcdir)/../include/@TERMINFO_CAPS@ >$@
#
@ -336,6 +336,17 @@ lint:
$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c $(LINT_LIBS)
$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c $(LINT_LIBS)
# Verify that each header-file can be compiled without including another.
check:
@$(SHELL) -c "for header in *.h;\
do \
echo \"** testing \$${header}\" ; \
echo \"#include <\$${header}>\" >headers.c; \
echo \"int main(void) { return 0; }\" >>headers.c; \
$(CC) -c $(CFLAGS) $(CPPFLAGS) headers.c; \
done"
-@rm -f headers.*
###############################################################################
# The remainder of this file is automatically generated during configuration
###############################################################################

View File

@ -36,11 +36,11 @@
#define __INTERNAL_CAPS_VISIBLE
#include <progs.priv.h>
#include "dump_entry.h"
#include "termsort.c" /* this C file is generated */
#include <dump_entry.h>
#include <termsort.h> /* this C file is generated */
#include <parametrized.h> /* so is this */
MODULE_ID("$Id: dump_entry.c,v 1.185 2021/04/17 15:24:04 tom Exp $")
MODULE_ID("$Id: dump_entry.c,v 1.186 2021/04/18 11:33:08 tom Exp $")
#define DISCARD(string) string = ABSENT_STRING
#define PRINTF (void) printf

View File

@ -1,5 +1,5 @@
/****************************************************************************
* Copyright 2018,2020 Thomas E. Dickey *
* Copyright 2018-2020,2021 Thomas E. Dickey *
* Copyright 1998-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@ -34,7 +34,7 @@
****************************************************************************/
/*
* $Id: dump_entry.h,v 1.43 2020/11/14 18:16:57 tom Exp $
* $Id: dump_entry.h,v 1.44 2021/04/18 19:56:09 tom Exp $
*
* Dump control definitions and variables
*/
@ -67,8 +67,11 @@
#define CMP_STRING 2 /* comparison on strings */
#define CMP_USE 3 /* comparison on use capabilities */
#ifndef _TERMSORT_H
typedef unsigned PredType;
typedef unsigned PredIdx;
#endif
typedef int (*PredFunc) (PredType, PredIdx);
typedef void (*PredHook) (PredType, PredIdx, const char *);

View File

@ -1,4 +1,4 @@
# $Id: modules,v 1.23 2021/04/17 16:05:34 tom Exp $
# $Id: modules,v 1.25 2021/04/18 17:21:03 tom Exp $
# Program modules (some are in ncurses lib!)
##############################################################################
# Copyright 2020,2021 Thomas E. Dickey #
@ -37,12 +37,12 @@ clear progs $(srcdir) $(HEADER_DEPS) tty_settings.h
tic progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h $(srcdir)/tparm_type.h
toe progs $(srcdir) $(HEADER_DEPS) $(INCDIR)/hashed_db.h
clear_cmd progs $(srcdir) $(HEADER_DEPS) clear_cmd.h
dump_entry progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h ../include/parametrized.h $(INCDIR)/capdefaults.c termsort.c
dump_entry progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h ../include/parametrized.h $(INCDIR)/capdefaults.c termsort.h
infocmp progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h
reset_cmd progs $(srcdir) $(HEADER_DEPS) reset_cmd.h tty_settings.h
tabs progs $(srcdir) $(HEADER_DEPS)
tparm_type progs $(srcdir) $(HEADER_DEPS) $(srcdir)/tparm_type.h
tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/tparm_type.h termsort.c reset_cmd.h tty_settings.h
tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/tparm_type.h reset_cmd.h tty_settings.h
tset progs $(srcdir) $(HEADER_DEPS) transform.h ../include/termcap.h reset_cmd.h tty_settings.h
transform progs $(srcdir) $(HEADER_DEPS) transform.h
tty_settings progs $(srcdir) $(HEADER_DEPS) tty_settings.h

View File

@ -44,13 +44,10 @@
#include <clear_cmd.h>
#include <reset_cmd.h>
#if !PURE_TERMINFO
#include <termsort.c>
#endif
#include <transform.h>
#include <tty_settings.h>
MODULE_ID("$Id: tput.c,v 1.88 2021/04/17 15:34:16 tom Exp $")
MODULE_ID("$Id: tput.c,v 1.90 2021/04/18 17:18:19 tom Exp $")
#define PUTS(s) fputs(s, stdout)

View File

@ -1,4 +1,4 @@
# $Id: Makefile.in,v 1.126 2021/03/13 20:55:43 tom Exp $
# $Id: Makefile.in,v 1.127 2021/04/18 11:48:06 tom Exp $
##############################################################################
# Copyright 2020,2021 Thomas E. Dickey #
# Copyright 1998-2017,2018 Free Software Foundation, Inc. #
@ -153,4 +153,15 @@ HEADER_DEPS = \
$(incdir)/unctrl.h \
$(INCDIR)/nc_alloc.h
# Verify that each header-file can be compiled without including another.
check::
@$(SHELL) -c "for header in *.h;\
do \
echo \"** testing \$${header}\" ; \
echo \"#include <\$${header}>\" >headers.c; \
echo \"int main(void) { return 0; }\" >>headers.c; \
$(CC) -c $(CFLAGS) $(CPPFLAGS) headers.c; \
done"
-@rm -f headers.*
# The rest is generated from the "programs" and "modules" files...

View File

@ -1,6 +1,6 @@
# $Id: mk-test.awk,v 1.23 2020/02/02 23:34:34 tom Exp $
# $Id: mk-test.awk,v 1.24 2021/04/18 11:49:55 tom Exp $
##############################################################################
# Copyright 2019,2020 Thomas E. Dickey #
# Copyright 2019-2020,2021 Thomas E. Dickey #
# Copyright 2006-2017,2018 Free Software Foundation, Inc. #
# #
# Permission is hereby granted, free of charge, to any person obtaining a #
@ -81,7 +81,7 @@ END {
print ""
print "sources:"
print ""
print "check:"
print "check::"
print " @ echo The test-programs are interactive"
print "tags:"
print " $(CTAGS) *.[ch]"