This is the mail archive of the cygwin@sources.redhat.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: GNU emacs on cygwin


Here is a "proper" patch file (I didn't have the disk space before; to
have both trees); so I did it from Linux.

patch -p1 < emacs.patch
from emacs-20.7 worked for me

Bill

diff -ur emacs-20.7/lib-src/movemail.c emacs-20.7.new/lib-src/movemail.c
--- emacs-20.7/lib-src/movemail.c	Sun May  2 04:25:15 1999
+++ emacs-20.7.new/lib-src/movemail.c	Tue Jan 23 11:19:06 2001
@@ -430,7 +430,7 @@
 #ifdef WINDOWSNT
 	  status = locking (indesc, LK_RLCK, -1L);
 #else
-	  status = flock (indesc, LOCK_EX);
+//	  status = flock (indesc, LOCK_EX);
 #endif
 #endif
 #endif /* not MAIL_USE_LOCKF */
@@ -542,8 +542,8 @@
       exit (0);
     }
 
-  wait (&status);
-  if (!WIFEXITED (status))
+  wait ((int *) &status);
+  if (!WIFEXITED (status.w_status))
     exit (1);
   else if (WRETCODE (status) != 0)
     exit (WRETCODE (status));
diff -ur emacs-20.7/src/dispnew.c emacs-20.7.new/src/dispnew.c
--- emacs-20.7/src/dispnew.c	Sun May 31 22:11:47 1998
+++ emacs-20.7.new/src/dispnew.c	Tue Jan 23 12:20:12 2001
@@ -1290,7 +1290,8 @@
 		 Also flush out if likely to have more than 1k buffered
 		 otherwise.   I'm told that some telnet connections get
 		 really screwed by more than 1k output at once.  */
-	      int outq = PENDING_OUTPUT_COUNT (stdout);
+//	      int outq = PENDING_OUTPUT_COUNT (stdout);
+	      int outq = (stdout)->_w;
 	      if (outq > 900
 		  || (outq > 20 && ((i - 1) % preempt_count == 0)))
 		{
diff -ur emacs-20.7/src/emacs.c emacs-20.7.new/src/emacs.c
--- emacs-20.7/src/emacs.c	Wed May 24 08:58:54 2000
+++ emacs-20.7.new/src/emacs.c	Tue Jan 23 12:46:00 2001
@@ -475,7 +475,7 @@
 #ifndef LINUX
 char * __CTOR_LIST__[2] = { (char *) (-1), 0 };
 #endif
-char * __DTOR_LIST__[2] = { (char *) (-1), 0 };
+//char * __DTOR_LIST__[2] = { (char *) (-1), 0 };
 #endif /* GCC_CTORS_IN_LIBC */
 void __main ()
 {}
diff -ur emacs-20.7/src/mem-limits.h emacs-20.7.new/src/mem-limits.h
--- emacs-20.7/src/mem-limits.h	Sun Jan 17 13:13:25 1999
+++ emacs-20.7.new/src/mem-limits.h	Tue Jan 23 12:44:48 2001
@@ -123,7 +123,7 @@
 
   /* Use the ulimit call, if we seem to have it.  */
 #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX)
-  lim_data = ulimit (3, 0);
+//  lim_data = ulimit (3, 0);
 #endif
 
   /* If that didn't work, just use the macro's value.  */
diff -ur emacs-20.7/src/process.c emacs-20.7.new/src/process.c
--- emacs-20.7/src/process.c	Tue May 23 14:10:16 2000
+++ emacs-20.7.new/src/process.c	Tue Jan 23 12:32:34 2001
@@ -303,13 +303,13 @@
 status_convert (w)
      WAITTYPE w;
 {
-  if (WIFSTOPPED (w))
-    return Fcons (Qstop, Fcons (make_number (WSTOPSIG (w)), Qnil));
-  else if (WIFEXITED (w))
+  if (WIFSTOPPED (w.w_status))
+    return Fcons (Qstop, Fcons (make_number (WSTOPSIG (w.w_status)), Qnil));
+  else if (WIFEXITED (w.w_status))
     return Fcons (Qexit, Fcons (make_number (WRETCODE (w)),
 				WCOREDUMP (w) ? Qt : Qnil));
-  else if (WIFSIGNALED (w))
-    return Fcons (Qsignal, Fcons (make_number (WTERMSIG (w)),
+  else if (WIFSIGNALED (w.w_status))
+    return Fcons (Qsignal, Fcons (make_number (WTERMSIG (w.w_status)),
 				  WCOREDUMP (w) ? Qt : Qnil));
   else
     return Qrun;
@@ -362,7 +362,8 @@
 	{
 #ifndef VMS
 	  /* Cast to suppress warning if the table has const char *.  */
-	  signame = (char *) sys_siglist[code];
+//	  signame = (char *) sys_siglist[code];
+	  signame = (char *) strsignal(code);
 #else
 	  signame = sys_errlist[code];
 #endif
@@ -4069,7 +4070,7 @@
       do 
 	{
 	  errno = 0;
-	  pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
+	  pid = wait3 (&w.w_status, WNOHANG | WUNTRACED, 0);
 	}
       while (pid <= 0 && errno == EINTR);
 
@@ -4129,7 +4130,7 @@
 	  XSETINT (p->raw_status_high, u.i >> 16);
 	  
 	  /* If process has terminated, stop waiting for its output.  */
-	  if ((WIFSIGNALED (w) || WIFEXITED (w))
+	  if ((WIFSIGNALED (w.w_status) || WIFEXITED (w.w_status))
 	      && XINT (p->infd) >= 0)
 	    clear_desc_flag = 1;
 
@@ -4153,18 +4154,19 @@
 	  synch_process_alive = 0;
 
 	  /* Report the status of the synchronous process.  */
-	  if (WIFEXITED (w))
+	  if (WIFEXITED (w.w_status))
 	    synch_process_retcode = WRETCODE (w);
-	  else if (WIFSIGNALED (w))
+	  else if (WIFSIGNALED (w.w_status))
 	    {
-	      int code = WTERMSIG (w);
+	      int code = WTERMSIG (w.w_status);
 	      char *signame = 0;
 
 	      if (code < NSIG)
 		{
 #ifndef VMS
 		  /* Suppress warning if the table has const char *.  */
-		  signame = (char *) sys_siglist[code];
+//		  signame = (char *) sys_siglist[code];
+            signame = (char *) strsignal(code);
 #else
 		  signame = sys_errlist[code];
 #endif
diff -ur emacs-20.7/src/sysdep.c emacs-20.7.new/src/sysdep.c
--- emacs-20.7/src/sysdep.c	Wed May 24 08:59:14 2000
+++ emacs-20.7.new/src/sysdep.c	Tue Jan 23 12:50:00 2001
@@ -2216,8 +2216,9 @@
 #ifdef TEXT_END
   return ((char *) TEXT_END);
 #else
-  extern int etext;
-  return ((char *) &etext);
+//  extern int etext;
+//  return ((char *) &etext);
+  return 0;
 #endif
 }
  
@@ -2232,8 +2233,9 @@
 #ifdef DATA_END
   return ((char *) DATA_END);
 #else
-  extern int edata;
-  return ((char *) &edata);
+//  extern int edata;
+//  return ((char *) &edata);
+  return 0;
 #endif
 }
 
diff -ur emacs-20.7/src/unexec.c emacs-20.7.new/src/unexec.c
--- emacs-20.7/src/unexec.c	Mon Jun 29 17:53:55 1998
+++ emacs-20.7.new/src/unexec.c	Tue Jan 23 18:08:04 2001
@@ -303,8 +303,12 @@
      ((x).fmagic)!=FMAGIC && ((x).fmagic)!=IMAGIC)
 #define NEWMAGIC FMAGIC
 #else /* IRIS or IBMAIX or not USG */
-static EXEC_HDR_TYPE hdr, ohdr;
+//static EXEC_HDR_TYPE hdr, ohdr;
+static  AOUTHDR hdr, ohdr;
 #define NEWMAGIC ZMAGIC
+#define	N_BADMAG(x) \
+    (((x).fmagic)!=OMAGIC && ((x).fmagic)!=NMAGIC &&\
+     ((x).fmagic)!=FMAGIC && ((x).fmagic)!=IMAGIC)
 #endif /* IRIS or IBMAIX not USG */
 #endif /* not HPUX */
 
@@ -742,10 +746,10 @@
 	  PERROR (a_name);
 	}
 
-      if (N_BADMAG (ohdr))
-	{
-	  ERROR1 ("invalid magic number in %s", a_name);
-	}
+//    if (N_BADMAG (ohdr))
+//	{
+//	  ERROR1 ("invalid magic number in %s", a_name);
+//	}
       hdr = ohdr;
     }
   else
@@ -769,23 +773,23 @@
 
   /* Machine-dependent fixup for header, or maybe for unexec_text_start */
 #ifdef ADJUST_EXEC_HEADER
-  ADJUST_EXEC_HEADER;
+//  ADJUST_EXEC_HEADER;
 #endif /* ADJUST_EXEC_HEADER */
 
-  hdr.a_trsize = 0;
-  hdr.a_drsize = 0;
-  if (entry_address != 0)
-    hdr.a_entry = entry_address;
+//  hdr.a_trsize = 0;
+//  hdr.a_drsize = 0;
+//  if (entry_address != 0)
+//    hdr.a_entry = entry_address;
 
-  hdr.a_bss = bss_end - bss_start;
-  hdr.a_data = bss_start - data_start;
+//  hdr.a_bss = bss_end - bss_start;
+//  hdr.a_data = bss_start - data_start;
 #ifdef NO_REMAP
-  hdr.a_text = ohdr.a_text;
+//  hdr.a_text = ohdr.a_text;
 #else /* not NO_REMAP */
-  hdr.a_text = data_start - unexec_text_start;
+//  hdr.a_text = data_start - unexec_text_start;
 
 #ifdef A_TEXT_OFFSET
-  hdr.a_text += A_TEXT_OFFSET (ohdr);
+//  hdr.a_text += A_TEXT_OFFSET (ohdr);
 #endif
 
 #endif /* not NO_REMAP */
@@ -827,7 +831,7 @@
   /* #ifndef NO_REMAP  */
 #endif
 #ifdef A_TEXT_OFFSET
-  hdr.a_text -= A_TEXT_OFFSET (ohdr);
+//  hdr.a_text -= A_TEXT_OFFSET (ohdr);
 #endif
 
   return 0;
@@ -956,7 +960,7 @@
    the extra A_TEXT_OFFSET bytes, only the actual bytes of code.  */
 
 #ifdef A_TEXT_SEEK
-  lseek (new, (long) A_TEXT_SEEK (hdr), 0);
+// lseek (new, (long) A_TEXT_SEEK (hdr), 0);
 #else
   lseek (new, (long) N_TXTOFF (hdr), 0);
 #endif /* no A_TEXT_SEEK */
@@ -1044,12 +1048,12 @@
 
 #else /* !RISCiX */
   ptr = (char *) unexec_text_start;
-  end = ptr + hdr.a_text;
+//  end = ptr + hdr.a_text;
   write_segment (new, ptr, end);
 #endif /* RISCiX */
 
   ptr = (char *) unexec_data_start;
-  end = ptr + hdr.a_data;
+//  end = ptr + hdr.a_data;
 /*  This lseek is certainly incorrect when A_TEXT_OFFSET
     and I believe it is a no-op otherwise.
     Let's see if its absence ever fails.  */
@@ -1142,7 +1146,7 @@
   else
     lseek (a_out, coff_offset + SYMS_START, 0);	/* Position a.out to symtab. */
 #else  /* not COFF */
-  lseek (a_out, SYMS_START, 0);	/* Position a.out to symtab. */
+//    lseek (a_out, SYMS_START, 0);	/* Position a.out to symtab. */
 #endif /* not COFF */
 
   while ((n = read (a_out, page, sizeof page)) > 0)

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple


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