On 6/26/21 6:05 AM, Andreas Metzler wrote:
thanks for the report. The ./configure test checks whether $CONFIG_SHELL
supports (non-posix) read -u and uses bash otherwise. This test succeeds
"read -u4" avoids redirecting stdin and avoiding that keeps the
activities from being done in a subshell. If you do stuff in a subshell,
the information stashed in variables is invisible. I think the "-u"
option is a couple of decades old now. I wonder what the POSIX point of
resistance is on that feature.
I believe Andreas' solution should be correct: force CONFIG_SHELL to a
shell that supports "read -u".
It is possible the dependence on "-u" can be removed, if my scan over
the code is correct. It looks like the templates I use use that option
only to avoid an otherwise unnecessary fork() call. If so, the loops
involved can be fixed up with a "done <&4" at the end and removing the
"-u" option.
There's still the issue of "mk-unlocked-io.sh" tho:
do_stdio() {
while read -u4 line
do
[[ "$line" =~ $extern_line ]] || continue
[[ "$line" =~ $close_decl ]] || {
read -u4 args || die "no close for $line"
line+="$args"
}
ct=$(sed 's/.*( *//;s/ *).*//' <<<"$line")
if (( ${#ct} > 0 )) && [[ "$ct" != "void" ]]
then
ct=$(sed 's/[^,]//g' <<<"$ct")
ct=$(( (${#ct} * 3) + 2 ))
args='_w,_x,_y,_z'
args=${args:$(( ${#args} - ct )):$ct}
else
args='' ct=0
fi
do_func "$line" "$args"
done
}
That may be trickier, but I am uncertain of its use anymore. :) (I
stopped being a programmer 6 years ago now. I'm retired. It's been a
long time.) I think that is an AutoGen developer only script for
fabricating an "autoopts/unlocked-io.h" header. It should not be
relevant to reproducible builds. But I cannot be certain anymore.
Cheers - Bruce