Branch
Hash :
75541c6a
Author :
Date :
2022-01-01T15:30:38
gen-header: port to BusyBox ‘sed’ Problem reported by Tim Rühsen in: https://lists.gnu.org/r/bug-gnulib/2022-01/msg00004.html * modules/gen-header (SED_HEADER_NOEDIT): Replace instead of prepend. (SED_HEADER_STDOUT, SED_HEADER_TO_AT_t): Adjust to that change. Do not use ‘w foo’ twice in the same script, as BusyBox ‘sed’ mistakenly opens ‘foo’ for output twice, thus losing some output.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
Description:
Generating header files
Applicability:
all
Files:
Depends-on:
configure.ac:
Makefile.am:
# In 'sed', replace the pattern space with a "DO NOT EDIT" comment.
SED_HEADER_NOEDIT = s,.*,/* DO NOT EDIT! GENERATED AUTOMATICALLY! */,
# '$(SED_HEADER_STDOUT) -e "..."' runs 'sed' but first outputs "DO NOT EDIT".
SED_HEADER_STDOUT = sed -e 1h -e '1$(SED_HEADER_NOEDIT)' -e 1G
# '$(SED_HEADER_TO_AT_t) FILE' copies FILE to $@-t, prepending a leading
# "DO_NOT_EDIT". Although this could be done more simply via:
# SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) > $@-t
# the -n and 'w' avoid a fork+exec, at least when GNU Make is used.
SED_HEADER_TO_AT_t = $(SED_HEADER_STDOUT) -n -e 'w $@-t'
# Use $(gl_V_at) instead of $(AM_V_GEN) or $(AM_V_at) on a line that
# is its recipe's first line if and only if @NMD@ lines are absent.
@NMD@gl_V_at = $(AM_V_at)
@!NMD@gl_V_at = $(AM_V_GEN)
Include:
License:
LGPLv2+
Maintainer:
bug-gnulib@gnu.org