Feature #403
closedAdd support to Haiku
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
Updated by naruse (Yui NARUSE) over 16 years ago
=begin
I have some questions about this patch,
-
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? -
io.c
This seems includes net/socket.h twice. -
config.guess, config.sub
such a large change scares me.
=end
Updated by oco (Olivier Coursière) over 16 years ago
- File new_ruby_1_9_haiku.patch new_ruby_1_9_haiku.patch added
- File new_ruby_1_9_haiku_config.sub_config.guess.patch new_ruby_1_9_haiku_config.sub_config.guess.patch added
- File config.guess_automake-1.10.1.patch config.guess_automake-1.10.1.patch added
=begin
Thank you for reviewing the patch. Here are some precisions :
- 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.
-
Yes. One include should be enough. I have removed the second socket.h include.
-
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
Updated by naruse (Yui NARUSE) about 16 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.
- 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
Updated by znz (Kazuhiro NISHIYAMA) about 16 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
Updated by usa (Usaku NAKAMURA) about 16 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, 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
Updated by nobu (Nobuyoshi Nakada) about 16 years ago
=begin
Hi,
At Thu, 7 Aug 2008 06:11:32 +0900,
Yui NARUSE wrote in [ruby-core:18152]:
- 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
Updated by naruse (Yui NARUSE) about 16 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
Updated by nobu (Nobuyoshi Nakada) about 16 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r18472.
=end