public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: GNU emacs on cygwin
@ 2001-01-24 13:10 Bill Priest
  0 siblings, 0 replies; 3+ messages in thread
From: Bill Priest @ 2001-01-24 13:10 UTC (permalink / raw)
  To: kevin; +Cc: 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GNU emacs on cygwin
  2001-01-23 14:56 Bill Priest
@ 2001-01-23 15:47 ` Bill Priest
  0 siblings, 0 replies; 3+ messages in thread
From: Bill Priest @ 2001-01-23 15:47 UTC (permalink / raw)
  To: cygwin

Kevin Wright asked for the patches I made, again it didn't finish building correctly.
It did produce an executable that would run (although some keys like backspace didn't
seem to work correctly).  Please don't flame if this doesn't work; I only worked on
it during my lunch break ;).  Latest cygwin (via setup) w/ only changes to emacs.

Good Luck,

Bill


to emacs-20.7/src
*** Makefile.~1~	Tue Jan 23 10:45:32 2001
--- Makefile	Tue Jan 23 12:54:10 2001
***************
*** 80,86 ****
  ${libsrc}make-docfile:
  	cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile
  temacs:   $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj}     prefix-args
! 	$(LD) `./prefix-args -Xlinker  ${STARTFLAGS} ${ALL_LDFLAGS} `      -o temacs ${STARTFILES} ${obj} ${otherobj}          ${LIBES}
  prefix-args: prefix-args.c $(config_h)
  	$(CC) $(ALL_CFLAGS) $(LDFLAGS) ${srcdir}/prefix-args.c -o prefix-args
  CPP = $(CC) -E
--- 80,86 ----
  ${libsrc}make-docfile:
  	cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile
  temacs:   $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj}     prefix-args
! 	$(LD) `./prefix-args -Xlinker  ${STARTFLAGS} ${ALL_LDFLAGS} `      -o temacs ${STARTFILES} ${obj} ${otherobj}          ${LIBES} -lkernel32
  prefix-args: prefix-args.c $(config_h)
  	$(CC) $(ALL_CFLAGS) $(LDFLAGS) ${srcdir}/prefix-args.c -o prefix-args
  CPP = $(CC) -E


*** dispnew.c.~1~	Sun May 31 19:11:48 1998
--- dispnew.c	Tue Jan 23 12:20:12 2001
***************
*** 1290,1296 ****
  		 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);
  	      if (outq > 900
  		  || (outq > 20 && ((i - 1) % preempt_count == 0)))
  		{
--- 1290,1297 ----
  		 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 = (stdout)->_w;
  	      if (outq > 900
  		  || (outq > 20 && ((i - 1) % preempt_count == 0)))
  		{

*** process.c.~1~	Tue May 23 11:10:16 2000
--- process.c	Tue Jan 23 12:32:34 2001
***************
*** 303,315 ****
  status_convert (w)
       WAITTYPE w;
  {
!   if (WIFSTOPPED (w))
!     return Fcons (Qstop, Fcons (make_number (WSTOPSIG (w)), Qnil));
!   else if (WIFEXITED (w))
      return Fcons (Qexit, Fcons (make_number (WRETCODE (w)),
  				WCOREDUMP (w) ? Qt : Qnil));
!   else if (WIFSIGNALED (w))
!     return Fcons (Qsignal, Fcons (make_number (WTERMSIG (w)),
  				  WCOREDUMP (w) ? Qt : Qnil));
    else
      return Qrun;
--- 303,315 ----
  status_convert (w)
       WAITTYPE 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.w_status))
!     return Fcons (Qsignal, Fcons (make_number (WTERMSIG (w.w_status)),
  				  WCOREDUMP (w) ? Qt : Qnil));
    else
      return Qrun;
***************
*** 362,368 ****
  	{
  #ifndef VMS
  	  /* Cast to suppress warning if the table has const char *.  */
! 	  signame = (char *) sys_siglist[code];
  #else
  	  signame = sys_errlist[code];
  #endif
--- 362,369 ----
  	{
  #ifndef VMS
  	  /* Cast to suppress warning if the table has const char *.  */
! //	  signame = (char *) sys_siglist[code];
! 	  signame = (char *) strsignal(code);
  #else
  	  signame = sys_errlist[code];
  #endif
***************
*** 4069,4075 ****
        do 
  	{
  	  errno = 0;
! 	  pid = wait3 (&w, WNOHANG | WUNTRACED, 0);
  	}
        while (pid <= 0 && errno == EINTR);
  
--- 4070,4076 ----
        do 
  	{
  	  errno = 0;
! 	  pid = wait3 (&w.w_status, WNOHANG | WUNTRACED, 0);
  	}
        while (pid <= 0 && errno == EINTR);
  
***************
*** 4129,4135 ****
  	  XSETINT (p->raw_status_high, u.i >> 16);
  	  
  	  /* If process has terminated, stop waiting for its output.  */
! 	  if ((WIFSIGNALED (w) || WIFEXITED (w))
  	      && XINT (p->infd) >= 0)
  	    clear_desc_flag = 1;
  
--- 4130,4136 ----
  	  XSETINT (p->raw_status_high, u.i >> 16);
  	  
  	  /* If process has terminated, stop waiting for its output.  */
! 	  if ((WIFSIGNALED (w.w_status) || WIFEXITED (w.w_status))
  	      && XINT (p->infd) >= 0)
  	    clear_desc_flag = 1;
  
***************
*** 4153,4170 ****
  	  synch_process_alive = 0;
  
  	  /* Report the status of the synchronous process.  */
! 	  if (WIFEXITED (w))
  	    synch_process_retcode = WRETCODE (w);
! 	  else if (WIFSIGNALED (w))
  	    {
! 	      int code = WTERMSIG (w);
  	      char *signame = 0;
  
  	      if (code < NSIG)
  		{
  #ifndef VMS
  		  /* Suppress warning if the table has const char *.  */
! 		  signame = (char *) sys_siglist[code];
  #else
  		  signame = sys_errlist[code];
  #endif
--- 4154,4172 ----
  	  synch_process_alive = 0;
  
  	  /* Report the status of the synchronous process.  */
! 	  if (WIFEXITED (w.w_status))
  	    synch_process_retcode = WRETCODE (w);
! 	  else if (WIFSIGNALED (w.w_status))
  	    {
! 	      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 *) strsignal(code);
  #else
  		  signame = sys_errlist[code];
  #endif

*** mem-limits.h.~1~	Sun Jan 17 10:13:26 1999
--- mem-limits.h	Tue Jan 23 12:44:48 2001
***************
*** 123,129 ****
  
    /* Use the ulimit call, if we seem to have it.  */
  #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX)
!   lim_data = ulimit (3, 0);
  #endif
  
    /* If that didn't work, just use the macro's value.  */
--- 123,129 ----
  
    /* Use the ulimit call, if we seem to have it.  */
  #if !defined (ULIMIT_BREAK_VALUE) || defined (LINUX)
! //  lim_data = ulimit (3, 0);
  #endif
  
    /* If that didn't work, just use the macro's value.  */

*** emacs.c.~1~	Wed May 24 05:58:54 2000
--- emacs.c	Tue Jan 23 12:46:00 2001
***************
*** 475,481 ****
  #ifndef LINUX
  char * __CTOR_LIST__[2] = { (char *) (-1), 0 };
  #endif
! char * __DTOR_LIST__[2] = { (char *) (-1), 0 };
  #endif /* GCC_CTORS_IN_LIBC */
  void __main ()
  {}
--- 475,481 ----
  #ifndef LINUX
  char * __CTOR_LIST__[2] = { (char *) (-1), 0 };
  #endif
! //char * __DTOR_LIST__[2] = { (char *) (-1), 0 };
  #endif /* GCC_CTORS_IN_LIBC */
  void __main ()
  {}

*** sysdep.c.~1~	Wed May 24 05:59:14 2000
--- sysdep.c	Tue Jan 23 12:50:00 2001
***************
*** 2216,2223 ****
  #ifdef TEXT_END
    return ((char *) TEXT_END);
  #else
!   extern int etext;
!   return ((char *) &etext);
  #endif
  }
   
--- 2216,2224 ----
  #ifdef TEXT_END
    return ((char *) TEXT_END);
  #else
! //  extern int etext;
! //  return ((char *) &etext);
!   return 0;
  #endif
  }
   
***************
*** 2232,2239 ****
  #ifdef DATA_END
    return ((char *) DATA_END);
  #else
!   extern int edata;
!   return ((char *) &edata);
  #endif
  }
  
--- 2233,2241 ----
  #ifdef DATA_END
    return ((char *) DATA_END);
  #else
! //  extern int edata;
! //  return ((char *) &edata);
!   return 0;
  #endif
  }

********************************************************************************
*
*  WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
* This patch isn't even remotely correct; I just commented out stuff until it
* would compile.
*
********************************************************************************

*** unexec.c.~1~	Mon Jun 29 14:53:56 1998
--- unexec.c	Tue Jan 23 12:39:00 2001
***************
*** 303,309 ****
       ((x).fmagic)!=FMAGIC && ((x).fmagic)!=IMAGIC)
  #define NEWMAGIC FMAGIC
  #else /* IRIS or IBMAIX or not USG */
! static EXEC_HDR_TYPE hdr, ohdr;
  #define NEWMAGIC ZMAGIC
  #endif /* IRIS or IBMAIX not USG */
  #endif /* not HPUX */
--- 303,309 ----
       ((x).fmagic)!=FMAGIC && ((x).fmagic)!=IMAGIC)
  #define NEWMAGIC FMAGIC
  #else /* IRIS or IBMAIX or not USG */
! //static EXEC_HDR_TYPE hdr, ohdr;
  #define NEWMAGIC ZMAGIC
  #endif /* IRIS or IBMAIX not USG */
  #endif /* not HPUX */
***************
*** 737,752 ****
  	  ERROR1("%s doesn't have legal coff magic number\n", a_name);
  	}
  #endif
!       if (read (a_out, &ohdr, sizeof hdr) != sizeof hdr)
! 	{
! 	  PERROR (a_name);
! 	}
! 
!       if (N_BADMAG (ohdr))
! 	{
! 	  ERROR1 ("invalid magic number in %s", a_name);
! 	}
!       hdr = ohdr;
      }
    else
      {
--- 737,752 ----
  	  ERROR1("%s doesn't have legal coff magic number\n", a_name);
  	}
  #endif
! //      if (read (a_out, &ohdr, sizeof hdr) != sizeof hdr)
! //	{
! //	  PERROR (a_name);
! //	}
! 
! //      if (N_BADMAG (ohdr))
! //	{
! //	  ERROR1 ("invalid magic number in %s", a_name);
! //	}
! //      hdr = ohdr;
      }
    else
      {
***************
*** 759,765 ****
  #ifdef MSDOS	/* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
        bzero ((void *)&hdr, sizeof hdr);
  #else
!       bzero (&hdr, sizeof hdr);
  #endif
  #endif
      }
--- 759,765 ----
  #ifdef MSDOS	/* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
        bzero ((void *)&hdr, sizeof hdr);
  #else
! //      bzero (&hdr, sizeof hdr);
  #endif
  #endif
      }
***************
*** 769,786 ****
  
    /* Machine-dependent fixup for header, or maybe for unexec_text_start */
  #ifdef 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_bss = bss_end - bss_start;
!   hdr.a_data = bss_start - data_start;
  #ifdef NO_REMAP
!   hdr.a_text = ohdr.a_text;
  #else /* not NO_REMAP */
    hdr.a_text = data_start - unexec_text_start;
  
--- 769,786 ----
  
    /* Machine-dependent fixup for header, or maybe for unexec_text_start */
  #ifdef 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_bss = bss_end - bss_start;
! //  hdr.a_data = bss_start - data_start;
  #ifdef NO_REMAP
! //  hdr.a_text = ohdr.a_text;
  #else /* not NO_REMAP */
    hdr.a_text = data_start - unexec_text_start;
  
***************
*** 816,825 ****
      }
  #endif /* COFF_ENCAPSULATE */
  
!   if (write (new, &hdr, sizeof hdr) != sizeof hdr)
!     {
!       PERROR (new_name);
!     }
  
  #if 0 /* This #ifndef caused a bug on Linux when using QMAGIC.  */
    /* This adjustment was done above only #ifndef NO_REMAP,
--- 816,825 ----
      }
  #endif /* COFF_ENCAPSULATE */
  
! //  if (write (new, &hdr, sizeof hdr) != sizeof hdr)
! //    {
! //      PERROR (new_name);
! //    }
  
  #if 0 /* This #ifndef caused a bug on Linux when using QMAGIC.  */
    /* This adjustment was done above only #ifndef NO_REMAP,
***************
*** 827,833 ****
    /* #ifndef NO_REMAP  */
  #endif
  #ifdef A_TEXT_OFFSET
!   hdr.a_text -= A_TEXT_OFFSET (ohdr);
  #endif
  
    return 0;
--- 827,833 ----
    /* #ifndef NO_REMAP  */
  #endif
  #ifdef A_TEXT_OFFSET
! //  hdr.a_text -= A_TEXT_OFFSET (ohdr);
  #endif
  
    return 0;
***************
*** 956,962 ****
     the extra A_TEXT_OFFSET bytes, only the actual bytes of code.  */
  
  #ifdef A_TEXT_SEEK
!   lseek (new, (long) A_TEXT_SEEK (hdr), 0);
  #else
    lseek (new, (long) N_TXTOFF (hdr), 0);
  #endif /* no A_TEXT_SEEK */
--- 956,962 ----
     the extra A_TEXT_OFFSET bytes, only the actual bytes of code.  */
  
  #ifdef A_TEXT_SEEK
! //  lseek (new, (long) A_TEXT_SEEK (hdr), 0);
  #else
    lseek (new, (long) N_TXTOFF (hdr), 0);
  #endif /* no A_TEXT_SEEK */
***************
*** 1044,1055 ****
  
  #else /* !RISCiX */
    ptr = (char *) unexec_text_start;
!   end = ptr + hdr.a_text;
    write_segment (new, ptr, end);
  #endif /* RISCiX */
  
    ptr = (char *) unexec_data_start;
!   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.  */
--- 1044,1055 ----
  
  #else /* !RISCiX */
    ptr = (char *) unexec_text_start;
! //  end = ptr + hdr.a_text;
    write_segment (new, ptr, end);
  #endif /* RISCiX */
  
    ptr = (char *) unexec_data_start;
! //  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,1148 ****
    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. */
  #endif /* not COFF */
  
    while ((n = read (a_out, page, sizeof page)) > 0)
--- 1142,1148 ----
    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. */
  #endif /* not COFF */
  
    while ((n = read (a_out, page, sizeof page)) > 0)

in emacs-20/lib-src

*** movemail.c.~1~	Sun May  2 01:25:16 1999
--- movemail.c	Tue Jan 23 11:19:06 2001
***************
*** 430,436 ****
  #ifdef WINDOWSNT
  	  status = locking (indesc, LK_RLCK, -1L);
  #else
! 	  status = flock (indesc, LOCK_EX);
  #endif
  #endif
  #endif /* not MAIL_USE_LOCKF */
--- 430,436 ----
  #ifdef WINDOWSNT
  	  status = locking (indesc, LK_RLCK, -1L);
  #else
! //	  status = flock (indesc, LOCK_EX);
  #endif
  #endif
  #endif /* not MAIL_USE_LOCKF */
***************
*** 542,549 ****
        exit (0);
      }
  
!   wait (&status);
!   if (!WIFEXITED (status))
      exit (1);
    else if (WRETCODE (status) != 0)
      exit (WRETCODE (status));
--- 542,549 ----
        exit (0);
      }
  
!   wait ((int *) &status);
!   if (!WIFEXITED (status.w_status))
      exit (1);
    else if (WRETCODE (status) != 0)
      exit (WRETCODE (status));


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* GNU emacs on cygwin
@ 2001-01-23 14:56 Bill Priest
  2001-01-23 15:47 ` Bill Priest
  0 siblings, 1 reply; 3+ messages in thread
From: Bill Priest @ 2001-01-23 14:56 UTC (permalink / raw)
  To: cygwin

All,
		Has anyone worked on the subject (I don't mean NT EMACS or
XEMACS)?  In trying to build it I hit a couple of problems that
I don't know how to work around.

First the ones I could work around.

file.h was missing definitions for LOCK_* (might be because flock hasn't been implemented
                                           nm /usr/lib/*.a | grep flock didn't find it)

According to emacs WINDOWS NT version of flock looks like
  status = locking (indesc, LK_RLCK, -1L);
for
  status = flock (indesc, LOCK_EX);

I added the following that I found in linux (dunno if they are correct or not)

*** file.h	Tue Jan 23 12:00:14 2001
--- file.h.~1~	Mon Dec 25 09:42:28 2000
***************
*** 28,37 ****
  #define	W_OK		2	/* is it writable by caller */
  #define	R_OK		4	/* is it readable by caller */
  
- #define LOCK_SH 1
- #define LOCK_EX 2
- #define LOCK_UN 8
- 
- extern int flock (int __fd, int __operation);
- 
  #endif
--- 28,31 ----

Some changes I had to make to movemail.c
the old code had

  if (!WIFEXITED (status))
    exit (1);

I had to change it to 

  if (!WIFEXITED (status.w_status))
    exit (1);

I don't know if emacs is broken in the way it uses WIFEXITED or if cygwin's macro
is incompatible or if gcc is complaining when it should not (or I'm just stupid).

Another change that I made that I'm unsure of is in dispnew.c
the old code had

  int outq = PENDING_OUTPUT_COUNT (stdout);

I changed it to 

  int outq = (stdout)->_w;

there was a reference in the file to  GNU_LIBRARY_PENDING_OUTPUT_COUNT which if
present is #define's PENDING_OUTPUT_COUNT to it; this would seem the portable
way to go the only thing close I found in cygwin was 

g++-3/libio.h:
#define _IO_PENDING_OUTPUT_COUNT(_fp)   \
        ((_fp)->_IO_write_ptr - (_fp)->_IO_write_base)

Seems like it should work to me; but I didn't try it.

in emacs.c I had to comment out __DTOR_LIST__[2] as it was complained about by
the linker (probably an "emacs" problem).

in process.c I more wait macro changes 
WIFSTOPPED, WIFSTOPSIG, WIFSIGNALED, WTERMSIG

I had a couple of changes for sys_siglist which doesn't seem to exist in cygwin
(I believe it is deprecated); I changed it to strsignal.
------------------------------------------------------------------------------------
Now for the stuff that I couldn't figure out

There are extern declarations for etext & edata in sysdep.c; it would seem to me
that since __DJGPP__ > 1 declared etext that cygwin should have it (if it does and
I don't know where it is I'm sorry; "nm /usr/lib/*.a | grep etext" showed nothing).

extern int etext;
extern int edata;

"nm /usr/lib/*.a | grep edata" did find _pe_print_edata which leads me to believe
that there is edata somewhare (or it is my ignorance showing again).

In unxec.c I hit a bunch of problems related to 
struct exec which is defined in /usr/include/asm/a.out.h in linux it looks similar to
cygwin AOUTHDR or PEAOUTHDR in /usr/include/a.out.h

Can anyone tell me which one of these I should use??

The amazing thing is that the resulting executable sort of worked (no X, no Windows UI, just xterm).

I'm on digest so copy me on any replies.


Thanks in advance,

Bill
PS. this was emacs-20.7 w/o any patches configure'ed
./configure  --prefix=/usr/local '--host=i386-*-linux-gnu'

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-01-24 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-24 13:10 GNU emacs on cygwin Bill Priest
  -- strict thread matches above, loose matches on Subject: below --
2001-01-23 14:56 Bill Priest
2001-01-23 15:47 ` Bill Priest

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).