This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cross-compiler from gcc-2.7.2.2 with cygwin32.


> 
> Hi all,
> I am a newbie so please be kind.
> Has anyone built a cygwin32 hosted cross compiler using gnu-win32 b18 as
> the build machine?  I am able to successfully build binutils-2.8.1 but
> the configuration for gcc does not understand cygwin32 as a host.  I

Yes the configure stuff is not set up properly in gcc-2.7.2.2 for cygwin32.
You can build a toolchain from binutils-2.7 (2.8.1 as well likely, but I've
not tested that) gcc-2.7.2.2 and gdb-4.16 cross to another target by using
--host=cygwin32 for binutils and gdb, and using --host=gnuwin32 for gcc.
You may also need pieces of the patches attached.  Note that these patches
are for a specific target (PalmPilot PDA), and are applied after the patches 
for that specific target are applied.  Thus they may fail, but it should 
get you started...

Jeff.
jeff@pfnet.com

> would like to use the 'vanilla' gcc-2.7.2.2 source if possible but am
> open to suggestions.  What is involved in adding this host type?
> Thanks,
> Jim
> -
> For help on using this list (especially unsubscribing), send a message to
> "gnu-win32-request@cygnus.com" with one line of text: "help".
> 

===============for gcc-2.7.2.2
diff -r -c orig/gcc-2.7.2.2/config/xm-gnu.h gcc-2.7.2.2/config/xm-gnu.h
*** orig/gcc-2.7.2.2/config/xm-gnu.h	Thu Jun 15 12:54:14 1995
--- gcc-2.7.2.2/config/xm-gnu.h	Mon Jun 23 08:56:16 1997
***************
*** 24,30 ****
--- 24,33 ----
     CPU/xm-CPU.h and this file xm-gnu.h.  */
  
  #define HAVE_STRERROR		/* GNU has strerror.  */
+ 
+ #ifndef POSIX
  #define POSIX			/* GNU complies to POSIX.1.  */
+ #endif
  
  /* Get a definition of O_RDONLY; some of the GCC files don't include this
     properly and will define it themselves to be zero. */
diff -r -c orig/gcc-2.7.2.2/dbxout.c gcc-2.7.2.2/dbxout.c
*** orig/gcc-2.7.2.2/dbxout.c	Thu Jun 15 11:27:10 1995
--- gcc-2.7.2.2/dbxout.c	Mon Jun 23 08:53:52 1997
***************
*** 156,162 ****
  #define FORCE_TEXT
  #endif
  
! #if defined (USG) || defined (NO_STAB_H)
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */
--- 156,162 ----
  #define FORCE_TEXT
  #endif
  
! #if 1 /* defined (USG) || defined (NO_STAB_H) */
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */
diff -r -c orig/gcc-2.7.2.2/final.c gcc-2.7.2.2/final.c
*** orig/gcc-2.7.2.2/final.c	Sun Nov 26 18:50:00 1995
--- gcc-2.7.2.2/final.c	Mon Jun 23 08:54:00 1997
***************
*** 70,76 ****
  
  /* Get N_SLINE and N_SOL from stab.h if we can expect the file to exist.  */
  #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
! #if defined (USG) || defined (NO_STAB_H)
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */
--- 70,76 ----
  
  /* Get N_SLINE and N_SOL from stab.h if we can expect the file to exist.  */
  #if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
! #if 1 /* defined (USG) || defined (NO_STAB_H) */
  #include "gstab.h"  /* If doing DBX on sysV, use our own stab.h.  */
  #else
  #include <stab.h>  /* On BSD, use the system's stab.h.  */
diff -r -c orig/gcc-2.7.2.2/gcc.c gcc-2.7.2.2/gcc.c
*** orig/gcc-2.7.2.2/gcc.c	Tue Sep 12 21:15:10 1995
--- gcc-2.7.2.2/gcc.c	Mon Jun 23 08:55:16 1997
***************
*** 37,43 ****
  #include <sys/stat.h>
  #include <errno.h>
  
! #ifndef _WIN32
  #include <sys/file.h>   /* May get R_OK, etc. on some systems.  */
  #else
  #include <process.h>
--- 37,43 ----
  #include <sys/stat.h>
  #include <errno.h>
  
! #if 1 /* ndef _WIN32 */
  #include <sys/file.h>   /* May get R_OK, etc. on some systems.  */
  #else
  #include <process.h>
***************
*** 2022,2028 ****
  
  #endif
  
! #if !defined(__MSDOS__) && !defined(OS2) && !defined(_WIN32)
  
  static int
  pexecute (search_flag, program, argv, not_last)
--- 2022,2028 ----
  
  #endif
  
! #if !defined(__MSDOS__) && !defined(OS2) /* && !defined(_WIN32) */
  
  static int
  pexecute (search_flag, program, argv, not_last)
***************
*** 2127,2133 ****
  }
  #endif /* OS2 */
  
! #if defined(_WIN32)
  
  static int
  pexecute (search_flag, program, argv, not_last)
--- 2127,2133 ----
  }
  #endif /* OS2 */
  
! #if 0 /* defined(_WIN32) */
  
  static int
  pexecute (search_flag, program, argv, not_last)
***************
*** 2262,2268 ****
  #ifdef __MSDOS__
          status = pid = commands[i].pid;
  #else
! #ifdef _WIN32
  	pid = cwait (&status, commands[i].pid, WAIT_CHILD);
  #else
  	pid = wait (&status);
--- 2262,2268 ----
  #ifdef __MSDOS__
          status = pid = commands[i].pid;
  #else
! #if 0 /* def _WIN32 */
  	pid = cwait (&status, commands[i].pid, WAIT_CHILD);
  #else
  	pid = wait (&status);
diff -r -c orig/gcc-2.7.2.2/getpwd.c gcc-2.7.2.2/getpwd.c
*** orig/gcc-2.7.2.2/getpwd.c	Tue May 16 22:25:04 1995
--- gcc-2.7.2.2/getpwd.c	Mon Jun 23 08:54:12 1997
***************
*** 29,35 ****
  #define GUESSPATHLEN 100
  #endif /* (defined (USG) || defined (VMS)) */
  #ifdef _WIN32
! #include <direct.h>
  #endif
  
  char *getenv ();
--- 29,35 ----
  #define GUESSPATHLEN 100
  #endif /* (defined (USG) || defined (VMS)) */
  #ifdef _WIN32
! #include <dirent.h>
  #endif
  
  char *getenv ();
diff -r -c orig/gcc-2.7.2.2/Makefile.in gcc-2.7.2.2/Makefile.in
*** orig/gcc-2.7.2.2/Makefile.in	Sun Nov 26 19:44:24 1995
--- gcc-2.7.2.2/Makefile.in	Mon Jun 23 09:00:26 1997
***************
*** 35,41 ****
  
  # Selection of languages to be made.
  # This is overridden by configure.
! LANGUAGES = c objective-c proto
  
  ALLOCA =
  ALLOCA_FLAGS =
--- 35,41 ----
  
  # Selection of languages to be made.
  # This is overridden by configure.
! LANGUAGES = c
  
  ALLOCA =
  ALLOCA_FLAGS =
***************
*** 56,62 ****
  X_CPPFLAGS =
  T_CPPFLAGS =
  
! CC = cc
  BISON = bison
  BISONFLAGS =
  LEX = flex
--- 56,62 ----
  X_CPPFLAGS =
  T_CPPFLAGS =
  
! CC = gcc
  BISON = bison
  BISONFLAGS =
  LEX = flex
***************
*** 207,213 ****
  # Extension (if any) to put in installed man-page filename.
  manext = .1
  objext = .o
! exeext =
  
  # Directory in which to put man pages.
  mandir = $(prefix)/man/man1
--- 207,213 ----
  # Extension (if any) to put in installed man-page filename.
  manext = .1
  objext = .o
! exeext = .exe
  
  # Directory in which to put man pages.
  mandir = $(prefix)/man/man1
***************
*** 2205,2211 ****
  # Install the include directory using tar.
  install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir
  	(cd include; \
! 	 tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - )
  # /bin/sh on some systems returns the status of the first tar,
  # and that can lose with GNU tar which always writes a full block.
  # So use `exit 0' to ignore its exit status.
--- 2205,2211 ----
  # Install the include directory using tar.
  install-headers-tar: stmp-headers $(STMP_FIXPROTO) install-include-dir
  	(cd include; \
! 	 tar -cf - .; exit 0) | (cd $(libsubdir)/include; tar $(TAROUTOPTS) - ; exit 0)
  # /bin/sh on some systems returns the status of the first tar,
  # and that can lose with GNU tar which always writes a full block.
  # So use `exit 0' to ignore its exit status.
===============for binutils-2.7
diff -r -c orig/binutils-2.7/install.sh binutils-2.7/install.sh
*** orig/binutils-2.7/install.sh	Thu Jul 04 16:22:00 1996
--- binutils-2.7/install.sh	Mon Jun 23 09:34:50 1997
***************
*** 49,54 ****
--- 49,55 ----
  src=""
  dst=""
  dir_arg=""
+ exe_flag="true"
  
  while [ x"$1" != x ]; do
      case $1 in
***************
*** 61,66 ****
--- 62,68 ----
  	    continue;;
  
  	-m) chmodcmd="$chmodprog $2"
+ 	    exe_flag=""
  	    shift
  	    shift
  	    continue;;
***************
*** 147,152 ****
--- 149,164 ----
  		dst="$dst"/`basename $src`
  	else
  		true
+ 	fi
+ 
+ 	if [ x$exe_flag != x ]
+ 	then
+ 		dst=$dst.exe
+ 	fi
+ 
+ 	if [ -f $src.exe ]
+ 	then
+ 		src=$src.exe
  	fi
  fi
  
===============for gdb-4.16
diff -urN gdb-4.16.orig/gdb/config/i386/cygwin32.mh gdb-4.16/gdb/config/i386/cygwin32.mh
--- gdb-4.16.orig/gdb/config/i386/cygwin32.mh	Thu Feb  1 13:38:32 1996
+++ gdb-4.16/gdb/config/i386/cygwin32.mh	Mon Jul  7 21:24:05 1997
@@ -1,6 +1,6 @@
 MH_CFLAGS=
 XM_FILE=xm-cygwin32.h
 TERMCAP= 
-NATDEPFILES=win32-nat.o
+NATDEPFILES=# win32-nat.o
 XM_CLIBS=-lkernel32
-
+XDEPFILES= ser-tcp.o
diff -urN gdb-4.16.orig/gdb/ser-tcp.c gdb-4.16/gdb/ser-tcp.c
--- gdb-4.16.orig/gdb/ser-tcp.c	Sat Mar 30 00:58:50 1996
+++ gdb-4.16/gdb/ser-tcp.c	Mon Jul  7 21:19:29 1997
@@ -25,7 +25,9 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <sys/socket.h>
+#ifndef _WIN32
 #include <netinet/tcp.h>
+#endif
 #include "signals.h"
 #include "gdb_string.h"
 
diff -urN gdb-4.16.orig/gdb/utils.c gdb-4.16/gdb/utils.c
--- gdb-4.16.orig/gdb/utils.c	Tue Apr 23 00:35:13 1996
+++ gdb-4.16/gdb/utils.c	Mon Jul  7 21:08:49 1997
@@ -1887,20 +1887,24 @@
 	if (status > 0)
 	  {
 	    int val;
-	    
+
+#ifndef __CYGWIN32__
 	    val = tgetnum ("li");
 	    if (val >= 0)
 	      lines_per_page = val;
 	    else
+#endif
 	      /* The number of lines per page is not mentioned
 		 in the terminal description.  This probably means
 		 that paging is not useful (e.g. emacs shell window),
 		 so disable paging.  */
 	      lines_per_page = UINT_MAX;
 	    
+#ifndef __CYGWIN32__
 	    val = tgetnum ("co");
 	    if (val >= 0)
 	      chars_per_line = val;
+#endif
 	  }
       }
   }
diff -urN gdb-4.16.orig/readline/ChangeLog gdb-4.16/readline/ChangeLog
--- gdb-4.16.orig/readline/ChangeLog	Mon Apr  8 01:25:05 1996
+++ gdb-4.16/readline/ChangeLog	Mon Jul  7 21:08:49 1997
@@ -1,9 +1,76 @@
+Tue Oct  8 08:59:24 1996  Stu Grossman  (grossman@critters.cygnus.com)
+
+	* tilde.c (tilde_word_expand):  __MSDOS___ -> __MSDOS__
+
+Sat Oct 05 11:24:34 1996  Mark Alexander  <marka@cygnus.com>
+
+	* rldefs.h: On Linux, include <termios.h> to fix compile error
+	in <termcap.h>.
+
+Wed Sep  4 18:06:51 1996  Stu Grossman  (grossman@critters.cygnus.com)
+
+	* rldefs.h:  Enable HANDLE_SIGNALS for cygwin32.
+
+Thu Aug 29 16:59:45 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
+
+	* configure.in (i[345]86-*-*): Recognize i686 for pentium pro.
+
+Fri Aug 16 17:49:57 1996  Stu Grossman  (grossman@critters.cygnus.com)
+
+	* complete.c:  Include <pwd.h> if not DOS, and if cygwin32 or not
+	win32.
+	* configure.in:  Add test for *-*-cygwin32* to use config/mh-posix.
+	* readline.c:  Move decl of tgetstr to rldefs.h.
+	* (_rl_set_screen_size):  Remove redundant ifdef MINIMALs.
+	* rldefs.h:  Don't do MINIMAL for cygwin32.  Cygwin32 now uses
+	full-blown readline, except for termcap.
+
+Sun Aug 11 21:06:26 1996  Stu Grossman  (grossman@critters.cygnus.com)
+
+	* rldefs.c:  Get rid of define of SIGALRM if _WIN32 or __MSDOS__.
+	* Don't define ScreenCols/ScreenRows/... if cygwin32.
+	* sysdep-norm.h:  Don't include <malloc.h> if cygwin32.
+
+Sun Aug 11 14:59:09 1996  Fred Fish  <fnf@cygnus.com>
+
+	* rldefs.h:  If __osf__is defined, include <termio.h> instead of
+	<sgtty.h>.
+
+Fri Aug  9 08:54:26 1996  Stu Grossman  (grossman@critters.cygnus.com)
+
+	* bind.c complete.c history.c readline.c:  Don't include sys/file.h.
+	* complete.c display.c parens.c readline.c rldefs.h rltty.c
+	signals.c tilde.c:  Change refs to _MSC_VER and __WIN32__ to _WIN32.
+	* signals.c (rl_signal_handler):  Ifdef out kill if _WIN32.
+	* sysdep-norm.h:  Ifdef out include of dirent.h if _WIN32.
+	Include malloc.h if _WIN32.
+
+Thu Jul 18 15:59:35 1996  Michael Meissner  <meissner@tiktok.cygnus.com>
+
+	* rldefs.h (sys/uio.h) Before sys/stream.h is included under AIX,
+	include sys/uio.h, which prevents an undefined structure used in a
+	prototype message from being generated.
+
+Tue Jun 25 23:05:55 1996  Jason Molenda  (crash@godzilla.cygnus.co.jp)
+
+        * Makefile.in (datadir): Set to $(prefix)/share.
+	(docdir): Removed.
+
+Sun May 26 15:14:42 1996  Fred Fish  <fnf@cygnus.com>
+
+	From: David Mosberger-Tang  <davidm@azstarnet.com>
+
+	* sysdep-linux.h: New file.
+	* display.c: Add include of "sysdep.h" to get HAVE_VARARGS_H.
+	* configure.in: Change pattern i[345]86-*-linux* into *-*-linux* to
+	support non-x86 based Linux platforms.
+
 Sun Apr  7 22:06:11 1996  Fred Fish  <fnf@cygnus.com>
 
 	From: Miles Bader  <miles@gnu.ai.mit.edu>
 	* config/mh-gnu: New file.
 	* configure.in (*-*-gnu*): New host.
-	
+
 Sun Apr  7 13:21:51 1996  Fred Fish  <fnf@cygnus.com>
 
 	From: Robert Lipe <robertl@dgii.com>
diff -urN gdb-4.16.orig/readline/Makefile.in gdb-4.16/readline/Makefile.in
--- gdb-4.16.orig/readline/Makefile.in	Tue Oct 10 16:44:02 1995
+++ gdb-4.16/readline/Makefile.in	Mon Jul  7 21:08:49 1997
@@ -29,7 +29,7 @@
 bindir = $(exec_prefix)/bin
 libdir = $(exec_prefix)/lib
 
-datadir = $(prefix)/lib
+datadir = $(prefix)/share
 mandir = $(prefix)/man
 man1dir = $(mandir)/man1
 man2dir = $(mandir)/man2
@@ -42,7 +42,6 @@
 man9dir = $(mandir)/man9
 infodir = $(prefix)/info
 includedir = $(prefix)/include
-docdir = $(datadir)/doc
 
 SHELL = /bin/sh
 
diff -urN gdb-4.16.orig/readline/bind.c gdb-4.16/readline/bind.c
--- gdb-4.16.orig/readline/bind.c	Thu Feb 24 07:19:01 1994
+++ gdb-4.16/readline/bind.c	Mon Jul  7 21:08:49 1997
@@ -23,9 +23,6 @@
 #include "sysdep.h"
 #include <stdio.h>
 #include <fcntl.h>
-#ifndef	NO_SYS_FILE
-#include <sys/file.h>
-#endif
 
 #include <errno.h>
 /* Not all systems declare ERRNO in errno.h... and some systems #define it! */
diff -urN gdb-4.16.orig/readline/complete.c gdb-4.16/readline/complete.c
--- gdb-4.16.orig/readline/complete.c	Wed Jan  3 21:48:22 1996
+++ gdb-4.16/readline/complete.c	Mon Jul  7 21:08:49 1997
@@ -23,9 +23,6 @@
 #include "sysdep.h"
 #include <stdio.h>
 #include <fcntl.h>
-#if !defined (NO_SYS_FILE)
-#  include <sys/file.h>
-#endif /* !NO_SYS_FILE */
 
 #include <errno.h>
 /* Not all systems declare ERRNO in errno.h... and some systems #define it! */
@@ -35,7 +32,7 @@
 
 /* These next are for filename completion.  Perhaps this belongs
    in a different place. */
-#if !defined(__MSDOS__) && !defined(_MSC_VER)
+#if !defined __MSDOS__ && (defined __CYGWIN32__ || ! defined _WIN32)
 #include <pwd.h>
 #endif /* __MSDOS__ */
 #if defined (USG) && !defined (isc386) && !defined (sgi)
@@ -1047,7 +1044,7 @@
      int state;
      char *text;
 {
-#if !defined(__WIN32__) && !defined(_MSC_VER)
+#if !defined(_WIN32)
   static DIR *directory;
   static char *filename = (char *)NULL;
   static char *dirname = (char *)NULL;
diff -urN gdb-4.16.orig/readline/configure.in gdb-4.16/readline/configure.in
--- gdb-4.16.orig/readline/configure.in	Mon Apr  8 01:17:28 1996
+++ gdb-4.16/readline/configure.in	Mon Jul  7 21:08:49 1997
@@ -13,8 +13,9 @@
 links=sysdep.h
 
 case "${host}" in
+  *-*-cygwin32*)	host_makefile_frag=config/mh-posix ;;
   *-*-irix*)		host_makefile_frag=config/mh-sysv; files=sysdep-irix.h;;
-  i[345]86-ncr-sysv4*)	host_makefile_frag=config/mh-ncr3000 ;;
+  i[3456]86-ncr-sysv4*)	host_makefile_frag=config/mh-ncr3000 ;;
 # Using sysdep-norm.h is harmful because termio.h defines VWERASE even though
 # c_cc is too small for it (VWERASE is for termios).
 # The problem with _POSIX_SOURCE is said not to be a problem after all.
@@ -25,17 +26,17 @@
   m88*-harris-cxux7*)	host_makefile_frag=config/mh-sysv4 ; files=sysdep-cxux7.h ;;
   *-*-sysv4*)		host_makefile_frag=config/mh-sysv4 ; files=sysdep-sysv4.h ;;
   *-*-solaris2*)	host_makefile_frag=config/mh-sysv4 ;;
-  i[345]86-*-sco3.2v[45]*)	host_makefile_frag=config/mh-sco4; files=sysdep-sco.h ;;
-  i[345]86-*-sco*)	host_makefile_frag=config/mh-sco; files=sysdep-sco.h ;;
+  i[3456]86-*-sco3.2v[45]*)	host_makefile_frag=config/mh-sco4; files=sysdep-sco.h ;;
+  i[3456]86-*-sco*)	host_makefile_frag=config/mh-sco; files=sysdep-sco.h ;;
 # Don't use this; ISC 4.0 only supports POSIX features if you link with
 # -lcposix.  No thanks.
-#  i[345]86-*-isc*)	host_makefile_frag=config/mh-isc ;;
-  i[345]86-*-isc*)	host_makefile_frag=config/mh-sysv ;;
+#  i[3456]86-*-isc*)	host_makefile_frag=config/mh-isc ;;
+  i[3456]86-*-isc*)	host_makefile_frag=config/mh-sysv ;;
   *-*-go32)		host_makefile_frag=config/mh-go32 ;;
   m68k-apollo-sysv*)	host_makefile_frag=config/mh-apollo68v ;;    
   *-*-sysv*)		host_makefile_frag=config/mh-sysv ;;
   *-*-m88kbcs*)		host_makefile_frag=config/mh-sysv ;;
-  i[345]86-*-linux*)	host_makefile_frag=config/mh-posix ;;
+  *-*-linux*)		host_makefile_frag=config/mh-posix ;;
   powerpc-ibm-aix*)	host_makefile_frag=config/mh-sysv; files=sysdep-aix.h ;;
   rs6000-ibm-aix*)	host_makefile_frag=config/mh-sysv; files=sysdep-aix.h ;;
   rs6000-bull-bosx*)	host_makefile_frag=config/mh-sysv; files=sysdep-aix.h ;;
diff -urN gdb-4.16.orig/readline/display.c gdb-4.16/readline/display.c
--- gdb-4.16.orig/readline/display.c	Wed Jan  3 21:48:22 1996
+++ gdb-4.16/readline/display.c	Mon Jul  7 21:08:49 1997
@@ -20,6 +20,7 @@
    have a copy of the license, write to the Free Software Foundation,
    675 Mass Ave, Cambridge, MA 02139, USA. */
 
+#include "sysdep.h"
 #include <stdio.h>
 #include <sys/types.h>
 
@@ -521,7 +522,7 @@
      of moving backwards. */
   if (new + 1 < _rl_last_c_pos - new)
     {
-#if defined(__MSDOS__) || defined(__WIN32__) || defined (_MSC_VER)
+#if defined(__MSDOS__) || defined(_WIN32)
       putc('\r', rl_outstream);
 #else
       tputs (term_cr, 1, _rl_output_character_function);
@@ -734,8 +735,7 @@
      char *string;
      int count;
 {
-#if defined(__WIN32__) || defined(_MSC_VER)
-
+#if defined(_WIN32)
 #else
 #if defined (__GO32__)
   int row, col, width;
@@ -791,7 +791,7 @@
 delete_chars (count)
      int count;
 {
-#if defined(__WIN32__) || defined(_MSC_VER)
+#if defined(_WIN32)
 
 #else
 #if defined (__GO32__)
diff -urN gdb-4.16.orig/readline/foo gdb-4.16/readline/foo
--- gdb-4.16.orig/readline/foo	Wed Dec 31 19:00:00 1969
+++ gdb-4.16/readline/foo	Mon Jul  7 21:08:49 1997
@@ -0,0 +1,256 @@
+--- bind.c	Tue Apr 15 04:23:30 1997
++++ /home/jeff/pilot-tst/src/gdb-4.16/readline/bind.c	Thu Feb 24 07:19:01 1994
+@@ -23,6 +23,9 @@
+ #include "sysdep.h"
+ #include <stdio.h>
+ #include <fcntl.h>
++#ifndef	NO_SYS_FILE
++#include <sys/file.h>
++#endif
+ 
+ #include <errno.h>
+ /* Not all systems declare ERRNO in errno.h... and some systems #define it! */
+--- complete.c	Tue Apr 15 04:23:30 1997
++++ /home/jeff/pilot-tst/src/gdb-4.16/readline/complete.c	Wed Jan  3 21:48:22 1996
+@@ -23,6 +23,9 @@
+ #include "sysdep.h"
+ #include <stdio.h>
+ #include <fcntl.h>
++#if !defined (NO_SYS_FILE)
++#  include <sys/file.h>
++#endif /* !NO_SYS_FILE */
+ 
+ #include <errno.h>
+ /* Not all systems declare ERRNO in errno.h... and some systems #define it! */
+@@ -32,7 +35,7 @@
+ 
+ /* These next are for filename completion.  Perhaps this belongs
+    in a different place. */
+-#if !defined __MSDOS__ && (defined __CYGWIN32__ || ! defined _WIN32)
++#if !defined(__MSDOS__) && !defined(_MSC_VER)
+ #include <pwd.h>
+ #endif /* __MSDOS__ */
+ #if defined (USG) && !defined (isc386) && !defined (sgi)
+@@ -1044,7 +1047,7 @@
+      int state;
+      char *text;
+ {
+-#if !defined(_WIN32)
++#if !defined(__WIN32__) && !defined(_MSC_VER)
+   static DIR *directory;
+   static char *filename = (char *)NULL;
+   static char *dirname = (char *)NULL;
+--- display.c	Tue Apr 15 04:23:30 1997
++++ /home/jeff/pilot-tst/src/gdb-4.16/readline/display.c	Wed Jan  3 21:48:22 1996
+@@ -20,7 +20,6 @@
+    have a copy of the license, write to the Free Software Foundation,
+    675 Mass Ave, Cambridge, MA 02139, USA. */
+ 
+-#include "sysdep.h"
+ #include <stdio.h>
+ #include <sys/types.h>
+ 
+@@ -522,7 +521,7 @@
+      of moving backwards. */
+   if (new + 1 < _rl_last_c_pos - new)
+     {
+-#if defined(__MSDOS__) || defined(_WIN32)
++#if defined(__MSDOS__) || defined(__WIN32__) || defined (_MSC_VER)
+       putc('\r', rl_outstream);
+ #else
+       tputs (term_cr, 1, _rl_output_character_function);
+@@ -735,7 +734,8 @@
+      char *string;
+      int count;
+ {
+-#if defined(_WIN32)
++#if defined(__WIN32__) || defined(_MSC_VER)
++
+ #else
+ #if defined (__GO32__)
+   int row, col, width;
+@@ -791,7 +791,7 @@
+ delete_chars (count)
+      int count;
+ {
+-#if defined(_WIN32)
++#if defined(__WIN32__) || defined(_MSC_VER)
+ 
+ #else
+ #if defined (__GO32__)
+--- history.c	Tue Apr 15 04:23:31 1997
++++ /home/jeff/pilot-tst/src/gdb-4.16/readline/history.c	Sun Jun 12 06:54:45 1994
+@@ -42,6 +42,9 @@
+ 
+ extern char *getenv();
+ 
++#ifndef	NO_SYS_FILE
++#include <sys/file.h>
++#endif
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ 
+--- parens.c	Tue Apr 15 04:23:31 1997
++++ /home/jeff/pilot-tst/src/gdb-4.16/readline/parens.c	Tue Oct 31 13:40:32 1995
+@@ -23,7 +23,7 @@
+ #include <stdio.h>
+ #include <sys/types.h>
+ 
+-#if defined(__GO32__) || defined(_WIN32)
++#if defined(__GO32__) || defined(__WIN32__)
+ #undef FD_SET
+ #endif
+ 
+--- readline.c	Tue Apr 15 04:23:31 1997
++++ /home/jeff/pilot-tst/src/gdb-4.16/readline/readline.c	Wed Jan  3 21:48:24 1996
+@@ -24,6 +24,9 @@
+ #include "sysdep.h"
+ #include <stdio.h>
+ #include <fcntl.h>
++#ifndef	NO_SYS_FILE
++#include <sys/file.h>
++#endif
+ #include <signal.h>
+ 
+ /* This is needed to include support for TIOCGWINSZ and window resizing. */
+@@ -59,6 +62,7 @@
+    to be visible to readline callers. */
+ 
+ /* Functions imported from other files in the library. */
++extern char *tgetstr ();
+ extern void rl_prep_terminal (), rl_deprep_terminal ();
+ extern void rl_vi_set_last ();
+ extern Function *rl_function_of_keyseq ();
+@@ -474,7 +478,7 @@
+ void
+ rl_gather_tyi ()
+ {
+-#if defined (MINIMAL) && !defined (_WIN32)
++#if defined (MINIMAL)
+   char input;
+ 
+   if (isatty (0))
+@@ -1149,6 +1153,7 @@
+ _rl_set_screen_size (tty, ignore_env)
+      int tty, ignore_env;
+ {
++#ifndef MINIMAL
+ #if defined (TIOCGWINSZ) && !defined (TIOCGWINSZ_BROKEN)
+   struct winsize window_size;
+ #endif /* TIOCGWINSZ */
+@@ -1204,6 +1209,7 @@
+      don't use the last column. */
+   if (!term_xn)
+     screenwidth--;
++#endif
+ }
+ #endif /* !MINIMAL */
+ 
+@@ -1772,7 +1778,7 @@
+   _rl_move_vert (curr_line);
+   _rl_move_cursor_relative (0, the_line);   /* XXX is this right */
+ 
+-#if defined (_WIN32)
++#if defined (__WIN32__) || defined (_MSC_VER)
+   abort();
+ #else
+ #if defined (__GO32__)
+@@ -3113,7 +3119,7 @@
+   int result;
+   unsigned char c;
+ 
+-#if defined (MINIMAL) && !defined (_WIN32)
++#if defined (MINIMAL)
+   if (isatty (0))
+     return (getkey () & 0x7f);
+ #endif /* MINIMAL */
+--- rltty.c	Tue Apr 15 04:23:31 1997
++++ /home/jeff/pilot-tst/src/gdb-4.16/readline/rltty.c	Sat Oct  7 20:44:06 1995
+@@ -24,6 +24,9 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include <stdio.h>
++#ifndef	NO_SYS_FILE
++#include <sys/file.h>
++#endif
+ 
+ #if defined (HAVE_UNISTD_H)
+ #  include <unistd.h>
+--- signals.c	Tue Apr 15 04:23:31 1997
++++ /home/jeff/pilot-tst/src/gdb-4.16/readline/signals.c	Sat Oct  7 20:44:08 1995
+@@ -23,6 +23,9 @@
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
++#if !defined (NO_SYS_FILE)
++#  include <sys/file.h>
++#endif /* !NO_SYS_FILE */
+ #include <signal.h>
+ 
+ /* This is needed to include support for TIOCGWINSZ and window resizing. */
+@@ -149,9 +152,7 @@
+       rl_clear_signals ();
+       rl_pending_input = 0;
+ 
+-#ifndef _WIN32
+       kill (getpid (), sig);
+-#endif
+ 
+       SIGNALS_UNBLOCK;
+ 
+--- tilde.c	Tue Apr 15 04:23:32 1997
++++ /home/jeff/pilot-tst/src/gdb-4.16/readline/tilde.c	Thu Feb 24 07:19:32 1994
+@@ -27,7 +27,7 @@
+    GDB to add YET ANOTHER -I directive.  No thanks.  */
+ #include "tilde.h"
+ 
+-#if !defined(__MSDOS__) && !defined(_WIN32)
++#ifndef __MSDOS__
+ #include <pwd.h>
+ #endif
+ 
+@@ -218,7 +218,7 @@
+ 	  /* Prepend $HOME to the rest of the string. */
+ 	  char *temp_home = getenv ("HOME");
+ 
+-#if !defined (__MSDOS__) && !defined (_WIN32)
++#ifndef __MSDOS__
+ 	  /* If there is no HOME variable, look up the directory in
+ 	     the password database. */
+ 	  if (!temp_home)
+@@ -242,7 +242,7 @@
+ 	}
+       else
+ 	{
+-#if !defined (__MSDOS__) && !defined (_WIN32)
++#ifndef __MSDOS__
+ 	  struct passwd *user_entry;
+ #endif
+ 	  char *username = (char *)alloca (257);
+@@ -257,7 +257,7 @@
+ 	    }
+ 	  username[i - 1] = '\0';
+ 
+-#if !defined (__MSDOS__) && !defined (_WIN32)
++#ifndef __MSDOS__
+ 	  if (!(user_entry = getpwnam (username)))
+ 	    {
+ #endif
+@@ -281,7 +281,7 @@
+ 		    }
+ 		}
+ 	      /* We shouldn't report errors. */
+-#if !defined (__MSDOS__) && !defined (_WIN32)
++#ifndef __MSDOS__
+ 	    }
+ 	  else
+ 	    {
+@@ -293,7 +293,7 @@
+ 	    return_name:
+ 	      free (dirname);
+ 	      dirname = savestring (temp_name);
+-#if !defined (__MSDOS__) && !defined (_WIN32)
++#ifndef __MSDOS__
+ 	    }
+ 	    endpwent ();
+ #endif
diff -urN gdb-4.16.orig/readline/history.c gdb-4.16/readline/history.c
--- gdb-4.16.orig/readline/history.c	Sun Jun 12 06:54:45 1994
+++ gdb-4.16/readline/history.c	Mon Jul  7 21:08:49 1997
@@ -42,9 +42,6 @@
 
 extern char *getenv();
 
-#ifndef	NO_SYS_FILE
-#include <sys/file.h>
-#endif
 #include <sys/stat.h>
 #include <fcntl.h>
 
diff -urN gdb-4.16.orig/readline/parens.c gdb-4.16/readline/parens.c
--- gdb-4.16.orig/readline/parens.c	Tue Oct 31 13:40:32 1995
+++ gdb-4.16/readline/parens.c	Mon Jul  7 21:08:50 1997
@@ -23,7 +23,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 
-#if defined(__GO32__) || defined(__WIN32__)
+#if defined(__GO32__) || defined(_WIN32)
 #undef FD_SET
 #endif
 
diff -urN gdb-4.16.orig/readline/readline.c gdb-4.16/readline/readline.c
--- gdb-4.16.orig/readline/readline.c	Wed Jan  3 21:48:24 1996
+++ gdb-4.16/readline/readline.c	Mon Jul  7 21:08:50 1997
@@ -24,9 +24,6 @@
 #include "sysdep.h"
 #include <stdio.h>
 #include <fcntl.h>
-#ifndef	NO_SYS_FILE
-#include <sys/file.h>
-#endif
 #include <signal.h>
 
 /* This is needed to include support for TIOCGWINSZ and window resizing. */
@@ -62,7 +59,6 @@
    to be visible to readline callers. */
 
 /* Functions imported from other files in the library. */
-extern char *tgetstr ();
 extern void rl_prep_terminal (), rl_deprep_terminal ();
 extern void rl_vi_set_last ();
 extern Function *rl_function_of_keyseq ();
@@ -478,7 +474,7 @@
 void
 rl_gather_tyi ()
 {
-#if defined (MINIMAL)
+#if defined (MINIMAL) && !defined (_WIN32)
   char input;
 
   if (isatty (0))
@@ -1153,7 +1149,6 @@
 _rl_set_screen_size (tty, ignore_env)
      int tty, ignore_env;
 {
-#ifndef MINIMAL
 #if defined (TIOCGWINSZ) && !defined (TIOCGWINSZ_BROKEN)
   struct winsize window_size;
 #endif /* TIOCGWINSZ */
@@ -1209,7 +1204,6 @@
      don't use the last column. */
   if (!term_xn)
     screenwidth--;
-#endif
 }
 #endif /* !MINIMAL */
 
@@ -1778,7 +1772,7 @@
   _rl_move_vert (curr_line);
   _rl_move_cursor_relative (0, the_line);   /* XXX is this right */
 
-#if defined (__WIN32__) || defined (_MSC_VER)
+#if defined (_WIN32)
   abort();
 #else
 #if defined (__GO32__)
@@ -3119,7 +3113,7 @@
   int result;
   unsigned char c;
 
-#if defined (MINIMAL)
+#if defined (MINIMAL) && !defined (_WIN32)
   if (isatty (0))
     return (getkey () & 0x7f);
 #endif /* MINIMAL */
diff -urN gdb-4.16.orig/readline/readline.patch gdb-4.16/readline/readline.patch
--- gdb-4.16.orig/readline/readline.patch	Wed Dec 31 19:00:00 1969
+++ gdb-4.16/readline/readline.patch	Mon Jul  7 21:08:50 1997
@@ -0,0 +1,389 @@
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/bind.c	Thu Feb 24 07:19:01 1994
++++ bind.c	Tue Apr 15 04:23:30 1997
+@@ -23,9 +23,6 @@
+ #include "sysdep.h"
+ #include <stdio.h>
+ #include <fcntl.h>
+-#ifndef	NO_SYS_FILE
+-#include <sys/file.h>
+-#endif
+ 
+ #include <errno.h>
+ /* Not all systems declare ERRNO in errno.h... and some systems #define it! */
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/complete.c	Wed Jan  3 21:48:22 1996
++++ complete.c	Tue Apr 15 04:23:30 1997
+@@ -23,9 +23,6 @@
+ #include "sysdep.h"
+ #include <stdio.h>
+ #include <fcntl.h>
+-#if !defined (NO_SYS_FILE)
+-#  include <sys/file.h>
+-#endif /* !NO_SYS_FILE */
+ 
+ #include <errno.h>
+ /* Not all systems declare ERRNO in errno.h... and some systems #define it! */
+@@ -35,7 +32,7 @@
+ 
+ /* These next are for filename completion.  Perhaps this belongs
+    in a different place. */
+-#if !defined(__MSDOS__) && !defined(_MSC_VER)
++#if !defined __MSDOS__ && (defined __CYGWIN32__ || ! defined _WIN32)
+ #include <pwd.h>
+ #endif /* __MSDOS__ */
+ #if defined (USG) && !defined (isc386) && !defined (sgi)
+@@ -1047,7 +1044,7 @@
+      int state;
+      char *text;
+ {
+-#if !defined(__WIN32__) && !defined(_MSC_VER)
++#if !defined(_WIN32)
+   static DIR *directory;
+   static char *filename = (char *)NULL;
+   static char *dirname = (char *)NULL;
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/display.c	Wed Jan  3 21:48:22 1996
++++ display.c	Tue Apr 15 04:23:30 1997
+@@ -20,6 +20,7 @@
+    have a copy of the license, write to the Free Software Foundation,
+    675 Mass Ave, Cambridge, MA 02139, USA. */
+ 
++#include "sysdep.h"
+ #include <stdio.h>
+ #include <sys/types.h>
+ 
+@@ -521,7 +522,7 @@
+      of moving backwards. */
+   if (new + 1 < _rl_last_c_pos - new)
+     {
+-#if defined(__MSDOS__) || defined(__WIN32__) || defined (_MSC_VER)
++#if defined(__MSDOS__) || defined(_WIN32)
+       putc('\r', rl_outstream);
+ #else
+       tputs (term_cr, 1, _rl_output_character_function);
+@@ -734,8 +735,7 @@
+      char *string;
+      int count;
+ {
+-#if defined(__WIN32__) || defined(_MSC_VER)
+-
++#if defined(_WIN32)
+ #else
+ #if defined (__GO32__)
+   int row, col, width;
+@@ -791,7 +791,7 @@
+ delete_chars (count)
+      int count;
+ {
+-#if defined(__WIN32__) || defined(_MSC_VER)
++#if defined(_WIN32)
+ 
+ #else
+ #if defined (__GO32__)
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/history.c	Sun Jun 12 06:54:45 1994
++++ history.c	Tue Apr 15 04:23:31 1997
+@@ -42,9 +42,6 @@
+ 
+ extern char *getenv();
+ 
+-#ifndef	NO_SYS_FILE
+-#include <sys/file.h>
+-#endif
+ #include <sys/stat.h>
+ #include <fcntl.h>
+ 
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/parens.c	Tue Oct 31 13:40:32 1995
++++ parens.c	Tue Apr 15 04:23:31 1997
+@@ -23,7 +23,7 @@
+ #include <stdio.h>
+ #include <sys/types.h>
+ 
+-#if defined(__GO32__) || defined(__WIN32__)
++#if defined(__GO32__) || defined(_WIN32)
+ #undef FD_SET
+ #endif
+ 
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/readline.c	Wed Jan  3 21:48:24 1996
++++ readline.c	Tue Apr 15 04:23:31 1997
+@@ -24,9 +24,6 @@
+ #include "sysdep.h"
+ #include <stdio.h>
+ #include <fcntl.h>
+-#ifndef	NO_SYS_FILE
+-#include <sys/file.h>
+-#endif
+ #include <signal.h>
+ 
+ /* This is needed to include support for TIOCGWINSZ and window resizing. */
+@@ -62,7 +59,6 @@
+    to be visible to readline callers. */
+ 
+ /* Functions imported from other files in the library. */
+-extern char *tgetstr ();
+ extern void rl_prep_terminal (), rl_deprep_terminal ();
+ extern void rl_vi_set_last ();
+ extern Function *rl_function_of_keyseq ();
+@@ -478,7 +474,7 @@
+ void
+ rl_gather_tyi ()
+ {
+-#if defined (MINIMAL)
++#if defined (MINIMAL) && !defined (_WIN32)
+   char input;
+ 
+   if (isatty (0))
+@@ -1153,7 +1149,6 @@
+ _rl_set_screen_size (tty, ignore_env)
+      int tty, ignore_env;
+ {
+-#ifndef MINIMAL
+ #if defined (TIOCGWINSZ) && !defined (TIOCGWINSZ_BROKEN)
+   struct winsize window_size;
+ #endif /* TIOCGWINSZ */
+@@ -1209,7 +1204,6 @@
+      don't use the last column. */
+   if (!term_xn)
+     screenwidth--;
+-#endif
+ }
+ #endif /* !MINIMAL */
+ 
+@@ -1778,7 +1772,7 @@
+   _rl_move_vert (curr_line);
+   _rl_move_cursor_relative (0, the_line);   /* XXX is this right */
+ 
+-#if defined (__WIN32__) || defined (_MSC_VER)
++#if defined (_WIN32)
+   abort();
+ #else
+ #if defined (__GO32__)
+@@ -3119,7 +3113,7 @@
+   int result;
+   unsigned char c;
+ 
+-#if defined (MINIMAL)
++#if defined (MINIMAL) && !defined (_WIN32)
+   if (isatty (0))
+     return (getkey () & 0x7f);
+ #endif /* MINIMAL */
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/rldefs.h	Tue Oct 31 13:40:46 1995
++++ rldefs.h	Tue Apr 15 04:23:31 1997
+@@ -40,15 +40,28 @@
+ #define HAVE_BSD_SIGNALS
+ /* #define USE_XON_XOFF */
+ 
+-#if defined(__MSDOS__) || defined(_MSC_VER)
++/* Only do this for DOS, and WinGDB */
++#if defined __MSDOS__ || (defined _WIN32 && !defined __CYGWIN32__)
+ #define NO_SYS_FILE
+-#define SIGALRM 1234
+ #undef NEW_TTY_DRIVER
+ #undef HAVE_BSD_SIGNALS
+ #define MINIMAL
+ #endif
+ 
++/* Only do this for cygwin32 */
++#if defined __CYGWIN32__
++#define tgetent(ARG1, ARG2) -1
++#define tgetnum(ARG1) ((int)abort())
++#define tgetstr(ARG1, ARG2) ((char *)abort())
++#define tgetflag(ARG1) ((int)abort())
++#define tputs(ARG1, ARG2, ARG3) ((int)abort())
++#define setpwent()
++#else
++extern char *tgetstr ();
++#endif
++
+ #if defined (__linux__)
++#  include <termios.h>
+ #  include <termcap.h>
+ #endif /* __linux__ */
+ 
+@@ -58,27 +71,26 @@
+ #  undef HAVE_BSD_SIGNALS
+ #endif
+ 
+-#if defined (__WIN32__) && !defined(_MSC_VER)
+-#undef NEW_TTY_DRIVER
+-#define MINIMAL
+-#undef HAVE_BSD_SIGNALS
+-#define TERMIOS_TTY_DRIVER
+-#undef HANDLE_SIGNALS
+-#include <termios.h>
+-/*#define HAVE_POSIX_SIGNALS*/
++/* Only do this for WinGDB */
++#if defined _WIN32 && !defined __CYGWIN32__
++#define ScreenCols() 80
++#define ScreenRows() 24
++#define ScreenSetCursor() abort();
++#define ScreenGetCursor() abort();
+ #endif
+ 
+ /* System V machines use termio. */
+ #if !defined (_POSIX_VERSION)
+-/* CYGNUS LOCAL accept __hpux as well as hpux for HP compiler in ANSI mode.  */
+-#  if defined (USG) || defined (hpux) || defined (__hpux) || defined (Xenix) || defined (sgi) || defined (DGUX)
++/* CYGNUS LOCAL accept __hpux as well as hpux for HP compiler in ANSI mode.
++   Add __osf__ to list of machines to force use of termio.h */
++#  if defined (USG) || defined (hpux) || defined (__hpux) || defined (Xenix) || defined (sgi) || defined (DGUX) || defined (__osf__)
+ #    undef NEW_TTY_DRIVER
+ #    define TERMIO_TTY_DRIVER
+ #    include <termio.h>
+ #    if !defined (TCOON)
+ #      define TCOON 1
+ #    endif
+-#  endif /* USG || hpux || Xenix || sgi || DUGX */
++#  endif /* USG || hpux || Xenix || sgi || DUGX || __osf__ */
+ #endif /* !_POSIX_VERSION */
+ 
+ /* Posix systems use termios and the Posix signal functions. */
+@@ -151,6 +163,12 @@
+ #endif /* !1 */
+ 
+ #if defined (USG) && defined (TIOCGWINSZ) && !defined (Linux)
++#  if defined (_AIX)
++	/* AIX 4.x seems to reference struct uio within a prototype
++	   in stream.h, but doesn't cause the uio include file to
++	   be included.  */
++#    include <sys/uio.h>
++#  endif
+ #  include <sys/stream.h>
+ #  if defined (HAVE_SYS_PTEM_H)
+ #    include <sys/ptem.h>
+@@ -183,7 +201,7 @@
+ /* If on, then readline handles signals in a way that doesn't screw. */
+ #define HANDLE_SIGNALS
+ 
+-#if defined(__WIN32__) || defined(__MSDOS__)
++#if defined __MSDOS__ || (defined _WIN32 && !defined __CYGWIN32__)
+ #undef HANDLE_SIGNALS
+ #endif
+ 
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/rltty.c	Sat Oct  7 20:44:06 1995
++++ rltty.c	Tue Apr 15 04:23:31 1997
+@@ -24,9 +24,6 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include <stdio.h>
+-#ifndef	NO_SYS_FILE
+-#include <sys/file.h>
+-#endif
+ 
+ #if defined (HAVE_UNISTD_H)
+ #  include <unistd.h>
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/signals.c	Sat Oct  7 20:44:08 1995
++++ signals.c	Tue Apr 15 04:23:31 1997
+@@ -23,9 +23,6 @@
+ #include <stdio.h>
+ #include <sys/types.h>
+ #include <fcntl.h>
+-#if !defined (NO_SYS_FILE)
+-#  include <sys/file.h>
+-#endif /* !NO_SYS_FILE */
+ #include <signal.h>
+ 
+ /* This is needed to include support for TIOCGWINSZ and window resizing. */
+@@ -152,7 +149,9 @@
+       rl_clear_signals ();
+       rl_pending_input = 0;
+ 
++#ifndef _WIN32
+       kill (getpid (), sig);
++#endif
+ 
+       SIGNALS_UNBLOCK;
+ 
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/sysdep-norm.h	Wed Nov  4 18:34:54 1992
++++ sysdep-norm.h	Tue Apr 15 04:23:32 1997
+@@ -26,11 +26,17 @@
+ #endif /* USGr4 */
+ #endif /* USG && TIOCGWINSZ */
+ 
++#ifndef _WIN32
+ #include <dirent.h>
+ typedef struct dirent dirent;
++#endif
+ 
+ /* SVR4 systems should use <termios.h> rather than <termio.h>. */
+ 
+ #if defined (USGr4)
+ #define _POSIX_VERSION
++#endif
++
++#if defined _WIN32 && !defined __GNUC__
++#include <malloc.h>
+ #endif
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/sysdep.h	Wed Nov  4 18:34:54 1992
++++ sysdep.h	Tue Apr 15 04:23:32 1997
+@@ -26,11 +26,17 @@
+ #endif /* USGr4 */
+ #endif /* USG && TIOCGWINSZ */
+ 
++#ifndef _WIN32
+ #include <dirent.h>
+ typedef struct dirent dirent;
++#endif
+ 
+ /* SVR4 systems should use <termios.h> rather than <termio.h>. */
+ 
+ #if defined (USGr4)
+ #define _POSIX_VERSION
++#endif
++
++#if defined _WIN32 && !defined __GNUC__
++#include <malloc.h>
+ #endif
+--- /home/jeff/pilot-tst/src/gdb-4.16/readline/tilde.c	Thu Feb 24 07:19:32 1994
++++ tilde.c	Tue Apr 15 04:23:32 1997
+@@ -27,7 +27,7 @@
+    GDB to add YET ANOTHER -I directive.  No thanks.  */
+ #include "tilde.h"
+ 
+-#ifndef __MSDOS__
++#if !defined(__MSDOS__) && !defined(_WIN32)
+ #include <pwd.h>
+ #endif
+ 
+@@ -218,7 +218,7 @@
+ 	  /* Prepend $HOME to the rest of the string. */
+ 	  char *temp_home = getenv ("HOME");
+ 
+-#ifndef __MSDOS__
++#if !defined (__MSDOS__) && !defined (_WIN32)
+ 	  /* If there is no HOME variable, look up the directory in
+ 	     the password database. */
+ 	  if (!temp_home)
+@@ -242,7 +242,7 @@
+ 	}
+       else
+ 	{
+-#ifndef __MSDOS__
++#if !defined (__MSDOS__) && !defined (_WIN32)
+ 	  struct passwd *user_entry;
+ #endif
+ 	  char *username = (char *)alloca (257);
+@@ -257,7 +257,7 @@
+ 	    }
+ 	  username[i - 1] = '\0';
+ 
+-#ifndef __MSDOS__
++#if !defined (__MSDOS__) && !defined (_WIN32)
+ 	  if (!(user_entry = getpwnam (username)))
+ 	    {
+ #endif
+@@ -281,7 +281,7 @@
+ 		    }
+ 		}
+ 	      /* We shouldn't report errors. */
+-#ifndef __MSDOS__
++#if !defined (__MSDOS__) && !defined (_WIN32)
+ 	    }
+ 	  else
+ 	    {
+@@ -293,7 +293,7 @@
+ 	    return_name:
+ 	      free (dirname);
+ 	      dirname = savestring (temp_name);
+-#ifndef __MSDOS__
++#if !defined (__MSDOS__) && !defined (_WIN32)
+ 	    }
+ 	    endpwent ();
+ #endif
diff -urN gdb-4.16.orig/readline/rldefs.h gdb-4.16/readline/rldefs.h
--- gdb-4.16.orig/readline/rldefs.h	Tue Oct 31 13:40:46 1995
+++ gdb-4.16/readline/rldefs.h	Mon Jul  7 21:08:50 1997
@@ -40,15 +40,28 @@
 #define HAVE_BSD_SIGNALS
 /* #define USE_XON_XOFF */
 
-#if defined(__MSDOS__) || defined(_MSC_VER)
+/* Only do this for DOS, and WinGDB */
+#if defined __MSDOS__ || (defined _WIN32 && !defined __CYGWIN32__)
 #define NO_SYS_FILE
-#define SIGALRM 1234
 #undef NEW_TTY_DRIVER
 #undef HAVE_BSD_SIGNALS
 #define MINIMAL
 #endif
 
+/* Only do this for cygwin32 */
+#if defined __CYGWIN32__
+#define tgetent(ARG1, ARG2) -1
+#define tgetnum(ARG1) ((int)abort())
+#define tgetstr(ARG1, ARG2) ((char *)abort())
+#define tgetflag(ARG1) ((int)abort())
+#define tputs(ARG1, ARG2, ARG3) ((int)abort())
+#define setpwent()
+#else
+extern char *tgetstr ();
+#endif
+
 #if defined (__linux__)
+#  include <termios.h>
 #  include <termcap.h>
 #endif /* __linux__ */
 
@@ -58,27 +71,26 @@
 #  undef HAVE_BSD_SIGNALS
 #endif
 
-#if defined (__WIN32__) && !defined(_MSC_VER)
-#undef NEW_TTY_DRIVER
-#define MINIMAL
-#undef HAVE_BSD_SIGNALS
-#define TERMIOS_TTY_DRIVER
-#undef HANDLE_SIGNALS
-#include <termios.h>
-/*#define HAVE_POSIX_SIGNALS*/
+/* Only do this for WinGDB */
+#if defined _WIN32 && !defined __CYGWIN32__
+#define ScreenCols() 80
+#define ScreenRows() 24
+#define ScreenSetCursor() abort();
+#define ScreenGetCursor() abort();
 #endif
 
 /* System V machines use termio. */
 #if !defined (_POSIX_VERSION)
-/* CYGNUS LOCAL accept __hpux as well as hpux for HP compiler in ANSI mode.  */
-#  if defined (USG) || defined (hpux) || defined (__hpux) || defined (Xenix) || defined (sgi) || defined (DGUX)
+/* CYGNUS LOCAL accept __hpux as well as hpux for HP compiler in ANSI mode.
+   Add __osf__ to list of machines to force use of termio.h */
+#  if defined (USG) || defined (hpux) || defined (__hpux) || defined (Xenix) || defined (sgi) || defined (DGUX) || defined (__osf__)
 #    undef NEW_TTY_DRIVER
 #    define TERMIO_TTY_DRIVER
 #    include <termio.h>
 #    if !defined (TCOON)
 #      define TCOON 1
 #    endif
-#  endif /* USG || hpux || Xenix || sgi || DUGX */
+#  endif /* USG || hpux || Xenix || sgi || DUGX || __osf__ */
 #endif /* !_POSIX_VERSION */
 
 /* Posix systems use termios and the Posix signal functions. */
@@ -151,6 +163,12 @@
 #endif /* !1 */
 
 #if defined (USG) && defined (TIOCGWINSZ) && !defined (Linux)
+#  if defined (_AIX)
+	/* AIX 4.x seems to reference struct uio within a prototype
+	   in stream.h, but doesn't cause the uio include file to
+	   be included.  */
+#    include <sys/uio.h>
+#  endif
 #  include <sys/stream.h>
 #  if defined (HAVE_SYS_PTEM_H)
 #    include <sys/ptem.h>
@@ -183,7 +201,7 @@
 /* If on, then readline handles signals in a way that doesn't screw. */
 #define HANDLE_SIGNALS
 
-#if defined(__WIN32__) || defined(__MSDOS__)
+#if defined __MSDOS__ || (defined _WIN32 && !defined __CYGWIN32__)
 #undef HANDLE_SIGNALS
 #endif
 
diff -urN gdb-4.16.orig/readline/rltty.c gdb-4.16/readline/rltty.c
--- gdb-4.16.orig/readline/rltty.c	Sat Oct  7 20:44:06 1995
+++ gdb-4.16/readline/rltty.c	Mon Jul  7 21:08:50 1997
@@ -24,9 +24,6 @@
 #include <signal.h>
 #include <errno.h>
 #include <stdio.h>
-#ifndef	NO_SYS_FILE
-#include <sys/file.h>
-#endif
 
 #if defined (HAVE_UNISTD_H)
 #  include <unistd.h>
diff -urN gdb-4.16.orig/readline/signals.c gdb-4.16/readline/signals.c
--- gdb-4.16.orig/readline/signals.c	Sat Oct  7 20:44:08 1995
+++ gdb-4.16/readline/signals.c	Mon Jul  7 21:08:50 1997
@@ -23,9 +23,6 @@
 #include <stdio.h>
 #include <sys/types.h>
 #include <fcntl.h>
-#if !defined (NO_SYS_FILE)
-#  include <sys/file.h>
-#endif /* !NO_SYS_FILE */
 #include <signal.h>
 
 /* This is needed to include support for TIOCGWINSZ and window resizing. */
@@ -152,7 +149,9 @@
       rl_clear_signals ();
       rl_pending_input = 0;
 
+#ifndef _WIN32
       kill (getpid (), sig);
+#endif
 
       SIGNALS_UNBLOCK;
 
diff -urN gdb-4.16.orig/readline/sysdep-linux.h gdb-4.16/readline/sysdep-linux.h
--- gdb-4.16.orig/readline/sysdep-linux.h	Wed Dec 31 19:00:00 1969
+++ gdb-4.16/readline/sysdep-linux.h	Mon Jul  7 21:08:50 1997
@@ -0,0 +1,24 @@
+/* System-dependent stuff, for Linux systems.  Known to be good for
+   Linux/Alpha, but should work for all other platforms, too. */
+
+/*
+ * This is important on Linux/Alpha where sizeof(void*) != sizeof(int).
+ */
+#define HAVE_VARARGS_H
+
+#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else
+#if defined (sparc) && defined (sun)
+#include <alloca.h>
+#endif
+#ifndef alloca				/* May be a macro, with args. */
+extern char *alloca ();
+#endif
+#endif
+
+#include <sys/types.h>			/* Needed by dirent.h */
+#include <string.h>
+
+#include <dirent.h>
+typedef struct dirent dirent;
diff -urN gdb-4.16.orig/readline/sysdep-norm.h gdb-4.16/readline/sysdep-norm.h
--- gdb-4.16.orig/readline/sysdep-norm.h	Wed Nov  4 18:34:54 1992
+++ gdb-4.16/readline/sysdep-norm.h	Mon Jul  7 21:08:50 1997
@@ -26,11 +26,17 @@
 #endif /* USGr4 */
 #endif /* USG && TIOCGWINSZ */
 
+#ifndef _WIN32
 #include <dirent.h>
 typedef struct dirent dirent;
+#endif
 
 /* SVR4 systems should use <termios.h> rather than <termio.h>. */
 
 #if defined (USGr4)
 #define _POSIX_VERSION
+#endif
+
+#if defined _WIN32 && !defined __GNUC__
+#include <malloc.h>
 #endif
diff -urN gdb-4.16.orig/readline/tilde.c gdb-4.16/readline/tilde.c
--- gdb-4.16.orig/readline/tilde.c	Thu Feb 24 07:19:32 1994
+++ gdb-4.16/readline/tilde.c	Mon Jul  7 21:08:50 1997
@@ -27,7 +27,7 @@
    GDB to add YET ANOTHER -I directive.  No thanks.  */
 #include "tilde.h"
 
-#ifndef __MSDOS__
+#if !defined(__MSDOS__) && !defined(_WIN32)
 #include <pwd.h>
 #endif
 
@@ -218,7 +218,7 @@
 	  /* Prepend $HOME to the rest of the string. */
 	  char *temp_home = getenv ("HOME");
 
-#ifndef __MSDOS__
+#if !defined (__MSDOS__) && !defined (_WIN32)
 	  /* If there is no HOME variable, look up the directory in
 	     the password database. */
 	  if (!temp_home)
@@ -242,7 +242,7 @@
 	}
       else
 	{
-#ifndef __MSDOS__
+#if !defined (__MSDOS__) && !defined (_WIN32)
 	  struct passwd *user_entry;
 #endif
 	  char *username = (char *)alloca (257);
@@ -257,7 +257,7 @@
 	    }
 	  username[i - 1] = '\0';
 
-#ifndef __MSDOS__
+#if !defined (__MSDOS__) && !defined (_WIN32)
 	  if (!(user_entry = getpwnam (username)))
 	    {
 #endif
@@ -281,7 +281,7 @@
 		    }
 		}
 	      /* We shouldn't report errors. */
-#ifndef __MSDOS__
+#if !defined (__MSDOS__) && !defined (_WIN32)
 	    }
 	  else
 	    {
@@ -293,7 +293,7 @@
 	    return_name:
 	      free (dirname);
 	      dirname = savestring (temp_name);
-#ifndef __MSDOS__
+#if !defined (__MSDOS__) && !defined (_WIN32)
 	    }
 	    endpwent ();
 #endif
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]