X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbuilder.cpp;h=63323310c5226d152b2e064b58c1df4ff099069f;hb=3f541fceb5aeb5d685ceb2363ebbca1cb1c3eb84;hp=c0574e924d51512ba5af04ff11e14517e78bebf0;hpb=30b1243ff16b908ae18b4ab9d70f772c9196b949;p=builder.git diff --git a/source/builder.cpp b/source/builder.cpp index c0574e9..6332331 100644 --- a/source/builder.cpp +++ b/source/builder.cpp @@ -50,7 +50,8 @@ Builder::Builder(int argc, char **argv): conf_all(false), conf_only(false), build_all(false), - create_makefile(false) + create_makefile(false), + tempdir("temp") { string analyze_mode; string work_dir; @@ -58,6 +59,7 @@ Builder::Builder(int argc, char **argv): unsigned max_depth = 5; StringList cmdline_warn; string prfx; + string temp_str; string arch; bool no_externals = false; unsigned verbose = 1; @@ -88,6 +90,7 @@ Builder::Builder(int argc, char **argv): getopt.add_option( "full-paths", full_paths, GetOpt::NO_ARG).set_help("Output full paths in analysis."); getopt.add_option( "max-depth", max_depth, GetOpt::REQUIRED_ARG).set_help("Maximum depth to show in analysis.", "NUM"); getopt.add_option( "prefix", prfx, GetOpt::REQUIRED_ARG).set_help("Directory to install things to.", "DIR"); + getopt.add_option( "tempdir", temp_str, GetOpt::REQUIRED_ARG).set_help("Store temporary files in DIR.", "DIR"); getopt.add_option( "warnings", cmdline_warn, GetOpt::REQUIRED_ARG).set_help("Compiler warnings to use.", "LIST"); usagemsg = getopt.generate_usage(argv[0])+" [ ...]"; helpmsg = getopt.generate_help(); @@ -187,6 +190,9 @@ Builder::Builder(int argc, char **argv): else prefix = FS::getcwd()/prfx; + if(!temp_str.empty()) + tempdir = temp_str; + if(!build_type_name.empty()) { BuildTypeMap::iterator i = build_types.find(build_type_name); @@ -276,6 +282,10 @@ int Builder::main() logger.log("environment", format("Building on %s, for %s%s", native_arch.get_name(), current_arch->get_name(), (current_arch->is_native() ? " (native)" : ""))); logger.log("environment", format("Prefix is %s", prefix)); + if(tempdir.is_absolute()) + logger.log("environment", format("Temporary directory is %s", tempdir)); + else + logger.log("environment", format("Using per-package temporary directory %s", tempdir)); if(build_type) logger.log("environment", format("Build type is %s", build_type->get_name())); @@ -640,7 +650,11 @@ void Builder::Loader::package(const string &n) if(!obj.main_pkg) obj.main_pkg = pkg; - load_sub(*pkg); + if(obj.conf_all || pkg==obj.main_pkg) + load_sub(*pkg, obj.cmdline_options); + else + load_sub(*pkg); + if(obj.build_type) pkg->set_build_type(*obj.build_type); }