]> git.draconx.ca Git - cdecl99.git/commitdiff
Use awk over printf when generating atlocal.
authorNick Bowler <nbowler@draconx.ca>
Mon, 4 Dec 2023 03:57:38 +0000 (22:57 -0500)
committerNick Bowler <nbowler@draconx.ca>
Mon, 4 Dec 2023 05:24:26 +0000 (00:24 -0500)
We use awk extensively already and it will do the job here.  SVr4
printf does not implement the POSIX behaviour of repeating the output
when there are more arguments than needed for the given format string.

Makefile.am

index 58ec75e2c423d078827a6465c9e1b233f3ba0757..87cf0bd7950f5855e680d80fa09f8aed5b8968de 100644 (file)
@@ -334,12 +334,9 @@ EXTRA_DIST += $(GPERFFILES) src/gperf-wordwrap.awk
 $(GPERFFILES:.gperf=.c): $(srcdir)/src/gperf-wordwrap.awk
 
 atlocal: config.status
-       $(AM_V_GEN) :; { \
-         printf ': "$${%s=%s}"\n' \
-           AWK '$(AWK)' \
-           EXEEXT '$(EXEEXT)' \
-           check_PROGRAMS '$(check_PROGRAMS)' \
-           ; } >$@.tmp
+       $(AM_V_GEN) $(AWK) </dev/null >$@.tmp \
+         'BEGIN{ for (i = 1; i < ARGC; i++) print ": \"$${" ARGV[i] "}\""; }' \
+         'AWK=$(AWK)' 'EXEEXT=$(EXEEXT)' 'check_PROGRAMS=$(check_PROGRAMS)'
        $(AM_V_at) mv -f $@.tmp $@
 check_DATA = atlocal
 CLEANFILES += atlocal