我已经着手为 OpenWRT Barrier Breaker 创建一个带有 Event Machine 的 Ruby 2.2 包。eventmachine包的makefile可以在这里看到:https ://github.com/DaKaZ/ruby-openwrt/blob/master/packages/ruby-eventmachine/Makefile
我能够从提要/包的主干中成功使用 Ruby 2.2 实现,并在我的路由器上使用 Ruby 2.2 运行 OpenWRT Barrier Breaker,但是...... eventmachine 在构建时抛出以下错误:
In file included from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby.h:33:0,
from rubymain.cpp:26:
/Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/ruby.h:107:73: error: size of array 'ruby_check_sizeof_long' is negative
typedef char ruby_check_sizeof_long[SIZEOF_LONG == sizeof(long) ? 1 : -1];
^
/Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/ruby.h:111:76: error: size of array 'ruby_check_sizeof_voidp' is negative
typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
^
In file included from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/intern.h:35:0,
from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/ruby.h:1710,
from /Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby.h:33,
from rubymain.cpp:26:
/Volumes/OpenWrt/barrier_breaker/staging_dir/host/include/ruby-2.2.0/ruby/st.h:52:93: error: size of array 'st_check_for_sizeof_st_index_t' is negative
typedef char st_check_for_sizeof_st_index_t[SIZEOF_VOIDP == (int)sizeof(st_index_t) ? 1 : -1];
^
make[4]: *** [rubymain.o] Error 1
make[3]: *** [/Volumes/OpenWrt/barrier_breaker/build_dir/target-mipsel_74kc+dsp2_uClibc-0.9.33.2/linux-brcm47xx_mips74k/ruby-eventmachine-1.0.7/.built] Error 2
make[3]: Leaving directory `/Volumes/OpenWrt/barrier_breaker/feeds/rubyopenwrt/packages/ruby-eventmachine'
make[2]: *** [package/feeds/rubyopenwrt/ruby-eventmachine/compile] Error 2
make[2]: Leaving directory `/Volumes/OpenWrt/barrier_breaker'
make[1]: *** [/Volumes/OpenWrt/barrier_breaker/staging_dir/target-mipsel_74kc+dsp2_uClibc-0.9.33.2/stamp/.package_compile] Error 2
make[1]: Leaving directory `/Volumes/OpenWrt/barrier_breaker'
make: *** [world] Error 2
这似乎是 ruby 的 HOST 版本中的一个错误,但我无法弄清楚如何正确使用交叉编译版本来构建 eventmachine。请帮忙!