aboutsummaryrefslogtreecommitdiff
path: root/config/c-compiler.m4
diff options
context:
space:
mode:
Diffstat (limited to 'config/c-compiler.m4')
-rw-r--r--config/c-compiler.m431
1 files changed, 30 insertions, 1 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4
index 5171e1e6d97..f02243ded0c 100644
--- a/config/c-compiler.m4
+++ b/config/c-compiler.m4
@@ -1,5 +1,5 @@
# 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
@@ -92,3 +92,32 @@ AC_DEFINE_UNQUOTED(AS_TR_CPP(alignof_$1),
[$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