@@ -2442,6 +2442,7 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
24422442fi
24432443{echo " $as_me :$LINENO : using CFLAGS=$CFLAGS " >&5
24442444echo " $as_me : using CFLAGS=$CFLAGS " >&6 ; }
2445+
24452446# Check if the compiler still works with the template settings
24462447echo " $as_me :$LINENO : checking whether the C compiler still works" >&5
24472448echo $ECHO_N " checking whether the C compiler still works...$ECHO_C " >&6
@@ -2488,6 +2489,52 @@ echo "$as_me: error: cannot proceed" >&2;}
24882489 { (exit 1); exit 1; }; }
24892490fi
24902491rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
2492+
2493+ # Defend against gcc -ffastmath
2494+ if test " $GCC " = yes; then
2495+ cat> conftest.$ac_ext << _ACEOF
2496+ #line$LINENO "configure"
2497+ #include "confdefs.h"
2498+
2499+ #ifdef F77_DUMMY_MAIN
2500+ # ifdef __cplusplus
2501+ extern "C"
2502+ # endif
2503+ int F77_DUMMY_MAIN() { return 1; }
2504+ #endif
2505+ int
2506+ main ()
2507+ {
2508+ #ifdef __FAST_MATH__
2509+ choke me
2510+ #endif
2511+ ;
2512+ return 0;
2513+ }
2514+ _ACEOF
2515+ rm -f conftest.$ac_objext
2516+ if { (evalecho " $as_me :$LINENO :\" $ac_compile \" " )>&5
2517+ (eval$ac_compile )2>&5
2518+ ac_status=$?
2519+ echo " $as_me :$LINENO :\$ ? =$ac_status " >&5
2520+ (exit$ac_status ); }&&
2521+ { ac_try=' test -s conftest.$ac_objext'
2522+ { (evalecho " $as_me :$LINENO :\" $ac_try \" " )>&5
2523+ (eval$ac_try )2>&5
2524+ ac_status=$?
2525+ echo " $as_me :$LINENO :\$ ? =$ac_status " >&5
2526+ (exit$ac_status ); }; }; then
2527+ :
2528+ else
2529+ echo " $as_me : failed program was:" >&5
2530+ cat conftest.$ac_ext >&5
2531+ { {echo " $as_me :$LINENO : error: do not put -ffast-math in CFLAGS" >&5
2532+ echo " $as_me : error: do not put -ffast-math in CFLAGS" >&2 ; }
2533+ { (exit 1); exit 1; }; }
2534+ fi
2535+ rm -f conftest.$ac_objext conftest.$ac_ext
2536+ fi
2537+
24912538ac_ext=c
24922539ac_cpp=' $CPP $CPPFLAGS'
24932540ac_compile=' $CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'