aboutsummaryrefslogtreecommitdiffstats
path: root/extension/configure
diff options
context:
space:
mode:
Diffstat (limited to 'extension/configure')
-rwxr-xr-xextension/configure82
1 files changed, 63 insertions, 19 deletions
diff --git a/extension/configure b/extension/configure
index e2cbd28c..0e6dd611 100755
--- a/extension/configure
+++ b/extension/configure
@@ -3678,23 +3678,25 @@ fi
$as_echo "${ac_cv_zos_uss}" >&6; }
if test "x$ac_cv_zos_uss" = "xyes"
then
- CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE -D_XOPEN_SOURCE=600"
- if test -n "$_C89_OPTIONS"
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: _C89_OPTIONS = $_C89_OPTIONS" >&5
-$as_echo "$as_me: _C89_OPTIONS = $_C89_OPTIONS" >&6;}
- elif test "x$GCC" != "xyes"
- then
- if echo " $CC " | $EGREP ' (/bin/)?cc ' >/dev/null
- then
- as_fn_error $? "cc-invalid
-The z/OS \"cc\" compiler does not build GNU Awk correctly.
-
-If the \"xlc\" or \"c89\" compiler is available, please set CC accordingly
-and reconfigure. (\"xlc\" is the recommended compiler on z/OS.)" "$LINENO" 5
- fi
- if echo " $CC " | $EGREP ' (/bin/)?c89 ' >/dev/null
+ ac_zos_uss_cc_id=unknown
+ echo " $CC " | $EGREP ' (/bin/)?c89 |_' >/dev/null && ac_zos_uss_cc_id=c89
+ echo " $CC " | $EGREP ' (/bin/)?c99 |_' >/dev/null && ac_zos_uss_cc_id=xlc
+ echo " $CC " | $EGREP ' (/bin/)?cc |_' >/dev/null && ac_zos_uss_cc_id=cc
+ echo " $CC " | $EGREP ' (/bin/)?xlc |_' >/dev/null && ac_zos_uss_cc_id=xlc
+ echo " $CC " | $EGREP ' (/bin/)?xlC |_' >/dev/null && ac_zos_uss_cc_id=xlc++
+ echo " $CC " | $EGREP ' (/bin/)?xlc\+\+ |_' >/dev/null && ac_zos_uss_cc_id=xlc++
+ test "x$GCC" = "xyes" && ac_zos_uss_cc_id=gcc
+ CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE"
+ test "$ac_zos_uss_cc_id" != xlc++ && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600"
+ case "$ac_zos_uss_cc_id" in
+ c89)
+ if test -n "$_C89_OPTIONS"
then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: CC = $CC" >&5
+$as_echo "$as_me: CC = $CC" >&6;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: _C89_OPTIONS = $_C89_OPTIONS" >&5
+$as_echo "$as_me: _C89_OPTIONS = $_C89_OPTIONS" >&6;}
+ else
as_fn_error $? "c89-setup-required
To build GNU Awk using \"c89\", please set
@@ -3703,10 +3705,52 @@ To build GNU Awk using \"c89\", please set
in your environment, and reconfigure. (The above flags cannot be specified
in CFLAGS/CPPFLAGS, due to the parentheses.)" "$LINENO" 5
fi
+ ;;
+ gcc)
+ ;;
+ cc)
+ as_fn_error $? "cc-invalid
+The z/OS \"cc\" compiler does not build GNU Awk correctly.
+
+If the \"xlc\" or \"c89\" compiler is available, please set CC accordingly
+and reconfigure. (\"xlc\" is the recommended compiler on z/OS.)" "$LINENO" 5
+ ;;
+ xlc*)
CFLAGS="$CFLAGS -qlanglvl=stdc99:libext"
- CPPFLAGS="$CPPFLAGS -qhaltonmsg=CCN3296"
- fi
-fi
+ cat >zos-cc <<EOF
+#!/bin/sh
+#
+# This wrapper script addresses two annoying peculiarities of the IBM
+# xlc/c99 compiler on z/OS:
+#
+# 1. Missing header files are considered warnings by default rather
+# than fatal errors;
+#
+# 2. Include directories specified with -I are searched _after_ the
+# system include directories (for #include<> directives) rather
+# than before.
+#
+# This script allows the code and the build system to assume standard
+# compiler behavior.
+#
+
+PS4='zos-cc: '
+REAL_CC="$CC"
+
+set -x
+\$REAL_CC -qhaltonmsg=CCN3296 -qnosearch "\$@" -qsearch=/usr/include
+EOF
+ chmod +x zos-cc
+ { $as_echo "$as_me:${as_lineno-$LINENO}: wrapping $CC with zos-cc to obtain standard behavior" >&5
+$as_echo "$as_me: wrapping $CC with zos-cc to obtain standard behavior" >&6;}
+ CC="`pwd`/zos-cc"
+ ;;
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized compiler environment" >&5
+$as_echo "$as_me: WARNING: unrecognized compiler environment" >&2;}
+ ;;
+ esac
+fi # ac_cv_zos_uss = yes
INSTALL="$ac_aux_dir/install-sh -c"