From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1528 invoked from network); 30 Apr 2001 17:16:44 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Apr 2001 17:16:44 -0000 Received: (qmail 6618 invoked by alias); 30 Apr 2001 17:16:39 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 14169 Received: (qmail 6604 invoked from network); 30 Apr 2001 17:16:38 -0000 From: "Bart Schaefer" Message-Id: <1010430171605.ZM9038@candle.brasslantern.com> Date: Mon, 30 Apr 2001 17:16:05 +0000 In-Reply-To: Comments: In reply to Andrej Borsenkow "Re: comptest* failed to load module: zsh/termcap" (Apr 30, 8:47pm) References: X-Mailer: Z-Mail (5.0.0 30July97) To: Subject: PATCH: Re: comptest* failed to load module: zsh/termcap Cc: Peter Whaite MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Apr 30, 8:47pm, Andrej Borsenkow wrote: } Subject: Re: comptest* failed to load module: zsh/termcap } } On Mon, 30 Apr 2001, Bart Schaefer wrote: } } > Modules/termcap.o: In function `scantermcap': } > Modules/termcap.o(.text+0x450): undefined reference to `boolcodes' } > } > So the problem is that configure.in is still missing the AC_SEARCH_LIBS } > call to find the ncurses libraries (it does one only for tgetent, which } > finds old termcap first). } } But it should not find the above variables then and should not try use } them (or use local static placeholders). So, the question is - why } configure sets HAVE_BOOLCODES and others at all? I believe, we finally } cleaned this up ... are you sure you are using the lates CVS? Yes, I did a "cvs up -d -P" immediately before buiding. Checking config.log, it turns out that even without -lcurses in the link, AC_TRY_LINK is succeeding for boolcodes et al. -- possibly gcc is doing an optimization and throwing out the `test' variable because it's not used, and therefore not actually trying to find boolcodes at link time: configure:3112: checking if boolcodes is available configure:3124: gcc -o conftest -Wall -Wno-implicit -Wmissing-prototypes -O2 -D _LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 conftest.c -ltermcap -lm -lc 1>&5 configure: In function `main': configure:3120: warning: initialization discards qualifiers from pointer target type configure:3120: warning: unused variable `test' The compilation then succeeds and goes on to the next thing. On my RH5.2 system at home, there's a link failure at this point. Sure enough, if I change configure.in to: #include ], [char **test = boolcodes; printf(*test);], (so that `test' is used), then AC_TRY_LINK fails and all is well. We've been bitten by an overoptimizing compiler. Index: configure.in =================================================================== --- configure.in 2001/04/27 05:21:54 1.4 +++ configure.in 2001/04/30 17:13:21 @@ -533,36 +533,36 @@ AC_TRY_LINK([#ifdef TERM_H_NEEDS_CURSES_H #include #endif -#include ], [char **test = boolcodes;], +#include ], [char **test = boolcodes; printf(*test);], AC_DEFINE(HAVE_BOOLCODES) boolcodes=yes, boolcodes=no) AC_MSG_RESULT($boolcodes) AC_MSG_CHECKING(if numcodes is available) AC_TRY_LINK([#ifdef TERM_H_NEEDS_CURSES_H #include #endif -#include ], [char **test = numcodes;], +#include ], [char **test = numcodes; printf(*test);], AC_DEFINE(HAVE_NUMCODES) numcodes=yes, numcodes=no) AC_MSG_RESULT($numcodes) AC_MSG_CHECKING(if strcodes is available) AC_TRY_LINK([#ifdef TERM_H_NEEDS_CURSES_H #include #endif -#include ], [char **test = strcodes;], +#include ], [char **test = strcodes; printf(*test);], AC_DEFINE(HAVE_STRCODES) strcodes=yes, strcodes=no) AC_MSG_RESULT($strcodes) AC_MSG_CHECKING(if boolnames is available) AC_TRY_LINK([#include -#include ], [char **test = boolnames;], +#include ], [char **test = boolnames; printf(*test);], AC_DEFINE(HAVE_BOOLNAMES) boolnames=yes, boolnames=no) AC_MSG_RESULT($boolnames) AC_MSG_CHECKING(if numnames is available) AC_TRY_LINK([#include -#include ], [char **test = numnames;], +#include ], [char **test = numnames; printf(*test);], AC_DEFINE(HAVE_NUMNAMES) numnames=yes, numnames=no) AC_MSG_RESULT($numnames) AC_MSG_CHECKING(if strnames is available) AC_TRY_LINK([#include -#include ], [char **test = strnames;], +#include ], [char **test = strnames; printf(*test);], AC_DEFINE(HAVE_STRNAMES) strnames=yes, strnames=no) AC_MSG_RESULT($strnames) -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net