X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fsourcepackage.cpp;h=ef4fd5760a26fd1a90f7fb077d3256612c4b9fca;hb=0a0a538e8500381a803f5ecd4168df2f4b2252b1;hp=caedaf673c2d5a9ef6bc8b305f896bbb85da0d0d;hpb=0ac8d6708b8c758fb89d97a0049d4a329990b83b;p=builder.git diff --git a/source/sourcepackage.cpp b/source/sourcepackage.cpp index caedaf6..ef4fd57 100644 --- a/source/sourcepackage.cpp +++ b/source/sourcepackage.cpp @@ -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(*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(optimize))