source: EcnlProtoTool/trunk/mruby-2.1.1/build_config.rb@ 439

Last change on this file since 439 was 439, checked in by coas-nagasima, 4 years ago

mrubyを2.1.1に更新

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-ruby;charset=UTF-8
File size: 6.6 KB
Line 
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-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'
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 = %q[-I"%s"]
34 # cc.option_define = '-D%s'
35 # cc.compile_options = %Q[%{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 = %q[-o "%{outfile}" "%{infile}"]
66 # end
67
68 # gperf settings
69 # conf.gperf do |gperf|
70 # gperf.command = 'gperf'
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}"]
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=begin
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=end
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
154# Cross build for arm-none-eabi
155MRuby::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
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)
164 conf.cc.include_paths << "../musl-1.1.18/include"
165
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
169
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"
181 conf.gem "#{root}/mrbgems/mruby-numeric-ext"
182 conf.gem "#{root}/mrbgems/mruby-string-ext"
183 conf.gem '../mrbgems/mruby-onig-regexp' do |g|
184 g.cc.flags << %w(-DHAVE_ONIGMO_H)
185 g.cc.include_paths << "../onigmo-6.1.3/src"
186 end
187 conf.gem "#{root}/../mrbgems/mruby-blockly"
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"
197 #conf.gem "#{root}/../mrbgems/mruby-require"
198 conf.gem "#{root}/../mrbgems/mruby-tls-openssl" do |g|
199 g.cc.include_paths << "#{g.dir}/../../openssl-1.1.0e/include"
200 end
201 conf.gem "#{root}/../mrbgems/mruby-arduino" do |g|
202 g.cc.include_paths << "#{g.dir}/../../prototool/src"
203 g.cc.include_paths << "#{g.dir}/../../mbed_api/src"
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'
211end
212=begin
213MRuby::CrossBuild.new("emscripten") do |conf|
214 toolchain :emscripten
215
216 conf.archiver.command = "llvm-ar"
217 conf.cc.flags << '-ffunction-sections -fdata-sections'
218 conf.linker.flags << '-Wl,--gc-sections'
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
224 #conf.gembox 'default'
225 conf.gem :core => 'mruby-bin-mrbc'
226end
227=end
Note: See TracBrowser for help on using the repository browser.