]> git.ipfire.org Git - thirdparty/automake.git/log
thirdparty/automake.git
20 months agom4: use AS_IF instead of ! builtin.
Mike Frysinger [Wed, 15 Nov 2023 18:35:40 +0000 (10:35 -0800)] 
m4: use AS_IF instead of ! builtin.

* m4/sanity.m4: Switch `if !` to AS_IF.

21 months agofix: syntax error in sanity.m4
Jim Meyering [Thu, 2 Nov 2023 05:20:05 +0000 (22:20 -0700)] 
fix: syntax error in sanity.m4

* m4/sanity.m4 (_AM_FILESYSTEM_TIMESTAMP_RESOLUTION): Fix
syntax error from preceding change: add a missing double quote.

21 months agodoc: more NEWS on fractional seconds.
Karl Berry [Thu, 2 Nov 2023 01:05:53 +0000 (18:05 -0700)] 
doc: more NEWS on fractional seconds.

* NEWS: fixed autom4te is not yet released.

21 months agodoc: references for non-fractional timestamps.
Karl Berry [Thu, 2 Nov 2023 01:03:36 +0000 (18:03 -0700)] 
doc: references for non-fractional timestamps.

The non-fractional fix from Bogdan fixes
https://bugs.gnu.org/64756, discussed earlier in a long thread on
automake in 2023-03 and 2023-04; references in the bug.
Jacob Bachmeyer contributed to the analysis and fixes.

* m4/sanity.m4:

21 months agodoc: add bug numbers to NEWS.
Karl Berry [Thu, 2 Nov 2023 00:41:53 +0000 (17:41 -0700)] 
doc: add bug numbers to NEWS.

* NEWS: add some bug numbers.

21 months agom4: fall back to non-fractional timestamps with older autom4te.
Bogdan [Thu, 2 Nov 2023 00:40:47 +0000 (17:40 -0700)] 
m4: fall back to non-fractional timestamps with older autom4te.

* m4/sanity.m4 (_AM_FILESYSTEM_TIMESTAMP_RESOLUTION): if
HiRes is not present in Autom4te/FileUtils.pm, do not consider
fractional sleeps.

21 months agom4: syntax fix for lex change.
Karl Berry [Thu, 2 Nov 2023 00:36:01 +0000 (17:36 -0700)] 
m4: syntax fix for lex change.

* m4/lex.m4: dnl caused "fiif" in output.

21 months agodoc: tiny Texinfo cleanups.
Karl Berry [Wed, 1 Nov 2023 16:25:21 +0000 (09:25 -0700)] 
doc: tiny Texinfo cleanups.

* doc/automake.texi (Public macros): Missed @var usage.
(Dependencies): "The Autoconf Manual" in cross-manual xref.

21 months agotests: add new test for AM_PROG_LEX arguments.
Bogdan [Wed, 1 Nov 2023 16:22:46 +0000 (09:22 -0700)] 
tests: add new test for AM_PROG_LEX arguments.

See https://bugs.gnu.org/65600 and https://bugs.gnu.org/65730
and https://lists.gnu.org/archive/html/automake/2023-07/msg00007.html.

* t/lex-args.sh: New test.
* t/list-of-tests.mk (handwritten_tests): Add it.

21 months agom4: update invocation of AC_PROG_LEX.
Łukasz Stelmach [Wed, 1 Nov 2023 16:18:57 +0000 (09:18 -0700)] 
m4: update invocation of AC_PROG_LEX.

* m4/lex.m4: Pass on any arguments given to AC_PROG_LEX.
* doc/automake.texi: Describe this.
* NEWS: Mention this.
* THANKS: New contributor.

21 months agodoc: user conditional for dependency tracking.
Karl Berry [Mon, 30 Oct 2023 17:14:51 +0000 (10:14 -0700)] 
doc: user conditional for dependency tracking.

* doc/automake.texi (Automatic dependency tracking): Describe
basing a conditional for dependency tracking on the shell variable
enable_dependency_tracking. Mentioned by Nick Bowler.
https://lists.gnu.org/archive/html/automake/2023-09/msg00004.html

* HACKING: Capitalization.

22 months agotests: add test for new posix option.
Karl Berry [Fri, 6 Oct 2023 15:28:19 +0000 (08:28 -0700)] 
tests: add test for new posix option.

See https://bugs.gnu.org/55025.

* t/posixtarget.sh: New test.
* t/list-of-tests.mk (handwritten_tests): Add it.
* t/README: mention using existing tests as a basis.

22 months agoautomake: new option posix to emit .POSIX target first.
Vincent Lefevre [Fri, 6 Oct 2023 15:18:33 +0000 (08:18 -0700)] 
automake: new option posix to emit .POSIX target first.

This patch is from https://bugs.gnu.org/55025.

* lib/Automake/Options.pm (_is_valid_easy_option): declare new
option "posix".
* bin/automake.in (generate_makefile): if the "posix" option is
present, add a .POSIX special target as the first non-comment
line in the Makefile.in files.
* NEWS: mention this.
* doc/automake.texi: likewise.

23 months agotests: avoid implicit function declarations.
Frédéric Bérat [Tue, 29 Aug 2023 18:00:41 +0000 (11:00 -0700)] 
tests: avoid implicit function declarations.

This patch is from https://bugs.gnu.org/59993 (v2 part 2).

* t/c-demo.sh: This patch is related to an effort to prepare
Automake for future GCC/Clang versions which set c99 as default
standard to be used.

C99 requires that functions be properly declared before use.
This is true for both user functions and standard functions,
e.g., printf.

* t/cond35.sh: Likewise.
* t/dist-vs-built-sources.sh: Likewise.
* t/lex-clean.sh: Likewise.
* t/lex-multiple.sh: Likewise.
* t/lex-nodist.sh: Likewise.
* t/ltcond2.sh: Likewise.
* t/ltconv.sh: Likewise.
* t/subobj-clean-lt-pr10697.sh: Likewise.
* t/subobj-clean-pr10697.sh: Likewise.
* t/tags-pr12372.sh: Likewise.
* t/yacc-basic.sh: Likewise.
* t/yacc-clean.sh: Likewise.
* t/yacc-nodist.sh: Likewise.

This patch is from https://bugs.gnu.org/59993.

23 months agotests: don't try to prevent flex from including unistd.h.
Frédéric Bérat [Tue, 29 Aug 2023 01:32:53 +0000 (18:32 -0700)] 
tests: don't try to prevent flex from including unistd.h.

This patch is from https://bugs.gnu.org/59994.

* t/cond35.sh: This patch is related to an effort to prepare
Automake for future GCC/Clang versions which set c99 as default
standard to be used.

In the current version of flex, not having unistd.h leads to
implicit function declarations that are not compatible with C99.

A future version of flex will (hopefully) make the "NO_UNISTD"
flag a no-op, and include unistd.h by default.

Also, while flex-dedicated tests had this macro set,
yacc tests did not, despite their use of flex.

For consistency, all the yacc/flex related tests now have the
"--never-interactive" option set in AM_LFLAGS, and do not try
define an isatty function.

* t/lex-clean-cxx.sh: Likewise.
* t/lex-clean.sh: Likewise.
* t/lex-depend-cxx.sh: Likewise.
* t/lex-depend.sh: Likewise.
* t/lex-header.sh: Likewise.
* t/lex-lib-external.sh: Likewise.
* t/lex-lib.sh: Likewise.
* t/lex-libobj.sh: Likewise.
* t/lex-line.sh: Likewise.
* t/lex-multiple.sh: Likewise.
* t/lex-nodist.sh: Likewise.
* t/lex-noyywrap.sh: Likewise.
* t/lex-pr204.sh: Likewise.
* t/lex-subobj-nodep.sh: Likewise.
* t/lex3.sh: Likewise.
* t/lex5.sh: Likewise.
* t/lexvpath.sh: Likewise.
* t/silent-lex.sh: Likewise.
* t/silent-many-languages.sh: Likewise.
* t/silent-yacc-headers.sh: Likewise.
* t/silent-yacc.sh: Likewise.
* t/subpkg-yacc.sh: Likewise.
* t/suffix10.tap: Likewise.
* t/yacc-auxdir.sh: Likewise.
* t/yacc-basic.sh: Likewise.
* t/yacc-bison-skeleton-cxx.sh: Likewise.
* t/yacc-bison-skeleton.sh: Likewise.
* t/yacc-clean-cxx.sh: Likewise.
* t/yacc-clean.sh: Likewise.
* t/yacc-cxx-grepping.sh: Likewise.
* t/yacc-cxx.sh: Likewise.
* t/yacc-d-basic.sh: Likewise.
* t/yacc-d-cxx.sh: Likewise.
* t/yacc-d-vpath.sh: Likewise.
* t/yacc-deleted-headers.sh: Likewise.
* t/yacc-depend.sh: Likewise.
* t/yacc-depend2.sh: Likewise.
* t/yacc-dist-nobuild-subdir.sh: Likewise.
* t/yacc-dist-nobuild.sh: Likewise.
* t/yacc-dry.sh: Likewise.
* t/yacc-grepping.sh: Likewise.
* t/yacc-grepping2.sh: Likewise.
* t/yacc-headers-and-dist-pr47.sh: Likewise.
* t/yacc-line.sh: Likewise.
* t/yacc-misc.sh: Likewise.
* t/yacc-mix-c-cxx.sh: Likewise.
* t/yacc-nodist.sh: Likewise.
* t/yacc-pr204.sh: Likewise.
* t/yacc-subdir.sh: Likewise.
* t/yacc-vpath.sh: Likewise.
* t/yacc-weirdnames.sh: Likewise.
* t/yflags-cmdline-override.sh: Likewise.
* t/yflags-cxx.sh: Likewise.
* t/yflags-d-false-positives.sh: Likewise.
* t/yflags-force-conditional.sh: Likewise.
* t/yflags-force-override.sh: Likewise.
* t/yflags-var-expand.sh: Likewise.
* t/yflags.sh: Likewise.

23 months agotests: avoid implicit function declaration in t/depcomp.sh.
Frédéric Bérat [Mon, 28 Aug 2023 13:11:39 +0000 (06:11 -0700)] 
tests: avoid implicit function declaration in t/depcomp.sh.

This patch is from https://bugs.gnu.org/60962.

* t/ax/depcomp.sh: save and restore sub/subfoo.h, so its
declaration will be seen, as required by C99.
* THANKS: add Frédéric.

2 years agomaint: Ineiev in THANKS.
Karl Berry [Thu, 10 Aug 2023 01:07:44 +0000 (18:07 -0700)] 
maint: Ineiev in THANKS.

* THANKS: add Ineiev.

2 years agoautomake: portability warning for dollar-escaped dollar signs.
Jan Engelhardt [Thu, 10 Aug 2023 01:07:00 +0000 (18:07 -0700)] 
automake: portability warning for dollar-escaped dollar signs.

This bug and fix was posted at
https://lists.gnu.org/archive/html/automake/2023-08/msg00003.html.

* lib/Automake/Variable.pm (scan_variable_expansions): rewrite
scan_variable_expansions regex to handle dollar-escaped dollar signs.
* t/dollarvar2.sh: test it.

2 years agodoc: missing docdir and lispdir in _DATA description.
Ineiev [Sun, 6 Aug 2023 00:58:10 +0000 (17:58 -0700)] 
doc: missing docdir and lispdir in _DATA description.

This changes fixes https://bugs.gnu.org/65032.

* doc/automake.texi (Data): add docdir and lispdir,
index doc_DATA and lisp_DATA.

2 years agoautomake: disable GNU make's internal pattern rules, for speed.
Bruno Haible [Fri, 21 Jul 2023 01:03:27 +0000 (18:03 -0700)] 
automake: disable GNU make's internal pattern rules, for speed.

From https://bugs.gnu.org/64743.

* lib/am/footer.am: Disable GNU make's internal pattern rules.
* lib/Automake/Rule.pm (_conditionals_for_rule): Add special handling
for these pattern rules from footer.am.
(define): Likewise.
* t/nodep.sh: Update test to avoid matching the new %:: rules.
* t/fnoc.sh: Update test to avoid matching the new %:: SCCS rule.

* NEWS: Mention this.
* doc/automake.texi (Suffixes): Likewise.
(Doc changes written by Karl.)

2 years agoautomake: set test delays to am_cv_filesystem_timestamp_resolution.
Mike Frysinger [Fri, 14 Jul 2023 15:50:51 +0000 (08:50 -0700)] 
automake: set test delays to am_cv_filesystem_timestamp_resolution.

This patch is from https://bugs.gnu.org/60808.

* configure.ac: Set test delays to
am_cv_filesystem_timestamp_resolution, instead of hardwiring
5sec on DJGPP and 2sec elsewhere. This speeds up test runs
significantly, informally as much 30%.

2 years agotexi: assume .texi.in generates .texi.
Bogdan [Thu, 13 Jul 2023 22:32:34 +0000 (15:32 -0700)] 
texi: assume .texi.in generates .texi.

This change refines the fix for https://bugs.gnu.org/54063.

* bin/automake.in (scan_texinfo_file): if .texi doesn't exist,
but .texi.in exists, read the latter for the Texinfo source.
Use the @setfilename argument, if present, to generate rules.
* t/txinfo-no-texi-but-texi-in.sh: new test.
* t/list-of-tests.mk (handwritten_tests): add it.

* doc/automake.texi (Texinfo): document this.
* NEWS: mention this.  (Doc changes written by Karl.)

2 years agotests: avoid some SunOS declaration conflicts.
Bogdan [Sun, 9 Jul 2023 16:57:15 +0000 (09:57 -0700)] 
tests: avoid some SunOS declaration conflicts.

This change: finishes fixing https://bugs.gnu.org/34151
  and https://bugs.gnu.org/30612 and https://bugs.gnu.org/42393;
fixes https://bugs.gnu.org/44795 and https://bugs.gnu.org/49755;
partially fixes https://bugs.gnu.org/45205
  and https://bugs.gnu.org/55073.
Still open: https://bugs.gnu.org/15256;

* t/lex-clean-cxx.sh: test __cplusplus, __sun, and __EXTERN_C__
before using extern "C" for the yylex decl, as explained at
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45205#13.
* t/lex-depend-cxx.sh: likewise.

* t/yacc-cxx.sh: "using" std::exit, std::free, std::malloc.
* t/yacc-d-cxx.sh: likewise.
* t/yacc-mix-c-cxx.sh: likewise.

* NEWS: mention this.

2 years agopython: generalize tests.
Bogdan [Fri, 7 Jul 2023 01:27:36 +0000 (18:27 -0700)] 
python: generalize tests.

This change finishes fixing https://bugs.gnu.org/30556.

* t/python-prefix.sh: use $PYTHON if set, not hardwiring "python".
* t/python-virtualenv.sh (get-pyexecdir): new make target;
use it instead of hardwiring $py_site.

2 years agopython: support noinst_PYTHON preceding foo_PYTHON.
Bogdan [Wed, 5 Jul 2023 15:59:29 +0000 (08:59 -0700)] 
python: support noinst_PYTHON preceding foo_PYTHON.

This change fixes https://bugs.gnu.org/24507.

* lib/am/python.am (am__pep3147_tweak): remove conditional
on %?INSTALL%.
* t/python-pr10995.sh: test with make uninstall.

2 years agoautomake: do not warn that POSIX variables are non-POSIX.
Bogdan [Sat, 1 Jul 2023 15:34:55 +0000 (08:34 -0700)] 
automake: do not warn that POSIX variables are non-POSIX.

This change fixes https://bugs.gnu.org/9587.

* lib/Automake/Variable.pm (_VARIABLE_PATTERN_EXTRA_POSIX):
new variable for $(*D) and the like.
(_VARIABLE_PATTERN): use it.
* t/vars3.sh: update test.
* NEWS: mention this.
POSIX spec (currently):
  https://pubs.opengroup.org/onlinepubs/9699919799/utilities/make.html

2 years agodoc: discuss setting uid/gid information in tarballs.
Karl Berry [Fri, 30 Jun 2023 00:59:48 +0000 (17:59 -0700)] 
doc: discuss setting uid/gid information in tarballs.

In response to https://bugs.gnu.org/19615.

* doc/automake.texi (Basics of Distribution): give
example of specifying the TAR_OPTIONS (environment)
variable used by GNU tar.

2 years agomaint: Update files from upstream with 'make fetch'.
Karl Berry [Wed, 28 Jun 2023 17:00:56 +0000 (10:00 -0700)] 
maint: Update files from upstream with 'make fetch'.

* lib/INSTALL: update with make fetch.
* lib/config.guess: Update.
* lib/config.sub: Likewise.
* lib/gitlog-to-changelog: Likewise.
* lib/texinfo.tex: Likewise.
* lib/update-copyright: Likewise.

2 years agodoc: discuss workaround for V=99 failing.
Karl Berry [Wed, 28 Jun 2023 01:10:38 +0000 (18:10 -0700)] 
doc: discuss workaround for V=99 failing.

In response to https://bugs.gnu.org/20077.

* doc/automake.texi (Tricks For Silencing Make): state and discuss
workarounds for the limitation of $(V) only being settable to 0 or 1.

2 years agodoc: bring a few examples up to date.
Karl Berry [Sun, 25 Jun 2023 01:31:29 +0000 (18:31 -0700)] 
doc: bring a few examples up to date.

* doc/automake.texi (Built Sources Example): use @kbd for typed
commands; show current output.
(Checking the Distribution): refer to Third-Party Makefiles
for the do-nothing dvi target example.
Other small wording tweaks throughout.

* HACKING: consistently omit $ prompt.
Say a bit more about versions of Autoconf.
Describe actual current status of branches (only master in use).
Give some topic examples.
"rerun" not "re-run".
Other small wording tweaks throughout.

2 years agotest: avoid sometime-race condition for dist-no-built-sources test.
Karl Berry [Sat, 24 Jun 2023 00:51:43 +0000 (17:51 -0700)] 
test: avoid sometime-race condition for dist-no-built-sources test.

* t/dist-no-built-sources.sh: rm the dist .tar.gz and .tar
generated after inspecting, to avoid it being considered up to
date on the second time through the loop.

2 years agodepcomp spelling fix
Paul Eggert [Thu, 8 Jun 2023 21:33:14 +0000 (14:33 -0700)] 
depcomp spelling fix

* lib/depcomp: Fix spelling in comment.
Originally reported by Josh Soref <jsoref@gmail.com> in:
https://lists.gnu.org/r/bug-gnulib/2023-06/msg00057.html

2 years agodoc: improve NAME string for man pages.
Karl Berry [Tue, 30 May 2023 00:54:07 +0000 (17:54 -0700)] 
doc: improve NAME string for man pages.

This change fixes https://bugs.gnu.org/62853 and
https://bugs.gnu.org/62854.

* doc/local.mk (update_mans): move $(AM_V_GEN): to calls;
include --name="$${HELP2MAN_NAME}".
(-%D%/aclocal-$(APIVERSION).1, %D%/automake-$(APIVERSION).1):
set HELP2MAN_NAME in environment to pass to help2man.

2 years agoconfigure: exit explicitly if the path to perl contains spaces.
Bogdan [Sun, 28 May 2023 01:10:11 +0000 (18:10 -0700)] 
configure: exit explicitly if the path to perl contains spaces.

This change ameloriates https://bugs.gnu.org/62896.

* configure.ac: exit explicitly if the result of AC_PATH_PROG for
perl contains spaces, since shebang lines cannot support such paths.
* THANKS (Bogdan): add.

2 years agodoc: HACKING bug merge; doc/local.mk help2man update hints.
Karl Berry [Sun, 28 May 2023 00:59:51 +0000 (17:59 -0700)] 
doc: HACKING bug merge; doc/local.mk help2man update hints.

* HACKING: give bug merge example.
* doc/local.mk: how to update help2man manually;
fix checklinkx sleep comment.

2 years agomaint: Update files from upstream with 'make fetch' + help2man.
Karl Berry [Sun, 28 May 2023 00:55:15 +0000 (17:55 -0700)] 
maint: Update files from upstream with 'make fetch' + help2man.

* lib/INSTALL: update with make fetch.
* lib/config.guess: Update.
* lib/config.sub: Likewise.
* lib/gendocs.sh: Likewise.
* lib/gnupload: Likewise.
* lib/texinfo.tex: Likewise.
* lib/update-copyright: Likewise.
* doc/help2man: now 1.49.1.

2 years agoPort py-compile to Python 2.6-
Paul Eggert [Thu, 30 Mar 2023 01:07:10 +0000 (18:07 -0700)] 
Port py-compile to Python 2.6-

* lib/py-compile: Port to Python 2.6 and earlier,
which lack importlib.

2 years agodo not assume GNU tar in test
Paul Eggert [Thu, 30 Mar 2023 01:05:25 +0000 (18:05 -0700)] 
do not assume GNU tar in test

* t/dist-no-built-sources.sh: Don’t assume
GNU Tar’s ability of decompressing tarballs.
Solaris 10 ‘tar’ doesn’t do that.

2 years agoRemove parentheses around test argument lists
Jacob Bachmeyer [Thu, 9 Feb 2023 05:30:00 +0000 (23:30 -0600)] 
Remove parentheses around test argument lists

This works around a parser bug in Perl 5.6.2.
* t/pm/General.pl: Remove parentheses on argument lists.

Copyright-paperwork-exempt: yes

2 years agoImprove test for blocked signals
Jacob Bachmeyer [Thu, 9 Feb 2023 05:07:26 +0000 (23:07 -0600)] 
Improve test for blocked signals

This fixes ERRORs reported by:
 * t/parallel-tests-interrupt.tap
 * t/self-check-exit.tap
 * t/self-check-is-blocked-signal.tap
 * t/tap-signal.tap

 * t/ax/am-test-lib.sh (is_blocked_signal): Revise Perl code
   to more closely follow documented interfaces where
   available.  This also works around bugs and limitations
   of the POSIX module in Perl 5.6.

Copyright-paperwork-exempt: yes

2 years agoPort 'make check' to platforms lacking libtool
Paul Eggert [Wed, 29 Mar 2023 18:48:02 +0000 (11:48 -0700)] 
Port 'make check' to platforms lacking libtool

* t/get-sysconf.sh: Don’t fail if libtoolize is missing.

2 years agoconfigure: recommend perl 5.10 or better
Paul Eggert [Wed, 29 Mar 2023 03:29:02 +0000 (20:29 -0700)] 
configure: recommend perl 5.10 or better

* configure.ac (PERL): Recommend perl 5.10 or better,
since 5.10 has higher-resolution timestamps.

2 years agoGracefully degrade if Time::HiRes is not available
Jacob Bachmeyer [Wed, 8 Feb 2023 04:42:59 +0000 (22:42 -0600)] 
Gracefully degrade if Time::HiRes is not available

Copyright-paperwork-exempt: yes

2 years agoRevert "maint: require perl 5.010 or later"
Jacob Bachmeyer [Wed, 8 Feb 2023 04:39:29 +0000 (22:39 -0600)] 
Revert "maint: require perl 5.010 or later"

This reverts commit 4e3744a15c4d8bdb46c11ead2fb56c5f591b714b.

Copyright-paperwork-exempt: yes

2 years agodoc: tweak old NEWS about ACLOCAL_AMFLAGS.
Karl Berry [Wed, 1 Mar 2023 23:03:30 +0000 (15:03 -0800)] 
doc: tweak old NEWS about ACLOCAL_AMFLAGS.

* NEWS: any ACLOCAL_AMFLAGS deprecation will be in a major
release (the hypothetical 2.0), not sooner.
* NEWS-2.0: developers who don't wish to be maintainers are also
welcome and needed.

2 years agodirstamp: revert change of Jan 11 2023.
Karl Berry [Tue, 28 Feb 2023 23:14:07 +0000 (15:14 -0800)] 
dirstamp: revert change of Jan 11 2023.

Fixes (hopefully) automake bug https://bugs.gnu.org/61867.

* bin/automake.in: restore explicit per-directory pattern rules,
since evidently @D is not supported on BSD-derived makes,
whatever POSIX says.  That is, revert this commit:
https://git.savannah.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=55f8fcfd08cbf15d65d61dd2db934b6c3171cf06

2 years agoUse higher-resolution file timestamps
Paul Eggert [Thu, 2 Feb 2023 22:17:52 +0000 (14:17 -0800)] 
Use higher-resolution file timestamps

* lib/Automake/FileUtils.pm (mtime):
Return higher-resolution file timestamps.
This isn’t perfect, but it’s better than what we had.
Code change taken from Autoconf to partially fix a race
<https://bugs.gentoo.org/show_bug.cgi?id=782985>.

2 years agomaint: require perl 5.010 or later
Paul Eggert [Thu, 2 Feb 2023 22:13:24 +0000 (14:13 -0800)] 
maint: require perl 5.010 or later

This is needed for better treatment of high-res timestamps.

2 years agotests: depcomp: ensure make_ok() fails when run_make fails
Frédéric Bérat [Mon, 12 Dec 2022 06:32:13 +0000 (07:32 +0100)] 
tests: depcomp: ensure make_ok() fails when run_make fails

While running automake tests with -std-gnu=c99, the compiler report
errors which lead to make to fail. Yet, these failures are ignored
during the tests, which considers them to be successful as stderror is
check for one specific pattern.

If make fails, investigation should be made to discover why, whatever
the reason for the failure is.

* t/ax/depcomp.sh: Make make_ok fail when make fails.

2 years agodistdir/emacs: avoid `test -d` with MKDIR_P
Mike Frysinger [Fri, 13 Jan 2023 09:02:57 +0000 (04:02 -0500)] 
distdir/emacs: avoid `test -d` with MKDIR_P

We don't need to do the `test -d ... || mkdir ...` dance when we
have the MKDIR_P helper, so simplify this code a bit.

* lib/am/distdir.am: Use $(MKDIR_P).
* lib/am/lisp.am: Drop redundant `test -d`.

2 years agotests: rework gettext to only check 'external' behavior
Mike Frysinger [Fri, 13 Jan 2023 01:31:31 +0000 (20:31 -0500)] 
tests: rework gettext to only check 'external' behavior

The gettext project deprecated non-external use back in 2010 with the
0.18 release, and made it fatal with the 0.20 release in 2019.  With
that version, calling AM_GNU_GETTEXT() fails, which means all Automake
tests are now skipped.  The t/gettext-macros.sh helper probes gettext
as such:

>+ autopoint --force
>  autopoint: *** AM_GNU_GETTEXT without 'external' argument is no longer supported in version 0.21.1
>  autopoint: *** Stop.
> ...
>+ aclocal-1.16 -Werror -Wno-syntax -I m4 --install
>  aclocal-1.16: warnings are treated as errors
>  configure.ac:4: warning: macro 'AM_GNU_GETTEXT' not found in library
>  configure.ac:5: warning: macro 'AM_GNU_GETTEXT_VERSION' not found in library
>+ echo skip_all_ "couldn't find or get gettext macros"

Since t/gettext-macros.sh generates a helper that all other gettext
tests use to see if gettext is available, all they get skipped.

Rework our existing tests to only check the 'external' gettext mode.
This should work with older versions, and we don't really need to
keep track of old non-external mode since it's been deprecated for
so long.

* t/gettext-basics.sh: Use external gettext mode, and adjust tests.
* t/gettext-config-rpath.sh: Likewise.
* t/gettext-macros.sh: Likewise.
* t/gettext-pr381.sh: Likewise.
* t/subdir-cond-gettext.sh: Likewise.

2 years agotests: disable git log pager usage
Mike Frysinger [Fri, 13 Jan 2023 05:09:06 +0000 (00:09 -0500)] 
tests: disable git log pager usage

When running this code locally, the git log call can trigger a pager
depending on the local settings, which in turn forces the test to be
interactive.  Run git with --no-pager to force disable it.

* t/get-sysconf.sh: Run git with --no-pager.

2 years agotests: change `sort|uniq` to `sort -u`
Mike Frysinger [Wed, 4 Jan 2023 03:38:22 +0000 (22:38 -0500)] 
tests: change `sort|uniq` to `sort -u`

These are equivalent, but more performant.  We already use `sort -u`
elsewhere in the codebase, so nothing new here really.

* t/add-missing.tap: Change `sort|uniq` to `sort -u`.
* t/CheckListOfTests.am: Likewise.

2 years agotests: Fix 'type defaults' error in link_cond due to main not being properly declared
Frédéric Bérat [Mon, 12 Dec 2022 07:05:53 +0000 (08:05 +0100)] 
tests: Fix 'type defaults' error in link_cond due to main not being properly declared

This is related to an effort to prepare Automake for future GCC/Clang
versions which set c99 as default standard to be used.
Not properly declaring main as "int main(...)" is rejected since c99.

* t/link_cond.sh: Add (void) to main definition.

2 years agodirstamp: switch to a pattern rule
Mike Frysinger [Thu, 12 Jan 2023 03:07:22 +0000 (22:07 -0500)] 
dirstamp: switch to a pattern rule

We can leverage $(@D) to generate a single pattern rule for all dirstamp
rules.  This saves many lines in the output -- normally we create 2 rules
(or 6 lines) per subdir, and projects that use subdirs tend to use them
quite a bit.

In the most extreme & unlikely case (1 subdir, no depdir support), the
line count is the same.  In every other case, it's always a win.

Looking at a few real world projects, the line deltas:
* GNU libgloss: +3 -66
* GNU newlib:   +3 -714
* GNU sim:      +3 -138

There shouldn't be any concerns about portability with $(@D) because:
(0) This has been in POSIX (and beyond) for decades,
(1) We only generate this rule iff we know the dirstamp is in a subdir
    (so we'd never have a case where $(@D) would expand to the cwd, and
    that is where a few implementations are known to be buggy),
(2) We already rely on $(@D) in our depdir code, and have since 2014
    (the Automake 1.16 release).

2 years agodirstamp: use append too instead of truncate
Mike Frysinger [Thu, 12 Jan 2023 02:40:04 +0000 (21:40 -0500)] 
dirstamp: use append too instead of truncate

We changed the depfiles logic to use >> (append) instead of > (truncate)
due to it being slightly faster & nicer to the disk.  Do the same with
the dirstamp files as we only need the files to exist -- we don't care
about their content, and we never put anything in them ourselves.  If
someone else were to, we clean them up normally with `make clean`.

Simple test case on my Linux 6.1 w/ext4 on SSD:

@: > foo.txt
for (i = 0; i < 1000000; ++i) close(open("foo.txt", O_WRONLY|O_CREAT|O_TRUNC, 0666));
-> 769 msec

@: >>foo.txt
for (i = 0; i < 1000000; ++i) close(open("foo.txt", O_WRONLY|O_CREAT|O_APPEND, 0666));
-> 2 sec

2 years agorm: convert more cases to am__rm_f
Mike Frysinger [Wed, 4 Jan 2023 02:46:38 +0000 (21:46 -0500)] 
rm: convert more cases to am__rm_f

Fixes automake bug https://bugs.gnu.org/10828.

Clean up a few more cases where we were doing `test ... || rm ...` to
avoid calling `rm -f` without arguments by leveraging am__rm_f.  These
were harder to find in the source due to their constructed nature.

The clean programs rules in particular were much more complicated than
they needed to be.  This logic boiled down to two things: delete the
list of programs, and then delete the list without the exeext suffix,
but only if the list of programs is non-empty.

The check-TESTS rule was converted to am__rm_f, but a simplification
was missed where the $list variable is inlined.

* bin/automake.in: Delete test -z logic and always call am__rm_f.
* contrib/check-html.am: Use $(am__rm_f) helper.
* doc/automake.texi: Update examples to match current behavior.
* lib/am/check.am: Inline $list variable.
* lib/am/progs.am: Rewrite rule to use $(am__rm_f).

2 years agodoc: overriding targets doesn't mean third-party Makefiles.
Karl Berry [Mon, 9 Jan 2023 01:56:40 +0000 (17:56 -0800)] 
doc: overriding targets doesn't mean third-party Makefiles.

Fixes automake bug https://bugs.gnu.org/60607.

* doc/automake.texi (dvi and distcheck): simply show
dvi: as an example of a do-nothing Makefile (xref to Extending),
instead of cross-referencing the complicated method in
Third-Party Makefiles.
(Clean, Extending): wording tweaks.

2 years agocheck: drop unused trs_list variable
Mike Frysinger [Wed, 4 Jan 2023 04:30:29 +0000 (23:30 -0500)] 
check: drop unused trs_list variable

When the code that used this variable was removed, the variable
itself was left behind.  Clean that up now too.

* lib/am/check.am: Delete trs_list.

2 years agodepend: trim spurious leading tab
Mike Frysinger [Wed, 4 Jan 2023 02:07:45 +0000 (21:07 -0500)] 
depend: trim spurious leading tab

These vars are replaced with a list of remove commands that are joined
with a \n and each line always has a leading \t inserted.  That means
the literal tab here before the var leads to 2 tabs included in the
output.  While not functionally a problem, it can be a bit confusing
when reading the output as it implies something is amiss.  Trimming
the tab also aligns with the other .am files which don't include it.

* lib/am/depend.am: Delete tab before %DISTRMS%.

2 years agomaint: make update-copyright
Mike Frysinger [Wed, 4 Jan 2023 07:00:14 +0000 (02:00 -0500)] 
maint: make update-copyright

2 years agomaint: Update files from upstream with 'make fetch'
Mike Frysinger [Wed, 4 Jan 2023 06:57:06 +0000 (01:57 -0500)] 
maint: Update files from upstream with 'make fetch'

Pulls some 2023 copyright updates.

* lib/config.guess: Update.
* lib/config.sub: Likewise.
* lib/gendocs.sh: Likewise.
* lib/gendocs_template: Likewise.
* lib/gitlog-to-changelog: Likewise.
* lib/gnupload: Likewise.
* lib/texinfo.tex: Likewise.
* lib/update-copyright: Likewise.

2 years agotest: avoid apostrophe in test document.
Karl Berry [Mon, 12 Dec 2022 22:50:33 +0000 (14:50 -0800)] 
test: avoid apostrophe in test document.

From automake patch https://bugs.gnu.org/59989
(though a different solution), suggestion by Frederic Berat.

* t/txinfo-include.sh: avoid apostrophes in test document,
since Texinfo 7.0 turns them into UTF-8 by default.

2 years agodoc: typo in HACKING changes.
Kelvin M. Klann [Thu, 6 Oct 2022 21:08:55 +0000 (14:08 -0700)] 
doc: typo in HACKING changes.

* HACKING: allow backward compatibilities again.

2 years agodistcheck: more .NOTPARALLEL.
Karl Berry [Sun, 2 Oct 2022 01:23:39 +0000 (18:23 -0700)] 
distcheck: more .NOTPARALLEL.

* t/backcompat.sh: add .NOTPARALLEL.
* t/subdir-add2-pr46.sh: likewise.
(Maybe the problem is more general?)

2 years agomaint: Update files from upstream with 'make fetch' + help2man.
Karl Berry [Sat, 1 Oct 2022 22:24:54 +0000 (15:24 -0700)] 
maint: Update files from upstream with 'make fetch' + help2man.

* INSTALL: update with make fetch.

2 years agomaint: Update files from upstream with 'make fetch' + help2man.
Karl Berry [Sat, 1 Oct 2022 22:03:16 +0000 (15:03 -0700)] 
maint: Update files from upstream with 'make fetch' + help2man.

* lib/INSTALL: update with make fetch.
* lib/config.guess: Update.
* lib/config.sub: Likewise.
* lib/gendocs.sh: Likewise.
* lib/texinfo.tex: Likewise.
* doc/help2man: now 1.49.1.

2 years agomaintcheck: placate maintainer-check and grep 3.8.
Karl Berry [Sat, 1 Oct 2022 21:59:51 +0000 (14:59 -0700)] 
maintcheck: placate maintainer-check and grep 3.8.

* maintainer/syntax-checks.mk (sc_rm_minus_f): no \ before -
(diagnosed by grep 3.8).
* t/comment12.sh: use $(...) instead of `...`.
* t/comments-escaped-in-var.sh: use AUTOMAKE_fails and grep
for expected warning message.
* t/list-of-tests.mk (handwritten_TESTS): add t/py-compile-files.sh.
* t/subdir-add2-pr46.sh (.NOTPARALLEL): add; showed up with
parallelized internal make. Seems unreproducible.

2 years agomore HACKING tweaks
Karl Berry [Sat, 1 Oct 2022 16:19:57 +0000 (09:19 -0700)] 
more HACKING tweaks

2 years agoaclocal: protect against Perl undefined warnings.
Karl Berry [Sat, 1 Oct 2022 16:02:15 +0000 (09:02 -0700)] 
aclocal: protect against Perl undefined warnings.

* bin/aclocal.in (usage): check that envvars (ACLOCAL_AUTOMAKE_DIR,
ACLOCAL_PATH) are defined before printing values.
* HACKING: describe running scripts from checkout, et al.

2 years agodoc: rearrange NEWS.
Karl Berry [Wed, 28 Sep 2022 17:17:35 +0000 (10:17 -0700)] 
doc: rearrange NEWS.

* NEWS: reclassify bugs vs. features.

2 years agopython: better Python compilation portability.
Zack Weinberg [Wed, 28 Sep 2022 17:12:24 +0000 (10:12 -0700)] 
python: better Python compilation portability.

This change is per automake thread:
https://lists.gnu.org/archive/html/automake/2022-09/msg00002.html

* lib/py-compile: Test directly for availability of
importlib.util.cache_from_source.  Untangle logic for when
to generate -O and -OO bytecode.  Reformat embedded Python fragments.

2 years agoforgot NEWS update
Karl Berry [Wed, 28 Sep 2022 16:08:20 +0000 (09:08 -0700)] 
forgot NEWS update

2 years agodist: ignore "silly rename" files from nfs/afs/smb.
Zack Weinberg [Wed, 28 Sep 2022 16:06:40 +0000 (09:06 -0700)] 
dist: ignore "silly rename" files from nfs/afs/smb.

This change is per automake thread:
https://lists.gnu.org/archive/html/automake/2022-09/msg00002.html

* lib/am/distdir.am (distcleancheck_listfiles): filter "silly rename"
files (.nfs* .smb* .__afs*), unavoidably created by deleting files
that are still open in some process on network file systems.

2 years agoautomake: do not use -Q with emacs invocations.
Richard Hopkins [Wed, 28 Sep 2022 01:04:20 +0000 (18:04 -0700)] 
automake: do not use -Q with emacs invocations.

This change is for https://bugs.gnu.org/58102.
(By the way, the previous two commits were for bugs
58026 (silent .elc compilation) and
58025 (load bytecomp), respectively, but I forgot to mention them.)

* m4/lispdir.m4 (AM_PATH_LISPDIR): omit -Q option.
Also (from karl), use -no-site-file (one hyphen) for consistency
with the other options.
* NEWS: mention this.
* doc/automake.texi (Hard-Coded Install Paths): likewise.

2 years agoautomake: load -l bytecomp for Emacs.
Richard Hopkins [Mon, 26 Sep 2022 16:04:59 +0000 (09:04 -0700)] 
automake: load -l bytecomp for Emacs.

* lib/am/lisp.am (.el.elc): Require the bytecomp library so
byte-compile-dest-file-function can be used when available.

2 years agoautomake: silent make output for Emacs byte compilation.
Richard Hopkins [Mon, 26 Sep 2022 15:57:43 +0000 (08:57 -0700)] 
automake: silent make output for Emacs byte compilation.

* lib/am/lisp.am: Use $(AM_V_GEN) in .el.elc rule.
* NEWS: mention this.
* THANKS: add new contributor.

2 years agodoc: typo in depcomp.
Karl Berry [Sun, 18 Sep 2022 21:11:15 +0000 (14:11 -0700)] 
doc: typo in depcomp.

* lib/depcomp: obsosete -> obsolete. Report from anonymous.

3 years agocompile: look for clang-cl.
Alexander Neumann [Tue, 26 Jul 2022 00:49:53 +0000 (17:49 -0700)] 
compile: look for clang-cl.

* lib/compile: check for clang-cl, calling func_cl_wrapper.
* THANKS: add new contributor.

3 years agofix: autoreconf fails due to .m4 files added but not installed
Jim Meyering [Tue, 24 May 2022 06:20:37 +0000 (23:20 -0700)] 
fix: autoreconf fails due to .m4 files added but not installed

* m4/local.mk (dist_automake_ac_DATA): Add both rmf.m4 and xargsn.m4.
Building grep from "make maintainer-clean" state, failed like this:
  configure.ac:41: warning: _AM_PROG_RM_F is m4_require'd but not\
    m4_defun'd
  configure.ac:41: warning: _AM_PROG_XARGS_N is m4_require'd but not\
    m4_defun'd
  configure:5058: error: possibly undefined macro: _AM_PROG_RM_F
  configure:5059: error: possibly undefined macro: _AM_PROG_XARGS_N

3 years agodeps: create empty file instead of dummy file.
Jan Engelhardt [Mon, 23 May 2022 20:47:02 +0000 (13:47 -0700)] 
deps: create empty file instead of dummy file.

This change is per an automake thread, see both before and after:
https://lists.gnu.org/archive/html/automake/2022-05/msg00006.html

* lib/am/depend.am ($(am__depfiles_remade)): create empty files
for dependencies instead of files with a line '# dummy'. Turns out
this is noticeably faster.
* THANKS: update Jan's email address.
* NEWS: mention this.

3 years agodoc: refer to automake manual in all man pages
Mike Frysinger [Sun, 13 Mar 2022 05:12:23 +0000 (00:12 -0500)] 
doc: refer to automake manual in all man pages

Fixes automake bug https://bugs.gnu.org/54363.

There is no "aclocal" manual as it's all integrated into the automake
manual, so have all the help2man calls force automake as the manual.

* doc/local.mk: Use --info-page=automake for man pages.

3 years agoautomake: fall back gracefully when texinfo inputs don't exist
Mike Frysinger [Fri, 25 Feb 2022 03:25:45 +0000 (22:25 -0500)] 
automake: fall back gracefully when texinfo inputs don't exist

Fixes automake bug https://bugs.gnu.org/54063.

The function scanning for @setfilename will fall back to a default
value if the input doesn't have one defined.  But we need to handle
the case where the file doesn't even exist before falling back.

* bin/automake.in: Scan /dev/null for @setfilename if input doesn't exist.
* t/list-of-tests.mk: Add txinfo-no-setfilename-no-inputs.sh.
* t/txinfo-no-setfilename-no-inputs.sh: New test.

3 years agom4: handle id failures when checking ustar support
Mike Frysinger [Fri, 25 Feb 2022 03:20:53 +0000 (22:20 -0500)] 
m4: handle id failures when checking ustar support

Fixes automake bug https://bugs.gnu.org/20713.

If `id` fails, display a specific warning message to the user.

* m4/tar.m4: Check $am_uid & $am_gid if they're unknown.

3 years agom4: rework silent-rules macros to avoid double expansion
Mike Frysinger [Mon, 21 Feb 2022 00:06:55 +0000 (19:06 -0500)] 
m4: rework silent-rules macros to avoid double expansion

Fixes automake bug https://bugs.gnu.org/32868.

The AM_SILENT_RULES macro defines all the silent-rules related setup.
It's also called by users to change the default verbosity level.  This
leads to a quirk where automake calls it, expands the full context,
and then users call it, and it's fully expanded again.

Instead, let's rename AM_SILENT_RULES to _AM_SILENT_RULES and move the
initialization logic to late in the configure stage.  This allows the
user-centric AM_SILENT_RULES call to expand into a single line to set
the default verbosity.

* m4/init.m4: Switch to _AM_SILENT_RULES.
* m4/silent.m4: Rename AM_SILENT_RULES to _AM_SILENT_RULES.  Delay
evaluation of AM_SILENT_RULES to the end.  Define new AM_SILENT_RULES to
set default rules verbosity.
* t/silent-defaults.sh: New tests.
* t/list-of-tests.mk: Add t/silent-defaults.sh.

3 years agotests: make silent-custom regex a little more robust
Mike Frysinger [Thu, 24 Feb 2022 05:52:08 +0000 (00:52 -0500)] 
tests: make silent-custom regex a little more robust

Fixes automake bug https://bugs.gnu.org/32800.

Have the regex match the entire path with word boundaries on both
sides.  This should reduce false positives when the full cwd happens
to match parent directories.

* t/silent-custom.sh: Update the header output regex.

3 years agopy-compile: fix optimized compiling for Python 3.5+
Mike Frysinger [Sun, 6 Feb 2022 06:25:59 +0000 (01:25 -0500)] 
py-compile: fix optimized compiling for Python 3.5+

Fixes automake bug https://bugs.gnu.org/38043.

Split the optimized compilation logic into a new section.  This avoids
trying to support multiple versions of major versions in a single script
as it gets harder to verify new changes don't break old versions as time
goes on.

Now for Python 3.5+, compile with -O0 (which is "higher" than -O).

* NEWS: Mention fix.
* THANKS: Add Michal Górny.
* lib/py-compile: Add new section for compiling Python 3.5+.

3 years agomanual: mention LT_INIT
Mike Frysinger [Wed, 23 Feb 2022 05:44:11 +0000 (00:44 -0500)] 
manual: mention LT_INIT

The AC_PROG_LIBTOOL macro name is the old/deprecated one, so include
LT_INIT here too to avoid confusing people who have switched.

* doc/automake.texi: Add LT_INIT after AC_PROG_LIBTOOL.

3 years agoautomake: allow required files to be in subdirs
Mike Frysinger [Mon, 21 Feb 2022 04:30:39 +0000 (23:30 -0500)] 
automake: allow required files to be in subdirs

Fixes automake bug https://bugs.gnu.org/20300.

The internal method for caching path lookups expects the $filename to
only be a filename.  If it's actually a subdir/file itself, then the
cache logic gets confused, and it never matches.  This manifests as
AC_REQUIRE_AUX_FILE([subdir/file]) claiming that the subdir/file path
doesn't exist even when it does.

Before we process any required files, since we already construct the
full path locally, reset the dir & file inputs to the final values.

* bin/automake.in: Split dir & file name back out from the constructed
required file path.
* t/auxdir-subsubdir.sh: New test.
* t/list-of-tests.mk: Add t/auxdir-subsubdir.sh.

3 years agotests: fix yacc C++ tests with some C++ compilers
Mike Frysinger [Sun, 20 Feb 2022 19:28:11 +0000 (14:28 -0500)] 
tests: fix yacc C++ tests with some C++ compilers

Fixes automake bug https://bugs.gnu.org/20031.

The C++ standard does not require symbols be placed into the global
namespace, just in the std namespace.  The GNU implementation will
place symbols in both.  For our specific code, we don't care either.

Unfortunately, it looks like generated flex code assumes that some
stdlib.h symbols (free, malloc, exit) are in the global namespace,
even when compiling for C++.  So when we include <cstdlib> but not
<stdlib.h>, we might not get the symbols in the global namespace.

We can workaround this by including stdlib.h in these tests without
invalidating the point of the tests in general.

* t/yacc-cxx.sh: Include stdlib.h.
* t/yacc-d-cxx.sh: Likewise.
* t/yacc-mix-c-cxx.sh: Likewise.

3 years agotests: log autoconf & libtool version
Mike Frysinger [Sun, 20 Feb 2022 18:56:24 +0000 (13:56 -0500)] 
tests: log autoconf & libtool version

Having these in the sysconf log can be helpful when triaging test
failures from users.

* t/get-sysconf.sh: Log autoconf & libtoolize version.

3 years agoautomake: support embedded \# in variable appends
Mike Frysinger [Sun, 20 Feb 2022 18:28:48 +0000 (13:28 -0500)] 
automake: support embedded \# in variable appends

Fixes automake bug https://bugs.gnu.org/7610.

Use of \# is not portable.  POSIX does not provide any way of retaining
the # marker in variables.  There is wide spread support for \# though
in GNU & BSD Make implementations.

Today, with plain variable assignments, Automake leaves the line alone:
  foo = blah\#blah
This will leave it to the implementation to decide what to do.  But if
you try to append to it, Automake follows POSIX and strips it:
  foo = blah\#blah
  foo += what
  -> foo = blah\ what

Instead, let's issue a portability warning whenever \# is used, even if
it isn't being appended, and do not strip the \# when appending.  Now:
  foo = blah\#blah
  foo += what
  -> warning: escaping \# comment markers is not portable
  -> foo = blah\#blah what

* NEWS: Mention change in \# handling.
* lib/Automake/VarDef.pm: Do not strip # if escaped.
* lib/Automake/Variable.pm: Warn if \# is used.
* t/comment12.sh: New test.
* t/comments-escaped-in-var.sh: New test.
* t/list-of-tests.mk: Add comment12.sh & comments-escaped-in-var.sh.

3 years agopython: use xargs -n when uninstalling files
Mike Frysinger [Thu, 17 Feb 2022 09:35:03 +0000 (04:35 -0500)] 
python: use xargs -n when uninstalling files

Fixes automake bug https://bugs.gnu.org/53340.

If the system has xargs, then utilize it to uninstall files to stay
within long command line limits.  If the system doesn't have xargs,
fall back to running the remove command one at a time.  Since every
reasonable system should have `xargs -n`, and POSIX requires it, the
fallback probably rarely gets used, so don't bother optimizing.

* lib/am/inst-vars.am: Use am__xargs_n to call rm -f on the files.
* lib/am/python.am: Drop am__base_list and for loop and let the
am__uninstall_files_from_dir break up the long command lines.
* m4/init.m4: Call _AM_PROG_XARGS_N.
* m4/xargsn.m4: New test for `xargs -n`.

3 years agorm: handle -f w/no arguments gracefully
Mike Frysinger [Thu, 17 Feb 2022 08:50:55 +0000 (03:50 -0500)] 
rm: handle -f w/no arguments gracefully

Fixes automake bug https://bugs.gnu.org/10828.

Delete the configure check that would abort if `rm -f` does not work,
and delete the plans to make this a hard requirement in the future.

Instead, test to see if `rm -f` fails w/out arguments.  If it does,
define am__rm_f such that it always passes at least the "" argument
when deleting files.  If it doesn't fail, then we can omit the "".

Then go through lib/am/ and update places where we use the pattern
`test -z ... || rm -f ...` and replace with $(am__rm_f).

* NEWS: Mention support for `rm -f` w/out arguments.
* PLANS/rm-f-without-args.txt: Remove.
* lib/am/check.am: Use new $(am__rm_f) helper.
* lib/am/clean.am: Likewise.
* lib/am/header-vars.am: Likewise.
* lib/am/inst-vars.am: Likewise.
* lib/am/libs.am: Likewise.
* lib/am/ltlib.am: Likewise.
* lib/am/progs.am: Likewise.
* lib/am/texinfos.am: Likewise.
* m4/init.m4: Delete `rm -f` checks and call _AM_PROG_RM_F.
* m4/rmf.m4: Define new _AM_PROG_RM_F macro.
* t/rm-f-probe.sh: Update test.

3 years agoNEWS: fix typo in fix-timestamp.sh script name
Mike Frysinger [Mon, 21 Feb 2022 00:54:38 +0000 (19:54 -0500)] 
NEWS: fix typo in fix-timestamp.sh script name

As pointed out by Eric Blake.

* NEWS: Fix typo.

3 years agopython: fix exit status handling with uninstall
Mike Frysinger [Wed, 16 Feb 2022 03:25:35 +0000 (22:25 -0500)] 
python: fix exit status handling with uninstall

The st variable is set at the top of this shell script, and then here
is a pipeline where it tries to update it in the subshell.  But since
setting variables in a subshell doesn't propagate back up, it doesn't
actually work.  Have the final subshell in the pipeline manage its own
exit status and exit with that so that the final status of the pipeline
is the right value.

* lib/am/python.am: Fix final subshell exit status passing.

3 years agom4: speed up filesystem modification checks
Mike Frysinger [Sat, 12 Feb 2022 08:41:06 +0000 (03:41 -0500)] 
m4: speed up filesystem modification checks

The current code sleeps at least 1 second to make sure the generated
files are strictly newer than the source files.  It does this for a
few reasons: POSIX only guarantees that `sleep` accept integers, and
filesystems have a history (c.f. Windows) of bad timestamp resolution.

For the first part, we can easily probe sleep to see if it accepts a
decimal number with a fractional part -- just run `sleep 0.001`.

For the second part, we can create two files and then run sleep in a
loop to see when one is considered newer than the other.

For many projects, this 1 second delay is largely amortized by the
rest of the configure script.  Autoconf lends itself to being both
large & slow.  But in projects with many smallish configure scripts
with many cached vars, the time to rerun is dominated by this single
sleep call.  For example, building libgloss against a compiler with
many (60+) multilib configurations, we see:
[Using sleep 1]
$ time ./config.status
real    2m28.164s
user    0m33.651s
sys     0m9.083s
[Using sleep 0.1]
$ time ./config.status
real    0m39.569s
user    0m33.517s
sys     0m8.969s

And in case anyone wonders, going below 0.1s doesn't seem to make a
statistically significant difference, at least in this configuration.
It appears to be within "noise" limits.
[Using sleep 0.001]
$ time ./config.status
real    0m39.760s
user    0m33.342s
sys     0m9.080s

* NEWS: Mention updated timestamp checking.
* m4/sanity.m4: Determine whether `sleep` accepts fractional seconds.
Determine (roughly) the filesystem timestamp resolution.  Use this to
sleep less when waiting for generated file timestamps to update.

3 years agom4: cache build env sanity checks
Mike Frysinger [Sat, 12 Feb 2022 07:12:42 +0000 (02:12 -0500)] 
m4: cache build env sanity checks

When rerunning configure in an existing build dir, cache the previous
results about environment settings.  There should be no need to retest
these in a dir that has already been configured.

* m4/sanity.m4: Cache sanity results.

3 years agoelisp: run emacs with --no-site-file
Mike Frysinger [Tue, 8 Feb 2022 05:39:40 +0000 (00:39 -0500)] 
elisp: run emacs with --no-site-file

Fixes automake bug https://bugs.gnu.org/21547.

If users have interactive site file logic, the lispdir probing can
hang, as can the compilation of elisp files.  Use --no-site-file to
disable loading any of that possible user logic.

* NEWS: Note emacs --no-site-file change.
* doc/automake.texi: Run emacs with --no-site-file.
* lib/am/lisp.am: Likewise.
* m4/lispdir.m4: Likewise.

3 years agoar-lib: ignore -nologo option
Mike Frysinger [Tue, 8 Feb 2022 04:29:13 +0000 (23:29 -0500)] 
ar-lib: ignore -nologo option

We already invoke $AR with -NOLOGO all the time, so we can ignore the
option entirely if the user specifies it.

* lib/ar-lib: Ignore -NOLOGO.