1 ################################################################################
5 ################################################################################
7 RUBY_VERSION_MAJOR = 2.2
8 RUBY_VERSION = $(RUBY_VERSION_MAJOR).2
9 RUBY_VERSION_EXT = 2.2.0
10 RUBY_SITE = http://cache.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR)
11 RUBY_SOURCE = ruby-$(RUBY_VERSION).tar.xz
12 RUBY_DEPENDENCIES = host-pkgconf host-ruby
13 HOST_RUBY_DEPENDENCIES = host-pkgconf
14 RUBY_MAKE_ENV = $(TARGET_MAKE_ENV)
16 RUBY_CONF_OPTS = --disable-install-doc --disable-rpath --disable-rubygems
17 HOST_RUBY_CONF_OPTS = \
18 --disable-install-doc \
19 --with-out-ext=curses,openssl,readline \
21 RUBY_LICENSE = Ruby or BSD-2c, BSD-3c, others
22 RUBY_LICENSE_FILES = LEGAL COPYING BSDL
24 RUBY_CFLAGS = $(TARGET_CFLAGS)
25 # With some SuperH toolchains (like Sourcery CodeBench 2012.09), ruby fails to
26 # build with 'pcrel too far'. This seems to be caused by the -Os option we pass
27 # by default. To fix the problem, use standard -O2 optimization instead.
28 ifeq ($(BR2_sh)$(BR2_sh64),y)
31 RUBY_CONF_ENV = CFLAGS="$(RUBY_CFLAGS)"
34 RUBY_CONF_ENV = ac_cv_func_dl_iterate_phdr=no
35 # Blackfin doesn't have FFI closure support, needed by the fiddle
37 RUBY_CONF_OPTS += --with-out-ext=fiddle
40 # Force optionals to build before we do
41 ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
42 RUBY_DEPENDENCIES += berkeleydb
44 ifeq ($(BR2_PACKAGE_GDBM),y)
45 RUBY_DEPENDENCIES += gdbm
47 ifeq ($(BR2_PACKAGE_LIBYAML),y)
48 RUBY_DEPENDENCIES += libyaml
50 ifeq ($(BR2_PACKAGE_NCURSES),y)
51 RUBY_DEPENDENCIES += ncurses
53 ifeq ($(BR2_PACKAGE_OPENSSL),y)
54 RUBY_DEPENDENCIES += openssl
56 ifeq ($(BR2_PACKAGE_READLINE),y)
57 RUBY_DEPENDENCIES += readline
59 ifeq ($(BR2_PACKAGE_ZLIB),y)
60 RUBY_DEPENDENCIES += zlib
62 ifeq ($(BR2_PACKAGE_GMP),y)
63 RUBY_DEPENDENCIES += gmp
64 RUBY_CONF_OPTS += --with-gmp
66 RUBY_CONF_OPTS += --without-gmp
69 # workaround for amazing build failure, see
70 # http://lists.busybox.net/pipermail/buildroot/2014-December/114273.html
71 define RUBY_REMOVE_VERCONF_H
74 RUBY_POST_CONFIGURE_HOOKS += RUBY_REMOVE_VERCONF_H
76 # Remove rubygems and friends, as they need extensions that aren't
77 # built and a target compiler.
78 RUBY_EXTENSIONS_REMOVE = rake* rdoc* rubygems*
79 define RUBY_REMOVE_RUBYGEMS
80 rm -f $(addprefix $(TARGET_DIR)/usr/bin/, gem rdoc ri rake)
81 rm -rf $(TARGET_DIR)/usr/lib/ruby/gems
82 rm -rf $(addprefix $(TARGET_DIR)/usr/lib/ruby/$(RUBY_VERSION_EXT)/, \
83 $(RUBY_EXTENSIONS_REMOVE))
85 RUBY_POST_INSTALL_TARGET_HOOKS += RUBY_REMOVE_RUBYGEMS
87 $(eval $(autotools-package))
88 $(eval $(host-autotools-package))