Feature #403

Add support to Haiku

Added by Anonymous over 6 years ago. Updated almost 4 years ago.

[ruby-core:18110]
Status:Closed
Priority:Normal
Assignee:-

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

ruby_1_9_haiku_r18321.patch Magnifier (61.4 KB) Anonymous, 08/04/2008 04:07 AM

new_ruby_1_9_haiku.patch Magnifier (7.92 KB) Olivier Coursière, 08/05/2008 11:17 AM

new_ruby_1_9_haiku_config.sub_config.guess.patch Magnifier (53.2 KB) Olivier Coursière, 08/05/2008 11:17 AM

config.guess_automake-1.10.1.patch Magnifier (438 Bytes) Olivier Coursière, 08/05/2008 11:17 AM

History

#1 Updated by Yui NARUSE over 6 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

#2 Updated by Olivier Coursière over 6 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.

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

  3. 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

#3 Updated by Yui NARUSE over 6 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

#4 Updated by Kazuhiro NISHIYAMA over 6 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

#5 Updated by Usaku NAKAMURA over 6 years ago

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

In message " Re: [Ruby 1.9 - Feature #403] Add support to Haiku"
on Aug.07,2008 12:42:32, zn@mbf.nifty.com wrote:

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

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

それでは。
--
U.Nakamura usa@garbagecollect.jp

=end

#6 Updated by Nobuyoshi Nakada over 6 years ago

=begin
Hi,

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

  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

#7 Updated by Yui NARUSE over 6 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

#8 Updated by Nobuyoshi Nakada over 6 years ago

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

=begin
Applied in changeset r18472.
=end

Also available in: Atom PDF