automake: make the ARFLAGS default 'cr' instead of 'cru'.
commit8cdbdda5aec652c356fe6dbba96810202176ae75
authorPavel Raiskup <praiskup@redhat.com>
Tue, 21 Nov 2023 16:30:00 +0000 (21 08:30 -0800)
committerKarl Berry <karl@freefriends.org>
Tue, 21 Nov 2023 16:30:00 +0000 (21 08:30 -0800)
tree7d7df5e52f8df808d3396fe1f4b02fc34ab1741f
parent4adfd131e2fef36f387bced95da100d816e6cd7b
automake: make the ARFLAGS default 'cr' instead of 'cru'.

In some GNU/Linux distributions people started to compile 'ar'
binary with --enable-deterministic-archives (binutils project).
That, however, in combination with our previous long time working
default AR_FLAGS=cru causes warnings on such installations:
ar: `u' modifier ignored since `D' is the default (see `U')

The 'u' option (at least with GNU binutils) did small optimization
during repeated builds because it instructed 'ar' to not
open/close unchanged *.o files and to rather read their contents
from old archive file.  However, its removal should not cause a
big performance hit for usual workflows.

Distributions started using --enable-deterministic-archives
knowing that it would disable the 'u', just to rather have a bit
more deterministic builds.

Also, to justify this change a bit more, keeping 'u' in ARFLAGS
could only result in many per-project changes to override
Automake's ARFLAGS default, just to silence such warnings.

Fixes bug#20082.  Reported by Eric Blake.

* bin/automake.in (handle_libraries): Use 'ARFLAGS=cr' by default.
* doc/automake.texi (Building a library): Mention the changed
ARFLAGS default.
(@c LocalWords): Replace 'cru' with 'cr'.
* m4/ar-lib.m4 (AM_PROG_AR): Cut out 'cru' string into separate
ARFLAGS variable with new default 'cr'.
* NEWS: Document.
NEWS
bin/automake.in
doc/automake.texi
m4/ar-lib.m4