diff options
Diffstat (limited to 'pc')
-rw-r--r-- | pc/ChangeLog | 123 | ||||
-rw-r--r-- | pc/Makefile | 23 | ||||
-rw-r--r-- | pc/Makefile.tst | 295 | ||||
-rw-r--r-- | pc/config.h | 190 | ||||
-rw-r--r-- | pc/dlfcn.c | 2 | ||||
-rw-r--r-- | pc/dlfcn.h | 2 | ||||
-rw-r--r-- | pc/gawkmisc.pc | 2 | ||||
-rw-r--r-- | pc/popen.c | 22 | ||||
-rw-r--r-- | pc/popen.h | 2 |
9 files changed, 577 insertions, 84 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog index e62fad7c..962a4cf8 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,126 @@ +Mon Oct 22 08:49:05 2007 Arnold D. Robbins <arnold@skeeve.com> + + * Release 3.1.6: Release tar file made. + +Sat Oct 20 22:42:08 2007 Scott Deifik <scottd.mail@sbcglobal.net> + + * Makefile.tst: Sync with mainline, Revise inftest. + +Fri Oct 19 05:37:37 2007 Scott Deifik <scottd.mail@sbcglobal.net> + + * config.h: Add definition of HAVE_ATEXIT. Needed for replacement + sprintf. + +Thu Oct 4 21:19:54 2007 Juan M. Guerrero <juan.guerrero@gmx.de> + + * Makefile.tst (fmtspcl.ok): Remove unneeded dependency on Makefile. + +Wed Sep 26 15:10:17 2007 Scott Deifik <scottd.mail@sbcglobal.net> + + * Makefile.tst (poundbang): Fix path in call to gawk. + (nofile): Fix output message with sed to match what test suite wants. + +Wed Sep 26 14:46:34 2007 Eli Zaretskii <eliz@gnu.org> + + * Makefile.tst (msg): Use $(CMP) instead a literal "cmp". + (nonl): Use NUL instead of /dev/null. + (devfd, pid, fmtspcl, nofile, rstest4, rstest5, getlnhd, clos1way): + Expect to fail on MinGW. + (fmtspcl.ok): Depend on Makefile, not Makefile.tst. + (pipeio2, hsprint, fmttest): Expect formatting or whitespace + differences. + (exitval2): Use exitval2.w32 instead of exitval2.awk. + + * config.h (HAVE_DECL_TZNAME) [__MINGW32__]: Define. + (HAVE_ALLOCA) [__MINGW32__]: Don't define. + (HAVE_SNPRINTF) [__MINGW32__]: Remove _MSC_VER condition. + +Tue Sep 25 08:22:11 2007 KIMURA Koichi <kimura.koichi@canon.co.jp> + + * config.h: For Visual Studio, undef restrict, define HAVE_TMPFILE, + undef TIME_WITH_SYS_TIME. + +Mon May 21 05:46:46 2007 Scott Deifik <scottd.mail@sbcglobal.net> + + * config.h (HAVE_MKTIME): Define. + +Wed May 16 22:12:55 2007 Scott Deifik <scottd.mail@sbcglobal.net> + + * Makfile.tst: Changes for DJGPP, bring in sync with main + test/Makefile. + +Wed May 9 21:01:18 2007 Scott Deifik <scottd.mail@sbcglobal.net> + + DJGPP changes: + + * config.h: Add HAVE_MKTME, HAVE_MKSTEMP, conditionalize + HAVE_SNPRINTF. (ADR: #define out restrict). + * Makefile: Add replace$0 to AWKOBJS2 and PAWKOBJS2. + +2007-03-19 Juan M. Guerrero <juan.guerrero@gmx.de> + + * config.h: Undef HAVE_ALLOCA for DJGPP. + * Makefile: Add floatcomp$O to AWKOBJS1 and PAWKOBJS1. + +2007-02-25 Juan M. Guerrero <juan.guerrero@gmx.de> + + * config.h: Let DEFPATH reflect DJGPP installation directory tree. + * Makefile: pkgdatadir variable defined to $(prefix)/lib/awk. + * Makefile: In DJGPP section use the DJGPP environment variable to + redefine the pkgdatadir variable. + +2006-07-22 Eli Zaretskii <eliz@gnu.org> + + * Makefile.tst: Update copyright years. + (COMSPEC): If it's empty, use ComSpec instead. + (CMP): Ignore white space differences. + (BASIC_TESTS): Add concat4, nofile, ovrflow1, subi18n. + (GAWK_EXT_TESTS): Add binmode1, devfd1, devfd2, fwtest, nondec2. + (msg): Use $(CMP) instead of literal "cmp". + (inftest): Uncomment the test. + (nonl): Use NUL, so it works with any DOS/Windows shell. + (fsspcoln): Run `head' though the system shell. + (nondec2, nofile, binmode1, subi18n, concat4, devfd1, devfd2) + (ovrflow1, fwtest, mixed1): New tests. + (fmttest, hsprint, ovrflow1, posix): Run output through Sed to + adjust the number of leading zeros in the exponent produced by %e. + (longwrds): Set SORT to just "sort". + (exitval2): Use exitval2.w32. + +2006-07-01 Eli Zaretskii <eliz@gnu.org> + + * popen.h (os_popen): Declare 1st argument "const char *". + + * popen.c (scriptify): Declare argument "const char *". + (os_system): Declare argument "const char *". Add a new local + variable cmd1 to hold the results of scriptify. + (os_popen): Declare 1st argument "const char *". Add a new local + variable cmd to hold the results of scriptify. + + * Makefile (mingw32): Update definitions for CF, LF, and LF2. Use + libmsvcrtp60 during linking (for multibyte and wide character + support). + (io$O): Depend on popen.h. + + * config.h (HAVE_BTOWC) [_WIN32]: Define. + (HAVE_INTMAX_T, HAVE_UINTMAX_T, HAVE_INTTYPES_H, HAVE_STDINT_H) + (HAVE_INTTYPES_H_WITH_UINTMAX, HAVE_ISASCII, HAVE_ISWCTYPE) + (HAVE_ISWLOWER, HAVE_ISWUPPER, HAVE_LONG_LONG, HAVE_MBRLEN) + (HAVE_MBRTOWC, HAVE_TOWLOWER, HAVE_TOWUPPER, HAVE_WCHAR_H) + (HAVE_WCRTOMB, HAVE_WCSCOLL, HAVE_WCTYPE, HAVE_WCTYPE_H) + (HAVE_WCTYPE_T, HAVE_WINT_T) [__MINGW32__]: Define. + (inline) [__GNUC__]: Define to __inline__. + (HAVE_MEMMOVE, HAVE_PUTENV, HAVE_SETLOCALE, HAVE_LOCALE_H) + (HAVE_SNPRINTF, HAVE_STRTOUL, HAVE_STDLIB_H, HAVE_SYS_STAT_H) + (HAVE_SYS_TIME_H, HAVE_UNSIGNED_LONG_LONG) [__MINGW32__]: Define. + (HAVE_UNISTD_H): Define also for __MINGW32__. + (PACKAGE_BUGREPORT, PACKAGE_NAME, PACKAGE_STRING) + (PACKAGE_TARNAME, PACKAGE_VERSION): Define. + (VERSION): Update. + [__MINGW32__]: Include <limits.h>. + (HAVE_POPEN_H): Define as 1. + (ssize_t, intmax_t, uintmax_t): Don't redefine for __MINGW32__. + Tue Jul 26 21:46:16 2005 Arnold D. Robbins <arnold@skeeve.com> * Release 3.1.5: Release tar file made. diff --git a/pc/Makefile b/pc/Makefile index ad14baaf..585e66ab 100644 --- a/pc/Makefile +++ b/pc/Makefile @@ -73,6 +73,7 @@ MAK = $(MAKE) $(MAKEFILE) # edit config.h so that $(prefix)/lib/awk appears as part of DEFPATH. #prefix = prefix = c:/gnu +pkgdatadir = $(prefix)/lib/awk # # Define the install method. Method 1 is Unix-like (and requires cat, # cp, mkdir, sed, and sh); method 2 uses gawk and batch files. @@ -106,6 +107,10 @@ DO_PBIND= $($(PBIND)) #========================== DJGPP ======================================= #======================================================================== +ifneq ($(DJGPP),) +prefix = $(DJDIR) +pkgdatadir = $(prefix)/share/awk +endif LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2) PLDJG = $(CC) $(LF) -o pgawk.exe $(PLDRSP) $(LF2) BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk @@ -185,8 +190,8 @@ PLMINGW32 = $(CC) $(LF) -o $@ $(PGAWKOBJS) $(LF2) mingw32: $(MAK) all \ - CC=gcc O=.o CF=-O OBJ=popen.o \ - LNK=LMINGW32 PLNK=PLMINGW32 LF=-s RSP= + CC=gcc O=.o CF="-O2 -gdwarf-2 -g3" OBJ=popen.o \ + LNK=LMINGW32 PLNK=PLMINGW32 LF="-gdwarf-2 -g3" LF2=-lmsvcp60 RSP= #======================================================================== #========================== MSC ========================================= @@ -313,10 +318,10 @@ EMPTY= CFLAGS = $(CF) -DGAWK -I. -DHAVE_CONFIG_H $(DYN_FLAGS) # object files -AWKOBJS1 = array$O builtin$O eval$O field$O gawkmisc$O io$O main$O -AWKOBJS2 = ext$O msg$O node$O profile$O re$O version$O $(DYN_OBJ) -PAWKOBJS1 = array$O builtin$O eval_p$O field$O gawkmisc$O io$O main$O -PAWKOBJS2 = ext$O msg$O node$O profile_p$O re$O version$O $(DYN_OBJ) +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) AWKOBJS = $(AWKOBJS1) $(AWKOBJS2) ALLOBJS = $(AWKOBJS) awkgram$O getid$O $(OBJ) @@ -364,6 +369,8 @@ getopt$O: getopt.h getopt1$O: getopt.h +io$O: popen.h + gawk.exp: gawkw32.def $(DYN_MAKEXP) @@ -389,9 +396,9 @@ install1: cat pc/awklib/igawk >> igawk.cmd sed "s;igawk;$(prefix)/bin/igawk;" pc/awklib/igawk.bat > igawk.bat sh mkinstal.sh $(prefix)/bin - sh mkinstal.sh $(prefix)/lib/awk $(prefix)/man/man1 $(prefix)/info + sh mkinstal.sh $(pkgdatadir) $(prefix)/man/man1 $(prefix)/info cp *awk.exe igawk.bat igawk.cmd pc/awklib/igawk $(prefix)/bin - cp awklib/eg/lib/* pc/awklib/igawk.awk $(prefix)/lib/awk + cp awklib/eg/lib/* pc/awklib/igawk.awk $(pkgdatadir) cp doc/*.1 $(prefix)/man/man1 cp doc/gawk.info $(prefix)/info diff --git a/pc/Makefile.tst b/pc/Makefile.tst index 8c32dd80..b5953a12 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -1,13 +1,13 @@ # Makefile for GNU Awk test suite. # -# Copyright (C) 1988-2004 the Free Software Foundation, Inc. +# Copyright (C) 1988-2007 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 +# 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, @@ -111,46 +111,50 @@ PATH_SEPARATOR = ; srcdir = . -# Get rid of core files when cleaning -CLEANFILES = core core.* +# Get rid of core files when cleaning and generated .ok file +CLEANFILES = core core.* fmtspcl.ok # try to keep these sorted BASIC_TESTS = addcomma anchgsub argarray arrayparm arrayref arrymem1 \ arrayprm2 arrayprm3 arryref2 arryref3 arryref4 arryref5 arynasty \ arynocls aryprm1 aryprm2 aryprm3 aryprm4 aryprm5 aryprm6 aryprm7 \ aryprm8 arysubnm asgext awkpath back89 backgsub childin clobber \ - clsflnam compare compare2 concat1 concat2 concat3 convfmt datanonl defref \ - delarprm delarpm2 delfunc dynlj eofsplit exitval1 exitval2 fldchg fldchgnf fmttest fnamedat \ + clsflnam compare compare2 concat1 concat2 concat3 concat4 convfmt datanonl defref \ + delarprm delarpm2 delfunc dynlj eofsplit exitval1 exitval2 fldchg fldchgnf fmtspcl fmttest fnamedat \ fnarray fnarray2 fnarydel fnaryscl fnasgnm fnmisc fnparydl \ fordel forsimp fsbs fsspcoln fsrs fstabplus funsemnl funsmnam funstack getline \ getline2 getline3 getlnbuf getnr2tb getnr2tm gsubasgn gsubtest \ - gsubtst2 gsubtst3 gsubtst4 gsubtst5 hex hsprint inputred intest \ + gsubtst2 gsubtst3 gsubtst4 gsubtst5 hex hsprint inputred intest intformat \ intprec iobug1 leaddig leadnl litoct longsub longwrds manglprm math membug1 \ - messages minusstr mmap8k nasty nasty2 negexp nested nfldstr \ - nfneg nfset nlfldsep nlinstr nlstrina noeffect nofmtch noloop1 \ + messages minusstr mmap8k mtchi18n nasty nasty2 negexp nested nfldstr \ + nfneg nfset nlfldsep nlinstr nlstrina noeffect nofile nofmtch noloop1 \ noloop2 nonl noparms nors nulrsend numindex numsubstr octsub ofmt \ - ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf paramdup paramtyp \ - parseme pcntplus prdupval prec printf0 printf1 prmarscl prmreuse \ + ofmtbig ofmtfidl ofmts onlynl opasnidx opasnslf ovrflow1 paramdup paramtyp \ + parse1 parsefld parseme pcntplus prdupval prec printf0 printf1 prmarscl prmreuse \ prt1eval prtoeval psx96sub rand rebt8b1 rebt8b2 redfilnm regeq \ reindops reparse resplit rs rsnul1nl rsnulbig rsnulbig2 rstest1 \ rstest2 rstest3 rstest4 rstest5 rswhite scalar sclforin sclifin \ sortempty splitargv splitarr splitdef splitvar splitwht sprintfc \ - strcat1 strtod subamp subsepnm subslash substr swaplns synerr1 tradanch \ - tweakfld uninit2 uninit3 uninit4 uninitialized unterm wjposer1 \ - zeroe0 zeroflag - -UNIX_TESTS = fflush getlnhd pid pipeio1 pipeio2 poundbang space strftlng -GAWK_EXT_TESTS = argtest asort asorti backw badargs clos1way fieldwdth fsfwfs \ - gensub gensub2 gnuops2 gnuops3 gnureops icasefs icasers igncdym igncfs ignrcase \ - ignrcas2 lint match1 match2 manyfiles nondec posix procinfs \ - printfbad1 regx8bit rebuf reint rsstart1 rsstart2 rsstart3 \ - rstest6 shadow sort1 strtonum strftime whiny + strcat1 strtod strnum1 subamp subi18n subsepnm subslash substr swaplns \ + synerr1 synerr2 tradanch \ + tweakfld uninit2 uninit3 uninit4 uninitialized unterm wideidx wideidx2 \ + widesub widesub2 widesub3 widesub4 wjposer1 zeroe0 zeroflag zero2 + +UNIX_TESTS = fflush getlnhd localenl pid pipeio1 pipeio2 poundbang space strftlng +GAWK_EXT_TESTS = argtest asort asorti backw badargs binmode1 clos1way devfd devfd1 devfd2 double1 double2 \ + fieldwdth fsfwfs fwtest fwtest2 gensub gensub2 gnuops2 gnuops3 gnureops icasefs \ + icasers igncdym igncfs ignrcase ignrcas2 lint lintold match1 match2 manyfiles \ + nondec nondec2 posix procinfs printfbad1 regx8bit rebuf reint reint2 rsstart1 \ + rsstart2 rsstart3 rstest6 shadow sort1 strtonum strftime whiny EXTRA_TESTS = regtest inftest INET_TESTS = inetechu inetecht inetdayu inetdayt # List of the tests which should be run with --lint option: -NEED_LINT = defref noeffect nofmtch shadow uninit2 uninit3 uninit4 uninitialized +NEED_LINT = defref fmtspcl noeffect nofmtch shadow uninit2 uninit3 uninit4 uninitialized + +# List of the tests which should be run with --lint-old option: +NEED_LINT_OLD = lintold # List of the files that appear in manual tests or are for reserve testing: GENTESTS_UNUSED = Makefile.in gtlnbufv.awk printfloat.awk switch2.awk @@ -177,11 +181,11 @@ extra: $(EXTRA_TESTS) inetmesg inet: inetmesg $(INET_TESTS) msg:: - @echo '' - @echo 'Any output from "cmp" is bad news, although some differences' - @echo 'in floating point values are probably benign -- in particular,' - @echo 'some systems may omit a leading zero and the floating point' - @echo 'precision may lead to slightly different output in a few cases.' + @echo "" + @echo "Any output from $(CMP) is bad news, although some differences" + @echo "in floating point values are probably benign -- in particular," + @echo "some systems may omit a leading zero and the floating point" + @echo "precision may lead to slightly different output in a few cases." printlang:: @$(AWK) -f $(srcdir)/printlang.awk @@ -216,7 +220,7 @@ poundbang:: @if ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@` ; \ then : ; \ else \ - sed "s;/tmp/gawk;../$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk ; \ + sed "s;/tmp/gawk;./$(AWKPROG);" < $(srcdir)/poundbang.awk > ./_pbd.awk ; \ chmod +x ./_pbd.awk ; \ LC_ALL=$${GAWKLOCALE:-C} LANG=$${GAWKLOCALE:-C} ./_pbd.awk $(srcdir)/poundbang.awk > _`basename $@`; \ fi @@ -244,7 +248,7 @@ regtest:: @echo 'Some of the output from regtest is very system specific, do not' @echo 'be distressed if your output differs from that distributed.' @echo 'Manual inspection is called for.' - AWK=`pwd`/$(AWK) $(srcdir)/regtest.sh + AWK=$(AWKPROG) $(srcdir)/regtest.sh manyfiles:: @echo manyfiles @@ -263,10 +267,10 @@ compare:: inftest:: @echo $@ @echo This test is very machine specific... - @echo This sometimes seems to cause problems for MSC gawk, so do not - @echo run it. -# @$(AWK) -f $(srcdir)/inftest.awk | sed "s/inf/Inf/g" >_$@ -# @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ + @echo This sometimes seems to cause problems for MSC gawk. + @echo Expect inftest to fail with DJGPP. + @$(AWK) -f $(srcdir)/inftest.awk | sed "s/inf/Inf/g" >_$@ + @-$(CMP) $(srcdir)/inftest.ok _$@ && rm -f _$@ getline2:: @echo $@ @@ -290,7 +294,7 @@ badargs:: nonl:: @echo $@ - @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk /dev/null >_$@ 2>&1 + @-AWKPATH=$(srcdir) $(AWK) --lint -f nonl.awk NUL >_$@ 2>&1 @-$(CMP) $(srcdir)/nonl.ok _$@ && rm -f _$@ strftime:: @@ -310,6 +314,12 @@ litoct:: @echo ab | $(AWK) --traditional -f $(srcdir)/litoct.awk >_$@ @-$(CMP) $(srcdir)/litoct.ok _$@ && rm -f _$@ +devfd:: + @echo $@ + @echo Expect devfd to fail in MinGW + @$(AWK) 1 /dev/fd/4 /dev/fd/5 4<$(srcdir)/devfd.in4 5<$(srcdir)/devfd.in5 >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + fflush:: @echo $@ @$(srcdir)/fflush.sh >_$@ @@ -335,9 +345,9 @@ tradanch:: # command so that pid.sh is fork'ed as a child before being exec'ed. pid:: @echo pid - @echo Expect pid to fail with DJGPP. + @echo Expect pid to fail with DJGPP and MinGW. @AWKPATH=$(srcdir) AWK=$(AWKPROG) $(SHELL) $(srcdir)/pid.sh $$$$ > _`basename $@` ; : - @-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` _`basename $@`.in + @-$(CMP) $(srcdir)/pid.ok _`basename $@` && rm -f _`basename $@` strftlng:: @echo $@ @@ -352,6 +362,15 @@ nors:: @echo A B C D E | tr -d '\12\15' | $(AWK) '{ print $$NF }' - $(srcdir)/nors.in > _$@ @-$(CMP) $(srcdir)/nors.ok _$@ && rm -f _$@ +fmtspcl.ok: fmtspcl.tok + @$(AWK) -v "sd=$(srcdir)" 'BEGIN {pnan = sprintf("%g",sqrt(-1)); nnan = sprintf("%g",-sqrt(-1)); pinf = sprintf("%g",-log(0)); ninf = sprintf("%g",log(0))} {sub(/positive_nan/,pnan); sub(/negative_nan/,nnan); sub(/positive_infinity/,pinf); sub(/negative_infinity/,ninf); sub(/fmtspcl/,(sd"/fmtspcl")); print}' < $(srcdir)/fmtspcl.tok > $@ 2>/dev/null + +fmtspcl: fmtspcl.ok + @echo fmtspcl + @echo Expect $@ to fail with MinGW + @$(AWK) -f $(srcdir)/fmtspcl.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $@.ok _$@ && rm -f _$@ + reint:: @echo $@ @$(AWK) --re-interval -f $(srcdir)/reint.awk $(srcdir)/reint.in >_$@ @@ -359,6 +378,7 @@ reint:: pipeio1:: @echo $@ + @echo Expect $@ to produce insignificant whitespace differences @$(AWK) -f $(srcdir)/pipeio1.awk >_$@ @rm -f test1 test2 @-$(CMP) $(srcdir)/pipeio1.ok _$@ && rm -f _$@ @@ -455,6 +475,42 @@ whiny:: @WHINY_USERS=1 $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +wideidx:: + @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 _$@ + +wideidx2:: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +widesub:: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +widesub2:: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +widesub3:: + @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 _$@ + +widesub4:: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + ignrcas2:: @echo $@ @GAWKLOCALE=en_US ; export GAWKLOCALE ; \ @@ -493,6 +549,68 @@ rsstart3:: @echo $@ @head $(srcdir)/rsstart1.in | $(AWK) -f $(srcdir)/rsstart2.awk >_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +nondec2:: + @echo $@ + @$(AWK) --non-decimal-data -v a=0x1 -f $(srcdir)/$@.awk >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +nofile:: + @echo $@ + @$(AWK) '{}' no/such/file >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @sed "s/ (ENOENT)//" _$@ > _$@.2 + @rm -f _$@ +# @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + @-$(CMP) $(srcdir)/$@.ok _$@.2 && rm -f _$@.2 + +binmode1:: + @echo $@ + @$(AWK) -v BINMODE=3 'BEGIN { print BINMODE }' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +subi18n:: + @echo $@ + @GAWKLOCALE=en_US.UTF-8 ; $(AWK) -f $(srcdir)/$@.awk > _$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +concat4:: + @echo $@ + @GAWKLOCALE=en_US.UTF-8 ; $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in > _$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +devfd1:: + @echo $@ + @echo Expect devfd1 to fail in MinGW + @$(AWK) -f $(srcdir)/$@.awk 4< $(srcdir)/devfd.in1 5< $(srcdir)/devfd.in2 >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +# The program text is the '1' which will print each record. How compact can you get? +devfd2:: + @echo $@ + @$(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 _$@ + +mixed1:: + @echo $@ + @$(AWK) -f /dev/null --source 'BEGIN {return junk}' >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +mtchi18n:: + @echo $@ + @GAWKLOCALE=ru_RU.UTF-8 ; export GAWKLOCALE ; \ + $(AWK) -f $(srcdir)/$@.awk $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >> _$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +reint2:: + @echo $@ + @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ + AWKPATH=$(srcdir) $(AWK) --re-interval -f $@.awk $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +localenl:: + @echo $@ + @$(srcdir)/$@.sh >_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: @@ -687,7 +805,7 @@ eofsplit: exitval2: @echo exitval2 - @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH=$(srcdir) $(AWK) -f $@.w32 >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ fldchg: @@ -702,7 +820,8 @@ fldchgnf: fmttest: @echo fmttest - @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @echo Expect $@ to produce insignificant formatting differences + @AWKPATH=$(srcdir) $(AWK) -f $@.awk | sed -e "s/\([0-9]e[-+]\)0\([0-9]\)/\1\2/g" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ fnamedat: @@ -837,7 +956,9 @@ hex: hsprint: @echo hsprint - @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @echo Expect hsprint to produce insignificant formatting differences + @AWKPATH=$(srcdir) $(AWK) -f $@.awk | sed -e "s/\([0-9]e[-+]\)0\([0-9]\)/\1\2/g" -e "s/| 1/| 1/" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ +# @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ inputred: @@ -850,6 +971,11 @@ intest: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +intformat: + @echo intformat + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + intprec: @echo intprec @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -872,7 +998,8 @@ longsub: longwrds: @echo longwrds - @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH=$(srcdir) $(AWK) -f $@.awk SORT=sort < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ +# @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ manglprm: @@ -1025,6 +1152,11 @@ opasnslf: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +ovrflow1: + @echo ovrflow1 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + paramdup: @echo paramdup @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1035,6 +1167,16 @@ paramtyp: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +parse1: + @echo parse1 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +parsefld: + @echo parsefld + @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + parseme: @echo parseme @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1147,11 +1289,13 @@ rstest3: rstest4: @echo rstest4 + @echo Expect $@ to fail on DOS/Windows @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ rstest5: @echo rstest5 + @echo Expect $@ to fail on DOS/Windows @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ @@ -1221,6 +1365,11 @@ strtod: @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +strnum1: + @echo strnum1 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + subsepnm: @echo subsepnm @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1246,6 +1395,11 @@ synerr1: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +synerr2: + @echo synerr2 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + uninit2: @echo uninit2 @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1286,8 +1440,14 @@ zeroflag: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +zero2: + @echo zero2 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + getlnhd: @echo getlnhd + @echo Expect getlnhd to fail if pipe does not use a Unixy shell @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ @@ -1308,7 +1468,17 @@ backw: clos1way: @echo clos1way - @echo Expect clos1way to fail with DJGPP. + @echo Expect clos1way to fail with DJGPP and MinGW. + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +double1: + @echo double1 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +double2: + @echo double2 @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ @@ -1322,6 +1492,16 @@ fsfwfs: @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +fwtest: + @echo fwtest + @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + +fwtest2: + @echo fwtest2 + @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + gensub: @echo gensub @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1377,6 +1557,11 @@ lint: @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ +lintold: + @echo lintold + @AWKPATH=$(srcdir) $(AWK) -f $@.awk --lint-old < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ + match1: @echo match1 @AWKPATH=$(srcdir) $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @@ -1394,7 +1579,7 @@ nondec: posix: @echo posix - @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @AWKPATH=$(srcdir) $(AWK) -f $@.awk < $(srcdir)/$@.in | sed -e "s/e+000/e+00/" >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) $(srcdir)/$@.ok _$@ && rm -f _$@ procinfs: @@ -1442,10 +1627,11 @@ strtonum: # Targets generated for other tests: $(srcdir)/Maketests: $(srcdir)/Makefile.am $(srcdir)/Gentests - $(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" *.awk *.in > $(srcdir)/Maketests + files=`cd "$(srcdir)" && echo *.awk *.in`; \ + $(AWK) -f $(srcdir)/Gentests "$(srcdir)/Makefile.am" $$files > $(srcdir)/Maketests clean: - rm -fr _* core core.* junk out1 out2 out3 strftime.ok test1 test2 seq *~ + rm -fr _* core core.* fmtspcl.ok junk out1 out2 out3 strftime.ok test1 test2 seq *~ # An attempt to print something that can be grepped for in build logs pass-fail: @@ -1459,10 +1645,31 @@ pass-fail: diffout: for i in _* ; \ do \ + if [ "$$i" != "_*" ]; then \ echo ============== $$i ============= ; \ + if [ -r $${i#_}.ok ]; then \ + diff -c $${i#_}.ok $$i ; \ + else \ diff -c $(srcdir)/$${i#_}.ok $$i ; \ + fi ; \ + fi ; \ done | more +# convenient way to scan valgrind results for errors +valgrind-scan: + @echo "Scanning valgrind log files for problems:" + @$(AWK) '\ + function show() {if (cmd) {printf "%s: %s\n",FILENAME,cmd; cmd = ""}; \ + printf "\t%s\n",$$0}; \ + {$$1 = ""}; \ + /Prog and args are:/ {incmd = 1; cmd = ""; next}; \ + incmd {if (NF == 1) incmd = 0; else {cmd = (cmd $$0); next}}; \ + /ERROR SUMMARY:/ && !/: 0 errors from 0 contexts/ {show()}; \ + /definitely lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \ + /possibly lost:/ && !/: 0 bytes in 0 blocks/ {show()}; \ + / suppressed:/ && !/: 0 bytes in 0 blocks/ {show()}; \ + ' log.[0-9]* + # This target is for testing with electric fence. efence: for i in $$(ls _* | sed 's;_\(.*\);\1;') ; \ diff --git a/pc/config.h b/pc/config.h index 4f07d8a5..0ea25224 100644 --- a/pc/config.h +++ b/pc/config.h @@ -12,7 +12,7 @@ * * 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 + * 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, @@ -55,12 +55,89 @@ /* Define if the `getpgrp' function takes no argument. */ #define GETPGRP_VOID 1 +/* Define to 1 if you have the `atexit' function. */ +# define HAVE_ATEXIT 1 + +/* Define to 1 if you have the `btowc' function. */ +#ifdef _WIN32 +#define HAVE_BTOWC 1 +#endif + +#ifdef __MINGW32__ +/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't. + */ +#define HAVE_DECL_TZNAME 1 + +/* Define if you have the 'intmax_t' type in <stdint.h> or <inttypes.h>. */ +#define HAVE_INTMAX_T 1 + +/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */ +#define HAVE_UINTMAX_T 1 + +/* Define to 1 if you have the <inttypes.h> header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the <stdint.h> header file. */ +#define HAVE_STDINT_H 1 + +/* Define if <inttypes.h> exists, doesn't clash with <sys/types.h>, and + declares uintmax_t. */ +#define HAVE_INTTYPES_H_WITH_UINTMAX 1 +#endif + +#ifdef __MINGW32__ +/* Define to 1 if you have the `isascii' function. */ +#define HAVE_ISASCII 1 + +/* Define to 1 if you have the `iswctype' function. */ +#define HAVE_ISWCTYPE 1 + +/* Define to 1 if you have the `iswlower' function. */ +#define HAVE_ISWLOWER 1 + +/* Define to 1 if you have the `iswupper' function. */ +#define HAVE_ISWUPPER 1 + +/* Define if you have the 'long long' type. */ +#define HAVE_LONG_LONG 1 + +/* Define to 1 if you have the `mbrlen' function. */ +#define HAVE_MBRLEN 1 + +/* Define to 1 if mbrtowc and mbstate_t are properly declared. */ +#define HAVE_MBRTOWC 1 + +/* Define to 1 if you have the `towlower' function. */ +#define HAVE_TOWLOWER 1 + +/* Define to 1 if you have the `towupper' function. */ +#define HAVE_TOWUPPER 1 + +/* Define to 1 if you have the <wchar.h> header file. */ +#define HAVE_WCHAR_H 1 + +/* Define to 1 if you have the `wcrtomb' function. */ +#define HAVE_WCRTOMB 1 + +/* Define to 1 if you have the `wcscoll' function. */ +#define HAVE_WCSCOLL 1 + +/* Define to 1 if you have the `wctype' function. */ +#define HAVE_WCTYPE 1 + +/* Define to 1 if you have the <wctype.h> header file. */ +#define HAVE_WCTYPE_H 1 + +/* systems should define this type here */ +#define HAVE_WCTYPE_T 1 + +/* systems should define this type here */ +#define HAVE_WINT_T 1 +#endif + /* Define to `int' if <sys/types.h> doesn't define. */ /* #undef gid_t */ -/* 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 */ @@ -94,6 +171,12 @@ #define inline #endif +#ifdef __GNUC__ +#define inline __inline__ +/* Define to 1 if you have the <stddef.h> header file. */ +#define HAVE_STDDEF_H 1 +#endif + /* Define if on MINIX. */ /* #undef _MINIX */ @@ -139,7 +222,7 @@ #define REGEX_MALLOC 1 /* use malloc instead of alloca in regex.c */ #define SPRINTF_RET int /* return type of sprintf */ -/* #undef HAVE_MKTIME */ /* we have the mktime function */ +#define HAVE_MKTIME /* we have the mktime function */ /* #undef HAVE_SOCKETS */ /* we have sockets on this system */ /* #undef HAVE_PORTALS */ /* we have portals on /p on this system */ /* #undef DYNAMIC */ /* allow dynamic addition of builtins */ @@ -175,21 +258,45 @@ /* Define if you have the memcpy function. */ #define HAVE_MEMCPY 1 +#ifdef __MINGW32__ +/* Define to 1 if you have the `memmove' function. */ +#define HAVE_MEMMOVE 1 +#endif + /* Define if you have the memset function. */ #define HAVE_MEMSET 1 /* Define if you have the munmap function. */ /* #undef HAVE_MUNMAP */ +#ifdef __MINGW32__ /* Define if you have the putenv function. */ -/* #undef HAVE_PUTENV */ +#define HAVE_PUTENV 1 + +/* Define if you have the setlocale function. */ +#define HAVE_SETLOCALE 1 + +/* Define if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define to 1 if you have the `snprintf' function. */ +#define HAVE_SNPRINTF 1 + +/* Define if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* FIXME!! */ + +/* we have sockets on this system */ +#undef HAVE_SOCKETS + +/* Define to 1 if you have the <sys/socket.h> header file. */ +#undef HAVE_SYS_SOCKET_H +#endif /* Define if you have the setenv function. */ /* #define HAVE_SETENV */ -/* Define if you have the setlocale function. */ -/* #undef HAVE_SETLOCALE */ - /* Define if you have the stpcpy function. */ /* #undef HAVE_STPCPY */ @@ -214,6 +321,12 @@ /* Define if you have the strtod function. */ #define HAVE_STRTOD 1 +#ifdef __MINGW32__ + +/* Define to 1 if you have the `strtoul' function. */ +#define HAVE_STRTOUL 1 +#endif + /* Define if you have the system function. */ #define HAVE_SYSTEM 1 @@ -232,9 +345,6 @@ /* Define if you have the <limits.h> header file. */ #define HAVE_LIMITS_H 1 -/* Define if you have the <locale.h> header file. */ -/* #undef HAVE_LOCALE_H */ - /* Define if you have the <malloc.h> header file. */ /* #undef HAVE_MALLOC_H */ @@ -256,8 +366,19 @@ /* Define if you have the <stdarg.h> header file. */ #define HAVE_STDARG_H 1 +#ifdef __MINGW32__ /* Define if you have the <stdlib.h> header file. */ -/* #undef HAVE_STDLIB_H */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the <sys/stat.h> header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the <sys/time.h> header file. */ +#define HAVE_SYS_TIME_H 1 + +/* Define if you have the 'unsigned long long' type. */ +#define HAVE_UNSIGNED_LONG_LONG 1 +#endif /* Define if you have the <string.h> header file. */ #define HAVE_STRING_H 1 @@ -280,7 +401,7 @@ #define HAVE_SYS_TYPES_H 1 /* Define if you have the <unistd.h> header file. */ -#if defined(DJGPP) +#if defined(DJGPP) || defined(__MINGW32__) # define HAVE_UNISTD_H 1 #endif @@ -296,8 +417,23 @@ /* Name of package */ #define PACKAGE "gawk" +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "bug-gawk@gnu.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "GNU Awk" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "GNU Awk 3.1.5a" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "gawk" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "3.1.5a" + /* Version number of package */ -#define VERSION "3.0.89" +#define VERSION "3.1.5a" /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ @@ -311,6 +447,9 @@ /* Define to make ftello visible on some hosts (e.g. glibc 2.1.3). */ /* #undef _XOPEN_SOURCE */ +/* Define to 1 if *printf supports %F format */ +/* #undef PRINTF_HAS_F_FORMAT */ + /* Define if compiler has function prototypes */ #define PROTOTYPES 1 @@ -330,7 +469,7 @@ /* #undef HAVE_CATGETS */ /* The size of `unsigned int' & `unsigned long', as computed by sizeof. */ -#if defined(DJGPP) || defined(_MSC_VER) +#if defined(DJGPP) || defined(_MSC_VER) || defined(__MINGW32__) # include <limits.h> #endif @@ -347,7 +486,11 @@ #endif /* Library search path */ -#define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk" +#if defined(__DJGPP__) && (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 3) +# define DEFPATH ".;/dev/env/DJDIR/share/awk" +#else +# define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk" +#endif #if defined (_MSC_VER) #if !defined(__STDC__) @@ -362,13 +505,13 @@ #define altzone timezone #endif -# define HAVE_POPEN_H +#define HAVE_POPEN_H 1 #if defined(_MSC_VER) && defined(MSDOS) #define system(s) os_system(s) #endif -#if defined(_MSC_VER) || defined(__MINGW32__) +#ifdef _MSC_VER #define ssize_t long int /* DJGPP has ssize_t */ #define intmax_t long #define uintmax_t unsigned long @@ -382,8 +525,11 @@ #if defined(DJGPP) # define HAVE_LIMITS_H 1 # undef HAVE_POPEN_H +# undef HAVE_ALLOCA +# define HAVE_MKSTEMP 1 #define intmax_t long long #define uintmax_t unsigned long long +#define restrict /* nothing */ #endif #if defined(__WIN32__) && defined(__CRTRSXNT__) @@ -394,6 +540,12 @@ #if defined(WIN32) && defined(_MSC_VER) #define alloca _alloca #define system(s) os_system(s) +/* VC++ dosen't supprt restrict keyword */ +#define restrict +/* VC++ have tmpfile */ +#define HAVE_TMPFILE +/* sys/time.h is not exist in VC++? */ +#undef TIME_WITH_SYS_TIME #endif #if defined(__MINGW32__) @@ -10,7 +10,7 @@ *
* 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
+ * 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,
@@ -10,7 +10,7 @@ *
* 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
+ * 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,
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc index 5164edb1..48d4bc3c 100644 --- a/pc/gawkmisc.pc +++ b/pc/gawkmisc.pc @@ -10,7 +10,7 @@ * * 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 + * 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, @@ -71,7 +71,7 @@ slashify(char *p, char *s) } static char * -scriptify(char *command) +scriptify(const char *command) { FILE *fp; char *cmd, *name, *s, *p; @@ -119,22 +119,23 @@ unlink_and_free(char *cmd) } int -os_system(char *cmd) +os_system(const char *cmd) { char *s; int i; + char *cmd1; #if defined(OS2) if (_osmode == OS2_MODE) return(system(cmd)); #endif - if ((cmd = scriptify(cmd)) == NULL) return(1); + if ((cmd1 = scriptify(cmd)) == NULL) return(1); if (s = getenv("SHELL")) - i = spawnlp(P_WAIT, s, s, cmd + strlen(s), NULL); + i = spawnlp(P_WAIT, s, s, cmd1 + strlen(s), NULL); else - i = system(cmd); - unlink_and_free(cmd); + i = system(cmd1); + unlink_and_free(cmd1); return(i); } #else @@ -143,12 +144,15 @@ os_system(char *cmd) FILE * -os_popen( char *command, char *mode ) +os_popen(const char *command, char *mode ) { FILE *current; char *name; int cur; char curmode[4]; +#if defined(__MINGW32__) || (defined(_MSC_VER) && defined(WIN32)) + char *cmd; +#endif #if defined(OS2) && (_MSC_VER != 510) if (_osmode == OS2_MODE) @@ -160,10 +164,10 @@ os_popen( char *command, char *mode ) strncpy(curmode, mode, 3); curmode[3] = '\0'; #if defined(__MINGW32__) || (defined(_MSC_VER) && defined(WIN32)) - current = popen(command = scriptify(command), mode); + current = popen(cmd = scriptify(command), mode); cur = fileno(current); strcpy(pipes[cur].pmode, curmode); - pipes[cur].command = command; + pipes[cur].command = cmd; return(current); #endif @@ -15,7 +15,7 @@ # endif # define popen(c, m) os_popen(c, m) # define pclose(f) os_pclose(f) - extern FILE *os_popen( char *, const char * ); + extern FILE *os_popen( const char *, const char * ); extern int os_pclose( FILE * ); # endif #endif |