The relevant aspect is that the libffi configuration's AC_CHECK_LIB
and AC_CHECK_HEADERS are moved after FIND_GCC. There are two reasons
to do this:
- We should detect the presence of libffi using the C compiler
that we are eventually going to use to build GHC.
- Running AC_CHECK_HEADERS before FIND_GCC pollutes the CPP variable
with "gcc -E" (wrong when cross-compiling), and CPP is not reset
by FIND_GCC. Thus this patch fixes x86_64 -> i386 cross-compilation