OSDN Git Service

Okay, this should pretty much clean up the psql/readline/history mess.
authorMarc G. Fournier <scrappy@hub.org>
Sat, 25 Jan 1997 22:52:08 +0000 (22:52 +0000)
committerMarc G. Fournier <scrappy@hub.org>
Sat, 25 Jan 1997 22:52:08 +0000 (22:52 +0000)
Added a README.readline file until configure is integrated to *try* and
explain the way things stand.

Removed a stray configure .in file

src/README.readline [new file with mode: 0644]
src/bin/psql/Makefile
src/bin/psql/Makefile.in [deleted file]
src/bin/psql/psql.c
src/bin/psql/rlstubs.c
src/include/config.h

diff --git a/src/README.readline b/src/README.readline
new file mode 100644 (file)
index 0000000..9cacd37
--- /dev/null
@@ -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
index 8b13ae4..c0fc92e 100644 (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
-   else
-   ifeq ($(PORTNAME), sparc)
-   LD_ADD+= -ltermcap
+    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)
diff --git a/src/bin/psql/Makefile.in b/src/bin/psql/Makefile.in
deleted file mode 100644 (file)
index 57f4b89..0000000
+++ /dev/null
@@ -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
-
-
-
index 8df0998..0c6e19e 100644 (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 $
  *
  *-------------------------------------------------------------------------
  */
 #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
index 788757c..64c11db 100644 (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 $
  *
  *-------------------------------------------------------------------------
  */
 
 #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)
 {
index f34189e..4fbeb1f 100644 (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
 
 /* 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