summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2003-10-25 15:32:11 +0000
committerPeter Eisentraut <peter_e@gmx.net>2003-10-25 15:32:11 +0000
commit378f59904a8b6c36c25e5ce669633f1fa4491e3c (patch)
tree5ebdad148f89ae08e1d5cb74675896bdc186d44e /config
parent6db0a6b0352ff4644166f3b257e2e13103b770f9 (diff)
downloadpostgresql-378f59904a8b6c36c25e5ce669633f1fa4491e3c.tar.gz
Fix CFLAGS selection to actually work. Add test to detect whether gcc's
option -fno-strict-aliasing is available.
Diffstat (limited to 'config')
-rw-r--r--config/c-compiler.m433
1 files changed, 31 insertions, 2 deletions
diff --git a/config/c-compiler.m4 b/config/c-compiler.m4
index 5d72e1377b..1649b105aa 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.8 2003/04/24 21:16:42 tgl Exp $
+# $Header: /cvsroot/pgsql/config/c-compiler.m4,v 1.9 2003/10/25 15:32:11 petere Exp $
# PGAC_C_SIGNED
@@ -97,7 +97,7 @@ AC_DEFINE_UNQUOTED(AS_TR_CPP(alignof_$1),
# PGAC_C_FUNCNAME_SUPPORT
-# -------------
+# -----------------------
# Check if the C compiler understands __func__ (C99) or __FUNCTION__ (gcc).
# Define HAVE_FUNCNAME__FUNC or HAVE_FUNCNAME__FUNCTION accordingly.
AC_DEFUN([PGAC_C_FUNCNAME_SUPPORT],
@@ -120,3 +120,32 @@ AC_DEFINE(HAVE_FUNCNAME__FUNCTION, 1,
[Define to 1 if your compiler understands __FUNCTION__.])
fi
fi])# PGAC_C_FUNCNAME_SUPPORT
+
+
+# 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 "$ac_env_CFLAGS_set" != set; then
+ CFLAGS="$CFLAGS $pgac_cv_prog_cc_no_strict_aliasing"
+fi])# PGAC_PROG_CC_NO_STRICT_ALIASING