Subject: wn-2.4.0 (the webserver for cygwin)
From: "Gerrit P. Haase" <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Thu, 14 Jun 2001 03:14:06 +0200

The wn-webserver v2.4.0 builds o.k. on cygwin.
Take a look (slow connection):
http://familiehaase.dynu.com:8081/wn/

Only some minor patches are needed (see below).

Main Site: http://www.wnserver.org/

'wnserver' runs standalone or via inetd/tcpserver.

As standalone running daemon it needs less memory
than one child of apache and apache is always preforking,
so there are always several childs running.

If one doesn't want to serve thousands of people a day, but
need a webserver to browse docs locally, wnserver is cool.

Patch:
======
diff -urw wn-2.4.0/digestauth/Makefile wn-2.4.0-gph/digestauth/Makefile
--- wn-2.4.0/digestauth/Makefile	Thu May 20 17:06:04 1999
+++ wn-2.4.0-gph/digestauth/Makefile	Tue Jun 12 00:13:28 2001
@@ -1,7 +1,8 @@
-CC = cc
+CC = gcc
 
 BINDIR = ../bin
-
+# Cygwin needs it
+EXEEXT = .exe
 # Uncomment these two lines to use the DBM features of wndigest
 # You will likely have to change DBMLIB to whatever library contains
 # the DBM functions dbm_open(), dbm_fetch() and dbm_close() on your system.
@@ -28,13 +29,13 @@
 		mkdir $(BINDIR) ; \
 	fi
 	@echo "Installing wndigest and md5 in $(BINDIR)"
-	@cp wndigest $(BINDIR)
-	@strip $(BINDIR)/wndigest
-	@cp md5 $(BINDIR)
-	@strip $(BINDIR)/md5
+	@cp wndigest$(EXEEXT) $(BINDIR)
+	@strip $(BINDIR)/wndigest$(EXEEXT)
+	@cp md5$(EXEEXT) $(BINDIR)
+	@strip $(BINDIR)/md5$(EXEEXT)
 
 clean:
-	rm -f *.o  *~ wndigest md5
+	rm -f *.o  *~ wndigest$(EXEEXT) md5$(EXEEXT)
 
 wndigest.o:	md5 wndigest.c wndigest.h global.h md5.h ../config.h
 	@echo "Calculating random seed"
diff -urw wn-2.4.0/md5/Makefile wn-2.4.0-gph/md5/Makefile
--- wn-2.4.0/md5/Makefile	Wed Mar  8 22:38:26 2000
+++ wn-2.4.0-gph/md5/Makefile	Tue Jun 12 00:13:28 2001
@@ -2,6 +2,8 @@
 RANLIB=ranlib
 CFLAGS = -Wall -I../wn 
 OBJS = md5.o md5_dgst.o
+# Cygwin needs it
+EXEEXT = .exe
 
 all: md5 md5lib.a
 
@@ -19,13 +21,13 @@
 		mkdir $(BINDIR) ; \
 	fi
 	@echo "Installing md5 in $(BINDIR)"
-	@cp md5 $(BINDIR)
-	@strip $(BINDIR)/md5
+	@cp md5$(EXEEXT) $(BINDIR)
+	@strip $(BINDIR)/md5$(EXEEXT)
 	@echo "Installing md5lib.a in $(BINDIR)"
 	@cp md5lib.a $(BINDIR)
 
 clean:
-	rm -rf md5 md5lib.a *.o *~
+	rm -rf md5$(EXEEXT) md5lib.a *.o *~
 
 md5_dgst.o: md5.h  md5_locl.h  opensslv.h
 md5.o: md5.h  md5_locl.h  opensslv.h
diff -urw wn-2.4.0/suexec/Makefile wn-2.4.0-gph/suexec/Makefile
--- wn-2.4.0/suexec/Makefile	Fri Dec  8 19:11:10 2000
+++ wn-2.4.0-gph/suexec/Makefile	Tue Jun 12 00:13:28 2001
@@ -1,6 +1,8 @@
 CC=gcc
 CFLAGS=-O2
 #MD5LIB = ../md5/md5lib.a
+# Cygwin needs it
+EXEEXT = .exe
 MD5LIB = -lcrypto
 
 all: suexec
@@ -8,6 +10,6 @@
 	$(CC) $(CFLAGS) -o suexec -I. suexec.c $(MD5LIB)
 
 clean:
-	rm -f suexec *~
+	rm -f suexec$(EXEEXT) *~

Only in wn-2.4.0-gph/wn: Makefile
diff -urw wn-2.4.0/wn/Makefile.wn.dist wn-2.4.0-gph/wn/Makefile.wn.dist
--- wn-2.4.0/wn/Makefile.wn.dist	Wed Apr 25 16:05:02 2001
+++ wn-2.4.0-gph/wn/Makefile.wn.dist	Tue Jun 12 00:12:57 2001
@@ -2,6 +2,8 @@
 CFLAGS = -Wall
 CPPFLAGS = 
 LDFLAGS =
+# Cygwin needs it
+EXEEXT = .exe
 
 SSLFLAGS =
 # If you have compiled openssl without IDEA add -DNO_IDEA to SSLFLAGS
diff -urw wn-2.4.0/wn/chkauth.c wn-2.4.0-gph/wn/chkauth.c
--- wn-2.4.0/wn/chkauth.c	Thu May 10 15:30:05 2001
+++ wn-2.4.0-gph/wn/chkauth.c	Mon Jun 11 23:53:19 2001
@@ -25,7 +25,11 @@
 #include <string.h>
 #include <ctype.h>
 #include <sys/types.h>
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 #include <sys/stat.h>
 #include <sys/wait.h>
 
diff -urw wn-2.4.0/wn/init.c wn-2.4.0-gph/wn/init.c
--- wn-2.4.0/wn/init.c	Thu May 10 15:30:05 2001
+++ wn-2.4.0-gph/wn/init.c	Mon Jun 11 23:51:14 2001
@@ -25,7 +25,11 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/file.h>
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 #include <sys/socket.h>
 #include <string.h>
 #include <errno.h>
@@ -74,7 +78,7 @@
 #define PRINT1_ERROR( x)	printf( x);
 #endif
 
-#ifndef BSD_LIKE
+#if !defined BSD_LIKE && !defined __CYGWIN__
 extern long	timezone;
 #endif
 
@@ -882,11 +886,16 @@
 
 #ifdef BSD_LIKE
 	tz = ltm->tm_gmtoff;
-#else
+#endif /*BSD_LIKE */
+#ifdef __CYGWIN__
+	tzset();
+	tz = - _timezone;
+#endif /* __CYGWIN__ */
+#if !defined BSD_LIKE && !defined __CYGWIN__
 	tz = - timezone;
 	if( ltm->tm_isdst)
 		tz += 3600;
-#endif
+#endif /* !BSD_LIKE && __CYGWIN__ */
 	sign = ( tz > 0 ? '+' : '-');
 	tz = ( tz > 0 ? tz :  -tz);
 	cp = date;
diff -urw wn-2.4.0/wn/standalone.c wn-2.4.0-gph/wn/standalone.c
--- wn-2.4.0/wn/standalone.c	Thu May 10 15:30:05 2001
+++ wn-2.4.0-gph/wn/standalone.c	Mon Jun 11 23:54:13 2001
@@ -28,7 +28,11 @@
 #include <sys/file.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 #include <ctype.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
diff -urw wn-2.4.0/wn/wn.c wn-2.4.0-gph/wn/wn.c
--- wn-2.4.0/wn/wn.c	Thu May 10 15:30:05 2001
+++ wn-2.4.0-gph/wn/wn.c	Mon Jun 11 23:46:17 2001
@@ -31,7 +31,11 @@
 #include <sys/select.h>
 #endif
 
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 #include <sys/socket.h>
 #ifndef NO_UNISTD_H
 #include <unistd.h>
diff -urw wn-2.4.0/wnauth/Makefile wn-2.4.0-gph/wnauth/Makefile
--- wn-2.4.0/wnauth/Makefile	Fri Mar 10 16:22:46 2000
+++ wn-2.4.0-gph/wnauth/Makefile	Tue Jun 12 00:15:05 2001
@@ -1,5 +1,6 @@
-#CC = gcc
-
+CC = gcc
+# Cygwin needs it
+EXEEXT = .exe
 #Uncomment these two lines to use the DBM features of wnauth
 #You will likely have to change DBMLIB to whatever library contains
 # the NDBM functions dbm_open(), dbm_fetch() and dbm_close() on your system.
@@ -35,8 +36,8 @@
 		mkdir $(BINDIR) ; \
 	fi
 	@echo "Installing wnauth in $(BINDIR)"
-	@-cp wnauth $(BINDIR)
-	@-strip $(BINDIR)/wnauth
+	@-cp wnauth$(EXEEXT) $(BINDIR)
+	@-strip $(BINDIR)/wnauth$(EXEEXT)
 	@echo "Installing wn_md5passwd in $(BINDIR)"
 	@-chmod +x wn_md5passwd
 	@-cp wn_md5passwd $(BINDIR)
@@ -45,7 +46,7 @@
 		cp wn_pamauth.so $(BINDIR) ; \
 	fi
 clean:
-	@rm -f *.o  *~ wnauth wn_pamauth.so
+	@rm -f *.o  *~ wnauth$(EXEEXT) wn_pamauth.so
 
 wnauth.o: 		wnauth.h  ../config.h
 
diff -urw wn-2.4.0/wnauth/wnauth.c wn-2.4.0-gph/wnauth/wnauth.c
--- wn-2.4.0/wnauth/wnauth.c	Tue Nov 28 22:41:43 2000
+++ wn-2.4.0-gph/wnauth/wnauth.c	Mon Jun 11 23:59:16 2001
@@ -27,7 +27,11 @@
 #include <ctype.h>
 #include <unistd.h>
 #include <time.h>
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 #include <pwd.h>
 #include <sys/types.h>
 
diff -urw wn-2.4.0/wndex/Makefile wn-2.4.0-gph/wndex/Makefile
--- wn-2.4.0/wndex/Makefile	Wed Mar  8 22:45:19 2000
+++ wn-2.4.0-gph/wndex/Makefile	Tue Jun 12 00:13:28 2001
@@ -3,7 +3,8 @@
 CFLAGS = -I.. -I../wn -Wall
 MD5LIB = ../md5/md5lib.a
 #MD5LIB = -lcrypto
-
+# Cygwin needs it
+EXEEXT = .exe
 OBJS	= wndex.o init.o content.o serveall.o base64.o
 
 all:	wndex
@@ -17,11 +18,11 @@
 		mkdir $(BINDIR) ; \
 	fi
 	@echo "Installing wndex in $(BINDIR)"
-	@cp wndex $(BINDIR)
-	@strip $(BINDIR)/wndex
+	@cp wndex$(EXEEXT) $(BINDIR)
+	@strip $(BINDIR)/wndex$(EXEEXT)
 
 clean:
-	@rm -f *.o *.a  *~ wndex
+	@rm -f *.o *.a  *~ wndex$(EXEEXT)
 
 wndex.o: 	wndex.h err.h ../wn/common.h ../config.h
 init.o: 	wndex.h err.h ../wn/common.h ../config.h ../wn/version.h
diff -urw wn-2.4.0/wnputh/Makefile wn-2.4.0-gph/wnputh/Makefile
--- wn-2.4.0/wnputh/Makefile	Wed Dec 13 16:03:02 2000
+++ wn-2.4.0-gph/wnputh/Makefile	Tue Jun 12 00:13:28 2001
@@ -1,5 +1,6 @@
-#CC = gcc
-
+CC = gcc
+# Cygwin needs it
+EXEEXT = .exe
 BINDIR=../bin
 
 CFLAGS = -I../wn/ -O -Wall
@@ -17,11 +18,11 @@
 		mkdir $(BINDIR) ; \
 	fi
 	@echo "Installing wnputh in $(BINDIR)"
-	@-cp wnputh $(BINDIR)
-	@-strip $(BINDIR)/wnputh
+	@-cp wnputh$(EXEEXT) $(BINDIR)
+	@-strip $(BINDIR)/wnputh$(EXEEXT)
 
 clean:
-	@rm -f *.o  *~ wnputh
+	@rm -f *.o  *~ wnputh$(EXEEXT)
 
 puth.o:	puth.h  ../config.h
 
diff -urw wn-2.4.0/wnputh/puth.c wn-2.4.0-gph/wnputh/puth.c
--- wn-2.4.0/wnputh/puth.c	Sat Dec  2 16:35:20 2000
+++ wn-2.4.0-gph/wnputh/puth.c	Tue Jun 12 00:00:01 2001
@@ -32,7 +32,11 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 
 #include "../config.h"
 #include "puth.h"
Only in wn-2.4.0-gph/wnssl: Makefile
diff -urw wn-2.4.0/wnssl/chkauth.c wn-2.4.0-gph/wnssl/chkauth.c
--- wn-2.4.0/wnssl/chkauth.c	Thu May 10 15:30:05 2001
+++ wn-2.4.0-gph/wnssl/chkauth.c	Mon Jun 11 23:53:19 2001
@@ -25,7 +25,11 @@
 #include <string.h>
 #include <ctype.h>
 #include <sys/types.h>
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 #include <sys/stat.h>
 #include <sys/wait.h>
 
diff -urw wn-2.4.0/wnssl/init.c wn-2.4.0-gph/wnssl/init.c
--- wn-2.4.0/wnssl/init.c	Thu May 10 15:30:05 2001
+++ wn-2.4.0-gph/wnssl/init.c	Mon Jun 11 23:51:14 2001
@@ -25,7 +25,11 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/file.h>
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 #include <sys/socket.h>
 #include <string.h>
 #include <errno.h>
@@ -74,7 +78,7 @@
 #define PRINT1_ERROR( x)	printf( x);
 #endif
 
-#ifndef BSD_LIKE
+#if !defined BSD_LIKE && !defined __CYGWIN__
 extern long	timezone;
 #endif
 
@@ -882,11 +886,16 @@
 
 #ifdef BSD_LIKE
 	tz = ltm->tm_gmtoff;
-#else
+#endif /*BSD_LIKE */
+#ifdef __CYGWIN__
+	tzset();
+	tz = - _timezone;
+#endif /* __CYGWIN__ */
+#if !defined BSD_LIKE && !defined __CYGWIN__
 	tz = - timezone;
 	if( ltm->tm_isdst)
 		tz += 3600;
-#endif
+#endif /* !BSD_LIKE && __CYGWIN__ */
 	sign = ( tz > 0 ? '+' : '-');
 	tz = ( tz > 0 ? tz :  -tz);
 	cp = date;
diff -urw wn-2.4.0/wnssl/standalone.c wn-2.4.0-gph/wnssl/standalone.c
--- wn-2.4.0/wnssl/standalone.c	Thu May 10 15:30:05 2001
+++ wn-2.4.0-gph/wnssl/standalone.c	Mon Jun 11 23:54:13 2001
@@ -28,7 +28,11 @@
 #include <sys/file.h>
 #include <sys/socket.h>
 #include <sys/wait.h>
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 #include <ctype.h>
 #include <netinet/in.h>
 #include <netinet/tcp.h>
diff -urw wn-2.4.0/wnssl/wn.c wn-2.4.0-gph/wnssl/wn.c
--- wn-2.4.0/wnssl/wn.c	Thu May 10 15:30:05 2001
+++ wn-2.4.0-gph/wnssl/wn.c	Mon Jun 11 23:46:17 2001
@@ -31,7 +31,11 @@
 #include <sys/select.h>
 #endif
 
+#ifndef __CYGWIN__
 #include <sys/signal.h>
+#else /* __CYGWIN__ */
+#include <signal.h>
+#endif /* __CYGWIN__ */
 #include <sys/socket.h>
 #ifndef NO_UNISTD_H
 #include <unistd.h>

=================END

gph

-- 
=^..^=

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