Add default `host` target for cross compiling.
You don't have to define explicit `host` build target any more.
MODIFY
lib/mruby/build.rb
lib/mruby/build.rb
@@ -370,6 +370,17 @@ EOS
attr_accessor :host_target, :build_target
def initialize(name, build_dir=nil, &block)
+ unless MRuby.targets['host']
+ # add minimal 'host'
+ MRuby::Build.new('host') do |conf|
+ if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
+ toolchain :visualcpp
+ else
+ toolchain :gcc
+ end
+ conf.gem :core => 'mruby-bin-mrbc'
+ end
+ end
@endian = nil
@test_runner = Command::CrossTestRunner.new(self)
super

MODIFY
target/ArduinoDue.rb
target/ArduinoDue.rb
-MRuby::Build.new do |conf|
-
- # Gets set by the VS command prompts.
- if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
- toolchain :visualcpp
- else
- toolchain :gcc
- end
-
- enable_debug
-
- # include the default GEMs
- conf.gembox 'default'
-
-end
-
# Cross Compiling configuration for Arduino Due
# http://arduino.cc/en/Main/ArduinoBoardDue
#

MODIFY
target/IntelGalileo.rb
target/IntelGalileo.rb
-MRuby::Build.new do |conf|
-
- # Gets set by the VS command prompts.
- if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
- toolchain :visualcpp
- else
- toolchain :gcc
- end
-
- enable_debug
-
- # include the default GEMs
- conf.gembox 'default'
-
-end
-
-
# Cross Compiling configuration for Intel Galileo on Arduino environment
# http://arduino.cc/en/ArduinoCertified/IntelGalileo
#

MODIFY
target/RX630.rb
target/RX630.rb
-MRuby::Build.new do |conf|
-
- # Gets set by the VS command prompts.
- if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
- toolchain :visualcpp
- else
- toolchain :gcc
- end
-
- enable_debug
-
- # include the default GEMs
- conf.gembox 'default'
-
-end
-
# Cross Compiling configuration for RX630
# http://gadget.renesas.com/
#

MODIFY
target/android_arm64-v8a.rb
target/android_arm64-v8a.rb
-MRuby::Build.new do |conf|
-
- # Gets set by the VS command prompts.
- if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
- toolchain :visualcpp
- else
- toolchain :gcc
- end
-
- enable_debug
-
- # include the default GEMs
- conf.gembox 'default'
-end
-
# Requires Android NDK r13 or later.
MRuby::CrossBuild.new('android-arm64-v8a') do |conf|
params = {

MODIFY
target/android_armeabi.rb
target/android_armeabi.rb
-MRuby::Build.new do |conf|
-
- # Gets set by the VS command prompts.
- if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
- toolchain :visualcpp
- else
- toolchain :gcc
- end
-
- enable_debug
-
- # include the default GEMs
- conf.gembox 'default'
-end
-
# Requires Android NDK r13 or later.
MRuby::CrossBuild.new('android-armeabi') do |conf|
params = {

MODIFY
target/android_armeabi_v7a_neon_hard.rb
target/android_armeabi_v7a_neon_hard.rb
-MRuby::Build.new do |conf|
-
- # Gets set by the VS command prompts.
- if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
- toolchain :visualcpp
- else
- toolchain :gcc
- end
-
- enable_debug
-
- # include the default GEMs
- conf.gembox 'default'
-end
-
# Requires Android NDK r13 or later.
MRuby::CrossBuild.new('android-armeabi-v7a-neon-hard') do |conf|
params = {

MODIFY
target/chipKITMax32.rb
target/chipKITMax32.rb
-MRuby::Build.new do |conf|
-
- # Gets set by the VS command prompts.
- if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
- toolchain :visualcpp
- else
- toolchain :gcc
- end
-
- enable_debug
-
- # include the default GEMs
- conf.gembox 'default'
-
-end
-
# Cross Compiling configuration for Digilent chipKIT Max32
# http://www.digilentinc.com/Products/Detail.cfm?Prod=CHIPKIT-MAX32
#

MODIFY
target/cross-32bit.rb
target/cross-32bit.rb
# Define cross build settings
-MRuby::CrossBuild.new('32bit') do |conf|
+MRuby::CrossBuild.new('cross-32bit') do |conf|
toolchain :gcc
conf.cc.flags << "-m32"
conf.linker.flags << "-m32"
- conf.build_mrbtest_lib_only
+ # conf.build_mrbtest_lib_only
- conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
+ conf.gem :core => "mruby-bin-mruby"
+ conf.gem "#{MRUBY_ROOT}/examples/mrbgems/c_and_ruby_extension_example"
conf.test_runner.command = 'env'
end

MODIFY
target/dreamcast_shelf.rb
target/dreamcast_shelf.rb
-MRuby::Build.new do |conf|
- # Gets set by the VS command prompts
- if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
- toolchain :visualcpp
- else
- toolchain :gcc
- end
-
- enable_debug
-
- # Include the default GEMs
- conf.gembox 'default'
-end
-
# Cross Compiling configuration for the Sega Dreamcast
# This configuration requires KallistiOS (KOS)
# https://dreamcast.wiki

Add default `host` target for cross compiling.

You don't have to define explicit `host` build target any more.