Here are the lastest bits of the hack I use on my tree to compile and link (most of) wine. As you can see, the linking part is not functional, but it is in there just to get me far enough in the process. With this patch, you should be able to build on Cygwin up to the linking of winedbg. What remains to be done: -- build dlls -- modify winebuild to support dlls -- fix configure.in to properly detect getnetbe{name,addr} functions, which are not detected on Cygwin even if they are present -- implement {get,set}_thread_context -- implement saving the signal context -- send a patch to Cygwin with the {regv,send}msg implementation :) After we do these things, other may popup, I do not know. I may take a break from this effort for now. If someone will like to work on any of these, let me know if I can be of assistance. -- Dimi.
Index: configure.in =================================================================== RCS file: /home/wine/wine/configure.in,v retrieving revision 1.170 diff -u -r1.170 configure.in --- configure.in 2000/12/01 23:53:46 1.170 +++ configure.in 2000/12/04 16:48:28 @@ -558,7 +558,7 @@ echo "*** library (.so) support to allow transparent switch between .so" echo "*** and .dll files." echo "*** If you are using Linux, you will need a newer binutils." - exit 1 + LIBEXT="a" #exit 1 fi fi Index: dlls/ntdll/signal_i386.c =================================================================== RCS file: /home/wine/wine/dlls/ntdll/signal_i386.c,v retrieving revision 1.21 diff -u -r1.21 signal_i386.c --- dlls/ntdll/signal_i386.c 2000/11/29 20:04:09 1.21 +++ dlls/ntdll/signal_i386.c 2000/12/04 16:48:30 @@ -215,6 +215,54 @@ #endif /* __EMX__ */ +#ifdef __CYGWIN__ +typedef struct +{ + unsigned short sc_gs, __gsh; + unsigned short sc_fs, __fsh; + unsigned short sc_es, __esh; + unsigned short sc_ds, __dsh; + unsigned long sc_edi; + unsigned long sc_esi; + unsigned long sc_ebp; + unsigned long sc_esp; + unsigned long sc_ebx; + unsigned long sc_edx; + unsigned long sc_ecx; + unsigned long sc_eax; + unsigned long sc_trapno; + unsigned long sc_err; + unsigned long sc_eip; + unsigned short sc_cs, __csh; + unsigned long sc_eflags; + unsigned long esp_at_signal; + unsigned short sc_ss, __ssh; + unsigned long i387; + unsigned long oldmask; + unsigned long cr2; +} SIGCONTEXT; + +#define HANDLER_DEF(name) void name( int __signal, int code, SIGCONTEXT *__context ) +#define HANDLER_CONTEXT __context + +#define EAX_sig(context) ((context)->sc_eax) +#define EBX_sig(context) ((context)->sc_ebx) +#define ECX_sig(context) ((context)->sc_ecx) +#define EDX_sig(context) ((context)->sc_edx) +#define ESI_sig(context) ((context)->sc_esi) +#define EDI_sig(context) ((context)->sc_edi) +#define EBP_sig(context) ((context)->sc_ebp) + +#define CS_sig(context) ((context)->sc_cs) +#define DS_sig(context) ((context)->sc_ds) +#define ES_sig(context) ((context)->sc_es) +#define SS_sig(context) ((context)->sc_ss) + +#define EFL_sig(context) ((context)->sc_eflags) +#define EIP_sig(context) (*((unsigned long*)&(context)->sc_eip)) +#define ESP_sig(context) (*((unsigned long*)&(context)->sc_esp)) + +#endif /* __CYGWIN__ */ #if defined(linux) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__EMX__) Index: include/wine/port.h =================================================================== RCS file: /home/wine/wine/include/wine/port.h,v retrieving revision 1.4 diff -u -r1.4 port.h --- include/wine/port.h 2000/12/01 20:47:11 1.4 +++ include/wine/port.h 2000/12/04 16:48:32 @@ -11,6 +11,20 @@ #include <sys/types.h> #include <sys/time.h> + +#ifdef __CYGWIN__ + +#define HAVE_GETNETBYNAME 1 +#define HAVE_GETNETBYADDR 1 + +#define recvmsg(s, msg, flags) (-1) /* FAIL */ +#define sendmsg(s, msg, flags) (-1) /* FAIL */ + +#define TIOCMGET 0 +#define TIOCMSET 1 + +#endif /* __CYGWIN__ */ + /* Types */ #ifndef HAVE_GETRLIMIT Index: server/context_i386.c =================================================================== RCS file: /home/wine/wine/server/context_i386.c,v retrieving revision 1.15 diff -u -r1.15 context_i386.c --- server/context_i386.c 2000/11/29 20:04:09 1.15 +++ server/context_i386.c 2000/12/04 16:48:33 @@ -420,6 +420,19 @@ file_set_error(); } +#elif defined(__CYGWIN__) +/* retrieve a thread context */ +static void get_thread_context( struct thread *thread, unsigned int flags, CONTEXT +*context ) +{ + /* FIXME */ +} + +/* set a thread context */ +static void set_thread_context( struct thread *thread, unsigned int flags, CONTEXT +*context ) +{ + /* FIXME */ +} + #else /* linux || __sun__ || __FreeBSD__ */ #error You must implement get/set_thread_context for your platform #endif /* linux || __sun__ || __FreeBSD__ */ Index: tools/winebuild/import.c =================================================================== RCS file: /home/wine/wine/tools/winebuild/import.c,v retrieving revision 1.6 diff -u -r1.6 import.c --- tools/winebuild/import.c 2000/12/01 21:27:43 1.6 +++ tools/winebuild/import.c 2000/12/04 16:48:33 @@ -59,7 +59,7 @@ sprintf( buffer, "%s/lib%s", path, name ); p = buffer + strlen(buffer) - 4; if (!strcmp( p, ".dll" )) *p = 0; - strcat( buffer, ".so" ); + strcat( buffer, ".a" ); /* check if the file exists */ if ((fd = open( buffer, O_RDONLY )) == -1) return NULL; close( fd );