How to statically link Python with ncurses and readline?

Discussion in 'Python' started by arve.knudsen@gmail.com, Oct 25, 2005.

  1. Guest

    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, 2005
    #1
    1. Advertising

  2. 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
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Oct 25, 2005
    #2
    1. Advertising

  3. Guest

    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, 2005
    #3
  4. 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
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Oct 25, 2005
    #4
  5. Guest

    What do you mean? A static-only build does somehow exclude that I had
    static libraries before?
    , Oct 25, 2005
    #5
  6. 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
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Oct 26, 2005
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. lnatz

    history+readline+ncurses

    lnatz, Feb 8, 2007, in forum: C Programming
    Replies:
    25
    Views:
    1,074
    Keith Thompson
    Feb 21, 2007
  2. gavino
    Replies:
    4
    Views:
    535
    gavino
    Sep 20, 2010
  3. Jean-Michel
    Replies:
    0
    Views:
    359
    Jean-Michel
    Dec 22, 2007
  4. Kenneth McDonald
    Replies:
    1
    Views:
    150
    Nit Khair
    Sep 27, 2008
  5. Andrew DeFaria
    Replies:
    1
    Views:
    208
    Ben Morrow
    Jan 30, 2008
Loading...

Share This Page