Operating System - HP-UX
1745796 Members
3643 Online
108722 Solutions
New Discussion юеВ

Has anyone successfully compiled Ruby on HP-UX?

 
SOLVED
Go to solution
Ralph Grothe
Honored Contributor

Has anyone successfully compiled Ruby on HP-UX?

I wish to get Ruby on HP-UX.
I searched at software.hp.com but got no hit.
The version packaged on HP Porters is a bit dated, and since it relies on many libs (like openssl) which probably are 32Bit gcc compiles it won't link with HP's OpenSSL depot.
So I currently try to make it on B.11.11 with ansic, but as usual, got choked at openssl parts.
As I wish to use Rails or other web modules I hardly can do without OpenSSL for I need to run SSL connections as well.

I had a look at the very terse README from the ruby tarball and ran configure --help, to be very surprised how few fiddle switches were proposed unlike with Perl builds.
So I merely invoked configure like this to point to HP's openssl install target:

LDDFLAGS="-L/opt/openssl" CPPFLAGS="-I/opt/openssl/include/openssl" ./configure

A make aborts at this point when compiling
ossl_config.c:

/opt/ansic/bin/cc -I. -I../.. -I../../. -I../.././ext/openssl -DRUBY_EXTCONF_H=\"extconf.h\" -I/opt/openssl/include/openssl +Z -g -c ossl_config.c
cc: "ossl_config.c", line 248: error 1521: Incorrect initialization.
cc: "ossl_config.c", line 248: error 1521: Incorrect initialization.
cc: "ossl_config.c", line 300: warning 558: Empty declaration.
cc: "ossl_config.c", line 338: warning 558: Empty declaration.
cc: "ossl_config.c", line 382: warning 558: Empty declaration.
gmake[1]: *** [ossl_config.o] Error 1
gmake[1]: Leaving directory `/usr/local/tmp/ruby-1.8.6/ext/openssl'
gmake: *** [all] Error 1
Madness, thy name is system administration
15 REPLIES 15
Dennis Handly
Acclaimed Contributor

Re: Has anyone successfully compiled Ruby on HP-UX?

You might want to show the lines with the above errors so we can give you a hint what should be done to correct them.

C89 doesn't allow you to initialize locals with non-constants, within {}.
Ralph Grothe
Honored Contributor

Re: Has anyone successfully compiled Ruby on HP-UX?

Hi Dennis,

you're probably right.
This is the offending block with a maybe past C89 liberal array declaration in line 248?

245 static VALUE
246 ossl_config_set_section(VALUE self, VALUE section, VALUE hash)
247 {
248 VALUE arg[2] = { self, section };
249 rb_iterate(rb_each, hash, set_conf_section_i, (VALUE)arg);
250 return hash;
251 }
Madness, thy name is system administration
Dennis Handly
Acclaimed Contributor
Solution

Re: Has anyone successfully compiled Ruby on HP-UX?

>This is the offending block with a maybe past C89 liberal array declaration in line 248?

Right. This is legal C99 or C++ but not C89.
Just change it into two assignments to the array elements.

I'm not sure what the array cast to array element is suppose to do on 249:
(VALUE)arg

It would be valid if VALUE was void*.
Luk Vandenbussche
Honored Contributor

Re: Has anyone successfully compiled Ruby on HP-UX?

Ralph Grothe
Honored Contributor

Re: Has anyone successfully compiled Ruby on HP-UX?

You mean like so?

246 ossl_config_set_section(VALUE self, VALUE section, VALUE hash)
247 {
248 VALUE arg[2];
249 arg = { self, section };
250 rb_iterate(rb_each, hash, set_conf_section_i, (VALUE)arg);
251 return hash;
252 }



I'm also puzzled by the typecast to VALUE of the last param in the rb_iterate call.
Alas, I'm no C hacker.
Madness, thy name is system administration
Dennis Handly
Acclaimed Contributor

Re: Has anyone successfully compiled Ruby on HP-UX?

No, like:
248 VALUE arg[2];
249 arg[0] = self;
250 arg[1] = section;

>I'm also puzzled by the typecast to VALUE of the last parm in the rb_iterate call.

Well, no C warning so it must not be too bad.
Ralph Grothe
Honored Contributor

Re: Has anyone successfully compiled Ruby on HP-UX?

Nope, I think I need to lookup C basics,
how to assign array elems ;-)

cc: "ossl_config.c", line 249: error 1000: Unexpected symbol: "{".
cc: "ossl_config.c", line 249: error 1000: Unexpected symbol: "}".
cc: "ossl_config.c", line 249: error 1549: Modifiable lvalue required for assignment operator.


I bet this is fool proof though awkward?

arg[0] = self;
arg[1] = section;

Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: Has anyone successfully compiled Ruby on HP-UX?

Wow, single elem assignment worked :-)
Now make is progressing...
And even finished without errors and zero exit code.

Many thanks for your instant help.
You saved my day.

Just out of curiosity,
does C89 allow multiple array elem assignment with curly braces at all?


Madness, thy name is system administration
Ralph Grothe
Honored Contributor

Re: Has anyone successfully compiled Ruby on HP-UX?

Such a silly nonenty, such an effect.

# make install
./miniruby ./instruby.rb --dest-dir="" --extout=".ext" --make="/usr/local/bin/gmake" --mflags="" --make-flags="" --installed-list .installed.list --mantype="man"
installing binary commands
installing command scripts
installing library scripts
installing headers
installing manpages
installing extension objects
installing extension scripts

# which ruby
/usr/local/bin/ruby

# ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [hppa2.0w-hpux11.11]
Madness, thy name is system administration