Allow CONFIG_SHELL to override build-time shell in mkheaders
authorAlexandre Oliva <oliva@adacore.com>
Fri, 21 Feb 2020 01:09:03 +0000 (22:09 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Fri, 21 Feb 2020 01:09:03 +0000 (22:09 -0300)
commitafbffe08646f0fce346a2e3525474e498a9051fa
treeadb195723823f4b6962d44e06fe6175c4aca54f5
parent33fe984aca4d12013bbd5921eee393c66dc1cfaa
Allow CONFIG_SHELL to override build-time shell in mkheaders

mkheaders.in uses substitutions of @SHELL@ to run fixinc.sh and
mkinstalldirs.  Problem is, SHELL comes from CONFIG_SHELL for the
build system, and it needs not match whatever is available at an
unrelated host system after installation, when mkheaders is supposed
to be run.

I considered ditching the hardcoding altogether, but decided to retain
it, but allowing CONFIG_SHELL and SHELL to override it, if any of them
can successfully run mkinstalldirs, and if those and the substituted
@SHELL@ fail, fallback to /bin/sh and to plain execution of the
script, which appears to enable at least one shell on a system that
doesn't typicall have a shell to recognize a script by #!/bin/sh and
reinvoke itself to run it.

If all of these fail, we fail, but only after telling the user to
retry after setting CONFIG_SHELL, that fixincl itself also uses.

for  fixincludes/ChangeLog

* mkheaders.in: Don't require build-time shell on host.
fixincludes/ChangeLog
fixincludes/mkheaders.in