From: nobuyoshi nakada Date: 2005-10-25T17:30:50+09:00 Subject: [ruby-dev:27512] Re: [ ruby-Bugs-2613 ] building ruby 1.8.3 on Solaris なかだです。 At Tue, 25 Oct 2005 15:52:04 +0900, U.Nakamura wrote in [ruby-dev:27510]: > ここで、元の人は、VC++用のruby本体DLLのインポートライブラリを > 持ってきて、reimpというMinGWのユーティリティを使って、インポ > ートライブラリをMinGW用に変換しています。 > しかし、reimpによる変換はどうやら完璧ではないらしく、正しいイ > ンポートライブラリを生成できていません。 > よって、この正しくないインポートライブラリを使って構築した拡 > 張ライブラリ my_test.so は、実行時に正しく動的リンクが解決さ > れないので正常には動作しません。 インポートライブラリもそうですが、ヘッダはどうしたんでしょうね。 あのくらいなら違いが問題になるような部分は使ってないのかな。も しヘッダもライブラリと一緒に流用しているのであれば、config.hに 吸収させるという手もあるかも。 config.hもコンパイルしなおさないとダメですが、最低でも -DRUBY_EXTERN=__declspec(dllimport) とすれば逃げられるでしょう。 どうもmkmf.rbも使っていないような雰囲気だし。 # というかrbconfig.rbはどうしようもないはず。 Index: configure.in =================================================================== RCS file: /cvs/ruby/src/ruby/configure.in,v retrieving revision 1.212.2.35 diff -U2 -p -r1.212.2.35 configure.in --- configure.in 6 Sep 2005 23:22:56 -0000 1.212.2.35 +++ configure.in 24 Oct 2005 09:36:47 -0000 @@ -1347,5 +1347,5 @@ case "$target_os" in ;; esac - XCFLAGS="$XCFLAGS" + XCFLAGS="$XCFLAGS -DRUBY_EXPORT" LIBRUBY_DLDFLAGS="${DLDFLAGS}"' -Wl,--out-implib=$(LIBRUBY)' LIBRUBY_ALIASES='' Index: defines.h =================================================================== RCS file: /cvs/ruby/src/ruby/defines.h,v retrieving revision 1.37.2.7 diff -U2 -p -u -r1.37.2.7 defines.h --- defines.h 2 Jul 2005 09:13:41 -0000 1.37.2.7 +++ defines.h 25 Oct 2005 07:17:15 -0000 @@ -192,9 +192,6 @@ void xfree _((void*)); #endif +#ifdef RUBY_EXPORT #undef RUBY_EXTERN -#if defined _WIN32 && !defined __GNUC__ -# ifndef RUBY_EXPORT -# define RUBY_EXTERN extern __declspec(dllimport) -# endif #endif Index: bcc32/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/bcc32/Makefile.sub,v retrieving revision 1.42.2.27 diff -U2 -p -r1.42.2.27 Makefile.sub --- bcc32/Makefile.sub 18 Aug 2005 03:50:45 -0000 1.42.2.27 +++ bcc32/Makefile.sub 24 Oct 2005 09:23:57 -0000 @@ -223,4 +223,5 @@ $(CONFIG_H): $(MKFILES) $(srcdir)bcc32/M \#define HAVE_STDARG_PROTOTYPES 1 \#define NORETURN(x) x +\#define RUBY_EXTERN __declspec(dllimport) \#define HAVE_DECL_SYS_NERR 1 \#define HAVE_LIMITS_H 1 Index: win32/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/win32/Makefile.sub,v retrieving revision 1.59.2.27 diff -U2 -p -r1.59.2.27 Makefile.sub --- win32/Makefile.sub 31 Aug 2005 05:43:51 -0000 1.59.2.27 +++ win32/Makefile.sub 24 Oct 2005 09:22:00 -0000 @@ -208,4 +208,5 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/ #define NORETURN(x) __declspec(noreturn) x !endif +#define RUBY_EXTERN __declspec(dllimport) #define HAVE_DECL_SYS_NERR 1 #define HAVE_LIMITS_H 1 Index: wince/Makefile.sub =================================================================== RCS file: /cvs/ruby/src/ruby/wince/Makefile.sub,v retrieving revision 1.16.2.19 diff -U2 -p -r1.16.2.19 Makefile.sub --- wince/Makefile.sub 3 Aug 2005 15:27:13 -0000 1.16.2.19 +++ wince/Makefile.sub 24 Oct 2005 09:41:57 -0000 @@ -216,4 +216,5 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/wince/ #define NORETURN(x) __declspec(noreturn) x !endif +#define RUBY_EXTERN __declspec(dllimport) #define HAVE_DECL_SYS_NERR 1 #define HAVE_FCNTL_H 1 -- --- 僕の前にBugはない。 --- 僕の後ろにBugはできる。 中田 伸悦