-fno-strict-aliasing.
# Macros to detect C compiler features
-# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.5 2002/03/29 17:32:53 petere Exp $
+# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.5.2.1 2004/02/02 04:08:02 tgl Exp $
# PGAC_C_SIGNED
[$AS_TR_SH([pgac_cv_alignof_$1])],
[The alignment requirement of a `$1'])
])# PGAC_CHECK_ALIGNOF
+
+
+# PGAC_PROG_CC_NO_STRICT_ALIASING
+# -------------------------------
+# Find out how to turn off strict aliasing in the C compiler.
+AC_DEFUN([PGAC_PROG_CC_NO_STRICT_ALIASING],
+[AC_CACHE_CHECK([how to turn off strict aliasing in $CC],
+ pgac_cv_prog_cc_no_strict_aliasing,
+[pgac_save_CFLAGS=$CFLAGS
+if test "$GCC" = yes; then
+ pgac_try="-fno-strict-aliasing"
+else
+ # Maybe fill in later...
+ pgac_try=
+fi
+
+for pgac_flag in $pgac_try; do
+ CFLAGS="$pgac_save_CFLAGS $pgac_flag"
+ _AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
+ [pgac_cv_prog_cc_no_strict_aliasing=$pgac_try
+break])
+done
+
+CFLAGS=$pgac_save_CFLAGS
+])
+
+if test x"$pgac_cv_prog_cc_no_strict_aliasing" != x""; then
+ CFLAGS="$CFLAGS $pgac_cv_prog_cc_no_strict_aliasing"
+fi])# PGAC_PROG_CC_NO_STRICT_ALIASING
if test "$ac_env_CFLAGS_set" = set; then
CFLAGS=$ac_env_CFLAGS_value
fi
+
+# Need to specify -fno-strict-aliasing too in case it's gcc 3.3 or later.
+echo "$as_me:$LINENO: checking how to turn off strict aliasing in $CC" >&5
+echo $ECHO_N "checking how to turn off strict aliasing in $CC... $ECHO_C" >&6
+if test "${pgac_cv_prog_cc_no_strict_aliasing+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ pgac_save_CFLAGS=$CFLAGS
+if test "$GCC" = yes; then
+ pgac_try="-fno-strict-aliasing"
+else
+ # Maybe fill in later...
+ pgac_try=
+fi
+
+for pgac_flag in $pgac_try; do
+ CFLAGS="$pgac_save_CFLAGS $pgac_flag"
+ 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 ()
+{
+
+ ;
+ 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
+ pgac_cv_prog_cc_no_strict_aliasing=$pgac_try
+break
+else
+ echo "$as_me: failed program was:" >&5
+cat conftest.$ac_ext >&5
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+
+CFLAGS=$pgac_save_CFLAGS
+
+fi
+echo "$as_me:$LINENO: result: $pgac_cv_prog_cc_no_strict_aliasing" >&5
+echo "${ECHO_T}$pgac_cv_prog_cc_no_strict_aliasing" >&6
+
+if test x"$pgac_cv_prog_cc_no_strict_aliasing" != x""; then
+ CFLAGS="$CFLAGS $pgac_cv_prog_cc_no_strict_aliasing"
+fi
+
+# supply -g if --enable-debug
if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g"
fi
dnl Process this file with autoconf to produce a configure script.
-dnl $Header: /cvsroot/pgsql/configure.in,v 1.217.2.11 2003/12/02 16:23:03 tgl Exp $
+dnl $Header: /cvsroot/pgsql/configure.in,v 1.217.2.12 2004/02/02 04:08:12 tgl Exp $
dnl
dnl Developers, please strive to achieve this order:
dnl
if test "$ac_env_CFLAGS_set" = set; then
CFLAGS=$ac_env_CFLAGS_value
fi
+
+# Need to specify -fno-strict-aliasing too in case it's gcc 3.3 or later.
+PGAC_PROG_CC_NO_STRICT_ALIASING
+
+# supply -g if --enable-debug
if test "$enable_debug" = yes && test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="$CFLAGS -g"
fi