mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Readline and Zlib now required by default. Add options --without-readline
and --without-zlib to turn them off.
This commit is contained in:
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.18 2001/10/25 05:49:54 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.19 2002/04/10 22:46:58 petere Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
#include "input.h"
|
||||
@ -19,8 +19,6 @@
|
||||
/* (of course there is no runtime command for doing that :) */
|
||||
#ifdef USE_READLINE
|
||||
static bool useReadline;
|
||||
#endif
|
||||
#ifdef USE_HISTORY
|
||||
static bool useHistory;
|
||||
#endif
|
||||
|
||||
@ -44,7 +42,7 @@ gets_interactive(char *prompt)
|
||||
{
|
||||
char *s;
|
||||
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
const char *var;
|
||||
static char *prev_hist = NULL;
|
||||
#endif
|
||||
@ -62,7 +60,7 @@ gets_interactive(char *prompt)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
if (useHistory && s && s[0] != '\0')
|
||||
{
|
||||
var = GetVariable(pset.vars, "HISTCONTROL");
|
||||
@ -133,7 +131,7 @@ initializeInput(int flags)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
if (flags == 1)
|
||||
{
|
||||
const char *home;
|
||||
@ -168,7 +166,7 @@ initializeInput(int flags)
|
||||
bool
|
||||
saveHistory(char *fname)
|
||||
{
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
if (useHistory && fname)
|
||||
{
|
||||
if (write_history(fname) != 0)
|
||||
@ -194,7 +192,7 @@ finishInput(void)
|
||||
finishInput(int exitstatus, void *arg)
|
||||
#endif
|
||||
{
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef USE_READLINE
|
||||
if (useHistory)
|
||||
{
|
||||
char *home;
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.15 2001/11/05 17:46:31 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.16 2002/04/10 22:47:03 petere Exp $
|
||||
*/
|
||||
#ifndef INPUT_H
|
||||
#define INPUT_H
|
||||
@ -12,26 +12,20 @@
|
||||
* If some other file needs to have access to readline/history, include this
|
||||
* file and save yourself all this work.
|
||||
*
|
||||
* USE_READLINE and USE_HISTORY are the definite pointers regarding existence or not.
|
||||
* USE_READLINE is the definite pointers regarding existence or not.
|
||||
*/
|
||||
#ifdef HAVE_LIBREADLINE
|
||||
#if defined(HAVE_READLINE_READLINE_H)
|
||||
#include <readline/readline.h>
|
||||
#define USE_READLINE 1
|
||||
#elif defined(HAVE_READLINE_H)
|
||||
#include <readline.h>
|
||||
#define USE_READLINE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_HISTORY_FUNCTIONS)
|
||||
#if defined(HAVE_READLINE_HISTORY_H)
|
||||
#include <readline/history.h>
|
||||
#define USE_HISTORY 1
|
||||
#elif defined(HAVE_HISTORY_H)
|
||||
#include <history.h>
|
||||
#define USE_HISTORY 1
|
||||
#endif
|
||||
# define USE_READLINE 1
|
||||
# if defined(HAVE_READLINE_READLINE_H)
|
||||
# include <readline/readline.h>
|
||||
# elif defined(HAVE_READLINE_H)
|
||||
# include <readline.h>
|
||||
# endif
|
||||
# if defined(HAVE_READLINE_HISTORY_H)
|
||||
# include <readline/history.h>
|
||||
# elif defined(HAVE_HISTORY_H)
|
||||
# include <history.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
char *gets_interactive(char *prompt);
|
||||
|
@ -3,7 +3,7 @@
|
||||
*
|
||||
* Copyright 2000 by PostgreSQL Global Development Group
|
||||
*
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.55 2002/03/27 19:16:13 petere Exp $
|
||||
* $Header: /cvsroot/pgsql/src/bin/psql/startup.c,v 1.56 2002/04/10 22:47:04 petere Exp $
|
||||
*/
|
||||
#include "postgres_fe.h"
|
||||
|
||||
@ -636,7 +636,7 @@ showVersion(void)
|
||||
{
|
||||
puts("psql (PostgreSQL) " PG_VERSION);
|
||||
|
||||
#if defined(USE_READLINE) || defined (USE_HISTORY) || defined(MULTIBYTE)
|
||||
#if defined(USE_READLINE) || defined(MULTIBYTE)
|
||||
fputs(gettext("contains support for: "), stdout);
|
||||
|
||||
#ifdef USE_READLINE
|
||||
@ -644,15 +644,6 @@ showVersion(void)
|
||||
#define _Feature
|
||||
#endif
|
||||
|
||||
#ifdef USE_HISTORY
|
||||
#ifdef _Feature
|
||||
fputs(", ", stdout);
|
||||
#else
|
||||
#define _Feature
|
||||
#endif
|
||||
fputs(gettext("history"), stdout);
|
||||
#endif
|
||||
|
||||
#ifdef MULTIBYTE
|
||||
#ifdef _Feature
|
||||
fputs(", ", stdout);
|
||||
|
@ -8,7 +8,7 @@
|
||||
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
|
||||
* changes will be overwritten the next time you run configure.
|
||||
*
|
||||
* $Id: pg_config.h.in,v 1.20 2002/04/03 05:39:33 petere Exp $
|
||||
* $Id: pg_config.h.in,v 1.21 2002/04/10 22:47:09 petere Exp $
|
||||
*/
|
||||
|
||||
#ifndef PG_CONFIG_H
|
||||
@ -420,9 +420,6 @@
|
||||
/* Define if you have the stricmp function. */
|
||||
#undef HAVE_STRICMP
|
||||
|
||||
/* Set to 1 if you have history functions (either in libhistory or libreadline) */
|
||||
#undef HAVE_HISTORY_FUNCTIONS
|
||||
|
||||
/* Set to 1 if you have <pwd.h> */
|
||||
#undef HAVE_PWD_H
|
||||
|
||||
@ -590,9 +587,6 @@ extern int fdatasync(int fildes);
|
||||
/* Set to 1 if you have libreadline.a */
|
||||
#undef HAVE_LIBREADLINE
|
||||
|
||||
/* Set to 1 if you have libhistory.a */
|
||||
#undef HAVE_LIBHISTORY
|
||||
|
||||
/* Set to 1 if your libreadline defines rl_completion_append_character */
|
||||
#undef HAVE_RL_COMPLETION_APPEND_CHARACTER
|
||||
|
||||
|
Reference in New Issue
Block a user