omar-polo / gmid

a Gemini server
https://gmid.omarpolo.com
ISC License
102 stars 7 forks source link

Cross-compilation support #8

Closed sikmir closed 2 years ago

sikmir commented 2 years ago

I've tried to cross-compile gmid on x86 for rasberryPi (armv6l) and configure script failed with:

...
gmid-armv6l-unknown-linux-gnueabihf> tested noop-static: no (compilation failed)
gmid-armv6l-unknown-linux-gnueabihf> selected STATIC=""
gmid-armv6l-unknown-linux-gnueabihf> tested err: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested explicit_bzero: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested freezero: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested getdtablecount: no (compilation failed)
gmid-armv6l-unknown-linux-gnueabihf> tested getdtablesize: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested getprogname: no (compilation failed)
gmid-armv6l-unknown-linux-gnueabihf> tested imsg-lutil: no (compilation failed)
gmid-armv6l-unknown-linux-gnueabihf> tested libevent: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested libtls: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested openssl: no (execution fa
iled)
gmid-armv6l-unknown-linux-gnueabihf> tested pr_set_name: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested program_invocation_short_name: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested program_invocation_short_name-D_GNU_SOURCE: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested queue_h: no (compilation failed)
gmid-armv6l-unknown-linux-gnueabihf> tested reallocarray: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested recallocarray: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested setproctitle: no (compilation failed)
gmid-armv6l-unknown-linux-gnueabihf> tested strlcat: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested strlcpy: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested strtonum: no (compilation failed)
gmid-armv6l-unknown-linux-gnueabihf> tested vasprintf: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> tested vasprintf-D_GNU_SOURCE: no (execution failed)
gmid-armv6l-unknown-linux-gnueabihf> FATAL: libtls not found
...

libtls not found since HAVE_LIBTLS=0: https://github.com/omar-polo/gmid/blob/e4116fbf8b54f3937072ceef75017df2f1cd68e2/configure#L257-L261 HAVE_LIBTLS=0 since test binary cannot be executed on build host: https://github.com/omar-polo/gmid/blob/e4116fbf8b54f3937072ceef75017df2f1cd68e2/configure#L179-L196

omar-polo commented 2 years ago

I have stolen the configure script from mandoc and oconfigure. While mandoc probably shares the same issue, oconfigure doesn't try to run the just built test binary (which in fact, at least for the tests I have, it isn't needed: the compilation is enough.)

I'll sync the configure script with oconfigure soon, thank you for reporting the issue :)

sikmir commented 2 years ago

It works now. Thanks!