cross-building support
Brought to you by:
bkorb
Hello,
find attached two patches by Helmut Grohe to improve cross-building support:
05_cross_pkg_config.diff: Invoke the triplet prefixed pkg-config. Otherwise pkg-config examines the build architecture which usually doesn't have the relevant dependencies installed or whose flags is different.
04_crossbuild.diff Do not run host arch executables during cross build. When cross building autogen, one has to install autogen for the build architecture, because it uses itself during build.
cu Andreas
second patch
The first patch neglects to define PKG_CONFIG, in case it is not pre-defined. I'll fix that and roll a release in a few days. Thanks!
This patch incorporates the 04 patch and a rework of the 05 patch. Basically:
I think that goes through the make-sure-it-works-right well enough to be platform independent. I will start running the new code through its paces. Thank you!
On 2016-08-29 Bruce Korb bkorb@users.sf.net wrote:
Hello,
this seems to miss the point of the patch. It is not about finding a
executable pkg-config but correct results in cross-building szenario.
Afaiu for cross-building /usr/bin/pkg-config produces incorrect results,
since it looks at the host-system's pc files. Whereas
/usr/bin/host-triplet_pkg-config checks the pc files for host-triplet.
https://autotools.io/pkgconfig/cross-compiling.html
${PKG_CONFIG} should be set by PKG_PROG_PKG_CONFIG.
cu Andreas
What a good friend you are to him, Dr. Maturin. His other friends are so grateful to you.'
I sew his ears on from time to time, sure'I think it should do the same as your original patch, with the exception that it expands out the program name to a full path name. IF PKG_CONFIG is set to a program name (say, for example, "host-triplet_pkg-config"), THEN it should expand to the output of "command -v host-triplet_pkg-config". If PKG_CONFIG is already a full path, running it through "command -v" is a no-op.
then the suggested patch should include adding PKG_PROG_PKG_CONFIG invocation and instructions on how to find the autoconf macro. I'd have no idea. Some distros (perhaps BSD ones) are vehemently opposed to pkg-config at all. Personally, I still prefer applying a glue layer to all targets that does all this backfill stuff. No glue layer? Then it doesn't build. Has the glue layer? Then the build just assumes a lot of stuff. That should be the direction, but likely not today.
On 2016-08-30 Bruce Korb bkorb@users.sf.net wrote:
I see. Thanks for the explanation.
cu Andreas
Looks like the part of the patch that changes config/ag_macros.m4 was not included in 5.18.12. Perhaps you forgot regenenerate it from the changed config/misc.def?
cu Andreas
Reminder to self: take a closer look
fixed