By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,767 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,767 IT Pros & Developers. It's quick & easy.

How to statically link Python with ncurses and readline?

P: n/a
Hi
I'm trying to build a Python package that I can use on different Linux
setups, for this purpose it would be nice to weld external dependencies
(libraries) into Python itself. So far I've succeeded in getting Tcl/Tk
statically linked in, with the help of Modules/Setup.local, but the
same procedure for ncurses and readline results in python being
dynamically linked with these two libraries?? That is, there are no
longer any readline.so or _curses.so in lib-dynload, but instead they
are added to Python's shared library dependencies. Any clue as to
what's going on here would be much appreciated.

Arve

Oct 25 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
ar**********@gmail.com wrote:
That is, there are no longer any readline.so or _curses.so in lib-dynload,
but instead they are added to Python's shared library dependencies.
What is "they" in that sentence? readline.so and _curses.so? I very much
doubt that - more likely, libreadline.so and libncurses.so are in
the dependencies
Any clue as to what's going on here would be much appreciated.


Instead of linking with -lncurses, link explicitly with
/usr/lib/libncurses.a; or else using -static as a linker flag.

Regards,
Martin
Oct 25 '05 #2

P: n/a
Well, I implied that _curses.so and readline.so disappeared as one
would expect, dependencies on libncurses.so and libreadline.so instead
showing up in Python itself. It's very strange that this happens with
ncurses and readline, when both db and Tcl/Tk got linked in with no
fuss. Anyway, I built static-only (.a) versions of readline and
ncurses, which did the trick.

Arve

Oct 25 '05 #3

P: n/a
ar**********@gmail.com wrote:
Well, I implied that _curses.so and readline.so disappeared as one
would expect, dependencies on libncurses.so and libreadline.so instead
showing up in Python itself. It's very strange that this happens with
ncurses and readline, when both db and Tcl/Tk got linked in with no
fuss. Anyway, I built static-only (.a) versions of readline and
ncurses, which did the trick.


Ah, you didn't *have* static versions of readline and ncurses...
So how should it possibly have linked those libraries statically???

Regards,
Martin
Oct 25 '05 #4

P: n/a
What do you mean? A static-only build does somehow exclude that I had
static libraries before?

Oct 25 '05 #5

P: n/a
ar**********@gmail.com wrote:
What do you mean? A static-only build does somehow exclude that I had
static libraries before?


No, it doesn't. I misunderstood. It is quite unclear still what you had
been doing: e.g. did you have shared versions of db and Tcl or not?
Did you have linker scripts in place? What was your specific command
line you have used to link the entire interpreter?

In the absence of details, we have to take guesses on Usenet. Sometimes,
the guesses are right, and sometimes they are wrong.

Regards,
Martin
Oct 26 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.