X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuilder.cpp;h=21e7dcdf629c4a97780059c5d1615cb12dca60b2;hb=b3b2a8666defb9e1a5937bcfefc1bc8e02793aab;hp=15c9e5455f84e0946fc01ef8c569181063d79394;hpb=69ad3610053e140cb5108f53e4c46a0583e33559;p=builder.git diff --git a/source/builder.cpp b/source/builder.cpp index 15c9e54..21e7dcd 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -5,12 +5,13 @@ Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ -#include #include #include #include #include #include +#include +#include #include #include #include @@ -217,7 +218,7 @@ Target *Builder::get_header(const string &include, const string &arch, const str StringList argv; argv.push_back(get_architecture(arch).get_tool("CXX")); argv.push_back("--version"); - cxx_ver=Regex(" ([0-9.]+) ").match(run_command(argv))[1].str; + cxx_ver=Regex("[0-9]\\.[0-9.]+").match(run_command(argv))[0].str; while(!cxx_ver.empty() && !exists(Path("/usr/include/c++")/cxx_ver)) { unsigned dot=cxx_ver.rfind('.'); @@ -234,8 +235,6 @@ Target *Builder::get_header(const string &include, const string &arch, const str cout<<"Looking for include "<::const_iterator j=path.begin(); (!tgt && j!=path.end()); ++j) tgt=get_header(cwd/ *j/fn); for(list::const_iterator j=syspath.begin(); (!tgt && j!=syspath.end()); ++j) @@ -472,9 +473,8 @@ Loads the given build file. */ int Builder::load_build_file(const Path &fn) { - ifstream in(fn.str().c_str()); - if(!in) - return -1; + IO::File inf(fn.str()); + IO::Buffered in(inf); if(verbose>=3) cout<<"Reading "<