Project

General

Profile

Actions

Feature #403

closed

Add support to Haiku

Added by Anonymous over 15 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:18110]

Description

=begin
Here is a patch to compile ruby 1.9 under Haiku.

3 test cases still do not run. And network support is not yet fully working.

Here is the content of the patch :

  • more up to date config.guess et config.sub (maybe there is more recent
    ones in the autoconf repository)
  • different changes to recognize Haiku and configure ruby in autoconf scripts
  • some compile fix in various files
  • some compile fix in the socket extension

I hope it will help advocate the BeOS case at the next cleaning.

Pete Goodeve has already shown interest in the BeOS port too (http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/309735).
The only thing missing to compile 1.9 under BeOS is the lack
of a native thread implementation. There is only a partial pthread
library under BeOS. I will take a look at this in the next weeks,
but can't promise anything.

Haiku has a better POSIX layer, an almost complete pthread implementation
and is now stable enough to compile ruby directly.

If we have to choose, Haiku support is probably more important than BeOS one.

Olivier Coursière
=end


Files

ruby_1_9_haiku_r18321.patch (61.4 KB) ruby_1_9_haiku_r18321.patch Anonymous, 08/04/2008 04:07 AM
new_ruby_1_9_haiku.patch (7.92 KB) new_ruby_1_9_haiku.patch oco (Olivier Coursière), 08/05/2008 11:17 AM
new_ruby_1_9_haiku_config.sub_config.guess.patch (53.2 KB) new_ruby_1_9_haiku_config.sub_config.guess.patch oco (Olivier Coursière), 08/05/2008 11:17 AM
config.guess_automake-1.10.1.patch (438 Bytes) config.guess_automake-1.10.1.patch oco (Olivier Coursière), 08/05/2008 11:17 AM
Actions #1

Updated by naruse (Yui NARUSE) over 15 years ago

=begin
I have some questions about this patch,

  1. defines.h and eval_intern.h
    BeOS includs net/socket.h in both defines.h and eval_intern.h.
    And this patch change eval_intern.h that all the but BeOS includes sys/socket.h.
    This is correct?

  2. io.c
    This seems includes net/socket.h twice.

  3. config.guess, config.sub
    such a large change scares me.
    =end

Updated by oco (Olivier Coursière) over 15 years ago

=begin
Thank you for reviewing the patch. Here are some precisions :

  1. Oups ! I obviously misunderstood that socket.h included in those files are BeOS workarounds. In fact, Haiku do not need this to compile.

#if defined(BEOS) && !defined(HAIKU) should be enough (see my new patch) as GCC under Haiku still define BEOS too. There is some discussions to remove it as most of the time (like in this case), Haiku's port should work without those weird BeOS workarounds.

  1. Yes. One include should be enough. I have removed the second socket.h include.

  2. I understand. In fact, it correspond to the files in the latest stable version of automake (1.10.1) + a little patch to config.guess. I don't know what is the update policy for those files in the ruby project :

  • only stable version of automake ? : Haiku will have to wait the next release
  • only patch for ruby supported platforms ?
  • ...

Maybe, i can try to extract haiku related lines. Until then, people under Haiku can just drop config.guess and config.sub in there working copy the first time. Those files are included in the Haiku development package. A make rule could do this too.

I have extracted config.guess and config.sub from the main patch.
=end

Actions #3

Updated by naruse (Yui NARUSE) over 15 years ago

=begin

I have extracted config.guess and config.sub from the main patch.
Thanks, I patched new_ruby_1_9_haiku.patch in r18402 and
config.guess_automake-1.10.1.patch in r18403.

  1. I understand. In fact, it correspond to the files in
    the latest stable version of automake (1.10.1) + a little patch to config.guess.
    I don't know what is the update policy for those files in the ruby project :

Ruby uses the old version of config.guess and sub + large patches.
So a little patch to current ruby's will be easily merged.
=end

Actions #4

Updated by znz (Kazuhiro NISHIYAMA) over 15 years ago

=begin
At Thu, 7 Aug 2008 06:11:32 +0900,
Yui NARUSE wrote:

I have extracted config.guess and config.sub from the main patch.
Thanks, I patched new_ruby_1_9_haiku.patch in r18402 and
config.guess_automake-1.10.1.patch in r18403.

ext/socket/addrinfo.hでは以下のようにgai_strerrorが「#ifndef HAIKU」に
なっているので、ext/socket/getaddrinfo.cでもコメントアウトではなく
「#ifndef HAIKU」の方が良いのではないでしょうか?

#ifndef HAIKU
extern char *gai_strerror __P((int));
#endif

Index: ext/socket/getaddrinfo.c

--- ext/socket/getaddrinfo.c (revision 18407)
+++ ext/socket/getaddrinfo.c (working copy)
@@ -194,7 +194,7 @@ if (pai->ai_flags & AI_CANONNAME) {\

#define ERR(err) { error = (err); goto bad; }

-/*
+#ifndef HAIKU
#if defined UCLIBC
const
#endif
@@ -205,7 +205,7 @@ gai_strerror(int ecode)
ecode = EAI_MAX;
return (char )ai_errlist[ecode];
}
-
/
+#endif

void
freeaddrinfo(struct addrinfo *ai)

=end

Actions #5

Updated by usa (Usaku NAKAMURA) over 15 years ago

=begin
こんにちは、なかむら(う)です。

In message "[ruby-dev:35796] Re: [Ruby 1.9 - Feature #403] Add support to Haiku"
on Aug.07,2008 12:42:32, wrote:

ext/socket/addrinfo.hでは以下のようにgai_strerrorが「#ifndef HAIKU」に
なっているので、ext/socket/getaddrinfo.cでもコメントアウトではなく
「#ifndef HAIKU」の方が良いのではないでしょうか?

そうしない限りHaiku以外でgetaddrinfo.cを使う環境ではリンク不
能になりますね(具体的にはmswin32とか)。
commitしておきます。

それでは。

U.Nakamura

=end

Actions #6

Updated by nobu (Nobuyoshi Nakada) over 15 years ago

=begin
Hi,

At Thu, 7 Aug 2008 06:11:32 +0900,
Yui NARUSE wrote in [ruby-core:18152]:

  1. I understand. In fact, it correspond to the files in
    the latest stable version of automake (1.10.1) + a little patch to config.guess.
    I don't know what is the update policy for those files in the ruby project :

Ruby uses the old version of config.guess and sub + large patches.
So a little patch to current ruby's will be easily merged.

Actually, they are intermediate versions, and seems better to
update them first.

--
Nobu Nakada

=end

Actions #7

Updated by naruse (Yui NARUSE) over 15 years ago

=begin

ext/socket/addrinfo.hでは以下のようにgai_strerrorが「#ifndef HAIKU」に
なっているので、ext/socket/getaddrinfo.cでもコメントアウトではなく
「#ifndef HAIKU」の方が良いのではないでしょうか?

Oops, I missed it.
Thanks, usa.

Actually, they are intermediate versions, and seems better to
update them first.
I scared side effects on other platforms by updating them.
I can't judge that is safe or not.
Would you judge it, nobu?
=end

Actions #8

Updated by nobu (Nobuyoshi Nakada) over 15 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r18472.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0