5.0.3 release candidate 1 - was: Re: [GRASS5] Roadmap: Numbering
Markus Neteler
neteler at itc.it
Tue Aug 26 08:10:20 EDT 2003
On Tue, Aug 26, 2003 at 02:05:55PM +0200, Buchan Milne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Glynn Clements wrote:
> > Markus Neteler wrote:
> >
> >>Concerning the readline support:
> >
> >>When adding -lncurses the test passes. Could be add -lncurses to
> >>the config script (how) for the test?
> >
> >
> > http://grass.itc.it/pipermail/grass5/2003-August/006104.html
> >
>
> The biggest problem is not that you need to specify additional ldflags
> before configure, but that it isn't documented.
>
> Would it not be possible to have
> - --with-readline=(curses|ncurses|termcap|tinfo), and when it is not
> specified, get the dependency information from libreadline?
>
> In either case, the error message should mention that you need (to
> specify) a library to use.
>
[...]
A quick check how the "R" project solves the same problem:
config.log:
configure:11627: checking for rl_callback_read_char in -lreadline
configure:11658: gcc -o conftest -O3 -I/usr/local/include -L/usr/local/lib conftest.c -lreadline -ldl -lncurses -lm >&5
configure:11661: $? = 0
configure:
[...]
## Readline.
if test "${use_readline}" = yes; then
echo "$as_me:$LINENO: checking for rl_callback_read_char in -lreadline" >&5
echo $ECHO_N "checking for rl_callback_read_char in -lreadline... $ECHO_C" >&6
if test "${ac_cv_lib_readline_rl_callback_read_char+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lreadline $LIBS"
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
[...]
This indicates (to me) that $LIBS already contains -lncurses so
that the -lreadline test passes.
The relevant part in configure.ac looks like this:
[...]
## AC_CHECK_LIBM computes LIBM but does not add to LIBS, hence we do
## the following as well.
AC_CHECK_LIB(m, sin)
AC_CHECK_LIB(ncurses, main, [],
AC_CHECK_LIB(termcap, main, [],
AC_CHECK_LIB(termlib, main)))
AC_CHECK_LIB(dl, dlopen)
## Readline.
if test "${use_readline}" = yes; then
AC_CHECK_LIB(readline, rl_callback_read_char)
use_readline="${ac_cv_lib_readline_rl_callback_read_char}"
fi
[...]
Markus
More information about the grass-dev
mailing list