def custom_expand(val, conf)
      val.gsub!(/\$\(([^()]+)\)/) do |var|
        key = $1
        if CONFIG.key? key
          custom_expand(conf[key], conf)
        else
          var
        end
      end
      val
    end
def custom_expand(val, conf)
      val.gsub!(/\$\(([^()]+)\)/) do |var|
        key = $1
        if CONFIG.key? key
          custom_expand(conf[key], conf)
        else
          var
        end
      end
      val
    end
altered copy of rbconfig.rb -> Config::expand