make -k check TESTS="foo.test bar.test" (GNU make)
env TESTS="foo.test bar.test" make -e -k check (non-GNU make)
- To run the tests in cross-compilation mode:
-
- make -k check host_alias="$host_alias" (GNU make)
- env host_alias="$host_alias" make -e -k check (non-GNU make)
-
- Here `$host_alias' should be defined to a proper value different from
- configure-determined `$build_alias', and should refer to a set of
- cross-compilers you have available on your system; for example, if
- on Linux you have a set of MinGW-targeted cross-compilers named
- 'i586-mingw32msvc-cc', 'i586-mingw32msvc-c++', etc., you could use:
-
- make -k check host_alias='i586-mingw32msvc'
+ To run the tests in cross-compilation mode, you should first configure
+ the automake source tree to a cross-compilation setup. For example, to
+ run with a Linux-to-MinGW cross compiler, you will need something like
+ this:
+
+ ./configure --host i586-mingw32msvc --build i686-pc-linux-gnu
+
+ To avoid possible spurious error, you really have to *explicitly* specify
+ `--build' in addition to `--host'; the `lib/config.guess' script can help
+ determine the correct value to pass to `--build'.
+ Then you can just run the testsuite in the usual way, and the test cases
+ using a compiler should automatically use a cross-compilation setup.
Interpretation
# tests (or portions of them) that requires a native compiler.
cross_compiling ()
{
+ # Quoting from the autoconf manual:
+ # ... [$host_alias and $build both] default to the result of running
+ # config.guess, unless you specify either --build or --host. In
+ # this case, the default becomes the system type you specified.
+ # If you specify both, *and they're different*, configure enters
+ # cross compilation mode (so it doesn't run any tests that require
+ # execution).
test x"$host_alias" != x && test x"$build_alias" != x"$host_alias"
}