fix readline detection

This commit is contained in:
brianb 2004-06-20 14:36:23 +00:00
parent ba6f5b30cc
commit 642a74c8c3
4 changed files with 81 additions and 5952 deletions

View File

@ -1,3 +1,8 @@
Sun Jun 20 09:37:58 EDT 2004 Brian Bruns <brian@bruns.com.
* configure.in:
* acinclude.m4: use READLINE macro from Ville Laurikari. Remove full macroset to work around broken BSD autoconf.
* src/util/mdb-sql.c: add stubs for read_history/write_history if no readline. update to use new readline defines.
Fri Jun 18 00:08:24 CDT 2004 Jeff Smith <whydoubt@yahoo.com>
* HACKING:
* src/libmdb/index.c:

File diff suppressed because it is too large Load Diff

View File

@ -156,20 +156,12 @@ dnl Checks for library functions.
OLDLDFLAGS=$LDFLAGS
AC_CHECK_LIB(ncurses,initscr,[
READLINE_LIBS="$READLINE_LIBS -lncurses"
LDFLAGS="$LDFLAGS -lncurses"
],[])
AC_CHECK_LIB(readline, add_history, [
READLINE_LIBS="$READLINE_LIBS -lreadline"
AC_DEFINE(HAVE_READLINE,1,[ ])
],[])
VL_LIB_READLINE
READLINE_LIBS=$vl_cv_lib_readline
AC_SUBST(READLINE_LIBS)
LDFLAGS=$OLDLDFLAGS
AC_SUBST(READLINE_LIBS)
localedir=${datadir}/locale
AC_SUBST(localedir)

View File

@ -19,9 +19,33 @@
#include <config.h>
#include <stdio.h>
#ifdef HAVE_READLINE
#include <readline/readline.h>
#endif
#ifdef HAVE_LIBREADLINE
# if defined(HAVE_READLINE_READLINE_H)
# include <readline/readline.h>
# elif defined(HAVE_READLINE_H)
# include <readline.h>
# else /* !defined(HAVE_READLINE_H) */
extern char *readline ();
# endif /* !defined(HAVE_READLINE_H) */
char *cmdline = NULL;
#else /* !defined(HAVE_READLINE_READLINE_H) */
/* no readline */
#endif /* HAVE_LIBREADLINE */
#ifdef HAVE_READLINE_HISTORY
# if defined(HAVE_READLINE_HISTORY_H)
# include <readline/history.h>
# elif defined(HAVE_HISTORY_H)
# include <history.h>
# else /* !defined(HAVE_HISTORY_H) */
extern void add_history ();
extern int write_history ();
extern int read_history ();
# endif /* defined(HAVE_READLINE_HISTORY_H) */
/* no history */
#endif /* HAVE_READLINE_HISTORY */
#include <string.h>
#include "mdbsql.h"
@ -44,7 +68,7 @@ int noexec = 0;
#define HISTFILE ".mdbhistory"
#ifndef HAVE_READLINE
#ifndef HAVE_LIBREADLINE
char *readline(char *prompt)
{
char *buf, line[1000];
@ -68,6 +92,13 @@ int i = 0;
void add_history(char *s)
{
}
void read_history(char *s)
{
}
void write_history(char *s)
{
}
#endif
int parse(MdbSQL *sql, char *buf)