1 | MRuby::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 | enable_debug
|
---|
12 |
|
---|
13 | # Use mrbgems
|
---|
14 | # conf.gem 'examples/mrbgems/ruby_extension_example'
|
---|
15 | # conf.gem 'examples/mrbgems/c_extension_example' do |g|
|
---|
16 | # g.cc.flags << '-g' # append cflags in this gem
|
---|
17 | # end
|
---|
18 | # conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
|
---|
19 | # 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'
|
---|
23 |
|
---|
24 | # include the default GEMs
|
---|
25 | conf.gembox 'default'
|
---|
26 | # C compiler settings
|
---|
27 | # conf.cc do |cc|
|
---|
28 | # cc.command = ENV['CC'] || 'gcc'
|
---|
29 | # cc.flags = [ENV['CFLAGS'] || %w()]
|
---|
30 | # cc.include_paths = ["#{root}/include"]
|
---|
31 | # cc.defines = %w(DISABLE_GEMS)
|
---|
32 | # cc.option_include_path = '-I%s'
|
---|
33 | # cc.option_define = '-D%s'
|
---|
34 | # cc.compile_options = "%{flags} -MMD -o %{outfile} -c %{infile}"
|
---|
35 | # end
|
---|
36 |
|
---|
37 | # mrbc settings
|
---|
38 | # conf.mrbc do |mrbc|
|
---|
39 | # mrbc.compile_options = "-g -B%{funcname} -o-" # The -g option is required for line numbers
|
---|
40 | # end
|
---|
41 |
|
---|
42 | # Linker settings
|
---|
43 | # conf.linker do |linker|
|
---|
44 | # linker.command = ENV['LD'] || 'gcc'
|
---|
45 | # linker.flags = [ENV['LDFLAGS'] || []]
|
---|
46 | # linker.flags_before_libraries = []
|
---|
47 | # linker.libraries = %w()
|
---|
48 | # linker.flags_after_libraries = []
|
---|
49 | # linker.library_paths = []
|
---|
50 | # linker.option_library = '-l%s'
|
---|
51 | # linker.option_library_path = '-L%s'
|
---|
52 | # linker.link_options = "%{flags} -o %{outfile} %{objs} %{libs}"
|
---|
53 | # end
|
---|
54 |
|
---|
55 | # Archiver settings
|
---|
56 | # conf.archiver do |archiver|
|
---|
57 | # archiver.command = ENV['AR'] || 'ar'
|
---|
58 | # archiver.archive_options = 'rs %{outfile} %{objs}'
|
---|
59 | # end
|
---|
60 |
|
---|
61 | # Parser generator settings
|
---|
62 | # conf.yacc do |yacc|
|
---|
63 | # yacc.command = ENV['YACC'] || 'bison'
|
---|
64 | # yacc.compile_options = '-o %{outfile} %{infile}'
|
---|
65 | # end
|
---|
66 |
|
---|
67 | # gperf settings
|
---|
68 | # conf.gperf do |gperf|
|
---|
69 | # 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 | # end
|
---|
72 |
|
---|
73 | # file extensions
|
---|
74 | # conf.exts do |exts|
|
---|
75 | # exts.object = '.o'
|
---|
76 | # exts.executable = '' # '.exe' if Windows
|
---|
77 | # exts.library = '.a'
|
---|
78 | # end
|
---|
79 |
|
---|
80 | # file separetor
|
---|
81 | # conf.file_separator = '/'
|
---|
82 |
|
---|
83 | # bintest
|
---|
84 | # conf.enable_bintest
|
---|
85 | end
|
---|
86 |
|
---|
87 | MRuby::Build.new('host-debug') do |conf|
|
---|
88 | # load specific toolchain settings
|
---|
89 |
|
---|
90 | # Gets set by the VS command prompts.
|
---|
91 | if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
|
---|
92 | toolchain :visualcpp
|
---|
93 | else
|
---|
94 | toolchain :gcc
|
---|
95 | end
|
---|
96 |
|
---|
97 | enable_debug
|
---|
98 |
|
---|
99 | # include the default GEMs
|
---|
100 | conf.gembox 'default'
|
---|
101 |
|
---|
102 | # C compiler settings
|
---|
103 | conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK)
|
---|
104 |
|
---|
105 | # Generate mruby debugger command (require mruby-eval)
|
---|
106 | conf.gem :core => "mruby-bin-debugger"
|
---|
107 |
|
---|
108 | # bintest
|
---|
109 | # conf.enable_bintest
|
---|
110 | end
|
---|
111 |
|
---|
112 | #MRuby::Build.new('test') do |conf|
|
---|
113 | # # Gets set by the VS command prompts.
|
---|
114 | # if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
|
---|
115 | # toolchain :visualcpp
|
---|
116 | # else
|
---|
117 | # toolchain :gcc
|
---|
118 | # end
|
---|
119 | #
|
---|
120 | # enable_debug
|
---|
121 | # conf.enable_bintest
|
---|
122 | # conf.enable_test
|
---|
123 | #
|
---|
124 | # conf.gembox 'default'
|
---|
125 | #end
|
---|
126 |
|
---|
127 | # Define cross build settings
|
---|
128 | # MRuby::CrossBuild.new('32bit') do |conf|
|
---|
129 | # toolchain :gcc
|
---|
130 | #
|
---|
131 | # conf.cc.flags << "-m32"
|
---|
132 | # conf.linker.flags << "-m32"
|
---|
133 | #
|
---|
134 | # conf.build_mrbtest_lib_only
|
---|
135 | #
|
---|
136 | # conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
|
---|
137 | #
|
---|
138 | # conf.test_runner.command = 'env'
|
---|
139 | #
|
---|
140 | # end
|
---|
141 |
|
---|
142 | # Define cross build settings
|
---|
143 | MRuby::CrossBuild.new('arm-none-eabi') do |conf|
|
---|
144 | toolchain :gcc
|
---|
145 |
|
---|
146 | conf.cc.command = "arm-none-eabi-gcc"
|
---|
147 | conf.cxx.command = "arm-none-eabi-g++"
|
---|
148 | conf.linker.command = "arm-none-eabi-gcc"
|
---|
149 | conf.archiver.command = "arm-none-eabi-ar"
|
---|
150 |
|
---|
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)
|
---|
152 | conf.cc.include_paths << "../musl-1.1.18/include"
|
---|
153 |
|
---|
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
|
---|
164 |
|
---|
165 | conf.gem "#{root}/mrbgems/mruby-compiler"
|
---|
166 | conf.gem "#{root}/mrbgems/mruby-numeric-ext"
|
---|
167 | conf.gem "#{root}/mrbgems/mruby-string-ext"
|
---|
168 | conf.gem '../mrbgems/mruby-onig-regexp' do |g|
|
---|
169 | g.cc.include_paths << "../onigmo-6.1.3/src"
|
---|
170 | end
|
---|
171 | conf.gem "#{root}/../mrbgems/mruby-blockly"
|
---|
172 | conf.gem "#{root}/../mrbgems/mruby-digest" do |g|
|
---|
173 | g.cc.include_paths << "#{g.dir}/../../openssl-1.1.0e/include"
|
---|
174 | end
|
---|
175 | conf.gem "#{root}/../mrbgems/mruby-dir"
|
---|
176 | conf.gem "#{root}/../mrbgems/mruby-env"
|
---|
177 | conf.gem "#{root}/../mrbgems/mruby-errno"
|
---|
178 | conf.gem "#{root}/../mrbgems/mruby-iijson"
|
---|
179 | conf.gem "#{root}/../mrbgems/mruby-io"
|
---|
180 | conf.gem "#{root}/../mrbgems/mruby-ipaddr"
|
---|
181 | conf.gem "#{root}/../mrbgems/mruby-mock"
|
---|
182 | conf.gem "#{root}/../mrbgems/mruby-pack"
|
---|
183 | conf.gem "#{root}/../mrbgems/mruby-require"
|
---|
184 | conf.gem "#{root}/../mrbgems/mruby-socket"
|
---|
185 | conf.gem "#{root}/../mrbgems/mruby-tls-openssl" do |g|
|
---|
186 | g.cc.include_paths << "#{g.dir}/../../openssl-1.1.0e/include"
|
---|
187 | end
|
---|
188 | conf.gem "#{root}/../mrbgems/mruby-arduino" do |g|
|
---|
189 | g.cc.include_paths << "#{g.dir}/../../prototool/src"
|
---|
190 | g.cc.include_paths << "#{g.dir}/../../mbed_api/src"
|
---|
191 | end
|
---|
192 | conf.gem "#{root}/../mrbgems/mruby-ecnl"
|
---|
193 | conf.gem "#{root}/../mrbgems/mruby-others"
|
---|
194 |
|
---|
195 | conf.bins = []
|
---|
196 |
|
---|
197 | # conf.test_runner.command = 'env'
|
---|
198 | end
|
---|
199 | =begin
|
---|
200 | MRuby::CrossBuild.new("emscripten") do |conf|
|
---|
201 | toolchain :emscripten
|
---|
202 |
|
---|
203 | conf.archiver.command = "llvm-ar"
|
---|
204 | conf.linker.flags << '--save-bc %{outfile}.bc --pre-js ../webapp/webmrbc/pre.js --post-js ../webapp/webmrbc/post.js --use-preload-plugins'
|
---|
205 | #conf.linker.flags << '-s BINARYEN=1'
|
---|
206 | #conf.exts.executable = '.html'
|
---|
207 |
|
---|
208 | # include the default GEMs
|
---|
209 | conf.gembox 'default'
|
---|
210 | conf.gem :core => 'mruby-bin-mrbc'
|
---|
211 | end
|
---|
212 | =end
|
---|