diff options
| -rw-r--r-- | Rakefile | 7 | ||||
| -rw-r--r-- | build_config.rb | 3 | ||||
| -rw-r--r-- | include/mrbconf.h | 4 | ||||
| -rw-r--r-- | mgems/mruby-math/mrbgem.rake | 4 | ||||
| -rw-r--r-- | mgems/mruby-math/src/math.c (renamed from src/math.c) | 9 | ||||
| -rw-r--r-- | mgems/mruby-math/test/math.rb (renamed from test/t/math.rb) | 0 | ||||
| -rw-r--r-- | src/init.c | 3 | ||||
| -rw-r--r-- | src/parse.y | 2 | ||||
| -rw-r--r-- | tasks/mruby_build.rake | 2 |
9 files changed, 18 insertions, 16 deletions
@@ -32,7 +32,6 @@ load "#{MRUBY_ROOT}/tools/mirb/mirb.rake" load "#{MRUBY_ROOT}/tasks/mrbgems_test.rake" load "#{MRUBY_ROOT}/test/mrbtest.rake" - ############################## # generic build targets, rules task :default => :all @@ -42,7 +41,7 @@ depfiles = MRuby.targets['host'].bins.map do |bin| source_path = MRuby.targets['host'].exefile("#{MRuby.targets['host'].build_dir}/bin/#{bin}") file install_path => source_path do |t| - FileUtils.cp t.prerequisites.first, t.name + FileUtils.cp t.prerequisites.first, t.name, { :verbose => $verbose } end install_path @@ -72,8 +71,8 @@ end desc "clean all built and in-repo installed artifacts" task :clean do MRuby.each_target do |t| - FileUtils.rm_rf t.build_dir + FileUtils.rm_rf t.build_dir, { :verbose => $verbose } end - FileUtils.rm_f depfiles + FileUtils.rm_f depfiles, { :verbose => $verbose } puts "Cleaned up build folder" end diff --git a/build_config.rb b/build_config.rb index a66dab6ac..99761a795 100644 --- a/build_config.rb +++ b/build_config.rb @@ -11,6 +11,9 @@ MRuby::Build.new do |conf| # conf.gem :github => 'masuidrive/mrbgems-example', :branch => 'master' # conf.gem :git => '[email protected]:masuidrive/mrbgems-example.git', :branch => 'master', :options => '-v' + # Use standard Math module + conf.gem 'mgems/mruby-math' + # Use standard Time class conf.gem 'mgems/mruby-time' diff --git a/include/mrbconf.h b/include/mrbconf.h index 092e02d11..45e3d6034 100644 --- a/include/mrbconf.h +++ b/include/mrbconf.h @@ -45,7 +45,6 @@ /* -DDISABLE_XXXX to drop following features */ //#define DISABLE_SPRINTF /* Kernel.sprintf method */ -//#define DISABLE_MATH /* Math functions */ //#define DISABLE_STRUCT /* Struct class */ //#define DISABLE_STDIO /* use of stdio */ @@ -85,9 +84,6 @@ typedef short mrb_sym; #ifndef DISABLE_SPRINTF #define ENABLE_SPRINTF #endif -#ifndef DISABLE_MATH -#define ENABLE_MATH -#endif #ifndef DISABLE_STRUCT #define ENABLE_STRUCT #endif diff --git a/mgems/mruby-math/mrbgem.rake b/mgems/mruby-math/mrbgem.rake new file mode 100644 index 000000000..4b0fa40fd --- /dev/null +++ b/mgems/mruby-math/mrbgem.rake @@ -0,0 +1,4 @@ +MRuby::Gem::Specification.new('mruby-math') do |spec| + spec.license = 'MIT' + spec.authors = 'mruby developers' +end diff --git a/src/math.c b/mgems/mruby-math/src/math.c index 782b75c97..9955d9862 100644 --- a/src/math.c +++ b/mgems/mruby-math/src/math.c @@ -7,7 +7,6 @@ #include "mruby.h" #include "mruby/array.h" -#ifdef ENABLE_MATH #include <math.h> #define domain_error(msg) \ @@ -630,7 +629,7 @@ math_erfc(mrb_state *mrb, mrb_value obj) /* ------------------------------------------------------------------------*/ void -mrb_init_math(mrb_state *mrb) +mrb_mruby_math_gem_init(mrb_state* mrb) { struct RClass *mrb_math; mrb_math = mrb_define_module(mrb, "Math"); @@ -685,4 +684,8 @@ mrb_init_math(mrb_state *mrb) mrb_define_module_function(mrb, mrb_math, "erf", math_erf, ARGS_REQ(1)); mrb_define_module_function(mrb, mrb_math, "erfc", math_erfc, ARGS_REQ(1)); } -#endif /* ENABLE_MATH */ + +void +mrb_mruby_math_gem_final(mrb_state* mrb) +{ +} diff --git a/test/t/math.rb b/mgems/mruby-math/test/math.rb index 780b805d2..780b805d2 100644 --- a/test/t/math.rb +++ b/mgems/mruby-math/test/math.rb diff --git a/src/init.c b/src/init.c index c5235396b..fa2d5d305 100644 --- a/src/init.c +++ b/src/init.c @@ -55,9 +55,6 @@ mrb_init_core(mrb_state *mrb) #ifdef ENABLE_STDIO mrb_init_print(mrb); DONE; #endif -#ifdef ENABLE_MATH - mrb_init_math(mrb); DONE; -#endif mrb_init_mrblib(mrb); DONE; #ifndef DISABLE_GEMS mrb_init_mrbgems(mrb); DONE; diff --git a/src/parse.y b/src/parse.y index 365bc5f18..2c5690ea3 100644 --- a/src/parse.y +++ b/src/parse.y @@ -4440,7 +4440,7 @@ parser_yylex(parser_state *p) p->lex_strterm = new_strterm(p, str_regexp, term, paren); #endif p->regexp = 1; - p->sterm = '/'; + p->sterm = term; return tREGEXP_BEG; case 's': diff --git a/tasks/mruby_build.rake b/tasks/mruby_build.rake index 4d28b1d95..812e861a7 100644 --- a/tasks/mruby_build.rake +++ b/tasks/mruby_build.rake @@ -163,7 +163,7 @@ module MRuby def run_test puts ">>> Test #{name} <<<" mrbtest = exefile("#{build_dir}/test/mrbtest") - sh "#{filename mrbtest.relative_path}" + sh "#{filename mrbtest.relative_path}#{$verbose ? ' -v' : ''}" puts end |
