gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, feature/zOS-try2, updated. gawk-4.1.0-74


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, feature/zOS-try2, updated. gawk-4.1.0-747-g4e9562f
Date: Fri, 11 Sep 2015 08:35:55 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, feature/zOS-try2 has been updated
       via  4e9562fd62acf478974fc7e0627381f93101083e (commit)
      from  35ba3f02a20d8592d16fb702fae3940d6e12dbfe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=4e9562fd62acf478974fc7e0627381f93101083e

commit 4e9562fd62acf478974fc7e0627381f93101083e
Author: Arnold D. Robbins <address@hidden>
Date:   Fri Sep 11 11:35:33 2015 +0300

    Further zOS updates: Wrap C compiler.

diff --git a/ChangeLog b/ChangeLog
index 6651049..956c472 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2015-09-11     Daniel Richard G.       <address@hidden>
+
+       * regcomp.h: Include strings.h, wrapped in ifdef. Revise
+       defines for BTOWC.
+       * regex_internal.h: Remove ZOS_USS bracketing ifdefs.
+
 2015-09-04         Arnold D. Robbins     <address@hidden>
 
        * profile.c (pp_num): Use format_val to print integral values
diff --git a/configure b/configure
index 3e6f197..bdf5055 100755
--- a/configure
+++ b/configure
@@ -5881,23 +5881,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
 
@@ -5906,10 +5908,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
 
 
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking for strerror in 
-lcposix" >&5
diff --git a/extension/configure b/extension/configure
index e2cbd28..0e6dd61 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"
diff --git a/m4/ChangeLog b/m4/ChangeLog
index 8086522..e6a8788 100644
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,8 @@
+2015-09-11     Daniel Richard G.       <address@hidden>
+
+       * arch.m4: Rework again. In particular, provide a wrapper
+       for CC to work around some issues.
+
 2015-08-28     Daniel Richard G.       <address@hidden>
 
        * arch.m4: Complete rewrite of AC_ZOS_USS. It no longer
diff --git a/m4/arch.m4 b/m4/arch.m4
index ec1e9ed..fc25d8e 100644
--- a/m4/arch.m4
+++ b/m4/arch.m4
@@ -72,32 +72,34 @@ fi
 AC_MSG_RESULT([${ac_cv_zos_uss}])
 if test "x$ac_cv_zos_uss" = "xyes"
 then
+  dnl Identify the compiler.
+  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
   dnl These feature test macros are needed on z/OS.
-  CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE -D_XOPEN_SOURCE=600"
-  dnl If _C89_OPTIONS is set, then assume the user is building with the c89
-  dnl compiler frontend, and knows what they are doing. c89 (as well as cc)
-  dnl pre-dates xlc, and accepts an option syntax that involves parentheses
-  dnl and cannot be handled in the usual way in C(PP)FLAGS. However, c89
-  dnl will also accept options via the aforementioned environment variable,
-  dnl which gives the user one way around the problem. (If you're wondering
-  dnl about cc, it is meant for programs written in "Common Usage C"
-  dnl [a.k.a. K&R C] as opposed to "Standard C" [a.k.a. ANSI], and does not
-  dnl build gawk correctly.)
-  if test -n "$_C89_OPTIONS"
-  then
-    AC_MSG_NOTICE([_C89_OPTIONS = $_C89_OPTIONS])
-  elif test "x$GCC" != "xyes"
-  then
-    if echo " $CC " | $EGREP ' (/bin/)?cc ' >/dev/null
-    then
-      AC_MSG_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.)])
-    fi
-    if echo " $CC " | $EGREP ' (/bin/)?c89 ' >/dev/null
+  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)
+    dnl If the user has set CC=c89 and _C89_OPTIONS, then don't get in
+    dnl their way.  c89 (as well as cc) pre-dates xlc, and accepts an
+    dnl option syntax that involves parentheses and cannot be handled
+    dnl in the usual way in C(PP)FLAGS.  However, c89 will also accept
+    dnl options via the aforementioned environment variable, which
+    dnl gives the user one way around the problem.  (If you're
+    dnl wondering about cc, it is meant for programs written in
+    dnl "Common Usage C" [a.k.a. K&R C] as opposed to "Standard C"
+    dnl [a.k.a. ANSI], and does not build gawk correctly.)
+    if test -n "$_C89_OPTIONS"
     then
+      AC_MSG_NOTICE([CC = $CC])
+      AC_MSG_NOTICE([_C89_OPTIONS = $_C89_OPTIONS])
+    else
       AC_MSG_ERROR([c89-setup-required
 To build GNU Awk using "c89", please set
 
@@ -106,12 +108,51 @@ 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.)])
     fi
+    ;;
+  gcc)
+    dnl GCC has not yet been ported to z/OS as of this writing
+    ;;
+  cc)
+    AC_MSG_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.)])
+    ;;
+  xlc*)
     dnl This enables C99, and on z/OS 1.11, the setenv() prototype.
     CFLAGS="$CFLAGS -qlanglvl=stdc99:libext"
-    dnl This is needed so that xlc considers a missing header file to be an
-    dnl error and not a warning. (Yes, the latter is in fact the default
-    dnl behavior on z/OS.)
-    CPPFLAGS="$CPPFLAGS -qhaltonmsg=CCN3296"
-  fi
-fi
+    dnl Use a compiler wrapper script to address some annoyances.
+    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
+    AC_MSG_NOTICE([wrapping $CC with zos-cc to obtain standard behavior])
+    CC="`pwd`/zos-cc"
+    ;;
+  *)
+    AC_MSG_WARN([unrecognized compiler environment])
+    ;;
+  esac
+fi # ac_cv_zos_uss = yes
 ])dnl
diff --git a/regcomp.c b/regcomp.c
index fd3ab84..80dcb0c 100644
--- a/regcomp.c
+++ b/regcomp.c
@@ -21,6 +21,10 @@
 #include <stdint.h>
 #endif
 
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+
 #ifdef _LIBC
 # include <locale/weight.h>
 #endif
@@ -211,10 +215,7 @@ const size_t __re_error_msgid_idx[] attribute_hidden =
 /* Entry points for GNU code.  */
 
 
-#ifdef ZOS_USS
-
-/* For ZOS USS we must define btowc */
-
+#ifndef HAVE_BTOWC
 wchar_t 
 btowc (int c)
 {
diff --git a/regex_internal.h b/regex_internal.h
index 4d0028f..9e104d8 100644
--- a/regex_internal.h
+++ b/regex_internal.h
@@ -41,11 +41,9 @@
 #if defined HAVE_STDBOOL_H || defined _LIBC
 # include <stdbool.h>
 #endif /* HAVE_STDBOOL_H || _LIBC */
-#if !defined(ZOS_USS)
 #if defined HAVE_STDINT_H || defined _LIBC
 # include <stdint.h>
 #endif /* HAVE_STDINT_H || _LIBC */
-#endif /* !ZOS_USS */
 #if defined _LIBC
 # include <bits/libc-lock.h>
 #else

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |    6 +++
 configure           |   82 ++++++++++++++++++++++++++++++++----------
 extension/configure |   82 ++++++++++++++++++++++++++++++++----------
 m4/ChangeLog        |    5 +++
 m4/arch.m4          |  101 ++++++++++++++++++++++++++++++++++++---------------
 regcomp.c           |    9 +++--
 regex_internal.h    |    2 -
 7 files changed, 213 insertions(+), 74 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]