Create a `mruby-config` that can be run on the host by cross-building
The output directory will be `host-bin`, so it will be output as `<build-dir>/host-bin/mruby-config`.
It's still not available for target devices.
-if MRuby::Build.current.kind_of?(MRuby::CrossBuild)
- gemname = File.basename File.dirname __FILE__
- buildname = MRuby::Build.current.name
- $stderr.puts "WARN #{gemname} - This mrbgem is ignored within #{buildname}"
-else
+iscross = MRuby::Build.current.kind_of?(MRuby::CrossBuild)
+
MRuby::Gem::Specification.new('mruby-bin-config') do |spec|
name = 'mruby-config'
spec.license = 'MIT'
spec.author = 'mruby developers'
spec.summary = "#{name} command"
+ if iscross
+ mruby_config_dir = "#{build.build_dir}/host-bin"
+ else
mruby_config_dir = "#{build.build_dir}/bin"
+ end
mruby_config = name + (ENV['OS'] == 'Windows_NT' ? '.bat' : '')
mruby_config_path = "#{mruby_config_dir}/#{mruby_config}"
make_cfg = "#{build.build_dir}/lib/libmruby.flags.mak"
tmplt_path = "#{__dir__}/#{mruby_config}"
+
+ if iscross
+ build.products << mruby_config_path
+ else
build.bins << mruby_config
+ end
directory mruby_config_dir
@@ -27,4 +33,3 @@ else
chmod(0755, t.name)
end
end
-end
