- bool changed = false;
- for(OptionMap::iterator i=options.begin(); i!=options.end(); ++i)
- {
- Option &opt = i->second;
- string::size_type dollar = 0;
- while((dollar = opt.value.find('$', dollar))!=string::npos)
- {
- string::size_type end;
- string var;
- if(opt.value[dollar+1]=='{')
- {
- end = opt.value.find('}', dollar+2);
- if(end==string::npos)
- throw Exception("Unterminated variable reference");
- var = opt.value.substr(dollar+2, end-dollar-2);
- ++end;
- }
- else
- {
- for(end=dollar+1; (isalnum(opt.value[end]) && opt.value[end]!='_'); ++end) ;
- var = opt.value.substr(dollar+1, end-dollar-1);
- }
-
- string value;
- if(is_option(var))
- value = get_option(var).value;
- else if(var=="arch")
- value = package.get_builder().get_current_arch().get_name();
- else if(const char *ptr = getenv(var.c_str()))
- value = ptr;
-
- opt.value.replace(dollar, end-dollar, value);
-
- dollar += value.size();
- changed = true;
- }
- }
+ package.get_builder().get_logger().log("files", format("Reading %s", fn));
+ IO::BufferedFile in(fn.str());