Skip to content

Instantly share code, notes, and snippets.

@cosmo0920
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosmo0920/641b143a9818212934b7 to your computer and use it in GitHub Desktop.
Save cosmo0920/641b143a9818212934b7 to your computer and use it in GitHub Desktop.

How to Cross compile Rroonga

apt

  • mingw-w64
  • build-essential

prepare ruby and rubygems

$ rbenv install 1.9.3-p547
$ gem install rubygems-update
$ gem install bundler
$ rbenv install 2.0.0-p353
$ gem install bundler
$ rbenv install 2.1.2
$ gem install bundler

bundle install

$ rbenv local 1.9.3-p547
$ bundle install [--path vendor/bundle]
$ rbenv local 2.0.0-p353
$ bundle install [--path vendor/bundle]
$ rbenv local 2.1.2
$ bundle install [--path vendor/bundle]

rake-compiler

$ rbenv local 1.9.3-p547
$ bundle exec rake-compiler cross-ruby HOST=i686-w64-mingw32 VERSION=1.9.3-p547 [EXTS=--without-extensions]
$ bundle exec rake-compiler cross-ruby HOST=x86_64-w64-mingw32 VERSION=1.9.3-p547 [EXTS=--without-extensions]
$ rbenv local 2.0.0-p353
$ bundle exec rake-compiler cross-ruby HOST=i686-w64-mingw32 VERSION=2.0.0-p353 [EXTS=--without-extensions]
$ bundle exec rake-compiler cross-ruby HOST=x86_64-w64-mingw32 VERSION=2.0.0-p353 [EXTS=--without-extensions]
[$ rbenv local 2.1.2]
$ bundle exec rake-compiler cross-ruby HOST=i686-w64-mingw32 VERSION=2.1.2 [EXTS=--without-extensions]
$ bundle exec rake-compiler cross-ruby HOST=x86_64-w64-mingw32 VERSION=2.1.2 [EXTS=--without-extensions]

cross compile

$ rbenv local 1.9.3-p547
$ bundle exec rake:build
$ bundle exec rake RUBY_CC_VERSION=1.9.3:2.0.0:2.1.2 cross clean native gem
$ make clean
$ bundle exec rake clean:groonga
$ bundle exec rake RUBY_CC_VERSION=1.9.3:2.0.0:2.1.2 cross RROONGA_USE_GROONGA_X64=true clean native gem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment