Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit fdb37f0

Browse files
committed
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
1 parent 34fec16 commit fdb37f0

File tree

5 files changed

+151
-141
lines changed

5 files changed

+151
-141
lines changed

src/bin/psql/Makefile.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.6 1998/01/04 19:12:21 scrappy Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/psql/Attic/Makefile.in,v 1.7 1998/04/05 21:29:35 momjian Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

1414
SRCDIR= ../..
1515
include ../../Makefile.global
1616

17-
CFLAGS+= -I$(LIBPQDIR)
17+
CFLAGS:= -I$(LIBPQDIR) $(CFLAGS)
1818

1919
#
2020
# And where libpq goes, so goes the authentication stuff...

src/bin/psql/psql.c

+12-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.137 1998/03/16 14:27:38 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.138 1998/04/05 21:29:36 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -38,13 +38,19 @@
3838
#ifdef HAVE_LIBREADLINE
3939
#ifdef HAVE_READLINE_H
4040
#include <readline.h>
41+
#define USE_READLINE 1
4142
#if defined(HAVE_HISTORY)
4243
#include <history.h>
44+
#define USE_HISTORY 1
4345
#endif
4446
#else
47+
#if defined(HAVE_READLINE_READLINE_H)
4548
#include <readline/readline.h>
49+
#define USE_READLINE 1
4650
#if defined(HAVE_READLINE_HISTORY_H)
4751
#include <readline/history.h>
52+
#define USE_HISTORY 1
53+
#endif
4854
#endif
4955
#endif
5056
#endif
@@ -931,7 +937,7 @@ gets_readline(char *prompt, FILE *source)
931937
{
932938
char *s;
933939

934-
#ifdef HAVE_LIBREADLINE
940+
#ifdef USE_READLINE
935941
s = readline(prompt);
936942
#else
937943
char buf[500];
@@ -2013,7 +2019,7 @@ HandleSlashCmds(PsqlSettings *pset,
20132019
case 's': /* \s is save history to a file */
20142020
if (!optarg)
20152021
optarg = "/dev/tty";
2016-
#ifdef HAVE_HISTORY
2022+
#ifdef USE_HISTORY
20172023
if (write_history(optarg) != 0)
20182024
fprintf(stderr, "cannot write history to %s\n", optarg);
20192025
#endif
@@ -2137,7 +2143,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
21372143
sprintf(pset->prompt, "%s%s", PQdb(pset->db), PROMPT);
21382144
if (pset->useReadline)
21392145
{
2140-
#ifdef HAVE_HISTORY
2146+
#ifdef USE_HISTORY
21412147
using_history();
21422148
#endif
21432149
GetNextLine = gets_readline;
@@ -2187,7 +2193,7 @@ MainLoop(PsqlSettings *pset, char *query, FILE *source)
21872193
pset->prompt[strlen(pset->prompt) - 3] = PROMPT_READY;
21882194
}
21892195
line = GetNextLine(pset->prompt, source);
2190-
#ifdef HAVE_HISTORY
2196+
#ifdef USE_HISTORY
21912197
if (interactive && pset->useReadline && line != NULL)
21922198
add_history(line); /* save non-empty lines in history */
21932199
#endif
@@ -2454,7 +2460,7 @@ main(int argc, char **argv)
24542460
settings.opt.pager = 1;
24552461
if (!isatty(0) || !isatty(1))
24562462
settings.notty = 1;
2457-
#ifdef HAVE_LIBREADLINE
2463+
#ifdef USE_READLINE
24582464
else
24592465
settings.useReadline = 1;
24602466
#endif

0 commit comments

Comments
 (0)