Changeset 439 for EcnlProtoTool/trunk/mruby-2.1.1/build_config.rb
- Timestamp:
- Jul 9, 2020, 8:51:43 AM (4 years ago)
- Location:
- EcnlProtoTool/trunk/mruby-2.1.1
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/mruby-2.1.1/build_config.rb
r424 r439 3 3 4 4 # Gets set by the VS command prompts. 5 #if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']5 if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] 6 6 toolchain :visualcpp 7 #else 8 # toolchain :gcc 9 #end 10 11 enable_debug 7 else 8 toolchain :gcc 9 end 10 11 # Turn on `enable_debug` for better debugging 12 # enable_debug 12 13 13 14 # Use mrbgems … … 18 19 # conf.gem 'examples/mrbgems/c_and_ruby_extension_example' 19 20 # conf.gem :core => 'mruby-eval' 20 # conf.gem :mgem => 'mruby- io'21 # conf.gem :github => ' iij/mruby-io'22 # conf.gem :git => 'git@github.com: iij/mruby-io.git', :branch => 'master', :options => '-v'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' 23 24 24 25 # include the default GEMs … … 29 30 # cc.flags = [ENV['CFLAGS'] || %w()] 30 31 # cc.include_paths = ["#{root}/include"] 31 # cc.defines = %w( DISABLE_GEMS)32 # cc.option_include_path = '-I%s'32 # cc.defines = %w() 33 # cc.option_include_path = %q[-I"%s"] 33 34 # cc.option_define = '-D%s' 34 # cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}"35 # cc.compile_options = %Q[%{flags} -MMD -o "%{outfile}" -c "%{infile}"] 35 36 # end 36 37 … … 50 51 # linker.option_library = '-l%s' 51 52 # linker.option_library_path = '-L%s' 52 # linker.link_options = "%{flags} -o %{outfile}%{objs} %{libs}"53 # linker.link_options = "%{flags} -o "%{outfile}" %{objs} %{libs}" 53 54 # end 54 55 … … 56 57 # conf.archiver do |archiver| 57 58 # archiver.command = ENV['AR'] || 'ar' 58 # archiver.archive_options = 'rs %{outfile}%{objs}'59 # archiver.archive_options = 'rs "%{outfile}" %{objs}' 59 60 # end 60 61 … … 62 63 # conf.yacc do |yacc| 63 64 # yacc.command = ENV['YACC'] || 'bison' 64 # yacc.compile_options = '-o %{outfile} %{infile}'65 # yacc.compile_options = %q[-o "%{outfile}" "%{infile}"] 65 66 # end 66 67 … … 68 69 # conf.gperf do |gperf| 69 70 # gperf.command = 'gperf' 70 # gperf.compile_options = '-L ANSI-C -C -p -j1 -i 1 -g -o -t -N mrb_reserved_word -k"1,3,$" %{infile} > %{outfile}'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}"] 71 72 # end 72 73 … … 84 85 # conf.enable_bintest 85 86 end 86 87 =begin 87 88 MRuby::Build.new('host-debug') do |conf| 88 89 # load specific toolchain settings … … 110 111 end 111 112 112 #MRuby::Build.new('test') do |conf| 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| 113 129 # # Gets set by the VS command prompts. 114 130 # if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] … … 116 132 # else 117 133 # toolchain :gcc 134 # conf.cc.flags << '-O3' 118 135 # end 119 #120 # enable_debug121 # conf.enable_bintest122 # conf.enable_test123 136 # 124 137 # conf.gembox 'default' … … 137 150 # 138 151 # conf.test_runner.command = 'env' 139 #140 152 # end 141 153 142 # Define cross build settings154 # Cross build for arm-none-eabi 143 155 MRuby::CrossBuild.new('arm-none-eabi') do |conf| 144 156 toolchain :gcc … … 149 161 conf.archiver.command = "arm-none-eabi-ar" 150 162 151 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 )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) 152 164 conf.cc.include_paths << "../musl-1.1.18/include" 153 165 154 conf.linker.flags << %w(-nostdlib) 155 conf.linker.library_paths << "../musl-1.1.18/lib" 156 conf.linker.libraries << %w(c gcc) 157 158 #configuration for low memory environment 159 conf.cc.defines << %w(MRB_GC_STRESS) 160 #conf.cc.defines << %w(DISABLE_STDIO) 161 conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK) 162 163 conf.build_mrbtest_lib_only 166 conf.cc.defines << %w(MRB_USE_CUSTOM_RO_DATA_P MRB_ENABLE_DEBUG_HOOK MRB_CONSTRAINED_BASELINE_PROFILE) 167 168 #conf.build_mrbtest_lib_only 164 169 165 170 conf.gem "#{root}/mrbgems/mruby-compiler" 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" 166 181 conf.gem "#{root}/mrbgems/mruby-numeric-ext" 167 182 conf.gem "#{root}/mrbgems/mruby-string-ext" 168 183 conf.gem '../mrbgems/mruby-onig-regexp' do |g| 184 g.cc.flags << %w(-DHAVE_ONIGMO_H) 169 185 g.cc.include_paths << "../onigmo-6.1.3/src" 170 186 end … … 177 193 conf.gem "#{root}/../mrbgems/mruby-errno" 178 194 conf.gem "#{root}/../mrbgems/mruby-iijson" 179 conf.gem "#{root}/../mrbgems/mruby-io"180 195 conf.gem "#{root}/../mrbgems/mruby-ipaddr" 181 196 conf.gem "#{root}/../mrbgems/mruby-mock" 182 conf.gem "#{root}/../mrbgems/mruby-pack"183 197 #conf.gem "#{root}/../mrbgems/mruby-require" 184 conf.gem "#{root}/../mrbgems/mruby-socket"185 198 conf.gem "#{root}/../mrbgems/mruby-tls-openssl" do |g| 186 199 g.cc.include_paths << "#{g.dir}/../../openssl-1.1.0e/include" … … 202 215 203 216 conf.archiver.command = "llvm-ar" 217 conf.cc.flags << '-ffunction-sections -fdata-sections' 218 conf.linker.flags << '-Wl,--gc-sections' 204 219 conf.linker.flags << '--save-bc %{outfile}.bc --pre-js ../webapp/webmrbc/pre.js --post-js ../webapp/webmrbc/post.js --use-preload-plugins' 205 220 #conf.linker.flags << '-s BINARYEN=1' … … 207 222 208 223 # include the default GEMs 209 conf.gembox 'default'224 #conf.gembox 'default' 210 225 conf.gem :core => 'mruby-bin-mrbc' 211 226 end
Note:
See TracChangeset
for help on using the changeset viewer.