Okay, this should pretty much clean up the psql/readline/history mess.

Added a README.readline file until configure is integrated to *try* and
explain the way things stand.

Removed a stray configure .in file
This commit is contained in:
Marc G. Fournier 1997-01-25 22:52:08 +00:00
parent 374b2b0639
commit aa46d53fa4
6 changed files with 71 additions and 114 deletions

38
src/README.readline Normal file
View File

@ -0,0 +1,38 @@
In preparation for using configure to compile PostgreSQL, various
define cleanups have been performed.
The most confusing has been psql's use of -lreadline
In order to turn on support for readline, your Makefile.custom file
*must* contain lines similar to:
USE_READLINE= yes
READLINE_INC=
READLINE_LIB=
READLINE_INC can contain:
-DHAVE_LIBREADLINE
not optional if USE_READLINE enabled
-DHAVE_READLINE_H
if <readline.h>, define this
-DHAVE_HISTORY
if you have either <history.h> or <readline/history.h>
-DHAVE_LIBHISTORY
if you have a libhistory.a
READLINE_LIB can contain:
-lreadline
not optional if USE_READLINE enabled
-lhistory
if you have a libhistory.a
Once support for configure is integrated into the distribution, this will
all be hidden "behind the scenes"
Marc G. Fournier
scrappy@hub.org

View File

@ -7,7 +7,7 @@
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.17 1996/12/30 23:19:48 bryanh Exp $
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.18 1997/01/25 22:51:26 scrappy Exp $
#
#-------------------------------------------------------------------------
@ -19,46 +19,40 @@ INCLUDE_OPT:= \
-I../../include
CFLAGS+= $(INCLUDE_OPT)
#
#USE_READLINE is set in Makefile.global
#
ifeq ($(USE_READLINE), true)
CFLAGS+= $(READLINE_INC) $(HISTORY_INC)
CFLAGS+= $(READLINE_INC)
LD_ADD+= $(READLINE_LIB) $(HISTORY_LIB) $(CURSES_LIB)
LD_ADD+= $(READLINE_LIB) $(CURSES_LIB)
ifeq ($(PORTNAME), ultrix4)
LD_ADD+= -ltermcap
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), sparc)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), linux)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), next)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), bsdi)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), BSD44_derived)
LD_ADD+= -ltermcap
endif
endif
endif
endif
endif
ifeq ($(PORTNAME), sparc)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), linux)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), next)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), bsdi)
LD_ADD+= -ltermcap
else
ifeq ($(PORTNAME), BSD44_derived)
LD_ADD+= -ltermcap
endif
endif
endif
endif
endif
endif
OBJS= psql.o stringutils.o
else
CFLAGS+= -DNOREADLINE
endif
OBJS= psql.o stringutils.o
ifneq ($(USE_READLINE), true)
OBJS+= rlstubs.o
OBJS= psql.o stringutils.o rlstubs.o
endif
ifeq ($(PORTNAME), ultrix4)

View File

@ -1,60 +0,0 @@
#-------------------------------------------------------------------------
#
# Makefile.inc--
# Makefile for bin/psql
#
# Copyright (c) 1994, Regents of the University of California
#
#
# IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.1 1997/01/24 02:35:27 scrappy Exp $
#
#-------------------------------------------------------------------------
SRCDIR= ../..
include ../../Makefile.global
INCLUDE_OPT:= -I$(LIBPQDIR) \
-I../../include
CFLAGS+= $(INCLUDE_OPT)
LD_ADD+= @READLINE_LIB@ @HISTORY_LIB@ @CURSES_LIB@ @TERMCAP_LIB@
OBJS= psql.o stringutils.o
ifneq ($(USE_READLINE), true)
OBJS+= rlstubs.o
endif
ifeq ($(PORTNAME), ultrix4)
OBJS+= ../../utils/strdup.o
endif
all: submake psql
psql: $(OBJS) $(LIBPQDIR)/libpq.a
$(CC) $(LDFLAGS) -o psql -L$(LIBPQDIR) $(OBJS) -lpq $(LD_ADD)
../../utils/strdup.o:
$(MAKE) -C ../../utils strdup.o
.PHONY: submake
submake:
$(MAKE) -C $(LIBPQDIR) libpq.a
install: psql
$(INSTALL) $(INSTL_EXE_OPTS) psql $(DESTDIR)$(BINDIR)/psql
depend dep:
$(CC) -MM $(INCLUDE_OPT) *.c >depend
clean:
rm -f psql $(OBJS)
ifeq (depend,$(wildcard depend))
include depend
endif

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.52 1997/01/25 22:16:36 scrappy Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.53 1997/01/25 22:51:56 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -35,12 +35,12 @@
#else
# ifdef HAVE_READLINE_H
# include <readline.h>
# ifndef NO_HISTORY
# if defined(HAVE_HISTORY) || defined(HAVE_LIBHISTORY)
# include <history.h>
# endif
# else
# include <readline/readline.h>
# ifndef NO_HISTORY
# if defined(HAVE_HISTORY) || defined(HAVE_LIBHISTORY)
# include <readline/history.h>
# endif
# endif

View File

@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/rlstubs.c,v 1.5 1996/11/11 14:55:47 scrappy Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/rlstubs.c,v 1.6 1997/01/25 22:52:08 scrappy Exp $
*
*-------------------------------------------------------------------------
*/
@ -15,11 +15,6 @@
#include "rlstubs.h"
extern char *readline(const char *);
extern int write_history(const char *);
extern int using_history(void);
extern int add_history(const char *);
char *
readline(const char *prompt)
{

View File

@ -9,7 +9,8 @@
#define BLCKSZ 8192
/* Define to enable readline/history support in psql */
/* #undef HAVE_LIBREADLINE */
/* #undef HAVE_LIBREADLINE */
/* #undef HAVE_LIBHISTORY */
/* These two defines are not used until HAVE_LIBREADLINE
* are also defined
@ -20,19 +21,8 @@
/* Define one for either <history.h> or <readline/history.h>
*/
/* #undef HAVE_HISTORY_H */
/* #undef HAVE_READLINE_HISTORY_H */
/* #undef HAVE_HISTORY */
/* this is meant to handle the condition where the system has readline
* capabilities, but no history. Unfortunately, it isn't as simple as
* testing for the existance of -lhistory, since newer -lreadline seems to
* include the -lhistory library, but newer readline.h doesn't
*/
#if defined(HAVE_LIBREADLINE)
# if !defined(HAVE_HISTORY_H) || !defined(HAVE_READLINE_HISTORY_H)
# define NO_HISTORY_H
# endif
#endif
#define HAVE_SYS_SELECT_H
#define HAVE_TERMIOS_H