]> git.tdb.fi Git - builder.git/blobdiff - source/component.cpp
Check for missing symlinks
[builder.git] / source / component.cpp
index 708293e7575da7e4ef67ca3e9fc0217f9ea7ab7a..3f8b004ce172af9a96b36ee6af13d7a586c6de75 100644 (file)
@@ -30,13 +30,10 @@ Component::Component(SourcePackage &p, Type t, const string &n):
        deflt(true)
 { }
 
-void Component::configure(const StringMap &opts, unsigned flag)
+void Component::prepare()
 {
-       for(StringList::iterator i=sources.begin(); i!=sources.end(); ++i)
-               *i = (pkg.get_source()/pkg.expand_string(*i)).str();
-
        for(PackageList::const_iterator i=requires.begin(); i!=requires.end(); ++i)
-               (*i)->configure(opts, flag&2);
+               (*i)->prepare();
 }
 
 void Component::create_build_info()
@@ -66,7 +63,11 @@ void Component::create_build_info()
        for(BuildInfo::PathList::iterator i=build_info.libpath.begin(); i!=build_info.libpath.end(); ++i)
                *i = (pkg.get_source() / *i).str();
 
-       if(pkg.get_library_mode()!=DYNAMIC)
+       if(type==LIBRARY || type==MODULE)
+               if(build_info.libmode<BuildInfo::DYNAMIC)
+                       build_info.libmode = BuildInfo::DYNAMIC;
+
+       if(build_info.libmode<BuildInfo::DYNAMIC)
        {
                for(PackageList::iterator i=all_reqs.begin(); i!=all_reqs.end(); ++i)
                {
@@ -74,9 +75,6 @@ void Component::create_build_info()
                        build_info.libpath.insert(build_info.libpath.end(), ebi.libpath.begin(), ebi.libpath.end());
                }
        }
-
-       if(type==PROGRAM)
-               build_info.strip = lexical_cast<bool>(pkg.get_config().get_option("strip").value);
 }
 
 void Component::create_targets() const
@@ -222,6 +220,7 @@ PathList Component::collect_source_files() const
                FS::Path path(*i);
                if(FS::is_dir(path))
                {
+                       pkg.get_builder().get_logger().log("files", format("Traversing %s", path));
                        list<string> sfiles = list_files(path);
                        for(list<string>::iterator j=sfiles.begin(); j!=sfiles.end(); ++j)
                                files.push_back(path / *j);
@@ -247,7 +246,7 @@ Component::Loader::Loader(Component &c):
 
 void Component::Loader::source(const string &s)
 {
-       obj.sources.push_back(s);
+       obj.sources.push_back((obj.pkg.get_source()/s).str());
 }
 
 void Component::Loader::require(const string &n)