Building Ruby on HPUX + readline support

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

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…

[email protected]:/home/host/ruby-1.8.6-src/ruby-1.8.6/ cd ext/readline
[email protected]:/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
[email protected]:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ make
[email protected]:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ make
clean
[email protected]:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ make
[email protected]:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/ make
install
[email protected]:/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
[email protected]:/home/host/ruby-1.8.6-src/ruby-1.8.6/ext/readline/

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs