X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fpackage.cpp;h=0bea2a96b03048c4d476815b56a799d7270526f2;hb=57bdb055acb0453c75b22cb64f35cc0e817a2827;hp=c5e0ffc3428b6629645c7ae3698f000c8a0560f4;hpb=40eb101a642b9ed2e898eec39e0916fa71066b23;p=builder.git diff --git a/source/package.cpp b/source/package.cpp index c5e0ffc..0bea2a9 100644 --- a/source/package.cpp +++ b/source/package.cpp @@ -31,6 +31,16 @@ void Package::set_path(const Msp::Path::Path &p) path=builder.get_cwd()/p; } +Msp::Path::Path Package::get_temp_dir() const +{ + return source/config.get_option("tempdir").value/config.get_option("profile").value; +} + +Msp::Path::Path Package::get_out_dir() const +{ + return source/config.get_option("outdir").value; +} + /** Checks which kinds of things the components of this package install. @@ -55,6 +65,19 @@ unsigned Package::get_install_flags() return flags; } +LibMode Package::get_library_mode() const +{ + const string &mode=config.get_option("staticlibs").value; + if(mode=="all") + return ALL_STATIC; + else if(mode=="local") + return LOCAL_STATIC; + else if(mode=="none") + return DYNAMIC; + else + throw Exception("Unknown library mode"); +} + /** Tries to resolve all references to dependency packages. */ @@ -91,11 +114,18 @@ void Package::configure(const RawOptionMap &opts, unsigned flag) { init_config(); - if(flag && config.process(opts) && !builder.get_dry_run()) + RawOptionMap::const_iterator prof=opts.find("profile"); + if(prof!=opts.end()) + config.select_profile(prof->second); + else + config.select_last_profile(); + + if(flag && config.update(opts)) { if(builder.get_verbose()>=2) cout<<"Configuration of "<get_package() && i->get_package()->get_need_path()) config.add_option(i->get_name()+"_path", "", "Path for "+i->get_name()); - config.load(source/".options.cache"); + config.set_source(source); } /**