Building Ruby on HPUX + readline support

Discussion in 'Ruby' started by Stuart Holden, Oct 17, 2007.

  1. Hi,

    I have successfully managed to build Ruby 1.8.6 on HP-UX, but when using
    irb it crashes when the cursor keys or escape keys are used. I believe
    that I need to rebuild Ruby with readline support enabled. In order to
    do this, I downloaded the gnu readline source and built and installed
    that to $HOME/lib (I don't have access to write to /usr/lib):

    export CC="cc –Ae"
    /configure --prefix=$HOME
    make
    make install



    This worked fine. Next, I configured the build process to include
    readline support:


    export CC="cc -Ae"
    /configure --prefix=/home/host/ruby-1.8.6 --with-readline-dir=$HOME

    Then ran make. It when compiling readline failed with the following
    error:

    compiling readline

    cc -Ae -I. -I../.. -I../../. -I../.././ext/readline
    -DHAVE_READLINE_READLINE_H -DHAVE_READLINE_HISTORY_H
    -DHAVE_RL_FILENAME_COMPLETION_FUNCTION
    -DHAVE_RL_USERNAME_COMPLETION_FUNCTION -DHAVE_RL_COMPLETION_MATCHES
    -DHAVE_RL_DEPREP_TERM_FUNCTION -DHAVE_RL_COMPLETION_APPEND_CHARACTER
    -DHAVE_RL_BASIC_WORD_BREAK_CHARACTERS
    -DHAVE_RL_COMPLETER_WORD_BREAK_CHARACTERS
    -DHAVE_RL_BASIC_QUOTE_CHARACTERS -DHAVE_RL_COMPLETER_QUOTE_CHARACTERS
    -DHAVE_RL_FILENAME_QUOTE_CHARACTERS -DHAVE_RL_ATTEMPTED_COMPLETION_OVER
    -DHAVE_RL_LIBRARY_VERSION -DHAVE_RL_EVENT_HOOK
    -DHAVE_RL_CLEANUP_AFTER_SIGNAL -DHAVE_RL_CLEAR_SIGNALS
    -DHAVE_RL_VI_EDITING_MODE -DHAVE_RL_EMACS_EDITING_MODE
    -DHAVE_RL_CLEAR_SIGNALS -DHAVE_REPLACE_HISTORY_ENTRY
    -DHAVE_REMOVE_HISTORY -I/home/host/include +Z -g -c readline.c

    ld -b -E -L"../.." -L"/home/host/lib" -o
    ../../.ext/hppa2.0w-hpux11.11/readline.sl readline.o -lreadline
    -ltermcap -ldld -lcrypt -lm -lc

    ld: Invalid loader fixup in text space needed in output file for symbol
    "$00000035" in input file: "/home/host/lib/libreadline.a(bind.o)". Make
    sure it was compiled with +z/+Z.

    *** Error exit code 1



    Stop.

    *** Error exit code 1



    Taking the advice, I rebuilt readline using the +Z flag:



    export CC="cc –Ae +Z"
    /configure --prefix=$HOME
    make
    make install


    Again, this worked. So I tried to build ruby again



    export CC="cc -Ae +Z"
    /configure --prefix=/home/host/ruby-1.8.6 --with-readline-dir=$HOME



    This time, similar error, but complaining about /usr/lib/libtermcap.a.



    compiling readline

    ld -b -E -L"../.." -L"/home/host/lib" -o
    ../../.ext/hppa2.0w-hpux11.11/readline.sl readline.o -lreadline
    -ltermcap -ldld -lcrypt -lm -lc

    ld: Invalid loader fixup in text space needed in output file for symbol
    "$00000008" in input file: "/usr/lib/libtermcap.a(tparm.o)". Make sure
    it was compiled with +z/+Z.

    *** Error exit code 1



    Stop.

    *** Error exit code 1



    Stop.



    Unfortunately I do not have access to /usr/lib/libtermcap.a and can't
    rebuild it.

    Can anybody offer any advice? Am I on the right track in thinking that
    the IRB problems are to do with readline support, or have I gone about
    this completely wrong?

    Thanks,
    Stu
    --
    Posted via http://www.ruby-forum.com/.
     
    Stuart Holden, Oct 17, 2007
    #1
    1. Advertising

  2. For what it's worth, I found some threads that discussed building Ruby
    and then applying ReadLine afterwards, though it doesn't seem to do
    anything for me...

    host@titan:/home/host/ruby-1.8.6-src/ruby-1.8.6/ cd ext/readline
    host@titan:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ ruby
    extconf.rb
    checking for tgetnum() in -lncurses... no
    checking for tgetnum() in -ltermcap... yes
    checking for readline/readline.h... no
    checking for editline/readline.h... no
    host@titan:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ make
    host@titan:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ make
    clean
    host@titan:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ make
    host@titan:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ make
    install
    host@titan:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ ll -rt
    total 400
    -rw-r--r-- 1 host staff 79 Feb 12 2007 depend
    -rw-r--r-- 1 host staff 1162 Feb 12 2007 README
    -rw-r--r-- 1 host staff 20738 Feb 12 2007 readline.c
    -rw-r--r-- 1 host staff 1233 Feb 12 2007 README.ja
    -rw-r--r-- 1 host staff 1993 Feb 12 2007 extconf.rb
    -rw-rw-r-- 1 host staff 130412 Oct 17 12:34 readline.o
    -rw-rw-r-- 1 host staff 1988 Oct 17 12:58 Makefile
    -rw-rw-r-- 1 host staff 2885 Oct 17 17:28 mkmf.log
    host@titan:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/
     
    Stuart Holden, Oct 17, 2007
    #2
    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. Richard Patterson

    building 2.4.1 on HPUX

    Richard Patterson, Jun 28, 2005, in forum: Python
    Replies:
    1
    Views:
    369
    Richard Patterson
    Jun 30, 2005
  2. gavino
    Replies:
    4
    Views:
    541
    gavino
    Sep 20, 2010
  3. Alexey Verkhovsky
    Replies:
    2
    Views:
    192
    Austin Ziegler
    Jul 30, 2004
  4. nesius
    Replies:
    0
    Views:
    93
    nesius
    Aug 30, 2004
  5. Yuri Kozlov

    Building ruby on hpux

    Yuri Kozlov, Jul 11, 2005, in forum: Ruby
    Replies:
    2
    Views:
    112
    Yuri Kozlov
    Jul 12, 2005
Loading...

Share This Page