Skip to content

Commit

Permalink
Merge branch 'master' into android.rake-ndk-clang
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Jones committed Feb 16, 2017
2 parents 70aa6dc + b165708 commit d83aad8
Show file tree
Hide file tree
Showing 113 changed files with 3,600 additions and 1,113 deletions.
8 changes: 0 additions & 8 deletions .travis.yml
Expand Up @@ -16,11 +16,3 @@ addons:

env: MRUBY_CONFIG=travis_config.rb
script: "./minirake all test"

notifications:
# Update mruby-head installed on Travis CI so other projects can test against it.
webhooks:
urls:
- "https://rubies.travis-ci.org/rebuild/mruby-head"
on_success: always
on_failure: never
1 change: 1 addition & 0 deletions AUTHORS
Expand Up @@ -34,3 +34,4 @@ Original Authors "mruby developers" are:
Yuichi Osawa
Terence Lee
Zachary Scott
Tomasz Dąbrowski
2 changes: 1 addition & 1 deletion MITL
@@ -1,4 +1,4 @@
Copyright (c) 2016 mruby developers
Copyright (c) 2017 mruby developers

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand Down
6 changes: 4 additions & 2 deletions build_config.rb
Expand Up @@ -16,8 +16,10 @@
# g.cc.flags << '-g' # append cflags in this gem
# end
# conf.gem 'examples/mrbgems/c_and_ruby_extension_example'
# conf.gem :github => 'masuidrive/mrbgems-example', :checksum_hash => '76518e8aecd131d047378448ac8055fa29d974a9'
# conf.gem :git => 'git@github.com:masuidrive/mrbgems-example.git', :branch => 'master', :options => '-v'
# conf.gem :core => 'mruby-eval'
# conf.gem :mgem => 'mruby-io'
# conf.gem :github => 'iij/mruby-io'
# conf.gem :git => 'git@github.com:iij/mruby-io.git', :branch => 'master', :options => '-v'

# include the default GEMs
conf.gembox 'default'
Expand Down
82 changes: 82 additions & 0 deletions examples/targets/build_config_RX630.rb
@@ -0,0 +1,82 @@
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(MRB_USE_IV_SEGLIST)
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
26 changes: 26 additions & 0 deletions 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
26 changes: 26 additions & 0 deletions 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
17 changes: 17 additions & 0 deletions include/mrbconf.h
Expand Up @@ -7,6 +7,23 @@
#ifndef MRUBYCONF_H
#define MRUBYCONF_H

#include <limits.h>
#include <stdint.h>

/* architecture selection: */
/* specify -DMRB_32BIT or -DMRB_64BIT to override */
#if !defined(MRB_32BIT) && !defined(MRB_64BIT)
#if UINT64_MAX == SIZE_MAX
#define MRB_64BIT
#else
#define MRB_32BIT
#endif
#endif

#if defined(MRB_32BIT) && defined(MRB_64BIT)
#error Cannot build for 32 and 64 bit architecture at the same time
#endif

/* configuration options: */
/* add -DMRB_USE_FLOAT to use float instead of double for floating point numbers */
//#define MRB_USE_FLOAT
Expand Down

0 comments on commit d83aad8

Please sign in to comment.