summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2002-09-20 18:38:57 +0000
committerPeter Eisentraut <peter_e@gmx.net>2002-09-20 18:38:57 +0000
commit105907f7dcdbad94ca007b89ca310024389afabe (patch)
tree891361a82e951468b5bb5957b3eac611d9f6e175 /configure
parent316d4e29b2a1ba5c70eb6fba3e820b971157c025 (diff)
downloadpostgresql-105907f7dcdbad94ca007b89ca310024389afabe.tar.gz
Put in defense against gcc -ffast-math.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure47
1 files changed, 47 insertions, 0 deletions
diff --git a/configure b/configure
index 14d00e6eec..6439605a63 100755
--- a/configure
+++ b/configure
@@ -2442,6 +2442,7 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
fi
{ echo "$as_me:$LINENO: using CFLAGS=$CFLAGS" >&5
echo "$as_me: using CFLAGS=$CFLAGS" >&6;}
+
# Check if the compiler still works with the template settings
echo "$as_me:$LINENO: checking whether the C compiler still works" >&5
echo $ECHO_N "checking whether the C compiler still works... $ECHO_C" >&6
@@ -2488,6 +2489,52 @@ echo "$as_me: error: cannot proceed" >&2;}
{ (exit 1); exit 1; }; }
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+
+# Defend against gcc -ffastmath
+if test "$GCC" = yes; then
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#ifdef F77_DUMMY_MAIN
+# ifdef __cplusplus
+ extern "C"
+# endif
+ int F77_DUMMY_MAIN() { return 1; }
+#endif
+int
+main ()
+{
+#ifdef __FAST_MATH__
+choke me
+#endif
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+{ { echo "$as_me:$LINENO: error: do not put -ffast-math in CFLAGS" >&5
+echo "$as_me: error: do not put -ffast-math in CFLAGS" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'