diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-02-07 15:52:58 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2019-02-07 15:52:58 +0900 |
| commit | e199df032dc7db1e9d7ee29ea5e57b57d3b486a2 (patch) | |
| tree | 9ae42402f97b65443e7cc00424b85e0445a6ef18 /mrbgems/mruby-bin-config/mrbgem.rake | |
| parent | 6397ec727feb053e9251d75efdc3b0ba9c397eef (diff) | |
| parent | 8c22911c861c13cf53510d7e713cb12d042599f3 (diff) | |
| download | mruby-e199df032dc7db1e9d7ee29ea5e57b57d3b486a2.tar.gz mruby-e199df032dc7db1e9d7ee29ea5e57b57d3b486a2.zip | |
Merge branch 'rename-bin-mruby-config-to-bin-config' of https://github.com/shuujii/mruby into shuujii-rename-bin-mruby-config-to-bin-config
Diffstat (limited to 'mrbgems/mruby-bin-config/mrbgem.rake')
| -rw-r--r-- | mrbgems/mruby-bin-config/mrbgem.rake | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/mrbgems/mruby-bin-config/mrbgem.rake b/mrbgems/mruby-bin-config/mrbgem.rake new file mode 100644 index 000000000..b9ba0e42c --- /dev/null +++ b/mrbgems/mruby-bin-config/mrbgem.rake @@ -0,0 +1,17 @@ +MRuby.each_target do + next if kind_of? MRuby::CrossBuild + + mruby_config = 'mruby-config' + (ENV['OS'] == 'Windows_NT' ? '.bat' : '') + mruby_config_path = "#{build_dir}/bin/#{mruby_config}" + @bins << mruby_config + + make_cfg = "#{build_dir}/lib/libmruby.flags.mak" + file mruby_config_path => [libmruby_static, make_cfg] do |t| + FileUtils.copy "#{File.dirname(__FILE__)}/#{mruby_config}", t.name + config = Hash[open(make_cfg).read.split("\n").map {|x| a = x.split(/\s*=\s*/, 2); [a[0], a[1].gsub('\\"', '"') ]}] + IO.write(t.name, File.open(t.name) {|f| + f.read.gsub (/echo (MRUBY_CFLAGS|MRUBY_LIBS|MRUBY_LDFLAGS_BEFORE_LIBS|MRUBY_LDFLAGS|MRUBY_LIBMRUBY_PATH)/) {|x| config[$1].empty? ? '' : "echo #{config[$1]}"} + }) + FileUtils.chmod(0755, t.name) + end +end |
