Commit fdb37f07 authored by Bruce Momjian's avatar Bruce Momjian

this patch solve 2 problemes :

probleme number 1 :

- configure can find the library readline , but don't
  find the header file . so in this case we don't use lib readline
  .

probleme number 2 :

- when you have postgres 6.2.1 and readline installed
  with the same prefix( and generally all your software ) .  you
  can compile the version 6.3 .  I use this prefix , when configure
  ask me for "Additional directories to search for include files"
  .

  ( because there a conflict in the header when you
    compile psql.c ) In this case, you must permut the sequence of
  directive -I .

Erwan MAS
parent 34fec161
...@@ -7,14 +7,14 @@ ...@@ -7,14 +7,14 @@
# #
# #
# IDENTIFICATION # IDENTIFICATION
# $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.6 1998/01/04 19:12:21 scrappy Exp $ # $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.7 1998/04/05 21:29:35 momjian Exp $
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
SRCDIR= ../.. SRCDIR= ../..
include ../../Makefile.global include ../../Makefile.global
CFLAGS+= -I$(LIBPQDIR) CFLAGS:= -I$(LIBPQDIR) $(CFLAGS)
# #
# And where libpq goes, so goes the authentication stuff... # And where libpq goes, so goes the authentication stuff...
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.137 1998/03/16 14:27:38 momjian Exp $ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.138 1998/04/05 21:29:36 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -38,13 +38,19 @@ ...@@ -38,13 +38,19 @@
#ifdef HAVE_LIBREADLINE #ifdef HAVE_LIBREADLINE
#ifdef HAVE_READLINE_H #ifdef HAVE_READLINE_H
#include <readline.h> #include <readline.h>
#define USE_READLINE 1
#if defined(HAVE_HISTORY) #if defined(HAVE_HISTORY)
#include <history.h> #include <history.h>
#define USE_HISTORY 1
#endif #endif
#else #else
#if defined(HAVE_READLINE_READLINE_H)
#include <readline/readline.h> #include <readline/readline.h>
#define USE_READLINE 1
#if defined(HAVE_READLINE_HISTORY_H) #if defined(HAVE_READLINE_HISTORY_H)
#include <readline/history.h> #include <readline/history.h>
#define USE_HISTORY 1
#endif
#endif #endif
#endif #endif
#endif #endif
...@@ -931,7 +937,7 @@ gets_readline(char *prompt, FILE *source) ...@@ -931,7 +937,7 @@ gets_readline(char *prompt, FILE *source)
{ {
char *s; char *s;
#ifdef HAVE_LIBREADLINE #ifdef USE_READLINE
s = readline(prompt); s = readline(prompt);
#else #else
char buf[500]; char buf[500];
...@@ -2013,7 +2019,7 @@ HandleSlashCmds(PsqlSettings *pset, ...@@ -2013,7 +2019,7 @@ HandleSlashCmds(PsqlSettings *pset,
case 's': /* \s is save history to a file */ case 's': /* \s is save history to a file */
if (!optarg) if (!optarg)
optarg = "/dev/tty"; optarg = "/dev/tty";
#ifdef HAVE_HISTORY #ifdef USE_HISTORY
if (write_history(optarg) != 0) if (write_history(optarg) != 0)
fprintf(stderr, "cannot write history to %s\n", optarg); fprintf(stderr, "cannot write history to %s\n", optarg);
#endif #endif
...@@ -2137,7 +2143,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) ...@@ -2137,7 +2143,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
sprintf(pset->prompt, "%s%s", PQdb(pset->db), PROMPT); sprintf(pset->prompt, "%s%s", PQdb(pset->db), PROMPT);
if (pset->useReadline) if (pset->useReadline)
{ {
#ifdef HAVE_HISTORY #ifdef USE_HISTORY
using_history(); using_history();
#endif #endif
GetNextLine = gets_readline; GetNextLine = gets_readline;
...@@ -2187,7 +2193,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source) ...@@ -2187,7 +2193,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
pset->prompt[strlen(pset->prompt) - 3] = PROMPT_READY; pset->prompt[strlen(pset->prompt) - 3] = PROMPT_READY;
} }
line = GetNextLine(pset->prompt, source); line = GetNextLine(pset->prompt, source);
#ifdef HAVE_HISTORY #ifdef USE_HISTORY
if (interactive && pset->useReadline && line != NULL) if (interactive && pset->useReadline && line != NULL)
add_history(line); /* save non-empty lines in history */ add_history(line); /* save non-empty lines in history */
#endif #endif
...@@ -2454,7 +2460,7 @@ main(int argc, char **argv) ...@@ -2454,7 +2460,7 @@ main(int argc, char **argv)
settings.opt.pager = 1; settings.opt.pager = 1;
if (!isatty(0) || !isatty(1)) if (!isatty(0) || !isatty(1))
settings.notty = 1; settings.notty = 1;
#ifdef HAVE_LIBREADLINE #ifdef USE_READLINE
else else
settings.useReadline = 1; settings.useReadline = 1;
#endif #endif
......
This diff is collapsed.
...@@ -453,8 +453,8 @@ AC_HEADER_SYS_WAIT ...@@ -453,8 +453,8 @@ AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(limits.h unistd.h termios.h values.h sys/select.h) AC_CHECK_HEADERS(limits.h unistd.h termios.h values.h sys/select.h)
AC_CHECK_HEADERS(sys/resource.h netdb.h arpa/inet.h getopt.h) AC_CHECK_HEADERS(sys/resource.h netdb.h arpa/inet.h getopt.h)
AC_CHECK_HEADERS(readline.h history.h dld.h crypt.h endian.h float.h) AC_CHECK_HEADERS(readline.h history.h dld.h crypt.h endian.h float.h)
AC_CHECK_HEADERS(readline/history.h ieeefp.h fp_class.h netinet/in.h) AC_CHECK_HEADERS(readline/readline.h readline/history.h ieeefp.h fp_class.h)
AC_CHECK_HEADERS(string.h strings.h) AC_CHECK_HEADERS(netinet/in.h string.h strings.h)
dnl Checks for typedefs, structures, and compiler characteristics. dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
......
...@@ -68,6 +68,9 @@ ...@@ -68,6 +68,9 @@
/* Set to 1 if you have <readline/history.h> */ /* Set to 1 if you have <readline/history.h> */
#undef HAVE_READLINE_HISTORY_H #undef HAVE_READLINE_HISTORY_H
/* Set to 1 if you have <readline/readline.h> */
#undef HAVE_READLINE_READLINE_H
/* Set to 1 if you have <dld.h> */ /* Set to 1 if you have <dld.h> */
#undef HAVE_DLD_H #undef HAVE_DLD_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