Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 4403 - python-2.2.1-r1 references non-existent termcap
Summary: python-2.2.1-r1 references non-existent termcap
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High blocker (vote)
Assignee: Jon Nelson (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-01 17:34 UTC by Daniel Robbins (RETIRED)
Modified: 2003-02-04 19:42 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Robbins (RETIRED) gentoo-dev 2002-07-01 17:34:00 UTC
Azarah merged readline-4.2 and tested it with python-2.2.1-r1.  Python's
./configure tried using -ltermcap instead of -lncurses and died:

15:53 <@Azarah> configure:7289: gcc -o conftest -march=i686 -O3 -pipe  
conftest.c -lreadline -ltermcap -ldl  -lpthread -lutil 1>&5
15:53 <@Azarah> collect2: ld returned 1 exit status
15:53 <@Azarah> configure: failed program was:
15:53 <@Azarah>  /usr/i686-pc-linux-gnu/bin/ld: cannot find -ltermcap

Gentoo Linux doesn't include libtermcap, so special care should be taken to
ensure that our python ebuilds never are put in a situation where they will try
to link to libtermcap.  On initial inspection, it appears that configure,
configure.in, and setup.py are guilty of referring to libtermcap:

configure:LIBS="-lreadline -ltermcap $LIBS"
configure:LIBS="-lreadline -ltermcap $LIBS"
configure.in:   AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK), , -ltermcap)
configure.in:   AC_DEFINE(HAVE_RL_COMPLETION_MATCHES), , -ltermcap)
setup.py:                                               ['/usr/lib/termcap'],
setup.py:                                               'termcap'):
setup.py:                readline_libs.append('termcap')
setup.py:                                   library_dirs=['/usr/lib/termcap'],
setup.py:                curses_libs = ['curses', 'termcap']
Comment 1 Jon Nelson (RETIRED) 2002-07-01 19:16:16 UTC
AFAICT, the Python configure stuff does the "Right Thing" and there must be
something else going on here.  I merged readline 4.2a-something (whatever the
latest in the archive is) and go no problems in either configure or in building.


Note that the failure to find -ltermcap is the "right" thing there.
You can ignore the warnings below:


gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -I.
-I/home/jnelson/gentoo-x86/dev-lang/python/Python-2.2.1/./Include
-I/usr/local/include -IInclude/ -c
/home/jnelson/gentoo-x86/dev-lang/python/Python-2.2.1/Modules/readline.c -o
build/temp.linux-i686-2.2/readline.o
/home/jnelson/gentoo-x86/dev-lang/python/Python-2.2.1/Modules/readline.c: In
function `set_completer_delims':
/home/jnelson/gentoo-x86/dev-lang/python/Python-2.2.1/Modules/readline.c:278:
warning: passing arg 1 of `free' discards qualifiers from pointer target type
/home/jnelson/gentoo-x86/dev-lang/python/Python-2.2.1/Modules/readline.c: In
function `flex_complete':
/home/jnelson/gentoo-x86/dev-lang/python/Python-2.2.1/Modules/readline.c:498:
warning: implicit declaration of function `completion_matches'
/home/jnelson/gentoo-x86/dev-lang/python/Python-2.2.1/Modules/readline.c:498:
warning: return makes pointer from integer without a cast
gcc -shared build/temp.linux-i686-2.2/readline.o -L/usr/lib/termcap
-L/usr/local/lib -lreadline -lncurses -o build/lib.linux-i686-2.2/readline.so

The -L/usr/lib/termcap thing is harmless (same as the /usr/local/lib), and note
that it *does* use -lncurses as appropriate.

Can Azarah give me more info?
Comment 2 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-01 19:43:10 UTC
I must note that that failure was from the readline tests in the config.log.  THus
it was not python that failed to compile, but it does mean that readline support
for python do not get enabled.

Then, why is it the correct behaviour ?  If it requires termcap, I should think
that you either need libtermcap, or change it to use ncurses.
Comment 3 Jon Nelson (RETIRED) 2002-07-01 20:01:51 UTC
Are you *sure* readline support isn't compiled in?  It works properly for me,
despite the "no" (misleading) messages from configure.

Note that readline support is built as a module, so python itself shouldn't be
linked to readline, but 'import readline' should work.
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-07-02 14:10:23 UTC
Lets put it this way.  I know next to nothing about how python support
readline or ncurses, and if it uses it anyhow.  Daniel and I was just
trying to resolve a gcc-3.1 wierdness, and I noted that python does
not detect readline or ncurses.

So if you are 100% sure that this do not cause problems, fine by me.
Comment 5 Jon Nelson (RETIRED) 2002-07-02 20:28:17 UTC
I am not 100% sure.
Due to the way Python builds, if a user installs any one of a number of packages
in /usr/local and rebuilds they will get a python that is built differently than
those built on "pure" Gentoo machines.

That being said, yes.  I am sure that in this instance there is not a problem.
;-)