[Tutor] RE: recompiling with readline
Kalle Svensson
kalle@gnupung.net
Fri, 20 Apr 2001 20:09:04 +0200
Sez Jonathan Soons:
>
> I cannot make Python2.0 recompile with readline enabled in Modules/Setup.
> It may have been a mistake to install readline if the source comes with
> Python2.0.
> Maybe that's the conflict???
No, I don't think there is any readline code in the Python dist.
> Here is the line from Setup:
> readline readline.c -lreadline -ltermcap
>
> Here is the error:
>
> make[1]: Leaving directory `/usr/share/src/Python-2.0/Python'
> cd Modules ; make OPT="-g -O2 -Wall -Wstrict-prototypes" VERSION="2.0" \
> prefix="/usr/local" exec_prefix="/usr/local" all
> make[1]: Entering directory `/usr/share/src/Python-2.0/Modules'
> gcc -g -O2 -Wall -Wstrict-prototypes -I./../Include -I.. -DHAVE_CONFIG_H -c
> ./readline.c
> ./readline.c:31: conflicting types for `rl_read_init_file'
> /usr/local/include/readline/readline.h:303: previous declaration of
> `rl_read_init_file'
> ./readline.c:32: conflicting types for `rl_insert_text'
> /usr/local/include/readline/readline.h:363: previous declaration of
> `rl_insert_text'
[snip]
Aha! You use readline 4.2, right?
A CVS commit on Fri Apr 13 18:14:27 2001 UTC has the following log entry:
"""
Clean up the unsightly mess around the readline header files. We now
always:
- #undef HAVE_CONFIG_H (because otherwise chardefs.h tries to include
strings.h)
- #include readline.h and history.h
and we never declare any readline function prototypes ourselves.
This makes it compile with readline 4.2, albeit with a few warnings.
Some of the remaining warnings are about completion_matches(), which
is renamed to rl_completion_matches().
I've tested it with various other versions, from 2.0 up, and they all
seem to work (some with warnings) -- but only on Red Hat Linux 6.2.
Fixing the warnings for readline 4.2 would break compatibility with
3.0 (and maybe even earlier versions), and readline doesn't seem to
have a way to test for its version at compile time, so I'd rather
leave the warnings in than break compilation with older versions.
"""
This probably means you have to downgrade readline to 3.x or upgrade Python
to 2.1. I suggest upgrading Python...
Peace,
Kalle
--
Email: kalle@gnupung.net | You can tune a filesystem, but you
Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
PGP fingerprint: 0C56 B171 8159 327F 1824 F5DE 74D7 80D7 BF3B B1DD
[ Not signed due to lossage. Blame Microsoft Outlook Express. ]