Snow LeopardでSafariのプラグインが動かない

昨日、WebKitPluginWithSimpleGUIはビルドしなおしたら動いたので
自分で作ったプラグインも同じようにしたら動くと思ったがなぜか動かない。
なんかボケてるのか?

Safariを32ビットモードで起動すると動く

試しにSafariを32ビットモードで起動すると問題なく動作するが、なんの解決にもならない。
64ビットで動かないと...


アクティブアーキテクチャx86_64でビルドしてみた

アクティブアーキテクチャx86_64でビルドすると、CarbonのAPIがリンクでエラーになる。
WebKitPluginWithSimpleGUIは、アクティブアーキテクチャx86で動いたので
ここは変える必要は無いだろう。

エラーになった関数
  "_OpenPicture", referenced from:
  "_CopyBits", referenced from:
  "_GetMainDevice", referenced from:
  "_ClosePicture", referenced from:
  "_KillPicture", referenced from:

アクティブアーキテクチャx86でビルド

アクティブアーキテクチャx86でビルドするとCarbon APIを使っている部分はワーニングになる。

warning: 'GetMainDevice' is deprecated (declared at /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:3314)
warning: 'OpenPicture' is deprecated (declared at /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:1908)
warning: 'CopyBits' is deprecated (declared at /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:1822)
warning: 'ClosePicture' is deprecated (declared at /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:1941)
warning: 'KillPicture' is deprecated (declared at /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/ApplicationServices.framework/Frameworks/QD.framework/Headers/QuickdrawAPI.h:1990)

動いた


ビルド設定のアーキテクチャを下記のようにすると動作した。


「アクティブアーキテクチャのみをビルド」がONになっていたのがマズかったんだな。


この設定ではCarbon APIは使えない。
幸い、CarbonのAPIが残っていた部分は未使用の部分だったので問題なし。

他のバージョンのMac OSでも動作するか?

Mac OS X Safari 結果 説明
10.6 Snow Leopard 4.0.3 OK
10.5.8 Leopard 4.0.2 OK
10.4 Tiger 未確認
10.3.9 Panther 1.3.1 NG 拡張子がwebpluginのファイルはディレクトリとして認識してしまう。