--- a/configure +++ b/configure @@ -706,12 +706,11 @@ int main(void) { } EOF -$CC -o .1 .1.c -COMPILER=`./.1 2> /dev/null` -r=$? +# preprocess only, the compiled test can not run when cross compiling +COMPILER=`$CC -E -P .1.c 2> /dev/null | sed -n 's/.*puts("\(.*\)");.*/\1/p' | head -n 1` rm -f .1.c .1 -if test "$r" -ne 0; then +if test -z "$COMPILER"; then assert "" "update compiler" else echo "success [$CC]"