
Ruby:
  http://www.ruby-lang.org/
  ftp://ftp.ruby-lang.org/pub/ruby/1.6/ruby-1.6.7.tar.gz

My Homepage
  http://members.jcom.home.ne.jp/nsa/ruby/index.html
  mailto:nsa@jcom.home.ne.jp

usage:
  cd <ruby-src>
  patch -p1 < beos-pc-dano.diff


diff -Nru1 ruby-1.6.7.orig/configure.in ruby-1.6.7/configure.in
--- ruby-1.6.7.orig/configure.in	Wed Feb  6 18:13:15 2002
+++ ruby-1.6.7/configure.in	Sat Mar  2 03:00:54 2002
@@ -260,3 +260,4 @@
 		 fcntl.h sys/fcntl.h sys/select.h sys/time.h sys/times.h sys/param.h\
-		 syscall.h pwd.h a.out.h utime.h memory.h direct.h sys/resource.h)
+		 syscall.h pwd.h a.out.h utime.h memory.h direct.h sys/resource.h\
+		 net/socket.h)
 
@@ -609,3 +610,3 @@
 			  i586*)
-			    LDSHARED="ld -shared"
+			    LDSHARED="gcc -nostart"
 			    DLDFLAGS="-L/boot/develop/lib/x86 -lbe -lroot"
diff -Nru1 ruby-1.6.7.orig/dln.c ruby-1.6.7/dln.c
--- ruby-1.6.7.orig/dln.c	Fri Aug 24 15:35:24 2001
+++ ruby-1.6.7/dln.c	Sat Mar  2 03:01:36 2002
@@ -1527,2 +1527,4 @@
 	path = "/usr/local/bin;/usr/ucb;/usr/bin;/bin;.";
+#elif defined(__BEOS__)
+	path = "/boot/home/config/bin:/bin:/boot/apps:/boot/preferences:/boot/beos/apps:/boot/beos/preferences:/boot/develop/bin:.";
 #else
diff -Nru1 ruby-1.6.7.orig/eval.c ruby-1.6.7/eval.c
--- ruby-1.6.7.orig/eval.c	Wed Feb 27 13:50:29 2002
+++ ruby-1.6.7/eval.c	Sat Mar  2 03:02:06 2002
@@ -60,3 +60,3 @@
 
-#ifdef __BEOS__
+#ifdef HAVE_NET_SOCKET_H
 #include <net/socket.h>
diff -Nru1 ruby-1.6.7.orig/ext/curses/extconf.rb ruby-1.6.7/ext/curses/extconf.rb
--- ruby-1.6.7.orig/ext/curses/extconf.rb	Mon Dec  3 19:04:46 2001
+++ ruby-1.6.7/ext/curses/extconf.rb	Sat Mar  2 03:02:25 2002
@@ -7,2 +7,3 @@
 make=false
+have_library("tinfo", "tgetent") if /beos/ =~ RUBY_PLATFORM
 have_library("mytinfo", "tgetent") if /bow/ =~ RUBY_PLATFORM
diff -Nru1 ruby-1.6.7.orig/ext/digest/test.rb ruby-1.6.7/ext/digest/test.rb
--- ruby-1.6.7.orig/ext/digest/test.rb	Thu Aug 16 16:35:42 2001
+++ ruby-1.6.7/ext/digest/test.rb	Sat Mar  2 05:00:46 2002
@@ -1,2 +1,2 @@
-#!/usr/bin/env ruby
+#!/bin/env ruby
 #
diff -Nru1 ruby-1.6.7.orig/ext/pty/pty.c ruby-1.6.7/ext/pty/pty.c
--- ruby-1.6.7.orig/ext/pty/pty.c	Sun Jan 27 02:15:53 2002
+++ ruby-1.6.7/ext/pty/pty.c	Sat Mar  2 05:05:52 2002
@@ -29,2 +29,6 @@
 
+#ifdef __BEOS__
+#define vfork fork
+#endif
+
 #define	DEVICELEN	16
@@ -77,2 +81,17 @@
 #else
+#ifdef __BEOS__
+char	*MasterDevice = "/dev/pt/%s",
+	*SlaveDevice = "/dev/tt/%s",
+	*deviceNo[] = {
+		"p0","p1","p2","p3","p4","p5","p6","p7",
+		"p8","p9","pa","pb","pc","pd","pe","pf",
+		"q0","q1","q2","q3","q4","q5","q6","q7",
+		"q8","q9","qa","qb","qc","qd","qe","qf",
+		"r0","r1","r2","r3","r4","r5","r6","r7",
+		"r8","r9","ra","rb","rc","rd","re","rf",
+		"s0","s1","s2","s3","s4","s5","s6","s7",
+		"s8","s9","sa","sb","sc","sd","se","sf",
+		0,
+	};
+#else
 char	*MasterDevice = "/dev/pty%s",
@@ -88,2 +107,3 @@
 	};
+#endif /* __BEOS__ */
 #endif /* _IBMESA */
diff -Nru1 ruby-1.6.7.orig/ext/socket/extconf.rb ruby-1.6.7/ext/socket/extconf.rb
--- ruby-1.6.7.orig/ext/socket/extconf.rb	Mon Dec  3 19:04:46 2001
+++ ruby-1.6.7/ext/socket/extconf.rb	Sat Mar  2 03:04:24 2002
@@ -16,3 +16,4 @@
   test_func = "socket"
-  have_library("net", "socket")
+  have_library("net", "socket") or have_library("socket", "socket")
+  have_library("bind", "__inet_pton")
   have_func("closesocket")
@@ -306,4 +307,10 @@
   $objs += ["getnameinfo.#{$OBJEXT}"]
-  have_func("inet_ntop") or have_func("inet_ntoa")
-  have_func("inet_pton") or have_func("inet_aton")
+  if /beos/ =~ RUBY_PLATFORM
+    have_func("getaddrinfo")
+    have_func("inet_ntop", "arpa/inet.h") or have_func("inet_ntoa", "arpa/inet.h")
+    have_func("inet_pton", "arpa/inet.h") or have_func("inet_aton", "arpa/inet.h")
+  else
+    have_func("inet_ntop") or have_func("inet_ntoa")
+    have_func("inet_pton") or have_func("inet_aton")
+  end
   have_func("getservbyport")
diff -Nru1 ruby-1.6.7.orig/ext/socket/getaddrinfo.c ruby-1.6.7/ext/socket/getaddrinfo.c
--- ruby-1.6.7.orig/ext/socket/getaddrinfo.c	Fri Mar  1 13:47:30 2002
+++ ruby-1.6.7/ext/socket/getaddrinfo.c	Sat Mar  2 03:56:39 2002
@@ -44,3 +44,3 @@
 #include <sys/param.h>
-#if defined(__BEOS__)
+#ifdef HAVE_NET_SOCKET_H
 # include <net/socket.h>
diff -Nru1 ruby-1.6.7.orig/ext/socket/getnameinfo.c ruby-1.6.7/ext/socket/getnameinfo.c
--- ruby-1.6.7.orig/ext/socket/getnameinfo.c	Mon Jul 10 13:49:18 2000
+++ ruby-1.6.7/ext/socket/getnameinfo.c	Sat Mar  2 03:05:40 2002
@@ -39,3 +39,3 @@
 #ifndef NT
-#if defined(__BEOS__)
+#if HAVE_NET_SOCKET_H
 # include <net/socket.h>
diff -Nru1 ruby-1.6.7.orig/ext/socket/socket.c ruby-1.6.7/ext/socket/socket.c
--- ruby-1.6.7.orig/ext/socket/socket.c	Thu Jan 17 04:40:06 2002
+++ ruby-1.6.7/ext/socket/socket.c	Sat Mar  2 03:06:30 2002
@@ -23,3 +23,3 @@
 #ifndef NT
-#if defined(__BEOS__)
+#if HAVE_NET_SOCKET_H
 # include <net/socket.h>
@@ -316,3 +316,3 @@
 {
-#if !defined(__BEOS__)
+#if B_BEOS_VERSION > B_BEOS_VERSION_5
     int level, option;
diff -Nru1 ruby-1.6.7.orig/ext/syslog/extconf.rb ruby-1.6.7/ext/syslog/extconf.rb
--- ruby-1.6.7.orig/ext/syslog/extconf.rb	Sat Dec  1 23:23:57 2001
+++ ruby-1.6.7/ext/syslog/extconf.rb	Sat Mar  2 04:58:57 2002
@@ -5,2 +5,4 @@
 
+have_library("be") if /beos/ =~ RUBY_PLATFORM
+
 have_header("syslog.h") &&
diff -Nru1 ruby-1.6.7.orig/ext/syslog/test.rb ruby-1.6.7/ext/syslog/test.rb
--- ruby-1.6.7.orig/ext/syslog/test.rb	Tue Feb 26 18:25:06 2002
+++ ruby-1.6.7/ext/syslog/test.rb	Sat Mar  2 05:00:47 2002
@@ -1,2 +1,2 @@
-#!/usr/bin/env ruby
+#!/bin/env ruby
 # $RoughId: test.rb,v 1.9 2002/02/25 08:20:14 knu Exp $
diff -Nru1 ruby-1.6.7.orig/io.c ruby-1.6.7/io.c
--- ruby-1.6.7.orig/io.c	Wed Feb 27 13:47:51 2002
+++ ruby-1.6.7/io.c	Sat Mar  2 03:07:19 2002
@@ -73,2 +73,4 @@
 # endif
+#endif
+#ifdef HAVE_NET_SOCKET_H
 #include <net/socket.h>
diff -Nru1 ruby-1.6.7.orig/sample/cal.rb ruby-1.6.7/sample/cal.rb
--- ruby-1.6.7.orig/sample/cal.rb	Tue Jul 18 15:00:45 2000
+++ ruby-1.6.7/sample/cal.rb	Sat Mar  2 05:00:47 2002
@@ -1,2 +1,2 @@
-#! /usr/bin/env ruby
+#! /bin/env ruby
 
diff -Nru1 ruby-1.6.7.orig/sample/goodfriday.rb ruby-1.6.7/sample/goodfriday.rb
--- ruby-1.6.7.orig/sample/goodfriday.rb	Tue Jul 18 15:00:45 2000
+++ ruby-1.6.7/sample/goodfriday.rb	Sat Mar  2 05:00:47 2002
@@ -1,2 +1,2 @@
-#! /usr/bin/env ruby
+#! /bin/env ruby
 
diff -Nru1 ruby-1.6.7.orig/sample/irb.rb ruby-1.6.7/sample/irb.rb
--- ruby-1.6.7.orig/sample/irb.rb	Tue May  1 17:43:16 2001
+++ ruby-1.6.7/sample/irb.rb	Sat Mar  2 05:00:47 2002
@@ -1,2 +1,2 @@
-#!/usr/bin/env ruby
+#!/bin/env ruby
 #
diff -Nru1 ruby-1.6.7.orig/sample/test.rb ruby-1.6.7/sample/test.rb
--- ruby-1.6.7.orig/sample/test.rb	Tue Feb 26 18:25:07 2002
+++ ruby-1.6.7/sample/test.rb	Sat Mar  2 05:00:47 2002
@@ -1,2 +1,2 @@
-#! /usr/bin/env ruby
+#! /bin/env ruby
 
diff -Nru1 ruby-1.6.7.orig/sample/uumerge.rb ruby-1.6.7/sample/uumerge.rb
--- ruby-1.6.7.orig/sample/uumerge.rb	Wed Mar 21 17:04:12 2001
+++ ruby-1.6.7/sample/uumerge.rb	Sat Mar  2 05:00:47 2002
@@ -1,2 +1,2 @@
-#!/usr/bin/env ruby
+#!/bin/env ruby
 
