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

Commit10e3d22

Browse files
committed
Add configure flag to allow libedit to be preferred over GNU readline:
--with-libedit-preferred prefer BSD Libedit over GNU Readline
1 parente4a9229 commit10e3d22

File tree

4 files changed

+105
-34
lines changed

4 files changed

+105
-34
lines changed

‎config/programs.m4

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $PostgreSQL: pgsql/config/programs.m4,v 1.18 2004/12/02 20:04:19 tgl Exp $
1+
# $PostgreSQL: pgsql/config/programs.m4,v 1.19 2005/12/04 03:52:28 momjian Exp $
22

33

44
# PGAC_PATH_FLEX
@@ -78,12 +78,16 @@ AC_SUBST(FLEXFLAGS)
7878

7979
AC_DEFUN([PGAC_CHECK_READLINE],
8080
[AC_REQUIRE([AC_CANONICAL_HOST])
81-
AC_MSG_CHECKING([for readline])
8281
8382
AC_CACHE_VAL([pgac_cv_check_readline],
8483
[pgac_cv_check_readline=no
8584
pgac_save_LIBS=$LIBS
86-
for pgac_rllib in -lreadline -ledit ; do
85+
if test x"$with_libedit_preferred" != x"yes"
86+
thenREADLINE_ORDER="-lreadline -ledit"
87+
elseREADLINE_ORDER="-ledit -lreadline"
88+
fi
89+
for pgac_rllib in $READLINE_ORDER ; do
90+
AC_MSG_CHECKING([for ${pgac_rllib}])
8791
for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
8892
LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
8993
AC_TRY_LINK_FUNC([readline],[[
@@ -98,20 +102,25 @@ for pgac_rllib in -lreadline -ledit ; do
98102
esac
99103
100104
pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
101-
break 2
105+
break
102106
]])
103107
done
108+
if test "$pgac_cv_check_readline" != no ; then
109+
AC_MSG_RESULT([yes ($pgac_cv_check_readline)])
110+
break
111+
else
112+
AC_MSG_RESULT(no)
113+
fi
104114
done
105115
LIBS=$pgac_save_LIBS
106116
])[]dnl AC_CACHE_VAL
107117
108118
if test "$pgac_cv_check_readline" != no ; then
109-
AC_DEFINE(HAVE_LIBREADLINE,1,[Define if you have a function readline library])
110119
LIBS="$pgac_cv_check_readline $LIBS"
111-
AC_MSG_RESULT([yes ($pgac_cv_check_readline)])
112-
else
113-
AC_MSG_RESULT(no)
114-
fi])# PGAC_CHECK_READLINE
120+
AC_DEFINE(HAVE_LIBREADLINE,1,[Define if you have a function readline library])
121+
fi
122+
123+
])# PGAC_CHECK_READLINE
115124

116125

117126

‎configure

Lines changed: 52 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,8 @@ Optional Packages:
890890
--with-pam build with PAM support
891891
--with-bonjour build with Bonjour support
892892
--with-openssl build with OpenSSL support
893-
--without-readline do not use Readline
893+
--with-libedit-preferred prefer BSD Libedit over GNU Readline
894+
--without-readline do not use GNU Readline / BSD Libedit line editing
894895
--without-zlib do not use Zlib
895896
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
896897

@@ -3771,6 +3772,37 @@ echo "${ECHO_T}$with_openssl" >&6
37713772

37723773

37733774

3775+
#
3776+
# Prefer libedit
3777+
#
3778+
3779+
3780+
3781+
# Check whether --with-libedit-preferred or --without-libedit-preferred was given.
3782+
if test "${with_libedit_preferred+set}" = set; then
3783+
withval="$with_libedit_preferred"
3784+
3785+
case $withval in
3786+
yes)
3787+
:
3788+
;;
3789+
no)
3790+
:
3791+
;;
3792+
*)
3793+
{ { echo "$as_me:$LINENO: error: no argument expected for --with-libedit-preferred option" >&5
3794+
echo "$as_me: error: no argument expected for --with-libedit-preferred option" >&2;}
3795+
{ (exit 1); exit 1; }; }
3796+
;;
3797+
esac
3798+
3799+
else
3800+
with_libedit_preferred=no
3801+
3802+
fi;
3803+
3804+
3805+
37743806
#
37753807
# Readline
37763808
#
@@ -6490,15 +6522,19 @@ fi
64906522

64916523
if test "$with_readline" = yes; then
64926524

6493-
echo "$as_me:$LINENO: checking for readline" >&5
6494-
echo $ECHO_N "checking for readline... $ECHO_C" >&6
64956525

64966526
if test "${pgac_cv_check_readline+set}" = set; then
64976527
echo $ECHO_N "(cached) $ECHO_C" >&6
64986528
else
64996529
pgac_cv_check_readline=no
65006530
pgac_save_LIBS=$LIBS
6501-
for pgac_rllib in -lreadline -ledit ; do
6531+
if test x"$with_libedit_preferred" != x"yes"
6532+
thenREADLINE_ORDER="-lreadline -ledit"
6533+
elseREADLINE_ORDER="-ledit -lreadline"
6534+
fi
6535+
for pgac_rllib in $READLINE_ORDER ; do
6536+
echo "$as_me:$LINENO: checking for ${pgac_rllib}" >&5
6537+
echo $ECHO_N "checking for ${pgac_rllib}... $ECHO_C" >&6
65026538
for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do
65036539
LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS"
65046540
cat >conftest.$ac_ext <<_ACEOF
@@ -6557,7 +6593,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
65576593
esac
65586594

65596595
pgac_cv_check_readline="${pgac_rllib}${pgac_lib}"
6560-
break 2
6596+
break
65616597

65626598
else
65636599
echo "$as_me: failed program was:" >&5
@@ -6567,24 +6603,29 @@ fi
65676603
rm -f conftest.err conftest.$ac_objext \
65686604
conftest$ac_exeext conftest.$ac_ext
65696605
done
6606+
if test "$pgac_cv_check_readline" != no ; then
6607+
echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5
6608+
echo "${ECHO_T}yes ($pgac_cv_check_readline)" >&6
6609+
break
6610+
else
6611+
echo "$as_me:$LINENO: result: no" >&5
6612+
echo "${ECHO_T}no" >&6
6613+
fi
65706614
done
65716615
LIBS=$pgac_save_LIBS
65726616

65736617
fi
65746618

65756619
if test "$pgac_cv_check_readline" != no ; then
6620+
LIBS="$pgac_cv_check_readline $LIBS"
65766621

65776622
cat >>confdefs.h <<\_ACEOF
65786623
#define HAVE_LIBREADLINE 1
65796624
_ACEOF
65806625

6581-
LIBS="$pgac_cv_check_readline $LIBS"
6582-
echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5
6583-
echo "${ECHO_T}yes ($pgac_cv_check_readline)" >&6
6584-
else
6585-
echo "$as_me:$LINENO: result: no" >&5
6586-
echo "${ECHO_T}no" >&6
65876626
fi
6627+
6628+
65886629
if test x"$pgac_cv_check_readline" = x"no"; then
65896630
{ { echo "$as_me:$LINENO: error: readline library not found
65906631
If you have readline already installed, see config.log for details on the

‎configure.in

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dnl Process this file with autoconf to produce a configure script.
2-
dnl $PostgreSQL: pgsql/configure.in,v 1.432 2005/11/05 16:42:01 tgl Exp $
2+
dnl $PostgreSQL: pgsql/configure.in,v 1.433 2005/12/04 03:52:24 momjian Exp $
33
dnl
44
dnl Developers, please strive to achieve this order:
55
dnl
@@ -467,11 +467,18 @@ AC_MSG_RESULT([$with_openssl])
467467
AC_SUBST(with_openssl)
468468

469469

470+
#
471+
# Prefer libedit
472+
#
473+
PGAC_ARG_BOOL(with, libedit-preferred, no,
474+
[ --with-libedit-preferred prefer BSD Libedit over GNU Readline])
475+
476+
470477
#
471478
# Readline
472479
#
473480
PGAC_ARG_BOOL(with, readline, yes,
474-
[ --without-readline do not use Readline])
481+
[ --without-readline do not useGNUReadline / BSD Libedit line editing])
475482
# readline on MinGW has problems with backslashes in psql and other bugs.
476483
# This is particularly a problem with non-US code pages.
477484
# Therefore disable its use until we understand the cause. 2004-07-20

‎doc/src/sgml/installation.sgml

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.249 2005/11/05 00:04:04 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/installation.sgml,v 1.250 2005/12/04 03:52:29 momjian Exp $ -->
22

33
<chapter id="installation">
44
<title><![%standalone-include[<productname>PostgreSQL</>]]>
@@ -50,7 +50,7 @@ su - postgres
5050
<para>
5151
In general, a modern Unix-compatible platform should be able to run
5252
<productname>PostgreSQL</>.
53-
The platforms that had received specific testing at the
53+
The platforms that had received specific testing at the
5454
time of release are listed in <xref linkend="supported-platforms">
5555
below. In the <filename>doc</> subdirectory of the distribution
5656
there are several platform-specific <acronym>FAQ</> documents you
@@ -107,16 +107,20 @@ su - postgres
107107
</indexterm>
108108

109109
The <acronym>GNU</> <productname>Readline</> library (for
110-
comfortable line editing and command history retrieval) will be
111-
used by default. If you don't want to use it then you must
112-
specify the <option>--without-readline</option> option for
113-
<filename>configure</>. (On <productname>NetBSD</productname>,
114-
the <filename>libedit</filename> library is
115-
<productname>Readline</productname>-compatible and is used if
116-
<filename>libreadline</filename> is not found.) If you are using
117-
a package-based Linux distribution, be aware that you need both
118-
the <literal>readline</> and <literal>readline-devel</> packages,
119-
if those are separate in your distribution.
110+
simple line editing and command history retrieval) is
111+
used by default. If you don't want to use it then you must specify
112+
the <option>--without-readline</option> option for
113+
<filename>configure</>. As an alternative, you can often use the
114+
BSD-licensed <filename>libedit</filename> library, originally
115+
developed on <productname>NetBSD</productname>. The
116+
<filename>libedit</filename> library is
117+
GNU <productname>Readline</productname>-compatible and is used if
118+
<filename>libreadline</filename> is not found, or if
119+
<option>--with-libedit-preferred</option> is used as an
120+
option to <filename>configure</>. If you are using a package-based
121+
Linux distribution, be aware that you need both the
122+
<literal>readline</> and <literal>readline-devel</> packages, if
123+
those are separate in your distribution.
120124
</para>
121125
</listitem>
122126

@@ -857,6 +861,16 @@ su - postgres
857861
</listitem>
858862
</varlistentry>
859863

864+
<varlistentry>
865+
<term><option>--with-libedit-preferred</option></term>
866+
<listitem>
867+
<para>
868+
Favors the use of the BSD-licensed <application>libedit</> library
869+
rather than GPL-licensed <application>Readline</>.
870+
</para>
871+
</listitem>
872+
</varlistentry>
873+
860874
<varlistentry>
861875
<term><option>--without-readline</option></term>
862876
<listitem>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp