Skip to content

Commit 68d95f1

Browse files
committed
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.
1 parent 787020f commit 68d95f1

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

configure

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3833,7 +3833,7 @@ unset CFLAGS
38333833
# else: If the template file set something, that is used.
38343834
# else: If coverage was enabled, don't set anything.
38353835
# else: If the compiler is GCC, then we use -O2.
3836-
# else: If the compiler is something else, then we use -O.
3836+
# else: If the compiler is something else, then we use -O, unless debugging.
38373837

38383838
if test "$ac_env_CFLAGS_set" = set; then
38393839
CFLAGS=$ac_env_CFLAGS_value
@@ -3852,7 +3852,8 @@ fi
38523852

38533853
# Some versions of GCC support some additional useful warning flags.
38543854
# Check whether they are supported, and add them to CFLAGS if so.
3855-
# ICC pretends to be GCC but it's lying; it doesn't support these options.
3855+
# ICC pretends to be GCC but it's lying; it doesn't support these flags,
3856+
# but has its own. Also check other compiler-specific flags here.
38563857

38573858
if test "$GCC" = yes -a "$ICC" = no; then
38583859
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith"
@@ -4157,8 +4158,8 @@ fi
41574158

41584159
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
41594160

4160-
elif test x"${CC}" = x"xlc"; then
4161-
# AIX xlc has to have strict aliasing turned off too
4161+
elif test "$PORTNAME" = "aix"; then
4162+
# AIX's xlc has to have strict aliasing turned off too
41624163
{ echo "$as_me:$LINENO: checking if $CC supports -qnoansialias" >&5
41634164
echo $ECHO_N "checking if $CC supports -qnoansialias... $ECHO_C" >&6; }
41644165
pgac_save_CFLAGS=$CFLAGS

configure.in

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.589 2009/01/22 22:27:12 petere Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.590 2009/02/11 20:02:39 tgl Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -402,7 +402,7 @@ unset CFLAGS
402402
# else: If the template file set something, that is used.
403403
# else: If coverage was enabled, don't set anything.
404404
# else: If the compiler is GCC, then we use -O2.
405-
# else: If the compiler is something else, then we use -O.
405+
# else: If the compiler is something else, then we use -O, unless debugging.
406406

407407
if test "$ac_env_CFLAGS_set" = set; then
408408
CFLAGS=$ac_env_CFLAGS_value
@@ -421,7 +421,8 @@ fi
421421

422422
# Some versions of GCC support some additional useful warning flags.
423423
# Check whether they are supported, and add them to CFLAGS if so.
424-
# ICC pretends to be GCC but it's lying; it doesn't support these options.
424+
# ICC pretends to be GCC but it's lying; it doesn't support these flags,
425+
# but has its own. Also check other compiler-specific flags here.
425426

426427
if test "$GCC" = yes -a "$ICC" = no; then
427428
CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith"
@@ -438,8 +439,8 @@ elif test "$ICC" = yes; then
438439
PGAC_PROG_CC_CFLAGS_OPT([-mp1])
439440
# Make sure strict aliasing is off (though this is said to be the default)
440441
PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])
441-
elif test x"${CC}" = x"xlc"; then
442-
# AIX xlc has to have strict aliasing turned off too
442+
elif test "$PORTNAME" = "aix"; then
443+
# AIX's xlc has to have strict aliasing turned off too
443444
PGAC_PROG_CC_CFLAGS_OPT([-qnoansialias])
444445
fi
445446

src/template/aix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Set appropriate default compiler options if using xlc
2+
# Note: configure will add -qnoansialias if the compiler accepts it,
3+
# even if user specifies a non-default CFLAGS setting.
14
if test "$GCC" != yes ; then
25
case $host_os in
36
aix3.2.5 | aix4.1*)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy