Improve cross-compilation support [once autoconf 2.70 is widespread] #1199
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As noted in PR #1198, autoconf 2.70 is more careful about cross compilation and with this autoconf version using
AC_FUNC_MMAP
implicitly pulls inAC_CANONICAL_HOST
and the cross-compilation infrastructure. So we might as well useAC_CANONICAL_HOST
explicitly and improve our "shared library type" check (using the formal platform triplet rather than our own ad hocuname
invocation), regardless of autoconf version.However using
AC_CANONICAL_HOST
causes autoconf 2.69 or earlier to search for install-sh unconditionally. So we might as well also addAC_PROG_INSTALL
and use@INSTALL@
(though this loses-p
).All this requires the config.guess, config.sub, and install-sh support scripts. With autoconf 2.70
autoreconf ‑i/‑‑install
creates these files. However this is not the case for previous versions of autoconf, so with those users would have to copy these files into their Git checkout from elsewhere themselves. Hence making this change is not worthwhile until autoconf 2.70 is a lot more widespread than it is at present. (At that point, our hand will have been forced w.r.t. these support files as config.guess and config.sub will be implicitly required anyway.)Alternatives would be to:
Check these three scripts into the repository instead of git-ignoring them, but it's preferable not to check in these externally-supplied scripts. (OTOH the release tarball-making scripts will have to take steps to ensure they are present in the generated tarballs.)
Not use
AC_FUNC_MMAP
, which is currently the only thing causing the cross-compilation machinery to be activated in autoconf 2.70. But I suspect the writing is on the wall and in future even just checking for C header files will activate this machinery too.This draft adds notes about these support scripts to the instructions. Probably it's about time the README.md instructions were reformatted more like those in INSTALL to emphasise use of
autoreconf
.As CI environments are updated to use autoconf 2.70, they also will need to start using
autoreconf --install
or similar to ensure the support scripts are present.