Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-14 Thread Patrick Welche

On Fri, Jul 14, 2000 at 12:33:20AM +0200, Peter Eisentraut wrote:
 Patrick Welche writes:
 
  .. of course for me it's in libedit:
  
  % nm -g /usr/lib/libedit.a | grep using_history
  028c T using_history
 
 Is libedit readline compatible now?

On a NetBSD-1.5B/i386 box, according to editline(3):

HISTORY
 The editline library first appeared in 4.4BSD.  CC_REDISPLAY appeared in
 NetBSD 1.3.  CC_REFRESH_BEEP, EL_EDITMODE and the readline emulation ap-
 peared in NetBSD 1.4.  EL_RPROMPT appeared in NetBSD 1.5.

AUTHORS
 The editline library was written by Christos Zoulas.  Luke Mewburn wrote
 this manual and implemented CC_REDISPLAY, CC_REFRESH_BEEP, EL_EDITMODE,
 and EL_RPROMPT.  Jaromir Dolecek implemented the readline emulation.

So I suspect the answer is "yes"?

Cheers,

Patrick



[GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Erich


With some helpful hints from various people, I figured out how to get
this to work, and now my life is more pleasant and meaningful.

Situation: Stock installation of OpenBSD 2.7, with PostgreSQL 7.0.2.
I installed postgres by downloading the source tar and compiling, not
by going through /usr/ports.

Anyway, I'm not sure if OpenBSD ships with readline or whatever, so I
downloaded the latest readline (4.1) and compiled and installed it.  I
then did ./configure in postgres, and recompiled psql, and it still
didn't have history.

Following some sugestions on this group, I figured out the problem.
First, there is no history.h with readline 4.1.  There's
readline/history.h.  So I modified Makefile.global to include that
file.  Also, I had to edit config.h, with several tweaks to various
defines.  I had to tell it that there is no history.h, but there is a
readline/history.h.  I had to put in that there is no history function
in libreadline, and it must also use libhistory.  Etc.

After doing all that, it worked beautifully.  I often have to do a
sequence of slighly varied inserts, etc, and this is much better.

Maybe for the next release, there should be better handling of gnu
readline 4.1?  Or maybe it should come with the package?  Just a
thought.

e


-- 
This message was my two cents worth.  Please deposit two cents into my
e-gold account by following this link:
http://rootworks.com/twocentsworth.cgi?102861
275A B627 1826 D627 ED35  B8DF 7DDE 4428 0F5C 4454



Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Tom Lane

Erich [EMAIL PROTECTED] writes:
 Following some sugestions on this group, I figured out the problem.
 First, there is no history.h with readline 4.1.  There's
 readline/history.h.  So I modified Makefile.global to include that
 file.  Also, I had to edit config.h, with several tweaks to various
 defines.  I had to tell it that there is no history.h, but there is a
 readline/history.h.  I had to put in that there is no history function
 in libreadline, and it must also use libhistory.  Etc.

configure is supposed to handle all that for you ... if it failed
to find the right location of libreadline and associated includes
then the question is why.  You sure you ran configure after installing
the include files?

regards, tom lane



Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Erich


 configure is supposed to handle all that for you ... if it failed to
 find the right location of libreadline and associated includes then
 the question is why.  You sure you ran configure after installing
 the include files?

I just deleted my postgres tree, and then unpacked it again, and ran
configure again.  libreadline.a and libhistory.a are in
/usr/local/lib/.  readline.h and history.h are in
/usr/local/include/readline/.

I then ran ./configure.

When I look at config.h, I can see that it failed to detect
/usr/local/include/readline/history.h.  Also, I see that it did define
HAVE_HISTORY_IN_READLINE 1 which is incorrect.  I would have to make
the change by hand to the file.

I think it may be a bug.

e



Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Tom Lane

Erich [EMAIL PROTECTED] writes:
 configure is supposed to handle all that for you ... if it failed to
 find the right location of libreadline and associated includes then
 the question is why.  You sure you ran configure after installing
 the include files?

 I just deleted my postgres tree, and then unpacked it again, and ran
 configure again.  libreadline.a and libhistory.a are in
 /usr/local/lib/.  readline.h and history.h are in
 /usr/local/include/readline/.

OK ... my setup has the same files in the same places ...

 I then ran ./configure.

 When I look at config.h, I can see that it failed to detect
 /usr/local/include/readline/history.h.  Also, I see that it did define
 HAVE_HISTORY_IN_READLINE 1 which is incorrect.  I would have to make
 the change by hand to the file.

Well, that's darn peculiar.  configure.in has a test for
readline/history.h, big as life:
AC_CHECK_HEADERS(readline/history.h)
Does the config.log file show why it failed to find the include?

HAVE_HISTORY_IN_READLINE seems to get defined if libreadline.a contains
a "using_history" symbol:

AC_CHECK_LIB(readline, using_history, AC_DEFINE(HAVE_HISTORY_IN_READLINE),
AC_CHECK_LIB(history,  main) )


On my setup, which is readline 4.0 if I'm checking the right files,
HAVE_HISTORY_IN_READLINE does get defined, and AFAICT libhistory.a
doesn't get linked, but I most certainly do get history support.

Which readline version are you using?  Maybe the GNU guys rearranged
which functions live in which library.  If so, we probably need
to be probing for a different symbol in libreadline to be compatible
across more libreadline versions ...

regards, tom lane



Re: [GENERAL] Figured it out (psql and Gnu readline)

2000-07-12 Thread Stephan Szabo

Here's a stupid question,

What happens if you do the same kind of compile on a similar program from
your shell (a simple program that includes readline/history.h, with and
without -I/usr/local/include?
I'm just wondering if the compiler is not looking in /usr/local/include by
default and is not finding the header because of that...

- Original Message -
From: "Erich" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Wednesday, July 12, 2000 6:12 PM
Subject: Re: [GENERAL] Figured it out (psql and Gnu readline)



  Well, that's darn peculiar.  configure.in has a test for
  readline/history.h, big as life:
  AC_CHECK_HEADERS(readline/history.h)
  Does the config.log file show why it failed to find the include?

 Here's the lines from config.log:

 configure:2539: checking for main in -lreadline
 configure:2554: gcc -o conftest -O2 -pipe
   conftest.c -lreadline  -ltermcap -lcurses  15
 configure:2582: checking for using_history in -lreadline
 configure:2601: gcc -o conftest -O2 -pipe
   conftest.c -lreadline  -lreadline -ltermcap -lcurses  15
 configure:3833: checking for history.h
 configure:3843: gcc -E   conftest.c /dev/null 2conftest.out
 configure:3839: history.h: No such file or directory
 configure: failed program was:
 #line 3838 "configure"
 #include "confdefs.h"
 #include history.h
 configure:3873: checking for ieeefp.h
 configure:3883: gcc -E   conftest.c /dev/null 2conftest.out
 configure:3913: checking for limits.h
 configure:3923: gcc -E   conftest.c /dev/null 2conftest.out
 configure:3953: checking for netdb.h
 configure:3963: gcc -E   conftest.c /dev/null 2conftest.out
 configure:3993: checking for netinet/in.h
 configure:4003: gcc -E   conftest.c /dev/null 2conftest.out
 configure:4033: checking for readline.h
 configure:4043: gcc -E   conftest.c /dev/null 2conftest.out
 configure:4039: readline.h: No such file or directory
 configure: failed program was:
 #line 4038 "configure"
 #include "confdefs.h"
 #include readline.h
 configure:4073: checking for readline/history.h
 configure:4083: gcc -E   conftest.c /dev/null 2conftest.out
 configure:4079: readline/history.h: No such file or directory
 configure: failed program was:
 #line 4078 "configure"
 #include "confdefs.h"
 #include readline/history.h
 configure:4113: checking for readline/readline.h
 configure:4123: gcc -E   conftest.c /dev/null 2conftest.out
 configure:4153: checking for sys/select.h
 configure:4163: gcc -E   conftest.c /dev/null 2conftest.out
 configure:4193: checking for termios.h
 configure:4203: gcc -E   conftest.c /dev/null 2conftest.out
 configure:4233: checking for unistd.h
 configure:4243: gcc -E   conftest.c /dev/null 2conftest.out
 configure:4273: checking for values.h
 configure:4283: gcc -E   conftest.c /dev/null 2conftest.out
 configure:4279: values.h: No such file or directory
 configure: failed program was:
 #line 4278 "configure"


  On my setup, which is readline 4.0 if I'm checking the right files,
  HAVE_HISTORY_IN_READLINE does get defined, and AFAICT libhistory.a
  doesn't get linked, but I most certainly do get history support.
 
  Which readline version are you using?  Maybe the GNU guys rearranged
  which functions live in which library.  If so, we probably need
  to be probing for a different symbol in libreadline to be compatible
  across more libreadline versions ...

 I'm using readline 4.1, compiled from the distribution.  In other
 words, I didn't get it from /usr/ports, which is what OpenBSD normally
 uses.

 I have a stupid ./configure question: Whenever I compile something, I
 never want to have -g as a CC option.  How do I tell configure not to
 use -g as a CC option?  I only want -O2.  Usually I go through and
 edit Makefiles by hand after configure is done, but that's annoying.

 e