1 MRuby::Build.new do |conf|
3 # Gets set by the VS command prompts.
4 if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
12 # include the default GEMs
18 # Cross Compiling configuration for Intel Galileo on Arduino environment
19 # http://arduino.cc/en/ArduinoCertified/IntelGalileo
21 # Requires Arduino IDE for Intel Galileo
22 MRuby::CrossBuild.new("Galileo") do |conf|
26 # Assume you renamed Arduino.app to Arduino_Galileo.app
27 GALILEO_ARDUINO_PATH = '/Applications/Arduino_Galileo.app/Contents/Resources/Java'
29 #ARDUINO_GALILEO_PATH = '/opt/arduino'
31 GALILEO_BIN_PATH = "#{GALILEO_ARDUINO_PATH}/hardware/tools/x86/i386-pokysdk-darwin/usr/bin/i586-poky-linux-uclibc"
32 GALILEO_SYSROOT = "#{GALILEO_ARDUINO_PATH}/hardware/tools/x86/i586-poky-linux-uclibc"
33 GALILEO_X86_PATH = "#{GALILEO_ARDUINO_PATH}/hardware/arduino/x86"
37 cc.command = "#{GALILEO_BIN_PATH}/i586-poky-linux-uclibc-gcc"
38 cc.include_paths << ["#{GALILEO_X86_PATH}/cores/arduino", "#{GALILEO_X86_PATH}/variants/galileo_fab_d"]
39 cc.flags = %w(-m32 -march=i586 -c -g -Os -w
40 -ffunction-sections -fdata-sections -MMD -DARDUINO=153)
41 cc.flags << "--sysroot=#{GALILEO_SYSROOT}"
42 cc.compile_options = "%{flags} -o %{outfile} -c %{infile}"
46 cxx.command = "#{GALILEO_BIN_PATH}/i586-poky-linux-uclibc-g++"
47 cxx.include_paths = conf.cc.include_paths.dup
48 cxx.include_paths << "#{GALILEO_ARDUINO_PATH}/hardware/tools/x86/i586-poky-linux-uclibc/usr/include/c++"
49 cxx.include_paths << "#{GALILEO_ARDUINO_PATH}/hardware/tools/x86/i586-poky-linux-uclibc/usr/include/c++/i586-poky-linux-uclibc"
50 cxx.flags = conf.cc.flags.dup
51 cxx.defines = conf.cc.defines.dup
52 cxx.compile_options = conf.cc.compile_options.dup
55 conf.archiver do |archiver|
56 archiver.command = "#{GALILEO_BIN_PATH}/i586-poky-linux-uclibc-ar"
57 archiver.archive_options = 'rcs %{outfile} %{objs}'
60 conf.linker do |linker|
61 linker.command = "#{GALILEO_BIN_PATH}/i586-poky-linux-uclibc-g++"
62 linker.flags = %w(-m32 -march=i586)
63 linker.flags << "--sysroot=#{GALILEO_SYSROOT}"
64 linker.flags << %w(-Os -Wl,--gc-sections)
65 linker.libraries = %w(m pthread)
71 #do not build executable test
72 conf.build_mrbtest_lib_only
75 conf.gem :core => "mruby-sprintf"
76 conf.gem :core => "mruby-print"
77 conf.gem :core => "mruby-math"
78 conf.gem :core => "mruby-time"
79 conf.gem :core => "mruby-struct"
80 conf.gem :core => "mruby-enum-ext"
81 conf.gem :core => "mruby-string-ext"
82 conf.gem :core => "mruby-numeric-ext"
83 conf.gem :core => "mruby-array-ext"
84 conf.gem :core => "mruby-hash-ext"
85 conf.gem :core => "mruby-range-ext"
86 conf.gem :core => "mruby-proc-ext"
87 conf.gem :core => "mruby-symbol-ext"
88 conf.gem :core => "mruby-random"
89 conf.gem :core => "mruby-object-ext"
90 conf.gem :core => "mruby-objectspace"
91 conf.gem :core => "mruby-fiber"
92 conf.gem :core => "mruby-toplevel-ext"
94 #lightweigh regular expression
95 conf.gem :github => "masamitsu-murase/mruby-hs-regexp", :branch => "master"
98 #conf.gem :github =>"kyab/mruby-arduino", :branch => "master" do |g|
99 # g.cxx.include_paths << "#{GALILEO_X86_PATH}/libraries/Wire"
100 # g.cxx.include_paths << "#{GALILEO_X86_PATH}/libraries/Servo"
102 #enable unsupported Servo class
103 # g.cxx.defines << "MRUBY_ARDUINO_GALILEO_ENABLE_SERVO"