From: Mikko Rasa Date: Thu, 1 Sep 2011 06:13:16 +0000 (+0000) Subject: Adjust to library changes X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=409a427f912f9c203b102beed0816b53b250931f;p=builder.git Adjust to library changes Avoid conflict with multiple files with same name --- diff --git a/Build b/Build index c2548aa..a446a23 100644 --- 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"; diff --git a/bootstrap.sh b/bootstrap.sh index 7b96c96..26b8b31 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -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 diff --git a/source/builder.cpp b/source/builder.cpp index dac7bb8..3c58f02 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -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::reg; string Builder::usagemsg; string Builder::helpmsg; diff --git a/source/builder.h b/source/builder.h index 6835299..a4fc14b 100644 --- a/source/builder.h +++ b/source/builder.h @@ -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 { private: class Loader: public Msp::DataFile::Loader @@ -101,7 +101,6 @@ private: Msp::FS::Path prefix; StringList warnings; - static Msp::Application::RegApp reg; static std::string usagemsg; static std::string helpmsg; diff --git a/source/config.cpp b/source/config.cpp index dd5cda1..0676ded 100644 --- a/source/config.cpp +++ b/source/config.cpp @@ -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 &) { } } diff --git a/source/dependencycache.cpp b/source/dependencycache.cpp index ffc6fd6..7505e98 100644 --- a/source/dependencycache.cpp +++ b/source/dependencycache.cpp @@ -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 &) { } } diff --git a/source/objectfile.cpp b/source/objectfile.cpp index f3d6183..cd87059 100644 --- a/source/objectfile.cpp +++ b/source/objectfile.cpp @@ -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; } diff --git a/source/sourcefile.cpp b/source/sourcefile.cpp index d95ea5e..0fc989d 100644 --- a/source/sourcefile.cpp +++ b/source/sourcefile.cpp @@ -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());