Modernize versioning and release infrastructure.

Signed-off-by: Simon Josefsson <simon@josefsson.org>
diff --git a/.clcopying b/.clcopying
deleted file mode 100644
index 4aa7d79..0000000
--- a/.clcopying
+++ /dev/null
@@ -1,5 +0,0 @@
-	----------------------------------------------------------------------
-	Copyright (C) 2002-2021 Free Software Foundation, Inc.
-	Copying and distribution of this file, with or without modification,
-	are permitted in any medium without royalty provided the copyright
-	notice and this notice are preserved.
diff --git a/.gitignore b/.gitignore
index 28ab335..de9efd9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,205 +1,209 @@
-*~
-aclocal.m4
-aminclude_static.am
-autom4te.cache/
-build-aux/ar-lib
-build-aux/compile
-build-aux/config.guess
-build-aux/config.sub
-build-aux/depcomp
-build-aux/install-sh
-build-aux/ltmain.sh
-build-aux/mdate-sh
-build-aux/missing
-build-aux/test-driver
-build-aux/texinfo.tex
-build-aux/ylwrap
-ChangeLog
-config.h
-config.h.in
-config.log
-config.status
-configure
-.deps
-doc/asn1Coding.1
-doc/asn1Decoding.1
-doc/asn1Parser.1
-doc/coverage/
-doc/cyclo/cyclo-libtasn1.html
-doc/cyclo/Makefile
-doc/cyclo/Makefile.in
-doc/libtasn1.aux
-doc/libtasn1.cp
-doc/libtasn1.cps
-doc/libtasn1.dvi
-doc/libtasn1.fn
-doc/libtasn1.fns
-doc/libtasn1.html
-doc/libtasn1.info
-doc/libtasn1.ky
-doc/libtasn1.log
-doc/libtasn1.pdf
-doc/libtasn1.pg
-doc/libtasn1.ps
-doc/libtasn1.t2d/
-doc/libtasn1.t2p/
-doc/libtasn1.toc
-doc/libtasn1.tp
-doc/libtasn1.vr
-doc/Makefile
-doc/Makefile.in
-doc/man/
-doc/reference/html/
-doc/reference/html-build.stamp
-doc/reference/html.stamp
-doc/reference/libtasn1.args
-doc/reference/libtasn1-decl-list.txt
-doc/reference/libtasn1-decl.txt
-doc/reference/libtasn1.hierarchy
-doc/reference/libtasn1.interfaces
-doc/reference/libtasn1-overrides.txt
-doc/reference/libtasn1.pdf
-doc/reference/libtasn1.prerequisites
-doc/reference/libtasn1-sections.txt
-doc/reference/libtasn1.signals
-doc/reference/libtasn1.types
-doc/reference/libtasn1-undeclared.txt
-doc/reference/libtasn1-undocumented.txt
-doc/reference/libtasn1-unused.txt
-doc/reference/Makefile
-doc/reference/Makefile.in
-doc/reference/pdf-build.stamp
-doc/reference/pdf.stamp
-doc/reference/scan-build.stamp
-doc/reference/setup-build.stamp
-doc/reference/sgml-build.stamp
-doc/reference/sgml.stamp
-doc/reference/tmpl/
-doc/reference/tmpl-build.stamp
-doc/reference/tmpl.stamp
-doc/reference/version.xml
-doc/reference/xml/
-doc/stamp_docs
-doc/stamp-vti
-doc/texi/
-doc/version.texi
-examples/CertificateExample
-examples/CertificateExample.o
-examples/CrlExample
-examples/CrlExample.o
-examples/.deps/
-examples/.libs/
-examples/Makefile
-examples/Makefile.in
-examples/pkix_asn1_tab.c
-examples/pkix_asn1_tab.o
-fuzz/*_fuzzer
-fuzz/*.log
-fuzz/*.new
-fuzz/*.o
-fuzz/*.trs
-fuzz/corpus2array
+!lib/gl/doc/gendocs_template.diff
+!lib/gl/top/README-release.diff
 *.gcda
 *.gcno
 *.gcov
-.gitignore
-gtk-doc.m4
-INSTALL
-lib/ASN1.c
-lib/ASN1.lo
-lib/ASN1.o
-lib/ASN1.tab.c
-lib/coding.lo
-lib/coding.o
-lib/decoding.lo
-lib/decoding.o
-lib/.deps/
-lib/element.lo
-lib/element.o
-lib/errors.lo
-lib/errors.o
-lib/gl/
-lib/gstr.lo
-lib/gstr.o
-lib/.libs/
-lib/includes/libtasn1.h
-lib/libtasn1.la
-lib/libtasn1.pc
-lib/Makefile
-lib/Makefile.in
-lib/parser_aux.lo
-lib/parser_aux.o
-lib/structure.lo
-lib/structure.o
-libtasn1-*.tar.gz
-libtasn1-*.tar.gz.sig
-libtool
-lib/version.lo
-lib/version.o
-m4-gl/
-m4/.gitignore
-m4/libtool.m4
-m4/lt~obsolete.m4
-m4/ltoptions.m4
-m4/ltsugar.m4
-m4/ltversion.m4
-Makefile
-Makefile.in
-README
-scan.tmp
-src/asn1Coding
-src/asn1Coding.o
-src/asn1Decoding
-src/asn1Decoding.o
-src/asn1Parser
-src/asn1Parser.o
-src/benchmark.o
-src/.deps/
-src/.libs/
-src/Makefile
-src/Makefile.in
-stamp-h1
-tags
-tests/coding-decoding2
-tests/coding-long-oid
-tests/copynode
-tests/CVE-2018-1000654
-tests/CVE-2018-1000654-1_asn1_tab.h
-tests/CVE-2018-1000654-2_asn1_tab.h
-tests/.deps/
-tests-gl/
-tests/*.log
-tests/Makefile
-tests/Makefile.in
-tests/*.o
-tests/object-id-decoding
-tests/ocsp-basic-response
-tests/octet-string
-tests/setof
-tests/spc_pe_image_data
-tests/strict-der
-tests/Test_choice
-tests/Test_choice.o
-tests/Test_choice_ocsp
-tests/Test_encdec
-tests/Test_encoding
-tests/Test_encoding.o
-tests/Test_errors
-tests/Test_errors.o
-tests/Test_indefinite
-tests/Test_indefinite.o
-tests/Test_overflow
-tests/Test_overflow.o
-tests/Test_parser
-tests/Test_parser_ERROR.asn
-tests/Test_parser.o
-tests/Test_simple
-tests/Test_simple.o
-tests/Test_strings
-tests/Test_strings.o
-tests/Test_tree
-tests/Test_tree.o
-tests/*.trs
-windows/libtasn1-*-win??.zip
-windows/tmp
-tests/object-id-encoding
+*~
+/.deps
+/.gitignore
+/ChangeLog
+/INSTALL
+/Makefile
+/Makefile.in
+/README-release
+/aclocal.m4
+/aminclude_static.am
+/autom4te.cache/
+/build-aux
+/build-aux/ar-lib
+/build-aux/compile
+/build-aux/config.guess
+/build-aux/config.sub
+/build-aux/depcomp
+/build-aux/install-sh
+/build-aux/ltmain.sh
+/build-aux/mdate-sh
+/build-aux/missing
+/build-aux/test-driver
+/build-aux/texinfo.tex
+/build-aux/ylwrap
+/config.h
+/config.h.in
+/config.log
+/config.status
+/configure
+/doc/Makefile
+/doc/Makefile.in
+/doc/asn1Coding.1
+/doc/asn1Decoding.1
+/doc/asn1Parser.1
+/doc/coverage/
+/doc/cyclo/Makefile
+/doc/cyclo/Makefile.in
+/doc/cyclo/cyclo-libtasn1.html
+/doc/gendocs_template
+/doc/gendocs_template_min
+/doc/libtasn1.aux
+/doc/libtasn1.cp
+/doc/libtasn1.cps
+/doc/libtasn1.dvi
+/doc/libtasn1.fn
+/doc/libtasn1.fns
+/doc/libtasn1.html
+/doc/libtasn1.info
+/doc/libtasn1.ky
+/doc/libtasn1.log
+/doc/libtasn1.pdf
+/doc/libtasn1.pg
+/doc/libtasn1.ps
+/doc/libtasn1.t2d/
+/doc/libtasn1.t2p/
+/doc/libtasn1.toc
+/doc/libtasn1.tp
+/doc/libtasn1.vr
+/doc/man/
+/doc/reference/Makefile
+/doc/reference/Makefile.in
+/doc/reference/html-build.stamp
+/doc/reference/html.stamp
+/doc/reference/html/
+/doc/reference/libtasn1-decl-list.txt
+/doc/reference/libtasn1-decl.txt
+/doc/reference/libtasn1-overrides.txt
+/doc/reference/libtasn1-sections.txt
+/doc/reference/libtasn1-undeclared.txt
+/doc/reference/libtasn1-undocumented.txt
+/doc/reference/libtasn1-unused.txt
+/doc/reference/libtasn1.args
+/doc/reference/libtasn1.hierarchy
+/doc/reference/libtasn1.interfaces
+/doc/reference/libtasn1.pdf
+/doc/reference/libtasn1.prerequisites
+/doc/reference/libtasn1.signals
+/doc/reference/libtasn1.types
+/doc/reference/pdf-build.stamp
+/doc/reference/pdf.stamp
+/doc/reference/scan-build.stamp
+/doc/reference/setup-build.stamp
+/doc/reference/sgml-build.stamp
+/doc/reference/sgml.stamp
+/doc/reference/tmpl-build.stamp
+/doc/reference/tmpl.stamp
+/doc/reference/tmpl/
+/doc/reference/version.xml
+/doc/reference/xml/
+/doc/stamp-vti
+/doc/stamp_docs
+/doc/texi/
+/doc/version.texi
+/examples/.deps/
+/examples/.libs/
+/examples/CertificateExample
+/examples/CertificateExample.o
+/examples/CrlExample
+/examples/CrlExample.o
+/examples/Makefile
+/examples/Makefile.in
+/examples/pkix_asn1_tab.c
+/examples/pkix_asn1_tab.o
+/fuzz/*.log
+/fuzz/*.new
+/fuzz/*.o
+/fuzz/*.trs
+/fuzz/*_fuzzer
+/fuzz/.deps/
+/fuzz/Makefile
+/fuzz/Makefile.in
+/fuzz/corpus2array
+/gtk-doc.m4
+/gtk-doc.make
+/lib/.deps/
+/lib/.libs/
+/lib/ASN1.c
+/lib/ASN1.lo
+/lib/ASN1.o
+/lib/ASN1.tab.c
+/lib/Makefile
+/lib/Makefile.in
+/lib/coding.lo
+/lib/coding.o
+/lib/decoding.lo
+/lib/decoding.o
+/lib/element.lo
+/lib/element.o
+/lib/errors.lo
+/lib/errors.o
+/lib/gl/
+/lib/gstr.lo
+/lib/gstr.o
+/lib/includes/libtasn1.h
+/lib/libtasn1.la
+/lib/libtasn1.pc
+/lib/parser_aux.lo
+/lib/parser_aux.o
+/lib/structure.lo
+/lib/structure.o
+/lib/version.lo
+/lib/version.o
+/libtasn1-*.tar.gz
+/libtasn1-*.tar.gz.sig
+/libtool
+/m4/
+/maint.mk
+/scan.tmp
+/src/.deps/
+/src/.libs/
+/src/Makefile
+/src/Makefile.in
+/src/asn1Coding
+/src/asn1Coding.o
+/src/asn1Decoding
+/src/asn1Decoding.o
+/src/asn1Parser
+/src/asn1Parser.o
+/src/benchmark.o
+/stamp-h1
+/tags
+/tests-gl/
+/tests/*.log
+/tests/*.o
+/tests/*.trs
+/tests/.deps/
+/tests/CVE-2018-1000654
+/tests/CVE-2018-1000654-1_asn1_tab.h
+/tests/CVE-2018-1000654-2_asn1_tab.h
+/tests/Makefile
+/tests/Makefile.in
+/tests/Test_choice
+/tests/Test_choice.o
+/tests/Test_choice_ocsp
+/tests/Test_encdec
+/tests/Test_encoding
+/tests/Test_encoding.o
+/tests/Test_errors
+/tests/Test_errors.o
+/tests/Test_indefinite
+/tests/Test_indefinite.o
+/tests/Test_overflow
+/tests/Test_overflow.o
+/tests/Test_parser
+/tests/Test_parser.o
+/tests/Test_parser_ERROR.asn
+/tests/Test_simple
+/tests/Test_simple.o
+/tests/Test_strings
+/tests/Test_strings.o
+/tests/Test_tree
+/tests/Test_tree.o
+/tests/coding-decoding2
+/tests/coding-long-oid
+/tests/copynode
+/tests/object-id-decoding
+/tests/object-id-encoding
+/tests/ocsp-basic-response
+/tests/octet-string
+/tests/setof
+/tests/spc_pe_image_data
+/tests/strict-der
+/windows/libtasn1-*-win??.zip
+/windows/tmp
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2064bc2..a4398bc 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -12,6 +12,7 @@
   - yum remove -y libtasn1-devel
   - ./bootstrap
   - ./configure --disable-doc && make -j$(nproc)
+  - make syntax-check
   - make -j$(nproc) check
   - make abi-check
   - make distcheck
diff --git a/.prev-version b/.prev-version
index 8bbe6cf..ecbc3b0 100644
--- a/.prev-version
+++ b/.prev-version
@@ -1 +1 @@
-2.2
+4.16.0
diff --git a/LICENSE b/COPYING
similarity index 100%
rename from LICENSE
rename to COPYING
diff --git a/GNUmakefile b/GNUmakefile
deleted file mode 100644
index 0c99d58..0000000
--- a/GNUmakefile
+++ /dev/null
@@ -1,127 +0,0 @@
-# Having a separate GNUmakefile lets me 'include' the dynamically
-# generated rules created via cfg.mk (package-local configuration)
-# as well as maint.mk (generic maintainer rules).
-# This makefile is used only if you run GNU Make.
-# It is necessary if you want to build targets usually of interest
-# only to the maintainer.
-
-# Copyright (C) 2001, 2003, 2006-2021 Free Software Foundation, Inc.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <https://www.gnu.org/licenses/>.
-
-# If the user runs GNU make but has not yet run ./configure,
-# give them a diagnostic.
-_gl-Makefile := $(wildcard [M]akefile)
-ifneq ($(_gl-Makefile),)
-
-# Make tar archive easier to reproduce.
-export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner
-
-# Allow the user to add to this in the Makefile.
-ALL_RECURSIVE_TARGETS =
-
-include Makefile
-
-# Some projects override e.g., _autoreconf here.
--include $(srcdir)/cfg.mk
-
-# Allow cfg.mk to override these.
-_build-aux ?= build-aux
-_autoreconf ?= autoreconf -v
-
-include $(srcdir)/maint.mk
-
-# Ensure that $(VERSION) is up to date for dist-related targets, but not
-# for others: rerunning autoreconf and recompiling everything isn't cheap.
-_have-git-version-gen := \
-  $(shell test -f $(srcdir)/$(_build-aux)/git-version-gen && echo yes)
-ifeq ($(_have-git-version-gen)0,yes$(MAKELEVEL))
-  _is-dist-target ?= $(filter-out %clean, \
-    $(filter maintainer-% dist% alpha beta stable,$(MAKECMDGOALS)))
-  _is-install-target ?= $(filter-out %check, $(filter install%,$(MAKECMDGOALS)))
-  ifneq (,$(_is-dist-target)$(_is-install-target))
-    _curr-ver := $(shell cd $(srcdir)				\
-                   && $(_build-aux)/git-version-gen		\
-                         .tarball-version			\
-                         $(git-version-gen-tag-sed-script))
-    ifneq ($(_curr-ver),$(VERSION))
-      ifeq ($(_curr-ver),UNKNOWN)
-        $(info WARNING: unable to verify if $(VERSION) is the correct version)
-      else
-        ifneq (,$(_is-install-target))
-          # GNU Coding Standards state that 'make install' should not cause
-          # recompilation after 'make all'.  But as long as changing the version
-          # string alters config.h, the cost of having 'make all' always have an
-          # up-to-date version is prohibitive.  So, as a compromise, we merely
-          # warn when installing a version string that is out of date; the user
-          # should run 'autoreconf' (or something like 'make distcheck') to
-          # fix the version, 'make all' to propagate it, then 'make install'.
-          $(info WARNING: version string $(VERSION) is out of date;)
-          $(info run '$(MAKE) _version' to fix it)
-        else
-          $(info INFO: running autoreconf for new version string: $(_curr-ver))
-GNUmakefile: _version
-	touch GNUmakefile
-        endif
-      endif
-    endif
-  endif
-endif
-
-.PHONY: _version
-_version:
-	cd $(srcdir) && rm -rf autom4te.cache .version && $(_autoreconf)
-	$(MAKE) $(AM_MAKEFLAGS) Makefile
-
-else
-
-.DEFAULT_GOAL := abort-due-to-no-makefile
-srcdir = .
-
-# The package can override .DEFAULT_GOAL to run actions like autoreconf.
--include ./cfg.mk
-
-# Allow cfg.mk to override these.
-_build-aux ?= build-aux
-_autoreconf ?= autoreconf -v
-
-include ./maint.mk
-
-ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
-$(MAKECMDGOALS): abort-due-to-no-makefile
-endif
-
-abort-due-to-no-makefile:
-	@echo There seems to be no Makefile in this directory.   1>&2
-	@echo "You must run ./configure before running '$(MAKE)'." 1>&2
-	@exit 1
-
-endif
-
-# Tell version 3.79 and up of GNU make to not build goals in this
-# directory in parallel, in case someone tries to build multiple
-# targets, and one of them can cause a recursive target to be invoked.
-
-# Only set this if Automake doesn't provide it.
-AM_RECURSIVE_TARGETS ?= $(RECURSIVE_TARGETS:-recursive=) \
-  $(RECURSIVE_CLEAN_TARGETS:-recursive=) \
-  dist distcheck tags ctags
-
-ALL_RECURSIVE_TARGETS += $(AM_RECURSIVE_TARGETS)
-
-ifneq ($(word 2, $(MAKECMDGOALS)), )
-ifneq ($(filter $(ALL_RECURSIVE_TARGETS), $(MAKECMDGOALS)), )
-.NOTPARALLEL:
-endif
-endif
diff --git a/Makefile.am b/Makefile.am
index 09394f7..86cca65 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -24,9 +24,8 @@
 	windows/gnulib/getopt.h windows/gnulib/gnulib.vcproj		\
 	windows/libtasn1/libtasn1.vcproj				\
 	windows/test-parser/test-parser.vcproj				\
-	windows/test-tree/test-tree.vcproj windows/libtasn14win.mk	\
-	CONTRIBUTING.md cfg.mk maint.mk AUTHORS NEWS ChangeLog		\
-	THANKS LICENSE
+	windows/test-tree/test-tree.vcproj windows/libtasn14win.mk
+EXTRA_DIST += cfg.mk maint.mk CONTRIBUTING.md README.md
 
 SUBDIRS = lib src fuzz tests
 
@@ -36,9 +35,7 @@
 
 include $(top_srcdir)/aminclude_static.am
 
-ACLOCAL_AMFLAGS = -I m4 -I m4-gl
-
-EXTRA_DIST += cfg.mk maint.mk .clcopying README.md
+ACLOCAL_AMFLAGS = -I m4
 
 ABIDW_COMMON = --no-show-locs --no-corpus-path
 ABIGNORE_FILE = "$(top_srcdir)/devel/libtasn1.abignore"
@@ -94,10 +91,25 @@
 clean-local: code-coverage-clean
 distclean-local: code-coverage-dist-clean
 
-dist-hook:
+# git-version-gen
+EXTRA_DIST += $(top_srcdir)/.version
+BUILT_SOURCES = $(top_srcdir)/.version
+$(top_srcdir)/.version:
+	echo $(VERSION) > $@-t && mv $@-t $@
+dist-hook: gen-ChangeLog
+	echo $(VERSION) > $(distdir)/.tarball-version
 	if test -d "$(top_srcdir)/devel";then \
 		$(MAKE) -C $(top_srcdir) abi-check-latest; \
 		make -C doc/ compare-makefile; \
 	fi
 
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+	$(AM_V_GEN)if test -d .git; then				\
+		$(top_srcdir)/build-aux/gitlog-to-changelog >		\
+			$(distdir)/cl-t &&				\
+		{ rm -f $(distdir)/ChangeLog &&				\
+		  mv $(distdir)/cl-t $(distdir)/ChangeLog; }		\
+	fi
+
 .PHONY: abi-check abi-dump-versioned abi-dump-latest
diff --git a/NEWS b/NEWS
index e8f2dd6..b12a48a 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,13 @@
 GNU Libtasn1 NEWS                                     -*- outline -*-
 
 * Noteworthy changes in release ?.? (????-??-??) [?]
-- Print deprecation messages when deprecated macros are used.
-- Fix bugs unvelieled by Static Analysis, reported by Simo Sorce.
-
+- Print deprecation messages for deprecated macros, thanks to Tim Rühsen.
+- Fix some clang issues due to illegal pointers, thanks to Stefan Weil.
+- Restore handling of SIZE nodes, thanks to Dmitry Baryshkov.
+- Fix memory leak caught by oss-fuzz, thanks to Dmitry Baryshkov.
+- Gtk-doc fixes, thanks to Dmitry Baryshkov.
+- Fix bugs unveiled by Static Analysis, reported by Simo Sorce.
+- Update gnulib files and many build fixes.
 
 * Noteworthy changes in release 4.16.0 (released 2020-02-01) [stable]
 - asn1_decode_simple_ber: added support for constructed definite
diff --git a/README b/README
new file mode 120000
index 0000000..42061c0
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+README.md
\ No newline at end of file
diff --git a/README.md b/README.md
index a3c48a8..0adf558 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,4 @@
-|Branch|CI system|Status|
-|:----:|:-------:|-----:|
-|Master|Gitlab|[![build status](https://gitlab.com/gnutls/libtasn1/badges/master/pipeline.svg)](https://gitlab.com/gnutls/libtasn1/commits/master)[![coverage report](https://gitlab.com/gnutls/libtasn1/badges/master/coverage.svg)](https://gnutls.gitlab.io/libtasn1/coverage)|
-
-# libtasn1
+# Libtasn1 README -- Introduction information
 
 This is GNU Libtasn1, a small ASN.1 library.
 
diff --git a/bootstrap.conf b/bootstrap.conf
index 45e9689..514988c 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -1,5 +1,5 @@
+# Copyright (C) 2016-2021 Simon Josefsson
 # Copyright (C) 2016,2018 Tim Rühsen
-# Copyright (C) 2016-2017 Simon Josefsson
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -16,33 +16,36 @@
 
 # gnulib library name
 source_base=lib/gl
+local_gl_dir=$source_base
 tests_base=tests-gl
-m4_base=m4-gl
 gnulib_name=libgnu
 gnulib_tool_option_extras="--lgpl=2 --without-tests --no-vc-files"
-use_libtool=1
-checkout_only_file=
-local_gl_dir=lib/gl/override/
+checkout_only_file=.gitignore
 
 gnulib_modules="
 c-ctype
+git-version-gen
+gitlog-to-changelog
 intprops
+lib-msvc-compat
 lib-symbol-versions
 lib-symbol-visibility
 manywarnings
 minmax
+readme-release
 stdint
 strverscmp
+update-copyright
 valgrind-tests
-maintainer-makefile
 "
 
 # Build prerequisites
 buildreq="\
-autoconf   2.62
-automake   1.11.1
+autoconf   2.64
+automake   1.13
 git        1.4.4
 bison      -
+make       -
 "
 
 GTKDOCIZE=$(which gtkdocize 2>/dev/null)
@@ -54,16 +57,11 @@
   echo "CLEANFILES =" >>gtk-doc.make
   GTKDOCIZE=""
 else
-  $GTKDOCIZE
-fi
-
-# update git submodules
-git_options=
-if test -n "$SUBMODULE_NOFETCH"; then
-  git_options="--no-fetch"
+  $GTKDOCIZE --copy
 fi
 
 bootstrap_post_import_hook ()
 {
-  touch ChangeLog
+  # Automake requires that ChangeLog exist.
+  touch ChangeLog || return 1
 }
diff --git a/build-aux/gendocs.sh b/build-aux/gendocs.sh
deleted file mode 100755
index 3b71b36..0000000
--- a/build-aux/gendocs.sh
+++ /dev/null
@@ -1,504 +0,0 @@
-#!/bin/sh -e
-# gendocs.sh -- generate a GNU manual in many formats.  This script is
-#   mentioned in maintain.texi.  See the help message below for usage details.
-
-scriptversion=2016-12-31.18
-
-# Copyright 2003-2017 Free Software Foundation, Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#
-# Original author: Mohit Agarwal.
-# Send bug reports and any other correspondence to bug-gnulib@gnu.org.
-#
-# The latest version of this script, and the companion template, is
-# available from the Gnulib repository:
-#
-# http://git.savannah.gnu.org/cgit/gnulib.git/tree/build-aux/gendocs.sh
-# http://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/gendocs_template
-
-# TODO:
-# - image importing was only implemented for HTML generated by
-#   makeinfo.  But it should be simple enough to adjust.
-# - images are not imported in the source tarball.  All the needed
-#   formats (PDF, PNG, etc.) should be included.
-
-prog=`basename "$0"`
-srcdir=`pwd`
-
-scripturl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/build-aux/gendocs.sh"
-templateurl="http://git.savannah.gnu.org/cgit/gnulib.git/plain/doc/gendocs_template"
-
-: ${SETLANG="env LANG= LC_MESSAGES= LC_ALL= LANGUAGE="}
-: ${MAKEINFO="makeinfo"}
-: ${TEXI2DVI="texi2dvi"}
-: ${DOCBOOK2HTML="docbook2html"}
-: ${DOCBOOK2PDF="docbook2pdf"}
-: ${DOCBOOK2TXT="docbook2txt"}
-: ${GENDOCS_TEMPLATE_DIR="."}
-: ${PERL='perl'}
-: ${TEXI2HTML="texi2html"}
-unset CDPATH
-unset use_texi2html
-
-MANUAL_TITLE=
-PACKAGE=
-EMAIL=webmasters@gnu.org  # please override with --email
-commonarg= # passed to all makeinfo/texi2html invcations.
-dirargs=   # passed to all tools (-I dir).
-dirs=      # -I directories.
-htmlarg="--css-ref=/software/gnulib/manual.css -c TOP_NODE_UP_URL=/manual"
-infoarg=--no-split
-generate_ascii=true
-generate_html=true
-generate_info=true
-generate_tex=true
-outdir=manual
-source_extra=
-split=node
-srcfile=
-texarg="-t @finalout"
-
-version="gendocs.sh $scriptversion
-
-Copyright 2017 Free Software Foundation, Inc.
-There is NO warranty.  You may redistribute this software
-under the terms of the GNU General Public License.
-For more information about these matters, see the files named COPYING."
-
-usage="Usage: $prog [OPTION]... PACKAGE MANUAL-TITLE
-
-Generate output in various formats from PACKAGE.texinfo (or .texi or
-.txi) source.  See the GNU Maintainers document for a more extensive
-discussion:
-  http://www.gnu.org/prep/maintain_toc.html
-
-Options:
-  --email ADR use ADR as contact in generated web pages; always give this.
-
-  -s SRCFILE   read Texinfo from SRCFILE, instead of PACKAGE.{texinfo|texi|txi}
-  -o OUTDIR    write files into OUTDIR, instead of manual/.
-  -I DIR       append DIR to the Texinfo search path.
-  --common ARG pass ARG in all invocations.
-  --html ARG   pass ARG to makeinfo or texi2html for HTML targets,
-                 instead of '$htmlarg'.
-  --info ARG   pass ARG to makeinfo for Info, instead of --no-split.
-  --no-ascii   skip generating the plain text output.
-  --no-html    skip generating the html output.
-  --no-info    skip generating the info output.
-  --no-tex     skip generating the dvi and pdf output.
-  --source ARG include ARG in tar archive of sources.
-  --split HOW  make split HTML by node, section, chapter; default node.
-  --tex ARG    pass ARG to texi2dvi for DVI and PDF, instead of -t @finalout.
-
-  --texi2html  use texi2html to make HTML target, with all split versions.
-  --docbook    convert through DocBook too (xml, txt, html, pdf).
-
-  --help       display this help and exit successfully.
-  --version    display version information and exit successfully.
-
-Simple example: $prog --email bug-gnu-emacs@gnu.org emacs \"GNU Emacs Manual\"
-
-Typical sequence:
-  cd PACKAGESOURCE/doc
-  wget \"$scripturl\"
-  wget \"$templateurl\"
-  $prog --email BUGLIST MANUAL \"GNU MANUAL - One-line description\"
-
-Output will be in a new subdirectory \"manual\" (by default;
-use -o OUTDIR to override).  Move all the new files into your web CVS
-tree, as explained in the Web Pages node of maintain.texi.
-
-Please use the --email ADDRESS option so your own bug-reporting
-address will be used in the generated HTML pages.
-
-MANUAL-TITLE is included as part of the HTML <title> of the overall
-manual/index.html file.  It should include the name of the package being
-documented.  manual/index.html is created by substitution from the file
-$GENDOCS_TEMPLATE_DIR/gendocs_template.  (Feel free to modify the
-generic template for your own purposes.)
-
-If you have several manuals, you'll need to run this script several
-times with different MANUAL values, specifying a different output
-directory with -o each time.  Then write (by hand) an overall index.html
-with links to them all.
-
-If a manual's Texinfo sources are spread across several directories,
-first copy or symlink all Texinfo sources into a single directory.
-(Part of the script's work is to make a tar.gz of the sources.)
-
-As implied above, by default monolithic Info files are generated.
-If you want split Info, or other Info options, use --info to override.
-
-You can set the environment variables MAKEINFO, TEXI2DVI, TEXI2HTML,
-and PERL to control the programs that get executed, and
-GENDOCS_TEMPLATE_DIR to control where the gendocs_template file is
-looked for.  With --docbook, the environment variables DOCBOOK2HTML,
-DOCBOOK2PDF, and DOCBOOK2TXT are also consulted.
-
-By default, makeinfo and texi2dvi are run in the default (English)
-locale, since that's the language of most Texinfo manuals.  If you
-happen to have a non-English manual and non-English web site, see the
-SETLANG setting in the source.
-
-Email bug reports or enhancement requests to bug-gnulib@gnu.org.
-"
-
-while test $# -gt 0; do
-  case $1 in
-    -s)          shift; srcfile=$1;;
-    -o)          shift; outdir=$1;;
-    -I)          shift; dirargs="$dirargs -I '$1'"; dirs="$dirs $1";;
-    --common)    shift; commonarg=$1;;
-    --docbook)   docbook=yes;;
-    --email)     shift; EMAIL=$1;;
-    --html)      shift; htmlarg=$1;;
-    --info)      shift; infoarg=$1;;
-    --no-ascii)  generate_ascii=false;;
-    --no-html)   generate_ascii=false;;
-    --no-info)   generate_info=false;;
-    --no-tex)    generate_tex=false;;
-    --source)    shift; source_extra=$1;;
-    --split)     shift; split=$1;;
-    --tex)       shift; texarg=$1;;
-    --texi2html) use_texi2html=1;;
-
-    --help)      echo "$usage"; exit 0;;
-    --version)   echo "$version"; exit 0;;
-    -*)
-      echo "$0: Unknown option \`$1'." >&2
-      echo "$0: Try \`--help' for more information." >&2
-      exit 1;;
-    *)
-      if test -z "$PACKAGE"; then
-        PACKAGE=$1
-      elif test -z "$MANUAL_TITLE"; then
-        MANUAL_TITLE=$1
-      else
-        echo "$0: extra non-option argument \`$1'." >&2
-        exit 1
-      fi;;
-  esac
-  shift
-done
-
-# makeinfo uses the dirargs, but texi2dvi doesn't.
-commonarg=" $dirargs $commonarg"
-
-# For most of the following, the base name is just $PACKAGE
-base=$PACKAGE
-
-if test -n "$srcfile"; then
-  # but here, we use the basename of $srcfile
-  base=`basename "$srcfile"`
-  case $base in
-    *.txi|*.texi|*.texinfo) base=`echo "$base"|sed 's/\.[texinfo]*$//'`;;
-  esac
-  PACKAGE=$base
-elif test -s "$srcdir/$PACKAGE.texinfo"; then
-  srcfile=$srcdir/$PACKAGE.texinfo
-elif test -s "$srcdir/$PACKAGE.texi"; then
-  srcfile=$srcdir/$PACKAGE.texi
-elif test -s "$srcdir/$PACKAGE.txi"; then
-  srcfile=$srcdir/$PACKAGE.txi
-else
-  echo "$0: cannot find .texinfo or .texi or .txi for $PACKAGE in $srcdir." >&2
-  exit 1
-fi
-
-if test ! -r $GENDOCS_TEMPLATE_DIR/gendocs_template; then
-  echo "$0: cannot read $GENDOCS_TEMPLATE_DIR/gendocs_template." >&2
-  echo "$0: it is available from $templateurl." >&2
-  exit 1
-fi
-
-# Function to return size of $1 in something resembling kilobytes.
-calcsize()
-{
-  size=`ls -ksl $1 | awk '{print $1}'`
-  echo $size
-}
-
-# copy_images OUTDIR HTML-FILE...
-# -------------------------------
-# Copy all the images needed by the HTML-FILEs into OUTDIR.
-# Look for them in . and the -I directories; this is simpler than what
-# makeinfo supports with -I, but hopefully it will suffice.
-copy_images()
-{
-  local odir
-  odir=$1
-  shift
-  $PERL -n -e "
-BEGIN {
-  \$me = '$prog';
-  \$odir = '$odir';
-  @dirs = qw(. $dirs);
-}
-" -e '
-/<img src="(.*?)"/g && ++$need{$1};
-
-END {
-  #print "$me: @{[keys %need]}\n";  # for debugging, show images found.
-  FILE: for my $f (keys %need) {
-    for my $d (@dirs) {
-      if (-f "$d/$f") {
-        use File::Basename;
-        my $dest = dirname ("$odir/$f");
-        #
-        use File::Path;
-        -d $dest || mkpath ($dest)
-          || die "$me: cannot mkdir $dest: $!\n";
-        #
-        use File::Copy;
-        copy ("$d/$f", $dest)
-          || die "$me: cannot copy $d/$f to $dest: $!\n";
-        next FILE;
-      }
-    }
-    die "$me: $ARGV: cannot find image $f\n";
-  }
-}
-' -- "$@" || exit 1
-}
-
-case $outdir in
-  /*) abs_outdir=$outdir;;
-  *)  abs_outdir=$srcdir/$outdir;;
-esac
-
-echo "Making output for $srcfile"
-echo " in `pwd`"
-mkdir -p "$outdir/"
-
-# 
-if $generate_info; then
-  cmd="$SETLANG $MAKEINFO -o $PACKAGE.info $commonarg $infoarg \"$srcfile\""
-  echo "Generating info... ($cmd)"
-  rm -f $PACKAGE.info* # get rid of any strays
-  eval "$cmd"
-  tar czf "$outdir/$PACKAGE.info.tar.gz" $PACKAGE.info*
-  ls -l "$outdir/$PACKAGE.info.tar.gz"
-  info_tgz_size=`calcsize "$outdir/$PACKAGE.info.tar.gz"`
-  # do not mv the info files, there's no point in having them available
-  # separately on the web.
-fi  # end info
-
-# 
-if $generate_tex; then
-  cmd="$SETLANG $TEXI2DVI $dirargs $texarg \"$srcfile\""
-  printf "\nGenerating dvi... ($cmd)\n"
-  eval "$cmd"
-  # compress/finish dvi:
-  gzip -f -9 $PACKAGE.dvi
-  dvi_gz_size=`calcsize $PACKAGE.dvi.gz`
-  mv $PACKAGE.dvi.gz "$outdir/"
-  ls -l "$outdir/$PACKAGE.dvi.gz"
-
-  cmd="$SETLANG $TEXI2DVI --pdf $dirargs $texarg \"$srcfile\""
-  printf "\nGenerating pdf... ($cmd)\n"
-  eval "$cmd"
-  pdf_size=`calcsize $PACKAGE.pdf`
-  mv $PACKAGE.pdf "$outdir/"
-  ls -l "$outdir/$PACKAGE.pdf"
-fi # end tex (dvi + pdf)
-
-# 
-if $generate_ascii; then
-  opt="-o $PACKAGE.txt --no-split --no-headers $commonarg"
-  cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
-  printf "\nGenerating ascii... ($cmd)\n"
-  eval "$cmd"
-  ascii_size=`calcsize $PACKAGE.txt`
-  gzip -f -9 -c $PACKAGE.txt >"$outdir/$PACKAGE.txt.gz"
-  ascii_gz_size=`calcsize "$outdir/$PACKAGE.txt.gz"`
-  mv $PACKAGE.txt "$outdir/"
-  ls -l "$outdir/$PACKAGE.txt" "$outdir/$PACKAGE.txt.gz"
-fi
-
-# 
-
-if $generate_html; then
-# Split HTML at level $1.  Used for texi2html.
-html_split()
-{
-  opt="--split=$1 --node-files $commonarg $htmlarg"
-  cmd="$SETLANG $TEXI2HTML --output $PACKAGE.html $opt \"$srcfile\""
-  printf "\nGenerating html by $1... ($cmd)\n"
-  eval "$cmd"
-  split_html_dir=$PACKAGE.html
-  (
-    cd ${split_html_dir} || exit 1
-    ln -sf ${PACKAGE}.html index.html
-    tar -czf "$abs_outdir/${PACKAGE}.html_$1.tar.gz" -- *.html
-  )
-  eval html_$1_tgz_size=`calcsize "$outdir/${PACKAGE}.html_$1.tar.gz"`
-  rm -f "$outdir"/html_$1/*.html
-  mkdir -p "$outdir/html_$1/"
-  mv ${split_html_dir}/*.html "$outdir/html_$1/"
-  rmdir ${split_html_dir}
-}
-
-if test -z "$use_texi2html"; then
-  opt="--no-split --html -o $PACKAGE.html $commonarg $htmlarg"
-  cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
-  printf "\nGenerating monolithic html... ($cmd)\n"
-  rm -rf $PACKAGE.html  # in case a directory is left over
-  eval "$cmd"
-  html_mono_size=`calcsize $PACKAGE.html`
-  gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz"
-  html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
-  copy_images "$outdir/" $PACKAGE.html
-  mv $PACKAGE.html "$outdir/"
-  ls -l "$outdir/$PACKAGE.html" "$outdir/$PACKAGE.html.gz"
-
-  # Before Texinfo 5.0, makeinfo did not accept a --split=HOW option,
-  # it just always split by node.  So if we're splitting by node anyway,
-  # leave it out.
-  if test "x$split" = xnode; then
-    split_arg=
-  else
-    split_arg=--split=$split
-  fi
-  #
-  opt="--html -o $PACKAGE.html $split_arg $commonarg $htmlarg"
-  cmd="$SETLANG $MAKEINFO $opt \"$srcfile\""
-  printf "\nGenerating html by $split... ($cmd)\n"
-  eval "$cmd"
-  split_html_dir=$PACKAGE.html
-  copy_images $split_html_dir/ $split_html_dir/*.html
-  (
-    cd $split_html_dir || exit 1
-    tar -czf "$abs_outdir/$PACKAGE.html_$split.tar.gz" -- *
-  )
-  eval \
-    html_${split}_tgz_size=`calcsize "$outdir/$PACKAGE.html_$split.tar.gz"`
-  rm -rf "$outdir/html_$split/"
-  mv $split_html_dir "$outdir/html_$split/"
-  du -s "$outdir/html_$split/"
-  ls -l "$outdir/$PACKAGE.html_$split.tar.gz"
-
-else # use texi2html:
-  opt="--output $PACKAGE.html $commonarg $htmlarg"
-  cmd="$SETLANG $TEXI2HTML $opt \"$srcfile\""
-  printf "\nGenerating monolithic html with texi2html... ($cmd)\n"
-  rm -rf $PACKAGE.html  # in case a directory is left over
-  eval "$cmd"
-  html_mono_size=`calcsize $PACKAGE.html`
-  gzip -f -9 -c $PACKAGE.html >"$outdir/$PACKAGE.html.gz"
-  html_mono_gz_size=`calcsize "$outdir/$PACKAGE.html.gz"`
-  mv $PACKAGE.html "$outdir/"
-
-  html_split node
-  html_split chapter
-  html_split section
-fi
-fi # end html
-
-# 
-printf "\nMaking .tar.gz for sources...\n"
-d=`dirname $srcfile`
-(
-  cd "$d"
-  srcfiles=`ls -d *.texinfo *.texi *.txi *.eps $source_extra 2>/dev/null` || true
-  tar czfh "$abs_outdir/$PACKAGE.texi.tar.gz" $srcfiles
-  ls -l "$abs_outdir/$PACKAGE.texi.tar.gz"
-)
-texi_tgz_size=`calcsize "$outdir/$PACKAGE.texi.tar.gz"`
-
-# 
-# Do everything again through docbook.
-if test -n "$docbook"; then
-  opt="-o - --docbook $commonarg"
-  cmd="$SETLANG $MAKEINFO $opt \"$srcfile\" >${srcdir}/$PACKAGE-db.xml"
-  printf "\nGenerating docbook XML... ($cmd)\n"
-  eval "$cmd"
-  docbook_xml_size=`calcsize $PACKAGE-db.xml`
-  gzip -f -9 -c $PACKAGE-db.xml >"$outdir/$PACKAGE-db.xml.gz"
-  docbook_xml_gz_size=`calcsize "$outdir/$PACKAGE-db.xml.gz"`
-  mv $PACKAGE-db.xml "$outdir/"
-
-  split_html_db_dir=html_node_db
-  opt="$commonarg -o $split_html_db_dir"
-  cmd="$DOCBOOK2HTML $opt \"${outdir}/$PACKAGE-db.xml\""
-  printf "\nGenerating docbook HTML... ($cmd)\n"
-  eval "$cmd"
-  (
-    cd ${split_html_db_dir} || exit 1
-    tar -czf "$abs_outdir/${PACKAGE}.html_node_db.tar.gz" -- *.html
-  )
-  html_node_db_tgz_size=`calcsize "$outdir/${PACKAGE}.html_node_db.tar.gz"`
-  rm -f "$outdir"/html_node_db/*.html
-  mkdir -p "$outdir/html_node_db"
-  mv ${split_html_db_dir}/*.html "$outdir/html_node_db/"
-  rmdir ${split_html_db_dir}
-
-  cmd="$DOCBOOK2TXT \"${outdir}/$PACKAGE-db.xml\""
-  printf "\nGenerating docbook ASCII... ($cmd)\n"
-  eval "$cmd"
-  docbook_ascii_size=`calcsize $PACKAGE-db.txt`
-  mv $PACKAGE-db.txt "$outdir/"
-
-  cmd="$DOCBOOK2PDF \"${outdir}/$PACKAGE-db.xml\""
-  printf "\nGenerating docbook PDF... ($cmd)\n"
-  eval "$cmd"
-  docbook_pdf_size=`calcsize $PACKAGE-db.pdf`
-  mv $PACKAGE-db.pdf "$outdir/"
-fi
-
-# 
-printf "\nMaking index.html for $PACKAGE...\n"
-if test -z "$use_texi2html"; then
-  CONDS="/%%IF  *HTML_SECTION%%/,/%%ENDIF  *HTML_SECTION%%/d;\
-         /%%IF  *HTML_CHAPTER%%/,/%%ENDIF  *HTML_CHAPTER%%/d"
-else
-  # should take account of --split here.
-  CONDS="/%%ENDIF.*%%/d;/%%IF  *HTML_SECTION%%/d;/%%IF  *HTML_CHAPTER%%/d"
-fi
-
-curdate=`$SETLANG date '+%B %d, %Y'`
-sed \
-   -e "s!%%TITLE%%!$MANUAL_TITLE!g" \
-   -e "s!%%EMAIL%%!$EMAIL!g" \
-   -e "s!%%PACKAGE%%!$PACKAGE!g" \
-   -e "s!%%DATE%%!$curdate!g" \
-   -e "s!%%HTML_MONO_SIZE%%!$html_mono_size!g" \
-   -e "s!%%HTML_MONO_GZ_SIZE%%!$html_mono_gz_size!g" \
-   -e "s!%%HTML_NODE_TGZ_SIZE%%!$html_node_tgz_size!g" \
-   -e "s!%%HTML_SECTION_TGZ_SIZE%%!$html_section_tgz_size!g" \
-   -e "s!%%HTML_CHAPTER_TGZ_SIZE%%!$html_chapter_tgz_size!g" \
-   -e "s!%%INFO_TGZ_SIZE%%!$info_tgz_size!g" \
-   -e "s!%%DVI_GZ_SIZE%%!$dvi_gz_size!g" \
-   -e "s!%%PDF_SIZE%%!$pdf_size!g" \
-   -e "s!%%ASCII_SIZE%%!$ascii_size!g" \
-   -e "s!%%ASCII_GZ_SIZE%%!$ascii_gz_size!g" \
-   -e "s!%%TEXI_TGZ_SIZE%%!$texi_tgz_size!g" \
-   -e "s!%%DOCBOOK_HTML_NODE_TGZ_SIZE%%!$html_node_db_tgz_size!g" \
-   -e "s!%%DOCBOOK_ASCII_SIZE%%!$docbook_ascii_size!g" \
-   -e "s!%%DOCBOOK_PDF_SIZE%%!$docbook_pdf_size!g" \
-   -e "s!%%DOCBOOK_XML_SIZE%%!$docbook_xml_size!g" \
-   -e "s!%%DOCBOOK_XML_GZ_SIZE%%!$docbook_xml_gz_size!g" \
-   -e "s,%%SCRIPTURL%%,$scripturl,g" \
-   -e "s!%%SCRIPTNAME%%!$prog!g" \
-   -e "$CONDS" \
-$GENDOCS_TEMPLATE_DIR/gendocs_template >"$outdir/index.html"
-
-echo "Done, see $outdir/ subdirectory for new files."
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-end: "$"
-# End:
diff --git a/build-aux/gnupload b/build-aux/gnupload
deleted file mode 100755
index d4d95ee..0000000
--- a/build-aux/gnupload
+++ /dev/null
@@ -1,440 +0,0 @@
-#!/bin/sh
-# Sign files and upload them.
-
-scriptversion=2016-01-11.22; # UTC
-
-# Copyright (C) 2004-2017 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Originally written by Alexandre Duret-Lutz <adl@gnu.org>.
-# The master copy of this file is maintained in the gnulib Git repository.
-# Please send bug reports and feature requests to bug-gnulib@gnu.org.
-
-set -e
-
-GPG='gpg --batch --no-tty'
-conffile=.gnuploadrc
-to=
-dry_run=false
-replace=
-symlink_files=
-delete_files=
-delete_symlinks=
-collect_var=
-dbg=
-nl='
-'
-
-usage="Usage: $0 [OPTION]... [CMD] FILE... [[CMD] FILE...]
-
-Sign all FILES, and process them at the destinations specified with --to.
-If CMD is not given, it defaults to uploading.  See examples below.
-
-Commands:
-  --delete                 delete FILES from destination
-  --symlink                create symbolic links
-  --rmsymlink              remove symbolic links
-  --                       treat the remaining arguments as files to upload
-
-Options:
-  --to DEST                specify a destination DEST for FILES
-                           (multiple --to options are allowed)
-  --user NAME              sign with key NAME
-  --replace                allow replacements of existing files
-  --symlink-regex[=EXPR]   use sed script EXPR to compute symbolic link names
-  --dry-run                do nothing, show what would have been done
-                           (including the constructed directive file)
-  --version                output version information and exit
-  --help                   print this help text and exit
-
-If --symlink-regex is given without EXPR, then the link target name
-is created by replacing the version information with '-latest', e.g.:
-  foo-1.3.4.tar.gz -> foo-latest.tar.gz
-
-Recognized destinations are:
-  alpha.gnu.org:DIRECTORY
-  savannah.gnu.org:DIRECTORY
-  savannah.nongnu.org:DIRECTORY
-  ftp.gnu.org:DIRECTORY
-                           build directive files and upload files by FTP
-  download.gnu.org.ua:{alpha|ftp}/DIRECTORY
-                           build directive files and upload files by SFTP
-  [user@]host:DIRECTORY    upload files with scp
-
-Options and commands are applied in order.  If the file $conffile exists
-in the current working directory, its contents are prepended to the
-actual command line options.  Use this to keep your defaults.  Comments
-(#) and empty lines in $conffile are allowed.
-
-<http://www.gnu.org/prep/maintain/html_node/Automated-FTP-Uploads.html>
-gives some further background.
-
-Examples:
-1. Upload foobar-1.0.tar.gz to ftp.gnu.org:
-  gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz
-
-2. Upload foobar-1.0.tar.gz and foobar-1.0.tar.xz to ftp.gnu.org:
-  gnupload --to ftp.gnu.org:foobar foobar-1.0.tar.gz foobar-1.0.tar.xz
-
-3. Same as above, and also create symbolic links to foobar-latest.tar.*:
-  gnupload --to ftp.gnu.org:foobar \\
-           --symlink-regex \\
-           foobar-1.0.tar.gz foobar-1.0.tar.xz
-
-4. Upload foobar-0.9.90.tar.gz to two sites:
-  gnupload --to alpha.gnu.org:foobar \\
-           --to sources.redhat.com:~ftp/pub/foobar \\
-           foobar-0.9.90.tar.gz
-
-5. Delete oopsbar-0.9.91.tar.gz and upload foobar-0.9.91.tar.gz
-   (the -- terminates the list of files to delete):
-  gnupload --to alpha.gnu.org:foobar \\
-           --to sources.redhat.com:~ftp/pub/foobar \\
-           --delete oopsbar-0.9.91.tar.gz \\
-           -- foobar-0.9.91.tar.gz
-
-gnupload executes a program ncftpput to do the transfers; if you don't
-happen to have an ncftp package installed, the ncftpput-ftp script in
-the build-aux/ directory of the gnulib package
-(http://savannah.gnu.org/projects/gnulib) may serve as a replacement.
-
-Send patches and bug reports to <bug-gnulib@gnu.org>."
-
-# Read local configuration file
-if test -r "$conffile"; then
-  echo "$0: Reading configuration file $conffile"
-  conf=`sed 's/#.*$//;/^$/d' "$conffile" | tr "\015$nl" '  '`
-  eval set x "$conf \"\$@\""
-  shift
-fi
-
-while test -n "$1"; do
-  case $1 in
-  -*)
-    collect_var=
-    case $1 in
-    --help)
-      echo "$usage"
-      exit $?
-      ;;
-    --to)
-      if test -z "$2"; then
-        echo "$0: Missing argument for --to" 1>&2
-        exit 1
-      elif echo "$2" | grep 'ftp-upload\.gnu\.org' >/dev/null; then
-        echo "$0: Use ftp.gnu.org:PKGNAME or alpha.gnu.org:PKGNAME" >&2
-        echo "$0: for the destination, not ftp-upload.gnu.org (which" >&2
-        echo "$0:  is used for direct ftp uploads, not with gnupload)." >&2
-        echo "$0: See --help and its examples if need be." >&2
-        exit 1
-      else
-        to="$to $2"
-        shift
-      fi
-      ;;
-    --user)
-      if test -z "$2"; then
-        echo "$0: Missing argument for --user" 1>&2
-        exit 1
-      else
-        GPG="$GPG --local-user $2"
-        shift
-      fi
-      ;;
-    --delete)
-      collect_var=delete_files
-      ;;
-    --replace)
-      replace="replace: true"
-      ;;
-    --rmsymlink)
-      collect_var=delete_symlinks
-      ;;
-    --symlink-regex=*)
-      symlink_expr=`expr "$1" : '[^=]*=\(.*\)'`
-      ;;
-    --symlink-regex)
-      symlink_expr='s|-[0-9][0-9\.]*\(-[0-9][0-9]*\)\{0,1\}\.|-latest.|'
-      ;;
-    --symlink)
-      collect_var=symlink_files
-      ;;
-    --dry-run|-n)
-      dry_run=:
-      ;;
-    --version)
-      echo "gnupload $scriptversion"
-      exit $?
-      ;;
-    --)
-      shift
-      break
-      ;;
-    -*)
-      echo "$0: Unknown option '$1', try '$0 --help'" 1>&2
-      exit 1
-      ;;
-    esac
-    ;;
-  *)
-    if test -z "$collect_var"; then
-      break
-    else
-      eval "$collect_var=\"\$$collect_var $1\""
-    fi
-    ;;
-  esac
-  shift
-done
-
-dprint()
-{
-  echo "Running $* ..."
-}
-
-if $dry_run; then
-  dbg=dprint
-fi
-
-if test -z "$to"; then
-  echo "$0: Missing destination sites" >&2
-  exit 1
-fi
-
-if test -n "$symlink_files"; then
-  x=`echo "$symlink_files" | sed 's/[^ ]//g;s/  //g'`
-  if test -n "$x"; then
-    echo "$0: Odd number of symlink arguments" >&2
-    exit 1
-  fi
-fi
-
-if test $# = 0; then
-  if test -z "${symlink_files}${delete_files}${delete_symlinks}"; then
-    echo "$0: No file to upload" 1>&2
-    exit 1
-  fi
-else
-  # Make sure all files exist.  We don't want to ask
-  # for the passphrase if the script will fail.
-  for file
-  do
-    if test ! -f $file; then
-      echo "$0: Cannot find '$file'" 1>&2
-      exit 1
-    elif test -n "$symlink_expr"; then
-      linkname=`echo $file | sed "$symlink_expr"`
-      if test -z "$linkname"; then
-        echo "$0: symlink expression produces empty results" >&2
-        exit 1
-      elif test "$linkname" = $file; then
-        echo "$0: symlink expression does not alter file name" >&2
-        exit 1
-      fi
-    fi
-  done
-fi
-
-# Make sure passphrase is not exported in the environment.
-unset passphrase
-unset passphrase_fd_0
-GNUPGHOME=${GNUPGHOME:-$HOME/.gnupg}
-
-# Reset PATH to be sure that echo is a built-in.  We will later use
-# 'echo $passphrase' to output the passphrase, so it is important that
-# it is a built-in (third-party programs tend to appear in 'ps'
-# listings with their arguments...).
-# Remember this script runs with 'set -e', so if echo is not built-in
-# it will exit now.
-if $dry_run || grep -q "^use-agent" $GNUPGHOME/gpg.conf; then :; else
-  PATH=/empty echo -n "Enter GPG passphrase: "
-  stty -echo
-  read -r passphrase
-  stty echo
-  echo
-  passphrase_fd_0="--passphrase-fd 0"
-fi
-
-if test $# -ne 0; then
-  for file
-  do
-    echo "Signing $file ..."
-    rm -f $file.sig
-    echo "$passphrase" | $dbg $GPG $passphrase_fd_0 -ba -o $file.sig $file
-  done
-fi
-
-
-# mkdirective DESTDIR BASE FILE STMT
-# Arguments: See upload, below
-mkdirective ()
-{
-  stmt="$4"
-  if test -n "$3"; then
-    stmt="
-filename: $3$stmt"
-  fi
-
-  cat >${2}.directive<<EOF
-version: 1.2
-directory: $1
-comment: gnupload v. $scriptversion$stmt
-EOF
-  if $dry_run; then
-    echo "File ${2}.directive:"
-    cat ${2}.directive
-    echo "File ${2}.directive:" | sed 's/./-/g'
-  fi
-}
-
-mksymlink ()
-{
-  while test $# -ne 0
-  do
-    echo "symlink: $1 $2"
-    shift
-    shift
-  done
-}
-
-# upload DEST DESTDIR BASE FILE STMT FILES
-# Arguments:
-#  DEST     Destination site;
-#  DESTDIR  Destination directory;
-#  BASE     Base name for the directive file;
-#  FILE     Name of the file to distribute (may be empty);
-#  STMT     Additional statements for the directive file;
-#  FILES    List of files to upload.
-upload ()
-{
-  dest=$1
-  destdir=$2
-  base=$3
-  file=$4
-  stmt=$5
-  files=$6
-
-  rm -f $base.directive $base.directive.asc
-  case $dest in
-    alpha.gnu.org:*)
-      mkdirective "$destdir" "$base" "$file" "$stmt"
-      echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
-      $dbg ncftpput ftp-upload.gnu.org /incoming/alpha $files $base.directive.asc
-      ;;
-    ftp.gnu.org:*)
-      mkdirective "$destdir" "$base" "$file" "$stmt"
-      echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
-      $dbg ncftpput ftp-upload.gnu.org /incoming/ftp $files $base.directive.asc
-      ;;
-    savannah.gnu.org:*)
-      if test -z "$files"; then
-        echo "$0: warning: standalone directives not applicable for $dest" >&2
-      fi
-      $dbg ncftpput savannah.gnu.org /incoming/savannah/$destdir $files
-      ;;
-    savannah.nongnu.org:*)
-      if test -z "$files"; then
-        echo "$0: warning: standalone directives not applicable for $dest" >&2
-      fi
-      $dbg ncftpput savannah.nongnu.org /incoming/savannah/$destdir $files
-      ;;
-    download.gnu.org.ua:alpha/*|download.gnu.org.ua:ftp/*)
-      destdir_p1=`echo "$destdir" | sed 's,^[^/]*/,,'`
-      destdir_topdir=`echo "$destdir" | sed 's,/.*,,'`
-      mkdirective "$destdir_p1" "$base" "$file" "$stmt"
-      echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
-      for f in $files $base.directive.asc
-      do
-        echo put $f
-      done | $dbg sftp -b - puszcza.gnu.org.ua:/incoming/$destdir_topdir
-      ;;
-    /*)
-      dest_host=`echo "$dest" | sed 's,:.*,,'`
-      mkdirective "$destdir" "$base" "$file" "$stmt"
-      echo "$passphrase" | $dbg $GPG $passphrase_fd_0 --clearsign $base.directive
-      $dbg cp $files $base.directive.asc $dest_host
-      ;;
-    *)
-      if test -z "$files"; then
-        echo "$0: warning: standalone directives not applicable for $dest" >&2
-      fi
-      $dbg scp $files $dest
-      ;;
-  esac
-  rm -f $base.directive $base.directive.asc
-}
-
-#####
-# Process any standalone directives
-stmt=
-if test -n "$symlink_files"; then
-  stmt="$stmt
-`mksymlink $symlink_files`"
-fi
-
-for file in $delete_files
-do
-  stmt="$stmt
-archive: $file"
-done
-
-for file in $delete_symlinks
-do
-  stmt="$stmt
-rmsymlink: $file"
-done
-
-if test -n "$stmt"; then
-  for dest in $to
-  do
-    destdir=`echo $dest | sed 's/[^:]*://'`
-    upload "$dest" "$destdir" "`hostname`-$$" "" "$stmt"
-  done
-fi
-
-# Process actual uploads
-for dest in $to
-do
-  for file
-  do
-    echo "Uploading $file to $dest ..."
-    stmt=
-    #
-    # allowing file replacement is all or nothing.
-    if test -n "$replace"; then stmt="$stmt
-$replace"
-    fi
-    #
-    files="$file $file.sig"
-    destdir=`echo $dest | sed 's/[^:]*://'`
-    if test -n "$symlink_expr"; then
-      linkname=`echo $file | sed "$symlink_expr"`
-      stmt="$stmt
-symlink: $file $linkname
-symlink: $file.sig $linkname.sig"
-    fi
-    upload "$dest" "$destdir" "$file" "$file" "$stmt" "$files"
-  done
-done
-
-exit 0
-
-# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "scriptversion="
-# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC0"
-# time-stamp-end: "; # UTC"
-# End:
diff --git a/build-aux/snippet/_Noreturn.h b/build-aux/snippet/_Noreturn.h
deleted file mode 100644
index c44ad89..0000000
--- a/build-aux/snippet/_Noreturn.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#if !defined _Noreturn && __STDC_VERSION__ < 201112
-# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
-      || 0x5110 <= __SUNPRO_C)
-#  define _Noreturn __attribute__ ((__noreturn__))
-# elif 1200 <= _MSC_VER
-#  define _Noreturn __declspec (noreturn)
-# else
-#  define _Noreturn
-# endif
-#endif
diff --git a/build-aux/update-copyright b/build-aux/update-copyright
deleted file mode 100755
index 2d20d21..0000000
--- a/build-aux/update-copyright
+++ /dev/null
@@ -1,274 +0,0 @@
-eval '(exit $?0)' && eval 'exec perl -wS -0777 -pi "$0" "$@"'
-  & eval 'exec perl -wS -0777 -pi "$0" $argv:q'
-    if 0;
-# Update an FSF copyright year list to include the current year.
-
-my $VERSION = '2016-01-12.23:13'; # UTC
-
-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Written by Jim Meyering and Joel E. Denny
-
-# The arguments to this script should be names of files that contain
-# copyright statements to be updated.  The copyright holder's name
-# defaults to "Free Software Foundation, Inc." but may be changed to
-# any other name by using the "UPDATE_COPYRIGHT_HOLDER" environment
-# variable.
-#
-# For example, you might wish to use the update-copyright target rule
-# in maint.mk from gnulib's maintainer-makefile module.
-#
-# Iff a copyright statement is recognized in a file and the final
-# year is not the current year, then the statement is updated for the
-# new year and it is reformatted to:
-#
-#   1. Fit within 72 columns.
-#   2. Convert 2-digit years to 4-digit years by prepending "19".
-#   3. Expand copyright year intervals.  (See "Environment variables"
-#      below.)
-#
-# A warning is printed for every file for which no copyright
-# statement is recognized.
-#
-# Each file's copyright statement must be formatted correctly in
-# order to be recognized.  For example, each of these is fine:
-#
-#   Copyright @copyright{} 1990-2005, 2007-2009 Free Software
-#   Foundation, Inc.
-#
-#   # Copyright (C) 1990-2005, 2007-2009 Free Software
-#   # Foundation, Inc.
-#
-#   /*
-#    * Copyright &copy; 90,2005,2007-2009
-#    * Free Software Foundation, Inc.
-#    */
-#
-# However, the following format is not recognized because the line
-# prefix changes after the first line:
-#
-#   ## Copyright (C) 1990-2005, 2007-2009 Free Software
-#   #  Foundation, Inc.
-#
-# However, any correctly formatted copyright statement following
-# a non-matching copyright statements would be recognized.
-#
-# The exact conditions that a file's copyright statement must meet
-# to be recognized are:
-#
-#   1. It is the first copyright statement that meets all of the
-#      following conditions.  Subsequent copyright statements are
-#      ignored.
-#   2. Its format is "Copyright (C)", then a list of copyright years,
-#      and then the name of the copyright holder.
-#   3. The "(C)" takes one of the following forms or is omitted
-#      entirely:
-#
-#        A. (C)
-#        B. (c)
-#        C. @copyright{}
-#        D. &copy;
-#
-#   4. The "Copyright" appears at the beginning of a line, except that it
-#      may be prefixed by any sequence (e.g., a comment) of no more than
-#      5 characters -- including white space.
-#   5. Iff such a prefix is present, the same prefix appears at the
-#      beginning of each remaining line within the FSF copyright
-#      statement.  There is one exception in order to support C-style
-#      comments: if the first line's prefix contains nothing but
-#      whitespace surrounding a "/*", then the prefix for all subsequent
-#      lines is the same as the first line's prefix except with each of
-#      "/" and possibly "*" replaced by a " ".  The replacement of "*"
-#      by " " is consistent throughout all subsequent lines.
-#   6. Blank lines, even if preceded by the prefix, do not appear
-#      within the FSF copyright statement.
-#   7. Each copyright year is 2 or 4 digits, and years are separated by
-#      commas or dashes.  Whitespace may appear after commas.
-#
-# Environment variables:
-#
-#   1. If UPDATE_COPYRIGHT_FORCE=1, a recognized FSF copyright statement
-#      is reformatted even if it does not need updating for the new
-#      year.  If unset or set to 0, only updated FSF copyright
-#      statements are reformatted.
-#   2. If UPDATE_COPYRIGHT_USE_INTERVALS=1, every series of consecutive
-#      copyright years (such as 90, 1991, 1992-2007, 2008) in a
-#      reformatted FSF copyright statement is collapsed to a single
-#      interval (such as 1990-2008).  If unset or set to 0, all existing
-#      copyright year intervals in a reformatted FSF copyright statement
-#      are expanded instead.
-#      If UPDATE_COPYRIGHT_USE_INTERVALS=2, convert a sequence with gaps
-#      to the minimal containing range.  For example, convert
-#      2000, 2004-2007, 2009 to 2000-2009.
-#   3. For testing purposes, you can set the assumed current year in
-#      UPDATE_COPYRIGHT_YEAR.
-#   4. The default maximum line length for a copyright line is 72.
-#      Set UPDATE_COPYRIGHT_MAX_LINE_LENGTH to use a different length.
-#   5. Set UPDATE_COPYRIGHT_HOLDER if the copyright holder is other
-#      than "Free Software Foundation, Inc.".
-
-use strict;
-use warnings;
-
-my $copyright_re = 'Copyright';
-my $circle_c_re = '(?:\([cC]\)|@copyright\{}|\\\\\(co|&copy;)';
-my $holder = $ENV{UPDATE_COPYRIGHT_HOLDER};
-$holder ||= 'Free Software Foundation, Inc.';
-my $prefix_max = 5;
-my $margin = $ENV{UPDATE_COPYRIGHT_MAX_LINE_LENGTH};
-!$margin || $margin !~ m/^\d+$/
-  and $margin = 72;
-
-my $tab_width = 8;
-
-my $this_year = $ENV{UPDATE_COPYRIGHT_YEAR};
-if (!$this_year || $this_year !~ m/^\d{4}$/)
-  {
-    my ($sec, $min, $hour, $mday, $month, $year) = localtime (time ());
-    $this_year = $year + 1900;
-  }
-
-# Unless the file consistently uses "\r\n" as the EOL, use "\n" instead.
-my $eol = /(?:^|[^\r])\n/ ? "\n" : "\r\n";
-
-my $leading;
-my $prefix;
-my $ws_re;
-my $stmt_re;
-while (/(^|\n)(.{0,$prefix_max})$copyright_re/g)
-  {
-    $leading = "$1$2";
-    $prefix = $2;
-    if ($prefix =~ /^(\s*\/)\*(\s*)$/)
-      {
-        $prefix =~ s,/, ,;
-        my $prefix_ws = $prefix;
-        $prefix_ws =~ s/\*/ /; # Only whitespace.
-        if (/\G(?:[^*\n]|\*[^\/\n])*\*?\n$prefix_ws/)
-          {
-            $prefix = $prefix_ws;
-          }
-      }
-    $ws_re = '[ \t\r\f]'; # \s without \n
-    $ws_re =
-      "(?:$ws_re*(?:$ws_re|\\n" . quotemeta($prefix) . ")$ws_re*)";
-    my $holder_re = $holder;
-    $holder_re =~ s/\s/$ws_re/g;
-    my $stmt_remainder_re =
-      "(?:$ws_re$circle_c_re)?"
-      . "$ws_re(?:(?:\\d\\d)?\\d\\d(?:,$ws_re?|-))*"
-      . "((?:\\d\\d)?\\d\\d)$ws_re$holder_re";
-    if (/\G$stmt_remainder_re/)
-      {
-        $stmt_re =
-          quotemeta($leading) . "($copyright_re$stmt_remainder_re)";
-        last;
-      }
-  }
-if (defined $stmt_re)
-  {
-    /$stmt_re/ or die; # Should never die.
-    my $stmt = $1;
-    my $final_year_orig = $2;
-
-    # Handle two-digit year numbers like "98" and "99".
-    my $final_year = $final_year_orig;
-    $final_year <= 99
-      and $final_year += 1900;
-
-    if ($final_year != $this_year)
-      {
-        # Update the year.
-        $stmt =~ s/\b$final_year_orig\b/$final_year, $this_year/;
-      }
-    if ($final_year != $this_year || $ENV{'UPDATE_COPYRIGHT_FORCE'})
-      {
-        # Normalize all whitespace including newline-prefix sequences.
-        $stmt =~ s/$ws_re/ /g;
-
-        # Put spaces after commas.
-        $stmt =~ s/, ?/, /g;
-
-        # Convert 2-digit to 4-digit years.
-        $stmt =~ s/(\b\d\d\b)/19$1/g;
-
-        # Make the use of intervals consistent.
-        if (!$ENV{UPDATE_COPYRIGHT_USE_INTERVALS})
-          {
-            $stmt =~ s/(\d{4})-(\d{4})/join(', ', $1..$2)/eg;
-          }
-        else
-          {
-            $stmt =~
-              s/
-                (\d{4})
-                (?:
-                  (,\ |-)
-                  ((??{
-                    if    ($2 eq '-') { '\d{4}'; }
-                    elsif (!$3)       { $1 + 1;  }
-                    else              { $3 + 1;  }
-                  }))
-                )+
-              /$1-$3/gx;
-
-            # When it's 2, emit a single range encompassing all year numbers.
-            $ENV{UPDATE_COPYRIGHT_USE_INTERVALS} == 2
-              and $stmt =~ s/\b(\d{4})\b.*\b(\d{4})\b/$1-$2/;
-          }
-
-        # Format within margin.
-        my $stmt_wrapped;
-        my $text_margin = $margin - length($prefix);
-        if ($prefix =~ /^(\t+)/)
-          {
-            $text_margin -= length($1) * ($tab_width - 1);
-          }
-        while (length $stmt)
-          {
-            if (($stmt =~ s/^(.{1,$text_margin})(?: |$)//)
-                || ($stmt =~ s/^([\S]+)(?: |$)//))
-              {
-                my $line = $1;
-                $stmt_wrapped .= $stmt_wrapped ? "$eol$prefix" : $leading;
-                $stmt_wrapped .= $line;
-              }
-            else
-              {
-                # Should be unreachable, but we don't want an infinite
-                # loop if it can be reached.
-                die;
-              }
-          }
-
-        # Replace the old copyright statement.
-        s/$stmt_re/$stmt_wrapped/;
-      }
-  }
-else
-  {
-    print STDERR "$ARGV: warning: copyright statement not found\n";
-  }
-
-# Local variables:
-# mode: perl
-# indent-tabs-mode: nil
-# eval: (add-hook 'write-file-hooks 'time-stamp)
-# time-stamp-start: "my $VERSION = '"
-# time-stamp-format: "%:y-%02m-%02d.%02H:%02M"
-# time-stamp-time-zone: "UTC0"
-# time-stamp-end: "'; # UTC"
-# End:
diff --git a/cfg.mk b/cfg.mk
index bd65cdb..4deaf29 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -16,27 +16,24 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-WFLAGS ?= --enable-gcc-warnings
-ADDFLAGS ?=
-CFGFLAGS ?= --enable-gtk-doc --enable-gtk-doc-pdf $(ADDFLAGS) $(WFLAGS)
+manual_title = Library for Abstract Syntax Notation One (ASN.1)
 
-INDENT_SOURCES = `find . -name \*.[ch]|grep -v -e ^./gl -e ^./lib/gl -e ^./build-aux/ -e ^./lib/ASN1.c -e ^./tests/Test_tree_asn1_tab.c`
+old_NEWS_hash = 71ff7c3bdfcaf6931c1e980d859de147
 
-ifeq ($(.DEFAULT_GOAL),abort-due-to-no-makefile)
-.DEFAULT_GOAL := bootstrap
-endif
+bootstrap-tools = gnulib,autoconf,automake,libtoolize,make,makeinfo,bison,help2man,gtkdocize,tar,gzip
+
+INDENT_SOURCES = `find . -name \*.[ch]|grep -v -e ^./gnulib -e ^./lib/gl -e ^./build-aux/ -e ^./lib/ASN1.c -e ^./tests/Test_tree_asn1_tab.c`
 
 local-checks-to-skip = sc_prohibit_strcmp sc_prohibit_have_config_h	\
 	sc_require_config_h sc_require_config_h_first			\
 	sc_immutable_NEWS sc_prohibit_magic_number_exit			\
 	sc_bindtextdomain sc_GPL_version sc_prohibit_always_true_header_tests \
-	sc_prohibit_gnu_make_extensions
+	sc_prohibit_gnu_make_extensions sc_codespell
 
-VC_LIST_ALWAYS_EXCLUDE_REGEX = ^(maint.mk|gtk-doc.make|build-aux/.*|gl/.*|lib/gllib/.*|lib/glm4/.*|lib/ASN1\.c|m4/pkg.m4|doc/gdoc|windows/.*|doc/fdl-1.3.texi|fuzz/.*_fuzzer.(in|repro)/.*)$$
+VC_LIST_ALWAYS_EXCLUDE_REGEX = ^(maint.mk|gtk-doc.make|build-aux/.*|lib/gl/.*|lib/ASN1\.c|m4/pkg.m4|doc/gdoc|windows/.*|doc/fdl-1.3.texi|fuzz/.*_fuzzer.(in|repro)/.*)$$
 update-copyright-env = UPDATE_COPYRIGHT_USE_INTERVALS=1
 
 # Explicit syntax-check exceptions.
-exclude_file_name_regexp--sc_copyright_check = ^./gnulib/.*$$
 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/TestIndef.p12$$
 exclude_file_name_regexp--sc_GPL_version = ^lib/includes/libtasn1.h$$
 exclude_file_name_regexp--sc_program_name = ^tests/|examples/
@@ -45,11 +42,8 @@
 exclude_file_name_regexp--sc_error_message_uppercase = ^tests/Test_tree.c$$
 exclude_file_name_regexp--sc_unmarked_diagnostics = ^tests/Test_tree.c$$
 exclude_file_name_regexp--sc_prohibit_undesirable_word_seq = ^msvc/.*$$
-exclude_file_name_regexp--sc_trailing_blank = ^msvc/.*$$|lib/gl/override/m4/valgrind-tests.m4
+exclude_file_name_regexp--sc_trailing_blank = ^msvc/.*$$
 exclude_file_name_regexp--sc_useless_cpp_parens = ^lib/includes/libtasn1.h$$
-exclude_file_name_regexp--sc_prohibit_intprops_without_use = ^lib/decoding.c$$
-exclude_file_name_regexp--sc_m4_quote_check = ^m4-gl/.*$$
-exclude_file_name_regexp--sc_makefile_at_at_check = 'lib/gl/Makefile.am'
 exclude_file_name_regexp--sc_prohibit_eol_brackets = ^(tests/.*|fuzz/.*|bootstrap)$$
 
 sc_prohibit_eol_brackets:
@@ -57,106 +51,18 @@
 	halt='please block bracket { use in a separate line' \
 	  $(_sc_search_regexp)
 
-gpg_key_ID = b565716f
+sc_codespell:
+	@if `which codespell > /dev/null`; then \
+		codespell -L tim,sorce `git ls-files|egrep -v '_fuzzer.in|_fuzzer.repro|gnulib|tests/.*.der|tests/TestIndef.*.p12|tests/built-in-type.asn|tests/crlf.cer|tests/invalid-assignments2.txt|windows/libtasn1.ncb|windows/libtasn1.suo$$'`; \
+	fi
 
-autoreconf:
-	@echo "Running ./bootstrap"
-	./bootstrap
-
-bootstrap: autoreconf
+aximport:
+	for f in m4/ax_*.m4; do \
+		wget -O $$f "https://git.savannah.gnu.org/gitweb/?p=autoconf-archive.git;a=blob_plain;f=$$f"; \
+	done
 
 review-diff:
 	git diff `git describe --abbrev=0`.. \
 	| grep -v -e ^index -e '^diff --git' \
-	| filterdiff -p 1 -x 'gl/*' -x 'build-aux/*' -x 'lib/gl*' -x 'po/*' -x 'maint.mk' -x '.gitignore' -x '.x-sc*' -x ChangeLog -x GNUmakefile -x 'lib/ASN1.c' \
+	| filterdiff -p 1 -x 'gl/*' -x 'build-aux/*' -x 'lib/gl*' -x 'po/*' -x 'maint.mk' -x '.gitignore' \
 	| less
-
-# Release
-
-htmldir = ../www-$(PACKAGE)
-
-coverage-copy:
-	rm -fv `find $(htmldir)/coverage -type f | grep -v CVS`
-	mkdir -p $(htmldir)/coverage/
-	cp -rv $(COVERAGE_OUT)/* $(htmldir)/coverage/
-
-coverage-upload:
-	cd $(htmldir) && \
-	find coverage -type d -! -name CVS -! -name '.' \
-		-exec cvs add {} \; && \
-	find coverage -type d -! -name CVS -! -name '.' \
-		-exec sh -c "cvs add -kb {}/*.png" \; && \
-	find coverage -type d -! -name CVS -! -name '.' \
-		-exec sh -c "cvs add {}/*.html" \; && \
-	cvs add coverage/libtasn1.info coverage/gcov.css || true && \
-	cvs commit -m "Update." coverage
-
-clang:
-	make clean
-	scan-build ./configure
-	rm -rf scan.tmp
-	scan-build -o scan.tmp make
-
-clang-copy:
-	rm -fv `find $(htmldir)/clang-analyzer -type f | grep -v CVS`
-	mkdir -p $(htmldir)/clang-analyzer/
-	cp -rv scan.tmp/*/* $(htmldir)/clang-analyzer/
-
-clang-upload:
-	cd $(htmldir) && \
-		cvs add clang-analyzer || true && \
-		cvs add clang-analyzer/*.css clang-analyzer/*.js \
-			clang-analyzer/*.html || true && \
-		cvs commit -m "Update." clang-analyzer
-
-gendoc-copy:
-	cd doc && $(SHELL) ../build-aux/gendocs.sh \
-		--html "--css-include=texinfo.css" \
-		-o ../$(htmldir)/manual/ $(PACKAGE) "$(PACKAGE_NAME)"
-
-gendoc-upload:
-	cd $(htmldir) && \
-		cvs add manual || true && \
-		cvs add manual/html_node || true && \
-		cvs add -kb manual/*.gz manual/*.pdf || true && \
-		cvs add manual/*.txt manual/*.html \
-			manual/html_node/*.html || true && \
-		cvs commit -m "Update." manual/
-
-gtkdoc-copy:
-	mkdir -p $(htmldir)/reference/
-	cp -v doc/reference/$(PACKAGE).pdf \
-		doc/reference/html/*.html \
-		doc/reference/html/*.png \
-		doc/reference/html/*.devhelp2 \
-		doc/reference/html/*.css \
-		$(htmldir)/reference/
-
-gtkdoc-upload:
-	cd $(htmldir) && \
-		cvs add reference || true && \
-		cvs add -kb reference/*.png reference/*.pdf || true && \
-		cvs add reference/*.html reference/*.css \
-			reference/*.devhelp2 || true && \
-		cvs commit -m "Update." reference/
-
-ChangeLog:
-	(cd "$(srcdir)" ; if test -d .git ; then git log --no-merges --no-decorate --pretty  --since="2014 November 07"|grep -v ^'commit' ; else echo "Empty" ; fi) > ChangeLog
-
-tag = $(PACKAGE)_`echo $(VERSION) | sed 's/\./_/g'`
-
-tarball:
-	! git tag -l $(tag) | grep $(PACKAGE) > /dev/null
-	rm -f ChangeLog
-	$(MAKE) ChangeLog distcheck
-
-source:
-	git tag -u b565716f -m $(VERSION) $(tag)
-
-RELEASE_TYPE?=stable
-release-upload-ftp:
-	build-aux/gnupload --to ftp.gnu.org:$(PACKAGE) $(distdir).tar.gz
-
-release: release-upload-ftp
-
-.PHONY: bootstrap autoreconf
diff --git a/configure.ac b/configure.ac
index f33290d..bb33e23 100644
--- a/configure.ac
+++ b/configure.ac
@@ -16,31 +16,31 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-AC_PREREQ([2.64])
-AC_INIT([GNU Libtasn1],[4.16.0],[help-libtasn1@gnu.org])
-AC_CONFIG_AUX_DIR([build-aux])
-AC_CONFIG_MACRO_DIRS([m4 m4-gl])
-AC_CONFIG_HEADERS(config.h)
-AM_INIT_AUTOMAKE([1.10 foreign -Wall -Wno-override])
-AM_SILENT_RULES([yes])
+AC_INIT([GNU Libtasn1],
+        m4_esyscmd([build-aux/git-version-gen .tarball-version]),
+        [help-libtasn1@gnu.org])
 
 # Library code modified:                              REVISION++
 # Interfaces changed/added/removed:   CURRENT++       REVISION=0
 # Interfaces added:                             AGE++
 # Interfaces removed:                           AGE=0
 AC_SUBST(LT_CURRENT, 12)
-AC_SUBST(LT_REVISION, 0)
+AC_SUBST(LT_REVISION, 1)
 AC_SUBST(LT_AGE, 6)
 
-# Generate version defines for include file
-AC_SUBST([ASN1_VERSION_MAJOR], [`echo $VERSION|cut -d'.' -f1`])
-AC_SUBST([ASN1_VERSION_MINOR], [`echo $VERSION|cut -d'.' -f2`])
-# Let's activate the following line as soon as we change to extended version numbering
-#AC_SUBST([ASN1_VERSION_PATCH], [`echo $VERSION|cut -d'.' -f3`])
-AC_SUBST([ASN1_VERSION_PATCH], [`echo 0`])
-AC_SUBST([ASN1_VERSION_NUMBER], [`printf '0x%02x%02x%02x' $ASN1_VERSION_MAJOR $ASN1_VERSION_MINOR $ASN1_VERSION_PATCH`])
-AC_CONFIG_FILES([lib/includes/libtasn1.h])
+AC_SUBST([MAJOR_VERSION], [`echo $PACKAGE_VERSION|cut -d'.' -f1`])
+AC_SUBST([MINOR_VERSION], [`echo $PACKAGE_VERSION|cut -d'.' -f2`])
+AC_SUBST([PATCH_VERSION], [`echo $PACKAGE_VERSION|cut -d'.' -f3`])
+AC_SUBST([NUMBER_VERSION], [`printf '0x%02x%02x%02x' $MAJOR_VERSION $MINOR_VERSION $PATCH_VERSION`])
 
+AC_MSG_NOTICE([$PACKAGE_NAME $PACKAGE_VERSION $PACKAGE_TARNAME $MAJOR_VERSION.$MINOR_VERSION.$PATCH_VERSION $NUMBER_VERSION $LT_CURRENT:$LT_REVISION:$LT_AGE $DLL_VERSION])
+
+AC_CONFIG_AUX_DIR([build-aux])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_HEADERS(config.h)
+
+AM_INIT_AUTOMAKE([-Wall -Wno-portability])
+AM_SILENT_RULES([yes])
 
 AC_PROG_CC
 gl_EARLY
@@ -53,19 +53,17 @@
 
 AC_CHECK_FUNCS([clock_gettime fmemopen])
 
-dnl Checks for programs.
 AM_MISSING_PROG(HELP2MAN, help2man, $missing_dir)
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_AR
-AM_PROG_LIBTOOL
+LT_INIT([win32-dll])
 GTK_DOC_CHECK(1.2)
 
 AC_CHECK_SIZEOF(unsigned long int, 4)
 AC_CHECK_SIZEOF(unsigned int, 4)
 
-# For gnulib compatibility modules.
 gl_INIT
 
+AX_CODE_COVERAGE
+
 AC_ARG_ENABLE([gcc-warnings],
   [AS_HELP_STRING([--disable-gcc-warnings],
     [disable GCC warnings (for developers)])],
@@ -103,8 +101,6 @@
   gl_WARN_ADD([-fdiagnostics-color=always])      # colors even when using ccache
 fi
 
-AX_CODE_COVERAGE
-
 AC_ARG_ENABLE([fuzzing],
   [AS_HELP_STRING([--enable-fuzzing], [Turn on fuzzing build (for developers)])],
   [enable_fuzzing=yes; AC_SUBST([LIB_FUZZING_ENGINE])], [enable_fuzzing=no; LIB_FUZZING_ENGINE=""])
@@ -121,24 +117,31 @@
   doc/Makefile
   doc/reference/Makefile
   examples/Makefile
+  fuzz/Makefile
   lib/Makefile
   lib/gl/Makefile
+  lib/includes/libtasn1.h
   lib/libtasn1.pc
   src/Makefile
   tests/Makefile
-  fuzz/Makefile
 ])
 AC_OUTPUT
 
-AC_MSG_NOTICE([summary of build options:
+AC_MSG_NOTICE([Summary of build options:
 
-  version:          ${VERSION} shared $LT_CURRENT:$LT_REVISION:$LT_AGE
-  Host type:        ${host}
-  Install prefix:   ${prefix}
-  Compiler:         ${CC}
-  Warning flags:    errors: ${WERROR_CFLAGS} warnings: ${WARN_CFLAGS}
-  Library types:    Shared=${enable_shared}, Static=${enable_static}
-  Valgrind:         ${VALGRIND}
-  Version script:   $have_ld_version_script
-  Fuzzing build:    $enable_fuzzing, $LIB_FUZZING_ENGINE
+  Version:           ${VERSION}
+  Libtool version    $LT_CURRENT:$LT_REVISION:$LT_AGE
+  DLL version:       $DLL_VERSION
+  Header version:    major $MAJOR_VERSION minor $MINOR_VERSION patch $PATCH_VERSION number $NUMBER_VERSION
+  Build/host system: ${build} / ${host}
+  Install prefix:    ${prefix}
+  Compiler:          ${CC}
+  Warning flags:     ${WARN_CFLAGS}
+  CFLAGS:            ${CFLAGS} ${CPPFLAGS}
+  LDFlags:           ${LDFLAGS}
+  Documentation:     ${enable_doc}
+  Library types:     Shared=${enable_shared}, Static=${enable_static}
+  Valgrind:          $gl_cv_prog_valgrind_works ${VALGRIND}
+  Version script:    $have_ld_version_script
+  Fuzzing build:     $enable_fuzzing $LIB_FUZZING_ENGINE
 ])
diff --git a/doc/Makefile.am b/doc/Makefile.am
index d8b1f55..2032420 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -26,8 +26,6 @@
 info_TEXINFOS = libtasn1.texi
 libtasn1_TEXINFOS = fdl-1.3.texi texinfo.css $(gdoc_TEXINFOS)
 
-AM_MAKEINFOFLAGS = -I $(top_builddir)/doc
-TEXI2DVI = texi2dvi $(AM_MAKEINFOFLAGS)
 AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS) \
 	--no-split --number-sections --css-include=texinfo.css
 
diff --git a/doc/gendocs_template b/doc/gendocs_template
deleted file mode 100644
index af645e5..0000000
--- a/doc/gendocs_template
+++ /dev/null
@@ -1,100 +0,0 @@
-<!--#include virtual="/server/header.html" -->
-<!-- Parent-Version: 1.77 -->
-<title>%%TITLE%% - GNU Project - Free Software Foundation</title>
-<!--#include virtual="/server/banner.html" -->
-<h2>%%TITLE%%</h2>
-
-<address>Free Software Foundation</address>
-<address>last updated %%DATE%%</address>
-
-<p>This manual (%%PACKAGE%%) is available in the following formats:</p>
-
-<ul>
-<li><a href="%%PACKAGE%%.html">HTML
-    (%%HTML_MONO_SIZE%%K bytes)</a> - entirely on one web page.</li>
-<li><a href="html_node/index.html">HTML</a> - with one web page per
-    node.</li>
-%%IF HTML_SECTION%%
-<li><a href="html_section/index.html">HTML</a> - with one web page per
-    section.</li>
-%%ENDIF HTML_SECTION%%
-%%IF HTML_CHAPTER%%
-<li><a href="html_chapter/index.html">HTML</a> - with one web page per
-    chapter.</li>
-%%ENDIF HTML_CHAPTER%%
-<li><a href="%%PACKAGE%%.html.gz">HTML compressed
-    (%%HTML_MONO_GZ_SIZE%%K gzipped characters)</a> - entirely on
-    one web page.</li>
-<li><a href="%%PACKAGE%%.html_node.tar.gz">HTML compressed
-    (%%HTML_NODE_TGZ_SIZE%%K gzipped tar file)</a> -
-    with one web page per node.</li>
-%%IF HTML_SECTION%%
-<li><a href="%%PACKAGE%%.html_section.tar.gz">HTML compressed
-    (%%HTML_SECTION_TGZ_SIZE%%K gzipped tar file)</a> -
-    with one web page per section.</li>
-%%ENDIF HTML_SECTION%%
-%%IF HTML_CHAPTER%%
-<li><a href="%%PACKAGE%%.html_chapter.tar.gz">HTML compressed
-    (%%HTML_CHAPTER_TGZ_SIZE%%K gzipped tar file)</a> -
-    with one web page per chapter.</li>
-%%ENDIF HTML_CHAPTER%%
-<li><a href="%%PACKAGE%%.info.tar.gz">Info document
-    (%%INFO_TGZ_SIZE%%K bytes gzipped tar file)</a>.</li>
-<li><a href="%%PACKAGE%%.txt">ASCII text
-    (%%ASCII_SIZE%%K bytes)</a>.</li>
-<li><a href="%%PACKAGE%%.txt.gz">ASCII text compressed
-    (%%ASCII_GZ_SIZE%%K bytes gzipped)</a>.</li>
-<li><a href="%%PACKAGE%%.dvi.gz">TeX dvi file
-    (%%DVI_GZ_SIZE%%K bytes gzipped)</a>.</li>
-<li><a href="%%PACKAGE%%.pdf">PDF file
-    (%%PDF_SIZE%%K bytes)</a>.</li>
-<li><a href="%%PACKAGE%%.texi.tar.gz">Texinfo source
-    (%%TEXI_TGZ_SIZE%%K bytes gzipped tar file).</a></li>
-</ul>
-
-<p>You can <a href="http://shop.fsf.org/">buy printed copies of
-some manuals</a> (among other items) from the Free Software Foundation;
-this helps support FSF activities.</p>
-
-<p>There is also an API reference manual:
-
-<p>
-<ul>
-  <li><a href="../reference/">HTML Reference API Manual (GTK-DOC)</a>.
-  <li><a href="../reference/%%PACKAGE%%.pdf">PDF Reference API Manual (GTK-DOC)</a>.
-  <li><a href="../reference/%%PACKAGE%%.devhelp2">DevHelp Reference API Manual (GTK-DOC)</a>.
-</ul>
-
-<p>(This page generated by the <a href="%%SCRIPTURL%%">%%SCRIPTNAME%%
-script</a>.)</p>
-
-<!-- If needed, change the copyright block at the bottom. In general,
-     all pages on the GNU web server should have the section about
-     verbatim copying.  Please do NOT remove this without talking
-     with the webmasters first.
-     Please make sure the copyright date is consistent with the document
-     and that it is like this: "2001, 2002", not this: "2001-2002". -->
-</div><!-- for id="content", starts in the include above -->
-<!--#include virtual="/server/footer.html" -->
-<div id="footer">
-<div class="unprintable">
-
-<p>Please send general FSF &amp; GNU inquiries to
-<a href="mailto:gnu@gnu.org">&lt;gnu@gnu.org&gt;</a>.
-There are also <a href="/contact/">other ways to contact</a>
-the FSF.  Broken links and other corrections or suggestions can be sent
-to <a href="mailto:%%EMAIL%%">&lt;%%EMAIL%%&gt;</a>.</p>
-</div>
-
-<p>Copyright &copy; 2017-2021 Free Software Foundation, Inc.</p>
-
-<p>This page is licensed under a <a rel="license"
-href="http://creativecommons.org/licenses/by-nd/3.0/us/">Creative
-Commons Attribution-NoDerivs 3.0 United States License</a>.</p>
-
-<!--#include virtual="/server/bottom-notes.html" -->
-
-</div>
-</div>
-</body>
-</html>
diff --git a/doc/release-process.txt b/doc/release-process.txt
deleted file mode 100644
index 161231e..0000000
--- a/doc/release-process.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Release steps:
-
-* Review changes compared to last release.
-  make review-diff
-
-* Make sure LT_* variables in configure.ac are updated properly.
-
-* Make sure NEWS file contains a good summary of changes.
-
-* Optionally check that everything builds.
-  make release-check
-
-* Replace 'unreleased' with 'released YYYY-MM-DD' in NEWS and commit
-  it with a commit log like 'Version 2.13.'.
-
-* Build tarball and update webpages.
-  make release
-
-* Email announcement, based on announce.txt.
-
-* Create a Savannah news blurb about the release:
-  https://savannah.gnu.org/news/?group=libtasn1
-
-* Notify freecode.org.
-
-Post-release:
-
-* Update NEWS file for another release.
diff --git a/gnulib b/gnulib
index 7cc8d8a..3b4cd76 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 7cc8d8aa0db12119d6d88af430238c24361afc4e
+Subproject commit 3b4cd76a8e64d4b70e2aff61cbca77df056ffcf4
diff --git a/gtk-doc.make b/gtk-doc.make
deleted file mode 120000
index 0870846..0000000
--- a/gtk-doc.make
+++ /dev/null
@@ -1 +0,0 @@
-/usr/share/gtk-doc/data/gtk-doc.make
\ No newline at end of file
diff --git a/lib/Makefile.am b/lib/Makefile.am
index f0e98b7..f06c7dc 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -60,3 +60,11 @@
 else
 libtasn1_la_LDFLAGS += -export-symbols-regex '^(asn1|libtasn1_).*'
 endif
+
+if HAVE_LD_OUTPUT_DEF
+libtasn1_la_LDFLAGS += -Wl,--output-def,libtasn1-$(DLL_VERSION).def
+libtasn1-$(DLL_VERSION).def: libtasn1.la
+defexecdir = $(libdir)
+defexec_DATA = libtasn1-$(DLL_VERSION).def
+DISTCLEANFILES = $(defexec_DATA)
+endif
diff --git a/lib/gl/doc/gendocs_template.diff b/lib/gl/doc/gendocs_template.diff
new file mode 100644
index 0000000..723b58c
--- /dev/null
+++ b/lib/gl/doc/gendocs_template.diff
@@ -0,0 +1,18 @@
+--- doc/gendocs_template.orig	2021-05-13 13:44:55.608847212 +0200
++++ doc/gendocs_template	2021-05-13 13:45:37.545045274 +0200
+@@ -66,6 +66,15 @@
+ some manuals</a> (among other items) from the Free Software Foundation;
+ this helps support FSF activities.</p>
+ 
++<p>There is also an API reference manual:
++
++<p>
++<ul>
++  <li><a href="../reference/">HTML Reference API Manual (GTK-DOC)</a>.
++  <li><a href="../reference/%%PACKAGE%%.pdf">PDF Reference API Manual (GTK-DOC)</a>.
++  <li><a href="../reference/%%PACKAGE%%.devhelp2">DevHelp Reference API Manual (GTK-DOC)</a>.
++</ul>
++
+ <p>(This page generated by the <a href="%%SCRIPTURL%%">%%SCRIPTNAME%%
+ script</a>.)</p>
+ 
diff --git a/lib/gl/override/m4/valgrind-tests.m4.diff b/lib/gl/override/m4/valgrind-tests.m4.diff
deleted file mode 100644
index 33d3723..0000000
--- a/lib/gl/override/m4/valgrind-tests.m4.diff
+++ /dev/null
@@ -1,15 +0,0 @@
---- valgrind-tests.m4	2018-05-25 10:11:51.767309109 +0200
-+++ valgrind-tests.m4.gnutls	2018-05-25 10:20:02.999088040 +0200
-@@ -12,9 +12,9 @@
- AC_DEFUN([gl_VALGRIND_TESTS],
- [
-   AC_ARG_ENABLE([valgrind-tests],
--    AS_HELP_STRING([--disable-valgrind-tests],
--                   [don't try to run self tests under valgrind]),
--    [opt_valgrind_tests=$enableval], [opt_valgrind_tests=yes])
-+    AS_HELP_STRING([--enable-valgrind-tests],
-+                   [try to run self tests under valgrind]),
-+    [opt_valgrind_tests=$enableval], [opt_valgrind_tests=no])
- 
-   # Run self-tests under valgrind?
-   if test "$opt_valgrind_tests" = "yes" && test "$cross_compiling" = no; then
diff --git a/lib/gl/top/README-release.diff b/lib/gl/top/README-release.diff
new file mode 100644
index 0000000..a38c1a9
--- /dev/null
+++ b/lib/gl/top/README-release.diff
@@ -0,0 +1,104 @@
+--- README-release.orig	2021-05-13 15:07:14.381783478 +0200
++++ README-release	2021-05-13 15:09:33.914755367 +0200
+@@ -6,6 +6,13 @@
+     git checkout master
+     git pull origin master
+ 
++* Review changes compared to last release, and make sure NEWS file
++  contains a good summary of changes.
++
++    make review-diff
++
++* Make sure LT_* variables in configure.ac are updated properly.
++
+ * Ensure that the latest stable versions of autoconf, automake, etc.
+   are in your PATH.  See the buildreq list in bootstrap.conf for
+   the complete list of tools.
+@@ -19,9 +26,9 @@
+ 
+     git push origin master
+ 
+-* Check that the NixOS/Hydra autobuilder is reporting all is well:
++* Check that the GitLab autobuilder is reporting all is well:
+ 
+-    https://hydra.nixos.org/project/gnu/@PACKAGE@-master
++    https://gitlab.com/gnutls/libtasn1/-/pipelines
+ 
+ * Run the following command to download any new translations:
+ 
+@@ -29,27 +36,26 @@
+ 
+ * Pre-release testing: ensure that the following commands succeed:
+ 
+-    c=check ve=check-very-expensive; git grep -q "^$ve:\$" && c=$ve
+-    make $c syntax-check distcheck
++    make check syntax-check distcheck
+ 
+ * To (i) set the date, version number, and release TYPE on line 3 of
+   NEWS, (ii) commit that, and (iii) tag the release, run
+ 
+     # "TYPE" must be stable, beta or alpha
+-    make release-commit RELEASE='X.Y TYPE'
++    make release-commit RELEASE='X.Y.Z TYPE'
+ 
+ * Run the following to create release tarballs.  Your choice selects the
+   corresponding upload-to destination in the emitted gnupload command.
+   The different destinations are specified in cfg.mk.  See the definitions
+   of gnu_ftp_host-{alpha,beta,stable}.
+ 
+-    make release RELEASE='X.Y TYPE'
++    make release RELEASE='X.Y.Z TYPE'
+ 
+ * Test the tarball.  Copy it to a few odd-ball systems and ensure that
+   it builds and passes all tests.
+ 
+ * While that's happening, write the release announcement that you will
+-  soon post.  Start with the template, $HOME/announce-@PACKAGE@-X.Y
++  soon post.  Start with the template, $HOME/announce-libtasn1-X.Y.Z
+   that was just created by that "make" command.
+ 
+ Once all the builds and tests have passed,
+@@ -57,7 +63,7 @@
+ * Run the gnupload command that was suggested by your "make release"
+   run above, or run
+ 
+-    make upload RELEASE='X.Y TYPE'
++    make upload RELEASE='X.Y.Z TYPE'
+ 
+ * Wait a few minutes (maybe up to 30?) and then use the release URLs to
+   download all tarball/signature pairs and use gpg --verify to ensure
+@@ -68,28 +74,6 @@
+     v=$(cat .prev-version)
+     git push origin master tag v$v
+ 
+-* Announce it on Savannah first, so you can include the savannah.org
+-  announcement link in the email message.
+-
+-  Go to the news-submission form:
+-
+-    https://savannah.gnu.org/news/submit.php?group=@PACKAGE@
+-
+-  If it does not work, then enable "News" for the project via this link:
+-
+-    https://savannah.gnu.org/project/admin/editgroupfeatures.php?group=@PACKAGE@
+-
+-  Write something like the following:
+-
+-    Subject: @PACKAGE@-X.Y released [stable]
+-    +verbatim+
+-    ...paste the announcement here...
+-    -verbatim-
+-
+-  Then go here to approve it:
+-
+-    https://savannah.gnu.org/news/approve.php?group=@PACKAGE@
+-
+ * Send the announcement email message.
+ 
+ * After each non-alpha release, run
+@@ -98,4 +82,4 @@
+ 
+   to update the on-line manual accessible at
+ 
+-    https://www.gnu.org/software/@PACKAGE@/manual/
++    https://www.gnu.org/software/libtasn1/manual/
diff --git a/lib/includes/libtasn1.h.in b/lib/includes/libtasn1.h.in
index d8e6d50..97a01c1 100644
--- a/lib/includes/libtasn1.h.in
+++ b/lib/includes/libtasn1.h.in
@@ -75,28 +75,28 @@
  *
  * Major version number of the library.
  */
-#define ASN1_VERSION_MAJOR @ASN1_VERSION_MAJOR@
+#define ASN1_VERSION_MAJOR @MAJOR_VERSION@
 
 /**
  * ASN1_VERSION_MINOR:
  *
  * Minor version number of the library.
  */
-#define ASN1_VERSION_MINOR @ASN1_VERSION_MINOR@
+#define ASN1_VERSION_MINOR @MINOR_VERSION@
 
 /**
  * ASN1_VERSION_PATCH:
  *
  * Patch version number of the library.
  */
-#define ASN1_VERSION_PATCH @ASN1_VERSION_PATCH@
+#define ASN1_VERSION_PATCH @PATCH_VERSION@
 
 /**
  * ASN1_VERSION_NUMBER:
  *
  * Version number of the library as a number.
  */
-#define ASN1_VERSION_NUMBER @ASN1_VERSION_NUMBER@
+#define ASN1_VERSION_NUMBER @NUMBER_VERSION@
 
 
 #if defined __GNUC__ && !defined ASN1_INTERNAL_BUILD
@@ -210,7 +210,7 @@
   const void *value;		/* Node value */
 } asn1_static_node;
 
-/* List of constants for field type of node_asn  */
+/* List of constants for field type of asn1_static_node */
 #define ASN1_ETYPE_INVALID        0
 #define ASN1_ETYPE_CONSTANT       1
 #define ASN1_ETYPE_IDENTIFIER     2
diff --git a/lib/libtasn1.pc.in b/lib/libtasn1.pc.in
index 7a10d96..faa93fb 100644
--- a/lib/libtasn1.pc.in
+++ b/lib/libtasn1.pc.in
@@ -24,7 +24,7 @@
 
 Name: libtasn1
 Description: Library for ASN.1 and DER manipulation
-URL: http://www.gnu.org/software/libtasn1/
+URL: https://www.gnu.org/software/libtasn1/
 Version: @VERSION@
 Libs: -L${libdir} -ltasn1
 Cflags: -I${includedir}
diff --git a/m4/ax_check_gnu_make.m4 b/m4/ax_check_gnu_make.m4
index 6811043..785dc96 100644
--- a/m4/ax_check_gnu_make.m4
+++ b/m4/ax_check_gnu_make.m4
@@ -69,7 +69,7 @@
 #   and this notice are preserved. This file is offered as-is, without any
 #   warranty.
 
-#serial 11
+#serial 12
 
 AC_DEFUN([AX_CHECK_GNU_MAKE],dnl
   [AC_PROG_AWK
@@ -87,7 +87,7 @@
     done ;])
 dnl If there was a GNU version, then set @ifGNUmake@ to the empty string, '#' otherwise
   AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifGNUmake], ["#"])],   [AS_VAR_SET([ifGNUmake], [""])])
-  AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifnGNUmake], [""])],   [AS_VAR_SET([ifGNUmake], ["#"])])
+  AS_VAR_IF([_cv_gnu_make_command], [""], [AS_VAR_SET([ifnGNUmake], [""])],   [AS_VAR_SET([ifnGNUmake], ["#"])])
   AS_VAR_IF([_cv_gnu_make_command], [""], [AS_UNSET(ax_cv_gnu_make_command)], [AS_VAR_SET([ax_cv_gnu_make_command], [${_cv_gnu_make_command}])])
   AS_VAR_IF([_cv_gnu_make_command], [""],[$2],[$1])
   AC_SUBST([ifGNUmake])
diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4
index 3d36924..352165b 100644
--- a/m4/ax_code_coverage.m4
+++ b/m4/ax_code_coverage.m4
@@ -74,7 +74,7 @@
 #   You should have received a copy of the GNU Lesser General Public License
 #   along with this program. If not, see <https://www.gnu.org/licenses/>.
 
-#serial 32
+#serial 34
 
 m4_define(_AX_CODE_COVERAGE_RULES,[
 AX_ADD_AM_MACRO_STATIC([
@@ -138,7 +138,7 @@
 CODE_COVERAGE_GENHTML_OPTIONS ?= \$(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT)
 CODE_COVERAGE_IGNORE_PATTERN ?=
 
-GITIGNOREFILES = \$(GITIGNOREFILES) \$(CODE_COVERAGE_OUTPUT_FILE) \$(CODE_COVERAGE_OUTPUT_DIRECTORY)
+GITIGNOREFILES := \$(GITIGNOREFILES) \$(CODE_COVERAGE_OUTPUT_FILE) \$(CODE_COVERAGE_OUTPUT_DIRECTORY)
 code_coverage_v_lcov_cap = \$(code_coverage_v_lcov_cap_\$(V))
 code_coverage_v_lcov_cap_ = \$(code_coverage_v_lcov_cap_\$(AM_DEFAULT_VERBOSITY))
 code_coverage_v_lcov_cap_0 = @echo \"  LCOV   --capture\" \$(CODE_COVERAGE_OUTPUT_FILE);
@@ -175,7 +175,7 @@
 
 code-coverage-dist-clean:
 
-A][M_DISTCHECK_CONFIGURE_FLAGS = \$(A][M_DISTCHECK_CONFIGURE_FLAGS) --disable-code-coverage
+A][M_DISTCHECK_CONFIGURE_FLAGS := \$(A][M_DISTCHECK_CONFIGURE_FLAGS) --disable-code-coverage
  else # ifneq (\$(abs_builddir), \$(abs_top_builddir))
 check-code-coverage:
 
diff --git a/tests/decoding-invalid-x509.sh b/tests/decoding-invalid-x509.sh
index bc5bd42..919339b 100755
--- a/tests/decoding-invalid-x509.sh
+++ b/tests/decoding-invalid-x509.sh
@@ -17,9 +17,14 @@
 
 srcdir="${srcdir:-.}"
 
-if ! test -z "${VALGRIND}";then
-VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=7"
+if ! test -z "${VALGRIND}"; then
+    if test $RUN_EXPENSIVE_TESTS = yes; then
+	VALGRIND="${LIBTOOL:-libtool} --mode=execute ${VALGRIND} --error-exitcode=7"
+    else
+	VALGRIND=
+    fi
 fi
+
 TMPFILE=decoding-invalid.$$.tmp
 ASN1DECODING="${ASN1DECODING:-../src/asn1Decoding$EXEEXT}"
 ASN1PKIX="${ASN1PKIX:-pkix.asn}"