aboutsummaryrefslogtreecommitdiffstats
path: root/pc
diff options
context:
space:
mode:
Diffstat (limited to 'pc')
-rw-r--r--pc/ChangeLog10
-rw-r--r--pc/Makefile8
-rw-r--r--pc/config.sed95
-rw-r--r--pc/gawkmisc.pc10
4 files changed, 83 insertions, 40 deletions
diff --git a/pc/ChangeLog b/pc/ChangeLog
index 6300257c..4d4c9f19 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,13 @@
+2017-08-01 Juan Manuel Guerrero <juan.guerrero@gmx.de>
+
+ Bring DJGPP support up to speed.
+
+ * Makefile: Add LOCALEDIR, infodir, mandir. Revise prefix,
+ SHLIBExT, CFLAGS.
+ * config.sed: Update for DJGPP.
+ * gawkmisc.pc: Update for DJGPP.
+ (putwc): New funcction.
+
2017-01-21 Arnold D. Robbins <arnold@skeeve.com>
* gawkmisc.pc: Fix a typo.
diff --git a/pc/Makefile b/pc/Makefile
index 921f320a..f91e9748 100644
--- a/pc/Makefile
+++ b/pc/Makefile
@@ -81,7 +81,10 @@ prefix = c:/gnu
pkgdatadir = $(prefix)/lib/awk
pkgextensiondir = $(prefix)/lib/gawk
DEFLIBPATH = "\"$(pkgextensiondir)\""
+LOCALEDIR="\"$(prefix)/share/locale\""
SHLIBEXT = "\"dll\""
+infodir = $(prefix)/share/info
+mandir = $(prefix)/share/man
#
# Define the install method. Method 1 is Unix-like (and requires cat
# and cp); method 2 uses gawk and batch files.
@@ -103,8 +106,9 @@ VPATH = .;./support
#========================================================================
ifneq ($(DJGPP),)
-prefix = $(DJDIR)
+prefix = /dev/env/DJDIR
pkgdatadir = $(prefix)/share/awk
+SHLIBEXT = "\"dxe\""
endif
LDJG = $(CC) $(LF) -o gawk.exe $(LDRSP) $(LF2)
BDJG = stubify -g awk.exe | stubedit awk.exe runfile=gawk
@@ -201,7 +205,7 @@ BIND = EMPTY
PBIND = EMPTY
EMPTY=
-CFLAGS = $(CF) -DGAWK -I. -I./support -DHAVE_CONFIG_H -DDEFLIBPATH=$(DEFLIBPATH) -DSHLIBEXT=$(SHLIBEXT)
+CFLAGS = $(CF) -DGAWK -I. -I./support -DHAVE_CONFIG_H -DDEFLIBPATH=$(DEFLIBPATH) -DSHLIBEXT=$(SHLIBEXT) -DLOCALEDIR=$(LOCALEDIR)
# object files
AWKOBJS1 = array$O builtin$O eval$O field$O floatcomp$O gawkmisc$O io$O main$O
diff --git a/pc/config.sed b/pc/config.sed
index ae2200c6..8eced744 100644
--- a/pc/config.sed
+++ b/pc/config.sed
@@ -51,11 +51,11 @@ s/^#undef HAVE_FMOD *$/#define HAVE_FMOD 1/
#define HAVE_GETADDRINFO 1\
#endif
/^#undef HAVE_INTMAX_T *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_INTMAX_T 1\
#endif
/^#undef HAVE_INTTYPES_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_INTTYPES_H 1\
#endif
/^#undef HAVE_INTTYPES_H_WITH_UINTMAX *$/c\
@@ -63,7 +63,7 @@ s/^#undef HAVE_FMOD *$/#define HAVE_FMOD 1/
#define HAVE_INTTYPES_H_WITH_UINTMAX 1\
#endif
/^#undef HAVE_ISASCII *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_ISASCII 1\
#endif
/^#undef HAVE_ISWCTYPE *$/c\
@@ -83,7 +83,7 @@ s/^#undef HAVE_LIBM *$/#define HAVE_LIBM 1/
/* #undef HAVE_LIBREADLINE */
s/^#undef HAVE_LIMITS_H *$/#define HAVE_LIMITS_H 1/
/^#undef HAVE_LOCALE_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_LOCALE_H 1\
#endif
/^#undef HAVE_LONG_LONG *$/c\
@@ -101,9 +101,13 @@ s/^#undef HAVE_LIMITS_H *$/#define HAVE_LIMITS_H 1/
s/^#undef HAVE_MEMCMP *$/#define HAVE_MEMCMP 1/
s/^#undef HAVE_MEMCPY *$/#define HAVE_MEMCPY 1/
/^#undef HAVE_MEMMOVE *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_MEMMOVE 1\
#endif
+/^#undef HAVE_MEMORY_H *$/c\
+#ifdef __DJGPP__\
+#define HAVE_MEMORY_H 1\
+#endif
s/^#undef HAVE_MEMSET *$/#define HAVE_MEMSET 1/
/^#undef HAVE_MKSTEMP *$/c\
#ifdef __DJGPP__\
@@ -117,11 +121,11 @@ s/^#undef HAVE_MKTIME *$/#define HAVE_MKTIME 1/
#define HAVE_SETENV 1\
#endif
/^#undef HAVE_SETLOCALE *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_SETLOCALE 1\
#endif
/^#undef HAVE_SNPRINTF *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_SNPRINTF 1\
#endif
/^#undef HAVE_SOCKADDR_STORAGE *$/c\
@@ -133,18 +137,30 @@ s/^#undef HAVE_MKTIME *$/#define HAVE_MKTIME 1/
#define HAVE_SOCKETS 1\
#endif
s/^#undef HAVE_STDARG_H *$/#define HAVE_STDARG_H 1/
+/^#undef HAVE_STDBOOL_H *$/c\
+#ifdef __DJGPP__\
+#define HAVE_STDBOOL_H 1\
+#endif
/^#undef HAVE_STDDEF_H *$/c\
#ifdef __GNUC__\
#define HAVE_STDDEF_H 1\
#endif
/^#undef HAVE_STDINT_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_STDINT_H 1\
#endif
/^#undef HAVE_STDLIB_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_STDLIB_H 1\
#endif
+/^#undef HAVE_STRCASECMP *$/c\
+#ifdef __DJGPP__\
+#define HAVE_STRCASECMP 1\
+#endif
+/^#undef HAVE_STRCOLL *$/c\
+#ifdef __DJGPP__\
+#define HAVE_STRCOLL 1\
+#endif
s/^#undef HAVE_STRCHR *$/#define HAVE_STRCHR 1/
s/^#undef HAVE_STRERROR *$/#define HAVE_STRERROR 1/
/^#undef HAVE_STRFTIME *$/c\
@@ -164,16 +180,24 @@ s/^#undef HAVE_STRING_H *$/#define HAVE_STRING_H 1/
#endif
s/^#undef HAVE_STRTOD *$/#define HAVE_STRTOD 1/
/^#undef HAVE_STRTOUL *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_STRTOUL 1\
#endif
+/^#undef HAVE_STRUCT_STAT_ST_BLKSIZE *$/c\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1\
+#endif
+/^#undef HAVE_SYS_IOCTL_H *$/c\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
+#define HAVE_SYS_IOCTL_H 1\
+#endif
s/^#undef HAVE_SYSTEM *$/#define HAVE_SYSTEM 1/
/^#undef HAVE_SYS_PARAM_H *$/c\
-#ifndef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_SYS_PARAM_H 1\
#endif
/^#undef HAVE_SYS_STAT_H *$/c\
-#ifdef __MINGW32__\
+#if defined(__MINGW32__) || defined(__DJGPP__)\
#define HAVE_SYS_STAT_H 1\
#endif
/^#undef HAVE_SYS_TIME_H *$/c\
@@ -185,6 +209,10 @@ s/^#undef HAVE_SYS_TYPES_H *$/#define HAVE_SYS_TYPES_H 1/
#ifdef __DJGPP__\
#define HAVE_SYS_WAIT_H 1\
#endif
+/^#undef HAVE_TMPFILE *$/c\
+#ifdef __DJGPP__\
+#define HAVE_TMPFILE 1\
+#endif
/^#undef HAVE_TOWLOWER *$/c\
#ifdef __MINGW32__\
#define HAVE_TOWLOWER 1\
@@ -198,9 +226,6 @@ s/^#undef HAVE_TZSET *$/#define HAVE_TZSET 1/
/^#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__)\
@@ -240,6 +265,14 @@ s/^#undef HAVE_VPRINTF *$/#define HAVE_VPRINTF 1/
#ifdef __MINGW32__\
#define HAVE_WINT_T 1\
#endif
+/^#undef HAVE__BOOL *$/c\
+#ifdef __DJGPP__\
+#define HAVE__BOOL 1\
+#endif
+/^#undef PRINTF_HAS_F_FORMAT *$/c\
+#ifdef __DJGPP__\
+#define PRINTF_HAS_F_FORMAT 1\
+#endif
s/^#undef PROTOTYPES *$/#define PROTOTYPES 1/
s/^#undef RETSIGTYPE *$/#define RETSIGTYPE void/
/^#.*RETSIGTYPE /a\
@@ -255,40 +288,26 @@ s/^#undef TIME_WITH_SYS_TIME *$/#define TIME_WITH_SYS_TIME 1/
#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\
+#ifdef __DJGPP__\
+/* gcc no longer includes this by default */\
+# include <sys/version.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"\
+# if (__DJGPP__ > 2 || __DJGPP_MINOR__ >= 3)\
+# define DEFPATH ".;/dev/env/DJDIR/share/awk"\
+# else\
+# define DEFPATH ".;c:/lib/awk;c:/gnu/lib/awk"\
+# endif\
#endif\
\
#ifndef __DJGPP__\
#define HAVE_POPEN_H 1\
#endif\
\
-#if defined(__DJGPP__)\
-typedef unsigned int uint32_t;\
-typedef int int32_t;\
-#define INT32_MAX INT_MAX\
-#define INT32_MIN INT_MIN\
-#endif\
-\
#if defined(__EMX__)\
#define strcasecmp stricmp\
#define strncasecmp strnicmp\
diff --git a/pc/gawkmisc.pc b/pc/gawkmisc.pc
index c6c92a46..41ffd5ec 100644
--- a/pc/gawkmisc.pc
+++ b/pc/gawkmisc.pc
@@ -299,6 +299,7 @@ os_is_setuid()
#ifdef __DJGPP__
#include <sys/exceptn.h>
+#include <io.h>
#endif
static int orig_tty_mode = -1;
@@ -996,6 +997,7 @@ init_sockets(void)
#ifdef __DJGPP__
+# if __DJGPP__ == 2 && __DJGPP_MINOR__ < 4
int
unsetenv (const char *name)
{
@@ -1004,6 +1006,7 @@ unsetenv (const char *name)
return putenv (name);
}
+#endif
/* This is needed to defeat too-clever GCC warnings in dfa.c about
comparison being always false due to limited range of data type. */
@@ -1013,4 +1016,11 @@ btowc (int c)
return c;
}
+wint_t
+putwc(wchar_t wc, FILE *stream)
+{
+ return MB_CUR_MAX == 1 && wc > 0 && wc <= UCHAR_MAX
+ && putc((unsigned char)wc, stream) != EOF ? (wint_t)wc : WEOF;
+}
+
#endif /* __DJGPP__ */