Commit aa46d53f authored by Marc G. Fournier's avatar Marc G. Fournier

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
parent 374b2b06
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
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
# #
# #
# IDENTIFICATION # 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,14 +19,13 @@ INCLUDE_OPT:= \ ...@@ -19,14 +19,13 @@ INCLUDE_OPT:= \
-I../../include -I../../include
CFLAGS+= $(INCLUDE_OPT) CFLAGS+= $(INCLUDE_OPT)
#
#USE_READLINE is set in Makefile.global #USE_READLINE is set in Makefile.global
# #
ifeq ($(USE_READLINE), true) 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) ifeq ($(PORTNAME), ultrix4)
LD_ADD+= -ltermcap LD_ADD+= -ltermcap
...@@ -51,14 +50,9 @@ ifeq ($(USE_READLINE), true) ...@@ -51,14 +50,9 @@ ifeq ($(USE_READLINE), true)
endif endif
endif endif
endif endif
OBJS= psql.o stringutils.o
else else
CFLAGS+= -DNOREADLINE OBJS= psql.o stringutils.o rlstubs.o
endif
OBJS= psql.o stringutils.o
ifneq ($(USE_READLINE), true)
OBJS+= rlstubs.o
endif endif
ifeq ($(PORTNAME), ultrix4) ifeq ($(PORTNAME), ultrix4)
......
#-------------------------------------------------------------------------
#
# 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
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 @@ ...@@ -35,12 +35,12 @@
#else #else
# ifdef HAVE_READLINE_H # ifdef HAVE_READLINE_H
# include <readline.h> # include <readline.h>
# ifndef NO_HISTORY # if defined(HAVE_HISTORY) || defined(HAVE_LIBHISTORY)
# include <history.h> # include <history.h>
# endif # endif
# else # else
# include <readline/readline.h> # include <readline/readline.h>
# ifndef NO_HISTORY # if defined(HAVE_HISTORY) || defined(HAVE_LIBHISTORY)
# include <readline/history.h> # include <readline/history.h>
# endif # endif
# endif # endif
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * 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 @@ ...@@ -15,11 +15,6 @@
#include "rlstubs.h" #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 * char *
readline(const char *prompt) readline(const char *prompt)
{ {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
/* Define to enable readline/history support in psql */ /* 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 /* These two defines are not used until HAVE_LIBREADLINE
* are also defined * are also defined
...@@ -20,19 +21,8 @@ ...@@ -20,19 +21,8 @@
/* Define one for either <history.h> or <readline/history.h> /* Define one for either <history.h> or <readline/history.h>
*/ */
/* #undef HAVE_HISTORY_H */ /* #undef HAVE_HISTORY */
/* #undef HAVE_READLINE_HISTORY_H */
/* 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_SYS_SELECT_H
#define HAVE_TERMIOS_H #define HAVE_TERMIOS_H
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment