diff -u netcat.orig/Makefile /Makefile --- netcat.orig/Makefile Wed Mar 20 04:16:06 1996 +++ /Makefile Thu Sep 5 13:47:30 2002 @@ -109,9 +109,16 @@ next: make -e $(ALL) $(MFLAGS) XFLAGS='-DNEXT' STATIC=-Bstatic + +# cygwin Unix-emulationlayer for Win9x/NT/... +cygwin: + make -e $(ALL) $(MFLAGS) XFLAGS='-DCYGWIN' STATIC= CC=gcc + + # start with this for a new architecture, and see what breaks. generic: make -e $(ALL) $(MFLAGS) XFLAGS='-DGENERIC' STATIC= + # Still at large: dgux dynix ??? diff -u netcat.orig/generic.h /generic.h --- netcat.orig/generic.h Sun Feb 18 02:36:43 1996 +++ /generic.h Thu Sep 5 14:17:18 2002 @@ -70,6 +70,9 @@ /* a sysvism, I think, but ... */ #define HAVE_SYSINFO +/* not found on cygwin as far as i know (kahl@informatik.uni-kl.de) */ +#define HAVE_RES_INIT + /* ============= */ /* Include files */ /* ============= */ @@ -359,6 +362,20 @@ #undef UTMPX #undef HAVE_SELECT_X #endif /* NeXTSTEP 3.2 motorola */ + + +/* cygwin unix-emulation-layer formWin9x/NT/... + * they try to be posix and linux compatible... */ +#ifdef CYGWIN +#undef UTMPX +#undef HAVE_SYSINFO +#undef HAVE_SELECT_H +#undef HAVE_TTYENT_H +#define HAVE_NO_LSRR +#define HAVE_NO_NOP +#undef HAVE_RES_INIT +#endif /* cygwin */ + /* Make some "generic" assumptions if all else fails */ #ifdef GENERIC diff -u netcat.orig/netcat.c /netcat.c --- netcat.orig/netcat.c Thu Mar 21 01:38:04 1996 +++ /netcat.c Thu Sep 5 14:09:48 2002 @@ -713,6 +713,7 @@ if (gatesidx) { /* if we wanted any srcrt hops ... */ /* don't even bother compiling if we can't do IP options here! */ #ifdef IP_OPTIONS +#ifndef HAVE_NO_LSRR if (! optbuf) { /* and don't already *have* a srcrt set */ char * opp; /* then do all this setup hair */ optbuf = Hmalloc (48); @@ -737,6 +738,9 @@ rr = setsockopt (nnetfd, IPPROTO_IP, IP_OPTIONS, optbuf, x); if (rr == -1) bail ("srcrt setsockopt fuxored"); +#else /* HAVE_NO_LSRR */ + holler ("Warning: source routing unavailable on this machine, ignoring"); +#endif #else /* IP_OPTIONS */ holler ("Warning: source routing unavailable on this machine, ignoring"); #endif /* IP_OPTIONS*/ @@ -1315,8 +1319,10 @@ char * randports = NULL; #ifdef HAVE_BIND +#ifdef HAVE_RES_INIT /* can *you* say "cc -yaddayadda netcat.c -lresolv -l44bsd" on SunLOSs? */ res_init(); +#endif #endif /* I was in this barbershop quartet in Skokie IL ... */ /* round up the usual suspects, i.e. malloc up all the stuff we need */