# Failure trying to build Ruby 1.8.6 on HP-UX 11

**URL:** <https://www.ruby-forum.com/t/failure-trying-to-build-ruby-1-8-6-on-hp-ux-11/112652>\
**Category:** Ruby\
**Created:** [August 21, 2007, 8:48pm UTC](https://www.ruby-forum.com/t/failure-trying-to-build-ruby-1-8-6-on-hp-ux-11/112652 "2007-08-21T20:48:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [August 21, 2007, 8:48pm UTC](https://www.ruby-forum.com/t/failure-trying-to-build-ruby-1-8-6-on-hp-ux-11/112652/1 "2007-08-21T20:48:39Z")

</div>

Hi all,

djberge@td191\> uname -a  
HP-UX td191 B.11.31 U 9000/800 3397116299 unlimited-user license

djberge@td191\> what `which cc`  
/usr/bin/cc:  
$Revision: 92453-07 linker linker crt0.o B.11.53 060807 $  
LINT B.11.X.36086-36089-36092.GP CXREF B.11.X.  
36086-36089-36092.GP  
HP92453-01 B.11.X.36086-36089-36092.GP HP C Compiler  
$ PATCH/11.00:PHCO\_27774 Oct 3 2002 09:45:59 $

djberge@td191\> echo $CC  
cc -Ae -s

When I try to build Ruby 1.8.6 I get this:

cc -Ae -s -DRUBY\_EXPORT -DYYMAXDEPTH=300 -I. -I. -c parse.c  
cc: “parse.y”, line 4446: warning 527: Integral value implicitly  
converted to pointer in assignment.  
cc: “parse.y”, line 4449: error 1530: Undefined struct or union.  
cc: “parse.y”, line 4451: error 1530: Undefined struct or union.  
cc: “parse.y”, line 4451: warning 563: Argument #1 is not the correct  
type.  
cc: “parse.y”, line 4452: error 1530: Undefined struct or union.  
cc: “parse.y”, line 4454: error 1530: Undefined struct or union.  
cc: “parse.y”, line 4454: error 1563: Expression in if must be scalar.  
cc: “parse.y”, line 4464: error 1530: Undefined struct or union.  
cc: “parse.y”, line 4466: error 1530: Undefined struct or union.  
cc: “parse.y”, line 4466: error 1530: Undefined struct or union.  
cc: “parse.y”, line 4466: error 1563: Expression in if must be scalar.  
cc: “parse.y”, line 4468: error 1530: Undefined struct or union.  
\*\*\* Error exit code 1

I see from older posts (including one of my own) that others have had  
this problem. The old solution of sticking “#define inline” in  
config.h did not work, though.

Any ideas?

BTW, you can get access to HP-UX (and OpenVMS, Linux, Windows 2003  
Server and FreeBSD 6.2) via the HP testdrive program at  
[http://www.testdrive.hp.com](http://www.testdrive.hp.com)  
(which is what I’m using in an attempt to get some platform info for  
rubygems).

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [August 21, 2007, 9:01pm UTC](https://www.ruby-forum.com/t/failure-trying-to-build-ruby-1-8-6-on-hp-ux-11/112652/2 "2007-08-21T21:01:41Z")

</div>

If I rememeber correctly from my own attempts to build Ruby on  
HP-UX, one of the issues is that HP’s make is broken and  
incorrectly thinks parse.y is out of date, trying to regenerate it  
with HP’s yacc, which is also broken.

Things generally get much better if you use the GNU toolchain (make,  
bison, gcc) rather than HP’s. But note that you’ll still need to  
disable IPv6 support or else the socket library won’t actually work  
(because HP’s IPv6 support is broken).

Also, make sure that the linker patches are up-to-date, or you may  
run into linker issues down the road.

-mental

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [August 21, 2007, 9:03pm UTC](https://www.ruby-forum.com/t/failure-trying-to-build-ruby-1-8-6-on-hp-ux-11/112652/3 "2007-08-21T21:03:41Z")

</div>

On Aug 21, 12:46 pm, Daniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> ```
> HP92453-01 B.11.X.36086-36089-36092.GP HP C Compiler
> $ PATCH/11.00:PHCO_27774 Oct 3 2002 09:45:59 $
> 
> ```
> 
> djberge@td191\> echo $CC  
> cc -Ae -s
> 
> When I try to build Ruby 1.8.6 I get this:

Ok, the problem went away when I installed gperf. The only other  
quirks I noticed is that you have to run make twice - the first one  
fails, but then the second works - and that ext/curses may cause the  
build to fail. I simply removed ext/curses altogether, but I think  
older posts have better soltuions.

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [August 21, 2007, 9:07pm UTC](https://www.ruby-forum.com/t/failure-trying-to-build-ruby-1-8-6-on-hp-ux-11/112652/4 "2007-08-21T21:07:42Z")

</div>

I am guessing that cc doesn’t integrate directoy with yacc/flex/bison/  
etc. parse.y isn’t C code.

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [August 22, 2007, 1:58am UTC](https://www.ruby-forum.com/t/failure-trying-to-build-ruby-1-8-6-on-hp-ux-11/112652/5 "2007-08-22T01:58:11Z")

</div>

MenTaLguY wrote:

> If I rememeber correctly from my own attempts to build Ruby on  
> HP-UX, one of the issues is that HP’s make is broken and  
> incorrectly thinks parse.y is out of date, trying to regenerate it  
> with HP’s yacc, which is also broken.

There’s definitely something odd going on, but I managed to build and  
install gperf, which solved it.

> Things generally get much better if you use the GNU toolchain (make,  
> bison, gcc) rather than HP’s. But note that you’ll still need to  
> disable IPv6 support or else the socket library won’t actually work  
> (because HP’s IPv6 support is broken).

Yes, I can’t say I’m too impressed with the HP-UX libraries or  
toolchain. Unfortunately, we do have a couple of HP-UX machines at work,  
so I still like to support it when I can.

> Also, make sure that the linker patches are up-to-date, or you may  
> run into linker issues down the road.

I hit one already trying to build zlib. ☹

Thanks,

Dan
