[270] | 1 | MRuby::Build.new do |conf|
|
---|
| 2 | # load specific toolchain settings
|
---|
| 3 |
|
---|
| 4 | # Gets set by the VS command prompts.
|
---|
[439] | 5 | if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
|
---|
[270] | 6 | toolchain :visualcpp
|
---|
[439] | 7 | else
|
---|
| 8 | toolchain :gcc
|
---|
| 9 | end
|
---|
[270] | 10 |
|
---|
[439] | 11 | # Turn on `enable_debug` for better debugging
|
---|
| 12 | # enable_debug
|
---|
[270] | 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'
|
---|
[331] | 20 | # conf.gem :core => 'mruby-eval'
|
---|
[439] | 21 | # conf.gem :mgem => 'mruby-onig-regexp'
|
---|
| 22 | # conf.gem :github => 'mattn/mruby-onig-regexp'
|
---|
| 23 | # conf.gem :git => 'git@github.com:mattn/mruby-onig-regexp.git', :branch => 'master', :options => '-v'
|
---|
[270] | 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"]
|
---|
[439] | 32 | # cc.defines = %w()
|
---|
| 33 | # cc.option_include_path = %q[-I"%s"]
|
---|
[270] | 34 | # cc.option_define = '-D%s'
|
---|
[439] | 35 | # cc.compile_options = %Q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"]
|
---|
[270] | 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'
|
---|
[439] | 53 | # linker.link_options = "%{flags} -o "%{outfile}" %{objs} %{libs}"
|
---|
[270] | 54 | # end
|
---|
| 55 |
|
---|
| 56 | # Archiver settings
|
---|
| 57 | # conf.archiver do |archiver|
|
---|
| 58 | # archiver.command = ENV['AR'] || 'ar'
|
---|
[439] | 59 | # archiver.archive_options = 'rs "%{outfile}" %{objs}'
|
---|
[270] | 60 | # end
|
---|
| 61 |
|
---|
| 62 | # Parser generator settings
|
---|
| 63 | # conf.yacc do |yacc|
|
---|
| 64 | # yacc.command = ENV['YACC'] || 'bison'
|
---|
[439] | 65 | # yacc.compile_options = %q[-o "%{outfile}" "%{infile}"]
|
---|
[270] | 66 | # end
|
---|
| 67 |
|
---|
| 68 | # gperf settings
|
---|
| 69 | # conf.gperf do |gperf|
|
---|
| 70 | # gperf.command = 'gperf'
|
---|
[439] | 71 | # gperf.compile_options = %q[-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" "%{infile}" > "%{outfile}"]
|
---|
[270] | 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
|
---|
| 86 | end
|
---|
[439] | 87 | =begin
|
---|
[270] | 88 | MRuby::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
|
---|
| 111 | end
|
---|
| 112 |
|
---|
[439] | 113 | MRuby::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'
|
---|
| 126 | end
|
---|
| 127 | =end
|
---|
| 128 | #MRuby::Build.new('bench') do |conf|
|
---|
[270] | 129 | # # Gets set by the VS command prompts.
|
---|
| 130 | # if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
|
---|
| 131 | # toolchain :visualcpp
|
---|
| 132 | # else
|
---|
| 133 | # toolchain :gcc
|
---|
[439] | 134 | # conf.cc.flags << '-O3'
|
---|
[270] | 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 |
|
---|
[439] | 154 | # Cross build for arm-none-eabi
|
---|
[270] | 155 | MRuby::CrossBuild.new('arm-none-eabi') do |conf|
|
---|
| 156 | toolchain :gcc
|
---|
| 157 |
|
---|
| 158 | conf.cc.command = "arm-none-eabi-gcc"
|
---|
| 159 | conf.cxx.command = "arm-none-eabi-g++"
|
---|
| 160 | conf.linker.command = "arm-none-eabi-gcc"
|
---|
| 161 | conf.archiver.command = "arm-none-eabi-ar"
|
---|
| 162 |
|
---|
[439] | 163 | conf.cc.flags << %w(-MD -MP -mlittle-endian -mcpu=cortex-a9 -mthumb -mthumb-interwork -marm -march=armv7-a -mfpu=vfpv3 -mfloat-abi=hard -mno-unaligned-access -fno-strict-aliasing -nostdinc -Wstack-usage=256 -ffunction-sections -fdata-sections)
|
---|
[331] | 164 | conf.cc.include_paths << "../musl-1.1.18/include"
|
---|
[270] | 165 |
|
---|
[440] | 166 | conf.cc.defines << %w(MRB_METHOD_T_STRUCT MRB_USE_CUSTOM_RO_DATA_P MRB_ENABLE_DEBUG_HOOK MRB_CONSTRAINED_BASELINE_PROFILE)
|
---|
[331] | 167 |
|
---|
[439] | 168 | #conf.build_mrbtest_lib_only
|
---|
[270] | 169 |
|
---|
[279] | 170 | conf.gem "#{root}/mrbgems/mruby-compiler"
|
---|
[439] | 171 | conf.gem "#{root}/mrbgems/mruby-eval"
|
---|
| 172 | conf.gem "#{root}/mrbgems/mruby-io"
|
---|
| 173 | conf.gem "#{root}/mrbgems/mruby-math"
|
---|
| 174 | conf.gem "#{root}/mrbgems/mruby-pack"
|
---|
| 175 | conf.gem "#{root}/mrbgems/mruby-print"
|
---|
| 176 | conf.gem "#{root}/mrbgems/mruby-random"
|
---|
| 177 | conf.gem "#{root}/mrbgems/mruby-socket"
|
---|
| 178 | conf.gem "#{root}/mrbgems/mruby-sprintf"
|
---|
| 179 | conf.gem "#{root}/mrbgems/mruby-struct"
|
---|
| 180 | conf.gem "#{root}/mrbgems/mruby-time"
|
---|
[270] | 181 | conf.gem "#{root}/mrbgems/mruby-numeric-ext"
|
---|
| 182 | conf.gem "#{root}/mrbgems/mruby-string-ext"
|
---|
[279] | 183 | conf.gem '../mrbgems/mruby-onig-regexp' do |g|
|
---|
[439] | 184 | g.cc.flags << %w(-DHAVE_ONIGMO_H)
|
---|
[331] | 185 | g.cc.include_paths << "../onigmo-6.1.3/src"
|
---|
[279] | 186 | end
|
---|
[270] | 187 | conf.gem "#{root}/../mrbgems/mruby-blockly"
|
---|
[331] | 188 | conf.gem "#{root}/../mrbgems/mruby-digest" do |g|
|
---|
| 189 | g.cc.include_paths << "#{g.dir}/../../openssl-1.1.0e/include"
|
---|
| 190 | end
|
---|
| 191 | conf.gem "#{root}/../mrbgems/mruby-dir"
|
---|
| 192 | conf.gem "#{root}/../mrbgems/mruby-env"
|
---|
| 193 | conf.gem "#{root}/../mrbgems/mruby-errno"
|
---|
| 194 | conf.gem "#{root}/../mrbgems/mruby-iijson"
|
---|
| 195 | conf.gem "#{root}/../mrbgems/mruby-ipaddr"
|
---|
| 196 | conf.gem "#{root}/../mrbgems/mruby-mock"
|
---|
[424] | 197 | #conf.gem "#{root}/../mrbgems/mruby-require"
|
---|
[331] | 198 | conf.gem "#{root}/../mrbgems/mruby-tls-openssl" do |g|
|
---|
| 199 | g.cc.include_paths << "#{g.dir}/../../openssl-1.1.0e/include"
|
---|
[279] | 200 | end
|
---|
[270] | 201 | conf.gem "#{root}/../mrbgems/mruby-arduino" do |g|
|
---|
[279] | 202 | g.cc.include_paths << "#{g.dir}/../../prototool/src"
|
---|
[331] | 203 | g.cc.include_paths << "#{g.dir}/../../mbed_api/src"
|
---|
[270] | 204 | end
|
---|
| 205 | conf.gem "#{root}/../mrbgems/mruby-ecnl"
|
---|
| 206 | conf.gem "#{root}/../mrbgems/mruby-others"
|
---|
| 207 |
|
---|
| 208 | conf.bins = []
|
---|
| 209 |
|
---|
| 210 | # conf.test_runner.command = 'env'
|
---|
| 211 | end
|
---|
[281] | 212 | =begin
|
---|
| 213 | MRuby::CrossBuild.new("emscripten") do |conf|
|
---|
| 214 | toolchain :emscripten
|
---|
[270] | 215 |
|
---|
[281] | 216 | conf.archiver.command = "llvm-ar"
|
---|
[439] | 217 | conf.cc.flags << '-ffunction-sections -fdata-sections'
|
---|
| 218 | conf.linker.flags << '-Wl,--gc-sections'
|
---|
[281] | 219 | conf.linker.flags << '--save-bc %{outfile}.bc --pre-js ../webapp/webmrbc/pre.js --post-js ../webapp/webmrbc/post.js --use-preload-plugins'
|
---|
| 220 | #conf.linker.flags << '-s BINARYEN=1'
|
---|
| 221 | #conf.exts.executable = '.html'
|
---|
| 222 |
|
---|
| 223 | # include the default GEMs
|
---|
[439] | 224 | #conf.gembox 'default'
|
---|
[281] | 225 | conf.gem :core => 'mruby-bin-mrbc'
|
---|
| 226 | end
|
---|
| 227 | =end
|
---|