Building readline 4.3 on 10.2

  • Has anyone gotten this to work?  Make fails for me with a link error:

    /usr/bin/libtool -dynamic -arch_only `/usr/bin/arch` -install_name
    /usr/local/lib/libreadline.4.3.dylib -current_version 4.3
    -compatibility_version 4 -v -o libreadline.4.3.dylib readline.so vi_mode.so
    funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so
    isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so
    callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so
    histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so
    compat.so -lSystem
    + ld -arch ppc -dylib -dynamic -all_load -force_cpusubtype_ALL
    -no_arch_warnings -dylib_compatibility_version 4 -dylib_current_version 4.3
    -dylib_install_name /usr/local/lib/libreadline.4.3.dylib -ldylib1.o
    readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so
    complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so
    macro.so input.so callback.so terminal.so text.so nls.so misc.so xmalloc.so
    history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so
    tilde.so compat.so -lSystem -o libreadline.4.3.dylib
    ld: Undefined symbols:
    restFP
    saveFP
    _tgoto
    _tputs
    _tgetent
    _tgetflag
    _tgetnum
    _tgetstr
    /usr/bin/libtool: internal link edit command failed
    make[1]: *** [libreadline.4.3.dylib] Error 1
    make: [shared] Error 2 (ignored)

    I've searched the web and Usenet for a fix, but all I can find are vague
    hints about the unstable branch of Fink.  I don't want to use Fink, but I do
    want to build and install readline.  Any suggestions?

    -John
  • Try adding "-lncurses" to the link line.

    ber

    On Wednesday, October 2, 2002, at 01:06 PM, John Siracusa wrote:

    > Has anyone gotten this to work?  Make fails for me with a link error:
    >
    > /usr/bin/libtool -dynamic -arch_only `/usr/bin/arch` -install_name
    > /usr/local/lib/libreadline.4.3.dylib -current_version 4.3
    > -compatibility_version 4 -v -o libreadline.4.3.dylib readline.so
    > vi_mode.so
    > funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so
    > isearch.so display.so signals.so util.so kill.so undo.so macro.so
    > input.so
    > callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so
    > histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so
    > compat.so -lSystem
    > + ld -arch ppc -dylib -dynamic -all_load -force_cpusubtype_ALL
    > -no_arch_warnings -dylib_compatibility_version 4
    > -dylib_current_version 4.3
    > -dylib_install_name /usr/local/lib/libreadline.4.3.dylib -ldylib1.o
    > readline.so vi_mode.so funmap.so keymaps.so parens.so search.so
    > rltty.so
    > complete.so bind.so isearch.so display.so signals.so util.so kill.so
    > undo.so
    > macro.so input.so callback.so terminal.so text.so nls.so misc.so
    > xmalloc.so
    > history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so
    > tilde.so compat.so -lSystem -o libreadline.4.3.dylib
    > ld: Undefined symbols:
    > restFP
    > saveFP
    > _tgoto
    > _tputs
    > _tgetent
    > _tgetflag
    > _tgetnum
    > _tgetstr
    > /usr/bin/libtool: internal link edit command failed
    > make[1]: *** [libreadline.4.3.dylib] Error 1
    > make: [shared] Error 2 (ignored)
    >
    > I've searched the web and Usenet for a fix, but all I can find are
    > vague
    > hints about the unstable branch of Fink.  I don't want to use Fink,
    > but I do
    > want to build and install readline.  Any suggestions?
    >
    > -John
    >
    > _______________________________________________
    > MacOSX-dev mailing list
    > <MacOSX-dev...>
    > http://www.omnigroup.com/mailman/listinfo/macosx-dev
  • On 10/2/02 1:11 PM, Brian Redman wrote:
    > Try adding "-lncurses" to the link line.

    I added it to the LDFLAGS environment variable since there was no obvious
    place for it in the Makefile.  That didn't help, so I tried adding it to
    many different places in the Makefile.  But that didn't work either, so
    maybe I haven't found the right place to add it yet...

    -John
  • On 10/2/02 1:46 PM, Brian Redman wrote:
    > At least some of the variables your error message spits out are defined
    > in /usr/lib/libncurses.*.  I didn't check them all
    > but they look familiar.

    Yeah, a few look like curses symbols.

    > When you added -lncurses to LDFLAGS did it (-lncurses) show up in the
    > error output?  That would indicate at least
    > LDFLAGS was being used.

    No, it wasn't, but I did try this:

    > To test the theory that -lncurses is what you need I would grab a copy
    > of the link line and paste it into the Terminal and add
    > -lncurses befoe the "-o" at the end.

    And all I got were complaints about missing files, so I think I ran it in
    the wrong directory.

    I also tried this:

    http://mail.gnu.org/pipermail/bug-bash/2002-August/004991.html

    With no luck, but it led me to the file "support/shobj-conf" which has this
    in it:

        SHLIB_LIBS='-lSystem'

    which I changed to:

        SHLIB_LIBS='-lSystem -lncurses'

    That gave me this error:

    /usr/bin/libtool -dynamic -arch_only `/usr/bin/arch` -install_name
    /usr/local/lib/`echo libreadline.4.3.dylib | sed
    "s:\\(.*\\.[0-9]\\)\\.[0-9]:\\1:"` -current_version 4.3
    -compatibility_version 4 -v -o libreadline.4.3.dylib readline.so vi_mode.so
    funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so
    isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so
    callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so
    histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so
    compat.so -lSystem -lncurses
    + ld -arch ppc -dylib -dynamic -all_load -force_cpusubtype_ALL
    -no_arch_warnings -dylib_compatibility_version 4 -dylib_current_version 4.3
    -dylib_install_name /usr/local/lib/libreadline.4.dylib -ldylib1.o
    readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so
    complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so
    macro.so input.so callback.so terminal.so text.so nls.so misc.so xmalloc.so
    history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so
    tilde.so compat.so -lSystem -lncurses -o libreadline.4.3.dylib
    ld: warning multiple definitions of symbol _PC
    terminal.so definition of _PC in section (__DATA,__common)
    /usr/lib/libncurses.dylib(lib_tputs.o) definition of _PC
    ld: warning multiple definitions of symbol _BC
    terminal.so definition of _BC in section (__DATA,__common)
    /usr/lib/libncurses.dylib(lib_termcap.o) definition of _BC
    ld: warning multiple definitions of symbol _UP
    terminal.so definition of _UP in section (__DATA,__common)
    /usr/lib/libncurses.dylib(lib_termcap.o) definition of _UP
    ld: Undefined symbols:
    restFP
    saveFP
    /usr/bin/libtool: internal link edit command failed
    make[1]: *** [libreadline.4.3.dylib] Error 1
    make: [shared] Error 2 (ignored)

    Note that this is the patched version, plus my extra change.  Anyway, notice
    that the curses symbols are gone, but "restFP" and "saveFP" are still
    undefined.

    So I went back to the unpatched version, and added only my change that added
    -lncurses.  I got this very similar error:

    /usr/bin/libtool -dynamic -arch_only `/usr/bin/arch` -install_name
    /usr/local/lib/libreadline.4.3.dylib -current_version 4.3
    -compatibility_version 4 -v -o libreadline.4.3.dylib readline.so vi_mode.so
    funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so
    isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so
    callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so
    histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so
    compat.so -lSystem -lncurses
    + ld -arch ppc -dylib -dynamic -all_load -force_cpusubtype_ALL
    -no_arch_warnings -dylib_compatibility_version 4 -dylib_current_version 4.3
    -dylib_install_name /usr/local/lib/libreadline.4.3.dylib -ldylib1.o
    readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so
    complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so
    macro.so input.so callback.so terminal.so text.so nls.so misc.so xmalloc.so
    history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so
    tilde.so compat.so -lSystem -lncurses -o libreadline.4.3.dylib
    ld: warning multiple definitions of symbol _PC
    terminal.so definition of _PC in section (__DATA,__common)
    /usr/lib/libncurses.dylib(lib_tputs.o) definition of _PC
    ld: warning multiple definitions of symbol _BC
    terminal.so definition of _BC in section (__DATA,__common)
    /usr/lib/libncurses.dylib(lib_termcap.o) definition of _BC
    ld: warning multiple definitions of symbol _UP
    terminal.so definition of _UP in section (__DATA,__common)
    /usr/lib/libncurses.dylib(lib_termcap.o) definition of _UP
    ld: Undefined symbols:
    restFP
    saveFP
    /usr/bin/libtool: internal link edit command failed
    make[1]: *** [libreadline.4.3.dylib] Error 1
    make: [shared] Error 2 (ignored)

    > Can I grab a copy of readline 4.3 from the sameplace you got it (where
    > was that again?) and look at the problem?

    ftp://ftp.gnu.org/gnu/readline/readline-4.3.tar.gz

    Thanks for the help :)

    -John
  • Well, do you want to build it cleanly or just build it?

    I ended up taking the ld line it generated,  replacing the 'ld' with
    'cc' and adding -lncurses to resolve
    the readFP/saveFP symbols which seem to be defined everywhere in the
    system libraries.
    Run this from the shlib directory.  You'll get your warnings but I
    don't know their consequences.

    ber

    cc -ldylib1.o readline.so vi_mode.so funmap.so keymaps.so parens.so
    search.so rltty.so complete.so bind.so isearch.so display.so signals.so
    util.so kill.so undo.so macro.so input.so callback.so terminal.so
    text.so nls.so misc.so xmalloc.so history.so histexpand.so histfile.so
    histsearch.so shell.so mbutil.so tilde.so compat.so -lncurses -lSystem
    -o libreadline.4.3.dylib

    On Wednesday, October 2, 2002, at 02:05 PM, John Siracusa wrote:

    > On 10/2/02 1:46 PM, Brian Redman wrote:
    >> At least some of the variables your error message spits out are
    >> defined
    >> in /usr/lib/libncurses.*.  I didn't check them all
    >> but they look familiar.
    >
    > Yeah, a few look like curses symbols.
    >
    >> When you added -lncurses to LDFLAGS did it (-lncurses) show up in the
    >> error output?  That would indicate at least
    >> LDFLAGS was being used.
    >
    > No, it wasn't, but I did try this:
    >
    >> To test the theory that -lncurses is what you need I would grab a copy
    >> of the link line and paste it into the Terminal and add
    >> -lncurses befoe the "-o" at the end.
    >
    > And all I got were complaints about missing files, so I think I ran it
    > in
    > the wrong directory.
    >
    > I also tried this:
    >
    > http://mail.gnu.org/pipermail/bug-bash/2002-August/004991.html
    >
    > With no luck, but it led me to the file "support/shobj-conf" which has
    > this
    > in it:
    >
    > SHLIB_LIBS='-lSystem'
    >
    > which I changed to:
    >
    > SHLIB_LIBS='-lSystem -lncurses'
    >
    > That gave me this error:
    >
    > /usr/bin/libtool -dynamic -arch_only `/usr/bin/arch` -install_name
    > /usr/local/lib/`echo libreadline.4.3.dylib | sed
    > "s:\\(.*\\.[0-9]\\)\\.[0-9]:\\1:"` -current_version 4.3
    > -compatibility_version 4 -v -o libreadline.4.3.dylib readline.so
    > vi_mode.so
    > funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so
    > isearch.so display.so signals.so util.so kill.so undo.so macro.so
    > input.so
    > callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so
    > histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so
    > compat.so -lSystem -lncurses
    > + ld -arch ppc -dylib -dynamic -all_load -force_cpusubtype_ALL
    > -no_arch_warnings -dylib_compatibility_version 4
    > -dylib_current_version 4.3
    > -dylib_install_name /usr/local/lib/libreadline.4.dylib -ldylib1.o
    > readline.so vi_mode.so funmap.so keymaps.so parens.so search.so
    > rltty.so
    > complete.so bind.so isearch.so display.so signals.so util.so kill.so
    > undo.so
    > macro.so input.so callback.so terminal.so text.so nls.so misc.so
    > xmalloc.so
    > history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so
    > tilde.so compat.so -lSystem -lncurses -o libreadline.4.3.dylib
    > ld: warning multiple definitions of symbol _PC
    > terminal.so definition of _PC in section (__DATA,__common)
    > /usr/lib/libncurses.dylib(lib_tputs.o) definition of _PC
    > ld: warning multiple definitions of symbol _BC
    > terminal.so definition of _BC in section (__DATA,__common)
    > /usr/lib/libncurses.dylib(lib_termcap.o) definition of _BC
    > ld: warning multiple definitions of symbol _UP
    > terminal.so definition of _UP in section (__DATA,__common)
    > /usr/lib/libncurses.dylib(lib_termcap.o) definition of _UP
    > ld: Undefined symbols:
    > restFP
    > saveFP
    > /usr/bin/libtool: internal link edit command failed
    > make[1]: *** [libreadline.4.3.dylib] Error 1
    > make: [shared] Error 2 (ignored)
    >
    > Note that this is the patched version, plus my extra change.  Anyway,
    > notice
    > that the curses symbols are gone, but "restFP" and "saveFP" are still
    > undefined.
    >
    > So I went back to the unpatched version, and added only my change that
    > added
    > -lncurses.  I got this very similar error:
    >
    > /usr/bin/libtool -dynamic -arch_only `/usr/bin/arch` -install_name
    > /usr/local/lib/libreadline.4.3.dylib -current_version 4.3
    > -compatibility_version 4 -v -o libreadline.4.3.dylib readline.so
    > vi_mode.so
    > funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so
    > isearch.so display.so signals.so util.so kill.so undo.so macro.so
    > input.so
    > callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so
    > histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so
    > compat.so -lSystem -lncurses
    > + ld -arch ppc -dylib -dynamic -all_load -force_cpusubtype_ALL
    > -no_arch_warnings -dylib_compatibility_version 4
    > -dylib_current_version 4.3
    > -dylib_install_name /usr/local/lib/libreadline.4.3.dylib -ldylib1.o
    > readline.so vi_mode.so funmap.so keymaps.so parens.so search.so
    > rltty.so
    > complete.so bind.so isearch.so display.so signals.so util.so kill.so
    > undo.so
    > macro.so input.so callback.so terminal.so text.so nls.so misc.so
    > xmalloc.so
    > history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so
    > tilde.so compat.so -lSystem -lncurses -o libreadline.4.3.dylib
    > ld: warning multiple definitions of symbol _PC
    > terminal.so definition of _PC in section (__DATA,__common)
    > /usr/lib/libncurses.dylib(lib_tputs.o) definition of _PC
    > ld: warning multiple definitions of symbol _BC
    > terminal.so definition of _BC in section (__DATA,__common)
    > /usr/lib/libncurses.dylib(lib_termcap.o) definition of _BC
    > ld: warning multiple definitions of symbol _UP
    > terminal.so definition of _UP in section (__DATA,__common)
    > /usr/lib/libncurses.dylib(lib_termcap.o) definition of _UP
    > ld: Undefined symbols:
    > restFP
    > saveFP
    > /usr/bin/libtool: internal link edit command failed
    > make[1]: *** [libreadline.4.3.dylib] Error 1
    > make: [shared] Error 2 (ignored)
    >
    >> Can I grab a copy of readline 4.3 from the sameplace you got it (where
    >> was that again?) and look at the problem?
    >
    > ftp://ftp.gnu.org/gnu/readline/readline-4.3.tar.gz
    >
    > Thanks for the help :)
    >
    > -John
    >
    > _______________________________________________
    > MacOSX-dev mailing list
    > <MacOSX-dev...>
    > http://www.omnigroup.com/mailman/listinfo/macosx-dev
  • Sorry, I'm thrashing.  My hack isn't effective for a lot of reasons.
    Never mind...

    ber
  • I found this in the unix-porting list.  It seems to advance the cause.
    I should have looked there 2 hours ago.
    This deals with the restFP/saveFP symbols.  google failed me.  I'm hurt.

    ber

    You need to add -lcc_dynamic to list of libs linked.
  • On 10/2/02 3:59 PM, Brian Redman wrote:
    > I found this in the unix-porting list.  It seems to advance the cause.  I
    > should have looked there 2 hours ago. This deals with the restFP/saveFP
    > symbols.  google failed me.  I'm hurt.

    Yeah, I was only searching google too...*sigh*

    > You need to add -lcc_dynamic to list of libs linked.

    I think I'll post a summary that in the hopes that google will pick up it up
    for "future generations" ;)

    Building GNU readline 4.3 on Mac OS X 10.2 Jaguar while avoiding libtool
    linking errors:

    1. Download and expand readline 4.3:

          wget ftp://ftp.gnu.org/gnu/readline/readline-4.3.tar.gz
          tar -xzf readline-4.3.tar.gz
          cd readline-4.3

    2. Edit the file "support/shobj-conf" in the "readline-4.3" dir and
      change line 151 from this:

          SHLIB_LIBS='-lSystem'

      to this:

          SHLIB_LIBS='-lSystem -lncurses -lcc_dynamic'

    3.  Build as usual:

          ./configure
          make
          make install

    Thanks for the help! :)

    -John
  • On Wednesday, October 2, 2002, at 10:20  pm, John Siracusa wrote:

    > 2. Edit the file "support/shobj-conf" in the "readline-4.3" dir and
    > change line 151 from this:
    >
    > SHLIB_LIBS='-lSystem'
    >
    > to this:
    >
    > SHLIB_LIBS='-lSystem -lncurses -lcc_dynamic'

    -lSystem is implied (everything links against it unless you jump
    through hoops) and does not need to be specified.

      -- Finlay
  • When I tried it without -lSystem I got illegal reference errors for
    internal variables.
    Did it build for you?

    ber

    On Wednesday, October 2, 2002, at 05:30 PM, Finlay Dobbie wrote:

    >
    > On Wednesday, October 2, 2002, at 10:20  pm, John Siracusa wrote:
    >
    >> 2. Edit the file "support/shobj-conf" in the "readline-4.3" dir and
    >> change line 151 from this:
    >>
    >> SHLIB_LIBS='-lSystem'
    >>
    >> to this:
    >>
    >> SHLIB_LIBS='-lSystem -lncurses -lcc_dynamic'
    >
    > -lSystem is implied (everything links against it unless you jump
    > through hoops) and does not need to be specified.
    >
    > -- Finlay
    >
    > _______________________________________________
    > MacOSX-dev mailing list
    > <MacOSX-dev...>
    > http://www.omnigroup.com/mailman/listinfo/macosx-dev
  • Probably due to linking with "ld" instead of "cc" that you are supposed
    to use. (or "c++" for c++)

    By the way, even if you don't want to use fink, you can always look at
    Fink CVS to see how it is being built:

    readline is at:
    http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/fink/dists/10.2/
    unstable/main/finkinfo/libs/

    scroll down to readline.info and .patch. The .info format is simple
    enough to figure out, if there is something complicated you can look at
    the fink packaging manual for reference.

    -Ben

    On Wednesday, October 2, 2002, at 02:58  PM, Brian Redman wrote:

    > When I tried it without -lSystem I got illegal reference errors for
    > internal variables.
    > Did it build for you?
    >
    > ber
    >
    > On Wednesday, October 2, 2002, at 05:30 PM, Finlay Dobbie wrote:
    >
    >>
    >> On Wednesday, October 2, 2002, at 10:20  pm, John Siracusa wrote:
    >>
    >>> 2. Edit the file "support/shobj-conf" in the "readline-4.3" dir and
    >>> change line 151 from this:
    >>>
    >>> SHLIB_LIBS='-lSystem'
    >>>
    >>> to this:
    >>>
    >>> SHLIB_LIBS='-lSystem -lncurses -lcc_dynamic'
    >>
    >> -lSystem is implied (everything links against it unless you jump
    >> through hoops) and does not need to be specified.
    >>
    >> -- Finlay
    >>
    >> _______________________________________________
    >> MacOSX-dev mailing list
    >> <MacOSX-dev...>
    >> http://www.omnigroup.com/mailman/listinfo/macosx-dev
    >
    > _______________________________________________
    > MacOSX-dev mailing list
    > <MacOSX-dev...>
    > http://www.omnigroup.com/mailman/listinfo/macosx-dev
    >
previous month october 2002 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today