From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11340 invoked from network); 31 Jan 2001 10:53:10 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 31 Jan 2001 10:53:10 -0000 Received: (qmail 3457 invoked by alias); 31 Jan 2001 10:53:02 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13414 Received: (qmail 3440 invoked from network); 31 Jan 2001 10:52:57 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "Zsh hackers list" Subject: PATCH: RE: termcap moodule problem on Cygwin Date: Wed, 31 Jan 2001 13:37:34 +0300 Message-ID: <002001c08b71$d23e08a0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0021_01C08B8A.F78B40A0" 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 is a multi-part message in MIME format. ------=_NextPart_000_0021_01C08B8A.F78B40A0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit > > You could force it to be statically linked by changing the `link' line to > test for cygwin in termcap.mdd. See existing `link=' in terminfo.mdd for > how this works. You can make this depend on a configure test for whether > termcap is static. > This implements the latter. On two systems with static termcap/terminfo both are now compiled into main executable. I do not have any system with shared term library. I could try using ncurses on Cygwin, but zsh unconditionally includes termcap.h and it is incompatible with ncurses. Please, check with shared termcap if both modules are still built as shared :) I am fairly sure that check in current form does not work correctly on Cygwin (due to stab libraries). -andrej ------=_NextPart_000_0021_01C08B8A.F78B40A0 Content-Type: application/octet-stream; name="zsh.termcap.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="zsh.termcap.diff" Index: aczsh.m4=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/aczsh.m4,v=0A= retrieving revision 1.6=0A= diff -u -r1.6 aczsh.m4=0A= --- aczsh.m4 2000/10/11 12:26:13 1.6=0A= +++ aczsh.m4 2001/01/31 10:32:38=0A= @@ -111,28 +111,30 @@=0A= =0A= =0A= dnl=0A= -dnl zsh_SYS_DYNAMIC_BROKEN=0A= -dnl Check whether static/shared library linking is broken.=0A= +dnl zsh_SHARED_SYMBOL=0A= +dnl Check whether symbol is available in static or shared library=0A= dnl=0A= dnl On some systems, static modifiable library symbols (such as = environ)=0A= dnl may appear only in statically linked libraries. If this is the = case,=0A= dnl then two shared libraries that reference the same symbol, each = linked=0A= dnl with the static library, could be given distinct copies of the = symbol.=0A= -dnl If this is the case then dynamic linking is FUBAR.=0A= dnl=0A= +dnl Usage: zsh_SHARED_SYMBOL(ident,type)=0A= +dnl Sets zsh_cv_shared_$1 cache variable to yes/no=0A= +dnl=0A= =0A= -AC_DEFUN(zsh_SYS_DYNAMIC_BROKEN,=0A= -[AC_CACHE_CHECK([if static/shared library linking is broken],=0A= -zsh_cv_sys_dynamic_broken,=0A= +AC_DEFUN(zsh_SHARED_SYMBOL,=0A= +[AC_CACHE_CHECK([if $1 is available in shared libraries],=0A= +zsh_cv_shared_$1,=0A= [if test "$zsh_cv_func_dlsym_needs_underscore" =3D yes; then=0A= us=3D_=0A= else=0A= us=3D=0A= fi=0A= echo '=0A= - extern char **environ;=0A= + extern $2 **$1;=0A= void *symlist1[[]] =3D {=0A= - (void *)&environ,=0A= + (void *)&$1,=0A= (void *)0=0A= };=0A= ' > conftest1.c=0A= @@ -185,12 +187,12 @@=0A= exit(1);=0A= exit(0);=0A= }=0A= -], [zsh_cv_sys_dynamic_broken=3Dno],=0A= -[zsh_cv_sys_dynamic_broken=3Dyes],=0A= -[zsh_cv_sys_dynamic_broken=3Dyes]=0A= +], [zsh_cv_shared_$1=3Dyes],=0A= +[zsh_cv_shared_$1=3Dno],=0A= +[zsh_cv_shared_$1=3Dno]=0A= )=0A= else=0A= - zsh_cv_sys_dynamic_broken=3Dyes=0A= + zsh_cv_shared_$1=3Dno=0A= fi=0A= ])=0A= ])=0A= 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.39=0A= diff -u -r1.39 configure.in=0A= --- configure.in 2001/01/19 14:47:44 1.39=0A= +++ configure.in 2001/01/31 10:32:39=0A= @@ -557,37 +557,6 @@=0A= AC_DEFINE(MUST_DEFINE_OSPEED)=0A= fi=0A= =0A= -dnl Check if tgetent accepts NULL (and will allocate its own termcap = buffer)=0A= -dnl Some termcaps reportedly accept a zero buffer, but then dump core=0A= -dnl in tgetstr().=0A= -dnl Under Cygwin test program crashes but exit code is still 0. So,=0A= -dnl we test for a file that porgram should create=0A= -AC_CACHE_CHECK(if tgetent accepts NULL,=0A= -zsh_cv_func_tgetent_accepts_null,=0A= -[AC_TRY_RUN([=0A= -main()=0A= -{=0A= - int i =3D tgetent((char*)0,"vt100");=0A= - if (i > 0) {=0A= - char tbuf[1024], *u;=0A= - u =3D tbuf;=0A= - tgetstr("cl", &u);=0A= - creat("conftest.tgetent", 0640);=0A= - }=0A= - exit(!i || i =3D=3D -1);=0A= -}=0A= -],=0A= - if test -f conftest.tgetent; then=0A= - zsh_cv_func_tgetent_accepts_null=3Dyes=0A= - else=0A= - zsh_cv_func_tgetent_accepts_null=3Dno=0A= - fi,=0A= - zsh_cv_func_tgetent_accepts_null=3Dno,=0A= - zsh_cv_func_tgetent_accepts_null=3Dno)])=0A= -if test $zsh_cv_func_tgetent_accepts_null =3D yes; then=0A= - AC_DEFINE(TGETENT_ACCEPTS_NULL)=0A= -fi=0A= -=0A= dnl --------------=0A= dnl CHECK TYPEDEFS=0A= dnl --------------=0A= @@ -845,9 +814,40 @@=0A= putenv getenv \=0A= brk sbrk \=0A= pathconf sysconf \=0A= - tigetflag tigetnum tigetstr)=0A= + tgetent tigetflag tigetnum tigetstr)=0A= AC_FUNC_STRCOLL=0A= =0A= +dnl Check if tgetent accepts NULL (and will allocate its own termcap = buffer)=0A= +dnl Some termcaps reportedly accept a zero buffer, but then dump core=0A= +dnl in tgetstr().=0A= +dnl Under Cygwin test program crashes but exit code is still 0. So,=0A= +dnl we test for a file that porgram should create=0A= +AC_CACHE_CHECK(if tgetent accepts NULL,=0A= +zsh_cv_func_tgetent_accepts_null,=0A= +[AC_TRY_RUN([=0A= +main()=0A= +{=0A= + int i =3D tgetent((char*)0,"vt100");=0A= + if (i > 0) {=0A= + char tbuf[1024], *u;=0A= + u =3D tbuf;=0A= + tgetstr("cl", &u);=0A= + creat("conftest.tgetent", 0640);=0A= + }=0A= + exit(!i || i =3D=3D -1);=0A= +}=0A= +],=0A= + if test -f conftest.tgetent; then=0A= + zsh_cv_func_tgetent_accepts_null=3Dyes=0A= + else=0A= + zsh_cv_func_tgetent_accepts_null=3Dno=0A= + fi,=0A= + zsh_cv_func_tgetent_accepts_null=3Dno,=0A= + zsh_cv_func_tgetent_accepts_null=3Dno)])=0A= +if test $zsh_cv_func_tgetent_accepts_null =3D yes; then=0A= + AC_DEFINE(TGETENT_ACCEPTS_NULL)=0A= +fi=0A= +=0A= AC_FUNC_MMAP=0A= if test x$ac_cv_func_mmap_fixed_mapped =3D xyes; then=0A= AC_CHECK_FUNCS(munmap msync)=0A= @@ -1471,7 +1471,10 @@=0A= zsh_cv_sys_dynamic_execsyms=3D"${zsh_cv_sys_dynamic_execsyms=3Dno}"=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= + #=0A= + # THAT SUCKS! and must be changed=0A= + #=0A= + zsh_cv_shared_environ=3D"${zsh_cv_shared_environ=3Dyes}"=0A= LINKMODS=3DLINKMODS=0A= MOD_EXPORT=3D"__attribute__((__dllexport__))"=0A= MOD_IMPORT_VARIABLE=3D"__attribute__((__dllimport__))"=0A= @@ -1616,8 +1619,15 @@=0A= fi=0A= =0A= if test "x$dynamic" =3D xyes; then=0A= - zsh_SYS_DYNAMIC_BROKEN=0A= - test "$zsh_cv_sys_dynamic_broken" =3D no || dynamic=3Dno=0A= + zsh_SHARED_SYMBOL([environ], [char **])=0A= + test "$zsh_cv_shared_environ" =3D yes || dynamic=3Dno=0A= +dnl test "$zsh_cv_sys_dynamic_broken" =3D no || dynamic=3Dno=0A= + if test "$ac_cv_func_tgetent" =3D yes; then=0A= + zsh_SHARED_SYMBOL([tgetent], [(void (*)())])=0A= + fi=0A= + if test "$ac_cv_func_tigetstr" =3D yes; then=0A= + zsh_SHARED_SYMBOL([tigetstr], [(void (*)())])=0A= + fi=0A= fi=0A= =0A= if test "x$dynamic" =3D xyes; then=0A= Index: Src/Modules/termcap.c=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/Modules/termcap.c,v=0A= retrieving revision 1.1=0A= diff -u -r1.1 termcap.c=0A= --- Src/Modules/termcap.c 2000/12/03 20:53:25 1.1=0A= +++ Src/Modules/termcap.c 2001/01/31 10:32:40=0A= @@ -33,7 +33,7 @@=0A= /* echotc: output a termcap */=0A= =0A= /**/=0A= -int=0A= +static int=0A= bin_echotc(char *name, char **argv, char *ops, int func)=0A= {=0A= char *s, buf[2048], *t, *u;=0A= Index: Src/Modules/termcap.mdd=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/Modules/termcap.mdd,v=0A= retrieving revision 1.1=0A= diff -u -r1.1 termcap.mdd=0A= --- Src/Modules/termcap.mdd 2000/12/03 20:53:25 1.1=0A= +++ Src/Modules/termcap.mdd 2001/01/31 10:32:40=0A= @@ -1,5 +1,15 @@=0A= name=3Dzsh/termcap=0A= -link=3Deither=0A= +=0A= +link=3D'if test "x$ac_cv_func_tgetent" =3D xyes; then=0A= + if test "x$zsh_cv_shared_tgetent" =3D xyes; then=0A= + echo either=0A= + else=0A= + echo static=0A= + fi=0A= + else=0A= + echo no;=0A= + fi=0A= +'=0A= load=3Dyes=0A= =0A= autobins=3D"echotc"=0A= Index: Src/Modules/terminfo.c=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/Modules/terminfo.c,v=0A= retrieving revision 1.4=0A= diff -u -r1.4 terminfo.c=0A= --- Src/Modules/terminfo.c 2000/12/06 01:16:15 1.4=0A= +++ Src/Modules/terminfo.c 2001/01/31 10:32:40=0A= @@ -36,7 +36,7 @@=0A= /* echoti: output a terminfo capability */=0A= =0A= /**/=0A= -int=0A= +static int=0A= bin_echoti(char *name, char **argv, char *ops, int func)=0A= {=0A= char *s, *t;=0A= Index: Src/Modules/terminfo.mdd=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/Modules/terminfo.mdd,v=0A= retrieving revision 1.3=0A= diff -u -r1.3 terminfo.mdd=0A= --- Src/Modules/terminfo.mdd 2000/12/05 11:00:09 1.3=0A= +++ Src/Modules/terminfo.mdd 2001/01/31 10:32:40=0A= @@ -1,5 +1,15 @@=0A= name=3Dzsh/terminfo=0A= -link=3D'if test "x$ac_cv_func_tigetstr" =3D xyes; then echo either; = else echo no; fi'=0A= +=0A= +link=3D'if test "x$ac_cv_func_tigetstr" =3D xyes; then=0A= + if test "x$zsh_cv_shared_tigetstr" =3D xyes; then=0A= + echo either=0A= + else=0A= + echo static=0A= + fi=0A= + else=0A= + echo no;=0A= + fi=0A= +'=0A= load=3Dyes=0A= =0A= autobins=3D"echoti"=0A= ------=_NextPart_000_0021_01C08B8A.F78B40A0--