How to statically link Python with ncurses and readline?

A

arve.knudsen

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
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

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
 
A

arve.knudsen

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
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

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
 
A

arve.knudsen

What do you mean? A static-only build does somehow exclude that I had
static libraries before?
 
?

=?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top