1 ################################################################################
5 ################################################################################
7 RUBY_VERSION_MAJOR
= 2.4
8 RUBY_VERSION
= $(RUBY_VERSION_MAJOR
).1
9 RUBY_VERSION_EXT
= 2.4.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
)
15 RUBY_CONF_OPTS
= --disable-install-doc
--disable-rpath
--disable-rubygems
16 HOST_RUBY_CONF_OPTS
= \
17 --disable-install-doc \
18 --with-out-ext
=curses
,openssl
,readline \
20 RUBY_LICENSE
= Ruby or BSD-2c
, BSD-3c
, others
21 RUBY_LICENSE_FILES
= LEGAL COPYING BSDL
23 RUBY_CFLAGS
= $(TARGET_CFLAGS
)
24 # With some SuperH toolchains (like Sourcery CodeBench 2012.09), ruby fails to
25 # build with 'pcrel too far'. This seems to be caused by the -Os option we pass
26 # by default. To fix the problem, use standard -O2 optimization instead.
30 RUBY_CONF_ENV
= CFLAGS
="$(RUBY_CFLAGS)"
32 ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC
),y
)
33 # On uClibc, finite, isinf and isnan are not directly implemented as
34 # functions. Instead math.h #define's these to __finite, __isinf and
35 # __isnan, confusing the Ruby configure script. Tell it that they
36 # really are available.
38 ac_cv_func_finite
=yes \
39 ac_cv_func_isinf
=yes \
44 RUBY_CONF_ENV
+= ac_cv_func_dl_iterate_phdr
=no
45 # Blackfin doesn't have FFI closure support, needed by the fiddle
47 RUBY_CONF_OPTS
+= --with-out-ext
=fiddle
50 ifeq ($(BR2_TOOLCHAIN_HAS_SSP
),)
51 RUBY_CONF_ENV
+= stack_protector
=no
54 # Force optionals to build before we do
55 ifeq ($(BR2_PACKAGE_BERKELEYDB
),y
)
56 RUBY_DEPENDENCIES
+= berkeleydb
58 ifeq ($(BR2_PACKAGE_GDBM
),y
)
59 RUBY_DEPENDENCIES
+= gdbm
61 ifeq ($(BR2_PACKAGE_LIBYAML
),y
)
62 RUBY_DEPENDENCIES
+= libyaml
64 ifeq ($(BR2_PACKAGE_NCURSES
),y
)
65 RUBY_DEPENDENCIES
+= ncurses
67 ifeq ($(BR2_PACKAGE_OPENSSL
),y
)
68 RUBY_DEPENDENCIES
+= openssl
70 ifeq ($(BR2_PACKAGE_READLINE
),y
)
71 RUBY_DEPENDENCIES
+= readline
73 ifeq ($(BR2_PACKAGE_ZLIB
),y
)
74 RUBY_DEPENDENCIES
+= zlib
76 ifeq ($(BR2_PACKAGE_GMP
),y
)
77 RUBY_DEPENDENCIES
+= gmp
78 RUBY_CONF_OPTS
+= --with-gmp
80 RUBY_CONF_OPTS
+= --without-gmp
83 # workaround for amazing build failure, see
84 # http://lists.busybox.net/pipermail/buildroot/2014-December/114273.html
85 define RUBY_REMOVE_VERCONF_H
88 RUBY_POST_CONFIGURE_HOOKS
+= RUBY_REMOVE_VERCONF_H
90 # Remove rubygems and friends, as they need extensions that aren't
91 # built and a target compiler.
92 RUBY_EXTENSIONS_REMOVE
= rake
* rdoc
* rubygems
*
93 define RUBY_REMOVE_RUBYGEMS
94 rm -f
$(addprefix $(TARGET_DIR
)/usr
/bin
/, gem rdoc ri rake
)
95 rm -rf
$(TARGET_DIR
)/usr
/lib
/ruby
/gems
96 rm -rf
$(addprefix $(TARGET_DIR
)/usr
/lib
/ruby
/$(RUBY_VERSION_EXT
)/, \
97 $(RUBY_EXTENSIONS_REMOVE
))
99 RUBY_POST_INSTALL_TARGET_HOOKS
+= RUBY_REMOVE_RUBYGEMS
101 $(eval
$(autotools-package
))
102 $(eval
$(host-autotools-package
))