Attached is a patch that should atleast solve the problem of trying to execute just-compiled binaries (which obviously does not work when cross-compiling). There might be other issues in the configure scripts (eg. I've seen trying to locate the crypto library using some absolute paths that are only valid for the host).
Thank you for the suggestion! This has been an issue for a long time.
Here is my adaptation: https://sourceforge.net/p/x3270/code/ci/586e37479689ae8da2c18731016dc7d28852c386/
Your patch assumes that the 'build' C compiler is called 'gcc'. I changed it to something a bit more generic, a BUILDCC variable that defines the path of the 'build' compiler. So to get roughly the same effect as you patch, add 'BUILDCC=gcc' to your ./configure command line.
Thanks for looking into it. And yes, your adaption is more generic, although i doubt that are any other compilers beside gcc and clang that are able to cross-compile ;)
After i did the patch i also noticed that there is a NATIVE_CC variable used in some Makefiles, but i think these are only used for win32.
I'm probably biased by spending too much time lately with the Microsoft C# build environment, which seems to be set up to do cross-compilation by default (you have to explicitly say which target architecture you want, without an option for "the one you're running on"), and is similarly hostile to the whole idea of compiling a tool as part of the build chain and then running it on the build machine.
I also changed NATIVE_CC to BUILDCC to be internally consistent -- good catch.
Thank you for the patches!
Last edit: Paul Mattes 2023-05-23