# Building Ruby on HPUX + readline support

**URL:** <https://www.ruby-forum.com/t/building-ruby-on-hpux-readline-support/117502>\
**Category:** Ruby\
**Created:** [October 17, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/building-ruby-on-hpux-readline-support/117502 "2007-10-17T15:08:16Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![stuart\_holden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7993a0/32.png) [@stuart\_holden](https://www.ruby-forum.com/u/stuart_holden)\
**Post date:** [October 17, 2007, 3:08pm UTC](https://www.ruby-forum.com/t/building-ruby-on-hpux-readline-support/117502/1 "2007-10-17T15:08:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![stuart\_holden](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/7993a0/32.png) [@stuart\_holden](https://www.ruby-forum.com/u/stuart_holden)\
**Post date:** [October 17, 2007, 6:35pm UTC](https://www.ruby-forum.com/t/building-ruby-on-hpux-readline-support/117502/2 "2007-10-17T18:35:25Z")

</div>

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/
