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

PATCH: static cygwin compilation



I can't get dynamic linking on cygwin to work, and the problem is somewhere
in the middle of dllwrap which is giving no help, so I won't be able to
debug this any time soon.

Static linking is now broken:  the following seems to fix it up.  However,
I won't be able to tell if this re-breaks dynamic compilation.  If I've
understood the meaning of MODULE correctly, it shouldn't.

Index: Src/mkmakemod.sh
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/mkmakemod.sh,v
retrieving revision 1.2
diff -u -r1.2 mkmakemod.sh
--- Src/mkmakemod.sh	2000/08/02 18:01:51	1.2
+++ Src/mkmakemod.sh	2000/08/07 14:54:39
@@ -427,8 +427,13 @@
 	    echo "	    done; \\"
 	    if test "$CYGWIN" = yes; then
 		echo "	    echo '# ifndef IMPORTING_MODULE_${q_name} '; \\"
-		echo "	    echo '#  undef mod_import_variable'; \\"
-		echo "	    echo '#  define mod_import_variable __attribute__((__dllimport__))'; \\"
+		echo "      echo '#  ifdef MODULE'; \\"
+		echo "	    echo '#   undef mod_import_variable'; \\"
+		echo "	    echo '#   define mod_import_variable __attribute__((__dllimport__))'; \\"
+		echo "      echo '#  else /* MODULE */'; \\"
+		echo "      echo '#   undef mod_import_variable'; \\"
+		echo "      echo '#   define mod_import_variable'; \\"
+		echo "      echo '#  endif /* MODULE */'; \\"
 		echo "	    echo '# endif /* IMPORTING_MODULE_${q_name} */'; \\"
 	    fi
 	    echo "	    echo; \\"
Index: Src/zsh.h
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v
retrieving revision 1.18
diff -u -r1.18 zsh.h
--- Src/zsh.h	2000/08/02 18:01:51	1.18
+++ Src/zsh.h	2000/08/07 14:54:39
@@ -1681,7 +1681,7 @@
 /* Pseudo-keyword to mark exportedness */
 /***************************************/
 
-#ifdef __CYGWIN__
+#if defined(__CYGWIN__) && defined(MODULE)
 #define mod_export __attribute__((__dllexport__))
 #define mod_import_variable __attribute__((__dllimport__))
 #define mod_import_function

-- 
Peter Stephenson <pws@xxxxxxx>
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