From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9610 invoked from network); 14 Aug 2000 17:54:30 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 14 Aug 2000 17:54:30 -0000 Received: (qmail 15772 invoked by alias); 14 Aug 2000 17:54:21 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 12623 Received: (qmail 15765 invoked from network); 14 Aug 2000 17:54:20 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "ZSH workers mailing list" Subject: PATCH: Cygwin - second go. Date: Mon, 14 Aug 2000 21:54:15 +0400 Message-ID: <000f01c00618$a99c2be0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0010_01C0063A.30AF5280" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 This is a multi-part message in MIME format. ------=_NextPart_000_0010_01C0063A.30AF5280 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit This patch hopefully makes both dynamic and static compilation under Cygwin possible again (at least, I tried both under Unix and under Cygwin). The main changes are: - almost all dependencies are now in configure.in; it defines MOD_EXPORT, MOD_IMPORT_VARIABLE and MOD_IMPORT_FUNCTION that are put by mkmakemod.sh into *.mdh files - dllwrap is now using --export-all-symbols. Else the problem with setup_, etc became just way too messy and I did not have enough guts :-) It means, that missing mod_export's won't be noticed anymore. - I removed --dllname. It does not appear to do what I expected and I wait some clarification (hopefully) from Cygwin list. (I was afraid, that if we have two modules foo1/bar.dll and foo2/bar.dll system may not like it. But dllname does not appear to be used for imported name resolution - or I do not know how to do it). Question - should I remove --export-all-symbols? With this option cygwin becomes so much like a Unix, that I was even tempted to remove special case from configure.in :>-) -andrej Have a nice DOS! B >> P.S. Post-1.1.4 cygwin appears to be broken to the extent, that multios hangs and CPU load goes high. Just to warn you :-) P.P.S. I compiled in the Peter's icon. Wow! At least, now I really see where is my Zsh shortcut :-)) Probably, we could post the question to zsh-users or even c.u.s. But icon is pretty usable as is already! ------=_NextPart_000_0010_01C0063A.30AF5280 Content-Type: application/octet-stream; name="zsh-cygwin.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="zsh-cygwin.diff" Index: configure.in=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/zsh/zsh/configure.in,v=0A= retrieving revision 1.24=0A= diff -u -r1.24 configure.in=0A= --- configure.in 2000/08/14 16:46:18 1.24=0A= +++ configure.in 2000/08/14 16:58:01=0A= @@ -1431,6 +1431,10 @@=0A= dnl dynamic loading=0A= dnl ---------------=0A= L=3DN=0A= +LINKMODS=3DNOLINKMODS=0A= +MOD_EXPORT=3D=0A= +MOD_IMPORT_VARIABLE=3D=0A= +MOD_IMPORT_FUNCTION=3D=0A= aixdynamic=3Dno=0A= hpuxdynamic=3Dno=0A= if test "$ac_cv_func_dlopen" !=3D yes ||=0A= @@ -1477,6 +1481,7 @@=0A= elif test "x$ac_cv_cygwin" =3D xyes; then=0A= DL_EXT=3D"${DL_EXT=3Ddll}"=0A= DLLD=3D"${DLLD=3Ddllwrap}"=0A= + DLLDFLAGS=3D"${DLLDFLAGS=3D--export-all-symbols}"=0A= zsh_cv_func_dlsym_needs_underscore=3Dno=0A= DLLDFLAGS=3D${DLLDFLAGS=3D}=0A= EXTRA_LDFLAGS=3D${EXTRA_LDFLAGS=3D}=0A= @@ -1486,6 +1491,10 @@=0A= zsh_cv_sys_dynamic_strip_exe=3D"${zsh_cv_sys_dynamic_strip_exe=3Dyes}"=0A= zsh_cv_sys_dynamic_strip_lib=3D"${zsh_cv_sys_dynamic_strip_lib=3Dyes}"=0A= zsh_cv_sys_dynamic_broken=3D"${zsh_cv_sys_dynamic_broken=3Dno}"=0A= + LINKMODS=3DLINKMODS=0A= + MOD_EXPORT=3D"__attribute__((__dllexport__))"=0A= + MOD_IMPORT_VARIABLE=3D"__attribute__((__dllimport__))"=0A= + MOD_IMPORT_FUNCTION=3D=0A= elif test "x$dynamic" =3D xyes; then=0A= AC_CACHE_CHECK(if your system use ELF binaries,=0A= zsh_cv_sys_elf,=0A= @@ -1694,7 +1703,10 @@=0A= AC_SUBST(EXPOPT)dnl=0A= AC_SUBST(IMPOPT)dnl=0A= AC_SUBST(L)dnl=0A= -AC_SUBST(RTLD_GLOBAL_OK)dnl=0A= +AC_SUBST(LINKMODS)dnl=0A= +AC_SUBST(MOD_EXPORT)dnl=0A= +AC_SUBST(MOD_IMPORT_VARIABLE)dnl=0A= +AC_SUBST(MOD_IMPORT_FUNCTION)dnl=0A= =0A= CLEAN_MK=3D"${srcdir}/Config/clean.mk"=0A= CONFIG_MK=3D"${srcdir}/Config/config.mk"=0A= Index: Src/mkmakemod.sh=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/zsh/zsh/Src/mkmakemod.sh,v=0A= retrieving revision 1.3=0A= diff -u -r1.3 mkmakemod.sh=0A= --- Src/mkmakemod.sh 2000/08/07 17:17:05 1.3=0A= +++ Src/mkmakemod.sh 2000/08/14 16:58:02=0A= @@ -73,15 +73,6 @@=0A= s,\(.\)/$,\1,=0A= '=0A= =0A= -CYGWIN=3Dno=0A= -if uname -s > /dev/null 2>&1; then=0A= - case `uname -s` in=0A= - CYGWIN* )=0A= - CYGWIN=3Dyes=0A= - ;;=0A= - esac=0A= -fi=0A= -=0A= # decide which stages to process=0A= first_stage=3Dtrue=0A= second_stage=3Dtrue=0A= @@ -202,7 +193,6 @@=0A= exportdeps=3D=0A= imports=3D=0A= q_moddeps=3D=0A= - dllname=3D=0A= for dep in $moddeps; do=0A= q_dep=3D`echo $dep | sed 's,Q,Qq,g;s,_,Qu,g;s,/,Qs,g'`=0A= q_moddeps=3D"$q_moddeps $q_dep"=0A= @@ -222,9 +212,6 @@=0A= zsh/main )=0A= mdll=3D"\$(dir_top)/Src/libzsh-\$(VERSION).\$(DL_EXT) "=0A= ;;=0A= - zsh/$mddname )=0A= - mdll=3D=0A= - ;;=0A= * )=0A= mdll=3D"${depbase}.\$(DL_EXT) "=0A= ;;=0A= @@ -245,9 +232,6 @@=0A= zsh/main )=0A= mdll=3D"\$(dir_top)/Src/libzsh-\$(VERSION).\$(DL_EXT) "=0A= ;;=0A= - zsh/$mddname )=0A= - mdll=3D=0A= - ;;=0A= * )=0A= mdll=3D"\$(dir_top)/$loc/${depbase}.\$(DL_EXT) "=0A= ;;=0A= @@ -272,9 +256,6 @@=0A= zsh/main )=0A= mdll=3D"\$(dir_top)/Src/libzsh-\$(VERSION).\$(DL_EXT) "=0A= ;;=0A= - zsh/$mddname )=0A= - mdll=3D=0A= - ;;=0A= * )=0A= mdll=3D"\$(dir_top)/$loc/${depbase}.\$(DL_EXT) "=0A= ;;=0A= @@ -288,20 +269,15 @@=0A= modhdeps=3D"$modhdeps $mdh"=0A= exportdeps=3D"$exportdeps $export"=0A= imports=3D"$imports \$(IMPOPT)$export"=0A= - if test $CYGWIN =3D yes -a -n "$mdll"; then=0A= - case "$mododeps" in=0A= - *" $mdll "* )=0A= - :=0A= - ;;=0A= - * )=0A= - mododeps=3D"$mododeps $mdll"=0A= - ;;=0A= - esac=0A= - fi=0A= + case "$mododeps " in=0A= + *" $mdll "* )=0A= + :=0A= + ;;=0A= + * )=0A= + mododeps=3D"$mododeps $mdll"=0A= + ;;=0A= + esac=0A= done=0A= - if test $CYGWIN =3D yes; then=0A= - dllname=3D"--dllname $q_name"=0A= - fi=0A= =0A= echo "##### =3D=3D=3D=3D=3D DEPENDENCIES GENERATED FROM ${mddname}.mdd = =3D=3D=3D=3D=3D #####"=0A= echo=0A= @@ -312,8 +288,8 @@=0A= echo "INCS_${mddname} =3D \$(EPRO_${mddname}) $otherincs"=0A= echo "EXPIMP_${mddname} =3D $imports \$(EXPOPT)$mddname.export"=0A= echo "NXPIMP_${mddname} =3D"=0A= - echo "DEPMODS_${mddname} =3D $mododeps"=0A= - echo "DLLNAME_${mddname} =3D $dllname"=0A= + echo "LINKMODS_${mddname} =3D $mododeps"=0A= + echo "NOLINKMODS_${mddname} =3D "=0A= echo=0A= echo "proto.${mddname}: \$(EPRO_${mddname})"=0A= echo "\$(SYMS_${mddname}): \$(PROTODEPS)"=0A= @@ -338,9 +314,9 @@=0A= echo "uninstall.modules.${mddname}:"=0A= echo " rm -f \$(DESTDIR)\$(MODDIR)/${name}.\$(DL_EXT)"=0A= echo=0A= - echo "${mddname}.\$(DL_EXT): \$(MODDOBJS_${mddname}) = ${mddname}.export $exportdeps \$(DEPMODS_${mddname})"=0A= + echo "${mddname}.\$(DL_EXT): \$(MODDOBJS_${mddname}) = ${mddname}.export $exportdeps \$(@LINKMODS@_${mddname})"=0A= echo ' rm -f $@'=0A= - echo " \$(DLLINK) \$(@E@XPIMP_$mddname) \$(@E@NTRYOPT) = \$(DLLNAME_${mddname}) \$(MODDOBJS_${mddname}) \$(DEPMODS_${mddname}) = \$(LIBS) "=0A= + echo " \$(DLLINK) \$(@E@XPIMP_$mddname) \$(@E@NTRYOPT) = \$(MODDOBJS_${mddname}) \$(@LINKMODS@_${mddname}) \$(LIBS) "=0A= echo=0A= fi=0A= echo "${mddname}.mdhi: ${mddname}.mdhs \$(INCS_${mddname})"=0A= @@ -368,30 +344,16 @@=0A= echo " echo '#define have_${q_name}_module'; \\"=0A= echo " echo; \\"=0A= echo " echo '# ifndef IMPORTING_MODULE_${q_name}'; \\"=0A= - if test $CYGWIN =3D yes; then=0A= - echo " echo '# ifdef MODULE'; \\"=0A= - echo " echo '# define boot_ __attribute__((__dllexport__)) = boot_${q_name}'; \\"=0A= - echo " echo '# define cleanup_ = __attribute__((__dllexport__)) cleanup_${q_name}'; \\"=0A= - echo " echo '# define setup_ __attribute__((__dllexport__)) = setup_${q_name}'; \\"=0A= - echo " echo '# define finish_ __attribute__((__dllexport__)) = finish_${q_name}'; \\"=0A= - echo " echo '# else /* MODULE */'; \\"=0A= - echo " echo '# define boot_ boot_${q_name}'; \\"=0A= - echo " echo '# define cleanup_ cleanup_${q_name}'; \\"=0A= - echo " echo '# define setup_ setup_${q_name}'; \\"=0A= - echo " echo '# define finish_ finish_${q_name}'; \\"=0A= - echo " echo '# endif /* MODULE */'; \\"=0A= - else=0A= - echo " if test @SHORTBOOTNAMES@ =3D yes; then \\"=0A= - echo " echo '# ifndef MODULE'; \\"=0A= - echo " fi; \\"=0A= - echo " echo '# define boot_ boot_${q_name}'; \\"=0A= - echo " echo '# define cleanup_ cleanup_${q_name}'; \\"=0A= - echo " echo '# define setup_ setup_${q_name}'; \\"=0A= - echo " echo '# define finish_ finish_${q_name}'; \\"=0A= - echo " if test @SHORTBOOTNAMES@ =3D yes; then \\"=0A= - echo " echo '# endif /* !MODULE */'; \\"=0A= - echo " fi; \\"=0A= - fi=0A= + echo " if test @SHORTBOOTNAMES@ =3D yes; then \\"=0A= + echo " echo '# ifndef MODULE'; \\"=0A= + echo " fi; \\"=0A= + echo " echo '# define boot_ boot_${q_name}'; \\"=0A= + echo " echo '# define cleanup_ cleanup_${q_name}'; \\"=0A= + echo " echo '# define setup_ setup_${q_name}'; \\"=0A= + echo " echo '# define finish_ finish_${q_name}'; \\"=0A= + echo " if test @SHORTBOOTNAMES@ =3D yes; then \\"=0A= + echo " echo '# endif /* !MODULE */'; \\"=0A= + echo " fi; \\"=0A= echo " echo '# endif /* !IMPORTING_MODULE_${q_name} */'; \\"=0A= echo " echo; \\"=0A= if test -n "$moddeps"; then (=0A= @@ -416,26 +378,25 @@=0A= echo " echo; \\"=0A= fi=0A= if test -n "$proto"; then=0A= - if test "$CYGWIN" =3D yes; then=0A= - echo " echo '# ifndef IMPORTING_MODULE_${q_name} '; \\"=0A= - echo " echo '# undef mod_import_variable'; \\"=0A= - echo " echo '# define mod_import_variable'; \\"=0A= - echo " echo '# endif /* IMPORTING_MODULE_${q_name} */'; \\"=0A= - fi=0A= + echo " echo '# undef mod_import_variable'; \\"=0A= + echo " echo '# undef mod_import_function'; \\"=0A= + echo " echo '# if defined(IMPORTING_MODULE_${q_name}) && = defined(MODULE)'; \\"=0A= + echo " echo '# define mod_import_variable = @MOD_IMPORT_VARIABLE@'; \\"=0A= + echo " echo '# define mod_import_function = @MOD_IMPORT_FUNCTION@'; \\"=0A= + echo " echo '# else'; \\"=0A= + echo " echo '# define mod_import_function'; \\"=0A= + echo " echo '# define mod_import_variable'; \\"=0A= + echo " echo '# endif /* IMPORTING_MODULE_${q_name} && MODULE = */'; \\"=0A= echo " for epro in \$(EPRO_${mddname}); do \\"=0A= echo " echo '# include \"'\$\$epro'\"'; \\"=0A= echo " done; \\"=0A= - if test "$CYGWIN" =3D yes; then=0A= - echo " echo '# ifndef IMPORTING_MODULE_${q_name} '; \\"=0A= - echo " echo '# ifdef MODULE'; \\"=0A= - echo " echo '# undef mod_import_variable'; \\"=0A= - echo " echo '# define mod_import_variable = __attribute__((__dllimport__))'; \\"=0A= - echo " echo '# else /* MODULE */'; \\"=0A= - echo " echo '# undef mod_import_variable'; \\"=0A= - echo " echo '# define mod_import_variable'; \\"=0A= - echo " echo '# endif /* MODULE */'; \\"=0A= - echo " echo '# endif /* IMPORTING_MODULE_${q_name} */'; \\"=0A= - fi=0A= + echo " echo '# undef mod_import_variable'; \\"=0A= + echo " echo '# define mod_import_variable'; \\"=0A= + echo " echo '# undef mod_import_variable'; \\"=0A= + echo " echo '# define mod_import_variable'; \\"=0A= + echo " echo '# ifndef mod_export'; \\"=0A= + echo " echo '# define mod_export @MOD_EXPORT@'; \\"=0A= + echo " echo '# endif /* mod_export */'; \\"=0A= echo " echo; \\"=0A= fi=0A= echo " echo '#endif /* !have_${q_name}_module */'; \\"=0A= @@ -472,17 +433,15 @@=0A= echo " false # should only happen with make -n"=0A= echo=0A= fi=0A= - if test "$CYGWIN" =3D yes; then=0A= - for mdll in $remote_modules; do=0A= - echo "$mdll: FORCE"=0A= - echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$mdll"=0A= - echo=0A= - done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'=0A= - if test -n "$other_modules"; then=0A= - echo "${other_modules}:" | sed 's,^ ,,'=0A= - echo " false # should only happen with make -n"=0A= - echo=0A= - fi=0A= + for mdll in $remote_modules; do=0A= + echo "$mdll: FORCE"=0A= + echo " @cd @%@ && \$(MAKE) \$(MAKEDEFS) @%@$mdll"=0A= + echo=0A= + done | sed 's,^\(.*\)@%@\(.*\)@%@\(.*\)/\([^/]*\)$,\1\3\2\4,'=0A= + if test -n "$other_modules"; then=0A= + echo "${other_modules}:" | sed 's,^ ,,'=0A= + echo " false # should only happen with make -n"=0A= + echo=0A= fi=0A= fi=0A= =0A= Index: Src/zsh.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/zsh/zsh/Src/zsh.h,v=0A= retrieving revision 1.21=0A= diff -u -r1.21 zsh.h=0A= --- Src/zsh.h 2000/08/10 16:19:12 1.21=0A= +++ Src/zsh.h 2000/08/14 16:58:08=0A= @@ -1681,20 +1681,6 @@=0A= typedef unsigned char * (*ZleReadFn) _((char *, char *, int));=0A= =0A= /***************************************/=0A= -/* Pseudo-keyword to mark exportedness */=0A= -/***************************************/=0A= -=0A= -#if defined(__CYGWIN__) && defined(MODULE)=0A= -#define mod_export __attribute__((__dllexport__))=0A= -#define mod_import_variable __attribute__((__dllimport__))=0A= -#define mod_import_function=0A= -#else=0A= -#define mod_export=0A= -#define mod_import_variable=0A= -#define mod_import_function=0A= -#endif=0A= -=0A= -/***************************************/=0A= /* Hooks in core. */=0A= /***************************************/=0A= =0A= ------=_NextPart_000_0010_01C0063A.30AF5280--