hiroshi hatake
cosmo****@gmail*****
2014年 9月 7日 (日) 18:09:47 JST
畑ケです。 すみません、時間が空いてしまいました。 色々と試してみました。 >>> 予想なんですが、MroongaかGroongaがやっているチェックの中で何 >>> かのフラグを変更していて、それがビルドエラーの引き金になって >>> いるんではないかと思っています。で、↑のcmakeの出力を見ると >>> Mroonga/Groongaが追加でチェックしている項目を見つけることが >>> できると思っています。 >> ... > 別のアプローチでもいいですか? > > a. MroongaなしMariaDBで本当にstorage/connect/tabwmi.cppがビ > ルドされているか確認する。 > > storage/connect/tabwmi.cppの > length[0] = max(length[0], len); > の次の行に > #error Built! > というのを入れてビルドし、「Built!」というエラーメッセー > ジでビルドが失敗したらMroongaなしのMariaDBでも本当にビル > ドしている。 > > → Mroongaなしのときはなにかしらの方法でmax()を定義してい > るはず ●Mroongaを外したMariaDBで本当にstorage/connect/tabwmi.cppがビルドされて いるか確認する こちらは↓ --- diff --git a/storage/connect/tabwmi.cpp b/storage/connect/tabwmi.cpp index e47df02..fc96560 100644 --- a/storage/connect/tabwmi.cpp +++ b/storage/connect/tabwmi.cpp @@ -201,6 +201,7 @@ PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info) len = (unsigned)SysStringLen(propname); length[0] = max(length[0], len); + #error Built!! } // enfor i res = SafeArrayDestroy(prnlist); --- === mkdir build-vc2013--32 cd build-vc2013-zip-32 cmake ..\source -G "Visual Studio 12" > config.log cmake --build . --config RelWithDebInfo > build.log === としてビルドすると、 tabwmi.cpp C:\Code\mrncheck\mariadb-10.0.13-with-mroonga-4.05-for-windows\storage\connect\tabwmi.cpp(203): error C3861: 'max': 識別子が見つかりませんでした [C:\Code\mrncheck\build-vc2013-config-without-mroonga-32\storage\connect\connect.vcxproj] C:\Code\mrncheck\mariadb-10.0.13-with-mroonga-4.05-for-windows\storage\connect\tabwmi.cpp(204): fatal error C1189: #error : Built!! [C:\Code\mrncheck\build-vc2013-config-without-mroonga-32\storage\connect\connect.vcxproj] tabmac.cpp となってビルドに失敗します。 →> rmdir storage\mroonga した後のMariaDB-10.0.13でもstorage/connect/tabwmi.cppがビルドされていま した。 https://dl.dropboxusercontent.com/u/36753409/MroongaBuildLog/Mroonga-Built/build-error-built.log > b. MroongaなしMariaDBでmax()がどこで定義されているかを確認す > る。 > > storage/connect/tabwmi.cppの > length[0] = max(length[0], len); > の次の行に > #define max(a, b) a > というのを入れると > > warning C4005: 'max' : マクロが再定義されました。 > > という警告がでて、このメッセージの周辺にどこでmax()が定義 > されていたかの情報がでるはず > > → Mroongaなしのときはどこで定義されているmax()を使ってい > るかがわかる。それをヒントにどうしてMroongaありのときは > max()が定義されていないのかを調べる ●MariaDBでmax()がどこで定義されているかを確認(rmdir storage\mroongaの場合) ◆VS2013の場合 次は以下のように変更を加えてみました: --- diff --git a/storage/connect/tabwmi.cpp b/storage/connect/tabwmi.cpp index e47df02..8293684 100644 --- a/storage/connect/tabwmi.cpp +++ b/storage/connect/tabwmi.cpp @@ -201,6 +201,7 @@ PQRYRES WMIColumns(PGLOBAL g, char *nsp, char *cls, bool info) len = (unsigned)SysStringLen(propname); length[0] = max(length[0], len); + #define max(a, b) a } // enfor i res = SafeArrayDestroy(prnlist); --- === mkdir build-redefine-max-vc2013 cd build-redefine-max-vc2013 cmake ..\source -G "Visual Studio 12" > config.log cmake --build . --config RelWithDebInfo > build.log === そしてビルドした時に出たログのstorage/connect/tabwmi.cpp周辺を覗くと: --- tabwmi.cpp C:\Code\mrncheck\mariadb-10.0.13-with-mroonga-4.05-for-windows\storage\connect\tabwmi.cpp(203): error C3861: 'max': 識別子が見つかりませんでした [C:\Code\mrncheck\build-vc2013-redefine-add-32\storage\connect\connect.vcxproj] tabmac.cpp --- https://dl.dropboxusercontent.com/u/36753409/MroongaBuildLog/Mroonga-Built/build-redefine-vc2013.log 出て…ないですね…。 maxが見つからない問題はそのままでした。 ◆VS2010の場合 では、VS2010では?と思ったのでそれも試してみました。 === mkdir build-redefine-max-vc2010 cd build-redefine-max-vc2010 cmake ..\source -G "Visual Studio 10" > config.log cmake --build . --config RelWithDebInfo > build.log === --- 167> xobject.cpp 167> tabwmi.cpp 167> tabmac.cpp --- https://dl.dropboxusercontent.com/u/36753409/MroongaBuildLog/Mroonga-Built/build-redefine-vc2010.log 出てないですね。。。 ●MariaDBでmax()がどこで定義されているかを確認(MariaDB-10.0.13のlocale.cc へBOMを入れてビルド) 更に今度はMariaDB-10.0.13のsql\locale.ccを with BOMで保存したものを VS2013でビルドしてみました。 === mkdir build-vc2013-zip-32 cd build-vc2013-zip-32 cmake ..\mariadb-10.0.13 -G "Visual Studio 12" > config.log cmake --build . --config RelWithDebInfo > build.log === --- tabwmi.cpp C:\Code\mrncheck\mariadb-10.0.13\mariadb-10.0.13\storage\connect\tabwmi.cpp(203): error C3861: 'max': 識別子が見つかりませんでした [C:\Code\mrncheck\mariadb-10.0.13\build-redefine-max-vc2013\storage\connect\connect.vcxproj] tabmac.cpp --- maxという識別子が見つからない問題がここでも出ました。 https://dl.dropboxusercontent.com/u/36753409/MroongaBuildLog/Mroonga-Built/build-mariadb-only-vc2013.log ここまで試した結果からするとMariaDB側でVS2013ではビルドできなくなってい るように見えるんですが、 どうでしょうか?