]> git.tdb.fi Git - builder.git/blobdiff - source/builder.cpp
Use IO::BufferedFile where appropriate
[builder.git] / source / builder.cpp
index 286f53b049cf8284b770821b0098fe58a4f2c77c..9be7f6c8eec3cbf57c5dc67d9556ec7a5c8c68a2 100644 (file)
@@ -139,6 +139,7 @@ Builder::Builder(int argc, char **argv):
        native_arch->set_tool("LXX", "g++");
        native_arch->set_tool("AR",  "ar");
 
+       load_build_file((FS::get_sys_data_dir(argv[0], "builder")/"builderrc").str());
        load_build_file((FS::get_home_dir()/".builderrc").str());
 
        if(arch.empty())
@@ -225,7 +226,8 @@ returned.
 Target *Builder::get_header(const string &include, const string &from, const list<string> &path)
 {
        string hash(8, 0);
-       update_hash(hash, from);
+       if(include[0]=='\"')
+               update_hash(hash, from);
        for(list<string>::const_iterator i=path.begin(); i!=path.end(); ++i)
                update_hash(hash, *i);
 
@@ -261,7 +263,7 @@ Target *Builder::get_header(const string &include, const string &from, const lis
                syspath.push_back("/usr/include");
        else
                syspath.push_back("/usr/"+current_arch->get_prefix()+"/include");
-       syspath.push_back((FS::Path("/usr/include/c++/")/cxx_ver/fn).str());
+       syspath.push_back((FS::Path("/usr/include/c++/")/cxx_ver).str());
 
        Target *tgt=0;
        if(include[0]=='\"')
@@ -545,8 +547,7 @@ int Builder::load_build_file(const FS::Path &fn)
 {
        try
        {
-               IO::File inf(fn.str());
-               IO::Buffered in(inf);
+               IO::BufferedFile in(fn.str());
 
                if(verbose>=3)
                        cout<<"Reading "<<fn<<'\n';