mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Back-port HEAD's configure fixes to select appropriate compiler switches
for Intel's icc and AIX's xlc.
This commit is contained in:
32
configure.in
32
configure.in
@ -1,5 +1,5 @@
|
||||
dnl Process this file with autoconf to produce a configure script.
|
||||
dnl $PostgreSQL: pgsql/configure.in,v 1.431.2.12 2006/07/11 16:15:03 tgl Exp $
|
||||
dnl $PostgreSQL: pgsql/configure.in,v 1.431.2.13 2006/08/07 20:08:43 tgl Exp $
|
||||
dnl
|
||||
dnl Developers, please strive to achieve this order:
|
||||
dnl
|
||||
@ -250,16 +250,34 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "$GCC" = yes; then
|
||||
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
|
||||
# Some versions of GCC support some additional useful warning flags.
|
||||
# Check whether they are supported, and add them to CFLAGS if so.
|
||||
|
||||
# Some versions of GCC support some additional useful warning flags.
|
||||
# Check whether they are supported, and add them to CFLAGS if so.
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement])
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels])
|
||||
if test "$GCC" = yes; then
|
||||
|
||||
# ICC pretends to be GCC but it's lying; it doesn't support these options.
|
||||
# So we have to check if "GCC" is really ICC.
|
||||
AC_TRY_COMPILE([], [@%:@ifndef __INTEL_COMPILER
|
||||
choke me
|
||||
@%:@endif], [ICC=[yes]], [ICC=[no]])
|
||||
|
||||
if test "$ICC" = no; then
|
||||
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith -Winline"
|
||||
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement])
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels])
|
||||
else
|
||||
# Intel compiler has a bug/misoptimization in checking for
|
||||
# division by NAN (NaN == 0), -mp1 fixes it, so add it to the
|
||||
# CFLAGS.
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-mp1])
|
||||
fi
|
||||
|
||||
# Disable strict-aliasing rules; needed for gcc 3.3+
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])
|
||||
elif test x"${CC}" = x"xlc"; then
|
||||
# AIX xlc has to have strict aliasing turned off too
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias])
|
||||
fi
|
||||
|
||||
# supply -g if --enable-debug
|
||||
|
Reference in New Issue
Block a user