X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 152B59DD8D5 for ; Sat, 3 Dec 2005 23:52:23 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 54261-03 for ; Sat, 3 Dec 2005 23:52:17 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from candle.pha.pa.us (candle.pha.pa.us [64.139.89.126]) by postgresql.org (Postfix) with ESMTP id 181929DD8C4 for ; Sat, 3 Dec 2005 23:52:18 -0400 (AST) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.11.6) id jB43qMn02416; Sat, 3 Dec 2005 22:52:22 -0500 (EST) From: Bruce Momjian Message-Id: <200512040352.jB43qMn02416@candle.pha.pa.us> Subject: Re: [HACKERS] Should libedit be preferred to libreadline? In-Reply-To: <200512031527.jB3FRbX08195@candle.pha.pa.us> To: Bruce Momjian Date: Sat, 3 Dec 2005 22:52:22 -0500 (EST) CC: Michael Paesold , Peter Eisentraut , pgsql-patches@postgresql.org, Tom Lane , Chris Browne X-Mailer: ELM [version 2.4ME+ PL121 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.005 required=5 tests=[AWL=0.005] X-Spam-Score: 0.005 X-Spam-Level: X-Archive-Number: 200512/112 X-Sequence-Number: 18071 Patch applied. --------------------------------------------------------------------------- Bruce Momjian wrote: > Michael Paesold wrote: > > Bruce Momjian wrote: > > > > > I wanted to distinguish libreadline from readline-functionality. Why is > > > it Readline? > > > > "The GNU Readline Library" is usually referred to as "Readline", not > > "libreadline". The offical name for "libedit" is really "Libedit". > > > > See e.g.: > > http://sourceforge.net/projects/libedit/ > > http://cnswww.cns.cwru.edu/~chet/readline/rltop.html > > > > IMHO libreadline does not sound good. > > OK, I call it GNU Readline now: > > --with-bonjour build with Bonjour support > --with-openssl build with OpenSSL support > --with-libedit-preferred prefer BSD Libedit over GNU Readline > --without-readline do not use GNU Readline / BSD Libedit line editing > --without-zlib do not use Zlib > > -- > Bruce Momjian | http://candle.pha.pa.us > pgman@candle.pha.pa.us | (610) 359-1001 > + If your life is a hard drive, | 13 Roberts Road > + Christ can be your backup. | Newtown Square, Pennsylvania 19073 > Index: configure > =================================================================== > RCS file: /cvsroot/pgsql/configure,v > retrieving revision 1.462 > diff -c -c -r1.462 configure > *** configure 5 Nov 2005 16:42:00 -0000 1.462 > --- configure 3 Dec 2005 15:25:44 -0000 > *************** > *** 890,896 **** > --with-pam build with PAM support > --with-bonjour build with Bonjour support > --with-openssl build with OpenSSL support > ! --without-readline do not use Readline > --without-zlib do not use Zlib > --with-gnu-ld assume the C compiler uses GNU ld [default=no] > > --- 890,897 ---- > --with-pam build with PAM support > --with-bonjour build with Bonjour support > --with-openssl build with OpenSSL support > ! --with-libedit-preferred prefer BSD Libedit over GNU Readline > ! --without-readline do not use GNU Readline / BSD Libedit line editing > --without-zlib do not use Zlib > --with-gnu-ld assume the C compiler uses GNU ld [default=no] > > *************** > *** 3772,3777 **** > --- 3773,3809 ---- > > > # > + # Prefer libedit > + # > + > + > + > + # Check whether --with-libedit-preferred or --without-libedit-preferred was given. > + if test "${with_libedit_preferred+set}" = set; then > + withval="$with_libedit_preferred" > + > + case $withval in > + yes) > + : > + ;; > + no) > + : > + ;; > + *) > + { { echo "$as_me:$LINENO: error: no argument expected for --with-libedit-preferred option" >&5 > + echo "$as_me: error: no argument expected for --with-libedit-preferred option" >&2;} > + { (exit 1); exit 1; }; } > + ;; > + esac > + > + else > + with_libedit_preferred=no > + > + fi; > + > + > + > + # > # Readline > # > > *************** > *** 6490,6504 **** > > if test "$with_readline" = yes; then > > - echo "$as_me:$LINENO: checking for readline" >&5 > - echo $ECHO_N "checking for readline... $ECHO_C" >&6 > > if test "${pgac_cv_check_readline+set}" = set; then > echo $ECHO_N "(cached) $ECHO_C" >&6 > else > pgac_cv_check_readline=no > pgac_save_LIBS=$LIBS > ! for pgac_rllib in -lreadline -ledit ; do > for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do > LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS" > cat >conftest.$ac_ext <<_ACEOF > --- 6522,6540 ---- > > if test "$with_readline" = yes; then > > > if test "${pgac_cv_check_readline+set}" = set; then > echo $ECHO_N "(cached) $ECHO_C" >&6 > else > pgac_cv_check_readline=no > pgac_save_LIBS=$LIBS > ! if test x"$with_libedit_preferred" != x"yes" > ! then READLINE_ORDER="-lreadline -ledit" > ! else READLINE_ORDER="-ledit -lreadline" > ! fi > ! for pgac_rllib in $READLINE_ORDER ; do > ! echo "$as_me:$LINENO: checking for ${pgac_rllib}" >&5 > ! echo $ECHO_N "checking for ${pgac_rllib}... $ECHO_C" >&6 > for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do > LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS" > cat >conftest.$ac_ext <<_ACEOF > *************** > *** 6557,6563 **** > esac > > pgac_cv_check_readline="${pgac_rllib}${pgac_lib}" > ! break 2 > > else > echo "$as_me: failed program was:" >&5 > --- 6593,6599 ---- > esac > > pgac_cv_check_readline="${pgac_rllib}${pgac_lib}" > ! break > > else > echo "$as_me: failed program was:" >&5 > *************** > *** 6567,6590 **** > rm -f conftest.err conftest.$ac_objext \ > conftest$ac_exeext conftest.$ac_ext > done > done > LIBS=$pgac_save_LIBS > > fi > > if test "$pgac_cv_check_readline" != no ; then > > cat >>confdefs.h <<\_ACEOF > #define HAVE_LIBREADLINE 1 > _ACEOF > > - LIBS="$pgac_cv_check_readline $LIBS" > - echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5 > - echo "${ECHO_T}yes ($pgac_cv_check_readline)" >&6 > - else > - echo "$as_me:$LINENO: result: no" >&5 > - echo "${ECHO_T}no" >&6 > fi > if test x"$pgac_cv_check_readline" = x"no"; then > { { echo "$as_me:$LINENO: error: readline library not found > If you have readline already installed, see config.log for details on the > --- 6603,6631 ---- > rm -f conftest.err conftest.$ac_objext \ > conftest$ac_exeext conftest.$ac_ext > done > + if test "$pgac_cv_check_readline" != no ; then > + echo "$as_me:$LINENO: result: yes ($pgac_cv_check_readline)" >&5 > + echo "${ECHO_T}yes ($pgac_cv_check_readline)" >&6 > + break > + else > + echo "$as_me:$LINENO: result: no" >&5 > + echo "${ECHO_T}no" >&6 > + fi > done > LIBS=$pgac_save_LIBS > > fi > > if test "$pgac_cv_check_readline" != no ; then > + LIBS="$pgac_cv_check_readline $LIBS" > > cat >>confdefs.h <<\_ACEOF > #define HAVE_LIBREADLINE 1 > _ACEOF > > fi > + > + > if test x"$pgac_cv_check_readline" = x"no"; then > { { echo "$as_me:$LINENO: error: readline library not found > If you have readline already installed, see config.log for details on the > Index: configure.in > =================================================================== > RCS file: /cvsroot/pgsql/configure.in,v > retrieving revision 1.432 > diff -c -c -r1.432 configure.in > *** configure.in 5 Nov 2005 16:42:01 -0000 1.432 > --- configure.in 3 Dec 2005 15:25:45 -0000 > *************** > *** 468,477 **** > > > # > # Readline > # > PGAC_ARG_BOOL(with, readline, yes, > ! [ --without-readline do not use Readline]) > # readline on MinGW has problems with backslashes in psql and other bugs. > # This is particularly a problem with non-US code pages. > # Therefore disable its use until we understand the cause. 2004-07-20 > --- 468,484 ---- > > > # > + # Prefer libedit > + # > + PGAC_ARG_BOOL(with, libedit-preferred, no, > + [ --with-libedit-preferred prefer BSD Libedit over GNU Readline]) > + > + > + # > # Readline > # > PGAC_ARG_BOOL(with, readline, yes, > ! [ --without-readline do not use GNU Readline / BSD Libedit line editing]) > # readline on MinGW has problems with backslashes in psql and other bugs. > # This is particularly a problem with non-US code pages. > # Therefore disable its use until we understand the cause. 2004-07-20 > Index: config/programs.m4 > =================================================================== > RCS file: /cvsroot/pgsql/config/programs.m4,v > retrieving revision 1.18 > diff -c -c -r1.18 programs.m4 > *** config/programs.m4 2 Dec 2004 20:04:19 -0000 1.18 > --- config/programs.m4 3 Dec 2005 15:25:47 -0000 > *************** > *** 78,89 **** > > AC_DEFUN([PGAC_CHECK_READLINE], > [AC_REQUIRE([AC_CANONICAL_HOST]) > - AC_MSG_CHECKING([for readline]) > > AC_CACHE_VAL([pgac_cv_check_readline], > [pgac_cv_check_readline=no > pgac_save_LIBS=$LIBS > ! for pgac_rllib in -lreadline -ledit ; do > for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do > LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS" > AC_TRY_LINK_FUNC([readline], [[ > --- 78,93 ---- > > AC_DEFUN([PGAC_CHECK_READLINE], > [AC_REQUIRE([AC_CANONICAL_HOST]) > > AC_CACHE_VAL([pgac_cv_check_readline], > [pgac_cv_check_readline=no > pgac_save_LIBS=$LIBS > ! if test x"$with_libedit_preferred" != x"yes" > ! then READLINE_ORDER="-lreadline -ledit" > ! else READLINE_ORDER="-ledit -lreadline" > ! fi > ! for pgac_rllib in $READLINE_ORDER ; do > ! AC_MSG_CHECKING([for ${pgac_rllib}]) > for pgac_lib in "" " -ltermcap" " -lncurses" " -lcurses" ; do > LIBS="${pgac_rllib}${pgac_lib} $pgac_save_LIBS" > AC_TRY_LINK_FUNC([readline], [[ > *************** > *** 98,117 **** > esac > > pgac_cv_check_readline="${pgac_rllib}${pgac_lib}" > ! break 2 > ]]) > done > done > LIBS=$pgac_save_LIBS > ])[]dnl AC_CACHE_VAL > > if test "$pgac_cv_check_readline" != no ; then > - AC_DEFINE(HAVE_LIBREADLINE, 1, [Define if you have a function readline library]) > LIBS="$pgac_cv_check_readline $LIBS" > ! AC_MSG_RESULT([yes ($pgac_cv_check_readline)]) > ! else > ! AC_MSG_RESULT(no) > ! fi])# PGAC_CHECK_READLINE > > > > --- 102,126 ---- > esac > > pgac_cv_check_readline="${pgac_rllib}${pgac_lib}" > ! break > ]]) > done > + if test "$pgac_cv_check_readline" != no ; then > + AC_MSG_RESULT([yes ($pgac_cv_check_readline)]) > + break > + else > + AC_MSG_RESULT(no) > + fi > done > LIBS=$pgac_save_LIBS > ])[]dnl AC_CACHE_VAL > > if test "$pgac_cv_check_readline" != no ; then > LIBS="$pgac_cv_check_readline $LIBS" > ! AC_DEFINE(HAVE_LIBREADLINE, 1, [Define if you have a function readline library]) > ! fi > ! > ! ])# PGAC_CHECK_READLINE > > > > Index: doc/src/sgml/installation.sgml > =================================================================== > RCS file: /cvsroot/pgsql/doc/src/sgml/installation.sgml,v > retrieving revision 1.249 > diff -c -c -r1.249 installation.sgml > *** doc/src/sgml/installation.sgml 5 Nov 2005 00:04:04 -0000 1.249 > --- doc/src/sgml/installation.sgml 3 Dec 2005 15:25:49 -0000 > *************** > *** 50,56 **** > > In general, a modern Unix-compatible platform should be able to run > PostgreSQL. > ! The platforms that had received specific testing at the > time of release are listed in > below. In the doc subdirectory of the distribution > there are several platform-specific FAQ documents you > --- 50,56 ---- > > In general, a modern Unix-compatible platform should be able to run > PostgreSQL. > ! The platforms that had received specific testing at the > time of release are listed in > below. In the doc subdirectory of the distribution > there are several platform-specific FAQ documents you > *************** > *** 107,122 **** > > > The GNU Readline library (for > ! comfortable line editing and command history retrieval) will be > ! used by default. If you don't want to use it then you must > ! specify the option for > ! configure. (On NetBSD, > ! the libedit library is > ! Readline-compatible and is used if > ! libreadline is not found.) If you are using > ! a package-based Linux distribution, be aware that you need both > ! the readline and readline-devel packages, > ! if those are separate in your distribution. > > > > --- 107,126 ---- > > > The GNU Readline library (for > ! simple line editing and command history retrieval) is > ! used by default. If you don't want to use it then you must specify > ! the option for > ! configure. As an alternative, you can often use the > ! BSD-licensed libedit library, originally > ! developed on NetBSD. The > ! libedit library is > ! GNU Readline-compatible and is used if > ! libreadline is not found, or if > ! is used as an > ! option to configure. If you are using a package-based > ! Linux distribution, be aware that you need both the > ! readline and readline-devel packages, if > ! those are separate in your distribution. > > > > *************** > *** 858,863 **** > --- 862,877 ---- > > > > + > + > + > + Favors the use of the BSD-licensed libedit library > + rather than GPL-licensed Readline. > + > + > + > + > + > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 3: Have you checked our extensive FAQ? > > http://www.postgresql.org/docs/faq -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 359-1001 + If your life is a hard drive, | 13 Roberts Road + Christ can be your backup. | Newtown Square, Pennsylvania 19073