mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-04-05 20:31:00 +08:00
fix readline detection
This commit is contained in:
parent
ba6f5b30cc
commit
642a74c8c3
@ -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>
|
Fri Jun 18 00:08:24 CDT 2004 Jeff Smith <whydoubt@yahoo.com>
|
||||||
* HACKING:
|
* HACKING:
|
||||||
* src/libmdb/index.c:
|
* src/libmdb/index.c:
|
||||||
|
5975
acinclude.m4
5975
acinclude.m4
File diff suppressed because it is too large
Load Diff
14
configure.in
14
configure.in
@ -156,20 +156,12 @@ dnl Checks for library functions.
|
|||||||
|
|
||||||
OLDLDFLAGS=$LDFLAGS
|
OLDLDFLAGS=$LDFLAGS
|
||||||
|
|
||||||
AC_CHECK_LIB(ncurses,initscr,[
|
VL_LIB_READLINE
|
||||||
READLINE_LIBS="$READLINE_LIBS -lncurses"
|
READLINE_LIBS=$vl_cv_lib_readline
|
||||||
LDFLAGS="$LDFLAGS -lncurses"
|
AC_SUBST(READLINE_LIBS)
|
||||||
],[])
|
|
||||||
|
|
||||||
AC_CHECK_LIB(readline, add_history, [
|
|
||||||
READLINE_LIBS="$READLINE_LIBS -lreadline"
|
|
||||||
AC_DEFINE(HAVE_READLINE,1,[ ])
|
|
||||||
],[])
|
|
||||||
|
|
||||||
LDFLAGS=$OLDLDFLAGS
|
LDFLAGS=$OLDLDFLAGS
|
||||||
|
|
||||||
AC_SUBST(READLINE_LIBS)
|
|
||||||
|
|
||||||
localedir=${datadir}/locale
|
localedir=${datadir}/locale
|
||||||
AC_SUBST(localedir)
|
AC_SUBST(localedir)
|
||||||
|
|
||||||
|
@ -19,9 +19,33 @@
|
|||||||
#include <config.h>
|
#include <config.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#ifdef HAVE_READLINE
|
|
||||||
#include <readline/readline.h>
|
#ifdef HAVE_LIBREADLINE
|
||||||
#endif
|
# 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 <string.h>
|
||||||
#include "mdbsql.h"
|
#include "mdbsql.h"
|
||||||
|
|
||||||
@ -44,7 +68,7 @@ int noexec = 0;
|
|||||||
|
|
||||||
#define HISTFILE ".mdbhistory"
|
#define HISTFILE ".mdbhistory"
|
||||||
|
|
||||||
#ifndef HAVE_READLINE
|
#ifndef HAVE_LIBREADLINE
|
||||||
char *readline(char *prompt)
|
char *readline(char *prompt)
|
||||||
{
|
{
|
||||||
char *buf, line[1000];
|
char *buf, line[1000];
|
||||||
@ -68,6 +92,13 @@ int i = 0;
|
|||||||
void add_history(char *s)
|
void add_history(char *s)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
void read_history(char *s)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
void write_history(char *s)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int parse(MdbSQL *sql, char *buf)
|
int parse(MdbSQL *sql, char *buf)
|
||||||
|
Loading…
Reference in New Issue
Block a user