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]

GNU emacs on 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


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