Hi,
  Being new here, I hope I'm going about the things the right way...

I've been working to get Ruby 1.8.7 running fully under BeOS, and everything
seems to be there now (though I haven't done "make test-all" yet).

I'm attaching the patches that were necessary.  These are only to the
BeOS conditional sections of some of the files, so I hope they can be
merged without difficulty.  Most of the changes are to make Ruby
compatible with the newer networking environment ("BONE"); this is
much more *nix-like than the older "net-server".  The system should
still compile for the older environment, but I can't easily check that
at the moment.

A fully-featured Ruby does depend on some libraries -- like 'readline' --
that are not distributed with the basic BeOS (but are easily obtainable).
To the extent I've been able to test, Ruby will still run if they're
absent, but of course relevant features -- e.g. history in the case of
readline -- won't be present.

There are a couple of other concerns that I wan't sure of the best way
to handle.  In particular, the i586 version needs a 'phony library'
specifically labelled "_APP_" to be present as a symbolic link to
miniruby, for dynamic libraries to be able to link back to symbols
in the main program.  At present I've simply added this in directly
(at the top of the tree), but it would be nice if somewhere in the
configure process this could be done automatically.  I'm not sure
where or how, though.  Any suggestions?

Secondly, the 'configure' command line still needs a couple of
arguments:

 ./configure --prefix=/boot/home/config CPPFLAGS="-DBONE"

The last is obviously to specify the correct networking environment.
I could have made the prefix the default, but I decided that it might be
best to be explicit, as others might want to install it as a system app.
('/boot/home/config' is the BeOS equivalent of '/usr/local'.)

Thanks,
				-- Pete Goodeve --


Index: dln.c
===================================================================
--- dln.c	(revision 19394)
+++ dln.c	(working copy)
@@ -1499,7 +1499,8 @@
       /* load extention module */
       img_id = load_add_on(file);
       if (img_id <= 0) {
-	rb_loaderror("Failed to load %.200s", file);
+	rb_loaderror("Failed to load add_on %.200s error_code=%x",
+	  file, img_id);
       }
       
       /* find symbol for module initialize function. */
Index: ext/socket/getaddrinfo.c
===================================================================
--- ext/socket/getaddrinfo.c	(revision 19394)
+++ ext/socket/getaddrinfo.c	(working copy)
@@ -42,7 +42,7 @@
 #include <sys/types.h>
 #if !defined(_WIN32) && !defined(__VMS)
 #include <sys/param.h>
-#if defined(__BEOS__)
+#if defined(__BEOS__) && !defined(BONE)
 # include <net/socket.h>
 #else
 # include <sys/socket.h>
Index: ext/socket/extconf.rb
===================================================================
--- ext/socket/extconf.rb	(revision 19394)
+++ ext/socket/extconf.rb	(working copy)
@@ -38,7 +38,7 @@
 end
 
 ipv6 = false
-default_ipv6 = /cygwin/ !~ RUBY_PLATFORM
+default_ipv6 = /cygwin|beos/ !~ RUBY_PLATFORM
 if enable_config("ipv6", default_ipv6)
   if checking_for("ipv6") {try_link(<<EOF)}
 #include <sys/types.h>
Index: ext/socket/socket.c
===================================================================
--- ext/socket/socket.c	(revision 19394)
+++ ext/socket/socket.c	(working copy)
@@ -26,7 +26,7 @@
 #endif
 
 #ifndef _WIN32
-#if defined(__BEOS__)
+#if defined(__BEOS__) && !defined(BONE)
 # include <net/socket.h>
 #else
 # include <sys/socket.h>
Index: ext/socket/getnameinfo.c
===================================================================
--- ext/socket/getnameinfo.c	(revision 19394)
+++ ext/socket/getnameinfo.c	(working copy)
@@ -38,7 +38,7 @@
 #include <stdio.h>
 #include <sys/types.h>
 #ifndef _WIN32
-#if defined(__BEOS__)
+#if defined(__BEOS__) && !defined(BONE)
 # include <net/socket.h>
 #else
 # include <sys/socket.h>
Index: numeric.c
===================================================================
--- numeric.c	(revision 19394)
+++ numeric.c	(working copy)
@@ -80,6 +80,9 @@
     }
     return x;
 }
+#elif defined(__BEOS__)
+      /* appears to be a bug in the BeOS headers */
+      double round(double x);
 #endif
 
 static ID id_coerce, id_to_i, id_eq;
Index: configure.in
===================================================================
--- configure.in	(revision 19394)
+++ configure.in	(working copy)
@@ -1238,10 +1238,12 @@
 			  powerpc*)
 			    : ${LDSHARED="ld -xms"}
 			    DLDFLAGS="$DLDFLAGS "'-export Init_$(TARGET) -lbe -lroot glue-noinit.a init_term_dyn.o start_dyn.o'
-                            ;;
+			    LDFLAGS="$LDFLAGS -L/boot/home/config/lib -lbe -lroot"
+			    ;;
 			  i586*)
 			    : ${LDSHARED="ld -shared"}
-			    DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -lbe -lroot"
+			    DLDFLAGS="$DLDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib \$(topdir)/_APP_ -lbe -lroot"
+			    LDFLAGS="$LDFLAGS -L/boot/develop/lib/x86 -L/boot/home/config/lib -lbe -lroot"
 			    ;;
 			esac
 			: ${LIBPATHENV=LIBRARY_PATH}
@@ -1606,6 +1608,7 @@
 	    CFLAGS="$CFLAGS -relax_pointers"
 	    ;;
 	esac
+	CPPFLAGS="$CPPFLAGS -I/boot/home/config/include"
 	;;
     cygwin*|mingw*)
 	case "$target_os" in
Index: io.c
===================================================================
--- io.c	(revision 19394)
+++ io.c	(working copy)
@@ -91,7 +91,9 @@
 # ifndef NOFILE
 #  define NOFILE (OPEN_MAX)
 # endif
-#include <net/socket.h>
+#if !defined(BONE)
+#  include <net/socket.h>
+# endif
 #endif
 
 #include "util.h"
Index: defines.h
===================================================================
--- defines.h	(revision 19394)
+++ defines.h	(working copy)
@@ -190,7 +190,7 @@
 #include "vms.h"
 #endif
 
-#if defined(__BEOS__)
+#if defined(__BEOS__) && !defined(BONE)
 #include <net/socket.h> /* intern.h needs fd_set definition */
 #endif
 
Index: eval.c
===================================================================
--- eval.c	(revision 19394)
+++ eval.c	(working copy)
@@ -72,7 +72,7 @@
 #include <unistd.h>
 #endif
 
-#ifdef __BEOS__
+#if defined(__BEOS__) && !defined(BONE)
 #include <net/socket.h>
 #endif