bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Opening a can of worms: a readline gnulib module?


From: Bruno Haible
Subject: Re: Opening a can of worms: a readline gnulib module?
Date: Fri, 12 Aug 2005 13:42:41 +0200
User-agent: KMail/1.5

Simon Josefsson wrote:
> I installed the patch below.  It builds on the same platforms, but now
> finds the readline library properly on Fedora too.
> ...
> checking for readline... yes
> checking how to link with libreadline... -lreadline -ltermcap

This is a problem because libtermcap is unsecure by design. (It has APIs
where the caller must allocate a buffer and doesn't tell the callee how
large the buffer is.) Therefore libncurses is to be preferred over
libtermcap. If you leave the macro as is, it will lead to rpms of some
packages that force users to install the termcap rpm.

I installed this patch.

Bruno

2005-08-12  Bruno Haible  <address@hidden>

        * readline.m4 (gl_FUNC_READLINE): Look for ncurses first.

*** readline.m4 12 Aug 2005 08:03:21 -0000      1.3
--- readline.m4 12 Aug 2005 11:39:00 -0000
***************
*** 1,4 ****
! # readline.m4 serial 2
  dnl Copyright (C) 2005 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # readline.m4 serial 3
  dnl Copyright (C) 2005 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 29,35 ****
    AC_CACHE_CHECK(for readline, gl_cv_lib_readline, [
      gl_cv_lib_readline=no
      am_save_LIBS="$LIBS"
!     for extra_lib in "" termcap curses ncurses; do
        LIBS="$am_save_LIBS $LIBREADLINE"
        if test -n "$extra_lib"; then
          LIBS="$LIBS -l$extra_lib"
--- 29,40 ----
    AC_CACHE_CHECK(for readline, gl_cv_lib_readline, [
      gl_cv_lib_readline=no
      am_save_LIBS="$LIBS"
!     dnl On some systems, -lreadline doesn't link without an additional
!     dnl -lncurses or -ltermcap.
!     dnl Try -lncurses before -ltermcap, because libtermcap is unsecure
!     dnl by design and obsolete since 1994. Try -lcurses last, because
!     dnl libcurses is unusable on some old Unices.
!     for extra_lib in "" ncurses termcap curses; do
        LIBS="$am_save_LIBS $LIBREADLINE"
        if test -n "$extra_lib"; then
          LIBS="$LIBS -l$extra_lib"





reply via email to

[Prev in Thread] Current Thread [Next in Thread]