aboutsummaryrefslogtreecommitdiffstats
path: root/pc
diff options
context:
space:
mode:
Diffstat (limited to 'pc')
-rw-r--r--pc/ChangeLog23
-rw-r--r--pc/Makefile74
-rw-r--r--pc/config.h746
-rw-r--r--pc/config.sed279
-rw-r--r--pc/configpk.sed9
-rw-r--r--pc/gawkmisc.pc22
-rwxr-xr-xpc/make-config.bat6
-rw-r--r--pc/popen.h4
8 files changed, 825 insertions, 338 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 8f676de6..ca1c15ea 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,26 @@
+2011-10-24 Eli Zaretskii <eliz@gnu.org>
+
+ * gawkmisc.pc (wctob) [__MINGW32__]: A replacement for the
+ function of the same name in MS runtime, which does a better job
+ with 8-bit characters that have their high bit set.
+ Original supplied by Jim Meyering <jim@meyering.net>.
+
+ * popen.h (system) [__MINGW32__]: Redirect to os_system.
+
+ * Makefile (./doc/awkcard.tr): Don't use Unixy forward slashes in
+ redirection.
+ (builtin$O): Depend on popen.h.
+ (random$O): New target, separated from builtin$O.
+
+ * configpk.sed:
+ * config.sed:
+ * make-config.bat: New files, to produce pc/config.h from the top-level
+ configh.in file.
+
+2011-10-18 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ * Makefile: doc target to create all documentation files.
+
2011-09-30 Eli Zaretskii <eliz@gnu.org>
* config.h: Update packaging related versions.
diff --git a/pc/Makefile b/pc/Makefile
index 403a86ec..6156ce96 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -13,10 +13,11 @@ default:
@echo " emx ..... OS/2 32-bit exe [emx/gcc; uses emxlibc.dll] "
@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 . Windows32 exe [Mingw32 GNU C] "
@echo " ----------------------------------------------------- "
@echo " test .... Perform tests (see README_d/README.pc) "
@echo " install . Install gawk under $(prefix)/ "
+ @echo " doc ..... Create documentation "
# Support dropped in 4.0
# - for DJGPP v1.x [DOS 32bit protected-mode executable]
@@ -28,7 +29,7 @@ default:
# @echo " msc6 .... DOS exe [Microsoft C 6.00a] "
# @echo " msc6os2 . OS/2 exe [Microsoft C 6.00a] "
# @echo " msc6bnd . OS/2 and DOS exe [Microsoft C 6.00a] "
-# @echo " vcWin32 . Windows32 exe [Microsoft Visual C] "
+# @echo " vcWin32 . Windows32 exe [Microsoft Visual C] "
# Support dropped in 3.0
# - for Microsoft C 5.1 [16bit executable for OS/2 or DOS]
# @echo " msc51 DOS exe [Microsoft C 5.1] "
@@ -239,7 +240,9 @@ $(DRSPFILE) : $(DGAWKOBJS)
$(ALLOBJS) $(LIBOBJS) eval_p$O profile_p$O: \
awk.h regex.h config.h gettext.h mbsupport.h protos.h dfa.h getopt.h
-builtin$O random$O: floatmagic.h random.h
+builtin$O: floatmagic.h random.h popen.h
+
+random$O: floatmagic.h random.h
debug$O: floatmagic.h
@@ -313,3 +316,68 @@ TAGS:
tags:
ctags awk.h *.y custom.h *.c *.h
+
+#========================================================================
+#================================= DOC ==================================
+#========================================================================
+
+DVIS = ./doc/gawk.dvi ./doc/gawkinet.dvi
+PDFS = ./doc/gawk.pdf ./doc/gawkinet.pdf
+PSS = ./doc/gawk.ps ./doc/gawkinet.ps
+HTMLS = ./doc/gawk.html ./doc/gawkinet.html
+INFOS = ./doc/gawk.info ./doc/gawkinet.info
+TEXINFOS = ./doc/gawk.texi ./doc/gawkinet.texi
+
+TEXI2DVI = texi2dvi --build-dir=./doc
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
+DVIPS = dvips
+MAKEINFO = makeinfo --no-split --force
+MAKEINFOHTML = $(MAKEINFO) --html
+
+TROFF = groff -t -Tps -U
+#SEDME = sed -e "s/^level0 restore/level0 restore flashme 100 72 moveto (Copyright `date '+%m-%d-%y %T'`, FSF, Inc. (all)) show/" \
+# -e "s/^\/level0 save def/\/level0 save def 30 -48 translate/"
+
+SEDME = sed "s/^\/level0 save def/\/level0 save def 30 -48 translate/"
+
+SEDME2 = sed "/%%Page: 10 10/,/0 Cg EP/d"
+
+.SUFFIXES: .dvi .html .info .pdf .ps .texi
+
+.texi.info:
+ $(MAKEINFO) -o $@ $<
+
+.texi.html:
+ $(MAKEINFOHTML) -o $@ $<
+
+.texi.dvi:
+ $(TEXI2DVI) -o $@ $<
+
+.texi.pdf:
+ $(TEXI2PDF) -o $@ $<
+
+.dvi.ps:
+ $(DVIPS) -o $@ $<
+
+./doc/awkcard.tr: ./doc/awkcard.in
+ cd doc
+ sed "s,SRCDIR,.," < awkcard.in > awkcard.tr
+ cd ..
+
+./doc/awkcard.nc: export GROFF_TMPDIR ?= .
+./doc/awkcard.nc: ./doc/macros ./doc/cardfonts ./doc/no.colors ./doc/awkcard.tr ./doc/ad.block ./doc/awkcard.in ./doc/setter.outline
+ cd doc
+ $(TROFF) ./macros ./cardfonts ./no.colors awkcard.tr | $(SEDME) | cat ./setter.outline - | $(SEDME2) > awkcard.ps
+ cd ..
+
+./doc/awkcard.ps: ./doc/awkcard.nc
+ cd doc
+ touch awkcard.nc
+ cd ..
+
+./doc/awkcard.pdf: ./doc/awkcard.ps
+ cd doc
+ ps2pdf ./awkcard.ps ./awkcard.pdf
+ cd ..
+
+doc: $(INFOS) $(DVIS) $(HTMLS) $(PSS) $(PDFS) ./doc/awkcard.ps ./doc/awkcard.pdf
diff --git a/pc/config.h b/pc/config.h
index 69c511d7..41fd895a 100644
--- a/pc/config.h
+++ b/pc/config.h
@@ -1,410 +1,427 @@
-/* config.h. Generated automatically by configure. */
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-/*
- * acconfig.h -- configuration definitions for gawk.
- */
-
-/*
- * Copyright (C) 1995-2005 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
- */
-
-
-/* Define if on AIX 3.
- System headers sometimes define this.
- We just want to avoid a redefinition error message. */
-#ifndef _ALL_SOURCE
-/* #undef _ALL_SOURCE */
-#endif
+/* configh.in. Generated from configure.ac by autoheader. */
+/* pc/config.h. Generated automatically by pc/config.sed. */
-/* Define if using alloca.c. */
-/* #undef C_ALLOCA */
+/* dynamic loading is possible */
+#undef DYNAMIC
-/* Define if type char is unsigned and you are not using gcc. */
-#ifndef __CHAR_UNSIGNED__
-/* #undef __CHAR_UNSIGNED__ */
-#endif
+/* Define to 1 if translation of program messages to the user's native
+ language is requested. */
+#undef ENABLE_NLS
-/* Define to empty if the keyword does not work. */
-/* #undef const */
+/* 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
-/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
- This function is required for alloca.c support on those systems. */
-/* #undef CRAY_STACKSEG_END */
+/* Define to 1 if the `getpgrp' function requires zero arguments. */
+#undef GETPGRP_VOID
-/* 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
+/* Define to 1 if you have the `alarm' function. */
+#define HAVE_ALARM 1
-/* Define if the `getpgrp' function takes no argument. */
-#define GETPGRP_VOID 1
+/* Define to 1 if you have the <arpa/inet.h> header file. */
+#undef HAVE_ARPA_INET_H
/* Define to 1 if you have the `atexit' function. */
-# define HAVE_ATEXIT 1
+#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 MacOS X function CFLocaleCopyCurrent in the
+ CoreFoundation framework. */
+#undef HAVE_CFLOCALECOPYCURRENT
+
+/* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in
+ the CoreFoundation framework. */
+#undef HAVE_CFPREFERENCESCOPYAPPVALUE
+
+/* Define if the GNU dcgettext() function is already present or preinstalled.
+ */
+#undef HAVE_DCGETTEXT
+
/* Define to 1 if you have the declaration of `tzname', and to 0 if you don't.
*/
+#ifdef __MINGW32__
#define HAVE_DECL_TZNAME 1
+#endif
+
+/* Define to 1 if you don't have `vprintf' but do have `_doprnt.' */
+#undef HAVE_DOPRNT
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_FCNTL_H 1
+#endif
+
+/* Define to 1 if you have the `fmod' function. */
+#define HAVE_FMOD 1
+
+/* have getaddrinfo */
+#undef HAVE_GETADDRINFO
+
+/* Define to 1 if you have the `getgrent' function. */
+#undef HAVE_GETGRENT
+
+/* Define to 1 if you have the `getgroups' function. */
+#undef HAVE_GETGROUPS
+
+/* Define if the GNU gettext() function is already present or preinstalled. */
+#undef HAVE_GETTEXT
+
+/* Define to 1 if you have the `grantpt' function. */
+#undef HAVE_GRANTPT
+
+/* 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>. */
+#ifdef __MINGW32__
#define HAVE_INTMAX_T 1
-
-/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */
-#define HAVE_UINTMAX_T 1
+#endif
/* Define to 1 if you have the <inttypes.h> header file. */
+#ifdef __MINGW32__
#define HAVE_INTTYPES_H 1
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#define HAVE_STDINT_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
-#ifdef __MINGW32__
/* Define to 1 if you have the `isascii' function. */
+#ifdef __MINGW32__
#define HAVE_ISASCII 1
+#endif
/* Define to 1 if you have the `iswctype' function. */
+#ifdef __MINGW32__
#define HAVE_ISWCTYPE 1
+#endif
/* Define to 1 if you have the `iswlower' function. */
+#ifdef __MINGW32__
#define HAVE_ISWLOWER 1
+#endif
/* Define to 1 if you have the `iswupper' function. */
+#ifdef __MINGW32__
#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.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 you have a working `mmap' system call. */
-/* #undef HAVE_MMAP */
+/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
+#undef HAVE_LANGINFO_CODESET
-/* Define if your struct stat has st_blksize. */
-#define HAVE_ST_BLKSIZE 1
+/* Define if your <locale.h> file defines LC_MESSAGES. */
+#undef HAVE_LC_MESSAGES
-/* Define if you have the ANSI # stringizing operator in cpp. */
-#define HAVE_STRINGIZE 1
+/* Define to 1 if you have the <libintl.h> header file. */
+#undef HAVE_LIBINTL_H
-/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
-/* #undef HAVE_SYS_WAIT_H */
+/* Define to 1 if you have the `m' library (-lm). */
+#define HAVE_LIBM 1
-/* Define if your struct tm has tm_zone. */
-/* #undef HAVE_TM_ZONE */
+/* Define to 1 if you have a fully functional readline library. */
+#undef HAVE_LIBREADLINE
-/* Define if you don't have tm_zone but do have the external array
- tzname. */
-#define HAVE_TZNAME 1
-
-/* Define if you have the vprintf function. */
-#define HAVE_VPRINTF 1
+/* Define if you have the libsigsegv library. */
+#undef HAVE_LIBSIGSEGV
-#ifdef __GNUC__
-#define inline __inline__
-/* Define to 1 if you have the <stddef.h> header file. */
-#define HAVE_STDDEF_H 1
+/* Define to 1 if you have the <limits.h> header file. */
+#if defined(DJGPP) || defined(__MINGW32__)
+#define HAVE_LIMITS_H 1
#endif
-/* Define if on MINIX. */
-/* #undef _MINIX */
-
-/* Define to `long' if <sys/types.h> doesn't define. */
-/* #undef off_t */
-
-/* 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 to 1 if you have the <locale.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_LOCALE_H 1
+#endif
-/* Define if you need to in order for stat and other things to work. */
-/* #undef _POSIX_SOURCE */
+/* Define if you have the 'long long' type. */
+#ifdef __MINGW32__
+#define HAVE_LONG_LONG 1
+#endif
-/* Define as the return type of signal handlers (int or void). */
-#define RETSIGTYPE void
+/* Define to 1 if the system has the type `long long int'. */
+#undef HAVE_LONG_LONG_INT
-/* Define to `unsigned' if <sys/types.h> doesn't define. */
-/* #undef size_t */
+/* Define to 1 if you have the `mbrlen' function. */
+#ifdef __MINGW32__
+#define HAVE_MBRLEN 1
+#endif
-/* 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
- */
-/* #undef STACK_DIRECTION */
+/* Define to 1 if mbrtowc and mbstate_t are properly declared. */
+#ifdef __MINGW32__
+#define HAVE_MBRTOWC 1
+#endif
-/* Define if you have the ANSI C header files. */
-#define STDC_HEADERS 1
+/* Define to 1 if you have the <mcheck.h> header file. */
+#undef HAVE_MCHECK_H
-/* Define if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
+/* Define to 1 if you have the `memcmp' function. */
+#define HAVE_MEMCMP 1
-/* Define if your <sys/time.h> declares struct tm. */
-/* #undef TM_IN_SYS_TIME */
+/* Define to 1 if you have the `memcpy' function. */
+#define HAVE_MEMCPY 1
-/* Define to `int' if <sys/types.h> doesn't define. */
-/* #undef uid_t */
+/* Define to 1 if you have the `memcpy_ulong' function. */
+#undef HAVE_MEMCPY_ULONG
-#define REGEX_MALLOC 1 /* use malloc instead of alloca in regex.c */
-#define SPRINTF_RET int /* return type of sprintf */
-#define HAVE_MKTIME /* we have the mktime function */
-/* #undef HAVE_SOCKETS */ /* we have sockets on this system */
-/* #undef DYNAMIC */ /* allow dynamic addition of builtins */
-/* #undef STRTOD_NOT_C89 */ /* strtod doesn't have C89 semantics */
+/* Define to 1 if you have the `memmove' function. */
+#ifdef __MINGW32__
+#define HAVE_MEMMOVE 1
+#endif
-/* Define if you have the alarm function. */
-#define HAVE_ALARM 1
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
-/* Define if you have the dcgettext function. */
-/* #undef HAVE_DCGETTEXT */
+/* Define to 1 if you have the `memset' function. */
+#define HAVE_MEMSET 1
-/* Define if you have the fmod function. */
-#define HAVE_FMOD 1
+/* Define to 1 if you have the `memset_ulong' function. */
+#undef HAVE_MEMSET_ULONG
-/* Define if you have the getcwd function. */
-/* #undef HAVE_GETCWD */
+/* Define to 1 if you have the `mkstemp' function. */
+#ifdef DJGPP
+#define HAVE_MKSTEMP 1
+#endif
-/* Define if you have the getpagesize function. */
-/* #undef HAVE_GETPAGESIZE */
+/* we have the mktime function */
+#define HAVE_MKTIME 1
-/* Define if you have the memcmp function. */
-#define HAVE_MEMCMP 1
+/* Define to 1 if you have the <netdb.h> header file. */
+#undef HAVE_NETDB_H
-/* Define if you have the memcpy function. */
-#define HAVE_MEMCPY 1
+/* Define to 1 if you have the <netinet/in.h> header file. */
+#undef HAVE_NETINET_IN_H
-#ifdef __MINGW32__
-/* Define to 1 if you have the `memmove' function. */
-#define HAVE_MEMMOVE 1
+/* Define to 1 if you have the `setenv' function. */
+#if defined(__MINGW32__) || defined(__DJGPP__)
+#define HAVE_SETENV 1
#endif
-/* Define if you have the memset function. */
-#define HAVE_MEMSET 1
-
-/* Define if you have the munmap function. */
-/* #undef HAVE_MUNMAP */
-
+/* Define to 1 if you have the `setlocale' function. */
#ifdef __MINGW32__
-/* Define if you have the putenv function. */
-#define HAVE_PUTENV 1
-
-/* Define if you have the setlocale function. */
#define HAVE_SETLOCALE 1
+#endif
-/* Define if you have the <locale.h> header file. */
-#define HAVE_LOCALE_H 1
+/* Define to 1 if you have the `setsid' function. */
+#undef HAVE_SETSID
/* Define to 1 if you have the `snprintf' function. */
+#ifdef __MINGW32__
#define HAVE_SNPRINTF 1
+#endif
-/* Define if you have the strcasecmp function. */
-#define HAVE_STRCASECMP 1
-
-/* FIXME!! */
+/* newer systems define this type here */
+#undef HAVE_SOCKADDR_STORAGE
/* 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 /* __MINGW32__ */
+/* Define to 1 if you have the <stdarg.h> header file. */
+#define HAVE_STDARG_H 1
-#if defined(__MINGW32__) || defined(__DJGPP__)
-/* Define if you have the setenv function. */
-#define HAVE_SETENV 1
+/* Define to 1 if you have the <stddef.h> header file. */
+#ifdef __GNUC__
+#define HAVE_STDDEF_H 1
+#endif
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_STDINT_H 1
#endif
-/* Define if you have the stpcpy function. */
-/* #undef HAVE_STPCPY */
+/* Define if <stdint.h> exists, doesn't clash with <sys/types.h>, and declares
+ uintmax_t. */
+#undef HAVE_STDINT_H_WITH_UINTMAX
-/* Define if you have the strcasecmp function. */
-/* #undef HAVE_STRCASECMP */
+/* Define to 1 if you have the <stdlib.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_STDLIB_H 1
+#endif
-/* Define if you have the strchr function. */
+/* Define to 1 if you have the `strchr' function. */
#define HAVE_STRCHR 1
-/* Define if you have the strdup function. */
-#define HAVE_STRDUP 1
+/* Define to 1 if you have the `strcoll' function. */
+#undef HAVE_STRCOLL
-/* Define if you have the strerror function. */
+/* Define to 1 if you have the `strerror' function. */
#define HAVE_STRERROR 1
+/* Define to 1 if you have the `strftime' function. */
#ifdef __MINGW32__
-/* Define if you have the strftime function. __MINGW32__ uses the
- replacement from missing_d, to support the %e specifier. */
+/* MinGW uses the replacement from missing_d, to support the %e specifier. */
#define strftime rpl_strftime
#else
#define HAVE_STRFTIME 1
#endif
-/* Define if you have the strncasecmp function. */
+/* Define to 1 if cpp supports the ANSI # stringizing operator. */
+#define HAVE_STRINGIZE 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the `strncasecmp' function. */
#define HAVE_STRNCASECMP 1
+#ifdef __EMX__
+#define strncasecmp strnicmp
+#endif
-/* Define if you have the strtod function. */
-#define HAVE_STRTOD 1
+/* Define to 1 if you have the <stropts.h> header file. */
+#undef HAVE_STROPTS_H
-#ifdef __MINGW32__
+/* Define to 1 if you have the `strtod' function. */
+#define HAVE_STRTOD 1
/* Define to 1 if you have the `strtoul' function. */
+#ifdef __MINGW32__
#define HAVE_STRTOUL 1
#endif
-/* Define if you have the system function. */
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if `tm_zone' is a member of `struct tm'. */
+#undef HAVE_STRUCT_TM_TM_ZONE
+
+/* Define to 1 if your `struct stat' has `st_blksize'. Deprecated, use
+ `HAVE_STRUCT_STAT_ST_BLKSIZE' instead. */
+#undef HAVE_ST_BLKSIZE
+
+/* Define to 1 if you have the `system' function. */
+#ifdef __MINGW32__
#define HAVE_SYSTEM 1
+#endif
-/* Define if you have the tzset function. */
-#define HAVE_TZSET 1
+/* Define to 1 if you have the <sys/ioctl.h> header file. */
+#undef HAVE_SYS_IOCTL_H
-/* Define if you have the <argz.h> header file. */
-/* #undef HAVE_ARGZ_H */
+/* Define to 1 if you have the <sys/param.h> header file. */
+#ifndef __MINGW32__
+#define HAVE_SYS_PARAM_H 1
+#endif
-/* Define if you have the <fcntl.h> header file. */
-#define HAVE_FCNTL_H 1
+/* Define to 1 if you have the <sys/socket.h> header file. */
+#undef HAVE_SYS_SOCKET_H
-/* Define if you have the <libintl.h> header file. */
-/* #undef HAVE_LIBINTL_H */
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_SYS_STAT_H 1
+#endif
-/* Define if you have the <limits.h> header file. */
-#define HAVE_LIMITS_H 1
+/* Define to 1 if you have the <sys/time.h> header file. */
+#if defined(DJGPP) || defined(__MINGW32__)
+#define HAVE_SYS_TIME_H 1
+#endif
-/* Define if you have the <malloc.h> header file. */
-/* #undef HAVE_MALLOC_H */
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
-/* Define if you have the <memory.h> header file. */
-#define HAVE_MEMORY_H 1
+/* Define to 1 if you have <sys/wait.h> that is POSIX.1 compatible. */
+#undef HAVE_SYS_WAIT_H
-/* Define if you have the <netdb.h> header file. */
-/* #undef HAVE_NETDB_H */
+/* Define to 1 if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
-/* Define if you have the <netinet/in.h> header file. */
-/* #undef HAVE_NETINET_IN_H */
+/* Define to 1 if you have the `tmpfile' function. */
+#undef HAVE_TMPFILE
-/* Define if you have the <nl_types.h> header file. */
-/* #undef HAVE_NL_TYPES_H */
+/* Define to 1 if your `struct tm' has `tm_zone'. Deprecated, use
+ `HAVE_STRUCT_TM_TM_ZONE' instead. */
+#undef HAVE_TM_ZONE
-/* Define if you have the <signum.h> header file. */
-/* #undef HAVE_SIGNUM_H */
+/* Define to 1 if you have the `towlower' function. */
+#ifdef __MINGW32__
+#define HAVE_TOWLOWER 1
+#endif
-/* Define if you have the <stdarg.h> header file. */
-#define HAVE_STDARG_H 1
+/* Define to 1 if you have the `towupper' function. */
+#ifdef __MINGW32__
+#define HAVE_TOWUPPER 1
+#endif
+
+/* Define to 1 if you don't have `tm_zone' but do have the external array
+ `tzname'. */
+#define HAVE_TZNAME 1
+/* Define to 1 if you have the `tzset' function. */
#ifdef __MINGW32__
-/* Define if you have the <stdlib.h> header file. */
-#define HAVE_STDLIB_H 1
+#define HAVE_TZSET 1
+#endif
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#define HAVE_SYS_STAT_H 1
+/* Define if you have the 'uintmax_t' type in <stdint.h> or <inttypes.h>. */
+#if defined(DJGPP) || defined(__MINGW32__)
+#define HAVE_UINTMAX_T 1
+#ifdef DJGPP
+#define uintmax_t unsigned long long
+#endif
+#endif
-/* Define to 1 if you have the <sys/time.h> header file. */
-#define HAVE_SYS_TIME_H 1
+/* Define to 1 if you have the <unistd.h> header file. */
+#if defined(DJGPP) || defined(__MINGW32__)
+#define HAVE_UNISTD_H 1
+#endif
/* 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
+/* Define to 1 if the system has the type `unsigned long long int'. */
+#undef HAVE_UNSIGNED_LONG_LONG_INT
-/* Define if you have the <strings.h> header file. */
-/* #undef HAVE_STRINGS_H */
+/* Define to 1 if you have the `usleep' function. */
+#if defined(DJGPP) || defined(__MINGW32__)
+#define HAVE_USLEEP 1
+#endif
-/* Define if you have the <sys/param.h> header file. */
-#define HAVE_SYS_PARAM_H 1
+/* Define to 1 if you have the `vprintf' function. */
+#define HAVE_VPRINTF 1
-/* Define if you have the <sys/socket.h> header file. */
-/* #undef HAVE_SYS_SOCKET_H */
+/* Define to 1 if you have the <wchar.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_WCHAR_H 1
+#endif
-/* Define if you have the <sys/time.h> header file. */
-#if defined(DJGPP)
-# define HAVE_SYS_TIME_H 1
+/* Define to 1 if you have the `wcrtomb' function. */
+#ifdef __MINGW32__
+#define HAVE_WCRTOMB 1
#endif
-/* Define to 1 if you have the <sys/types.h> header file. */
-#define HAVE_SYS_TYPES_H 1
+/* Define to 1 if you have the `wcscoll' function. */
+#ifdef __MINGW32__
+#define HAVE_WCSCOLL 1
+#endif
-/* Define if you have the <unistd.h> header file. */
-#if defined(DJGPP) || defined(__MINGW32__)
-# define HAVE_UNISTD_H 1
+/* Define to 1 if you have the `wctype' function. */
+#ifdef __MINGW32__
+#define HAVE_WCTYPE 1
+#endif
+
+/* Define to 1 if you have the <wctype.h> header file. */
+#ifdef __MINGW32__
+#define HAVE_WCTYPE_H 1
#endif
-/* Define if you have the i library (-li). */
-/* #undef HAVE_LIBI */
+/* systems should define this type here */
+#ifdef __MINGW32__
+#define HAVE_WCTYPE_T 1
+#endif
-/* Define if you have the intl library (-lintl). */
-/* #undef HAVE_LIBINTL */
+/* systems should define this type here */
+#ifdef __MINGW32__
+#define HAVE_WINT_T 1
+#endif
-/* Define if you have the m library (-lm). */
-#define HAVE_LIBM 1
+/* disable lint checks */
+#undef NO_LINT
/* Name of package */
#define PACKAGE "gawk"
@@ -416,7 +433,7 @@
#define PACKAGE_NAME "GNU Awk"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "GNU Awk 4.0.0"
+#define PACKAGE_STRING "GNU Awk 4.0.0c"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "gawk"
@@ -425,100 +442,159 @@
#define PACKAGE_URL "http://www.gnu.org/software/gawk/"
/* Define to the version of this package. */
-#define PACKAGE_VERSION "4.0.0"
+#define PACKAGE_VERSION "4.0.0c"
-/* Version number of package */
-#define VERSION "4.0.0"
+/* Define to 1 if *printf supports %F format */
+#undef PRINTF_HAS_F_FORMAT
-/* Number of bits in a file offset, on hosts where this is settable. */
-/* #undef _FILE_OFFSET_BITS */
+/* Define as the return type of signal handlers (`int' or `void'). */
+#define RETSIGTYPE void
-/* Define to make ftello visible on some hosts (e.g. HP-UX 10.20). */
-/* #undef _LARGEFILE_SOURCE */
+#if defined(DJGPP) || defined(__MINGW32__)
+#include <limits.h>
+#endif
-/* Define for large files, on AIX-style hosts. */
-/* #undef _LARGE_FILES */
+/* The size of `unsigned int', as computed by sizeof. */
+#if UINT_MAX == 65536
+#define SIZEOF_UNSIGNED_INT 2
+#elif UINT_MAX == 4294967295U
+#define SIZEOF_UNSIGNED_INT 4
+#endif
-/* Define to make ftello visible on some hosts (e.g. glibc 2.1.3). */
-/* #undef _XOPEN_SOURCE */
+/* The size of `unsigned long', as computed by sizeof. */
+#if ULONG_MAX == 4294967295UL
+#define SIZEOF_UNSIGNED_LONG 4
+#endif
-/* Define to 1 if *printf supports %F format */
-/* #undef PRINTF_HAS_F_FORMAT */
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
-/* Define if compiler has function prototypes */
-#define PROTOTYPES 1
+/* some systems define this type here */
+#undef TIME_T_IN_SYS_TYPES_H
-/* Define to 1 if you have the stpcpy function. */
-/* #undef HAVE_STPCPY */
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#define TIME_WITH_SYS_TIME 1
-/* Define if your locale.h file contains LC_MESSAGES. */
-/* #undef HAVE_LC_MESSAGES */
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
-/* Define to 1 if NLS is requested. */
-/* #undef ENABLE_NLS */
+/* force use of our version of strftime */
+#undef USE_INCLUDED_STRFTIME
-/* Define to 1 if you have gettext and don't want to use GNU gettext. */
-/* #undef HAVE_GETTEXT */
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# undef _ALL_SOURCE
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# undef _GNU_SOURCE
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
-/* Define as 1 if you have catgets and don't want to use GNU gettext. */
-/* #undef HAVE_CATGETS */
-/* The size of `unsigned int' & `unsigned long', as computed by sizeof. */
-#if defined(DJGPP) || defined(__MINGW32__)
-# include <limits.h>
-#endif
+/* Version number of package */
+#define VERSION "4.0.0c"
-#if UINT_MAX == 65536
-# define SIZEOF_UNSIGNED_INT 2
-#endif
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
+
+/* Define to 1 if on MINIX. */
+#undef _MINIX
-#if UINT_MAX == 4294967295U
-# define SIZEOF_UNSIGNED_INT 4
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+#undef _POSIX_1_SOURCE
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+#undef _POSIX_SOURCE
+
+/* Define to 1 if type `char' is unsigned and you are not using gcc. */
+#ifndef __CHAR_UNSIGNED__
+# undef __CHAR_UNSIGNED__
#endif
-#if ULONG_MAX == 4294967295UL
-# define SIZEOF_UNSIGNED_LONG 4
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to `int' if <sys/types.h> doesn't define. */
+#undef gid_t
+
+/* Define to `__inline__' or `__inline' if that's what the C compiler
+ calls it, or to nothing if 'inline' is not supported under any name. */
+#ifndef __cplusplus
+#ifdef __GNUC__
+#define inline __inline__
+#endif
#endif
-/* Library search path */
-#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"
+/* Define to long or long long if <inttypes.h> and <stdint.h> don't define. */
+#ifdef DJGPP
+#define intmax_t long long
#endif
-#define HAVE_POPEN_H 1
+/* Define to `int' if <sys/types.h> does not define. */
+#undef pid_t
-#if defined(__EMX__)
-#define strcasecmp stricmp
-#define strncasecmp strnicmp
+/* Define to the equivalent of the C99 'restrict' keyword, or to
+ nothing if this is not supported. Do not define if restrict is
+ supported directly. */
+#ifdef DJGPP
+#define restrict
+#endif
+/* Work around a bug in Sun C++: it does not support _Restrict or
+ __restrict__, even though the corresponding Sun C compiler ends up with
+ "#define restrict _Restrict" or "#define restrict __restrict__" in the
+ previous line. Perhaps some future version of Sun C++ will work with
+ restrict; if so, hopefully it defines __RESTRICT like Sun C does. */
+#if defined __SUNPRO_CC && !defined __RESTRICT
+# define _Restrict
+# define __restrict__
#endif
-#if defined(DJGPP)
-# define HAVE_LIMITS_H 1
-# undef HAVE_POPEN_H
-# undef HAVE_ALLOCA
-# define HAVE_MKSTEMP 1
-# define HAVE_USLEEP 1
-#define intmax_t long long
+/* Define to `unsigned int' if <sys/types.h> does not define. */
+#undef size_t
+
+/* type to use in place of socklen_t if not defined */
+#undef socklen_t
+
+/* Define to `int' if <sys/types.h> does not define. */
+#undef ssize_t
+
+/* 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. */
+#ifdef DJGPP
#define uintmax_t unsigned long long
-#define restrict /* nothing */
#endif
-#if defined(__WIN32__) && defined(__CRTRSXNT__)
-#include <crtrsxnt.h>
+#include "custom.h"
+/* Library search path */
+#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(__MINGW32__)
-#undef HAVE_SYS_PARAM_H
+#ifndef DJGPP
+#define HAVE_POPEN_H 1
#endif
#if defined(__MINGW32__)
# define WEXITSTATUS(stat_val) ((stat_val) & ~0xC0000000)
#endif
-
-#ifdef __MINGW32__
-#define HAVE_USLEEP 1
-#endif
-
-/* #define NO_LINT 1 */
diff --git a/pc/config.sed b/pc/config.sed
new file mode 100644
index 00000000..c0fa766a
--- /dev/null
+++ b/pc/config.sed
@@ -0,0 +1,279 @@
+# -config.sed-----------------------------------------------------------
+# Configuration script for pc/config.h
+# ----------------------------------------------------------------------
+
+# 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
+
+# ----------------------------------------------------------------------
+
+/configh\.in/a\
+/* pc/config.h. Generated automatically by pc/config.sed. */
+
+s/^#undef GETGROUPS_T *$/#define GETGROUPS_T gid_t/
+s/^#undef HAVE_ALARM *$/#define HAVE_ALARM 1/
+s/^#undef HAVE_ATEXIT *$/#define HAVE_ATEXIT 1/
+/^#undef HAVE_BTOWC$/c\
+#ifdef _WIN32\
+#define HAVE_BTOWC 1\
+#endif
+/^#undef HAVE_DECL_TZNAME$/c\
+#ifdef __MINGW32__\
+#define HAVE_DECL_TZNAME 1\
+#endif
+/^#undef HAVE_FCNTL_H$/c\
+#ifdef __MINGW32__\
+#define HAVE_FCNTL_H 1\
+#endif
+s/^#undef HAVE_FMOD *$/#define HAVE_FMOD 1/
+/^#undef HAVE_INTMAX_T$/c\
+#ifdef __MINGW32__\
+#define HAVE_INTMAX_T 1\
+#endif
+/^#undef HAVE_INTTYPES_H$/c\
+#ifdef __MINGW32__\
+#define HAVE_INTTYPES_H 1\
+#endif
+/^#undef HAVE_INTTYPES_H_WITH_UINTMAX$/c\
+#ifdef __MINGW32__\
+#define HAVE_INTTYPES_H_WITH_UINTMAX 1\
+#endif
+/^#undef HAVE_ISASCII$/c\
+#ifdef __MINGW32__\
+#define HAVE_ISASCII 1\
+#endif
+/^#undef HAVE_ISWCTYPE$/c\
+#ifdef __MINGW32__\
+#define HAVE_ISWCTYPE 1\
+#endif
+/^#undef HAVE_ISWLOWER$/c\
+#ifdef __MINGW32__\
+#define HAVE_ISWLOWER 1\
+#endif
+/^#undef HAVE_ISWUPPER$/c\
+#ifdef __MINGW32__\
+#define HAVE_ISWUPPER 1\
+#endif
+s/^#undef HAVE_LIBM *$/#define HAVE_LIBM 1/
+/^#undef HAVE_LIMITS_H$/c\
+#if defined(DJGPP) || defined(__MINGW32__)\
+#define HAVE_LIMITS_H 1\
+#endif
+/^#undef HAVE_LOCALE_H$/c\
+#ifdef __MINGW32__\
+#define HAVE_LOCALE_H 1\
+#endif
+/^#undef HAVE_LONG_LONG$/c\
+#ifdef __MINGW32__\
+#define HAVE_LONG_LONG 1\
+#endif
+/^#undef HAVE_MBRLEN$/c\
+#ifdef __MINGW32__\
+#define HAVE_MBRLEN 1\
+#endif
+/^#undef HAVE_MBRTOWC$/c\
+#ifdef __MINGW32__\
+#define HAVE_MBRTOWC 1\
+#endif
+s/^#undef HAVE_MEMCMP *$/#define HAVE_MEMCMP 1/
+s/^#undef HAVE_MEMCPY *$/#define HAVE_MEMCPY 1/
+/^#undef HAVE_MEMMOVE$/c\
+#ifdef __MINGW32__\
+#define HAVE_MEMMOVE 1\
+#endif
+s/^#undef HAVE_MEMSET *$/#define HAVE_MEMSET 1/
+/^#undef HAVE_MKSTEMP$/c\
+#ifdef DJGPP\
+#define HAVE_MKSTEMP 1\
+#endif
+s/^#undef HAVE_MKTIME *$/#define HAVE_MKTIME 1/
+/^#undef HAVE_SETENV$/c\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
+#define HAVE_SETENV 1\
+#endif
+/^#undef HAVE_SETLOCALE$/c\
+#ifdef __MINGW32__\
+#define HAVE_SETLOCALE 1\
+#endif
+/^#undef HAVE_SNPRINTF$/c\
+#ifdef __MINGW32__\
+#define HAVE_SNPRINTF 1\
+#endif
+s/^#undef HAVE_STDARG_H *$/#define HAVE_STDARG_H 1/
+/^#undef HAVE_STDDEF_H$/c\
+#ifdef __GNUC__\
+#define HAVE_STDDEF_H 1\
+#endif
+/^#undef HAVE_STDINT_H$/c\
+#ifdef __MINGW32__\
+#define HAVE_STDINT_H 1\
+#endif
+/^#undef HAVE_STDLIB_H$/c\
+#ifdef __MINGW32__\
+#define HAVE_STDLIB_H 1\
+#endif
+s/^#undef HAVE_STRCHR *$/#define HAVE_STRCHR 1/
+s/^#undef HAVE_STRERROR *$/#define HAVE_STRERROR 1/
+/^#undef HAVE_STRFTIME$/c\
+#ifdef __MINGW32__\
+/* MinGW uses the replacement from missing_d, to support the %e specifier. */\
+#define strftime rpl_strftime\
+#else\
+#define HAVE_STRFTIME 1\
+#endif
+s/^#undef HAVE_STRINGIZE *$/#define HAVE_STRINGIZE 1/
+s/^#undef HAVE_STRING_H *$/#define HAVE_STRING_H 1/
+/^#undef HAVE_STRNCASECMP$/c\
+#define HAVE_STRNCASECMP 1\
+#ifdef __EMX__\
+#define strncasecmp strnicmp\
+#endif
+s/^#undef HAVE_STRTOD *$/#define HAVE_STRTOD 1/
+/^#undef HAVE_STRTOUL$/c\
+#ifdef __MINGW32__\
+#define HAVE_STRTOUL 1\
+#endif
+/^#undef HAVE_SYSTEM$/c\
+#ifdef __MINGW32__\
+#define HAVE_SYSTEM 1\
+#endif
+/^#undef HAVE_SYS_PARAM_H$/c\
+#ifndef __MINGW32__\
+#define HAVE_SYS_PARAM_H 1\
+#endif
+/^#undef HAVE_SYS_STAT_H$/c\
+#ifdef __MINGW32__\
+#define HAVE_SYS_STAT_H 1\
+#endif
+/^#undef HAVE_SYS_TIME_H$/c\
+#if defined(DJGPP) || defined(__MINGW32__)\
+#define HAVE_SYS_TIME_H 1\
+#endif
+s/^#undef HAVE_SYS_TYPES_H *$/#define HAVE_SYS_TYPES_H 1/
+/^#undef HAVE_TOWLOWER$/c\
+#ifdef __MINGW32__\
+#define HAVE_TOWLOWER 1\
+#endif
+/^#undef HAVE_TOWUPPER$/c\
+#ifdef __MINGW32__\
+#define HAVE_TOWUPPER 1\
+#endif
+s/^#undef HAVE_TZNAME *$/#define HAVE_TZNAME 1/
+/^#undef HAVE_TZSET$/c\
+#ifdef __MINGW32__\
+#define HAVE_TZSET 1\
+#endif
+/^#undef HAVE_UINTMAX_T$/c\
+#if defined(DJGPP) || defined(__MINGW32__)\
+#define HAVE_UINTMAX_T 1\
+#ifdef DJGPP\
+#define uintmax_t unsigned long long\
+#endif\
+#endif
+/^#undef HAVE_UNISTD_H$/c\
+#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__)\
+#define HAVE_USLEEP 1\
+#endif
+s/^#undef HAVE_VPRINTF *$/#define HAVE_VPRINTF 1/
+/^#undef HAVE_WCHAR_H$/c\
+#ifdef __MINGW32__\
+#define HAVE_WCHAR_H 1\
+#endif
+/^#undef HAVE_WCRTOMB$/c\
+#ifdef __MINGW32__\
+#define HAVE_WCRTOMB 1\
+#endif
+/^#undef HAVE_WCSCOLL$/c\
+#ifdef __MINGW32__\
+#define HAVE_WCSCOLL 1\
+#endif
+/^#undef HAVE_WCTYPE$/c\
+#ifdef __MINGW32__\
+#define HAVE_WCTYPE 1\
+#endif
+/^#undef HAVE_WCTYPE_H$/c\
+#ifdef __MINGW32__\
+#define HAVE_WCTYPE_H 1\
+#endif
+/^#undef HAVE_WCTYPE_T$/c\
+#ifdef __MINGW32__\
+#define HAVE_WCTYPE_T 1\
+#endif
+/^#undef HAVE_WINT_T$/c\
+#ifdef __MINGW32__\
+#define HAVE_WINT_T 1\
+#endif
+s/^#undef PROTOTYPES *$/#define PROTOTYPES 1/
+s/^#undef RETSIGTYPE *$/#define RETSIGTYPE void/
+/^#.*RETSIGTYPE /a\
+\
+#if defined(DJGPP) || defined(__MINGW32__)\
+#include <limits.h>\
+#endif
+/^#undef SIZEOF_UNSIGNED_INT$/c\
+#if UINT_MAX == 65536\
+#define SIZEOF_UNSIGNED_INT 2\
+#elif UINT_MAX == 4294967295U\
+#define SIZEOF_UNSIGNED_INT 4\
+#endif
+/^#undef SIZEOF_UNSIGNED_LONG$/c\
+#if ULONG_MAX == 4294967295UL\
+#define SIZEOF_UNSIGNED_LONG 4\
+#endif
+s/^#undef STDC_HEADERS *$/#define STDC_HEADERS 1/
+s/^#undef TIME_WITH_SYS_TIME *$/#define TIME_WITH_SYS_TIME 1/
+/^#undef inline$/c\
+#ifdef __GNUC__\
+#define inline __inline__\
+#endif
+/^#undef intmax_t$/c\
+#ifdef DJGPP\
+#define intmax_t long long\
+#endif
+/^#undef restrict$/c\
+#ifdef DJGPP\
+#define restrict\
+#endif
+/^#undef uintmax_t$/c\
+#ifdef DJGPP\
+#define uintmax_t unsigned long long\
+#endif
+
+s|^#undef PACKAGE_URL *$|#define PACKAGE_URL "http://www.gnu.org/software/gawk/"|
+
+$a\
+/* Library search path */\
+#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\
+\
+#ifndef DJGPP\
+#define HAVE_POPEN_H 1\
+#endif\
+\
+#if defined(__MINGW32__)\
+# define WEXITSTATUS(stat_val) ((stat_val) & ~0xC0000000)\
+#endif
diff --git a/pc/configpk.sed b/pc/configpk.sed
new file mode 100644
index 00000000..26e6e946
--- /dev/null
+++ b/pc/configpk.sed
@@ -0,0 +1,9 @@
+s/^AC_INIT([[]\{0,1\}\([^],]*\)[]]\{0,1\}, *[[]\{0,1\}\([^],]*\)[]]\{0,1\}, *[[]\{0,1\}\([^],]*\)[]]\{0,1\}, *[[]\{0,1\}\([^],)]*\).*$/\
+s|^#undef PACKAGE_NAME *$|#define PACKAGE_NAME "\1"|\
+s|^#undef VERSION *$|#define VERSION "\2"\|\
+s|^#undef PACKAGE_VERSION *$|#define PACKAGE_VERSION "\2"|\
+s|^#undef PACKAGE_STRING *$|#define PACKAGE_STRING "\1 \2"|\
+s|^#undef PACKAGE_BUGREPORT *$|#define PACKAGE_BUGREPORT "\3"|\
+s|^#undef PACKAGE *$|#define PACKAGE "\4"|\
+s|^#undef PACKAGE_TARNAME *$|#define PACKAGE_TARNAME "\4"|\
+/p
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index 43f81ff9..64b42396 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -547,6 +547,28 @@ usleep(unsigned int usec)
return usec - msecf * 1000 < 0 ? 0 : (int)(usec - msecf * 1000);
}
+/* The implementation of wctob in the MS runtime is problematic
+ because it doesn't allow to distinguish between WEOF and 0xff, due
+ to integer sign extension. It also causes failures in dfa.c when
+ characters with the 8th bit set are involved. This replacement
+ version fixes that. */
+
+#include <wchar.h>
+
+int
+wctob (wint_t wc)
+{
+ char buf[64];
+
+ if (!(MB_CUR_MAX <= sizeof (buf)))
+ abort ();
+ /* Handle the case where WEOF is a value that does not fit in a wchar_t. */
+ if (wc == (wchar_t)wc)
+ if (wctomb (buf, (wchar_t)wc) == 1)
+ return (unsigned char) buf[0];
+ return EOF;
+}
+
#endif /* __MINGW32__ */
#ifdef __DJGPP__
diff --git a/pc/make-config.bat b/pc/make-config.bat
new file mode 100755
index 00000000..d2248048
--- /dev/null
+++ b/pc/make-config.bat
@@ -0,0 +1,6 @@
+@echo off
+sed -n -f configpk.sed < ..\configure.ac > tmp.sed
+sed -f config.sed < ..\configh.in > config.tmp
+sed -f tmp.sed < config.tmp > config.h
+del tmp.sed
+del config.tmp
diff --git a/pc/popen.h b/pc/popen.h
index 99f00169..9a04299c 100644
--- a/pc/popen.h
+++ b/pc/popen.h
@@ -10,4 +10,8 @@
# define pclose(f) os_pclose(f)
extern FILE *os_popen( const char *, const char * );
extern int os_pclose( FILE * );
+# ifdef __MINGW32__
+# define system(c) os_system(c)
+ extern int os_system( const char * );
+# endif /* __MINGW32__ */
#endif /* !__DJGPP__ */