aboutsummaryrefslogtreecommitdiffstats
path: root/atari
diff options
context:
space:
mode:
Diffstat (limited to 'atari')
-rw-r--r--atari/ChangeLog3
-rw-r--r--atari/Makefile.awklib104
-rw-r--r--atari/Makefile.st240
-rw-r--r--atari/config.h186
-rw-r--r--atari/gawkmisc.atr124
-rw-r--r--atari/mkconf.g18
-rw-r--r--atari/mkscrpt.sed15
-rw-r--r--atari/redirect.h32
-rw-r--r--atari/tmpnam.c4
9 files changed, 606 insertions, 120 deletions
diff --git a/atari/ChangeLog b/atari/ChangeLog
new file mode 100644
index 00000000..570c031b
--- /dev/null
+++ b/atari/ChangeLog
@@ -0,0 +1,3 @@
+Wed Jan 10 22:58:55 1996 Arnold D. Robbins <arnold@skeeve.atl.ga.us>
+
+ * ChangeLog created.
diff --git a/atari/Makefile.awklib b/atari/Makefile.awklib
new file mode 100644
index 00000000..30be5226
--- /dev/null
+++ b/atari/Makefile.awklib
@@ -0,0 +1,104 @@
+# Makefile for GNU Awk support library
+# Copy this file to 'awklib' subdirectory of main directory
+# and execute via relevant targets in your top Makefile
+#
+# This Makefile actually will work for awklib even when NOT
+# compiling with Atari Makefile!!!
+#
+# Copyright (C) 1995 the Free Software Foundation, Inc.
+#
+# This file is part of GAWK, the GNU implementation of the
+# AWK Programming Language.
+#
+# GAWK is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# GAWK is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+SHELL = /bin/sh
+
+srcdir = .
+
+INSTALL = /usr/bin/install -c
+INSTALL_PROGRAM = ${INSTALL}
+INSTALL_DATA = ${INSTALL} -m 644
+
+CC = gcc
+CFLAGS = -g -O
+
+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
+datadir = ${prefix}/share/awk
+libexecdir = ${exec_prefix}/libexec/awk
+
+PWCAT = pwcat
+GRCAT = grcat
+AUXPROGS = $(PWCAT) $(GRCAT)
+GCOM = '{print}'
+GAWK = ../gawk
+AUXAWK = passwd.awk group.awk
+
+all: stamp-eg $(AUXPROGS) igawk $(AUXAWK)
+
+stamp-eg: $(srcdir)/../doc/gawk.texi
+ rm -fr eg stamp-eg
+ $(GAWK) -f $(srcdir)/extract.awk $(srcdir)/../doc/gawk.texi
+ @echo 'some makes are stupid and will not check a directory' > stamp-eg
+ @echo 'against a file, so this file is a place holder. gack.' >> stamp-eg
+
+$(PWCAT): $(srcdir)/eg/lib/pwcat.c
+ $(CC) $(CFLAGS) $(srcdir)/eg/lib/pwcat.c -o $@
+
+$(GRCAT): $(srcdir)/eg/lib/grcat.c
+ $(CC) $(CFLAGS) $(srcdir)/eg/lib/grcat.c -o $@
+
+igawk: $(srcdir)/eg/prog/igawk.sh
+ $(GAWK) $(GCOM) $(srcdir)/eg/prog/igawk.sh > $@ ; chmod 755 $@
+
+passwd.awk: $(srcdir)/eg/lib/passwdawk.in
+ (cd $(srcdir)/eg/lib ; \
+ sed 's;/usr/local/libexec/awk;$(libexecdir);' < passwdawk.in) > passwd.awk
+
+group.awk: $(srcdir)/eg/lib/groupawk.in
+ (cd $(srcdir)/eg/lib ; \
+ sed 's;/usr/local/libexec/awk;$(libexecdir);' < groupawk.in) > group.awk
+
+install: igawk $(AUXPROGS) $(AUXAWK)
+ $(INSTALL_PROGRAM) igawk $(bindir)
+ for i in $(AUXPROGS) ; do \
+ $(INSTALL_PROGRAM) $$i $(libexecdir) ; \
+ done
+ for i in $(AUXAWK) $(srcdir)/eg/lib/*.awk ; do \
+ $(INSTALL_DATA) $$i $(datadir) ; \
+ done
+
+# libexecdir and bindir are removed in the top level Makefile's uninstall
+uninstall:
+ rm -fr $(libexecdir)/* $(datadir)/*
+ rm -f $(bindir)/igawk
+
+clean:
+ rm -f $(AUXPROGS) igawk
+
+maintainer-clean: clean
+ rm -fr eg stamp-eg
+
+distclean: clean
+ rm -f Makefile
diff --git a/atari/Makefile.st b/atari/Makefile.st
index 33e9e3c2..ca00b466 100644
--- a/atari/Makefile.st
+++ b/atari/Makefile.st
@@ -5,10 +5,14 @@
# and modified system().
# Check comments in this Makefile and adjust to your needs!!
#
-# Copyright (C) 1986, 1988-1993 the Free Software Foundation, Inc.
+# This Makefile assumes that you are using Bourne compatible shell
+# (like bash). If this is not the case you will have to edit various
+# targets or perform some actions by hand.
+#
+# Copyright (C) 1986, 1988-1995 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
-# AWK Progamming Language.
+# AWK Programming Language.
#
# GAWK is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -21,107 +25,219 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with GAWK; see the file COPYING. If not, write to
-# the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-srcdir = .
-VPATH = .
-# CC = gcc
-CC = cgcc # when cross-compiling
-#YACC = byacc
-YACC = bison -y
-# basename of parser output - adjust to your parser requirements
-YOUTPUT = awk_tab
+srcdir = .
+# native compiler with freshly compiled gawk.ttp to fix awklib
+CC = gcc
+GAWK=../gawk.ttp
+# cross-compiler and gawk already installed on the system (any awk will do)
+# CC = cgcc
+# GAWK = gawk
# WIDTH and EXT have to be both defined or both undefined
-# WIDTH = -mshort
+# WIDTH = -mshort -DINT_IS_16BIT
# EXT = 16
+OFLAGS = -O2 -Wall -fomit-frame-pointer $(WIDTH)
+LDFLAGS = $(WIDTH)
+YACC = bison -y
+
+INSTALL = cp -p
+INSTALL_PROGRAM = ${INSTALL}
+#INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_DATA = ${INSTALL}
+
LIBS = -lpml$(EXT)
-LIBOBJS = strncasecmp.o
-ST_LIBOBJS = stack.o tmpnam.o system.o
-# CFLAGS= -g -DGAWK -DHAVE_CONFIG_H $(WIDTH) -I. -I..
-CFLAGS= -DGAWK -DHAVE_CONFIG_H $(WIDTH) -O2 -I. -I.. -Wall \
- -fomit-frame-pointer # -pipe #
-# keep only global symbols and use long symbol names
-# xstrip -k in target gawk.ttp removes all symbols but _stksize
-# allowing for stack size manipulations without recompiling (with fixstk)
-LDFLAGS= -Xlinker -x -G $(WIDTH)
+ALLOCA =
+
+#all these definitions likely require changes
+exec_prefix = ${prefix}
+prefix = /usr/local
+binprefix =
+manprefix =
+
+bindir = $(exec_prefix)/bin
+libdir = $(exec_prefix)/lib
+manexta = l
+mandir = $(prefix)/man$(manexta)
+manext = .$(manexta)
+infodir = $(prefix)/info
+datadir = $(prefix)/lib/awk
+libexecdir = $(prefix)/libexec/awk
+
+#DEFPATH = ".:$(datadir)"
+# datadir is passed to the next Makefile level and through sed
+# you may need many more backslashes than that if you have to use
+# them at all - sigh...
+DEFPATH = ".,c:\\lib\\awk,c:\\gnu\\lib\\awk"
+
+SHELL = /bin/sh
+CFLAGS = $(OFLAGS) -DGAWK -I. -I$(srcdir) -DHAVE_CONFIG_H
+
+MFLAGS = "CC=$(CC)" "CFLAGS=$(CFLAGS) $(LDFLAGS)" GAWK=$(GAWK) \
+ PWCAT=pwcat.ttp GRCAT=grcat.ttp GCOM='{sub(/\":\"/, "\",\""); print}' \
+ "INSTALL_PROGRAM=$(INSTALL)" "INSTALL_DATA=$(INSTALL)" \
+ "bindir=$(bindir)" \
+ "libdir=$(libdir)" \
+ "mandir=$(mandir)" \
+ "infodir=$(infodir)" \
+ "datadir=$(datadir)" \
+ "libexecdir=$(libexecdir)"
# object files
-AWKOBJS = main.o eval.o builtin.o msg.o iop.o io.o field.o array.o \
- node.o version.o re.o getopt.o getopt1.o
+AWKOBJS = array.o builtin.o eval.o field.o gawkmisc.o io.o main.o \
+ missing.o msg.o node.o re.o version.o
ALLOBJS = $(AWKOBJS) awktab.o
# GNUOBJS
# GNU stuff that gawk uses as library routines.
-REGEX = regex
-GNUOBJS= $(REGEX).o dfa.o
+GNUOBJS= getopt.o getopt1.o regex.o dfa.o $(ALLOCA)
+
+# source and documentation files
+SRC = array.c builtin.c eval.c field.c gawkmisc.c io.c main.c \
+ missing.c msg.c node.c re.c version.c
+
+ALLSRC= $(SRC) awktab.c
+
+AWKSRC= awk.h awk.y $(ALLSRC) patchlevel.h protos.h
+
+GNUSRC = alloca.c dfa.c dfa.h regex.c regex.h getopt.h getopt.c getopt1.c
+
+DOCS= doc/gawk.1.in doc/gawk.texi.in doc/texinfo.tex
+
+TEXFILES= doc/gawk.aux doc/gawk.cp doc/gawk.cps doc/gawk.fn doc/gawk.fns \
+ doc/gawk.ky doc/gawk.kys doc/gawk.pg doc/gawk.pgs doc/gawk.toc \
+ doc/gawk.tp doc/gawk.tps doc/gawk.vr doc/gawk.vrs
+
+ALLDOC= doc/gawk.dvi $(TEXFILES) doc/gawk.info*
+
+# Release of gawk. There can be no leading or trailing white space here!
+REL=3.0
+PROG=gawk.ttp
+
+# clear out suffixes list
+.SUFFIXES:
+.SUFFIXES: .c .o
+
+.c.o:
+ $(CC) -c $(CFLAGS) $<
-all: gawk.ttp
+# rules to build $(PROG)
+all: $(PROG) awklib/all
-gawk.ttp: $(ALLOBJS) $(GNUOBJS) $(REOBJS) $(LIBOBJS) $(ST_LIBOBJS)
- $(CC) -o $@ $(LDFLAGS) \
- $(ALLOBJS) $(GNUOBJS) $(REOBJS) $(LIBOBJS) $(ST_LIBOBJS) $(LIBS)
- toglclr -fload $@
+alldoc: all doc/all
+
+$(PROG): $(ALLOBJS) $(GNUOBJS) $(REOBJS)
+ $(CC) -o $@ $(LDFLAGS) $(ALLOBJS) $(GNUOBJS) $(REOBJS) $(LIBS)
+# toglclr -fload $@
# xstrip -k $@
-$(AWKOBJS) $(GNUOBJS): awk.h dfa.h $(REGEX).h config.h
+
+$(ALLOBJS): awk.h dfa.h regex.h config.h custom.h
+
+$(GNUOBJS): config.h custom.h
+
+gawkmisc.o: $(srcdir)/atari/gawkmisc.atr
+ $(CC) -c -DDEFPATH='$(DEFPATH)' $(CFLAGS) $(srcdir)/$<
+
+# this rule needed or not - depending on your library
+missing.o io.o:
+ $(CC) -c $(CFLAGS) -DPIPES_SIMULATED $(srcdir)/$<
# cheat with defines to force an inclusion of a proper code
getopt.o: getopt.h
$(CC) $(CFLAGS) -D_LIBC -D__alloca=__builtin_alloca -c getopt.c
+
+getopt.o: getopt.h
getopt1.o: getopt.h
-main.o: patchlevel.h
+main.o: patchlevel.h
+
+awktab.c: awk.y
+ $(YACC) -v $(srcdir)/awk.y && \
+ if test -f y.tab.c ; then mv y.tab.c ytab.c ; else true ; fi && \
+ sed '/^extern char .malloc(), .realloc();$$/d' ytab.c >awktab.c && \
+ rm ytab.c
+
+# VMS POSIX make won't apply the default .c.o rule to awktab.o for some reason
+awktab.o: awktab.c awk.h
+ $(CC) -c $(CFLAGS) $(srcdir)/awktab.c
+
+alloca.o: alloca.c
-awktab.c: awk.y
- $(YACC) -v awk.y
- sed '/^extern char .malloc(), .realloc();$$/d' $(YOUTPUT).c >awktab.c
- rm $(YOUTPUT).c
+install: $(PROG)
+ $(INSTALL) $(PROG) $(bindir) && chmod 755 $(bindir)/$(PROG)
+ cd awklib && $(MAKE) $(MFLAGS) install
+# cd doc && $(MAKE) $(MFLAGS) install
-# rules for $(LIBOBJS) and $(ST_LIBOBJS)
+installdoc: info
+ cd doc && $(MAKE) $(MFLAGS) install
-strncasecmp.o: missing/strncasecmp.c config.h
- $(CC) $(CFLAGS) -c missing/strncasecmp.c
+#
+#installtotal: installdirs install installdoc
-stack.o: atari/stack.c
- $(CC) $(CFLAGS) -c atari/stack.c
-
-tmpnam.o: atari/tmpnam.c
- $(CC) $(CFLAGS) -c atari/tmpnam.c
-# this is an optional replacement for a library module.
-system.o: atari/system.c
- $(CC) $(CFLAGS) -c atari/system.c
+installdirs: mkinstalldirs
+ $(srcdir)/mkinstalldirs $(bindir) $(datadir) \
+ $(libdir) $(infodir) $(mandir)
+
+uninstall:
+ rm -f $(bindir)/$(PROG)
+ cd awklib && $(MAKE) $(MFLAGS) uninstall
+# cd doc && $(MAKE) $(MFLAGS) uninstall
clean:
- rm -rf gawk.ttp *.o core
+ rm -rf $(PROG) *.o core y.output
+ cd awklib && $(MAKE) $(MFLAGS) clean
+# the following does not always make sense (when crosscompiling)
+# cd test && $(MAKE) $(MFLAGS) clean
+# cd doc && $(MAKE) $(MFLAGS) clean
+
distclean: clean
rm -f Makefile *.orig *.rej */*.orig */*.rej awk.output gmon.out \
- make.out y.output config.h config.status
+ make.out config.h config.status config.cache config.log stamp-h stamp-h.in
+ cd doc && $(MAKE) $(MFLAGS) distclean
mostlyclean: clean
-realclean: distclean
- rm -f awktab.c $(ALLDOC)
+maintainer-clean: distclean
+ @echo "This command is intended for maintainers to use;"
+ @echo "it deletes files that may require special tools to rebuild."
+ rm -f awktab.c
+ cd doc && $(MAKE) $(MFLAGS) maintainer-clean
+ cd test && $(MAKE) $(MFLAGS) maintainer-clean
+# cd awklib && $(MAKE) $(MFLAGS) maintainer-clean
+
+clobber: maintainer-clean
+
+TAGS:
+ etags $(AWKSRC)
+ ctags $(AWKSRC)
-gawk.dvi: gawk.texi
- tex gawk.texi; texindex gawk.??
- tex gawk.texi; texindex gawk.??
- tex gawk.texi
- rm -f gawk.?? gawk.???
+dvi: $(srcdir)/doc/gawk.texi.in
+ cd doc && $(MAKE) $(MFLAGS) dvi
-gawk.info: gawk.texi
- makeinfo gawk.texi
+info: $(srcdir)/doc/gawk.texi.in
+ cd doc && $(MAKE) $(MFLAGS) info
-# not really (or not with every shell) - but you have an idea
-test: gawk
+doc/all:
+ cd doc && $(MAKE) $(MFLAGS) all
+
+awklib/all:
+ cd awklib && $(MAKE) $(MFLAGS) all
+
+# to run this target you have to adjust test/Makefile quite a bit
+# in order to make it paltable to your shell
+#
+check: $(PROG)
cd test; $(MAKE) -k
-check: test
+test: check
+
diff --git a/atari/config.h b/atari/config.h
index 48eaf0f1..8793d698 100644
--- a/atari/config.h
+++ b/atari/config.h
@@ -1,33 +1,171 @@
+/*
+ * Sample configuration file for ST - works with gcc and TOS libraries;
+ * revise for your configuration if configure script does not work
+ */
+/*
+ * acconfig.h -- configuration definitions for gawk.
+ */
+
/*
- * config.h for Atari ST.
- * Assumes gcc compiler and TOS libraries.
- * Edited by hand from a config.h generated automatically by configure.
+ * Copyright (C) 1995 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*/
-/* Default path for Awk library */
-#define DEFPATH ".,c:\\lib\\awk,c:\\gnu\\lib\\awk"
-/* Path separator in use */
-#define ENVSEP ','
-#define SZTC (size_t)
-#define INTC (int)
+/* Define if using alloca.c. */
+/* #undef C_ALLOCA */
+
+/* Define if type char is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+/* #undef __CHAR_UNSIGNED__ */
+#endif
-#define STDC_HEADERS 1 /* have the usual ANSI header files */
-#undef REGEX_MALLOC /* use alloca in regex.c */
+/* Define to empty if the keyword does not work. */
+/* #undef const */
-#undef __CHAR_UNSIGNED__ /* default char is signed */
+/* Define to the type of elements in the array set by `getgroups'.
+ Usually this is either `int' or `gid_t'. */
+#define GETGROUPS_T gid_t
-/*
- * srandom already has a prototype defined - don't redefine it
- */
-#define SRANDOM_PROTO 1
+/* Define if the `getpgrp' function takes no argument. */
+#define GETPGRP_VOID 1
-#undef _POSIX_SOURCE /* on Minix, used to get Posix functions */
-#undef _MINIX /* on Minix, used to get Posix functions */
-#undef _POSIX_1_SOURCE /* on Minix, define to 2 */
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef gid_t */
-/*
- * define const to nothing if not __STDC__
+/* Define if you have alloca, as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
+/* #undef HAVE_ALLOCA_H */
+
+/* Define if you don't have vprintf but do have _doprnt. */
+/* #undef HAVE_DOPRNT */
+
+/* Define if your struct stat has st_blksize. */
+#define HAVE_ST_BLKSIZE 1
+
+/* Define if your struct tm has tm_zone. */
+/* #undef HAVE_TM_ZONE */
+
+/* Define if you don't have tm_zone but do have the external array
+ tzname. */
+/* #undef HAVE_TZNAME */
+
+/* Define if you have the vprintf function. */
+#define HAVE_VPRINTF 1
+
+/* Define if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef pid_t */
+
+/* Define if the system does not provide POSIX.1 features except
+ with this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define if you need to in order for stat and other things to work. */
+/* #undef _POSIX_SOURCE */
+
+/* Define as the return type of signal handlers (int or void). */
+#define RETSIGTYPE void
+
+/* Define to `unsigned' if <sys/types.h> doesn't define. */
+/* #undef size_t */
+
+/* If using the C implementation of alloca, define if you know the
+ direction of stack growth for your system; otherwise it will be
+ automatically deduced at run-time.
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
*/
-#ifndef __STDC__
-#define const
-#endif
+/* #undef STACK_DIRECTION */
+
+/* Define if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
+
+/* Define if your <sys/time.h> declares struct tm. */
+#define TM_IN_SYS_TIME 1
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+/* #undef uid_t */
+
+/* #undef GETPGRP_IS_STANDARD */ /* getpgrp does/does not take an argument */
+/* #define HAVE_BCOPY 1 *//* we have the bcopy function */
+#define HAVE_MEMCPY 1 /* we have the memcpy function */
+#define HAVE_STRINGIZE 1 /* can use ANSI # operator in cpp */
+#define HAVE_STRING_H 1 /* the <string.h> header file */
+/* #undef REGEX_MALLOC */ /* use malloc instead of alloca in regex.c */
+#define SPRINTF_RET int /* return type of sprintf */
+
+/* Define if you have the fmod function. */
+#define HAVE_FMOD 1
+
+/* Define if you have the memcmp function. */
+#define HAVE_MEMCMP 1
+
+/* Define if you have the memcpy function. */
+#define HAVE_MEMCPY 1
+
+/* Define if you have the memset function. */
+#define HAVE_MEMSET 1
+
+/* Define if you have the random function. */
+#define HAVE_RANDOM 1
+
+/* Define if you have the strchr function. */
+#define HAVE_STRCHR 1
+
+/* Define if you have the strerror function. */
+#define HAVE_STRERROR 1
+
+/* Define if you have the strftime function. */
+#define HAVE_STRFTIME 1
+
+/* Define if you have the strncasecmp function. */
+/* #undef HAVE_STRNCASECMP */
+
+/* Define if you have the strtod function. */
+#define HAVE_STRTOD 1
+
+/* Define if you have the system function. */
+/* This is a white lie - but you may or may not prefer this way */
+/* #define HAVE_SYSTEM 1 */
+
+/* Define if you have the tzset function. */
+#define HAVE_TZSET 1
+
+/* Define if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the <signum.h> header file. */
+/* #undef HAVE_SIGNUM_H */
+
+/* Define if you have the <strings.h> header file. */
+/* #undef HAVE_STRINGS_H */
+
+/* Define if you have the <sys/param.h> header file. */
+#define HAVE_SYS_PARAM_H 1
+
+/* Define if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
diff --git a/atari/gawkmisc.atr b/atari/gawkmisc.atr
new file mode 100644
index 00000000..ef09b813
--- /dev/null
+++ b/atari/gawkmisc.atr
@@ -0,0 +1,124 @@
+/*
+ * gawkmisc.atr --- miscellanious gawk routines that are OS specific.
+ */
+
+/*
+ * Copyright (C) 1986, 1988, 1989, 1991-1993 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Progamming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+#include <string.h>
+
+char quote = '\'';
+#ifndef DEFPATH
+char *defpath = ".,c:\\lib\\awk,c:\\gnu\\lib\\awk";
+#else
+char *defpath = DEFPATH;
+#endif
+char envsep = ',';
+
+
+/* gawk_name --- pull out the "gawk" part from how the OS called us */
+
+char *
+gawk_name(filespec)
+const char *filespec;
+{
+ char *p, *q;
+
+ p = (char *)filespec;
+
+ if ((q = strrchr(p, '\\')) != NULL)
+ p = q + 1;
+ if ((q = strrchr(p, '/')) != NULL)
+ p = q + 1;
+ if ((q = strchr(p, '.')) != NULL)
+ *q = '\0';
+ strlwr(p);
+
+ return (p == NULL ? (char *)filespec : (char *)p);
+}
+
+/* os_arg_fixup --- fixup the command line */
+
+void
+os_arg_fixup(argcp, argvp)
+int *argcp;
+char ***argvp;
+{
+ /* no-op */
+ return;
+}
+
+/* os_devopen --- open special per-OS devices */
+
+int
+os_devopen(name, flag)
+const char *name;
+int flag;
+{
+ /* no-op */
+ return INVALID_HANDLE;
+}
+
+/* optimal_bufsize --- determine optimal buffer size */
+
+int
+optimal_bufsize(fd, stb)
+int fd;
+struct stat *stb;
+{
+ /* force all members to zero in case OS doesn't use all of them. */
+ memset(stb, '\0', sizeof(struct stat));
+
+ /* The atari has the st_blksize structure, so we just use it. */
+#define DEFBLKSIZE (stb->st_blksize ? stb->st_blksize : BUFSIZ)
+
+ /*
+ * On ST redirected stdin does not have a name attached
+ * (this could be hard to do to) and fstat would fail
+ */
+ if (fd == 0 || isatty(fd))
+ return BUFSIZ;
+ if (fstat(fd, stb) == -1)
+ fatal("can't stat fd %d (%s)", fd, strerror(errno));
+ if (lseek(fd, (off_t)0, 0) == -1) /* not a regular file */
+ return DEFBLKSIZE;
+ if (stb->st_size > 0 && stb->st_size < DEFBLKSIZE) /* small file */
+ return stb->st_size;
+ return DEFBLKSIZE;
+}
+
+/* ispath --- return true if path has directory components */
+
+int
+ispath(file)
+const char *file;
+{
+ return (strchr(file, '/') != NULL || strchr(file, '\\') != NULL);
+}
+
+/* isdirpunct --- return true if char is a directory separator */
+
+int
+isdirpunct(c)
+int c;
+{
+ return (c == '/' || c == '\\');
+}
diff --git a/atari/mkconf.g b/atari/mkconf.g
deleted file mode 100644
index 385559b3..00000000
--- a/atari/mkconf.g
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# gulam script to produce configuration file for Atari ST;
-# performs the same job as configure, but only for this specific configuration;
-# it is assumed that it is located in a subdirectory .\atari
-#
-if { -e ..\config\atari }
- sed -n -f mkscrpt.sed ..\config\atari > sedscr
- sed -f sedscr ..\config.in > config.h
- sed -n '/^#echo./s///p' ..\config\atari
- rm sedscr
- mv config.h ..
-ef
- echo "'..\config\atari' was lost somewhere"
- echo "Either construct one based on the examples in the config directory,"
- echo "or, in source directory, copy config.in to config.h and edit it."
- exit 1
-endif
-exit 0
diff --git a/atari/mkscrpt.sed b/atari/mkscrpt.sed
deleted file mode 100644
index 949d9c59..00000000
--- a/atari/mkscrpt.sed
+++ /dev/null
@@ -1,15 +0,0 @@
-# there is no automatic editing of Makefile for Atari right now
-# but lines starting with "MAKE_" string are processed for consistency
-# with other configuration files and in a case they would be needed
-# in a future
-:start
- /^MAKE_/d
- /^[^#]/s/.*/s~__SYSTEM__~&~/p
- t cont
- n
- b start
-:cont
- n
- /^MAKE_/d
- /^[^#]/s:^\([^ ]*\)[ ].*:s~^/\\* #define[ ]*\1.*~#define &~:p
-b cont
diff --git a/atari/redirect.h b/atari/redirect.h
new file mode 100644
index 00000000..6452778f
--- /dev/null
+++ b/atari/redirect.h
@@ -0,0 +1,32 @@
+/*
+ * redirect.h --- definitions for functions that are OS specific.
+ */
+
+/*
+ * Copyright (C) 1986, 1988, 1989, 1991-1993 the Free Software Foundation, Inc.
+ *
+ * This file is part of GAWK, the GNU implementation of the
+ * AWK Programming Language.
+ *
+ * GAWK is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * GAWK is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+ */
+
+/* This file is already conditioned on atarist in awk.h */
+
+#define read _text_read /* we do not want all these CR's to mess our input */
+extern int _text_read(int, char *, int);
+#ifndef __MINT__
+#undef NGROUPS_MAX
+#endif /* __MINT__ */
diff --git a/atari/tmpnam.c b/atari/tmpnam.c
index b5ab45bd..92bf751b 100644
--- a/atari/tmpnam.c
+++ b/atari/tmpnam.c
@@ -1,10 +1,11 @@
+#ifdef PIPES_SIMULATED
/* tmpnam.c : return a temporary file name */
/* written by Eric R. Smith and placed in the public domain */
/**
* - modified for gawk needs - pattern /$$XXXXXX from the original
* code creates names which are hard to remove when somethig
* goes wrong
- * - retuned name can be passed outside via system(); other programs
+ * - returned name can be passed outside via system(); other programs
* may not dig '/' as a path separator
* - somehow more frugal in a memory use
* (mj - October 1990)
@@ -43,3 +44,4 @@ const char *path, *base; /* ignored */
{
return tmpnam(NULL);
}
+#endif /* PIPES_SIMULATED */