21
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

RubyAdvent Calendar 2012

Day 24

温故知新

Last updated at Posted at 2012-12-24

TL;DR

Go to https://github.com/mrkn/ruby10

はじめに

2012年も残すところあと1週間となりました。マヤ暦も終わったことですし、2013年を新鮮な気持ちで迎えられるとお考えの方々も少なくないでしょう。

2013年といえば、2月24日に Ruby 2.0 がリリースされる事でも有名です。2012年は Ruby バージョン 1.x 時代の最後の年になります。

みなさんが初めて Ruby を触った時、Ruby のバージョンはいくつでしたか?私は 1.4 でした。すぐに 1.6 がリリースされたので、1.4 を触っていた期間はとても短かく、ほとんど覚えていません。

Ruby 2.0 は 1.9.3 と 100% 互換性を保っている事が期待されています。ですから 2.0 は目新しいものにはならず、今まで使っていた Ruby と同じように使うことができるでしょう。今までの悪い部分を切り捨てて新しい機能を取り入れた、いまのRubyとの互換性を捨てた新しい Ruby は 2.0 の次のバージョンに期待しましょう。

これまでの Ruby の変化を見ると、変化を受け入れて進化していく言語であることが分かると思います。古い Ruby と今の Ruby を比較すれば、その違いは一目瞭然で、同じ言語なのかと驚くはずです。

記念すべき Ruby 2.0 のリリースを目前に控えたいま、Ruby 1.0 を使ってみることで Ruby がどのくらい変わったのか、体で感じてみては如何でしょうか。

この記事では、Ruby 1.0 を使うために、Ruby 1.0 を入手し、ビルドし、ruby -vを実行するまでの一部始終を報告します。OS は Mac OS X Lion です。その他の OS を使用されている場合は、適宜読み替えてください。

Ruby 1.0

Ruby 1.0 はいつリリースされたのでしょう?

ftp.ruby-lang.orgを見ると、最初のリリースは1996年12月25日であることが分かります。その後、1997年10月2日に2回目のリリースがあってから計9回更新されています。1.0の最終更新日である1997年12月25日には1.1b3がリリースされています

ということは、今日はRuby1.0の最後のリリースからちょうど15年目の最終日ということになりますね。

入手

本稿では1997年12月25日にリリースされた1.0を使います。

まずは、ソースコードを適当な場所にダウンロードして展開してください。

$ curl -O http://ftp.ruby-lang.org/pub/ruby/1.0/ruby-1.0-971225.tar.gz
$ tar xf ruby-1.0-971225.tar.gz

コンフィギューレ

tar 玉を展開すると ruby-1.0-971225 ディレクトリが作られます。このディレクトリに入って、configure しましょう。

$ cd ruby-1.9-971225
$ ./configure 
creating cache ./config.cache
checking host system type... configure: error: can not guess host type; you must specify one

おっと、host type が推測できなくて、しょっぱなから躓いてしまいました。Ruby 1.0 は64bit環境に対応していないはずなので、ここでは i386-darwin を明示的に指定してあげることにしましょう。

$ ./configure i386-darwin
loading cache ./config.cache
checking host system type... Invalid configuration `i386-darwin': system `darwin' not recognized

checking for gcc... gcc
checking whether the C compiler (gcc  ) works... yes
checking whether the C compiler (gcc  ) is a cross-compiler... no
checking whether we are using GNU C... yes
checking whether gcc accepts -g... yes
checking how to run the C preprocessor... gcc -E
checking whether gcc needs -traditional... no
checking for bison... bison -y
checking for ranlib... ranlib
checking for ar... ar
checking for a BSD compatible install... /usr/bin/install -c
checking whether make sets ${MAKE}... yes
checking for minix/config.h... no
checking for crypt in -lcrypt... no
checking for dlopen in -ldl... yes
checking for shl_load in -ldld... no
checking for dirent.h that defines DIR... yes
checking for opendir in -ldir... no
checking for ANSI C header files... yes
checking for stdlib.h... yes
checking for unistd.h... yes
checking for limits.h... yes
checking for sys/file.h... yes
checking for sys/ioctl.h... yes
checking for pwd.h... yes
checking for sys/select.h... yes
checking for sys/time.h... yes
checking for sys/times.h... yes
checking for sys/param.h... yes
checking for sys/wait.h... yes
checking for syscall.h... no
checking for a.out.h... no
checking for string.h... yes
checking for utime.h... yes
checking for memory.h... yes
checking for uid_t in sys/types.h... yes
checking for size_t... yes
checking for st_blksize in struct stat... yes
checking for st_blocks in struct stat... yes
checking for st_rdev in struct stat... yes
checking size of short... 2
checking size of int... 4
checking size of long... 8
checking size of void*... 8
checking type of array argument to getgroups... gid_t
checking return type of signal handlers... void
checking for working alloca.h... yes
checking for alloca... yes
checking for pid_t... yes
checking for vfork.h... no
checking for working vfork... yes
checking for dup2... yes
checking for setenv... yes
checking for memmove... yes
checking for mkdir... yes
checking for strcasecmp... yes
checking for strerror... yes
checking for strftime... yes
checking for strstr... yes
checking for strtoul... yes
checking for strdup... yes
checking for crypt... yes
checking for flock... yes
checking for fmod... yes
checking for killpg... yes
checking for random... yes
checking for wait4... yes
checking for waitpid... yes
checking for syscall... yes
checking for getcwd... yes
checking for truncate... yes
checking for chsize... no
checking for times... yes
checking for utimes... yes
checking for fcntl... yes
checking for lockf... yes
checking for setitimer... yes
checking for setruid... yes
checking for seteuid... yes
checking for setreuid... yes
checking for setrgid... yes
checking for setegid... yes
checking for setregid... yes
checking for setpgrp2... no
checking for getpgid... yes
checking for getgroups... yes
checking for getpriority... yes
checking for dlopen... yes
checking for sigprocmask... yes
checking for sigaction... yes
checking for _setjmp... yes
checking whether getpgrp() has arg... no
checking whether setpgrp() has args... no
checking whether byte ordering is bigendian... no
checking whether char is unsigned... no
checking count field in FILE structures... _r
checking whether OS depend dynamic link works... unknown
creating config.h
updating cache ./config.cache
creating ./config.status
creating Makefile
creating ext/extmk.rb

「darwin なんて知らねぇよ」と警告されてますが、config.h や Makefile など、必要なファイルは生成できたようです。

コンパイル

Makefile を生成できたので、make しましょう。

$ make
gcc -g -O2 -I.  -c array.c
array.c: In function ‘ary_modify’:
array.c:38: warning: cast to pointer from integer of different size
array.c: In function ‘ary_freeze’:
array.c:47: warning: cast to pointer from integer of different size
array.c: In function ‘ary_frozen_p’:
array.c:55: warning: cast to pointer from integer of different size
array.c: In function ‘ary_new2’:
array.c:64: warning: cast to pointer from integer of different size
array.c:76: warning: cast from pointer to integer of different size
In file included from array.c:85:
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/varargs.h:4:2: error: #error "GCC no longer implements <varargs.h>."
/usr/llvm-gcc-4.2/bin/../lib/gcc/i686-apple-darwin11/4.2.1/include/varargs.h:5:2: error: #error "Revise your code to use <stdarg.h>."
array.c: In function ‘ary_new3’:
array.c:90: error: expected declaration specifiers before ‘va_dcl’
array.c:113: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘int’
array.c:114: error: declaration for parameter ‘elts’ but no such parameter
array.c:118: warning: cast to pointer from integer of different size
array.c:119: warning: incompatible implicit declaration of built-in function ‘memcpy’
array.c:122: warning: cast from pointer to integer of different size
array.c: In function ‘assoc_new’:
array.c:131: warning: cast to pointer from integer of different size
array.c:136: warning: cast from pointer to integer of different size
array.c: In function ‘ary_s_new’:
array.c:146: warning: cast to pointer from integer of different size
array.c:155: warning: cast from pointer to integer of different size
array.c: In function ‘ary_s_create’:
array.c:164: warning: cast to pointer from integer of different size
array.c:174: warning: incompatible implicit declaration of built-in function ‘memcpy’
array.c:177: warning: cast from pointer to integer of different size
array.c: In function ‘ary_push’:
array.c:211: warning: cast from pointer to integer of different size
array.c: In function ‘ary_push_method’:
array.c:223: warning: cast from pointer to integer of different size
array.c: In function ‘ary_shift’:
array.c:250: warning: incompatible implicit declaration of built-in function ‘memmove’
array.c: In function ‘ary_unshift’:
array.c:271: warning: incompatible implicit declaration of built-in function ‘memmove’
array.c: In function ‘ary_subseq’:
array.c:315: warning: cast to pointer from integer of different size
array.c:316: warning: incompatible implicit declaration of built-in function ‘memcpy’
array.c:319: warning: cast from pointer to integer of different size
array.c: In function ‘ary_indexes’:
array.c:416: warning: cast from pointer to integer of different size
array.c: In function ‘ary_replace’:
array.c:436: warning: cast from pointer to integer of different size
array.c:437: warning: cast to pointer from integer of different size
array.c:450: warning: incompatible implicit declaration of built-in function ‘memcpy’
array.c:470: warning: incompatible implicit declaration of built-in function ‘memmove’
array.c:474: warning: incompatible implicit declaration of built-in function ‘memcpy’
array.c: In function ‘ary_aset’:
array.c:493: warning: cast from pointer to integer of different size
array.c: In function ‘ary_clone’:
array.c:575: warning: cast to pointer from integer of different size
array.c:575: warning: cast to pointer from integer of different size
array.c:576: warning: incompatible implicit declaration of built-in function ‘memcpy’
array.c:576: warning: cast to pointer from integer of different size
array.c:577: warning: cast to pointer from integer of different size
array.c: In function ‘ary_join’:
array.c:615: warning: cast from pointer to integer of different size
array.c:616: warning: cast to pointer from integer of different size
array.c:616: warning: cast to pointer from integer of different size
array.c: In function ‘ary_inspect’:
array.c:677: warning: cast to pointer from integer of different size
array.c:677: warning: cast to pointer from integer of different size
array.c:678: warning: cast to pointer from integer of different size
array.c: In function ‘ary_reverse’:
array.c:721: warning: cast from pointer to integer of different size
array.c: In function ‘ary_sort_bang’:
array.c:764: warning: cast from pointer to integer of different size
array.c: In function ‘ary_delete_if’:
array.c:841: warning: cast from pointer to integer of different size
array.c: In function ‘ary_clear’:
array.c:868: warning: cast from pointer to integer of different size
array.c: In function ‘ary_fill’:
array.c:914: warning: cast from pointer to integer of different size
array.c: In function ‘ary_plus’:
array.c:923: warning: cast from pointer to integer of different size
array.c:927: warning: cast to pointer from integer of different size
array.c:928: warning: incompatible implicit declaration of built-in function ‘memcpy’
array.c:931: warning: cast from pointer to integer of different size
array.c: In function ‘ary_concat’:
array.c:940: warning: cast from pointer to integer of different size
array.c:950: warning: cast from pointer to integer of different size
array.c: In function ‘ary_times’:
array.c:966: warning: cast to pointer from integer of different size
array.c:974: warning: incompatible implicit declaration of built-in function ‘memcpy’
array.c:977: warning: cast from pointer to integer of different size
array.c: In function ‘ary_assoc’:
array.c:990: warning: cast to pointer from integer of different size
array.c:991: warning: cast to pointer from integer of different size
array.c: In function ‘ary_rassoc’:
array.c:1008: warning: cast to pointer from integer of different size
array.c:1009: warning: cast to pointer from integer of different size
array.c: In function ‘ary_equal’:
array.c:1022: warning: cast from pointer to integer of different size
array.c: In function ‘ary_eql’:
array.c:1037: warning: cast from pointer to integer of different size
array.c: In function ‘ary_diff’:
array.c:1080: warning: cast from pointer to integer of different size
array.c: In function ‘ary_and’:
array.c:1097: warning: cast from pointer to integer of different size
array.c: In function ‘ary_or’:
array.c:1115: warning: cast from pointer to integer of different size
array.c:1116: warning: cast from pointer to integer of different size
array.c: In function ‘ary_compact_bang’:
array.c:1148: warning: cast from pointer to integer of different size
make: *** [array.o] Error 1

うわ〜失敗した〜

エラーメッセージを見ると、varargs.h ではなく stdarg.h を使うように修正すれば良さそうです。修正して make してみると、リンク時に以下のようなエラーが出ました (修正パッチは最後にまとめて提示します)。

gcc -g -O2 -I.  main.o array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o fnmatch.o gc.o glob.o hash.o inits.o io.o math.o numeric.o object.o pack.o parse.o process.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o -ldl -lm   -o miniruby
Undefined symbols for architecture x86_64:
  "_alloca", referenced from:
      _glob_vector in glob.o
      _glob_filename in glob.o
ld: symbol(s) not found for architecture x86_64

あれ?なぜか x86_64 って出てますね!そういえば、gcc に -arch i386 というオプションを渡してあげないと、i386 用にコンパイルしてくれないのでした。

CFLAGS='-g -O2 -arch i386' を指定して configure しなおし、もう一度 make しましょう。

$ make
(中略)
gcc -g -O2 -arch i386 -I.  main.o array.o bignum.o class.o compar.o dir.o dln.o enum.o error.o eval.o file.o fnmatch.o gc.o glob.o hash.o inits.o io.o math.o numeric.o object.o pack.o parse.o process.o random.o range.o re.o regex.o ruby.o signal.o sprintf.o st.o string.o struct.o time.o util.o variable.o version.o  dmyext.o -ldl -lm   -o miniruby
Undefined symbols for architecture i386:
  "_alloca", referenced from:
      _glob_vector in glob.o
      _glob_filename in glob.o
ld: symbol(s) not found for architecture i386

i386 でやってもさっきと同じエラーが出てしまいました。gcc を使ってるのに alloca を外部リンクしようとしているのが不気味ですね。問題となっている glob.c を開いてみると、以下のような記述を発見できます。

(前略)
#ifdef _AIX
#pragma alloca
#else
#if defined(HAVE_ALLOCA_H) && !defined(__GNUC__)
#include <alloca.h>
#else
char *alloca ();
#endif
#endif
(後略)

この最後の #else 節に入ってしまっているのでしょう。面倒ですから、<alloca.h> を include する行だけ残して、ほかの行は消してしまう事にしましょう。

すると・・・

$ make
(中略)
Compiling ext modules
compiling tkutil
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386     -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/tkutil/tkutil.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/tkutil/tkutil.c
ld  -o tkutil.so /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/tkutil/tkutil.o  
ld: warning: -macosx_version_min not specified, assuming 10.7
Undefined symbols for architecture i386:
  "_cObject", referenced from:
      _Init_tkutil in tkutil.o
  "_iterator_p", referenced from:
      _tk_s_new in tkutil.o
  "_obj_alloc", referenced from:
      _tk_s_new in tkutil.o
  "_rb_define_class", referenced from:
      _Init_tkutil in tkutil.o
  "_rb_define_module", referenced from:
      _Init_tkutil in tkutil.o
  "_rb_define_singleton_method", referenced from:
      _Init_tkutil in tkutil.o
  "_rb_eval_cmd", referenced from:
      _tk_eval_cmd in tkutil.o
  "_rb_funcall2", referenced from:
      _tk_s_new in tkutil.o
  "_rb_intern", referenced from:
      _tk_s_new in tkutil.o
  "_rb_scan_args", referenced from:
      _tk_eval_cmd in tkutil.o
  "_rb_yield_0", referenced from:
      _tk_s_new in tkutil.o
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture i386
make[1]: *** [tkutil.so] Error 1
compiling socket
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386  -DHAVE_SYS_UN_H -DHAVE_SOCKET -DHAVE_GETHOSTNAME   -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c: In function ‘open_inet’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c:432: warning: incompatible implicit declaration of built-in function ‘strlen’
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c:475: warning: incompatible implicit declaration of built-in function ‘memset’
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c:478: warning: incompatible implicit declaration of built-in function ‘memcpy’
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c: In function ‘open_unix’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c:625: warning: incompatible implicit declaration of built-in function ‘memset’
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c:627: warning: incompatible implicit declaration of built-in function ‘strncpy’
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c: In function ‘setipaddr’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.c:685: warning: incompatible implicit declaration of built-in function ‘memcpy’
ld -L/usr/local/lib -o socket.so /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/socket/socket.o  
ld: warning: -macosx_version_min not specified, assuming 10.7
Undefined symbols for architecture i386:
  "_Raise", referenced from:
      _sock_s_getservbyaname in socket.o
      _mkhostent in socket.o
      _setipaddr in socket.o
      _setup_domain_and_type in socket.o
      _open_inet in socket.o
  "_TypeError", referenced from:
      _s_recv in socket.o
  "___error", referenced from:
      _s_accept in socket.o
      _sock_connect in socket.o
      _open_inet in socket.o
      _bsock_send in socket.o
  "___sprintf_chk", referenced from:
      _tcpaddr in socket.o
      _tcp_s_getaddress in socket.o
  "___stack_chk_fail", referenced from:
      _sock_gethostname in socket.o
      _tcpaddr in socket.o
      _tcp_s_getaddress in socket.o
      _sock_accept in socket.o
      _bsock_getpeername in socket.o
      _bsock_getsockname in socket.o
      _bsock_getsockopt in socket.o
      ...
  "___stack_chk_guard", referenced from:
      _sock_gethostname in socket.o
      _tcpaddr in socket.o
      _tcp_s_getaddress in socket.o
      _sock_accept in socket.o
      _bsock_getpeername in socket.o
      _bsock_getsockname in socket.o
      _bsock_getsockopt in socket.o
      ...
  "_accept$UNIX2003", referenced from:
      _s_accept in socket.o
  "_ary_new", referenced from:
      _mkhostent in socket.o
  "_ary_new3", referenced from:
      _tcpaddr in socket.o
  "_ary_push", referenced from:
      _mkhostent in socket.o
  "_assoc_new", referenced from:
      _sock_s_socketpair in socket.o
      _s_recv in socket.o
      _sock_accept in socket.o
      _unix_peeraddr in socket.o
      _unix_addr in socket.o
  "_bind$UNIX2003", referenced from:
      _sock_bind in socket.o
      _open_unix in socket.o
      _open_inet in socket.o
  "_cIO", referenced from:
      _Init_socket in socket.o
  "_cInteger", referenced from:
      _sock_s_gethostbyname in socket.o
      _tcp_s_getaddress in socket.o
  "_close", referenced from:
      _open_unix in socket.o
      _open_inet in socket.o
  "_connect$UNIX2003", referenced from:
      _sock_connect in socket.o
      _open_unix in socket.o
      _open_inet in socket.o
  "_eException", referenced from:
      _Init_socket in socket.o
  "_fcntl$UNIX2003", referenced from:
      _open_inet in socket.o
  "_fileno", referenced from:
      _s_recv in socket.o
      _sock_accept in socket.o
      _unix_accept in socket.o
      _tcp_accept in socket.o
      _sock_listen in socket.o
      _sock_bind in socket.o
      _sock_connect in socket.o
      ...
  "_gethostbyaddr", referenced from:
      _sock_s_gethostbyaddr in socket.o
      _sock_s_gethostbyname in socket.o
      _tcpaddr in socket.o
  "_gethostbyname", referenced from:
      _setipaddr in socket.o
      _open_inet in socket.o
  "_gethostname", referenced from:
      _sock_gethostname in socket.o
  "_getpeername$UNIX2003", referenced from:
      _unix_peeraddr in socket.o
      _tcp_peeraddr in socket.o
      _bsock_getpeername in socket.o
  "_getprotobyname", referenced from:
      _open_inet in socket.o
  "_getservbyname", referenced from:
      _sock_s_getservbyaname in socket.o
      _open_inet in socket.o
  "_getsockname$UNIX2003", referenced from:
      _unix_addr in socket.o
      _unix_path in socket.o
      _tcp_addr in socket.o
      _bsock_getsockname in socket.o
  "_getsockopt", referenced from:
      _bsock_getsockopt in socket.o
  "_inet_addr", referenced from:
      _open_inet in socket.o
  "_io_unbuffered", referenced from:
      _sock_s_socketpair in socket.o
      _sock_s_for_fd in socket.o
      _s_accept in socket.o
      _sock_s_open in socket.o
      _open_unix in socket.o
      _open_inet in socket.o
  "_listen$UNIX2003", referenced from:
      _sock_listen in socket.o
      _open_unix in socket.o
      _open_inet in socket.o
  "_memcpy", referenced from:
      _setipaddr in socket.o
      _open_inet in socket.o
  "_num2int", referenced from:
      _sock_s_gethostbyaddr in socket.o
      _sock_s_gethostbyname in socket.o
      _setup_domain_and_type in socket.o
      _sock_s_socketpair in socket.o
      _sock_s_for_fd in socket.o
      _s_recv in socket.o
      _tcp_s_getaddress in socket.o
      ...
  "_obj_is_kind_of", referenced from:
      _sock_s_gethostbyname in socket.o
      _tcp_s_getaddress in socket.o
  "_rb_check_safe_str", referenced from:
      _open_unix in socket.o
      _open_inet in socket.o
      _tcp_s_open in socket.o
  "_rb_check_type", referenced from:
      _sock_s_getservbyaname in socket.o
      _sock_s_gethostbyaddr in socket.o
      _sock_s_gethostbyname in socket.o
      _tcp_s_getaddress in socket.o
      _sock_bind in socket.o
      _sock_connect in socket.o
      _open_inet in socket.o
      ...
  "_rb_class_of", referenced from:
      _Init_socket in socket.o
  "_rb_define_class", referenced from:
      _Init_socket in socket.o
  "_rb_define_const", referenced from:
      _Init_socket in socket.o
  "_rb_define_method", referenced from:
      _Init_socket in socket.o
  "_rb_define_singleton_method", referenced from:
      _Init_socket in socket.o
  "_rb_fdopen", referenced from:
      _sock_s_socketpair in socket.o
      _sock_s_for_fd in socket.o
      _s_accept in socket.o
      _sock_s_open in socket.o
      _open_unix in socket.o
      _open_inet in socket.o
  "_rb_newobj", referenced from:
      _sock_s_socketpair in socket.o
      _sock_s_for_fd in socket.o
      _s_accept in socket.o
      _sock_s_open in socket.o
      _open_unix in socket.o
      _open_inet in socket.o
  "_rb_scan_args", referenced from:
      _sock_s_getservbyaname in socket.o
      _sock_s_gethostbyaddr in socket.o
      _s_recv in socket.o
      _tcp_svr_s_open in socket.o
      _bsock_send in socket.o
      _bsock_shutdown in socket.o
  "_rb_secure", referenced from:
      _bsock_setsockopt in socket.o
      _bsock_send in socket.o
  "_rb_sys_fail", referenced from:
      _sock_gethostname in socket.o
      _sock_s_socketpair in socket.o
      _s_accept in socket.o
      _sock_listen in socket.o
      _sock_bind in socket.o
      _sock_connect in socket.o
      _sock_s_open in socket.o
      ...
  "_rb_test_false_or_nil", referenced from:
      _bsock_send in socket.o
  "_rb_type", referenced from:
      _setup_domain_and_type in socket.o
      _bsock_setsockopt in socket.o
  "_rb_undef_method", referenced from:
      _Init_socket in socket.o
  "_recvfrom$UNIX2003", referenced from:
      _s_recv in socket.o
  "_send$UNIX2003", referenced from:
      _bsock_send in socket.o
  "_sendto$UNIX2003", referenced from:
      _bsock_send in socket.o
  "_setbuf", referenced from:
      _sock_s_socketpair in socket.o
      _sock_s_for_fd in socket.o
      _s_accept in socket.o
      _sock_s_open in socket.o
      _open_unix in socket.o
      _open_inet in socket.o
  "_setsockopt", referenced from:
      _open_inet in socket.o
      _bsock_setsockopt in socket.o
  "_shutdown", referenced from:
      _bsock_shutdown in socket.o
  "_socket", referenced from:
      _sock_s_open in socket.o
      _open_unix in socket.o
      _open_inet in socket.o
     (maybe you meant: _Init_socket)
  "_socketpair$UNIX2003", referenced from:
      _sock_s_socketpair in socket.o
  "_sscanf", referenced from:
      _setipaddr in socket.o
  "_str_modify", referenced from:
      _sock_bind in socket.o
      _sock_connect in socket.o
  "_str_new", referenced from:
      _mkhostent in socket.o
      _s_recv in socket.o
      _sock_accept in socket.o
      _bsock_getpeername in socket.o
      _bsock_getsockname in socket.o
      _bsock_getsockopt in socket.o
  "_str_new2", referenced from:
      _mkhostent in socket.o
      _sock_gethostname in socket.o
      _tcpaddr in socket.o
      _s_recv in socket.o
      _tcp_s_getaddress in socket.o
      _unix_peeraddr in socket.o
      _unix_addr in socket.o
      ...
  "_str_taint", referenced from:
      _s_recv in socket.o
  "_strcmp", referenced from:
      _setipaddr in socket.o
      _setup_domain_and_type in socket.o
  "_strdup", referenced from:
      _open_unix in socket.o
      _unix_path in socket.o
  "_strncpy", referenced from:
      _open_unix in socket.o
  "_strtoul", referenced from:
      _open_inet in socket.o
  "_thread_fd_writable", referenced from:
      _bsock_send in socket.o
  "_thread_schedule", referenced from:
      _s_accept in socket.o
      _sock_connect in socket.o
      _bsock_send in socket.o
  "_thread_select", referenced from:
      _open_inet in socket.o
  "_thread_wait_fd", referenced from:
      _s_recv in socket.o
      _s_accept in socket.o
  "_trap_immediate", referenced from:
      _s_recv in socket.o
      _s_accept in socket.o
  "_xmalloc", referenced from:
      _sock_s_socketpair in socket.o
      _sock_s_for_fd in socket.o
      _s_accept in socket.o
      _sock_s_open in socket.o
      _open_unix in socket.o
      _open_inet in socket.o
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture i386
make[1]: *** [socket.so] Error 1
compiling md5
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386     -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5init.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5init.c
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5init.c: In function ‘md5_clone’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5init.c:56: warning: incompatible implicit declaration of built-in function ‘memset’
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5init.c: In function ‘md5_new’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5init.c:69: warning: passing argument 2 of ‘rb_scan_args’ makes pointer from integer without a cast
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5init.c:72: warning: incompatible implicit declaration of built-in function ‘memset’
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386     -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5c.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5c.c
ld  -o md5.so /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5init.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/md5/md5c.o  
ld: warning: -macosx_version_min not specified, assuming 10.7
Undefined symbols for architecture i386:
  "___stack_chk_fail", referenced from:
      _md5_digest in md5init.o
      _MD5Final in md5c.o
  "___stack_chk_guard", referenced from:
      _md5_digest in md5init.o
      _MD5Final in md5c.o
      _md5_digest in md5init.o
      _MD5Final in md5c.o
  "_cObject", referenced from:
      _Init_md5 in md5init.o
  "_data_object_alloc", referenced from:
      _md5_clone in md5init.o
      _md5_new in md5init.o
  "_rb_check_type", referenced from:
      _md5_clone in md5init.o
      _md5_digest in md5init.o
      _md5_update in md5init.o
      _md5_new in md5init.o
  "_rb_class_of", referenced from:
      _md5_clone in md5init.o
  "_rb_define_class", referenced from:
      _Init_md5 in md5init.o
  "_rb_define_method", referenced from:
      _Init_md5 in md5init.o
  "_rb_define_singleton_method", referenced from:
      _Init_md5 in md5init.o
  "_rb_scan_args", referenced from:
      _md5_new in md5init.o
  "_str_new", referenced from:
      _md5_digest in md5init.o
  "_xmalloc", referenced from:
      _md5_clone in md5init.o
      _md5_new in md5init.o
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture i386
make[1]: *** [md5.so] Error 1
compiling marshal
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386     -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.c
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.c: In function ‘w_float’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.c:140: warning: incompatible implicit declaration of built-in function ‘strlen’
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.c: In function ‘w_symbol’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.c:157: warning: incompatible implicit declaration of built-in function ‘strlen’
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.c: In function ‘marshal_dump’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.c:410: warning: passing argument 2 of ‘rb_scan_args’ makes pointer from integer without a cast
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.c: In function ‘r_bytes0’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.c:534: warning: incompatible implicit declaration of built-in function ‘memcpy’
ld  -o marshal.so /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/marshal/marshal.o  
ld: warning: -macosx_version_min not specified, assuming 10.7
Undefined symbols for architecture i386:
  "_ArgError", referenced from:
      _r_object in marshal.o
  "_Fail", referenced from:
      _w_object in marshal.o
  "_Fatal", referenced from:
      _r_object in marshal.o
      _w_object in marshal.o
  "_TypeError", referenced from:
      _marshal_load in marshal.o
      _r_long in marshal.o
      _r_symbol in marshal.o
      _r_object in marshal.o
      _marshal_dump in marshal.o
      _w_object in marshal.o
  "_Warning", referenced from:
      _marshal_load in marshal.o
  "___sprintf_chk", referenced from:
      _w_object in marshal.o
  "___stack_chk_fail", referenced from:
      _r_string in marshal.o
      _r_symbol in marshal.o
      _r_object in marshal.o
      _w_object in marshal.o
  "___stack_chk_guard", referenced from:
      _r_string in marshal.o
      _r_symbol in marshal.o
      _r_object in marshal.o
      _w_object in marshal.o
  "_ary_new2", referenced from:
      _r_object in marshal.o
  "_ary_push", referenced from:
      _r_object in marshal.o
  "_atof", referenced from:
      _r_object in marshal.o
  "_big_norm", referenced from:
      _r_object in marshal.o
  "_cArray", referenced from:
      _w_object in marshal.o
  "_cBignum", referenced from:
      _r_object in marshal.o
  "_cHash", referenced from:
      _w_object in marshal.o
  "_cIO", referenced from:
      _marshal_load in marshal.o
      _marshal_dump in marshal.o
  "_cRegexp", referenced from:
      _w_object in marshal.o
  "_cString", referenced from:
      _w_object in marshal.o
  "_eof_error", referenced from:
      _r_object in marshal.o
  "_float_new", referenced from:
      _r_object in marshal.o
  "_fread", referenced from:
      _r_string in marshal.o
      _r_symbol in marshal.o
      _r_object in marshal.o
  "_fwrite$UNIX2003", referenced from:
      _w_symbol in marshal.o
      _w_object in marshal.o
  "_getc", referenced from:
      _marshal_load in marshal.o
      _r_long in marshal.o
      _r_symbol in marshal.o
      _r_object in marshal.o
  "_hash_aset", referenced from:
      _r_object in marshal.o
  "_hash_new", referenced from:
      _r_object in marshal.o
  "_io_binmode", referenced from:
      _marshal_load in marshal.o
      _marshal_dump in marshal.o
  "_io_readable", referenced from:
      _marshal_load in marshal.o
  "_io_writable", referenced from:
      _marshal_dump in marshal.o
  "_memcpy", referenced from:
      _r_string in marshal.o
      _r_symbol in marshal.o
      _r_object in marshal.o
  "_num2int", referenced from:
      _marshal_dump in marshal.o
  "_obj_alloc", referenced from:
      _r_object in marshal.o
  "_obj_is_kind_of", referenced from:
      _marshal_load in marshal.o
      _marshal_dump in marshal.o
  "_putc", referenced from:
      _w_byte in marshal.o
      _marshal_dump in marshal.o
      _w_long in marshal.o
      _w_symbol in marshal.o
      _w_object in marshal.o
  "_rb_class2name", referenced from:
      _r_object in marshal.o
      _w_object in marshal.o
  "_rb_class_of", referenced from:
      _w_object in marshal.o
  "_rb_class_path", referenced from:
      _w_object in marshal.o
  "_rb_define_module", referenced from:
      _Init_marshal in marshal.o
  "_rb_define_module_function", referenced from:
      _Init_marshal in marshal.o
  "_rb_ensure", referenced from:
      _marshal_load in marshal.o
      _marshal_dump in marshal.o
  "_rb_funcall", referenced from:
      _r_object in marshal.o
      _w_object in marshal.o
  "_rb_id2name", referenced from:
      _r_object in marshal.o
      _w_symbol in marshal.o
  "_rb_intern", referenced from:
      _Init_marshal in marshal.o
      _r_symbol in marshal.o
      _r_object in marshal.o
      _w_unique in marshal.o
      _w_object in marshal.o
  "_rb_ivar_get", referenced from:
      _r_object in marshal.o
      _w_object in marshal.o
  "_rb_ivar_set", referenced from:
      _r_object in marshal.o
  "_rb_newobj", referenced from:
      _r_object in marshal.o
  "_rb_path2class", referenced from:
      _r_object in marshal.o
  "_rb_respond_to", referenced from:
      _r_object in marshal.o
      _w_object in marshal.o
  "_rb_scan_args", referenced from:
      _marshal_dump in marshal.o
  "_rb_special_const_p", referenced from:
      _r_object in marshal.o
      _w_object in marshal.o
  "_rb_type", referenced from:
      _marshal_load in marshal.o
      _r_object in marshal.o
      _w_object in marshal.o
  "_reg_new", referenced from:
      _r_object in marshal.o
  "_st_foreach", referenced from:
      _w_object in marshal.o
  "_st_free_table", referenced from:
      _load_ensure in marshal.o
      _dump_ensure in marshal.o
  "_st_init_numtable", referenced from:
      _marshal_load in marshal.o
      _marshal_dump in marshal.o
  "_st_insert", referenced from:
      _r_symbol in marshal.o
      _r_object in marshal.o
      _w_symbol in marshal.o
      _w_object in marshal.o
  "_st_lookup", referenced from:
      _r_symbol in marshal.o
      _r_object in marshal.o
      _w_symbol in marshal.o
      _w_object in marshal.o
  "_str_cat", referenced from:
      _w_byte in marshal.o
      _marshal_dump in marshal.o
      _w_long in marshal.o
      _w_symbol in marshal.o
      _w_object in marshal.o
  "_str_new", referenced from:
      _r_string in marshal.o
      _marshal_dump in marshal.o
  "_str_taint", referenced from:
      _r_string in marshal.o
  "_strlen", referenced from:
      _w_symbol in marshal.o
      _w_object in marshal.o
  "_struct_alloc", referenced from:
      _r_object in marshal.o
  "_struct_aset", referenced from:
      _r_object in marshal.o
  "_xmalloc", referenced from:
      _r_object in marshal.o
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture i386
make[1]: *** [marshal.so] Error 1
compiling kconv
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386     -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/kconv/kconv.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/kconv/kconv.c
ld  -o kconv.so /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/kconv/kconv.o  
ld: warning: -macosx_version_min not specified, assuming 10.7
Undefined symbols for architecture i386:
  "_num2int", referenced from:
      _kconv_kconv in kconv.o
  "_rb_check_type", referenced from:
      _kconv_tosjis in kconv.o
      _kconv_toeuc in kconv.o
      _kconv_tojis in kconv.o
      _kconv_kconv in kconv.o
  "_rb_define_const", referenced from:
      _Init_kconv in kconv.o
  "_rb_define_module", referenced from:
      _Init_kconv in kconv.o
  "_rb_define_module_function", referenced from:
      _Init_kconv in kconv.o
  "_rb_scan_args", referenced from:
      _kconv_kconv in kconv.o
  "_str_new", referenced from:
      _kconv_tosjis in kconv.o
      _kconv_toeuc in kconv.o
      _kconv_tojis in kconv.o
      _kconv_kconv in kconv.o
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture i386
make[1]: *** [kconv.so] Error 1
compiling fcntl
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386     -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/fcntl/fcntl.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/fcntl/fcntl.c
ld  -o fcntl.so /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/fcntl/fcntl.o  
ld: warning: -macosx_version_min not specified, assuming 10.7
Undefined symbols for architecture i386:
  "_int2inum", referenced from:
      _Init_fcntl in fcntl.o
  "_rb_define_const", referenced from:
      _Init_fcntl in fcntl.o
  "_rb_define_module", referenced from:
      _Init_fcntl in fcntl.o
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture i386
make[1]: *** [fcntl.so] Error 1
compiling etc
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386  -DHAVE_GETLOGIN -DHAVE_GETPWENT -DHAVE_GETGRENT   -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/etc/etc.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/etc/etc.c
ld  -o etc.so /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/etc/etc.o  
ld: warning: -macosx_version_min not specified, assuming 10.7
Undefined symbols for architecture i386:
  "_Fail", referenced from:
      _etc_getgrnam in etc.o
      _etc_getgrgid in etc.o
      _etc_passwd in etc.o
      _etc_getpwnam in etc.o
      _etc_getpwuid in etc.o
  "_ary_new", referenced from:
      _setup_group in etc.o
  "_ary_push", referenced from:
      _setup_group in etc.o
  "_endgrent", referenced from:
      _etc_group in etc.o
  "_endpwent", referenced from:
      _etc_passwd in etc.o
  "_getenv", referenced from:
      _etc_getlogin in etc.o
  "_getgrent", referenced from:
      _etc_group in etc.o
  "_getgrgid", referenced from:
      _etc_getgrgid in etc.o
  "_getgrnam", referenced from:
      _etc_getgrnam in etc.o
  "_getlogin", referenced from:
      _etc_getlogin in etc.o
  "_getpwent", referenced from:
      _etc_passwd in etc.o
  "_getpwnam", referenced from:
      _etc_getpwnam in etc.o
  "_getpwuid", referenced from:
      _etc_getpwuid in etc.o
  "_getuid", referenced from:
      _etc_getpwuid in etc.o
  "_iterator_p", referenced from:
      _etc_group in etc.o
      _etc_passwd in etc.o
  "_num2int", referenced from:
      _etc_getgrgid in etc.o
      _etc_getpwuid in etc.o
  "_rb_check_type", referenced from:
      _etc_getgrnam in etc.o
      _etc_getpwnam in etc.o
  "_rb_define_module", referenced from:
      _Init_etc in etc.o
  "_rb_define_module_function", referenced from:
      _Init_etc in etc.o
  "_rb_global_variable", referenced from:
      _Init_etc in etc.o
  "_rb_scan_args", referenced from:
      _etc_getpwuid in etc.o
  "_rb_sys_fail", referenced from:
      _setup_passwd in etc.o
  "_rb_yield", referenced from:
      _etc_group in etc.o
      _etc_passwd in etc.o
  "_setgrent", referenced from:
      _etc_group in etc.o
  "_setpwent", referenced from:
      _etc_passwd in etc.o
  "_str_new2", referenced from:
      _setup_group in etc.o
      _setup_passwd in etc.o
      _etc_getlogin in etc.o
  "_struct_define", referenced from:
      _Init_etc in etc.o
  "_struct_new", referenced from:
      _setup_group in etc.o
      _setup_passwd in etc.o
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture i386
make[1]: *** [etc.so] Error 1
compiling dbm
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386  -DHAVE_DBM_OPEN   -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/dbm/dbm.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/dbm/dbm.c
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/dbm/dbm.c: In function ‘fdbm_s_open’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/dbm/dbm.c:82: warning: incompatible implicit declaration of built-in function ‘memset’
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/dbm/dbm.c: In function ‘fdbm_store’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/dbm/dbm.c:273: warning: passing argument 1 of ‘rb_sys_fail’ makes pointer from integer without a cast
ld -L/usr/local/lib -o dbm.so /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/dbm/dbm.o  -lgdbm
ld: warning: -macosx_version_min not specified, assuming 10.7
ld: warning: ignoring file /usr/local/lib/libgdbm.dylib, file was built for unsupported file format ( 0xcf 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 1 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (i386): /usr/local/lib/libgdbm.dylib
Undefined symbols for architecture i386:
  "_Fail", referenced from:
      _fdbm_to_a in dbm.o
      _fdbm_has_key in dbm.o
      _fdbm_values in dbm.o
      _fdbm_keys in dbm.o
      _fdbm_fetch in dbm.o
      _fdbm_has_value in dbm.o
      _fdbm_clear in dbm.o
      ...
  "___error", referenced from:
      _fdbm_store in dbm.o
  "_ary_new", referenced from:
      _fdbm_to_a in dbm.o
      _fdbm_values in dbm.o
      _fdbm_keys in dbm.o
  "_ary_new2", referenced from:
      _fdbm_indexes in dbm.o
  "_ary_push", referenced from:
      _fdbm_to_a in dbm.o
      _fdbm_values in dbm.o
      _fdbm_keys in dbm.o
      _fdbm_indexes in dbm.o
  "_assoc_new", referenced from:
      _fdbm_to_a in dbm.o
      _fdbm_shift in dbm.o
      _fdbm_each_pair in dbm.o
      _fdbm_delete_if in dbm.o
  "_cObject", referenced from:
      _Init_dbm in dbm.o
  "_data_object_alloc", referenced from:
      _fdbm_s_open in dbm.o
  "_dbm_clearerr", referenced from:
      _fdbm_store in dbm.o
  "_dbm_close", referenced from:
      _fdbm_close in dbm.o
      _free_dbm in dbm.o
  "_dbm_delete", referenced from:
      _fdbm_clear in dbm.o
      _fdbm_shift in dbm.o
      _fdbm_delete_if in dbm.o
      _fdbm_delete in dbm.o
  "_dbm_fetch", referenced from:
      _fdbm_to_a in dbm.o
      _fdbm_has_key in dbm.o
      _fdbm_values in dbm.o
      _fdbm_fetch in dbm.o
      _fdbm_has_value in dbm.o
      _fdbm_shift in dbm.o
      _fdbm_each_value in dbm.o
      ...
  "_dbm_firstkey", referenced from:
      _fdbm_empty_p in dbm.o
      _fdbm_length in dbm.o
      _fdbm_to_a in dbm.o
      _fdbm_values in dbm.o
      _fdbm_keys in dbm.o
      _fdbm_has_value in dbm.o
      _fdbm_clear in dbm.o
      ...
  "_dbm_nextkey", referenced from:
      _fdbm_empty_p in dbm.o
      _fdbm_length in dbm.o
      _fdbm_to_a in dbm.o
      _fdbm_values in dbm.o
      _fdbm_keys in dbm.o
      _fdbm_has_value in dbm.o
      _fdbm_clear in dbm.o
      ...
  "_dbm_open", referenced from:
      _fdbm_s_open in dbm.o
  "_dbm_store", referenced from:
      _fdbm_store in dbm.o
  "_iterator_p", referenced from:
      _fdbm_delete in dbm.o
  "_mEnumerable", referenced from:
      _Init_dbm in dbm.o
  "_memcmp", referenced from:
      _fdbm_has_value in dbm.o
  "_num2int", referenced from:
      _fdbm_s_open in dbm.o
  "_obj_as_string", referenced from:
      _fdbm_store in dbm.o
  "_rb_check_safe_str", referenced from:
      _fdbm_s_open in dbm.o
  "_rb_check_type", referenced from:
      _fdbm_empty_p in dbm.o
      _fdbm_length in dbm.o
      _fdbm_to_a in dbm.o
      _fdbm_has_key in dbm.o
      _fdbm_values in dbm.o
      _fdbm_keys in dbm.o
      _fdbm_fetch in dbm.o
      ...
  "_rb_define_alias", referenced from:
      _Init_dbm in dbm.o
  "_rb_define_class", referenced from:
      _Init_dbm in dbm.o
  "_rb_define_method", referenced from:
      _Init_dbm in dbm.o
  "_rb_define_singleton_method", referenced from:
      _Init_dbm in dbm.o
  "_rb_include_module", referenced from:
      _Init_dbm in dbm.o
  "_rb_scan_args", referenced from:
      _fdbm_s_open in dbm.o
  "_rb_secure", referenced from:
      _fdbm_clear in dbm.o
      _fdbm_shift in dbm.o
      _fdbm_delete_if in dbm.o
      _fdbm_delete in dbm.o
      _fdbm_store in dbm.o
  "_rb_sys_fail", referenced from:
      _fdbm_store in dbm.o
      _fdbm_s_open in dbm.o
  "_rb_test_false_or_nil", referenced from:
      _fdbm_delete_if in dbm.o
  "_rb_to_a", referenced from:
      _fdbm_indexes in dbm.o
  "_rb_yield", referenced from:
      _fdbm_each_key in dbm.o
      _fdbm_each_value in dbm.o
      _fdbm_each_pair in dbm.o
      _fdbm_delete_if in dbm.o
      _fdbm_delete in dbm.o
  "_str_new", referenced from:
      _fdbm_to_a in dbm.o
      _fdbm_values in dbm.o
      _fdbm_keys in dbm.o
      _fdbm_fetch in dbm.o
      _fdbm_shift in dbm.o
      _fdbm_each_key in dbm.o
      _fdbm_each_value in dbm.o
      ...
  "_str_taint", referenced from:
      _fdbm_to_a in dbm.o
      _fdbm_values in dbm.o
      _fdbm_keys in dbm.o
      _fdbm_fetch in dbm.o
      _fdbm_shift in dbm.o
      _fdbm_each_key in dbm.o
      _fdbm_each_value in dbm.o
      ...
  "_xmalloc", referenced from:
      _fdbm_s_open in dbm.o
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture i386
make[1]: *** [dbm.so] Error 1
compiling curses
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
gcc -fpic -I/Users/kenta-murata/Downloads/ruby-1.0-971225.git -g -O2 -arch i386 -I/usr/include/ncurses -I/usr/local/include/ncurses -DHAVE_NCURSES_H -DHAVE_ISENDWIN -DHAVE_UNGETCH -DHAVE_BEEP   -c -o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/curses/curses.o /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/curses/curses.c
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/curses/curses.c: In function ‘prep_window’:
/Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/curses/curses.c:77: warning: incompatible implicit declaration of built-in function ‘memset’
ld -L/usr/local/lib -o curses.so /Users/kenta-murata/Downloads/ruby-1.0-971225.git/ext/curses/curses.o  -lncurses
ld: warning: -macosx_version_min not specified, assuming 10.7
Undefined symbols for architecture i386:
  "_Fail", referenced from:
      _window_deleteln in curses.o
      _curses_deleteln in curses.o
      _window_delch in curses.o
      _curses_delch in curses.o
      _window_getstr in curses.o
      _curses_getstr in curses.o
      _window_getch in curses.o
      ...
  "___stack_chk_fail", referenced from:
      _window_getstr in curses.o
      _curses_getstr in curses.o
  "___stack_chk_guard", referenced from:
      _window_getstr in curses.o
      _curses_getstr in curses.o
  "_cObject", referenced from:
      _Init_curses in curses.o
  "_data_object_alloc", referenced from:
      _window_subwin in curses.o
      _window_s_new in curses.o
      _curses_init_screen in curses.o
  "_num2int", referenced from:
      _window_insch in curses.o
      _curses_insch in curses.o
      _window_addch in curses.o
      _curses_addch in curses.o
      _window_setpos in curses.o
      _curses_setpos in curses.o
      _window_move in curses.o
      ...
  "_rb_check_type", referenced from:
      _window_deleteln in curses.o
      _window_delch in curses.o
      _window_getstr in curses.o
      _window_getch in curses.o
      _window_addstr in curses.o
      _window_addstr2 in curses.o
      _window_insch in curses.o
      ...
  "_rb_define_alias", referenced from:
      _Init_curses in curses.o
  "_rb_define_class_under", referenced from:
      _Init_curses in curses.o
  "_rb_define_method", referenced from:
      _Init_curses in curses.o
  "_rb_define_module", referenced from:
      _Init_curses in curses.o
  "_rb_define_module_function", referenced from:
      _Init_curses in curses.o
  "_rb_define_singleton_method", referenced from:
      _Init_curses in curses.o
  "_rb_notimplement", referenced from:
      _curses_closed in curses.o
  "_str_new2", referenced from:
      _window_getstr in curses.o
      _curses_getstr in curses.o
  "_str_taint", referenced from:
      _window_getstr in curses.o
      _curses_getstr in curses.o
  "_xmalloc", referenced from:
      _window_subwin in curses.o
      _window_s_new in curses.o
      _curses_init_screen in curses.o
  "start", referenced from:
     -u command line option
ld: symbol(s) not found for inferred architecture i386
make[1]: *** [curses.so] Error 1

ギャー!拡張ライブラリのリンクで大量のエラーが〜><

拡張ライブラリはビルドできてませんが、肝心の ruby そのものはビルドできたみたいです。

ruby -v

こうして、念願の ruby -v を拝めます。

$ ./ruby -v
ruby - version 1.0-971225 (-)

さいごに

本稿では、15年前にリリースされた Ruby 1.0 を入手し、ビルドし、ruby -vを実行するまでの一部始終を報告しました。

私がこの記事を作成するにあたって Ruby 1.0 に対して行った変更はgithub/mrkn/ruby10に push してあります。Ruby 1.0 に興味を持たれた方は、このリポジトリを fork して遊んでみてください。

それでは、メリークリスマス。

21
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
21
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?