diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:22:24 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2010-07-16 12:22:24 +0300 |
commit | 56815f21bd9f396e53386969c7a00dd801f232fd (patch) | |
tree | 1dcf01c7109d6c91f8c789a9e81510e179e826f2 | |
parent | e1ef22d366abd1f9ec95eb495c727d55181c8584 (diff) | |
download | egawk-56815f21bd9f396e53386969c7a00dd801f232fd.tar.gz egawk-56815f21bd9f396e53386969c7a00dd801f232fd.tar.bz2 egawk-56815f21bd9f396e53386969c7a00dd801f232fd.zip |
Move to gawk-2.15.1.
-rw-r--r-- | Makefile.bsd44 | 8 | ||||
-rw-r--r-- | Makefile.in | 60 | ||||
-rw-r--r-- | NEWS | 29 | ||||
-rw-r--r-- | README.ibmrt-aos | 20 | ||||
-rw-r--r-- | awk.y | 3 | ||||
-rw-r--r-- | awktab.c | 3 | ||||
-rw-r--r-- | builtin.c | 5 | ||||
-rw-r--r-- | config/bsd44 | 1 | ||||
-rw-r--r-- | config/hpux8x | 1 | ||||
-rw-r--r-- | config/ibmrt-aos | 19 | ||||
-rw-r--r-- | config/sysv3 | 1 | ||||
-rw-r--r-- | config/sysv4 | 1 | ||||
-rw-r--r-- | config/ultrix41 | 1 | ||||
-rwxr-xr-x | configure | 4 | ||||
-rw-r--r-- | getopt.h | 7 | ||||
-rw-r--r-- | io.c | 17 | ||||
-rw-r--r-- | patchlevel.h | 2 |
17 files changed, 146 insertions, 36 deletions
diff --git a/Makefile.bsd44 b/Makefile.bsd44 index 269f14b8..a5d968c9 100644 --- a/Makefile.bsd44 +++ b/Makefile.bsd44 @@ -1,8 +1,12 @@ PROG= awk -SRCS= main.c eval.c builtin.c msg.c iop.c io.c field.c array.c \ +SRCS= main.c eval.c builtin.c msg.c iop.c io.c field.c getopt1.c \ + getopt.c array.c \ node.c version.c missing.c re.c awk.c regex.c dfa.c DPADD= ${LIBM} LDADD= -lm -CFLAGS+= -g +CFLAGS+=-I${.CURDIR} -DGAWK +BINDIR= /usr/bin +MANDIR= /usr/share/man/cat +CLEANFILES+=awk.c y.tab.h awk.0 .include <bsd.prog.mk> diff --git a/Makefile.in b/Makefile.in index f4792dc3..b32caf44 100644 --- a/Makefile.in +++ b/Makefile.in @@ -22,10 +22,16 @@ # User tunable macros -- CHANGE THESE IN Makefile.in RATHER THAN IN # Makefile, OR configure WILL OVERWRITE YOUR CHANGES -DESTDIR= -BINDIR= /usr/local/bin -MANDIR= /usr/local/man/man1 -MANEXT= 1 +prefix = /usr/local +exec_prefix = $(prefix) +binprefix = +manprefix = + +bindir = $(exec_prefix)/bin +libdir = $(exec_prefix)/lib +mandir = $(prefix)/man/man1 +manext = .1 +infodir = $(prefix)/info # CFLAGS: options to the C compiler # @@ -141,7 +147,7 @@ ALLFILES= $(AWKSRC) $(GNUSRC) $(COPIES) $(MISC) $(DOCS) $(ALLDOC) $(OTHERS) \ REL=2.15 # rules to build gawk -gawk: $(ALLOBJS) $(GNUOBJS) $(REOBJS) +gawk: $(ALLOBJS) $(GNUOBJS) $(REOBJS) $(CC) -o gawk $(CFLAGS) $(ALLOBJS) $(GNUOBJS) $(REOBJS) -lm $(LIBS) $(AWKOBJS) regex.o dfa.o: awk.h dfa.h regex.h @@ -150,23 +156,27 @@ getopt.o: getopt.h getopt1.o: getopt.h -main.o: patchlevel.h +main.o: patchlevel.h -awktab.c: awk.y +awktab.c: awk.y $(PARSER) -v awk.y ##MAKE_VMS-Posix## mv ytab.c awktab.c ##MAKE_VMS-Posix## dummy.awk_tab.target: sed '/^extern char .malloc(), .realloc();$$/d' y.tab.c >awktab.c rm y.tab.c -config.h: config.in +config.h: config.in @echo You must provide a config.h! @echo Run \"./configure\" to build it for known systems @echo or copy config.in to config.h and edit it.; exit 1 -install: gawk - cp gawk $(DESTDIR)$(BINDIR) - cp gawk.1 $(DESTDIR)$(MANDIR)/gawk.$(MANEXT) +install: gawk + cp gawk $(bindir) && chmod 755 $(bindir)/gawk + cp gawk.1 $(mandir)/gawk$(manext) && chmod 644 $(mandir)/gawk$(manext) + cp gawk.info* $(infodir) && chmod 644 $(infodir)/gawk.info* + +uninstall: + rm -f $(bindir)/gawk $(mandir)/gawk$(manext) $(infodir)/gawk.info* # ALLOCA: uncomment this if your system (notably System V boxen) # does not have alloca in /lib/libc.a or /lib/libPW.a @@ -178,31 +188,39 @@ install: gawk # One of these rules should have already been selected by running configure. -##MAKE_ALLOCA_S## alloca.o: alloca.s +##MAKE_ALLOCA_S## alloca.o: alloca.s ##MAKE_ALLOCA_S## /lib/cpp < alloca.s | sed '/^#/d' > t.s ##MAKE_ALLOCA_S## as t.s -o alloca.o ##MAKE_ALLOCA_S## rm t.s -##MAKE_ALLOCA_C## alloca.o: alloca.c +##MAKE_ALLOCA_C## alloca.o: alloca.c # auxiliary rules for release maintenance -lint: $(ALLSRC) +lint: $(ALLSRC) lint -hcbax $(FLAGS) $(ALLSRC) xref: cxref -c $(FLAGS) $(ALLSRC) | grep -v ' /' >xref clean: - rm -rf *.o core awk.output gmon.out make.out y.output \ - *.orig *.rej */*.orig */*.rej + rm -rf gawk *.o core + +distclean: clean + rm -f Makefile *.orig *.rej */*.orig */*.rej awk.output gmon.out \ + make.out y.output config.h + +mostlyclean: clean + +realclean: distclean + rm -f awktab.c $(ALLDOC) cleaner: clean - rm -f gawk awktab.c Makefile + rm -f gawk awktab.c Makefile config.h -clobber: clean - rm -f $(ALLDOC) gawk.log +clobber: clean + rm -f $(ALLDOC) gawk.log config.h -gawk.dvi: gawk.texi +gawk.dvi: gawk.texi tex gawk.texi; texindex gawk.?? tex gawk.texi; texindex gawk.?? tex gawk.texi @@ -250,7 +268,7 @@ gawk-ps-$(REL).tar.z: gawk.dvi gawk.1 pstroff -man gawk.1 > gawk-ps-$(REL)/gawk.1.ps tar -cf - gawk-ps-$(REL) | gzip > gawk-ps-$(REL).tar.z -release: gawk-src-$(REL).tar.z gawk-doc-$(REL).tar.z gawk-ps-$(REL).tar.z \ +release: gawk-src-$(REL).tar.z gawk-doc-$(REL).tar.z gawk-ps-$(REL).tar.z \ gawk-test-$(REL).tar.z test: gawk @@ -1,3 +1,32 @@ +Changes from 2.15 to 2.15.1 +--------------------------- + +Close stdout and stderr before all redirections on program exit. This allows + detection of write errors and also fixes the messages test on Solaris 2.x. + +Removed YYMAXDEPTH define in awk.y which was limiting the parser stack depth. + +Changes to config/bsd44, Makefile.bsd44 and configure to bring it into line + with the BSD4.4 release. + +Changed Makefile to use prefix, exec_prefix, bindir etc. + +make install now installs info files. + +make install now sets permissions on installed files. + +Make targets added: uninstall, distclean, mostlyclean and realclean. + +Added config.h to cleaner and clobber make targets. + +Changes to config/{hpux8x,sysv3,sysv4,ultrix41} to deal with alloca(). + +Change to getopt.h for portability. + +Added more special cases to the getpgrp() call. + +Added README.ibmrt-aos and config/ibmrt-aos. + Changes from 2.14 to 2.15 --------------------------- diff --git a/README.ibmrt-aos b/README.ibmrt-aos index e69de29b..25518e65 100644 --- a/README.ibmrt-aos +++ b/README.ibmrt-aos @@ -0,0 +1,20 @@ +From: karl@cs.umb.edu (Karl Berry) +Newsgroups: gnu.utils.bug +Subject: gawk 2.15/ibm rt/compile errors +Date: 17 May 1993 23:16:11 -0400 +Organization: GNUs Not Usenet + +gawk 2.15 on an IBM RT running AOS, configured as bsd43, needs the +following additional definitions (although I suppose this will be +irrelevant when you switch to Autoconf). + +-DTZSET_MISSING -DFMOD_MISSING -DCHAR_UNSIGNED + +[ Fixed in 2.15.1 -- configure as ibmrt-aos ] + +Also, missing/strftime.c did not compile, because it does not handle the +case where the system provides neither tzname nor the tm_zone member, +but instead has the timezone function. I used the strftime.c from the +find 3.8 distribution. + +[ Not fixed in 2.15.1 ] @@ -28,9 +28,6 @@ #define YYDEBUG 12 #endif -#define YYMAXDEPTH 300 -#define YYSSIZE YYMAXDEPTH - #include "awk.h" static void yyerror (); /* va_alist */ @@ -47,9 +47,6 @@ #define YYDEBUG 12 #endif -#define YYMAXDEPTH 300 -#define YYSSIZE YYMAXDEPTH - #include "awk.h" static void yyerror (); /* va_alist */ @@ -76,13 +76,14 @@ int flush; if (fwrite(ptr, size, count, fp) != count) goto wrerror; if (flush - && ((fp == stdout && output_is_tty) - || (rp && (rp->flag & RED_NOBUF)))) { + && ((fp == stdout && output_is_tty) + || (rp && (rp->flag & RED_NOBUF)))) { fflush(fp); if (ferror(fp)) goto wrerror; } return; + wrerror: fatal("%s to \"%s\" failed (%s)", from, rp ? rp->value : "standard output", diff --git a/config/bsd44 b/config/bsd44 index 4dfcb79d..6c908859 100644 --- a/config/bsd44 +++ b/config/bsd44 @@ -1,5 +1,4 @@ For generic 4.4 alpha -STRTOD_MISSING 1 HAVE_UNDERSCORE_SETJMP 1 STDC_HEADERS 1 ALLOCA_PROTO 1 diff --git a/config/hpux8x b/config/hpux8x index 66d347a9..9375e988 100644 --- a/config/hpux8x +++ b/config/hpux8x @@ -1,3 +1,4 @@ HPPA running HP-UX 8.x STDC_HEADERS 1 RANDOM_MISSING 1 +MAKE_ALLOCA_PW diff --git a/config/ibmrt-aos b/config/ibmrt-aos index e69de29b..fcec410f 100644 --- a/config/ibmrt-aos +++ b/config/ibmrt-aos @@ -0,0 +1,19 @@ +For generic 4.3 BSD machine. +SIGTYPE int +HAVE_UNDERSCORE_SETJMP 1 +MEMCMP_MISSING 1 +MEMCPY_MISSING 1 +MEMSET_MISSING 1 +STRCASE_MISSING 1 +STRCHR_MISSING 1 +STRERROR_MISSING 1 +STRFTIME_MISSING 1 +STRTOD_MISSING 1 +STRTOL_MISSING 1 +NON_STD_SPRINTF 1 +VPRINTF_MISSING 1 +BSDSTDIO 1 +TZNAME_MISSING 1 +TZSET_MISSING 1 +FMOD_MISSING 1 +CHAR_UNSIGNED 1 diff --git a/config/sysv3 b/config/sysv3 index 30e19d16..944db233 100644 --- a/config/sysv3 +++ b/config/sysv3 @@ -4,3 +4,4 @@ RANDOM_MISSING 1 STRCASE_MISSING 1 STRERROR_MISSING 1 STRFTIME_MISSING 1 +MAKE_ALLOCA_C diff --git a/config/sysv4 b/config/sysv4 index dfaf5ce4..0ea9c4ff 100644 --- a/config/sysv4 +++ b/config/sysv4 @@ -2,3 +2,4 @@ System V.4 Systems (generic) RANDOM_MISSING 1 STRCASE_MISSING 1 STDC_HEADERS 1 +MAKE_ALLOCA_C diff --git a/config/ultrix41 b/config/ultrix41 index 84348df8..8e82ec40 100644 --- a/config/ultrix41 +++ b/config/ultrix41 @@ -1,3 +1,4 @@ DECstation running Ultrix 4.1 (and 4.2??) STDC_HEADERS 1 #define Ultrix41 1 +MAKE_ALLOCA_C @@ -16,6 +16,10 @@ if [ -f config/$1 ]; then # echo #echo lines to stdout sed -n '/^#echo /s///p' config/$1 + case "$1" in + bsd44) ln -s Makefile.bsd44 Makefile ; exit 0 ;; + esac + sed -n '/^MAKE_.*/s//s,^##&## ,,/p' config/$1 >sedscr if [ -s sedscr ] then @@ -94,7 +94,14 @@ enum _argtype }; #if __STDC__ +#if defined(__GNU_LIBRARY__) +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ extern int getopt (int argc, char *const *argv, const char *shortopts); +#else /* not __GNU_LIBRARY__ */ +extern int getopt (); +#endif /* not __GNU_LIBRARY__ */ extern int getopt_long (int argc, char *const *argv, const char *shortopts, const struct option *longopts, int *longind); extern int getopt_long_only (int argc, char *const *argv, @@ -58,6 +58,7 @@ static int gawk_pclose P((struct redirect *rp)); static int do_pathopen P((char *file)); extern FILE *fdopen(); +extern FILE *popen(); static struct redirect *red_head = NULL; @@ -466,6 +467,8 @@ register struct redirect *rp; if (rp == NULL) return 0; + if (rp->fp == stdout || rp->fp == stderr) + return 0; errno = 0; if ((rp->flag & (RED_PIPE|RED_WRITE)) == (RED_PIPE|RED_WRITE)) status = pclose(rp->fp); @@ -516,7 +519,6 @@ flush_io () warning("error writing standard output (%s).", strerror(errno)); status++; } - errno = 0; if (fflush(stderr)) { warning("error writing standard error (%s).", strerror(errno)); status++; @@ -524,7 +526,6 @@ flush_io () for (rp = red_head; rp != NULL; rp = rp->next) /* flush both files and pipes, what the heck */ if ((rp->flag & RED_WRITE) && rp->fp != NULL) { - errno = 0; if (fflush(rp->fp)) { warning("%s flush of \"%s\" failed (%s).", (rp->flag & RED_PIPE) ? "pipe" : @@ -542,6 +543,15 @@ close_io () register struct redirect *next; int status = 0; + errno = 0; + if (fclose(stdout)) { + warning("error writing standard output (%s).", strerror(errno)); + status++; + } + if (fclose(stderr)) { + warning("error writing standard error (%s).", strerror(errno)); + status++; + } for (rp = red_head; rp != NULL; rp = next) { next = rp->next; if (close_redir(rp)) @@ -695,7 +705,8 @@ char *name, *mode; int i; if (name[6] == 'g') -#if defined(__svr4__) || defined(i860) +/* following #if will improve in 2.16 */ +#if defined(__svr4__) || defined(i860) || defined(_AIX) || defined(BSD4_4) sprintf(tbuf, "%d\n", getpgrp()); #else sprintf(tbuf, "%d\n", getpgrp(getpid())); diff --git a/patchlevel.h b/patchlevel.h index 2867bba9..131713a8 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -1 +1 @@ -#define PATCHLEVEL 0 +#define PATCHLEVEL 1 |