1MRuby::Build.new do |conf| 2 # load specific toolchain settings 3 4 # Gets set by the VS command prompts. 5 if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] 6 toolchain :visualcpp 7 else 8 toolchain :gcc 9 end 10 11 # Turn on `enable_debug` for better debugging 12 # enable_debug 13 14 # Use mrbgems 15 # conf.gem 'examples/mrbgems/ruby_extension_example' 16 # conf.gem 'examples/mrbgems/c_extension_example' do |g| 17 # g.cc.flags << '-g' # append cflags in this gem 18 # end 19 # conf.gem 'examples/mrbgems/c_and_ruby_extension_example' 20 # conf.gem :core => 'mruby-eval' 21 # conf.gem :mgem => 'mruby-io' 22 # conf.gem :github => 'iij/mruby-io' 23 # conf.gem :git => 'git@github.com:iij/mruby-io.git', :branch => 'master', :options => '-v' 24 25 # include the default GEMs 26 conf.gembox 'default' 27 # C compiler settings 28 # conf.cc do |cc| 29 # cc.command = ENV['CC'] || 'gcc' 30 # cc.flags = [ENV['CFLAGS'] || %w()] 31 # cc.include_paths = ["#{root}/include"] 32 # cc.defines = %w() 33 # cc.option_include_path = '-I%s' 34 # cc.option_define = '-D%s' 35 # cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}" 36 # end 37 38 # mrbc settings 39 # conf.mrbc do |mrbc| 40 # mrbc.compile_options = "-g -B%{funcname} -o-" # The -g option is required for line numbers 41 # end 42 43 # Linker settings 44 # conf.linker do |linker| 45 # linker.command = ENV['LD'] || 'gcc' 46 # linker.flags = [ENV['LDFLAGS'] || []] 47 # linker.flags_before_libraries = [] 48 # linker.libraries = %w() 49 # linker.flags_after_libraries = [] 50 # linker.library_paths = [] 51 # linker.option_library = '-l%s' 52 # linker.option_library_path = '-L%s' 53 # linker.link_options = "%{flags} -o %{outfile} %{objs} %{libs}" 54 # end 55 56 # Archiver settings 57 # conf.archiver do |archiver| 58 # archiver.command = ENV['AR'] || 'ar' 59 # archiver.archive_options = 'rs %{outfile} %{objs}' 60 # end 61 62 # Parser generator settings 63 # conf.yacc do |yacc| 64 # yacc.command = ENV['YACC'] || 'bison' 65 # yacc.compile_options = '-o %{outfile} %{infile}' 66 # end 67 68 # gperf settings 69 # conf.gperf do |gperf| 70 # gperf.command = 'gperf' 71 # gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}' 72 # end 73 74 # file extensions 75 # conf.exts do |exts| 76 # exts.object = '.o' 77 # exts.executable = '' # '.exe' if Windows 78 # exts.library = '.a' 79 # end 80 81 # file separetor 82 # conf.file_separator = '/' 83 84 # bintest 85 # conf.enable_bintest 86end 87 88MRuby::Build.new('host-debug') do |conf| 89 # load specific toolchain settings 90 91 # Gets set by the VS command prompts. 92 if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] 93 toolchain :visualcpp 94 else 95 toolchain :gcc 96 end 97 98 enable_debug 99 100 # include the default GEMs 101 conf.gembox 'default' 102 103 # C compiler settings 104 conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK) 105 106 # Generate mruby debugger command (require mruby-eval) 107 conf.gem :core => "mruby-bin-debugger" 108 109 # bintest 110 # conf.enable_bintest 111end 112 113MRuby::Build.new('test') do |conf| 114 # Gets set by the VS command prompts. 115 if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] 116 toolchain :visualcpp 117 else 118 toolchain :gcc 119 end 120 121 enable_debug 122 conf.enable_bintest 123 conf.enable_test 124 125 conf.gembox 'default' 126end 127 128#MRuby::Build.new('bench') do |conf| 129# # Gets set by the VS command prompts. 130# if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] 131# toolchain :visualcpp 132# else 133# toolchain :gcc 134# conf.cc.flags << '-O3' 135# end 136# 137# conf.gembox 'default' 138#end 139 140# Define cross build settings 141# MRuby::CrossBuild.new('32bit') do |conf| 142# toolchain :gcc 143# 144# conf.cc.flags << "-m32" 145# conf.linker.flags << "-m32" 146# 147# conf.build_mrbtest_lib_only 148# 149# conf.gem 'examples/mrbgems/c_and_ruby_extension_example' 150# 151# conf.test_runner.command = 'env' 152# end 153