diff options
Diffstat (limited to 'm4')
-rw-r--r-- | m4/ChangeLog | 12 | ||||
-rw-r--r-- | m4/arch.m4 | 49 |
2 files changed, 58 insertions, 3 deletions
diff --git a/m4/ChangeLog b/m4/ChangeLog index c3704e4b..80865223 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,15 @@ +2015-08-28 Daniel Richard G. <skunk@iSKUNK.ORG> + + * arch.m4: Complete rewrite of AC_ZOS_USS. It no longer + deletes awkgram.c and command.c on a z/OS system, as these are + now usable in EBCDIC-land without regeneration; it sets some + important CFLAGS/CPPFLAGS to enable standard compiler + behavior, like giving an error instead of a warning when a + header file cannot be found (!); prevents the use of cc(1), + which on z/OS does not build gawk correctly; and gives some + help to the user if s/he is building with c89(1), which + presents some difficulties due to its option syntax. + 2015-08-02 Arnold D. Robbins <arnold@skeeve.com> * codeset.m4, glibc2.m4, glibc21.m4, intdiv0.m4, intl.m4, @@ -61,14 +61,57 @@ AC_MSG_RESULT([${gawk_cv_linux_alpha_hack}]) dnl Check for z/OS Unix Systems Services AC_DEFUN([AC_ZOS_USS], [ AC_MSG_CHECKING([for z/OS USS compilation]) +AC_CACHE_VAL(ac_cv_zos_uss, [ if test "OS/390" = "`uname`" then - CFLAGS="$CFLAGS -D_ALL_SOURCE -DZOS_USS -DUSE_EBCDIC" - # Must rebuild awkgram.c and command.c from Bison for EBCDIC - rm -f awkgram.c command.c ac_cv_zos_uss=yes else ac_cv_zos_uss=no fi +])dnl AC_MSG_RESULT([${ac_cv_zos_uss}]) +if test "x$ac_cv_zos_uss" = "xyes" +then + 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 + then + AC_MSG_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.)]) + fi + 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 |