answering questions spilled out from gmake processes

Lowell Gilbert freebsd-questions-local at
Fri Apr 11 14:11:47 UTC 2014

Matthias Apitz <guru at> writes:

> Hello,
> I have a huge gmake process to compile a lot of OpenSource tools, mostly
> Perl modules etc. All this is driven by a master Makefile. Some of the
> make processes are asking questions which I do not have under my control and
> would require to change the fetched source trees, for example:
> ...
> Test for foo failed, do you want to continue (y/n):
> These questions forbit to run this with nohup in background or
> unattendend. I was thinking to use chat(1) or any other own written tool
> and run the proc in an xterm like:
> chat < Xterm.log | gmake 
> were Xterm.log is the log of the X-terminal and chat is reading the
> question there '...want to continue (y/n)' and sends the correct answer.
> Any other idea?

There are different approaches to this, depending on the kinds of
changes needed. As an example of how many kinds of settings could
theoretically be needed, look at the types of patches, configure flags,
and so on (and on) in the FreeBSD ports system. Other approaches to the
same problem (e.g., OpenEmbedded) show fairly similar numbers and types
of modifications, so I don't think there's a general-purpose way around
it. If you possibly can, leverage an existing porting framework; since
you're asking on freebsd-questions, the ports system is probably the
first candidate. 

The scripted approach will be fragile and fiddly, but if you're going to
try it, something like expect will probably be easier than chat().

More information about the freebsd-questions mailing list