$NetBSD: patch-ad,v 1.4 2004/03/08 21:13:55 seb Exp $ --- configure.in.orig 2000-01-02 04:05:50.000000000 +0000 +++ configure.in @@ -41,28 +41,30 @@ fi AC_SUBST(LOCAL_CC) AC_CHECK_LIB(m, sin) -AC_CHECK_LIB(gmp, mpf_get_str, - LIBS="-lgmp $LIBS" GMP_SUBDIRS= GMP_LIBS=, - GMP_SUBDIRS=gmp GMP_LIBS='$(GMP_LIBS)') +LIBS="-lgmp $LIBS";GMP_SUBDIRS=;GMP_LIBS= AC_SUBST(GMP_SUBDIRS) AC_SUBST(GMP_LIBS) -AC_CHECK_LIB(ncurses, tgetent, LIBS="-lncurses $LIBS" termcap=yes, - AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes, - termcap=no)) +AC_CHECK_LIB(termcap, tgetent, LIBS="-ltermcap $LIBS" termcap=yes, + termcap=no) if test "$termcap" = yes; then AC_CHECK_HEADERS(termcap.h) AC_DEFINE(HAVE_LIBTERMCAP) fi -AC_CHECK_LIB(readline, readline) -if test "$ac_cv_lib_readline_readline" = yes; then - AC_CHECK_HEADERS(readline/readline.h) - AC_CHECK_LIB(readline, add_history, history=yes, +AC_CHECK_LIB(edit, readline, readlinelib=edit have_readline=yes, + AC_CHECK_LIB(readline, readline, readlinelib=readline have_readline=yes, + readline=no)) +if test "$have_readline" = yes; then + LIBS="-l$readlinelib $LIBS" + AC_CHECK_HEADERS(readline.h readline/readline.h) + AC_DEFINE(HAVE_LIBREADLINE) + AC_CHECK_LIB($readlinelib, tilde_expand, AC_DEFINE(HAVE_TILDE_EXPAND)) + AC_CHECK_LIB($readlinelib, add_history, history=yes, AC_CHECK_LIB(history, add_history, LIBS="-lhistory" history=yes, history=no)) if test "$history" = yes; then - AC_CHECK_HEADERS(readline/history.h) + AC_CHECK_HEADERS(history.h readline/history.h) AC_DEFINE(HAVE_LIBHISTORY) fi fi @@ -201,7 +203,7 @@ AC_PROG_LN_S dnl This must be after other tests so warnings don't provoke errors above. if test "$ac_cv_prog_gcc" = yes; then - CFLAGS="-g -Wall -W -Wno-uninitialized -Wwrite-strings \ + CFLAGS="$CFLAGS -g -Wall -W -Wno-uninitialized -Wwrite-strings \ -Wstrict-prototypes -Wpointer-arith" if test "$CC_OPTIONS" != ""; then CFLAGS="$CFLAGS $CC_OPTIONS"