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

Re: PATCH: cygwin modules



Geoff wrote:
> This is (theoretically) handled via autoconf by calling
> 	AC_EXEEXT
> in configure.in and using $EXEEXT (which is "" everywhere except cygwin &
> mingw32) in the Makefile.in's

I would have sworn blind this was already in there.  I suspect that when
the tzsh tomfoolery was introduced, it just got thrown out.

Sorry I didn't check in my previous cygwin patches... this is a diff
against the current archive, so it includes the lot again.  I've added
Andrej's comment to MACHINES and removed the note about installation which
now works.

I've added AC_CYGWIN to configure.in for possible future use, but for now
it's really just a flag that cygwin is handled.  Maybe this will stop
people ripping out .exe handling in future.

===================================================================
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/26 09:36:02
@@ -367,6 +367,9 @@
 AC_PROG_GCC_TRADITIONAL     dnl Do we need -traditional flag for gcc.
 AC_C_CONST                  dnl Does compiler support `const'.
 
+AC_CYGWIN                   dnl Check for cygwin environment
+AC_EXEEXT                   dnl Check for executable extension, e.g. .exe
+
 fp_PROG_CC_STDC
 AC_MSG_CHECKING([whether to use prototypes])
 if test ."$ansi2knr" = .yes || test ."$ansi2knr" = .no; then
@@ -444,7 +447,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 +841,8 @@
 	       cap_get_proc \
 	       getrlimit \
 	       setlocale \
-	       uname)
+	       uname \
+	       signgam)
 AC_FUNC_STRCOLL
 
 if test $ac_cv_func_setpgrp = yes; then
Index: Config/defs.mk.in
===================================================================
RCS file: /cvsroot/zsh/zsh/Config/defs.mk.in,v
retrieving revision 1.1.1.8
diff -u -r1.1.1.8 defs.mk.in
--- Config/defs.mk.in	2000/02/14 00:19:24	1.1.1.8
+++ Config/defs.mk.in	2000/05/26 09:36:03
@@ -27,6 +27,7 @@
 # fundamentals
 SHELL = /bin/sh
 @SET_MAKE@
+EXEEXT = @EXEEXT@
 
 # install basename
 tzsh            = @tzsh@
Index: Etc/MACHINES
===================================================================
RCS file: /cvsroot/zsh/zsh/Etc/MACHINES,v
retrieving revision 1.3
diff -u -r1.3 MACHINES
--- Etc/MACHINES	2000/05/01 03:53:05	1.3
+++ Etc/MACHINES	2000/05/26 09:36:03
@@ -25,6 +25,16 @@
 Cray: Unicos (C90 and T90)
 	Should build `out-of-the-box'.
 
+Cygnus Solutions: Cygwin on Intel
+	Should build `out-of-the-box'.  The compilation directory should
+	be on a file system mounted as binary (the mount command shows
+	`binmode').
+
+	Dynamic loading does not work (this is automatically detected),
+	though libraries not compiled by default will work (see the file
+	INSTALL for how to add these to the base executable).  In
+	particular zsh/zftp and zsh/mathfunc are known to work.
+
 Data General: DG/UX 5.4R3.10 MU01 (various AViiONs)
 	Should build `out-of-the-box'.
 
Index: Src/Makefile.in
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/Makefile.in,v
retrieving revision 1.2
diff -u -r1.2 Makefile.in
--- Src/Makefile.in	2000/04/25 04:30:31	1.2
+++ Src/Makefile.in	2000/05/26 09:36:03
@@ -50,7 +50,7 @@
 all: bin modules
 .PHONY: all
 
-bin: zsh
+bin: zsh$(EXEEXT)
 .PHONY: bin
 
 modules: headers
@@ -74,7 +74,7 @@
 LDRUNPATH = LD_RUN_PATH=$(libdir)/$(tzsh)
 NDRUNPATH =
 
-zsh: $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export
+zsh$(EXEEXT): $(@L@IBZSH) $(@L@STMP) $(MAIN_OBJS) zsh.export
 	rm -f $@
 	$(@L@DRUNPATH) $(LINK) $(MAIN_OBJS) $(@L@LIST) $(ZSH_@E@XPORT) $(@L@IBZSH) $(LIBS)
 
@@ -176,16 +176,16 @@
 .PHONY: install.bin uninstall.bin
 
 # install binary, creating install directory if necessary
-install.bin-here: zsh install.bin-@L@
+install.bin-here: zsh$(EXEEXT) install.bin-@L@
 	$(sdir_top)/mkinstalldirs $(DESTDIR)$(bindir)
-	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)
-	if test -f $(DESTDIR)$(bindir)/$(tzsh); then \
+	$(INSTALL_PROGRAM) $(STRIPFLAGS) zsh$(EXEEXT) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)$(EXEEXT)
+	if test -f $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT); then \
 	    rm -f $(DESTDIR)$(bindir)/$(tzsh).old; \
-	    $(LN) $(DESTDIR)$(bindir)/$(tzsh) $(DESTDIR)$(bindir)/$(tzsh).old; \
+	    $(LN) $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT) $(DESTDIR)$(bindir)/$(tzsh).old; \
 	else :; fi
 	rm -f $(DESTDIR)$(bindir)/$(tzsh).new
-	$(LN) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh).new
-	mv $(DESTDIR)$(bindir)/$(tzsh).new $(DESTDIR)$(bindir)/$(tzsh)
+	$(LN) $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION)$(EXEEXT) $(DESTDIR)$(bindir)/$(tzsh).new
+	mv $(DESTDIR)$(bindir)/$(tzsh).new $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT)
 .PHONY: install.bin-here
 
 install.bin-N:
@@ -196,7 +196,7 @@
 
 # uninstall binary
 uninstall.bin-here: uninstall.bin-@L@
-	rm -f $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh)
+	rm -f $(DESTDIR)$(bindir)/$(tzsh)-$(VERSION) $(DESTDIR)$(bindir)/$(tzsh)$(EXEEXT)
 .PHONY: uninstall.bin-here uninstall.bin-@L@
 
 uninstall.bin-N:
@@ -215,7 +215,7 @@
 .PHONY: mostlyclean-here
 
 clean-here:
-	rm -f modules.index.tmp modules.stamp zsh ansi2knr.o ansi2knr
+	rm -f modules.index.tmp modules.stamp zsh$(EXEEXT) ansi2knr.o ansi2knr
 	rm -f modules.index modules-bltin
 	rm -f libzsh-*.$(DL_EXT)
 .PHONY: clean-here
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/26 09:36:03
@@ -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/26 09:36:03
@@ -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