2013-06-05 23:53:30 +00:00
|
|
|
################################################################################
|
2006-01-23 20:21:02 +00:00
|
|
|
#
|
|
|
|
|
# ruby
|
|
|
|
|
#
|
2013-06-05 23:53:30 +00:00
|
|
|
################################################################################
|
2006-01-23 20:21:02 +00:00
|
|
|
|
2021-12-08 12:53:35 +00:00
|
|
|
RUBY_VERSION_MAJOR = 3.0
|
|
|
|
|
RUBY_VERSION = $(RUBY_VERSION_MAJOR).2
|
|
|
|
|
RUBY_VERSION_EXT = 3.0.0
|
2014-08-29 00:17:39 +02:00
|
|
|
RUBY_SITE = http://cache.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR)
|
2015-03-03 11:18:54 -03:00
|
|
|
RUBY_SOURCE = ruby-$(RUBY_VERSION).tar.xz
|
2012-12-29 06:29:05 +00:00
|
|
|
RUBY_DEPENDENCIES = host-pkgconf host-ruby
|
2019-10-25 13:37:20 +00:00
|
|
|
HOST_RUBY_DEPENDENCIES = host-pkgconf host-openssl
|
2010-11-04 16:09:32 -03:00
|
|
|
RUBY_MAKE_ENV = $(TARGET_MAKE_ENV)
|
2014-09-27 21:32:44 +02:00
|
|
|
RUBY_CONF_OPTS = --disable-install-doc --disable-rpath --disable-rubygems
|
2015-03-31 09:21:57 +02:00
|
|
|
HOST_RUBY_CONF_OPTS = \
|
|
|
|
|
--disable-install-doc \
|
2019-10-25 13:37:20 +00:00
|
|
|
--with-out-ext=curses,readline \
|
2014-09-06 15:59:26 +02:00
|
|
|
--without-gmp
|
2017-03-30 19:13:39 +05:30
|
|
|
RUBY_LICENSE = Ruby or BSD-2-Clause, BSD-3-Clause, others
|
2013-10-08 21:02:33 +02:00
|
|
|
RUBY_LICENSE_FILES = LEGAL COPYING BSDL
|
2021-12-08 12:53:35 +00:00
|
|
|
RUBY_CPE_ID_VENDOR = ruby-lang
|
|
|
|
|
# 0001-fix-default-coroutine-selection.patch
|
|
|
|
|
RUBY_AUTORECONF = YES
|
2011-02-01 20:14:00 +01:00
|
|
|
|
2021-12-08 12:53:35 +00:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
|
|
|
|
|
RUBY_CONF_ENV += LIBS=-latomic
|
2013-10-13 13:45:04 +02:00
|
|
|
endif
|
|
|
|
|
|
ruby: assume we always have finite, isinf and isnan for uClibc
On uClibc, finite, isinf and isnan are not directly implemented as
functions. Instead math.h #define's these to __finite, __isinf and __isnan,
which are real functions.
This confuses the Ruby configure script which use AC_REPLACE_FUNCS to
detect these, as it really checks for a function without including math.h.
Because of the naming difference the checks fail, therefore the symbols
HAVE_FINITE, HAVE_ISINF and HAVE_ISNAN are not defined.
Ruby code relies on those symbols in order to define its own version of
the finite, isinf and isnan functions. Since the symbols haven't been
defined, those definitions cause conflicts with the already-existing
functions.
Fixes:
http://autobuild.buildroot.net/results/f34/f34dc20749c6f6d12c51eddf3ee6c2ef41d7c13d/
[Peter: extend description, add comment in .mk]
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2017-02-07 09:47:59 +00:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
|
|
|
|
|
# On uClibc, finite, isinf and isnan are not directly implemented as
|
|
|
|
|
# functions. Instead math.h #define's these to __finite, __isinf and
|
|
|
|
|
# __isnan, confusing the Ruby configure script. Tell it that they
|
|
|
|
|
# really are available.
|
|
|
|
|
RUBY_CONF_ENV += \
|
|
|
|
|
ac_cv_func_finite=yes \
|
|
|
|
|
ac_cv_func_isinf=yes \
|
|
|
|
|
ac_cv_func_isnan=yes
|
|
|
|
|
endif
|
|
|
|
|
|
2015-11-09 21:25:11 +01:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
|
|
|
|
|
RUBY_CONF_ENV += stack_protector=no
|
|
|
|
|
endif
|
|
|
|
|
|
2010-11-04 16:09:32 -03:00
|
|
|
# Force optionals to build before we do
|
|
|
|
|
ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += berkeleydb
|
2010-11-04 16:09:32 -03:00
|
|
|
endif
|
2020-02-28 09:44:35 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBFFI),y)
|
|
|
|
|
RUBY_DEPENDENCIES += libffi
|
|
|
|
|
else
|
|
|
|
|
# Disable fiddle to avoid a build failure with bundled-libffi on MIPS
|
|
|
|
|
RUBY_CONF_OPTS += --with-out-ext=fiddle
|
|
|
|
|
endif
|
2014-05-20 10:44:21 -03:00
|
|
|
ifeq ($(BR2_PACKAGE_GDBM),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += gdbm
|
2014-05-20 10:44:21 -03:00
|
|
|
endif
|
2014-05-20 10:44:20 -03:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBYAML),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += libyaml
|
2014-05-20 10:44:20 -03:00
|
|
|
endif
|
2010-11-04 16:09:32 -03:00
|
|
|
ifeq ($(BR2_PACKAGE_NCURSES),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += ncurses
|
2010-11-04 16:09:32 -03:00
|
|
|
endif
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += openssl
|
2010-11-04 16:09:32 -03:00
|
|
|
endif
|
|
|
|
|
ifeq ($(BR2_PACKAGE_READLINE),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += readline
|
2010-11-04 16:09:32 -03:00
|
|
|
endif
|
|
|
|
|
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += zlib
|
2010-11-04 16:09:32 -03:00
|
|
|
endif
|
2014-09-06 15:59:27 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_GMP),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += gmp
|
|
|
|
|
RUBY_CONF_OPTS += --with-gmp
|
2014-09-06 15:59:27 +02:00
|
|
|
else
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_CONF_OPTS += --without-gmp
|
2014-09-06 15:59:27 +02:00
|
|
|
endif
|
2010-11-04 16:09:32 -03:00
|
|
|
|
2021-12-08 12:53:35 +00:00
|
|
|
RUBY_CFLAGS = $(TARGET_CFLAGS)
|
|
|
|
|
|
|
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_GCC_BUG_83143),y)
|
|
|
|
|
RUBY_CFLAGS += -freorder-blocks-algorithm=simple
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
RUBY_CONF_OPTS += CFLAGS="$(RUBY_CFLAGS)"
|
2014-12-06 00:23:35 +01:00
|
|
|
|
2014-05-20 10:44:22 -03:00
|
|
|
# Remove rubygems and friends, as they need extensions that aren't
|
|
|
|
|
# built and a target compiler.
|
|
|
|
|
RUBY_EXTENSIONS_REMOVE = rake* rdoc* rubygems*
|
|
|
|
|
define RUBY_REMOVE_RUBYGEMS
|
|
|
|
|
rm -f $(addprefix $(TARGET_DIR)/usr/bin/, gem rdoc ri rake)
|
|
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/ruby/gems
|
|
|
|
|
rm -rf $(addprefix $(TARGET_DIR)/usr/lib/ruby/$(RUBY_VERSION_EXT)/, \
|
|
|
|
|
$(RUBY_EXTENSIONS_REMOVE))
|
|
|
|
|
endef
|
|
|
|
|
RUBY_POST_INSTALL_TARGET_HOOKS += RUBY_REMOVE_RUBYGEMS
|
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(autotools-package))
|
2012-07-03 00:06:54 +02:00
|
|
|
$(eval $(host-autotools-package))
|