g++4.4 でコンフィギュレータをビルドする

TOPPERSプロジェクトからダウンロードしたCQ-STARM用カーネル(ターゲット非依存部1.3.2)のコンフィギュレータをUbuntu 10.04でビルドしようとすると、makeに失敗します。エラーメッセージを見るとこんな感じ。

builtin_function.cpp: In function ‘toppers::<unnamed>::var_t toppers::bf_dump(const toppers::text_line&, const std::vector<std::vector<toppers::macro_processor::element, std::allocator<toppers::macro_processor::element> >, std::allocator<std::vector<toppers::macro_processor::element, std::allocator<toppers::macro_processor::element> > > >&, const toppers::<unnamed>::context*)’:
builtin_function.cpp:520: error: ‘stdout’ was not declared in this scope
builtin_function.cpp:520: error: ‘fputs’ was not declared in this scope
builtin_function.cpp:524: error: ‘stderr’ was not declared in this scope
builtin_function.cpp:524: error: ‘fputs’ was not declared in this scope
builtin_function.cpp:528: error: ‘FILE’ is not a member of ‘std’
builtin_function.cpp:528: error: ‘stream’ was not declared in this scope
builtin_function.cpp:528: error: ‘fopen’ is not a member of ‘std’
builtin_function.cpp:531: error: ‘fputs’ was not declared in this scope
builtin_function.cpp:532: error: ‘fclose’ is not a member of ‘std’

g++のバージョンは4.4.3です。この問題はg++がインクルード・ファイルの整理を進めているためで、TOPPERS/ASPのコンフィギュレータが暗黙にインクルードしていたcstdioがインクルードされなくなったのが原因です。同様の問題は「g++4.3でコンフィギュレータをビルドできない」として、TOPPERS/JSPでも挙げられています。

この問題はasp/cfg/toppers/builtin_function.cppに

  1. #include <cstdio>

を追加することで解決します。