]> git.tdb.fi Git - builder.git/blobdiff - source/builder.cpp
Initialize Component::install to false
[builder.git] / source / builder.cpp
index e6f036b7028f409ec0851615d068152dd1547966..2c137ca406841a1159269851f8177261504c91c9 100644 (file)
@@ -132,7 +132,8 @@ Package *Builder::get_package(const string &n)
        
        Package *pkg=Package::create(*this, n);
        packages.insert(PackageMap::value_type(n, pkg));
-       new_pkgs.push_back(pkg);
+       if(pkg)
+               new_pkgs.push_back(pkg);
 
        return pkg;
 }
@@ -216,17 +217,12 @@ int Builder::main()
 
        std::list<std::string> missing;
        for(PackageMap::iterator i=packages.begin(); i!=packages.end(); ++i)
-       {
-               const list<PackageRef> &requires=i->second->get_requires();
-               for(list<PackageRef>::const_iterator j=requires.begin(); j!=requires.end(); ++j)
-                       if(!j->get_package())
-                               missing.push_back(j->get_name());
-       }
+               if(!i->second)
+                       missing.push_back(i->first);
 
        if(!missing.empty())
        {
                missing.sort();
-               missing.unique();
                cerr<<"The following packages were not found on the system:\n";
                for(list<string>::iterator i=missing.begin(); i!=missing.end(); ++i)
                        cerr<<"  "<<*i<<'\n';
@@ -305,6 +301,10 @@ int Builder::create_targets()
                if(!i->second->get_buildable())
                        continue;
 
+               Path::Path inst_base;
+               if(i->second->get_config().is_option("prefix"))
+                       inst_base=i->second->get_config().get_option("prefix").value;
+
                const ComponentList &components=i->second->get_components();
                for(ComponentList::const_iterator j=components.begin(); j!=components.end(); ++j)
                {
@@ -317,8 +317,6 @@ int Builder::create_targets()
                                        files.push_back(*k / *l);
                        }
 
-                       Path::Path inst_base=i->second->get_config().get_option("prefix").value;
-
                        bool build_exe=j->get_type()!=Component::HEADERS;
                        
                        list<ObjectFile *> objs;