Commit 105907f7 authored by Peter Eisentraut's avatar Peter Eisentraut

Put in defense against gcc -ffast-math.

parent 316d4e29
...@@ -2442,6 +2442,7 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then ...@@ -2442,6 +2442,7 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
fi fi
{ echo "$as_me:$LINENO: using CFLAGS=$CFLAGS" >&5 { echo "$as_me:$LINENO: using CFLAGS=$CFLAGS" >&5
echo "$as_me: using CFLAGS=$CFLAGS" >&6;} echo "$as_me: using CFLAGS=$CFLAGS" >&6;}
# Check if the compiler still works with the template settings # Check if the compiler still works with the template settings
echo "$as_me:$LINENO: checking whether the C compiler still works" >&5 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 echo $ECHO_N "checking whether the C compiler still works... $ECHO_C" >&6
...@@ -2488,6 +2489,52 @@ echo "$as_me: error: cannot proceed" >&2;} ...@@ -2488,6 +2489,52 @@ echo "$as_me: error: cannot proceed" >&2;}
{ (exit 1); exit 1; }; } { (exit 1); exit 1; }; }
fi fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext 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_ext=c
ac_cpp='$CPP $CPPFLAGS' ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
......
dnl Process this file with autoconf to produce a configure script. dnl Process this file with autoconf to produce a configure script.
dnl $Header: /cvsroot/pgsql/configure.in,v 1.209 2002/09/17 04:27:41 momjian Exp $ dnl $Header: /cvsroot/pgsql/configure.in,v 1.210 2002/09/20 18:38:57 petere Exp $
dnl dnl
dnl Developers, please strive to achieve this order: dnl Developers, please strive to achieve this order:
dnl dnl
...@@ -253,12 +253,21 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then ...@@ -253,12 +253,21 @@ if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g" CFLAGS="$CFLAGS -g"
fi fi
AC_MSG_NOTICE([using CFLAGS=$CFLAGS]) AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
# Check if the compiler still works with the template settings # Check if the compiler still works with the template settings
AC_MSG_CHECKING([whether the C compiler still works]) AC_MSG_CHECKING([whether the C compiler still works])
AC_TRY_LINK([], [return 0;], AC_TRY_LINK([], [return 0;],
[AC_MSG_RESULT(yes)], [AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no) [AC_MSG_RESULT(no)
AC_MSG_ERROR([cannot proceed])]) AC_MSG_ERROR([cannot proceed])])
# Defend against gcc -ffastmath
if test "$GCC" = yes; then
AC_TRY_COMPILE([], [@%:@ifdef __FAST_MATH__
choke me
@%:@endif], [], [AC_MSG_ERROR([do not put -ffast-math in CFLAGS])])
fi
AC_PROG_CPP AC_PROG_CPP
AC_SUBST(GCC) AC_SUBST(GCC)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment