The standard practice in this type of situation is to use an Autoconf site default file containing the appropriate values for the tests that configure
wants to run.
In this particular case, configure
is trying to determine in which direction the stack grows:
volatile int *a = 0, *b = 0;
void f (int i) { volatile int x = 5; if (i == 0) b = &x; else f (i - 1); }
int main () { volatile int y = 7; a = &y; f (100); return b > a ? 0 : 1; }
So you'd cross-compile that code, run it on your target platform, and examine its exit code (echo $?
). Create a site default file for your target architecture, for example config.arm-hisiv400-linux
, and add a line with
glib_cv_stack_grows=yes
(if the exit code above was 0), or
glib_cv_stack_grows=no
(if the exit code was 1).
Then run configure
with CONFIG_SITE
pointing to the full path of the site default file you just created:
CONFIG_SITE=/path/to/config.arm-hisiv400-linux ./configure --prefix=$HOME --host=arm-hisiv400-linux
configure
should use the value from the site default file, skipping the test for the stack. It will probably fail on the next test which needs to run a program compiled for the target, but you can fix that in the same way, adding more entries to the site default file (as long as configure.ac
uses AC_CACHE_VAL
around AC_TRY_RUN
).
./configure --help
might help.