How does one cross-compile Expect for ARM?
It is absolutely no problem to build it from source on a host Ubuntu machine. But if you try to cross compile it, the configure script constantly gives the following error:
checking if WNOHANG requires _POSIX_SOURCE... configure: error: Expect can't be cross compiled
There seems to be someone who found out how to do it here (but he doesn't elaborate):
I also took the source and patches from here:
But received the same error even when patches were successfully applied!
I'd really appreciate some help here.
What those patches are doing is following the methodology of the explanation from the first link you provide: Find all of the
AC_MSG_ERROR([Expect can't be cross compiled])
lines inconfigure.in
, and replace them with a hard-coded line that encodes the "right" answer.So, there's the first thing to do: If you're still getting that error after applying the patches, then the patch must have missed one; you should find it and fix it too.
Another thing to check is along the lines of "is it plugged in" -- did you run the relevant autotools to properly regenerate the
configure
file after patching theconfigure.in
file? It looks like those patches only patchconfigure.in
, so if you didn't do the regeneration you won't have changed anything that actually runs.Once you get past the immediate error, there's also the point that the patches that you found are for TimeSys Linux (as per the names), which may or may not match your system -- and, in particular, may not even be for an ARM system. (I see that TimeSys now supports ARM, but my familiarity with them is for PowerPC.) Since it's replacing automatic tests with hard-coded answers, those answers could easily be wrong. I'd recommend checking the various lines changed in the patches to confirm that the answers they hard-code in are actually correct.