Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: cygwin modules



This allows zftp and mathfunc to compile (and work) on cygwin.  Dynamic
loading doesn't work, so you need to put them in mymods.conf.  I haven't
yet checked whether dynamic loading should work.

I haven't dared alter the order of the headers in zftp.c again, so I had to
include config.h separately at the top to detect whether netinet/in_systm.h
is there (it isn't on cygwin).

There are still configuration problems:

- autoconf screws up the additions by Zefram for config.status, haven't
looked at why.  I don't suppose anyone's going to be doing to much
development on cygwin, however, and this isn't an issue for releases.

- More importantly, installation doesn't work because it doesn't get the
.exe suffix for the executable when creating a link to it, so you have to
install by hand.  I hope this isn't too hard to fix; again, I haven't
looked yet.  I thought in principal we were already dealing with such
suffixes.

I'll send a patch for Etc/MACHINES separately because I want it to go to
zsh-users.

Index: configure.in
===================================================================
RCS file: /cvsroot/zsh/zsh/configure.in,v
retrieving revision 1.9
diff -u -r1.9 configure.in
--- configure.in	2000/05/09 11:54:43	1.9
+++ configure.in	2000/05/25 14:15:59
@@ -444,7 +444,7 @@
 		 limits.h fcntl.h libc.h sys/utsname.h sys/resource.h \
 		 locale.h errno.h stdlib.h unistd.h sys/capability.h \
 		 utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \
-		 linux/tasks.h)
+		 linux/tasks.h netinet/in_systm.h)
 if test $dynamic = yes; then
   AC_CHECK_HEADERS(dlfcn.h)
   AC_CHECK_HEADERS(dl.h)
@@ -838,7 +838,8 @@
 	       cap_get_proc \
 	       getrlimit \
 	       setlocale \
-	       uname)
+	       uname \
+	       signgam)
 AC_FUNC_STRCOLL
 
 if test $ac_cv_func_setpgrp = yes; then
Index: Src/Modules/mathfunc.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/mathfunc.c,v
retrieving revision 1.1.1.9
diff -u -r1.1.1.9 mathfunc.c
--- Src/Modules/mathfunc.c	1999/12/20 22:29:12	1.1.1.9
+++ Src/Modules/mathfunc.c	2000/05/25 14:15:59
@@ -69,7 +69,9 @@
 MF_NEXTAFTER,
 MF_RINT,
 MF_SCALB,
+#ifdef HAVE_SIGNGAM
 MF_SIGNGAM,
+#endif
 MF_SIN,
 MF_SINH,
 MF_SQRT,
@@ -155,7 +157,9 @@
   NUMMATHFUNC("nextafter", math_func, 2, 2, MF_NEXTAFTER),
   NUMMATHFUNC("rint", math_func, 1, 1, MF_RINT),
   NUMMATHFUNC("scalb", math_func, 2, 2, MF_SCALB | TFLAG(TF_INT2)),
+#ifdef HAVE_SIGNGAM
   NUMMATHFUNC("signgam", math_func, 0, 0, MF_SIGNGAM | TFLAG(TF_NOASS)),
+#endif
   NUMMATHFUNC("sin", math_func, 1, 1, MF_SIN),
   NUMMATHFUNC("sinh", math_func, 1, 1, MF_SINH),
   NUMMATHFUNC("sqrt", math_func, 1, 1, MF_SQRT | BFLAG(BF_NONNEG)),
@@ -392,10 +396,12 @@
       retd = scalb(argd, argi);
       break;
 
+#ifdef HAVE_SIGNGAM
   case MF_SIGNGAM:
       ret.type = MN_INTEGER;
       ret.u.l = signgam;
       break;
+#endif
 
   case MF_SIN:
       retd = sin(argd);
Index: Src/Modules/zftp.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Modules/zftp.c,v
retrieving revision 1.4
diff -u -r1.4 zftp.c
--- Src/Modules/zftp.c	2000/05/25 10:50:05	1.4
+++ Src/Modules/zftp.c	2000/05/25 14:16:00
@@ -50,10 +50,20 @@
 struct zftp_session;
 typedef struct zftp_session *Zftp_session;
 
+/*
+ * We need to include the zsh headers later to avoid clashes with
+ * the definitions on some systems, however we need the configuration
+ * file to decide whether we can include netinet/in_systm.h, which
+ * doesn't exist on cygwin.
+ */
+#include "../../config.h"
+
 #include <sys/types.h>
 #include <sys/socket.h>
 #include <netdb.h>
-#include <netinet/in_systm.h>
+#ifdef HAVE_NETINET_IN_SYSTM_H
+# include <netinet/in_systm.h>
+#endif
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <arpa/inet.h>

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxxxxxxxxxx>
Cambridge Silicon Radio, Unit 300, Science Park, Milton Road,
Cambridge, CB4 0XL, UK                          Tel: +44 (0)1223 392070



Messages sorted by: Reverse Date, Date, Thread, Author