Configure should avoid looping infinitely repeating the same question
Backport of
46bfb3c49f22629a21d99ff2d02461a2a8a9aac4
Author: Nicholas Clark <nick@ccl4.org>
Date: Tue Aug 2 16:40:39 2022 +0200
Configure's helper function ./myread is intended to loop until it gets an
acceptable answer. For a couple of cases, an empty string is not acceptable
(eg 'Where is your C library?', if all automated attempts at answering this
have failed). In these cases, if Configure's standard input is /dev/null (or
closed), the shell read returns an empty string, and ./myread repeats the
question.
Before this commit, it would loop infinitely (generating continuous terminal
output). With this commit, we add a retry counter - if it asks the same
question to many times, it aborts Configure. This means that unattended
./Configure runs should now always terminate, as termination with an error
is better than spinning forever.