Closed maoueh closed 1 year ago
And for Windows, I'm not even sure what is the required elements, trying now.
Some of my difficulties might come from the fact that those fields are valid only if an actual sysroot with extra libraries is required. In which case, the creator of the sysroot
might know what to put.
I know this whole thing with PKG_CONFIG_PATH
is way more confusing than we would like it to be, however there is not much that could be improved from our side.
The example you're referring to shows how one can cross-compile go package with C/C++ dependencies for multiple platform at once which is indeed entire purpose of this project.
PKG_CONFIG_PATH
is optional, and only used when dynamic linking is required with C/C++ libraries. For example here we use goreleaser-cross, but there is no mention of PKG_CONFIG_PATH
bc C/C++ dependencies (libusb/libhib) actually included in codebase.armhf
historically has been an alias to ARM v7
, same as arm64
is an alias to armv8
and amd64
is nearly an alias of x86_64
. armhf
is widely used within PPA sources for linux distributions. Thats why it was showed this way in the example so users that familiar with c/c++ compiling find thing familiar. For others thats new subject regardless.p.s: One can name sysroot whatever way it is suitable, as it has nothing to do with actual cross-compiling and it will work as long as directory structure is preserved and libraries are compiled for desired architecture.
@troian Thanks for the extra details, indeed I realized that it was optional after I got the point that those were needed to provide those "external native dependencies" when compiling.
The PR is still good however, fixes some links and add extra details about Golang version used to compile.
thanks @maoueh, merging
On a side note for discussion, I would like to find a way to improve the README to better describe how someone could derive the right value for PKG_CONFIG_PATH and related setup.
In the example, we have:
While
CC
andCXX
are fairly easy to found, it's harder to know for sure by whatarmhf
needs to be replaced and by whatarm-linux-gnueabihf
in/sysroot/linux/armhf/usr/lib/arm-linux-gnueabihf
is needed.I think for
armhf
a quick sentence to tell to replace byArch
column in supported platforms table. For the other one, I would like to add another columnTriplet
in the the same table. A sentence would then explain thatarm-linux-gnueabihf
should be replaced in the triplet.I was wondering also if we should just list the required values per platforms directly instead, does are fairly static and won't change often, so seems it could be a good improvements to add the direct values.