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

Patch for 4.2.3 building on Cygwin



Cygwin updates against zsh-4.2.3.  See attached diffs:

configure.ac - check for iconv.h
             - check for libiconv() if cygwin
	     - call 'pcre-config --libs' to get LIBS if using pcre
Src/utils.c  - added if defined(HAVE_ICONV_H) to #if's which test for
               HAVE_ICONV or HAVE_LIBICONV

Notes:

Added iconv.h header to header check list.  This is really just for
completeness.  iconv() in Cygwin is really libiconv() (iconv.h does a
"#define iconv libiconv").  However the AC_CHECK_LIB() macro doesn't know
to include iconv.h.  I played with coding a custom conf test to #include
iconv.h but ran into prototype issues and decided it was simpler to just
look for the real function instead using AC_CHECK_LIB.

pcre's libs should be obtained by running pcre-config.  This isn't really
a cygwin-ism, but more of a generic pcre issue.

FIFO's in Cygwin are implemented using Windows' underlying named pipes
implementation and are somewhat buggy (like Windows, itself :).  Until
this is resolved, it makes more sense to disable their usage.  I'll
track this issue and send updates when things are working properly.

Thanks!

-- 
Peter A. Castro <doctor@xxxxxxxxxxxx> or <Peter.Castro@xxxxxxxxxx>
	"Cats are just autistic Dogs" -- Dr. Tony Attwood
diff -urN -x .build -x .inst -x .sinst zsh-4.2.3-orig/Src/utils.c zsh-4.2.3/Src/utils.c
--- zsh-4.2.3-orig/Src/utils.c	2005-01-12 02:56:16.000000000 -0800
+++ zsh-4.2.3/Src/utils.c	2005-01-22 21:37:58.765625000 -0800
@@ -35,7 +35,7 @@
 #else
 # ifdef HAVE_LANGINFO_H 			       
 #   include <langinfo.h>			       
-#   if defined(HAVE_ICONV) || defined(HAVE_LIBICONV)   
+#   if defined(HAVE_ICONV_H) || defined(HAVE_ICONV) || defined(HAVE_LIBICONV)   
 #     include <iconv.h> 			       
 #   endif					       
 # endif 					       
@@ -3521,7 +3521,7 @@
     size_t count;
 #else
     unsigned int wval;
-# if defined(HAVE_NL_LANGINFO) && defined(CODESET) && (defined(HAVE_ICONV) || defined(HAVE_LIBICONV))
+# if defined(HAVE_NL_LANGINFO) && defined(CODESET) && (defined(HAVE_ICONV_H) || defined(HAVE_ICONV) || defined(HAVE_LIBICONV))
     iconv_t cd;
     char inbuf[4];
     size_t inbytes, outbytes;
@@ -3642,7 +3642,7 @@
 		    t += ucs4toutf8(t, wval);
 		    continue;
 		} else {
-#   if defined(HAVE_ICONV) || defined(HAVE_LIBICONV)
+#   if defined(HAVE_ICONV_H) || defined(HAVE_ICONV) || defined(HAVE_LIBICONV)
     	    	    inbytes = 4;
 		    outbytes = 6;
     	    	    inptr = inbuf;
diff -urN -x .build -x .inst -x .sinst zsh-4.2.3-orig/configure.ac zsh-4.2.3/configure.ac
--- zsh-4.2.3-orig/configure.ac	2005-01-12 02:55:06.000000000 -0800
+++ zsh-4.2.3/configure.ac	2005-01-29 11:53:24.187500000 -0800
@@ -1,4 +1,3 @@
-dnl
 dnl  configure.ac: Configure template for zsh.
 dnl  Process this file with autoconf to produce a configure script.
 dnl
@@ -529,7 +528,7 @@
 		 locale.h errno.h stdio.h stdlib.h unistd.h sys/capability.h \
 		 utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \
 		 netinet/in_systm.h pcre.h langinfo.h wchar.h stddef.h \
-		 sys/stropts.h)
+		 sys/stropts.h iconv.h)
 if test $dynamic = yes; then
   AC_CHECK_HEADERS(dlfcn.h)
   AC_CHECK_HEADERS(dl.h)
@@ -727,11 +726,17 @@
 
 AC_CHECK_LIB(socket, socket)
 
-AC_CHECK_LIB(iconv, iconv)
+dnl AC_CHECK_LIB(iconv, iconv)
+
+if test "$host_os" = cygwin; then
+dnl cygwin iconv() is really libiconv()
+AC_CHECK_LIB(iconv, libiconv)
+fi
 
 if test x$enable_pcre = xyes; then
 dnl pcre-config should probably be employed here
-AC_SEARCH_LIBS(pcre_compile, pcre)
+dnl AC_SEARCH_LIBS(pcre_compile, pcre)
+  LIBS="`pcre-config --libs` $LIBS"
 fi
 
 dnl ---------------------
@@ -1633,7 +1638,11 @@
 dnl -----------
 AC_CACHE_CHECK(if named FIFOs work,
 zsh_cv_sys_fifo,
-[AC_TRY_RUN([
+[if test "$host_os" = cygwin; then
+dnl for now, fifos no worky in cygwin
+zsh_cv_sys_fifo=no
+else
+AC_TRY_RUN([
 #include <fcntl.h>
 #include <signal.h>
 main()
@@ -1663,7 +1672,8 @@
 ],
   zsh_cv_sys_fifo=yes,
   zsh_cv_sys_fifo=no,
-  zsh_cv_sys_fifo=yes)])
+  zsh_cv_sys_fifo=yes)
+fi])
 AH_TEMPLATE([HAVE_FIFOS],
 [Define to 1 if system has working FIFOs.])
 if test $zsh_cv_sys_fifo = yes; then


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