Upgrade to 1.46.0
[platform/upstream/nghttp2.git] / third-party / mruby / examples / targets / build_config_RX630.rb
1 MRuby::Build.new do |conf|
2
3   # Gets set by the VS command prompts.
4   if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
5     toolchain :visualcpp
6   else
7     toolchain :gcc
8   end
9
10   enable_debug
11
12   # include the default GEMs
13   conf.gembox 'default'
14
15 end
16
17 # Cross Compiling configuration for RX630
18 # http://gadget.renesas.com/
19 #
20 # Requires gnurx_v14.03
21 MRuby::CrossBuild.new("RX630") do |conf|
22   toolchain :gcc
23
24   # Linux
25   BIN_PATH = "/usr/share/gnurx_v14.03_elf-1/bin"
26
27   conf.cc do |cc|
28     cc.command = "#{BIN_PATH}/rx-elf-gcc"
29     cc.flags = "-Wall -g -O2 -flto -mcpu=rx600 -m64bit-doubles"
30     cc.compile_options = %Q[%{flags} -o "%{outfile}" -c "%{infile}"]
31
32     #configuration for low memory environment
33     cc.defines << %w(MRB_USE_FLOAT)
34     cc.defines << %w(MRB_HEAP_PAGE_SIZE=64)
35     cc.defines << %w(KHASH_DEFAULT_SIZE=8)
36     cc.defines << %w(MRB_STR_BUF_MIN_SIZE=20)
37     cc.defines << %w(MRB_GC_STRESS)
38     cc.defines << %w(MRB_DISABLE_STDIO) #if you dont need stdio.
39     #cc.defines << %w(POOL_PAGE_SIZE=1000) #effective only for use with mruby-eval
40   end
41
42   conf.cxx do |cxx|
43     cxx.command = conf.cc.command.dup
44     cxx.include_paths = conf.cc.include_paths.dup
45     cxx.flags = conf.cc.flags.dup
46     cxx.defines = conf.cc.defines.dup
47     cxx.compile_options = conf.cc.compile_options.dup
48   end
49
50   conf.linker do |linker|
51     linker.command="#{BIN_PATH}/rx-elf-ld"
52   end
53
54   conf.archiver do |archiver|
55     archiver.command = "#{BIN_PATH}/rx-elf-ar"
56     archiver.archive_options = 'rcs "%{outfile}" %{objs}'
57   end
58
59   #no executables
60   conf.bins = []
61
62   #do not build executable test
63   conf.build_mrbtest_lib_only
64
65   #disable C++ exception
66   conf.disable_cxx_exception
67
68   #gems from core
69   conf.gem :core => "mruby-sprintf"
70   conf.gem :core => "mruby-print"
71   conf.gem :core => "mruby-math"
72   conf.gem :core => "mruby-enum-ext"
73   conf.gem :core => "mruby-numeric-ext"
74
75   #light-weight regular expression
76   #conf.gem :github => "masamitsu-murase/mruby-hs-regexp", :branch => "master"
77
78   #Arduino API
79   #conf.gem :github =>"kyab/mruby-arduino", :branch => "master"
80
81 end