From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12218 invoked from network); 31 Jan 2001 12:42:58 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 Jan 2001 12:42:58 -0000 Received: (qmail 16440 invoked by alias); 31 Jan 2001 12:42:51 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13416 Received: (qmail 16429 invoked from network); 31 Jan 2001 12:42:50 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "Zsh hackers list" Subject: RE: PATCH: RE: termcap moodule problem on Cygwin Date: Wed, 31 Jan 2001 15:42:42 +0300 Message-ID: <002801c08b83$4d6fe7d0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 In-Reply-To: Importance: Normal > > This turns the linking on SunOS 5.6 from dynamic to static for the two > modules. It was working OK before with dynamic. However, the curses > library which is linked in does appear to be static. On the other hand, > our new server with SunOS 5.8 appears to have a dynamic curses library, but > the test still fails, although: > % nm /lib/libcurses.so | grep tgetent > [1176] | 95876| 52|FUNC |GLOB |0 |9 |tgetent > The libraries used are `-lsocket -ldl -lnsl -lcurses -lm -lc'. > Yes, test was broken, sorry. Try this patch (on top of previous). The situation looks a bit more complicated. On my system name resolution in shared modules happens at runtime (unless you override it) so all modules pick up just one copy of curses library linked into main executable. Cool. -andrej --- aczsh.m4.old Wed Jan 31 13:31:38 2001 +++ aczsh.m4 Wed Jan 31 15:31:46 2001 @@ -111,6 +111,38 @@ dnl +dnl zsh_SHARED_FUNCTION +dnl Check whether symbol is available in static or shared library +dnl +dnl On some systems, static modifiable library symbols (such as environ) +dnl may appear only in statically linked libraries. If this is the case, +dnl then two shared libraries that reference the same symbol, each linked +dnl with the static library, could be given distinct copies of the symbol. +dnl +dnl Usage: zsh_SHARED_FUNCTION(name) +dnl Sets zsh_cv_shared_$1 cache variable to yes/no +dnl + +AC_DEFUN(zsh_SHARED_FUNCTION, +[zsh_SHARED_SYMBOL($1, [char *$1()], [$1])]) + +dnl +dnl zsh_SHARED_VARIABLE +dnl Check whether symbol is available in static or shared library +dnl +dnl On some systems, static modifiable library symbols (such as environ) +dnl may appear only in statically linked libraries. If this is the case, +dnl then two shared libraries that reference the same symbol, each linked +dnl with the static library, could be given distinct copies of the symbol. +dnl +dnl Usage: zsh_SHARED_VARIABLE(name,type) +dnl Sets zsh_cv_shared_$1 cache variable to yes/no +dnl + +AC_DEFUN(zsh_SHARED_VARIABLE, +[zsh_SHARED_SYMBOL($1, [ $2 $1], [&$1])]) + +dnl dnl zsh_SHARED_SYMBOL dnl Check whether symbol is available in static or shared library dnl @@ -119,7 +151,7 @@ dnl then two shared libraries that reference the same symbol, each linked dnl with the static library, could be given distinct copies of the symbol. dnl -dnl Usage: zsh_SHARED_SYMBOL(ident,type) +dnl Usage: zsh_SHARED_SYMBOL(name,declaration) dnl Sets zsh_cv_shared_$1 cache variable to yes/no dnl @@ -132,9 +164,12 @@ us= fi echo ' - extern $2 **$1; - void *symlist1[[]] = { - (void *)&$1, +#ifdef __CYGWIN__ + __attribute__((__dllimport__)) +#endif + extern $2; + void *symlist[[]] = { + (void *)$3, (void *)0 }; ' > conftest1.c @@ -179,8 +214,8 @@ if(!handle1) exit(1); handle2 = dlopen("./conftest2.$DL_EXT", RTLD_LAZY | RTLD_GLOBAL); if(!handle2) exit(1); - symlist1 = (void **) dlsym(handle1, "${us}symlist1"); - symlist2 = (void **) dlsym(handle2, "${us}symlist2"); + symlist1 = (void **) dlsym(handle1, "${us}symlist"); + symlist2 = (void **) dlsym(handle2, "${us}symlist"); if(!symlist1 || !symlist2) exit(1); for(; *symlist1; symlist1++, symlist2++) if(*symlist1 != *symlist2) bor@itsrm2% gdiff -u configure.in.old configure.in --- configure.in.old Wed Jan 31 14:45:05 2001 +++ configure.in Wed Jan 31 15:32:05 2001 @@ -1619,17 +1619,16 @@ fi if test "x$dynamic" = xyes; then - zsh_SHARED_SYMBOL([environ], [char **]) + zsh_SHARED_VARIABLE([environ], [char **]) test "$zsh_cv_shared_environ" = yes || dynamic=no dnl test "$zsh_cv_sys_dynamic_broken" = no || dynamic=no if test "$ac_cv_func_tgetent" = yes; then - zsh_SHARED_SYMBOL([tgetent], [(void (*)())]) + zsh_SHARED_FUNCTION([tgetent]) fi if test "$ac_cv_func_tigetstr" = yes; then - zsh_SHARED_SYMBOL([tigetstr], [(void (*)())]) + zsh_SHARED_FUNCTION([tigetstr]) fi fi - zsh_SHARED_SYMBOL([socket], [(void (*)())]) if test "x$dynamic" = xyes; then zsh_SYS_DYNAMIC_CLASH