Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaa46d53

Browse files
committed
Okay, this should pretty much clean up the psql/readline/history mess.
Added a README.readline file until configure is integrated to *try* andexplain the way things stand.Removed a stray configure .in file
1 parent374b2b0 commitaa46d53

File tree

6 files changed

+71
-114
lines changed

6 files changed

+71
-114
lines changed

‎src/README.readline

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
In preparation for using configure to compile PostgreSQL, various
3+
define cleanups have been performed.
4+
5+
The most confusing has been psql's use of -lreadline
6+
7+
In order to turn on support for readline, your Makefile.custom file
8+
*must* contain lines similar to:
9+
10+
USE_READLINE= yes
11+
READLINE_INC=
12+
READLINE_LIB=
13+
14+
15+
READLINE_INC can contain:
16+
17+
-DHAVE_LIBREADLINE
18+
not optional if USE_READLINE enabled
19+
-DHAVE_READLINE_H
20+
if <readline.h>, define this
21+
-DHAVE_HISTORY
22+
if you have either <history.h> or <readline/history.h>
23+
-DHAVE_LIBHISTORY
24+
if you have a libhistory.a
25+
26+
READLINE_LIB can contain:
27+
28+
-lreadline
29+
not optional if USE_READLINE enabled
30+
-lhistory
31+
if you have a libhistory.a
32+
33+
34+
Once support for configure is integrated into the distribution, this will
35+
all be hidden "behind the scenes"
36+
37+
Marc G. Fournier
38+
scrappy@hub.org

‎src/bin/psql/Makefile

Lines changed: 26 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
#
99
# IDENTIFICATION
10-
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.17 1996/12/30 23:19:48 bryanh Exp $
10+
# $Header: /cvsroot/pgsql/src/bin/psql/Makefile,v 1.18 1997/01/25 22:51:26 scrappy Exp $
1111
#
1212
#-------------------------------------------------------------------------
1313

@@ -19,46 +19,40 @@ INCLUDE_OPT:= \
1919
-I../../include
2020

2121
CFLAGS+=$(INCLUDE_OPT)
22-
#
22+
2323
#USE_READLINE is set in Makefile.global
2424
#
25-
2625
ifeq ($(USE_READLINE), true)
27-
CFLAGS+=$(READLINE_INC)$(HISTORY_INC)
26+
CFLAGS+=$(READLINE_INC)
2827

29-
LD_ADD+=$(READLINE_LIB)$(HISTORY_LIB)$(CURSES_LIB)
28+
LD_ADD+=$(READLINE_LIB)$(CURSES_LIB)
3029

3130
ifeq ($(PORTNAME), ultrix4)
32-
LD_ADD+= -ltermcap
33-
else
34-
ifeq ($(PORTNAME), sparc)
35-
LD_ADD+= -ltermcap
31+
LD_ADD+= -ltermcap
3632
else
37-
ifeq ($(PORTNAME), linux)
38-
LD_ADD+= -ltermcap
39-
else
40-
ifeq ($(PORTNAME), next)
41-
LD_ADD+= -ltermcap
42-
else
43-
ifeq ($(PORTNAME), bsdi)
44-
LD_ADD+= -ltermcap
45-
else
46-
ifeq ($(PORTNAME), BSD44_derived)
47-
LD_ADD+= -ltermcap
48-
endif
49-
endif
50-
endif
51-
endif
52-
endif
33+
ifeq ($(PORTNAME), sparc)
34+
LD_ADD+= -ltermcap
35+
else
36+
ifeq ($(PORTNAME), linux)
37+
LD_ADD+= -ltermcap
38+
else
39+
ifeq ($(PORTNAME), next)
40+
LD_ADD+= -ltermcap
41+
else
42+
ifeq ($(PORTNAME), bsdi)
43+
LD_ADD+= -ltermcap
44+
else
45+
ifeq ($(PORTNAME), BSD44_derived)
46+
LD_ADD+= -ltermcap
47+
endif
48+
endif
49+
endif
50+
endif
51+
endif
5352
endif
53+
OBJS= psql.o stringutils.o
5454
else
55-
CFLAGS+= -DNOREADLINE
56-
endif
57-
58-
OBJS= psql.o stringutils.o
59-
60-
ifneq ($(USE_READLINE), true)
61-
OBJS+= rlstubs.o
55+
OBJS= psql.o stringutils.o rlstubs.o
6256
endif
6357

6458
ifeq ($(PORTNAME), ultrix4)

‎src/bin/psql/Makefile.in

Lines changed: 0 additions & 60 deletions
This file was deleted.

‎src/bin/psql/psql.c

Lines changed: 3 additions & 3 deletions
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.52 1997/01/25 22:16:36 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.53 1997/01/25 22:51:56 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -35,12 +35,12 @@
3535
#else
3636
# ifdefHAVE_READLINE_H
3737
# include<readline.h>
38-
#ifndefNO_HISTORY
38+
#if defined(HAVE_HISTORY)|| defined(HAVE_LIBHISTORY)
3939
# include<history.h>
4040
# endif
4141
# else
4242
# include<readline/readline.h>
43-
#ifndefNO_HISTORY
43+
#if defined(HAVE_HISTORY)|| defined(HAVE_LIBHISTORY)
4444
# include<readline/history.h>
4545
# endif
4646
# endif

‎src/bin/psql/rlstubs.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,14 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/rlstubs.c,v 1.5 1996/11/11 14:55:47 scrappy Exp $
10+
* $Header: /cvsroot/pgsql/src/bin/psql/Attic/rlstubs.c,v 1.6 1997/01/25 22:52:08 scrappy Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
1414
#include<stdio.h>
1515

1616
#include"rlstubs.h"
1717

18-
externchar*readline(constchar*);
19-
externintwrite_history(constchar*);
20-
externintusing_history(void);
21-
externintadd_history(constchar*);
22-
2318
char*
2419
readline(constchar*prompt)
2520
{

‎src/include/config.h

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
#defineBLCKSZ8192
1010

1111
/* Define to enable readline/history support in psql */
12-
/* #undef HAVE_LIBREADLINE */
12+
/* #undef HAVE_LIBREADLINE */
13+
/* #undef HAVE_LIBHISTORY */
1314

1415
/* These two defines are not used until HAVE_LIBREADLINE
1516
* are also defined
@@ -20,19 +21,8 @@
2021

2122
/* Define one for either <history.h> or <readline/history.h>
2223
*/
23-
/* #undef HAVE_HISTORY_H */
24-
/* #undef HAVE_READLINE_HISTORY_H */
24+
/* #undef HAVE_HISTORY */
2525

26-
/* this is meant to handle the condition where the system has readline
27-
* capabilities, but no history. Unfortunately, it isn't as simple as
28-
* testing for the existance of -lhistory, since newer -lreadline seems to
29-
* include the -lhistory library, but newer readline.h doesn't
30-
*/
31-
#if defined(HAVE_LIBREADLINE)
32-
# if !defined(HAVE_HISTORY_H)|| !defined(HAVE_READLINE_HISTORY_H)
33-
# defineNO_HISTORY_H
34-
# endif
35-
#endif
3626

3727
#defineHAVE_SYS_SELECT_H
3828
#defineHAVE_TERMIOS_H

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp