aboutsummaryrefslogtreecommitdiffstats
path: root/pc
diff options
context:
space:
mode:
Diffstat (limited to 'pc')
-rw-r--r--pc/ChangeLog66
-rw-r--r--pc/Makefile99
-rw-r--r--pc/Makefile.tst43
-rw-r--r--pc/config.h9
-rw-r--r--pc/gawkmisc.pc27
5 files changed, 174 insertions, 70 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 535b5be4..0defb81a 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -6,14 +6,76 @@
* Makefile.tst: Sync with mainline version.
+2012-10-28 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * Makefile.pc (messages): Adjust to use standard failure test for
+ make diffout.
+
+2012-08-08 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_isreadable): Take IOBUF_PUBLIC instead of fd and
+ use passed in info.
+
+2012-07-29 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_isreadable): Add isdir pointer parameter to be
+ set to true if fd is for a directory.
+
+2012-07-26 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (os_isreadable): New function.
+
+2012-05-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile: Remove second mingw32-readline target. Bad
+ result from branch merging.
+
2012-05-06 Eli Zaretskii <eliz@gnu.org>
* config.sed: Update DJGPP -> __DJGPP__.
+2012-04-16 Eli Zaretskii <eliz@gnu.org>
+
+ * Makefile.tst (PGAWK): Redefine as "../gawk.exe -p".
+ (MPFR_TESTS): New variable, a list of MPFR-related tests.
+ (mpfr-tests): A new target.
+ (badargs): Reset GREP_OPTIONS to empty, to avoid gratuitous
+ failures when the user has something like -nH there.
+ (mpfrieee, mpfrexprange, mpfrrnd, mpfrnr, mpfrsort, mpfrbigint):
+ New tests.
+
+ * Makefile (default): Add descriptions of mingw32-mpfr and
+ mingw32-libreadline-mpfr targets.
+ (PRSPFILE, DRSPFILE, PRSP, DRSP, PLDRSP, DLDRSP, DO_PLNK)
+ (DO_PBIND, DO_DLNK, DO_DBIND, PLDJG, DLDJG, PLMINGW32)
+ (DLMINGW32, PAWKOBJS1, PAWKOBJS2, DAWKOBJS2, PGAWKOBJS)
+ (DGAWKOBJS): Remove unused variables.
+ (djgpp, djgpp-debug, mingw32): Don't use them.
+ (mingw32): Add -D__USE_MINGW_ANSI_STDIO to compilation flags.
+ (mingw32-readline, mingw32-mpfr, mingw32-readline-mpfr): New targets.
+ (CFLAGS, AWKOBJS2): Don't reference obsolete DYN_FLAGS and DYN_OBJ
+ variables.
+ (AWKOBJS2): Add symbol$O.
+ (AWKOBJS3): New variable, lists MPFR-related object files.
+ (AWKOBJS): Add $(AWKOBJS3).
+ (all): Remove pgawk.exe and dgawk.exe.
+ (pgawk.exe, dgawk.exe, $(PRSPFILE) $(DRSPFILE), eval_p$O)
+ (profile_p$O): Remove targets.
+ (random$O, debug$O): Don't depend on floatmagic.h
+ (eval$O): Depend on interpret.h.
+ (clean): Prepend '-' to command line, to ignore errors due to
+ non-existent files.
+
+ * config.h: Comment out "#undef HAVE_LIBREADLINE" (again).
+
2012-03-29 Arnold D. Robbins <arnold@skeeve.com>
* config.h: Add definition for _Noreturn.
+2012-03-20 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
+ * gawkmisc.pc (deflibpath): New global variable.
+
2012-03-28 Arnold D. Robbins <arnold@skeeve.com>
* 4.0.1: Release tar ball made.
@@ -68,6 +130,10 @@
* Makefile.tst: Sync with mainline version.
+2011-12-12 Scott Deifik <scottd.mail@sbcglobal.net>
+
+ * Makefile.tst: Sync with mainline version.
+
2011-12-06 Scott Deifik <scottd.mail@sbcglobal.net>
* Makefile.tst: Sync with mainline version.
diff --git a/pc/Makefile b/pc/Makefile
index af3044d3..f01849a8 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -16,6 +16,9 @@ default:
@echo " mingw32 . Windows32 exe [Mingw32 GNU C] "
@echo " mingw32-readline . Like mingw32, but with readline "
@echo " [You will need to have GNU readline library installed.] "
+ @echo " mingw32-mpfr . Like mingw32, but with MPFR "
+ @echo " [You will need to have GNU MPFR library installed.] "
+ @echo " mingw32-readline-mpfr . mingw32 with readline and MPFR "
@echo " ----------------------------------------------------- "
@echo " test .... Perform tests (see README_d/README.pc) "
@echo " install . Install gawk under $(prefix)/ "
@@ -39,8 +42,6 @@ default:
#======================= Configuration ==================================
RSPFILE = gawk.rsp
-PRSPFILE = pgawk.rsp
-DRSPFILE = dgawk.rsp
#
# Choose method for passing arguments to the linker.
#
@@ -50,11 +51,7 @@ DRSPFILE = dgawk.rsp
#
# else use brain-dead approach (emxbnd will need 'tr').
RSP = $(RSPFILE)
-PRSP = $(PRSPFILE)
-DRSP = $(DRSPFILE)
LDRSP = @$(RSP)
-PLDRSP = @$(PRSP)
-DLDRSP = @$(DRSP)
LNKRSP = $(LDRSP)
#------------------------------------------------------------------------
# Some makes do not define MAKE (and ndmake does not allow a define).
@@ -80,10 +77,6 @@ install = 1
# that $($X) can be expanded.
DO_LNK = $($(LNK))
DO_BIND= $($(BIND))
-DO_PLNK = $($(PLNK))
-DO_PBIND= $($(PBIND))
-DO_DLNK = $($(DLNK))
-DO_DBIND= $($(DBIND))
#========================================================================
# End of general configuration. Some platform-specific configuration
# notes appear below.
@@ -97,21 +90,19 @@ prefix = $(DJDIR)
pkgdatadir = $(prefix)/share/awk
endif
LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2)
-PLDJG = $(CC) $(LF) -o pgawk.exe $(PLDRSP) $(LF2)
-DLDJG = $(CC) $(LF) -o dgawk.exe $(DLDRSP) $(LF2)
BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk
djgpp:
$(MAK) all \
CC=gcc O=.o CF=-O2 \
- LNK=LDJG PLNK=PLDJG DLNK=DLDJG LF=-s LF2=-lm \
- BIND=BDJG PBIND='' DBIND=''
+ LNK=LDJG LF=-s LF2=-lm \
+ BIND=BDJG
djgpp-debug:
$(MAK) all \
CC=gcc O=.o CF='-O2 -g' \
- LNK=LDJG PLNK=PLDJG DLNK=DLDJG LF2=-lm \
- BIND=BDJG PBIND='' DBIND=''
+ LNK=LDJG LF2=-lm \
+ BIND=BDJG
#========================================================================
#========================== EMX =========================================
@@ -158,41 +149,47 @@ emxbnd-debug:
#========================================================================
LMINGW32 = $(CC) $(LF) -o $@ $(GAWKOBJS) $(LF2)
-PLMINGW32 = $(CC) $(LF) -o $@ $(PGAWKOBJS) $(LF2)
-DLMINGW32 = $(CC) $(LF) -o $@ $(DGAWKOBJS) $(LF2)
# The following might work around command-line length limitations:
#LMINGW32 = $(CC) $(LF) -o $@ *.o $(LF2)
mingw32:
$(MAK) all \
- CC=gcc O=.o CF="-O2 -gdwarf-2 -g3" OBJ=popen.o \
- LNK=LMINGW32 PLNK=PLMINGW32 DLNK=DLMINGW32 \
- LF="-gdwarf-2 -g3" LF2=-lmsvcp60 RSP=
+ CC=gcc O=.o CF="-D__USE_MINGW_ANSI_STDIO -O2 -gdwarf-2 -g3" \
+ OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" LF2=-lmsvcp60 RSP=
mingw32-readline:
$(MAK) all \
- CC=gcc O=.o CF="-DHAVE_LIBREADLINE -O2 -gdwarf-2 -g3" OBJ=popen.o \
- LNK=LMINGW32 PLNK=PLMINGW32 DLNK=DLMINGW32 \
- LF="-gdwarf-2 -g3" \
+ CC=gcc O=.o \
+ CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_LIBREADLINE -O2 -gdwarf-2 -g3" \
+ OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
LF2="-lreadline -lmsvcp60 -Wl,--enable-auto-import" RSP=
+mingw32-mpfr:
+ $(MAK) all \
+ CC=gcc O=.o \
+ CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_MPFR -O2 -gdwarf-2 -g3" \
+ OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
+ LF2="-lmpfr -lgmp -lmsvcp60 -Wl,--enable-auto-import" RSP=
+
+mingw32-readline-mpfr:
+ $(MAK) all \
+ CC=gcc O=.o \
+ CF="-D__USE_MINGW_ANSI_STDIO -DHAVE_LIBREADLINE -DHAVE_MPFR -O2 -gdwarf-2 -g3" \
+ OBJ=popen.o LNK=LMINGW32 LF="-gdwarf-2 -g3" \
+ LF2="-lmpfr -lgmp -lreadline -lmsvcp60 -Wl,--enable-auto-import" RSP=
+
# Define BIND for BINDless compiles, otherwise $($(BIND)) may break.
BIND = EMPTY
PBIND = EMPTY
EMPTY=
-# bitwise operations (-DBITOPS) and non-decimal input data (-DNONDECDATA) are
-# undocumented in 3.0.3. They may be enabled in config.h, or added to CFLAGS.
-CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H $(DYN_FLAGS)
+CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H
# object files
AWKOBJS1 = array$O builtin$O eval$O field$O floatcomp$O gawkmisc$O io$O main$O
-AWKOBJS2 = ext$O msg$O node$O profile$O re$O replace$O version$O $(DYN_OBJ)
-PAWKOBJS1 = array$O builtin$O eval_p$O field$O floatcomp$O gawkmisc$O io$O main$O
-PAWKOBJS2 = ext$O msg$O node$O profile_p$O re$O replace$O version$O $(DYN_OBJ)
-DAWKOBJS1 = array$O builtin$O debug$O eval_d$O field$O floatcomp$O gawkmisc$O io$O main$O
-DAWKOBJS2 = ext$O msg$O node$O profile$O re$O replace$O version$O command$O $(DYN_OBJ)
-AWKOBJS = $(AWKOBJS1) $(AWKOBJS2)
+AWKOBJS2 = ext$O msg$O node$O profile$O re$O replace$O version$O symbol$O
+AWKOBJS3 = debug$O cint_array$O int_array$O mpfr$O str_array$O command$O
+AWKOBJS = $(AWKOBJS1) $(AWKOBJS2) $(AWKOBJS3)
ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ)
@@ -201,8 +198,6 @@ ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ)
LIBOBJS= getopt$O getopt1$O dfa$O regex$O random$O
GAWKOBJS = $(ALLOBJS) $(LIBOBJS)
-PGAWKOBJS = $(PAWKOBJS1) $(PAWKOBJS2) $(LIBOBJS) awkgram$O getid$O $(OBJ)
-DGAWKOBJS = $(DAWKOBJS1) $(DAWKOBJS2) $(LIBOBJS) awkgram$O getid$O $(OBJ)
# clear out suffixes list
# .SUFFIXES:
@@ -212,52 +207,34 @@ DGAWKOBJS = $(DAWKOBJS1) $(DAWKOBJS2) $(LIBOBJS) awkgram$O getid$O $(OBJ)
$(CC) -c $(CFLAGS) $<
# rules to build gawk
-all : gawk.exe pgawk.exe dgawk.exe
+all : gawk.exe
gawk.exe:: $(GAWKOBJS) $(RSP)
$(DO_LNK)
$(DO_BIND)
-pgawk.exe:: $(PGAWKOBJS) $(PRSP)
- $(DO_PLNK)
- $(DO_PBIND)
-
-dgawk.exe:: $(DGAWKOBJS) $(DRSP)
- $(DO_DLNK)
- $(DO_DBIND)
-
$(RSPFILE) : $(GAWKOBJS)
echo $(AWKOBJS1)$P > $@
echo $(AWKOBJS2)$P >> $@
echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@
-$(PRSPFILE) : $(PGAWKOBJS)
- echo $(PAWKOBJS1)$P > $@
- echo $(PAWKOBJS2)$P >> $@
- echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@
-
-$(DRSPFILE) : $(DGAWKOBJS)
- echo $(DAWKOBJS1)$P > $@
- echo $(DAWKOBJS2)$P >> $@
- echo awkgram$O getid$O $(OBJ) $(LIBOBJS)$P >> $@
-
# Notes to dependencies:
# 1. The dependency on getopt.h is because unistd.h includes it,
# and we have -I. on the compiler command line. unistd.h is
# included by awk.h.
# 2. custom.h is not mentioned because pc ports don't use it.
-$(ALLOBJS) $(LIBOBJS) eval_p$O profile_p$O eval_d$O debug$O command$O: \
+$(ALLOBJS) $(LIBOBJS): \
awk.h regex.h config.h gettext.h mbsupport.h protos.h dfa.h getopt.h
builtin$O: floatmagic.h random.h popen.h
-random$O: floatmagic.h random.h
+random$O: random.h
-debug$O: floatmagic.h
+node$O: floatmagic.h
command$O debug$O: cmd.h
-dfa$O: xalloc.h
+dfa$O: xalloc.h
gawkmisc$O: pc/gawkmisc.pc
@@ -267,9 +244,7 @@ io$O: popen.h
regex$O: regcomp.c regexec.c regex_internal.h
-eval_p$O: eval.c
-
-profile_p$O: profile.c
+eval$O: interpret.h
# A bug in ndmake requires the following rule
awkgram$O: awk.h awkgram.c
@@ -300,7 +275,7 @@ install2:
gawk -v prefix=$(prefix) -f install.awk
clean:
- rm -rf gawk pgawk dgawk *.exe gawk.map *.o *.obj core a.out $(RSPFILE) $(PRSPFILE) $(DRSPFILE) $(DYN_EXP)
+ -rm -rf gawk *.exe gawk.map *.o *.obj core a.out $(RSPFILE) $(PRSPFILE) $(DRSPFILE) $(DYN_EXP)
# cd doc && $(MAKE) clean
# cd test && $(MAKE) clean
# cd awklib && $(MAKE) clean
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index c9aea454..09baaf32 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -67,7 +67,7 @@ AWK2 = '..\gawk.exe'
AWKPROG = ../gawk.exe
# Define PGAWK
-PGAWK = ../pgawk.exe
+PGAWK = ../gawk.exe -p
# Set your cmp command here (you can use most versions of diff instead of cmp
# if you don't want to convert the .ok files to the DOS CR/LF format).
@@ -187,6 +187,7 @@ GAWK_EXT_TESTS = \
EXTRA_TESTS = inftest regtest
INET_TESTS = inetdayu inetdayt inetechu inetecht
MACHINE_TESTS = double1 double2 fmtspcl intformat
+MPFR_TESTS = mpfrnr mpfrrnd mpfrieee mpfrexprange mpfrsort mpfrbigint
LOCALE_CHARSET_TESTS = \
asort asorti fmttest fnarydel fnparydl jarebug lc_num1 mbfw1 \
mbprintf1 mbprintf2 mbprintf3 rebt8b2 rtlenmb sort1 sprintfc
@@ -234,6 +235,8 @@ inet: inetmesg $(INET_TESTS)
machine-tests: $(MACHINE_TESTS)
+mpfr-tests: $(MPFR_TESTS)
+
msg::
@echo ""
@echo "Any output from $(CMP) is bad news, although some differences"
@@ -300,8 +303,8 @@ poundbang::
messages::
@echo $@
- @$(AWK) -f $(srcdir)/messages.awk >out2 2>out3
- @-$(CMP) $(srcdir)/out1.ok out1 && $(CMP) $(srcdir)/out2.ok out2 && $(CMP) $(srcdir)/out3.ok out3 && rm -f out1 out2 out3
+ @$(AWK) -f $(srcdir)/messages.awk >_out2 2>_out3
+ @-$(CMP) $(srcdir)/out1.ok _out1 && $(CMP) $(srcdir)/out2.ok _out2 && $(CMP) $(srcdir)/out3.ok _out3 && rm -f _out1 _out2 _out3
argarray::
@echo $@
@@ -361,7 +364,7 @@ argtest::
badargs::
@echo $@
- @-$(AWK) -f 2>&1 | grep -v patchlevel >_$@
+ @-$(AWK) -f 2>&1 | GREP_OPTIONS='' grep -v patchlevel >_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
nonl::
@@ -801,6 +804,36 @@ exit:
@-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+mpfrieee:
+ @echo mpfrieee
+ @$(AWK) -M -vPREC=double -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrexprange:
+ @echo mpfrexprange
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrrnd:
+ @echo mpfrrnd
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrnr:
+ @echo mpfrnr
+ @$(AWK) -M -vPREC=113 -f $(srcdir)/$@.awk $(srcdir)/$@.in > _$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrsort:
+ @echo mpfrsort
+ @$(AWK) -M -vPREC=53 -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
+mpfrbigint:
+ @echo mpfrbigint
+ @$(AWK) -M -f $(srcdir)/$@.awk > _$@ 2>&1
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
rri1::
@echo $@
@[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \
@@ -2056,7 +2089,7 @@ $(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests
$(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" $$files > $(srcdir)/Maketests
clean:
- rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~
+ rm -fr _* core core.* fmtspcl.ok junk strftime.ok test1 test2 seq *~
# An attempt to print something that can be grepped for in build logs
pass-fail:
diff --git a/pc/config.h b/pc/config.h
index 67c40a2f..0dbf1701 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -177,6 +177,9 @@
/* we have the mktime function */
#define HAVE_MKTIME 1
+/* Define to 1 if you have fully functional mpfr and gmp libraries. */
+#undef HAVE_MPFR
+
/* Define to 1 if you have the <netdb.h> header file. */
#undef HAVE_NETDB_H
@@ -413,7 +416,7 @@
#define PACKAGE_NAME "GNU Awk"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "GNU Awk 4.0.1b"
+#define PACKAGE_STRING "GNU Awk 4.0.71"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gawk"
@@ -422,7 +425,7 @@
#define PACKAGE_URL "http://www.gnu.org/software/gawk/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "4.0.1b"
+#define PACKAGE_VERSION "4.0.71"
/* Define to 1 if *printf supports %F format */
#undef PRINTF_HAS_F_FORMAT
@@ -484,7 +487,7 @@
/* Version number of package */
-#define VERSION "4.0.1b"
+#define VERSION "4.0.71"
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index b2a67a50..e2f114e4 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -31,6 +31,8 @@ char *defpath = DEFPATH;
# else
char *defpath = ".;c:\\lib\\awk;c:\\gnu\\lib\\awk";
# endif
+/* the Makefile should define DEFLIBPATH */
+char *deflibpath = DEFLIBPATH;
#ifdef __EMX__
#include<io.h>
@@ -230,6 +232,31 @@ int fd;
return (fstat(fd, &sbuf) == 0 && S_ISDIR(sbuf.st_mode));
}
+/* os_isreadable --- fd can be read from */
+
+int
+os_isreadable(const IOBUF_PUBLIC *iobuf, bool *isdir)
+{
+ *isdir = false;
+
+ switch (iobuf->sbuf.st_mode & S_IFMT) {
+ case S_IFREG:
+ case S_IFCHR: /* ttys, /dev/null, .. */
+#ifdef S_IFSOCK
+ case S_IFSOCK:
+#endif
+#ifdef S_IFIFO
+ case S_IFIFO:
+#endif
+ return true;
+ case S_IFDIR:
+ *isdir = true;
+ /* fall through */
+ default:
+ return false;
+ }
+}
+
/* os_is_setuid --- true if running setuid root */
int