From: sh@... Date: 2010-03-21T01:00:02+09:00 Subject: [ruby-dev:40722] Re: [ruby-cvs:33760] Ruby:r26545 (trunk): Wed Feb 3 10:12:09 2010 Aaron Patterson こんばんは sheepman です。 > > 確認ありがとうございます。 > テスト結果はだいたい同じ感じですね。 > > > twitter では素の libffi もいけたという話ですが、 > * http://github.com/atgreen/libffi/ を > * cygwin で path/to/configure --enable-shared --enable-static \ > CC=path/to/msvcc.sh LD=link \ > CPP=\"cl -nologo -EP\" を実行し、 > * コマンドプロンプトから make > という話ですか? > > MSYS ベースの壊れた環境持ちにはいまいち前提条件が > わからなかったんですよね。 > cygwin ではなくてWindows のコマンドプロンプトから MSYS だけを使いました。 またWindowsの動的ライブラリの探索がどのように行われるのかわからなかったので、 --diable-shared でビルドしました。詳しくは以下の通りです。 0. あらかじめ ruby 1.9 を、使用する Visual Studio でビルドしてインストールしておく。 1. MSYS をインストール http://downloads.sourceforge.net/mingw/MSYS-1.0.11.exe . C:\msys\1.0\bin を環境変数PATHに追加する。 2. http://sourceforge.net/projects/mingw/files/ から bison と make をインストール。念のため次のスクリプトを cygpath としてインストール http://synfig.org/wiki/Dev:Mingw_installation#cygpath_emulation 。 3. コマンドプロンプトを開いて "C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\Tools\vsvars32" を実行 4. libffi を git で c:\src\libffi に入手。c:\src\libffi へ移動。 5. コマンドプロンプトから README に書いてある通り sh configure --prefix=/c/usr/local --disable-shared --enable-static CC=/c/src/libffi/msvcc.sh LD=link CPP="cl -nologo -EP" を実行。 6. make を実行。 c:\src\libffi\.libs に libffi.lib が出来る。 7. https://github.com/tenderlove/ruby/tree/ffi からソースを入手。ext/dl/ に c:\src\libffi\.libs\libffi.lib と c:\src\libffi\include\ffi.h と c:\src\libffi\include\ffitarget.h をコピー。libffi.lib を ffi.lib へ名前変更。 8. closure.c に #define USE_NEW_CLOSURE_API 1 を書き加える。 9. ruby extconf.rb 実行。 nmake 実行。