mattn / mruby-onig-regexp

mrbgem of 鬼雲's Regular Expression
31 stars 36 forks source link

How to cross compile this gem? #100

Open torsakch opened 5 years ago

torsakch commented 5 years ago

I'm trying to cross compile this gem. Unfortunately, it's not success. Do you have some steps to do that? Thanks

mattn commented 5 years ago

I confirm that mruby-onig-regexp support Visual Studio, mingw64, Linux, OSX. What is target OS? Please show me compilation error.

torsakch commented 5 years ago

I'm using OSX.

` MRuby::CrossBuild.new('android-armeabi') do |conf|

ENV['ANDROID_ARCH'] = 'armeabi'

toolchain :android

conf.gembox 'custom'

conf.cc.flags << '-O3' conf.linker.flags << "-lm"

end `

I'm trying to cross compile like this. In the custom.gembox, I have the line like this.

conf.gem :github => 'mattn/mruby-onig-regexp'

I found that when the system built, the file "onigmo-6.1.3.tar.gz" don't get unzipped and the onigmo doesn't get compiled. Thank you for help.

mattn commented 5 years ago

What error message?

torsakch commented 5 years ago

The compile is fine. But it cannot be linked. The error messages are like "undef: _OnigEncodingASCII" when linked.

mattn commented 5 years ago

What compiler do you use? gcc or clang? version?

torsakch commented 5 years ago

I use clang.

clang -v
Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
mattn commented 5 years ago

Hmm, can you build onigmo-6.1.3 with extract tar.gz?