aboutsummaryrefslogtreecommitdiffstats
path: root/extension
diff options
context:
space:
mode:
Diffstat (limited to 'extension')
-rw-r--r--extension/ChangeLog10
-rw-r--r--extension/Makefile.am2
-rw-r--r--extension/Makefile.in11
-rw-r--r--extension/aclocal.m41
-rwxr-xr-xextension/configure93
-rw-r--r--extension/configure.ac1
-rw-r--r--extension/gawkfts.h8
-rw-r--r--extension/readdir.c12
-rw-r--r--extension/rwarray.c11
9 files changed, 115 insertions, 34 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog
index 3d38072a..0200ecc4 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,3 +1,13 @@
+2015-08-28 Daniel Richard G. <skunk@iSKUNK.ORG>
+
+ * rwarray.c: Removed z/OS-specific code that is no longer needed due
+ to improvements in Gawk's general Autotools support.
+ * Makefile.am, configure.ac: Make use of the AC_ZOS_USS macro so
+ that this sub-project can support that platform as well.
+ * gawkfts.h, readdir.c: Use a proper platform cpp symbol to guard
+ z/OS-specific code, and eliminate the z/OS-specific use of "long"
+ inode numbers as "long long" works perfectly well there.
+
2015-08-02 Arnold D. Robbins <arnold@skeeve.com>
* revoutput.c (init_revoutput): Don't install REVOUT if it's
diff --git a/extension/Makefile.am b/extension/Makefile.am
index 92f5637b..ff9e9073 100644
--- a/extension/Makefile.am
+++ b/extension/Makefile.am
@@ -27,7 +27,7 @@ AM_CPPFLAGS = -I$(srcdir)/..
# This variable insures that aclocal runs
# correctly after changing configure.ac
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 -I ../m4
# For some make's, e.g. OpenBSD, that don't define this
RM = rm -f
diff --git a/extension/Makefile.in b/extension/Makefile.in
index 4c148361..868781ca 100644
--- a/extension/Makefile.in
+++ b/extension/Makefile.in
@@ -113,10 +113,11 @@ build_triplet = @build@
host_triplet = @host@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-am__aclocal_m4_deps = $(top_srcdir)/m4/dirfd.m4 \
- $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
- $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
- $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
+am__aclocal_m4_deps = $(top_srcdir)/../m4/arch.m4 \
+ $(top_srcdir)/m4/dirfd.m4 $(top_srcdir)/m4/libtool.m4 \
+ $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+ $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+ $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
@@ -499,7 +500,7 @@ AM_CPPFLAGS = -I$(srcdir)/..
# This variable insures that aclocal runs
# correctly after changing configure.ac
-ACLOCAL_AMFLAGS = -I m4
+ACLOCAL_AMFLAGS = -I m4 -I ../m4
# For some make's, e.g. OpenBSD, that don't define this
RM = rm -f
diff --git a/extension/aclocal.m4 b/extension/aclocal.m4
index d2e755e4..5665d48e 100644
--- a/extension/aclocal.m4
+++ b/extension/aclocal.m4
@@ -1210,6 +1210,7 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
+m4_include([../m4/arch.m4])
m4_include([m4/dirfd.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
diff --git a/extension/configure b/extension/configure
index 6e280de9..0e6dd611 100755
--- a/extension/configure
+++ b/extension/configure
@@ -3660,6 +3660,99 @@ $as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for z/OS USS compilation" >&5
+$as_echo_n "checking for z/OS USS compilation... " >&6; }
+if ${ac_cv_zos_uss+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+
+if test "OS/390" = "`uname`"
+then
+ ac_cv_zos_uss=yes
+else
+ ac_cv_zos_uss=no
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${ac_cv_zos_uss}" >&5
+$as_echo "${ac_cv_zos_uss}" >&6; }
+if test "x$ac_cv_zos_uss" = "xyes"
+then
+ 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
+
+ _C89_OPTIONS=\"-W c,langlvl(stdc99,libext),haltonmsg(CCN3296)\"
+
+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"
+ 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"
export INSTALL
diff --git a/extension/configure.ac b/extension/configure.ac
index 4da226a1..5ff4ab69 100644
--- a/extension/configure.ac
+++ b/extension/configure.ac
@@ -29,6 +29,7 @@ AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_USE_SYSTEM_EXTENSIONS
+AC_ZOS_USS
INSTALL="$ac_aux_dir/install-sh -c"
export INSTALL
diff --git a/extension/gawkfts.h b/extension/gawkfts.h
index f1ca26f5..447b1758 100644
--- a/extension/gawkfts.h
+++ b/extension/gawkfts.h
@@ -45,7 +45,7 @@
# endif
#endif
-#ifdef ZOS_USS
+#ifdef __MVS__
#include <limits.h>
#define MAXPATHLEN FILENAME_MAX
#endif
@@ -81,11 +81,7 @@ typedef struct _ftsent {
struct _ftsent *fts_cycle; /* cycle node */
struct _ftsent *fts_parent; /* parent directory */
struct _ftsent *fts_link; /* next file in directory */
-#ifdef ZOS_USS
- long fts_number; /* local numeric value */
-#else
- long long fts_number; /* local numeric value */
-#endif
+ long long fts_number; /* local numeric value */
void *fts_pointer; /* local address value */
char *fts_accpath; /* access path */
char *fts_path; /* root path */
diff --git a/extension/readdir.c b/extension/readdir.c
index 7bcabcb0..4578b864 100644
--- a/extension/readdir.c
+++ b/extension/readdir.c
@@ -137,11 +137,7 @@ ftype(struct dirent *entry, const char *dirname)
}
/* get_inode --- get the inode of a file */
-#ifdef ZOS_USS
-static long
-#else
static long long
-#endif
get_inode(struct dirent *entry, const char *dirname)
{
#ifdef __MINGW32__
@@ -179,11 +175,7 @@ dir_get_record(char **out, awk_input_buf_t *iobuf, int *errcode,
int len;
open_directory_t *the_dir;
const char *ftstr;
-#ifdef ZOS_USS
- unsigned long ino;
-#else
unsigned long long ino;
-#endif
/*
* The caller sets *errcode to 0, so we should set it only if an
@@ -208,9 +200,7 @@ dir_get_record(char **out, awk_input_buf_t *iobuf, int *errcode,
ino = get_inode (dirent, iobuf->name);
-#if defined(ZOS_USS)
- len = sprintf(the_dir->buf, "%lu/%s", ino, dirent->d_name);
-#elif __MINGW32__
+#if __MINGW32__
len = sprintf(the_dir->buf, "%I64u/%s", ino, dirent->d_name);
#else
len = sprintf(the_dir->buf, "%llu/%s", ino, dirent->d_name);
diff --git a/extension/rwarray.c b/extension/rwarray.c
index 5bead973..e751ea2c 100644
--- a/extension/rwarray.c
+++ b/extension/rwarray.c
@@ -53,17 +53,6 @@
#define _(msgid) gettext(msgid)
#define N_(msgid) msgid
-#if defined(ZOS_USS)
-#include <limits.h>
-#define INT32_MAX INT_MAX
-#define INT32_MIN INT_MIN
-#ifndef __uint32_t
-#define __uint32_t 1
-typedef unsigned long uint32_t;
-#endif
-typedef long int32_t;
-#endif /* ZOS_USS */
-
#define MAGIC "awkrulz\n"
#define MAJOR 3
#define MINOR 0