3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

mrubyをAndroid Studioのエミュレーターで動かすためのlibmruby.aを作る

Last updated at Posted at 2016-09-01

はじめに

Android x86なlibmruby.aができれば、Android Studioで高速なエミュレーターを使えるはずと思いやってみた。

Android x86_64向けのlibmruby.aを作るには

toolchain :androidではダメ。

toolchain :android, {:arch => "x86_64",:platform => "android-21"}

と、archにx86_64の指定は当然ながら、platformの指定も必要。

これがないと、

stdint.hがないと怒られる。

Android向けのクロスビルドの設定例

こんな感じで、libmruby.aをarmとx86_64向けに作れた。

MRuby::CrossBuild.new('android') do |conf|
    toolchain :android
    # include the default GEMs
    conf.gembox 'full-core'
end

MRuby::CrossBuild.new('android_x86') do |conf|
    toolchain :android, {:arch => "x86_64",:platform => "android-21"}

    # include the default GEMs
    conf.gembox 'full-core'
end

と、gemboxの指定も忘れずに。。(忘れてlibmaruby.a作って、mrb_load_stringのシンボル参照の解決できずにハマった。)

参考資料

関連記事

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?