Skip site navigation (1) Skip section navigation (2)

Fixed: Trouble with readline compiling on Redhat 8.0

From: "David Busby" <busby(at)edoceo(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Fixed: Trouble with readline compiling on Redhat 8.0
Date: 2002-12-30 02:39:15
Message-ID: 006801c2afac$a52c1300$1103a8c0@edoceo.com (view raw or flat)
Thread:
Lists: pgsql-general
Tom, Michael, List,
    Thank you for the replies, I've got it working...incase anyone else
reading (or for the archives) the fix is:
for the '--with-libs' parameter add the location of both readline and
libtermcap.  On RedHat Linux 8.0 libreadline and libncurses are in
'/usr/lib' and libtermcap is in '/lib' so when building PostgreSQL 7.3 from
source on RedHat 8.0 with RPM versions of necessary stuff for PostgreSQL
installed...
Fix:
The '--with-libs' parameter for ./configure should be
'--with-libs=/lib:/usr/lib'.

/B


----- Original Message -----
From: "David Busby" <busby(at)edoceo(dot)com>
To: <pgsql-general(at)postgresql(dot)org>
Sent: Sunday, December 29, 2002 15:37
Subject: [GENERAL] Trouble with readline compiling on Redhat 8.0


> List,
>     I'm attempting to install PG 7.3 on my RedHat 8.0 box.
> My RedHat install was minimal...but readline was installed.  I run my PG
> configure script like this:
> (in /usr/src/postgresql-7.3/)
>
>
./configure --prefix=/usr/local --bindir=/usr/local/bin --datadir=/usr/local
>
/share --enable-odbc --sysconfdir=/etc/pgsql --libdir=/usr/lib --includedir=
> /usr/include --with-libs=/usr/lib --with-perl
>
> That's how it should be for my system, as far as I know.
> Now configure chokes and dies on readline with the following error
message:
>
> checking for readline... no
> configure: error: readline library not found
> If you have readline already installed, see config.log for details on the
> failure.  It is possible the compiler isn't looking in the proper
directory.
> Use --without-readline to disable readline support.
>
> psql is not that fun without readline, so I MUST have it, MUST.  I went
> looking in config.log (it says to do that) and I see:
>
> configure:5800: checking for readline
> configure:5837: gcc -o conftest -O2     -L/usr/lib
> conftest.c -lreadline -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
> /usr/lib/libreadline.so: undefined reference to `tgetnum'
> /usr/lib/libreadline.so: undefined reference to `tgoto'
> /usr/lib/libreadline.so: undefined reference to `tgetflag'
> /usr/lib/libreadline.so: undefined reference to `BC'
> /usr/lib/libreadline.so: undefined reference to `tputs'
> /usr/lib/libreadline.so: undefined reference to `PC'
> /usr/lib/libreadline.so: undefined reference to `tgetent'
> /usr/lib/libreadline.so: undefined reference to `UP'
> /usr/lib/libreadline.so: undefined reference to `tgetstr'
> collect2: ld returned 1 exit status
> configure:5840: $? = 1
> configure: failed program was:
> #line 5811 "configure"
> #include "confdefs.h"
>
> /* Override any gcc2 internal prototype to avoid an error.  */
> #ifdef __cplusplus
> extern "C"
> #endif
> /* We use char because int might match the return type of a gcc2
>    builtin and then its argument prototype would still apply.  */
> char readline ();
> #ifdef F77_DUMMY_MAIN
> #  ifdef __cplusplus
>      extern "C"
> #  endif
>    int F77_DUMMY_MAIN() { return 1; }
> #endif
> int
> main ()
> {
> readline ();
>   ;
>   return 0;
> }
> configure:5837: gcc -o conftest -O2     -L/usr/lib
> conftest.c -ledit -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
> /usr/bin/ld: cannot find -ledit
> collect2: ld returned 1 exit status
> configure:5840: $? = 1
> configure: failed program was:
> #line 5811 "configure"
> #include "confdefs.h"
>
> /* Override any gcc2 internal prototype to avoid an error.  */
> #ifdef __cplusplus
> extern "C"
> #endif
> /* We use char because int might match the return type of a gcc2
>    builtin and then its argument prototype would still apply.  */
> char readline ();
> #ifdef F77_DUMMY_MAIN
> #  ifdef __cplusplus
>      extern "C"
> #  endif
>    int F77_DUMMY_MAIN() { return 1; }
> #endif
> int
> main ()
> {
> readline ();
>   ;
>   return 0;
> }
> configure:5837: gcc -o conftest -O2     -L/usr/lib
> conftest.c -lreadline -ltermcap -lcrypt -lresolv -lnsl -ldl -lm -lbsd  >&5
> /usr/bin/ld: cannot find -ltermcap
> collect2: ld returned 1 exit status
> configure:5840: $? = 1
> configure: failed program was:
> #line 5811 "configure"
> #include "confdefs.h"
>
> /* Override any gcc2 internal prototype to avoid an error.  */
> #ifdef __cplusplus
> extern "C"
>
> All that looks like it can't load readline, cause of a problem with
termcap
> (or maybe curses?)
> But then I look at my libreadline (from the RPM)
> [root(at)localhost lib]# ldd /usr/lib/libreadline.so.4.3
>         libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
>
> That looks OK?  I don't see readline linking to termcap or curses
(shouldn't
> it?)
> Here's my termcap & ncurses
> [root(at)localhost lib]# ldd /lib/libtermcap.so.2.0.8
>         libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
> [root(at)localhost lib]# ldd /usr/lib/libncurses.so.5.2
>         libc.so.6 => /lib/i686/libc.so.6 (0x42000000)
>         /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)
>
> Then I ran ld on libreadline, and I get this:
> [root(at)localhost lib]# ld -lreadline
> ld: warning: cannot find entry symbol _start; not setting start address
> /usr/lib/libreadline.so: undefined reference to `tgetnum'
> /usr/lib/libreadline.so: undefined reference to `tgoto'
> /usr/lib/libreadline.so: undefined reference to `tgetflag'
> /usr/lib/libreadline.so: undefined reference to `BC'
> /usr/lib/libreadline.so: undefined reference to `tputs'
> /usr/lib/libreadline.so: undefined reference to `PC'
> /usr/lib/libreadline.so: undefined reference to `tgetent'
> /usr/lib/libreadline.so: undefined reference to `UP'
> /usr/lib/libreadline.so: undefined reference to `tgetstr'
>
> Oh snap! what does that all mean?  Has anyone seen anything similar?  I've
> built without readline for now, but I really really like that feature.
> Should I just go to 7.3.1?  (is it stable? (or stable enough for someone
who
> runs latest PHP 4.3.0 and Apache 2.0.43 in production (nobody advises
> that)?))  Perhaps my RedHat 8.0 is missing something?  (I see termcap and
> ncurses) in `rpm -q`
>
> Thanks In Advance
> /B
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly


In response to

Responses

pgsql-general by date

Next:From: Bruce MomjianDate: 2002-12-30 03:02:58
Subject: Re: 7.3.1: Using phpPgAdmin with crypt
Previous:From: Tom LaneDate: 2002-12-30 00:52:47
Subject: Re: Trouble with readline compiling on Redhat 8.0

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group