aboutsummaryrefslogtreecommitdiffstats
path: root/pc
diff options
context:
space:
mode:
Diffstat (limited to 'pc')
-rw-r--r--pc/ChangeLog96
-rw-r--r--pc/Makefile107
-rw-r--r--pc/Makefile.tst153
-rw-r--r--pc/config.h58
-rw-r--r--pc/config.sed26
-rw-r--r--pc/gawkmisc.pc23
-rw-r--r--pc/testoutcmp.awk19
7 files changed, 338 insertions, 144 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog
index a5ce6002..1eb51812 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,7 +1,103 @@
+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.
+
+2012-03-20 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst (printfbad3): New test.
+
+2012-03-14 Eli Zaretskii <eliz@gnu.org>
+
+ * gawkmisc.pc (btowc): New version for DJGPP.
+
+2012-03-01 Scott Deifik <scottd.mail@sbcglobal.net>
+
+ * Makefile.tst: Sync with mainline version.
+
+2012-03-01 Eli Zaretskii <eliz@gnu.org>
+
+ * Makefile: Quiet confusing info messages from the linker when
+ gawk is linked against readline as a shared library.
+
+2012-02-22 Eli Zaretskii <eliz@gnu.org>
+
+ * Makefile.tst: Update CMP and CP definitions, add "Expect xxxx to
+ fail with MinGW" messages as needed.
+
+2012-02-15 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (execvp): Modify signature, return -1
+ on error.
+
+2012-02-11 Eli Zaretskii <eliz@gnu.org>
+
+ Fix dependencies in pc/Makefile.
+ * Makefile ($(ALLOBJS) $(LIBOBJS) eval_p$O profile_p$O): Add eval_d$O,
+ debug$O, and command$O.
+
+ Support MinGW build with the readline library.
+ * Makefile (default): Add a line for the mingw32-readline target.
+ (mingw32-readline): New target, passes -DHAVE_LIBREADLINE to the
+ compiler and adds -lreadline to the linker command line.
+
+ * config.sed: Comment out "#undef HAVE_LIBREADLINE", so that it
+ could be #define'd on the compiler command line.
+
+2012-02-10 Arnold D. Robbins <arnold@skeeve.com>
+
+ * gawkmisc.pc (execvp): New function based on code from Eli
+ Zaretskii to make dgawk's restarting the debugger work.
+
+2012-01-27 Scott Deifik <scottd.mail@sbcglobal.net>
+
+ * Makefile.tst: Sync with mainline version.
+
2011-12-12 Scott Deifik <scottd.mail@sbcglobal.net>
* Makefile.tst: Sync with mainline version.
diff --git a/pc/Makefile b/pc/Makefile
index 6156ce96..21fe0bfe 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -14,6 +14,11 @@ default:
@echo " emxnt ... NT exe [emx/gcc with RSXNT] "
@echo " emxbnd .. OS/2 and DOS 32-bit exe [emx/gcc] "
@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)/ "
@@ -37,8 +42,6 @@ default:
#======================= Configuration ==================================
RSPFILE = gawk.rsp
-PRSPFILE = pgawk.rsp
-DRSPFILE = dgawk.rsp
#
# Choose method for passing arguments to the linker.
#
@@ -48,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).
@@ -78,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.
@@ -95,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 =========================================
@@ -156,34 +149,54 @@ 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 \
+ 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="-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=
+
+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" LF2=-lmsvcp60 RSP=
+ LF="-gdwarf-2 -g3" \
+ LF2="-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)
@@ -192,8 +205,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:
@@ -203,52 +214,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: \
+$(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
@@ -258,9 +251,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
@@ -291,7 +282,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 f14341c8..ab566531 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -1,6 +1,6 @@
# Makefile for GNU Awk test suite.
#
-# Copyright (C) 1988-2011 the Free Software Foundation, Inc.
+# Copyright (C) 1988-2012 the Free Software Foundation, Inc.
#
# This file is part of GAWK, the GNU implementation of the
# AWK Programming Language.
@@ -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).
@@ -86,8 +86,8 @@ PGAWK = ../pgawk.exe
#CMP = cmp
# See the comment above for why you might want to set CMP to "env LFN=n diff"
#CMP = env LFN=n diff
-CMP = diff
-#CMP = diff -c
+#CMP = diff
+CMP = diff -u
#CMP = gcmp
# cmp replacement program for PC where the error messages aren't
@@ -96,9 +96,9 @@ TESTOUTCMP = $(AWK) -f ../testoutcmp.awk
# Set your "cp," "mv," and "mkdir" commands here. Note: DOS's copy must take
# forward slashes.
-#CP = cp
+CP = cp
#CP = : && command -c copy
-CP = command.com /c copy
+#CP = command.com /c copy
MV = cmd.exe /c ren
@@ -124,37 +124,43 @@ abs_builddir = .
# Get rid of core files when cleaning and generated .ok file
CLEANFILES = core core.* fmtspcl.ok
-# try to keep these sorted
+# try to keep these sorted. each letter starts a new line
BASIC_TESTS = \
addcomma anchgsub argarray arrayparm arrayprm2 arrayprm3 \
arrayref arrymem1 arryref2 arryref3 arryref4 arryref5 arynasty \
arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \
- aryprm8 arysubnm asgext awkpath back89 backgsub childin clobber \
- closebad clsflnam compare compare2 concat1 concat2 concat3 \
- concat4 convfmt datanonl defref delargv delarpm2 delarprm delfunc \
- dfastress dynlj eofsplit exitval1 exitval2 fcall_exit fcall_exit2 \
- fldchg fldchgnf fnamedat fnarray fnarray2 fnaryscl fnasgnm fnmisc \
- fordel forref forsimp fsbs fsrs fsspcoln fstabplus funsemnl funsmnam \
- funstack getline getline2 getline3 getline4 \
- getlnbuf getnr2tb getnr2tm \
+ aryprm8 arysubnm asgext awkpath \
+ back89 backgsub \
+ childin clobber closebad clsflnam compare compare2 concat1 concat2 \
+ concat3 concat4 convfmt \
+ datanonl defref delargv delarpm2 delarprm delfunc dfastress dynlj \
+ eofsplit exitval1 exitval2 \
+ fcall_exit fcall_exit2 fldchg fldchgnf fnamedat fnarray fnarray2 \
+ fnaryscl fnasgnm fnmisc fordel forref forsimp fsbs fsrs fsspcoln \
+ fstabplus funsemnl funsmnam funstack \
+ getline getline2 getline3 getline4 getlnbuf getnr2tb getnr2tm \
gsubasgn gsubtest gsubtst2 gsubtst3 gsubtst4 gsubtst5 gsubtst6 \
gsubtst7 gsubtst8 \
- hex hsprint inputred intest intprec iobug1 leaddig leadnl litoct \
- longsub longwrds manglprm math membug1 messages minusstr mmap8k \
- mtchi18n nasty nasty2 negexp negrange nested nfldstr nfneg \
- nfset nlfldsep nlinstr nlstrina noeffect nofile nofmtch noloop1 \
- noloop2 nonl noparms nors nulrsend numindex numsubstr octsub ofmt \
- ofmta ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup \
- paramres paramtyp parse1 parsefld parseme pcntplus posix2008sub \
- prdupval prec printf0 printf1 prmarscl prmreuse prt1eval prtoeval \
- rand range1 rebt8b1 redfilnm regeq regrange reindops reparse resplit \
- rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 rstest3 rstest4 \
- rstest5 rswhite scalar sclforin sclifin sortempty splitargv \
- splitarr splitdef splitvar splitwht strcat1 strnum1 strtod subamp \
- subi18n subsepnm subslash substr swaplns synerr1 synerr2 tradanch \
- tweakfld uninit2 uninit3 uninit4 uninit5 uninitialized unterm \
- uparrfs wideidx wideidx2 widesub widesub2 widesub3 widesub4 \
- wjposer1 zero2 zeroe0 zeroflag
+ hex hsprint \
+ inputred intest intprec iobug1 \
+ leaddig leadnl litoct longsub longwrds \
+ manglprm math membug1 messages minusstr mmap8k mtchi18n \
+ nasty nasty2 negexp negrange nested nfldstr nfneg nfset nlfldsep \
+ nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl \
+ noparms nors nulrsend numindex numsubstr \
+ octsub ofmt ofmta ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf \
+ paramdup paramres paramtyp parse1 parsefld parseme pcntplus \
+ posix2008sub prdupval prec printf0 printf1 prmarscl prmreuse \
+ prt1eval prtoeval \
+ rand range1 rebt8b1 redfilnm regeq regrange reindops reparse \
+ resplit rri1 rs rsnul1nl rsnulbig rsnulbig2 rstest1 rstest2 \
+ rstest3 rstest4 rstest5 rswhite \
+ scalar sclforin sclifin sortempty splitargv splitarr splitdef \
+ splitvar splitwht strcat1 strnum1 strtod subamp subi18n \
+ subsepnm subslash substr swaplns synerr1 synerr2 tradanch tweakfld \
+ uninit2 uninit3 uninit4 uninit5 uninitialized unterm uparrfs \
+ wideidx wideidx2 widesub widesub2 widesub3 widesub4 wjposer1 \
+ zero2 zeroe0 zeroflag
UNIX_TESTS = \
fflush getlnhd localenl pid pipeio1 pipeio2 poundbang rtlen rtlen01 \
@@ -162,15 +168,16 @@ UNIX_TESTS = \
GAWK_EXT_TESTS = \
aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \
- backw badargs beginfile1 beginfile2 \
- binmode1 clos1way delsub devfd devfd1 \
- devfd2 dumpvars exit fieldwdth fpat1 fpat2 fpat3 \
- fpatnull fsfwfs funlen \
+ backw badargs beginfile1 beginfile2 binmode1 \
+ clos1way delsub devfd devfd1 devfd2 dumpvars exit \
+ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \
fwtest fwtest2 fwtest3 \
gensub gensub2 getlndir gnuops2 gnuops3 gnureops \
- icasefs icasers igncdym igncfs ignrcas2 ignrcase indirectcall lint \
- lintold lintwarn manyfiles match1 match2 match3 mbstr1 nastyparm \
- next nondec nondec2 patsplit posix printfbad1 printfbad2 procinfs \
+ icasefs icasers igncdym igncfs ignrcas2 ignrcase indirectcall \
+ lint lintold lintwarn \
+ manyfiles match1 match2 match3 mbstr1 \
+ nastyparm next nondec nondec2 \
+ patsplit posix printfbad1 printfbad2 printfbad3 procinfs \
profile1 profile2 profile3 pty1 \
rebuf regx8bit reint reint2 rsstart1 \
rsstart2 rsstart3 rstest6 shadow sortfor sortu splitarg4 strftime \
@@ -179,6 +186,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 lc_num1 mbfw1 \
mbprintf1 mbprintf2 mbprintf3 rebt8b2 rtlenmb sort1 sprintfc
@@ -226,6 +234,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"
@@ -353,7 +363,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::
@@ -448,6 +458,7 @@ pipeio1::
pipeio2::
@echo $@
+ @echo Expect pipeio2 to fail with MinGW
@$(AWK) -v SRCDIR=$(srcdir) -f $(srcdir)/pipeio2.awk >_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -671,6 +682,7 @@ devfd1::
# The program text is the '1' which will print each record. How compact can you get?
devfd2::
@echo $@
+ @echo Expect devfd2 to fail in MinGW
@$(AWK) 1 /dev/fd/4 /dev/fd/5 4< $(srcdir)/devfd.in1 5< $(srcdir)/devfd.in2 >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -698,7 +710,7 @@ localenl::
mbprintf1::
@echo $@
- @echo Expect mbprintf1 to fail with DJGPP.
+ @echo Expect mbprintf1 to fail with DJGPP and MinGW.
@GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
$(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -717,7 +729,7 @@ mbprintf3::
mbfw1::
@echo $@
- @echo Expect mbfw1 to fail with DJGPP.
+ @echo Expect mbfw1 to fail with DJGPP and MinGW.
@GAWKLOCALE=en_US.UTF-8 ; export GAWKLOCALE ; \
$(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -740,13 +752,13 @@ printfbad2: printfbad2.ok
beginfile1::
@echo $@
- @echo Expect beginfile1 to fail with DJGPP
+ @echo Expect beginfile1 to fail with DJGPP and MinGW
@AWKPATH=$(srcdir) $(AWK) -f $@.awk $(srcdir)/$@.awk . ./no/such/file Makefile >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
beginfile2:
@echo $@
- @-( cd $(srcdir) && AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1
+ @-( cd $(srcdir) && LC_ALL=C AWK="$(abs_builddir)/$(AWKPROG)" $(srcdir)/$@.sh $(srcdir)/$@.in ) > _$@ 2>&1
# @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@-$(TESTOUTCMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -783,12 +795,49 @@ posix2008sub:
next:
@echo $@
@-AWK="$(AWKPROG)" $(srcdir)/$@.sh > _$@ 2>&1
- @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+ @-LC_ALL=C $(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
exit:
@echo $@
+ @echo Expect exit to fail with MinGW
@-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; \
+ AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
Gt-dummy:
# file Maketests, generated from Makefile.am by the Gentests program
addcomma:
@@ -998,6 +1047,7 @@ eofsplit:
exitval2:
@echo exitval2
+ @echo Expect exitval2 to fail with MinGW
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1163,6 +1213,7 @@ hex:
hsprint:
@echo hsprint
+ @echo Expect hsprint to fail with MinGW due to 3 digits in %e output
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1499,11 +1550,13 @@ rstest3:
rstest4:
@echo rstest4
+ @echo Expect rstest4 to fail with MinGW
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
rstest5:
@echo rstest5
+ @echo Expect rstest5 to fail with MinGW
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1772,7 +1825,7 @@ gensub2:
getlndir:
@echo getlndir
- @echo Expect getlndir to fail with DJGPP.
+ @echo Expect getlndir to fail with DJGPP and MinGW.
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1868,6 +1921,7 @@ patsplit:
posix:
@echo posix
+ @echo Expect posix to fail with MinGW due to 3 digits in e+NNN exponent
@AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1876,6 +1930,11 @@ printfbad1:
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+printfbad3:
+ @echo printfbad3
+ @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
+
procinfs:
@echo procinfs
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@@ -1883,7 +1942,7 @@ procinfs:
pty1:
@echo pty1
- @echo Expect pty1 to fail with DJGPP.
+ @echo Expect pty1 to fail with DJGPP and MinGW.
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1939,6 +1998,7 @@ double1:
double2:
@echo double2
+ @echo Expect double2 to fail with MinGW due to 3 digits in e+NNN exponents
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
@@ -1959,6 +2019,7 @@ asorti:
fmttest:
@echo fmttest
+ @echo Expect fmttest to fail with MinGW due to 3 digits in e+NNN exponents
@AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@
diff --git a/pc/config.h b/pc/config.h
index a9dac512..8b39a640 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -74,7 +74,7 @@
/* Define if you have the iconv() function and it works. */
#undef HAVE_ICONV
-/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */
+/* Define to 1 if the system has the type `intmax_t'. */
#ifdef __MINGW32__
#define HAVE_INTMAX_T 1
#endif
@@ -84,12 +84,6 @@
#define HAVE_INTTYPES_H 1
#endif
-/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and
- declares uintmax_t. */
-#ifdef __MINGW32__
-#define HAVE_INTTYPES_H_WITH_UINTMAX 1
-#endif
-
/* Define to 1 if you have the `isascii' function. */
#ifdef __MINGW32__
#define HAVE_ISASCII 1
@@ -123,7 +117,7 @@
#define HAVE_LIBM 1
/* Define to 1 if you have a fully functional readline library. */
-#undef HAVE_LIBREADLINE
+/* #undef HAVE_LIBREADLINE */
/* Define if you have the libsigsegv library. */
#undef HAVE_LIBSIGSEGV
@@ -136,11 +130,6 @@
#define HAVE_LOCALE_H 1
#endif
-/* Define if you have the 'long long' type. */
-#ifdef __MINGW32__
-#define HAVE_LONG_LONG 1
-#endif
-
/* Define to 1 if the system has the type `long long int'. */
#undef HAVE_LONG_LONG_INT
@@ -188,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
@@ -231,10 +223,6 @@
#define HAVE_STDINT_H 1
#endif
-/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
- uintmax_t. */
-#undef HAVE_STDINT_H_WITH_UINTMAX
-
/* Define to 1 if you have the <stdlib.h> header file. */
#ifdef __MINGW32__
#define HAVE_STDLIB_H 1
@@ -350,7 +338,7 @@
/* Define to 1 if you have the `tzset' function. */
#define HAVE_TZSET 1
-/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */
+/* Define to 1 if the system has the type `uintmax_t'. */
#if defined(DJGPP) || defined(__MINGW32__)
#define HAVE_UINTMAX_T 1
#ifdef DJGPP
@@ -363,9 +351,6 @@
#define HAVE_UNISTD_H 1
#endif
-/* Define if you have the 'unsigned long long' type. */
-#define HAVE_UNSIGNED_LONG_LONG 1
-
/* Define to 1 if the system has the type `unsigned long long int'. */
#undef HAVE_UNSIGNED_LONG_LONG_INT
@@ -425,7 +410,7 @@
#define PACKAGE_NAME "GNU Awk"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "GNU Awk 4.0.0f"
+#define PACKAGE_STRING "GNU Awk 4.0.70"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gawk"
@@ -434,7 +419,7 @@
#define PACKAGE_URL "http://www.gnu.org/software/gawk/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "4.0.0f"
+#define PACKAGE_VERSION "4.0.70"
/* Define to 1 if *printf supports %F format */
#undef PRINTF_HAS_F_FORMAT
@@ -496,7 +481,12 @@
/* Version number of package */
-#define VERSION "4.0.0f"
+#define VERSION "4.0.70"
+
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
/* Number of bits in a file offset, on hosts where this is settable. */
#undef _FILE_OFFSET_BITS
@@ -507,6 +497,19 @@
/* Define to 1 if on MINIX. */
#undef _MINIX
+/* The _Noreturn keyword of C11. */
+#ifndef _Noreturn
+# if (3 <= __GNUC__ || (__GNUC__ == 2 && 8 <= __GNUC_MINOR__) \
+ || 0x5110 <= __SUNPRO_C)
+# define _Noreturn __attribute__ ((__noreturn__))
+# elif defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn
+# endif
+#endif
+
+
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
#undef _POSIX_1_SOURCE
@@ -533,7 +536,8 @@
#endif
#endif
-/* Define to long or long long if <inttypes.h> and <stdint.h> don't define. */
+/* Define to the widest signed integer type if <stdint.h> and <inttypes.h> do
+ not define. */
#ifdef DJGPP
#define intmax_t long long
#endif
@@ -569,8 +573,8 @@
/* Define to `int' if <sys/types.h> doesn't define. */
#undef uid_t
-/* Define to unsigned long or unsigned long long if <stdint.h> and
- <inttypes.h> don't define. */
+/* Define to the widest unsigned integer type if <stdint.h> and <inttypes.h>
+ do not define. */
#ifdef DJGPP
#define uintmax_t unsigned long long
#endif
diff --git a/pc/config.sed b/pc/config.sed
index 7fe0f922..5e57e82b 100644
--- a/pc/config.sed
+++ b/pc/config.sed
@@ -29,7 +29,7 @@
s/^#undef GETPGRP_VOID *$/#define GETPGRP_VOID 1/
s/^#undef GETGROUPS_T *$/#define GETGROUPS_T gid_t/
/^#undef GETPGRP_VOID$/c\
-#ifdef DJGPP\
+#ifdef __DJGPP__\
#define GETPGRP_VOID 1\
#endif
s/^#undef HAVE_ALARM *$/#define HAVE_ALARM 1/
@@ -73,6 +73,8 @@ s/^#undef HAVE_FMOD *$/#define HAVE_FMOD 1/
#define HAVE_ISWUPPER 1\
#endif
s/^#undef HAVE_LIBM *$/#define HAVE_LIBM 1/
+/^#undef HAVE_LIBREADLINE *$/c\
+/* #undef HAVE_LIBREADLINE */
s/^#undef HAVE_LIMITS_H *$/#define HAVE_LIMITS_H 1/
/^#undef HAVE_LOCALE_H *$/c\
#ifdef __MINGW32__\
@@ -98,7 +100,7 @@ s/^#undef HAVE_MEMCPY *$/#define HAVE_MEMCPY 1/
#endif
s/^#undef HAVE_MEMSET *$/#define HAVE_MEMSET 1/
/^#undef HAVE_MKSTEMP *$/c\
-#ifdef DJGPP\
+#ifdef __DJGPP__\
#define HAVE_MKSTEMP 1\
#endif
s/^#undef HAVE_MKTIME *$/#define HAVE_MKTIME 1/
@@ -158,7 +160,7 @@ s/^#undef HAVE_SYSTEM *$/#define HAVE_SYSTEM 1/
#define HAVE_SYS_STAT_H 1\
#endif
/^#undef HAVE_SYS_TIME_H *$/c\
-#if defined(DJGPP) || defined(__MINGW32__)\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
#define HAVE_SYS_TIME_H 1\
#endif
s/^#undef HAVE_SYS_TYPES_H *$/#define HAVE_SYS_TYPES_H 1/
@@ -173,19 +175,19 @@ s/^#undef HAVE_SYS_TYPES_H *$/#define HAVE_SYS_TYPES_H 1/
s/^#undef HAVE_TZNAME *$/#define HAVE_TZNAME 1/
s/^#undef HAVE_TZSET *$/#define HAVE_TZSET 1/
/^#undef HAVE_UINTMAX_T *$/c\
-#if defined(DJGPP) || defined(__MINGW32__)\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
#define HAVE_UINTMAX_T 1\
-#ifdef DJGPP\
+#ifdef __DJGPP__\
#define uintmax_t unsigned long long\
#endif\
#endif
/^#undef HAVE_UNISTD_H *$/c\
-#if defined(DJGPP) || defined(__MINGW32__)\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
#define HAVE_UNISTD_H 1\
#endif
s/^#undef HAVE_UNSIGNED_LONG_LONG *$/#define HAVE_UNSIGNED_LONG_LONG 1/
/^#undef HAVE_USLEEP *$/c\
-#if defined(DJGPP) || defined(__MINGW32__)\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
#define HAVE_USLEEP 1\
#endif
s/^#undef HAVE_VPRINTF *$/#define HAVE_VPRINTF 1/
@@ -221,7 +223,7 @@ s/^#undef PROTOTYPES *$/#define PROTOTYPES 1/
s/^#undef RETSIGTYPE *$/#define RETSIGTYPE void/
/^#.*RETSIGTYPE /a\
\
-#if defined(DJGPP) || defined(__MINGW32__)\
+#if defined(__DJGPP__) || defined(__MINGW32__)\
#include <limits.h>\
#endif
/^#undef SIZEOF_UNSIGNED_INT *$/c\
@@ -241,15 +243,15 @@ s/^#undef TIME_WITH_SYS_TIME *$/#define TIME_WITH_SYS_TIME 1/
#define inline __inline__\
#endif
/^#undef intmax_t *$/c\
-#ifdef DJGPP\
+#ifdef __DJGPP__\
#define intmax_t long long\
#endif
/^#undef restrict *$/c\
-#ifdef DJGPP\
+#ifdef __DJGPP__\
#define restrict\
#endif
/^#undef uintmax_t *$/c\
-#ifdef DJGPP\
+#ifdef __DJGPP__\
#define uintmax_t unsigned long long\
#endif
@@ -263,7 +265,7 @@ $a\
# define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk"\
#endif\
\
-#ifndef DJGPP\
+#ifndef __DJGPP__\
#define HAVE_POPEN_H 1\
#endif\
\
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index cb1e209a..b368e81f 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -3,7 +3,7 @@
*/
/*
- * Copyright (C) 1986, 1988, 1989, 1991 - 2003 the Free Software Foundation, Inc.
+ * Copyright (C) 1986, 1988, 1989, 1991 - 2003, 2012 the Free Software Foundation, Inc.
*
* This file is part of GAWK, the GNU implementation of the
* AWK Progamming Language.
@@ -571,6 +571,19 @@ wctob (wint_t wc)
return EOF;
}
+/*
+ * On MS-Windows with MinGW, execvp causes the shell and the re-exec'ed
+ * dgawk to compete for the keyboard input.
+ *
+ * This will need work if we ever need a real version of execvp.
+ */
+int execvp(const char *file, const char *const *argv)
+{
+ if (_spawnvp(_P_WAIT, file, (const char * const *)argv) != -1)
+ exit(EXIT_SUCCESS);
+
+ return -1;
+}
#endif /* __MINGW32__ */
#ifdef __DJGPP__
@@ -584,4 +597,12 @@ unsetenv (const char *name)
return putenv (name);
}
+/* This is needed to defeat too-clever GCC warnings in dfa.c about
+ comparison being always false due to limited range of data type. */
+wint_t
+btowc (int c)
+{
+ return c;
+}
+
#endif /* __DJGPP__ */
diff --git a/pc/testoutcmp.awk b/pc/testoutcmp.awk
index ff190155..33dcaa3f 100644
--- a/pc/testoutcmp.awk
+++ b/pc/testoutcmp.awk
@@ -1,5 +1,24 @@
# cmp replacement program for PC where the error messages aren't
# exactly the same. should run even on old awk
+#
+# Copyright (C) 2011 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 3 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
{
if (FNR == NR)