summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2009-02-11 20:02:40 +0000
committerTom Lane2009-02-11 20:02:40 +0000
commit786b344fcd668c0d325409fada48a8f7d7d07882 (patch)
tree943e4b13d8a981d8567b15edd1496d1bdddde572
parenta53eeaddc3103a44dfc4dfb5d59dce86112e737c (diff)
Tweak configure to attempt to add -qnoansialias to CFLAGS whenever running
on AIX with a non-gcc compiler. The previous coding would do this only if CC was exactly "xlc"; which is a bad idea, as demonstrated by trouble report from Mihai Criveti.
-rwxr-xr-xconfigure9
-rw-r--r--configure.in9
-rw-r--r--src/template/aix3
3 files changed, 13 insertions, 8 deletions
diff --git a/configure b/configure
index 5924db003b..507b679660 100755
--- a/configure
+++ b/configure
@@ -3833,7 +3833,7 @@ unset CFLAGS
# else: If the template file set something, that is used.
# else: If coverage was enabled, don't set anything.
# else: If the compiler is GCC, then we use -O2.
-# else: If the compiler is something else, then we use -O.
+# else: If the compiler is something else, then we use -O, unless debugging.
if test "$ac_env_CFLAGS_set" = set; then
CFLAGS=$ac_env_CFLAGS_value
@@ -3852,7 +3852,8 @@ fi
# Some versions of GCC support some additional useful warning flags.
# Check whether they are supported, and add them to CFLAGS if so.
-# ICC pretends to be GCC but it's lying; it doesn't support these options.
+# ICC pretends to be GCC but it's lying; it doesn't support these flags,
+# but has its own. Also check other compiler-specific flags here.
if test "$GCC" = yes -a "$ICC" = no; then
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith"
@@ -4157,8 +4158,8 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-elif test x"${CC}" = x"xlc"; then
- # AIX xlc has to have strict aliasing turned off too
+elif test "$PORTNAME" = "aix"; then
+ # AIX's xlc has to have strict aliasing turned off too
{ echo "$as_me:$LINENO: checking if $CC supports -qnoansialias" >&5
echo $ECHO_N "checking if $CC supports -qnoansialias... $ECHO_C" >&6; }
pgac_save_CFLAGS=$CFLAGS
diff --git a/configure.in b/configure.in
index 3c8a7a8fd5..dfec978a91 100644
--- a/configure.in
+++ b/configure.in
@@ -402,7 +402,7 @@ unset CFLAGS
# else: If the template file set something, that is used.
# else: If coverage was enabled, don't set anything.
# else: If the compiler is GCC, then we use -O2.
-# else: If the compiler is something else, then we use -O.
+# else: If the compiler is something else, then we use -O, unless debugging.
if test "$ac_env_CFLAGS_set" = set; then
CFLAGS=$ac_env_CFLAGS_value
@@ -421,7 +421,8 @@ fi
# Some versions of GCC support some additional useful warning flags.
# Check whether they are supported, and add them to CFLAGS if so.
-# ICC pretends to be GCC but it's lying; it doesn't support these options.
+# ICC pretends to be GCC but it's lying; it doesn't support these flags,
+# but has its own. Also check other compiler-specific flags here.
if test "$GCC" = yes -a "$ICC" = no; then
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith"
@@ -438,8 +439,8 @@ elif test "$ICC" = yes; then
PGAC_PROG_CC_CFLAGS_OPT([-mp1])
# Make sure strict aliasing is off (though this is said to be the default)
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
+elif test "$PORTNAME" = "aix"; then
+ # AIX's xlc has to have strict aliasing turned off too
PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias])
fi
diff --git a/src/template/aix b/src/template/aix
index 94ad2f6175..04c97e7bd1 100644
--- a/src/template/aix
+++ b/src/template/aix
@@ -1,3 +1,6 @@
+# Set appropriate default compiler options if using xlc
+# Note: configure will add -qnoansialias if the compiler accepts it,
+# even if user specifies a non-default CFLAGS setting.
if test "$GCC" != yes ; then
case $host_os in
aix3.2.5 | aix4.1*)