]> git.tdb.fi Git - builder.git/commitdiff
Adjust to library changes
authorMikko Rasa <tdb@tdb.fi>
Thu, 1 Sep 2011 06:13:16 +0000 (06:13 +0000)
committerMikko Rasa <tdb@tdb.fi>
Thu, 1 Sep 2011 06:13:16 +0000 (06:13 +0000)
Avoid conflict with multiple files with same name

Build
bootstrap.sh
source/builder.cpp
source/builder.h
source/config.cpp
source/dependencycache.cpp
source/objectfile.cpp
source/sourcefile.cpp

diff --git a/Build b/Build
index c2548aa62f02f3dab6ffac65055319e1356399ad..a446a23658b8033700fc2573c5d94526c3171f40 100644 (file)
--- a/Build
+++ b/Build
@@ -6,7 +6,6 @@ package "builder"
        description "Mikkosoft Productions software builder";
 
        require "mspcore";
-       require "mspstrings";
        require "mspdatafile";
        require "mspfs";
        require "sigc++-2.0";
index 7b96c9639c1bf3aa58032e53cc04d13a79fe4cc9..26b8b31ba7c17f96557504e4f5a16b63d80a2a2e 100755 (executable)
@@ -3,7 +3,7 @@
 
 set -e
 
-REQUIRED="core datafile fs strings io"
+REQUIRED="core datafile"
 CFLAGS="-Iinclude `pkg-config --cflags sigc++-2.0`"
 LIBS="`pkg-config --libs sigc++-2.0` -lpthread"
 if [ -e /usr/lib/libdl.so ]; then
index dac7bb84a43c6f68c577331b2294955309982f08..3c58f0245ecc773fa4945a9f6c614409b94151c6 100644 (file)
@@ -587,7 +587,7 @@ int Builder::load_build_file(const FS::Path &fn)
                Loader loader(*this, fn.subpath(0, fn.size()-1));
                loader.load(parser);
        }
-       catch(const IO::FileNotFound &)
+       catch(const IO::file_not_found &)
        {
                return -1;
        }
@@ -867,7 +867,6 @@ void Builder::package_help()
        }
 }
 
-Application::RegApp<Builder> Builder::reg;
 string Builder::usagemsg;
 string Builder::helpmsg;
 
index 6835299b4ac464807240565fd231731d80b2edd0..a4fc14b5d8b8343c99ca7fbacb0db7faafe7a73b 100644 (file)
@@ -30,7 +30,7 @@ class VirtualTarget;
 /**
 The main application class.  Controls and owns everything.  Rules the world.
 */
-class Builder: public Msp::Application
+class Builder: public Msp::RegisteredApplication<Builder>
 {
 private:
        class Loader: public Msp::DataFile::Loader
@@ -101,7 +101,6 @@ private:
        Msp::FS::Path prefix;
        StringList warnings;
 
-       static Msp::Application::RegApp<Builder> reg;
        static std::string usagemsg;
        static std::string helpmsg;
 
index dd5cda148dea67a838e73d0d720fb47cdea6c966..0676dedd94a8e2e486e619a529e1be65679fe5cb 100644 (file)
@@ -52,7 +52,7 @@ void Config::select_last_profile()
                in.getline(profile);
                set_option("profile", profile);
        }
-       catch(const IO::FileNotFound &)
+       catch(const IO::file_not_found &)
        { }
 
        freeze_mtime = true;
@@ -143,7 +143,7 @@ void Config::load()
                Loader loader(*this);
                loader.load(parser);
        }
-       catch(const IO::FileNotFound &)
+       catch(const IO::file_not_found &)
        { }
 }
 
index ffc6fd63fbc7291c289395f9230abc78a83378ca..7505e9889a15154b35a05313f8ed13b7e8db0e13 100644 (file)
@@ -70,6 +70,6 @@ void DependencyCache::load()
 
                mtime = Time::TimeStamp::from_unixtime(FS::stat(fn).st_mtime);
        }
-       catch(const IO::FileNotFound &)
+       catch(const IO::file_not_found &)
        { }
 }
index f3d6183afa6b01161b1039af0bb6f838d571e5d8..cd870592530f74b0220b6e5ed9692c090db16e8b 100644 (file)
@@ -19,7 +19,7 @@ using namespace std;
 using namespace Msp;
 
 ObjectFile::ObjectFile(Builder &b, const Component &c, SourceFile &s):
-       FileTarget(b, &c.get_package(), generate_target_path(c, FS::basename(s.get_path()))),
+       FileTarget(b, &c.get_package(), generate_target_path(c, FS::relative(s.get_path(), c.get_package().get_source()).str())),
        comp(c),
        source(s)       
 {
@@ -78,5 +78,11 @@ Action *ObjectFile::create_action()
 FS::Path ObjectFile::generate_target_path(const Component &comp, const string &src)
 {
        const SourcePackage &pkg = comp.get_package();
-       return pkg.get_temp_dir()/comp.get_name()/(FS::basepart(src)+".o");
+       string fn = FS::basepart(src)+".o";
+       if(!fn.compare(0, 2, "./"))
+               fn.erase(0, 2);
+       for(string::iterator i=fn.begin(); i!=fn.end(); ++i)
+               if(*i=='/')
+                       *i = '_';
+       return pkg.get_temp_dir()/comp.get_name()/fn;
 }
index d95ea5edc5f3678d1f1c0eb1926a50866ab22311..0fc989d0f5a78927acce28f38050c0feddc7f09d 100644 (file)
@@ -68,7 +68,7 @@ void SourceFile::find_depends()
 
                        deps_cache.set_deps(relname, includes);
                }
-               catch(const IO::FileNotFound &)
+               catch(const IO::file_not_found &)
                {
                        if(builder.get_verbose()>=4)
                                IO::print("Failed to read includes from %s\n", path.str());