]> git.tdb.fi Git - builder.git/blobdiff - source/sourcepackage.cpp
Some fixes to library and header searching
[builder.git] / source / sourcepackage.cpp
index caedaf673c2d5a9ef6bc8b305f896bbb85da0d0d..ef4fd5760a26fd1a90f7fb077d3256612c4b9fca 100644 (file)
@@ -19,7 +19,7 @@ using namespace Msp;
 /**
 Creates a buildable package.
 */
-SourcePackage::SourcePackage(Builder &b, const string &n, const Path::Path &s):
+SourcePackage::SourcePackage(Builder &b, const string &n, const Path &s):
        Package(b, n),
        source(s),
        config(*this),
@@ -28,12 +28,12 @@ SourcePackage::SourcePackage(Builder &b, const string &n, const Path::Path &s):
        tar_files.push_back(source/"Build");
 }
 
-Msp::Path::Path SourcePackage::get_temp_dir() const
+Msp::Path SourcePackage::get_temp_dir() const
 {
        return source/config.get_option("tempdir").value/config.get_option("profile").value;
 }
 
-Msp::Path::Path SourcePackage::get_out_dir() const
+Msp::Path SourcePackage::get_out_dir() const
 {
        return source/config.get_option("outdir").value;
 }
@@ -106,7 +106,8 @@ void SourcePackage::do_configure(const StringMap &opts, unsigned flag)
                {
                        const StringList &reqs=i->get_requires();
                        for(StringList::const_iterator j=reqs.begin(); j!=reqs.end(); ++j)
-                               requires.push_back(builder.get_package(*j));
+                               if(Package *pkg=builder.get_package(*j))
+                                       requires.push_back(pkg);
                }
 
        base_reqs=requires;
@@ -164,7 +165,7 @@ void SourcePackage::init_config()
        {
                BinaryPackage *bpkg=dynamic_cast<BinaryPackage *>(*i);
                if(bpkg && bpkg->get_need_path())
-                       config.add_option(bpkg->get_name()+"_path", "", "Path for "+bpkg->get_name());
+                       config.add_option(bpkg->get_name()+"_path", "/usr", "Path for "+bpkg->get_name());
        }
 }
 
@@ -194,9 +195,9 @@ void SourcePackage::create_build_info()
        unsigned flags=get_install_flags();
 
        if(flags&INCLUDE)
-               export_binfo.incpath.push_back((Path::Path(config.get_option("prefix").value)/"include").str());
+               export_binfo.incpath.push_back((Path(config.get_option("prefix").value)/"include").str());
        if(flags&LIB)
-               export_binfo.libpath.push_back((Path::Path(config.get_option("prefix").value)/"lib").str());
+               export_binfo.libpath.push_back((Path(config.get_option("prefix").value)/"lib").str());
 
        string optimize=config.get_option("optimize").value;
        if(lexical_cast<unsigned>(optimize))