diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:19:48 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-03-09 13:20:02 +0000 |
commit | 58daab21cd043e1dc37024a7f99b396788372918 (patch) | |
tree | 96771e43bb69f7c1c2b0b4f7374cb74d7866d0cb /web/server/h2o/libh2o/deps/mruby/examples | |
parent | Releasing debian version 1.43.2-1. (diff) | |
download | netdata-58daab21cd043e1dc37024a7f99b396788372918.tar.xz netdata-58daab21cd043e1dc37024a7f99b396788372918.zip |
Merging upstream version 1.44.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'web/server/h2o/libh2o/deps/mruby/examples')
22 files changed, 665 insertions, 0 deletions
diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/README.md b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/README.md new file mode 100644 index 000000000..0b428b0b6 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/README.md @@ -0,0 +1,4 @@ +C and Ruby Extension Example +========= + +This is an example gem which implements a C and Ruby extension. diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake new file mode 100644 index 000000000..6b4595b35 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/mrbgem.rake @@ -0,0 +1,23 @@ +MRuby::Gem::Specification.new('c_and_ruby_extension_example') do |spec| + spec.license = 'MIT' + spec.author = 'mruby developers' + + # Add compile flags + # spec.cc.flags << '' + + # Add cflags to all + # spec.mruby.cc.flags << '-g' + + # Add libraries + # spec.linker.libraries << 'external_lib' + + # Default build files + # spec.rbfiles = Dir.glob("#{dir}/mrblib/*.rb") + # spec.objs = Dir.glob("#{dir}/src/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).pathmap("#{build_dir}/%X")) } + # spec.test_rbfiles = Dir.glob("#{dir}/test/*.rb") + # spec.test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).pathmap("#{build_dir}/%X")) } + # spec.test_preload = 'test/assert.rb' + + # Values accessible as TEST_ARGS inside test scripts + # spec.test_args = {'tmp_dir' => Dir::tmpdir} +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb new file mode 100644 index 000000000..d3899c301 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/mrblib/example.rb @@ -0,0 +1,5 @@ +module CRubyExtension + def CRubyExtension.ruby_method + puts "A Ruby Extension" + end +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c new file mode 100644 index 000000000..7b780d016 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/src/example.c @@ -0,0 +1,20 @@ +#include <mruby.h> +#include <stdio.h> + +static mrb_value +mrb_c_method(mrb_state *mrb, mrb_value self) +{ + puts("A C Extension"); + return self; +} + +void +mrb_c_and_ruby_extension_example_gem_init(mrb_state* mrb) { + struct RClass *class_cextension = mrb_define_module(mrb, "CRubyExtension"); + mrb_define_class_method(mrb, class_cextension, "c_method", mrb_c_method, MRB_ARGS_NONE()); +} + +void +mrb_c_and_ruby_extension_example_gem_final(mrb_state* mrb) { + /* finalizer */ +} diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/test/example.rb b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/test/example.rb new file mode 100644 index 000000000..fffad710f --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_and_ruby_extension_example/test/example.rb @@ -0,0 +1,7 @@ +assert('C and Ruby Extension Example 1') do + CRubyExtension.respond_to? :c_method +end + +assert('C and Ruby Extension Example 2') do + CRubyExtension.respond_to? :ruby_method +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/README.md b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/README.md new file mode 100644 index 000000000..3803c2065 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/README.md @@ -0,0 +1,4 @@ +C Extension Example +========= + +This is an example gem which implements a C extension. diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/mrbgem.rake b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/mrbgem.rake new file mode 100644 index 000000000..6e4c5b165 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/mrbgem.rake @@ -0,0 +1,23 @@ +MRuby::Gem::Specification.new('c_extension_example') do |spec| + spec.license = 'MIT' + spec.author = 'mruby developers' + + # Add compile flags + # spec.cc.flags << '-g' + + # Add cflags to all + # spec.mruby.cc.flags << '-g' + + # Add libraries + # spec.linker.libraries << 'external_lib' + + # Default build files + # spec.rbfiles = Dir.glob("#{dir}/mrblib/*.rb") + # spec.objs = Dir.glob("#{dir}/src/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).pathmap("#{build_dir}/%X")) } + # spec.test_rbfiles = Dir.glob("#{dir}/test/*.rb") + # spec.test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).pathmap("#{build_dir}/%X")) } + # spec.test_preload = 'test/assert.rb' + + # Values accessible as TEST_ARGS inside test scripts + # spec.test_args = {'tmp_dir' => Dir::tmpdir} +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/src/example.c b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/src/example.c new file mode 100644 index 000000000..e70ee42f8 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/src/example.c @@ -0,0 +1,20 @@ +#include <mruby.h> +#include <stdio.h> + +static mrb_value +mrb_c_method(mrb_state *mrb, mrb_value self) +{ + puts("A C Extension"); + return self; +} + +void +mrb_c_extension_example_gem_init(mrb_state* mrb) { + struct RClass *class_cextension = mrb_define_module(mrb, "CExtension"); + mrb_define_class_method(mrb, class_cextension, "c_method", mrb_c_method, MRB_ARGS_NONE()); +} + +void +mrb_c_extension_example_gem_final(mrb_state* mrb) { + /* finalizer */ +} diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/test/example.c b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/test/example.c new file mode 100644 index 000000000..ab410333d --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/test/example.c @@ -0,0 +1,7 @@ +#include <mruby.h> + +void +mrb_c_extension_example_gem_test(mrb_state *mrb) +{ + /* test initializer in C */ +} diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/test/example.rb b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/test/example.rb new file mode 100644 index 000000000..367d18029 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/c_extension_example/test/example.rb @@ -0,0 +1,3 @@ +assert('C Extension Example') do + CExtension.respond_to? :c_method +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/README.md b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/README.md new file mode 100644 index 000000000..906a0d8f2 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/README.md @@ -0,0 +1,4 @@ +Pure Ruby Extension Example +========= + +This is an example gem which implements a pure Ruby extension. diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake new file mode 100644 index 000000000..6e5a5b729 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/mrbgem.rake @@ -0,0 +1,25 @@ +MRuby::Gem::Specification.new('ruby_extension_example') do |spec| + spec.license = 'MIT' + spec.author = 'mruby developers' + + # Add compile flags + # spec.cc.flags << '' + + # Add cflags to all + # spec.mruby.cc.flags << '-g' + + # Add libraries + # spec.linker.libraries << 'external_lib' + + spec.add_dependency('mruby-print', :core => 'mruby-print') + + # Default build files + # spec.rbfiles = Dir.glob("#{dir}/mrblib/*.rb") + # spec.objs = Dir.glob("#{dir}/src/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).pathmap("#{build_dir}/%X")) } + # spec.test_rbfiles = Dir.glob("#{dir}/test/*.rb") + # spec.test_objs = Dir.glob("#{dir}/test/*.{c,cpp,m,asm,S}").map { |f| objfile(f.relative_path_from(dir).pathmap("#{build_dir}/%X")) } + # spec.test_preload = 'test/assert.rb' + + # Values accessible as TEST_ARGS inside test scripts + # spec.test_args = {'tmp_dir' => Dir::tmpdir} +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb new file mode 100644 index 000000000..b07a2b580 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/mrblib/example.rb @@ -0,0 +1,5 @@ +class RubyExtension + def RubyExtension.ruby_method + puts "A Ruby Extension" + end +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/test/example.rb b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/test/example.rb new file mode 100644 index 000000000..0c1b63469 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/mrbgems/ruby_extension_example/test/example.rb @@ -0,0 +1,3 @@ +assert('Ruby Extension Example') do + RubyExtension.respond_to? :ruby_method +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_ArduinoDue.rb b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_ArduinoDue.rb new file mode 100644 index 000000000..527aaa4f6 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_ArduinoDue.rb @@ -0,0 +1,90 @@ +MRuby::Build.new do |conf| + + # Gets set by the VS command prompts. + if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] + toolchain :visualcpp + else + toolchain :gcc + end + + enable_debug + + # include the default GEMs + conf.gembox 'default' + +end + +# Cross Compiling configuration for Arduino Due +# http://arduino.cc/en/Main/ArduinoBoardDue +# +# Requires Arduino IDE >= 1.5 +MRuby::CrossBuild.new("ArduinoDue") do |conf| + toolchain :gcc + + # Mac OS X, Arduino IDE <= 1.5.6 + # ARDUINO_PATH = '/Applications/Arduino.app/Contents/Resources/Java' + # Mac OS X, Arduino IDE >= 1.5.7 + # ARDUINO_PATH = '/Applications/Arduino.app/Contents/Java' + # GNU Linux + ARDUINO_PATH = '/opt/arduino' + # Arduino IDE <= 1.5.6 + BIN_PATH = "#{ARDUINO_PATH}/hardware/tools/g++_arm_none_eabi/bin" + # Arduino IDE >= 1.5.7 + # BIN_PATH = "#{ARDUINO_PATH}/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin" + SAM_PATH = "#{ARDUINO_PATH}/hardware/arduino/sam" + TARGET_PATH = "#{SAM_PATH}/variants/arduino_due_x" + + conf.cc do |cc| + cc.command = "#{BIN_PATH}/arm-none-eabi-gcc" + cc.include_paths << ["#{SAM_PATH}/system/libsam", "#{SAM_PATH}/system/CMSIS/CMSIS/Include/", + "#{SAM_PATH}/system/CMSIS/Device/ATMEL/", + "#{SAM_PATH}/cores/arduino", "#{SAM_PATH}/libraries","#{TARGET_PATH}"] + cc.flags = %w(-g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 + -Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=156 -DARDUINO_SAM_DUE -DARDUINO_ARCH_SAM + -D__SAM3X8E__ -mthumb -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON -DUSB_MANUFACTURER="Unknown" -DUSB_PRODUCT="Arduino Due") + cc.compile_options = "%{flags} -o %{outfile} -c %{infile}" + + #configuration for low memory environment + cc.defines << %w(MRB_HEAP_PAGE_SIZE=64) + cc.defines << %w(KHASH_DEFAULT_SIZE=8) + cc.defines << %w(MRB_STR_BUF_MIN_SIZE=20) + cc.defines << %w(MRB_GC_STRESS) + #cc.defines << %w(MRB_DISABLE_STDIO) #if you dont need stdio. + #cc.defines << %w(POOL_PAGE_SIZE=1000) #effective only for use with mruby-eval + end + + conf.cxx do |cxx| + cxx.command = conf.cc.command.dup + cxx.include_paths = conf.cc.include_paths.dup + cxx.flags = conf.cc.flags.dup + cxx.flags << %w(-fno-rtti -fno-exceptions) + cxx.defines = conf.cc.defines.dup + cxx.compile_options = conf.cc.compile_options.dup + end + + conf.archiver do |archiver| + archiver.command = "#{BIN_PATH}/arm-none-eabi-ar" + archiver.archive_options = 'rcs %{outfile} %{objs}' + end + + #no executables + conf.bins = [] + + #do not build executable test + conf.build_mrbtest_lib_only + + #disable C++ exception + conf.disable_cxx_exception + + #gems from core + conf.gem :core => "mruby-print" + conf.gem :core => "mruby-math" + conf.gem :core => "mruby-enum-ext" + + #light-weight regular expression + conf.gem :github => "masamitsu-murase/mruby-hs-regexp", :branch => "master" + + #Arduino API + #conf.gem :github =>"kyab/mruby-arduino", :branch => "master" + +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_IntelEdison.rb b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_IntelEdison.rb new file mode 100644 index 000000000..8fa3aa0c0 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_IntelEdison.rb @@ -0,0 +1,69 @@ +# Cross-compiling setup for Intel Edison (poky linux) platform +# Get SDK from here: https://software.intel.com/en-us/iot/hardware/edison/downloads +# REMEMBER to check and update the SDK root in the constant POKY_EDISON_PATH + +MRuby::Build.new do |conf| + toolchain :gcc + conf.gembox 'default' + conf.cc.defines = %w(ENABLE_READLINE) + conf.gembox 'default' + + #lightweight regular expression + conf.gem :github => "pbosetti/mruby-hs-regexp", :branch => "master" + +end + +# Define cross build settings +MRuby::CrossBuild.new('core2-32-poky-linux') do |conf| + toolchain :gcc + + # Mac OS X + # + POKY_EDISON_PATH = '/opt/poky-edison/1.7.2' + + POKY_EDISON_SYSROOT = "#{POKY_EDISON_PATH}/sysroots/core2-32-poky-linux" + POKY_EDISON_X86_PATH = "#{POKY_EDISON_PATH}/sysroots/i386-pokysdk-darwin" + POKY_EDISON_BIN_PATH = "#{POKY_EDISON_X86_PATH}/usr/bin/i586-poky-linux" + + + conf.cc do |cc| + cc.command = "#{POKY_EDISON_BIN_PATH}/i586-poky-linux-gcc" + cc.include_paths << ["#{POKY_EDISON_SYSROOT}/usr/include", "#{POKY_EDISON_X86_PATH}/usr/include"] + cc.flags = %w(-m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mstackrealign -fno-omit-frame-pointer) + cc.flags << %w(-O2 -pipe -g -feliminate-unused-debug-types) + cc.flags << "--sysroot=#{POKY_EDISON_SYSROOT}" + cc.compile_options = "%{flags} -o %{outfile} -c %{infile}" + cc.defines = %w(ENABLE_READLINE) + end + + conf.cxx do |cxx| + cxx.command = "#{POKY_EDISON_BIN_PATH}/i586-poky-linux-g++" + cxx.include_paths = conf.cc.include_paths.dup + cxx.include_paths << ["#{POKY_EDISON_SYSROOT}/usr/include/c++/4.9.1"] + cxx.flags = conf.cc.flags.dup + cxx.defines = conf.cc.defines.dup + cxx.compile_options = conf.cc.compile_options.dup + end + + conf.archiver do |archiver| + archiver.command = "#{POKY_EDISON_BIN_PATH}/i586-poky-linux-ar" + archiver.archive_options = 'rcs %{outfile} %{objs}' + end + + conf.linker do |linker| + linker.command = "#{POKY_EDISON_BIN_PATH}/i586-poky-linux-g++" + linker.flags = %w(-m32 -march=i586) + linker.flags << "--sysroot=#{POKY_EDISON_SYSROOT}" + linker.flags << %w(-O1) + linker.libraries = %w(m pthread) + end + + #do not build executable test + conf.build_mrbtest_lib_only + + conf.gembox 'default' + + #lightweight regular expression + conf.gem :github => "pbosetti/mruby-hs-regexp", :branch => "master" + +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_IntelGalileo.rb b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_IntelGalileo.rb new file mode 100644 index 000000000..42f800d9f --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_IntelGalileo.rb @@ -0,0 +1,106 @@ +MRuby::Build.new do |conf| + + # Gets set by the VS command prompts. + if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] + toolchain :visualcpp + else + toolchain :gcc + end + + enable_debug + + # include the default GEMs + conf.gembox 'default' + +end + + +# Cross Compiling configuration for Intel Galileo on Arduino environment +# http://arduino.cc/en/ArduinoCertified/IntelGalileo +# +# Requires Arduino IDE for Intel Galileo +MRuby::CrossBuild.new("Galileo") do |conf| + toolchain :gcc + + # Mac OS X + # Assume you renamed Arduino.app to Arduino_Galileo.app + GALILEO_ARDUINO_PATH = '/Applications/Arduino_Galileo.app/Contents/Resources/Java' + # GNU Linux + #ARDUINO_GALILEO_PATH = '/opt/arduino' + + GALILEO_BIN_PATH = "#{GALILEO_ARDUINO_PATH}/hardware/tools/x86/i386-pokysdk-darwin/usr/bin/i586-poky-linux-uclibc" + GALILEO_SYSROOT = "#{GALILEO_ARDUINO_PATH}/hardware/tools/x86/i586-poky-linux-uclibc" + GALILEO_X86_PATH = "#{GALILEO_ARDUINO_PATH}/hardware/arduino/x86" + + + conf.cc do |cc| + cc.command = "#{GALILEO_BIN_PATH}/i586-poky-linux-uclibc-gcc" + cc.include_paths << ["#{GALILEO_X86_PATH}/cores/arduino", "#{GALILEO_X86_PATH}/variants/galileo_fab_d"] + cc.flags = %w(-m32 -march=i586 -c -g -Os -w + -ffunction-sections -fdata-sections -MMD -DARDUINO=153) + cc.flags << "--sysroot=#{GALILEO_SYSROOT}" + cc.compile_options = "%{flags} -o %{outfile} -c %{infile}" + end + + conf.cxx do |cxx| + cxx.command = "#{GALILEO_BIN_PATH}/i586-poky-linux-uclibc-g++" + cxx.include_paths = conf.cc.include_paths.dup + cxx.include_paths << "#{GALILEO_ARDUINO_PATH}/hardware/tools/x86/i586-poky-linux-uclibc/usr/include/c++" + cxx.include_paths << "#{GALILEO_ARDUINO_PATH}/hardware/tools/x86/i586-poky-linux-uclibc/usr/include/c++/i586-poky-linux-uclibc" + cxx.flags = conf.cc.flags.dup + cxx.defines = conf.cc.defines.dup + cxx.compile_options = conf.cc.compile_options.dup + end + + conf.archiver do |archiver| + archiver.command = "#{GALILEO_BIN_PATH}/i586-poky-linux-uclibc-ar" + archiver.archive_options = 'rcs %{outfile} %{objs}' + end + + conf.linker do |linker| + linker.command = "#{GALILEO_BIN_PATH}/i586-poky-linux-uclibc-g++" + linker.flags = %w(-m32 -march=i586) + linker.flags << "--sysroot=#{GALILEO_SYSROOT}" + linker.flags << %w(-Os -Wl,--gc-sections) + linker.libraries = %w(m pthread) + end + + #no executables + conf.bins = [] + + #do not build executable test + conf.build_mrbtest_lib_only + + #official mrbgems + conf.gem :core => "mruby-sprintf" + conf.gem :core => "mruby-print" + conf.gem :core => "mruby-math" + conf.gem :core => "mruby-time" + conf.gem :core => "mruby-struct" + conf.gem :core => "mruby-enum-ext" + conf.gem :core => "mruby-string-ext" + conf.gem :core => "mruby-numeric-ext" + conf.gem :core => "mruby-array-ext" + conf.gem :core => "mruby-hash-ext" + conf.gem :core => "mruby-range-ext" + conf.gem :core => "mruby-proc-ext" + conf.gem :core => "mruby-symbol-ext" + conf.gem :core => "mruby-random" + conf.gem :core => "mruby-object-ext" + conf.gem :core => "mruby-objectspace" + conf.gem :core => "mruby-fiber" + conf.gem :core => "mruby-toplevel-ext" + + #lightweigh regular expression + conf.gem :github => "masamitsu-murase/mruby-hs-regexp", :branch => "master" + + #Arduino API + #conf.gem :github =>"kyab/mruby-arduino", :branch => "master" do |g| + # g.cxx.include_paths << "#{GALILEO_X86_PATH}/libraries/Wire" + # g.cxx.include_paths << "#{GALILEO_X86_PATH}/libraries/Servo" + + #enable unsupported Servo class + # g.cxx.defines << "MRUBY_ARDUINO_GALILEO_ENABLE_SERVO" + #end + +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_RX630.rb b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_RX630.rb new file mode 100644 index 000000000..fd17eae99 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_RX630.rb @@ -0,0 +1,81 @@ +MRuby::Build.new do |conf| + + # Gets set by the VS command prompts. + if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] + toolchain :visualcpp + else + toolchain :gcc + end + + enable_debug + + # include the default GEMs + conf.gembox 'default' + +end + +# Cross Compiling configuration for RX630 +# http://gadget.renesas.com/ +# +# Requires gnurx_v14.03 +MRuby::CrossBuild.new("RX630") do |conf| + toolchain :gcc + + # Linux + BIN_PATH = "/usr/share/gnurx_v14.03_elf-1/bin" + + conf.cc do |cc| + cc.command = "#{BIN_PATH}/rx-elf-gcc" + cc.flags = "-Wall -g -O2 -flto -mcpu=rx600 -m64bit-doubles" + cc.compile_options = "%{flags} -o %{outfile} -c %{infile}" + + #configuration for low memory environment + cc.defines << %w(MRB_USE_FLOAT) + cc.defines << %w(MRB_HEAP_PAGE_SIZE=64) + cc.defines << %w(KHASH_DEFAULT_SIZE=8) + cc.defines << %w(MRB_STR_BUF_MIN_SIZE=20) + cc.defines << %w(MRB_GC_STRESS) + cc.defines << %w(MRB_DISABLE_STDIO) #if you dont need stdio. + #cc.defines << %w(POOL_PAGE_SIZE=1000) #effective only for use with mruby-eval + end + + conf.cxx do |cxx| + cxx.command = conf.cc.command.dup + cxx.include_paths = conf.cc.include_paths.dup + cxx.flags = conf.cc.flags.dup + cxx.defines = conf.cc.defines.dup + cxx.compile_options = conf.cc.compile_options.dup + end + + conf.linker do |linker| + linker.command="#{BIN_PATH}/rx-elf-ld" + end + + conf.archiver do |archiver| + archiver.command = "#{BIN_PATH}/rx-elf-ar" + archiver.archive_options = 'rcs %{outfile} %{objs}' + end + + #no executables + conf.bins = [] + + #do not build executable test + conf.build_mrbtest_lib_only + + #disable C++ exception + conf.disable_cxx_exception + + #gems from core + conf.gem :core => "mruby-sprintf" + conf.gem :core => "mruby-print" + conf.gem :core => "mruby-math" + conf.gem :core => "mruby-enum-ext" + conf.gem :core => "mruby-numeric-ext" + + #light-weight regular expression + #conf.gem :github => "masamitsu-murase/mruby-hs-regexp", :branch => "master" + + #Arduino API + #conf.gem :github =>"kyab/mruby-arduino", :branch => "master" + +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_android_arm64-v8a.rb b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_android_arm64-v8a.rb new file mode 100644 index 000000000..6188c13ec --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_android_arm64-v8a.rb @@ -0,0 +1,26 @@ +MRuby::Build.new do |conf| + + # Gets set by the VS command prompts. + if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] + toolchain :visualcpp + else + toolchain :gcc + end + + enable_debug + + # include the default GEMs + conf.gembox 'default' +end + +# Requires Android NDK r13 or later. +MRuby::CrossBuild.new('android-arm64-v8a') do |conf| + params = { + :arch => 'arm64-v8a', + :platform => 'android-24', + :toolchain => :clang, + } + toolchain :android, params + + conf.gembox 'default' +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_android_armeabi.rb b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_android_armeabi.rb new file mode 100644 index 000000000..b7eb33a92 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_android_armeabi.rb @@ -0,0 +1,26 @@ +MRuby::Build.new do |conf| + + # Gets set by the VS command prompts. + if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] + toolchain :visualcpp + else + toolchain :gcc + end + + enable_debug + + # include the default GEMs + conf.gembox 'default' +end + +# Requires Android NDK r13 or later. +MRuby::CrossBuild.new('android-armeabi') do |conf| + params = { + :arch => 'armeabi', + :platform => 'android-24', + :toolchain => :clang, + } + toolchain :android, params + + conf.gembox 'default' +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_android_armeabi_v7a_neon_hard.rb b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_android_armeabi_v7a_neon_hard.rb new file mode 100644 index 000000000..3788bba7f --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_android_armeabi_v7a_neon_hard.rb @@ -0,0 +1,28 @@ +MRuby::Build.new do |conf| + + # Gets set by the VS command prompts. + if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] + toolchain :visualcpp + else + toolchain :gcc + end + + enable_debug + + # include the default GEMs + conf.gembox 'default' +end + +# Requires Android NDK r13 or later. +MRuby::CrossBuild.new('android-armeabi-v7a-neon-hard') do |conf| + params = { + :arch => 'armeabi-v7a', + :mfpu => 'neon', + :mfloat_abi => 'hard', + :platform => 'android-24', + :toolchain => :clang, + } + toolchain :android, params + + conf.gembox 'default' +end diff --git a/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_chipKITMax32.rb b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_chipKITMax32.rb new file mode 100644 index 000000000..951f71483 --- /dev/null +++ b/web/server/h2o/libh2o/deps/mruby/examples/targets/build_config_chipKITMax32.rb @@ -0,0 +1,86 @@ +MRuby::Build.new do |conf| + + # Gets set by the VS command prompts. + if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR'] + toolchain :visualcpp + else + toolchain :gcc + end + + enable_debug + + # include the default GEMs + conf.gembox 'default' + +end + +# Cross Compiling configuration for Digilent chipKIT Max32 +# http://www.digilentinc.com/Products/Detail.cfm?Prod=CHIPKIT-MAX32 +# +# Requires MPIDE (https://github.com/chipKIT32/chipKIT32-MAX) +# +# This configuration is based on @kyab's version +# http://d.hatena.ne.jp/kyab/20130201 +MRuby::CrossBuild.new("chipKITMax32") do |conf| + toolchain :gcc + + # Mac OS X + # MPIDE_PATH = '/Applications/Mpide.app/Contents/Resources/Java' + # GNU Linux + MPIDE_PATH = '/opt/mpide-0023-linux-20120903' + + PIC32_PATH = "#{MPIDE_PATH}/hardware/pic32" + + conf.cc do |cc| + cc.command = "#{PIC32_PATH}/compiler/pic32-tools/bin/pic32-gcc" + cc.include_paths << ["#{PIC32_PATH}/cores/pic32", + "#{PIC32_PATH}/variants/Max32", + "#{PIC32_PATH}/libraries"] + cc.flags = %w(-O2 -mno-smart-io -w -ffunction-sections -fdata-sections -g -mdebugger -Wcast-align + -fno-short-double -mprocessor=32MX795F512L -DF_CPU=80000000L -DARDUINO=23 -D_BOARD_MEGA_ + -DMPIDEVER=0x01000202 -DMPIDE=23) + cc.compile_options = "%{flags} -o %{outfile} -c %{infile}" + + #configuration for low memory environment + cc.defines << %w(MRB_HEAP_PAGE_SIZE=64) + cc.defines << %w(KHASH_DEFAULT_SIZE=8) + cc.defines << %w(MRB_STR_BUF_MIN_SIZE=20) + cc.defines << %w(MRB_GC_STRESS) + #cc.defines << %w(MRB_DISABLE_STDIO) #if you dont need stdio. + #cc.defines << %w(POOL_PAGE_SIZE=1000) #effective only for use with mruby-eval + end + + conf.cxx do |cxx| + cxx.command = conf.cc.command.dup + cxx.include_paths = conf.cc.include_paths.dup + cxx.flags = conf.cc.flags.dup + cxx.defines = conf.cc.defines.dup + cxx.compile_options = conf.cc.compile_options.dup + end + + conf.archiver do |archiver| + archiver.command = "#{PIC32_PATH}/compiler/pic32-tools/bin/pic32-ar" + archiver.archive_options = 'rcs %{outfile} %{objs}' + end + + #no executables + conf.bins = [] + + #do not build test executable + conf.build_mrbtest_lib_only + + #disable C++ exception + conf.disable_cxx_exception + + #gems from core + conf.gem :core => "mruby-print" + conf.gem :core => "mruby-math" + conf.gem :core => "mruby-enum-ext" + + #light-weight regular expression + conf.gem :github => "masamitsu-murase/mruby-hs-regexp", :branch => "master" + + #Arduino API + #conf.gem :github =>"kyab/mruby-arduino", :branch => "master" + +end |