Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

zsh-2.6-beta15, AC_CHECK_LIB for termcap/curses/ncurses



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 <<EOF
  #line 1822 "configure"
--- 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 <<EOF
  #line 1822 "configure"
diff -c2rN zsh-2.6-beta14.orig/configure.in zsh-2.6-beta14/configure.in
*** zsh-2.6-beta14.orig/configure.in	Mon Apr 15 07:32:58 1996
--- zsh-2.6-beta14/configure.in	Fri Apr 26 03:56:21 1996
***************
*** 220,224 ****
  dnl Prefer BSD termcap library to SysV curses library.
  for lib in termcap curses ncurses; do
!   AC_CHECK_LIB($lib, tgetent, [LIBS="$LIBS -l$lib"; break])
  done
  
--- 220,224 ----
  dnl Prefer BSD termcap library to SysV curses library.
  for lib in termcap curses ncurses; do
!   AC_CHECK_LIB(${lib}, tgetent, [LIBS="$LIBS -l$lib"; break])
  done
  






Messages sorted by: Reverse Date, Date, Thread, Author