Require socket - standalone file?

Does such a statement imply that a file ‘socket.rb’ must exist ?

We are trying to build ruby on QNX4 4.24 but don’t get a file ‘socket.rb’.
We linked statically (required for QNX4) so the socket library is included
in the executable ‘ruby’ along with adding ‘Init_socket()’ to inits.c. No
joy running ruby code with the above statement.

./ext/extinit.c also seems to need addition of 'rb_provide( socket.so );'
but we cannot do dynamic loading. Are we __ out of luck ?

Ron

BTW: -----------------------------------

Ruby extconf.rb gives us on stdout:

checking for t_open() in -lnsl… no

checking for socket() in -lsocket… checking for netinet/tcp.h… yes

checking for netinet/udp.h… checking for inet_ntop()… no

checking for inet_ntoa()… no

checking for inet_pton()… no

checking for inet_aton()… no

checking for getservbyport()… no

checking for arpa/inet.h… yes

checking for arpa/nameser.h… yes

checking for resolv.h… checking for sys/un.h… yes

checking for socket()… no

Does such a statement imply that a file 'socket.rb' must exist ?

No,

./ext/extinit.c also seems to need addition of 'rb_provide( socket.so );'
but we cannot do dynamic loading. Are we __ out of luck ?

If you compile statically ruby and ruby *can build* the module socket it
will add automatically the lines

        Init_socket();
        rb_provide("socket.so");

in ext/extinit.c

This is these lines which make the line 'require "socket"' work even if
you don't have dynamic loading (i.e. in this case ruby will not use
dynamic loading for the module socket).

Apparently, in your case, ruby *can't* build the module socket, because it
give the message

checking for socket()... no

   ^^^^^^^^^^^^^^^^^^^^^^^^^^^

At this step the module socket was not build and not statically linked
with ruby, this is why socket is not available

To make it work, ruby must be able to compile this extension.

Guy Decoux