From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3) with ESMTP id DAA13422 for ; Tue, 30 Apr 1996 03:39:24 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id NAA15993; Mon, 29 Apr 1996 13:28:57 -0400 (EDT) Resent-Date: Mon, 29 Apr 1996 13:28:57 -0400 (EDT) Date: Mon, 29 Apr 1996 19:28:32 +0200 (MET DST) From: Janos Farkas To: zsh-workers@math.gatech.edu Subject: zsh-2.6-beta15, AC_CHECK_LIB for termcap/curses/ncurses In-Reply-To: Message-ID: X-Mood: in love MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Resent-Message-ID: <"D67Rh2.0.mv3.PnFXn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/972 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Hi! I still had some problems compiling the latesh zsh, not just that nameddirtab caused problems.. :) While searching for termcap/curses/ncurses, configure.in uses the following code: AC_CHECK_LIB($lib, tgetent.... For mysterious reasons, AC_CHECK_LIB does not correctly support shell variables in the LIBRARY parameter (Report sent to the appropriate autoconf maintainers.) $lib is used unquoted by autoconf, and is used in expressions like: $lib_tgetent which is clearly wrong, as it is another variable. If it doesn't find termcap (which is not a common case, but is true for at least my linux box), it continues to search for curses, but it uses a bogus cache variable, initialized by a similar value than above, and thus it doesn't find any curses library at all. For now, a simple workaround is to use AC_CHECK_LIB(${lib}, tgetent... instead of AC_CHECK_LIB($lib, tgetent... (patch follows), which should work even if autoconf is fixed to quote/escape shell variables more `correctly'. I was not really sure, if this is a really portable solution, but Zoli assured me that it's portable, although it's not clear from the `configure.in' file, that the variable need to be used this way. Janos [PS. The patch is for beta 14, but applies without a hitch to beta15 too.] diff -c2rN zsh-2.6-beta14.orig/configure zsh-2.6-beta14/configure *** zsh-2.6-beta14.orig/configure Mon Apr 15 07:33:08 1996 --- zsh-2.6-beta14/configure Fri Apr 26 03:56:31 1996 *************** *** 1811,1821 **** for lib in termcap curses ncurses; do ! echo $ac_n "checking for -l$lib""... $ac_c" 1>&6 ! ac_lib_var=`echo $lib_tgetent | tr '.-/+' '___p'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" ! LIBS="-l$lib $LIBS" cat > conftest.$ac_ext <&6 ! ac_lib_var=`echo ${lib}_tgetent | tr '.-/+' '___p'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" ! LIBS="-l${lib} $LIBS" cat > conftest.$ac_ext <