Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare stub functions for libmruby_core in core #6024

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/mruby/build.rb
Expand Up @@ -76,7 +76,8 @@ def install_dir
include Rake::DSL
include LoadGems
attr_accessor :name, :bins, :exts, :file_separator, :build_dir, :gem_clone_dir, :defines
attr_reader :products, :libmruby_core_objs, :libmruby_objs, :gems, :toolchains, :presym, :mrbc_build, :gem_dir_to_repo_url
attr_reader :products, :libmruby_core_only_objs, :libmruby_core_objs, :libmruby_objs
attr_reader :gems, :toolchains, :presym, :mrbc_build, :gem_dir_to_repo_url

alias libmruby libmruby_objs

Expand Down Expand Up @@ -117,6 +118,7 @@ def initialize(name='host', build_dir=nil, internal: false, &block)
@products = []
@bins = []
@gems = MRuby::Gem::List.new
@libmruby_core_only_objs = []
@libmruby_core_objs = []
@libmruby_objs = [@libmruby_core_objs]
@enable_libmruby = true
Expand Down
12 changes: 0 additions & 12 deletions mrbgems/mruby-bin-mrbc/tools/mrbc/mrbc.c
Expand Up @@ -357,15 +357,3 @@ main(int argc, char **argv)
}
return EXIT_SUCCESS;
}

void
mrb_init_mrblib(mrb_state *mrb)
{
}

#ifndef MRB_NO_GEMS
void
mrb_init_mrbgems(mrb_state *mrb)
{
}
#endif
@@ -1,10 +1,27 @@
#include <mruby.h>
/*
** stub.c - stub functions for libmruby_core
**
** See Copyright Notice in mruby.h
*/

/*
functions defined in mrbgems referenced from the core should be listed here
to avoid link errors, since mrbc does not link any mrbgem ignoring configuration.
*/

#include <mruby.h>

void
mrb_init_mrblib(mrb_state *mrb)
{
}

#ifndef MRB_NO_GEMS
void mrb_init_mrbgems(mrb_state *mrb)
{
}
#endif

#ifdef MRB_USE_COMPLEX
mrb_value mrb_complex_new(mrb_state *mrb, mrb_float x, mrb_float y)
{
Expand Down
5 changes: 5 additions & 0 deletions tasks/core.rake
Expand Up @@ -9,4 +9,9 @@ MRuby.each_target do
end
end
self.libmruby_core_objs << objs

Dir.glob("#{MRUBY_ROOT}/src/coreonly/*.c").each do |src|
obj = objfile(src.pathmap("#{build_dir}/src/coreonly/%n"))
self.libmruby_core_only_objs << obj
end
end
2 changes: 1 addition & 1 deletion tasks/libmruby.rake
@@ -1,5 +1,5 @@
MRuby.each_target do
file libmruby_core_static => libmruby_core_objs.flatten do |t|
file libmruby_core_static => [libmruby_core_objs, libmruby_core_only_objs].flatten do |t|
archiver.run t.name, t.prerequisites
end

Expand Down