diff options
-rw-r--r-- | mkconfig.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mkconfig.rb b/mkconfig.rb index c83e5f8d8f..2e346c15af 100644 --- a/mkconfig.rb +++ b/mkconfig.rb @@ -83,7 +83,22 @@ end print v_fast, v_others print <<EOS CONFIG["compile_dir"] = "#{Dir.pwd}" - MAKEFILE_CONFIG = CONFIG.dup + MAKEFILE_CONFIG = {} + CONFIG.each{|k,v| MAKEFILE_CONFIG[k] = v.dup} + def Config::expand(val) + val.gsub!(/\\$\\(([^()]+)\\)/) do |var| + key = $1 + if CONFIG.key? key + "\#{Config::expand(CONFIG[\\\"\#{key}\\\"])}" + else + var + end + end + val + end + CONFIG.each_value do |val| + Config::expand(val) + end end EOS config.close |