I was trying to build git for MIPS. And found that configure.ac will compile some stuff on the host machine during configure step. So I am not sure how the inventor wants that it work. My solution was to remove the parts with ac_cv_fread_reads_directories and ac_cv_snprintf_returns_bogus from configure.ac.
Because it seems that it is not enough to use arguments as described here: https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation .html#Cross_002dCompilation
I mean would it be possible to specifiy both from outside?
i.e. ./configure ac_cv_fread_reads_directories=yes ac_cv_snprintf_returns_bogus=yes ...
This should overwrite any try of test with compile, so that any cross compile will build.