2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2006-01-23 21:21:02 +01:00
|
|
|
#
|
|
|
|
# ruby
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2006-01-23 21:21:02 +01:00
|
|
|
|
2016-01-08 19:48:36 +01:00
|
|
|
RUBY_VERSION_MAJOR = 2.3
|
2016-04-27 12:38:48 +02:00
|
|
|
RUBY_VERSION = $(RUBY_VERSION_MAJOR).1
|
2016-01-08 19:48:36 +01:00
|
|
|
RUBY_VERSION_EXT = 2.3.0
|
2014-08-29 00:17:39 +02:00
|
|
|
RUBY_SITE = http://cache.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR)
|
2015-03-03 15:18:54 +01:00
|
|
|
RUBY_SOURCE = ruby-$(RUBY_VERSION).tar.xz
|
2012-12-29 07:29:05 +01:00
|
|
|
RUBY_DEPENDENCIES = host-pkgconf host-ruby
|
|
|
|
HOST_RUBY_DEPENDENCIES = host-pkgconf
|
2010-11-04 20:09:32 +01: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 \
|
2014-09-06 15:59:26 +02:00
|
|
|
--with-out-ext=curses,openssl,readline \
|
|
|
|
--without-gmp
|
2013-10-08 21:02:33 +02:00
|
|
|
RUBY_LICENSE = Ruby or BSD-2c, BSD-3c, others
|
|
|
|
RUBY_LICENSE_FILES = LEGAL COPYING BSDL
|
2011-02-01 20:14:00 +01:00
|
|
|
|
2013-10-13 13:45:04 +02:00
|
|
|
RUBY_CFLAGS = $(TARGET_CFLAGS)
|
|
|
|
# With some SuperH toolchains (like Sourcery CodeBench 2012.09), ruby fails to
|
|
|
|
# build with 'pcrel too far'. This seems to be caused by the -Os option we pass
|
|
|
|
# by default. To fix the problem, use standard -O2 optimization instead.
|
|
|
|
ifeq ($(BR2_sh)$(BR2_sh64),y)
|
|
|
|
RUBY_CFLAGS += -O2
|
|
|
|
endif
|
|
|
|
RUBY_CONF_ENV = CFLAGS="$(RUBY_CFLAGS)"
|
|
|
|
|
2014-08-29 00:17:38 +02:00
|
|
|
ifeq ($(BR2_bfin),y)
|
2015-11-09 21:25:10 +01:00
|
|
|
RUBY_CONF_ENV += ac_cv_func_dl_iterate_phdr=no
|
2014-10-23 21:58:34 +02:00
|
|
|
# Blackfin doesn't have FFI closure support, needed by the fiddle
|
|
|
|
# extension.
|
|
|
|
RUBY_CONF_OPTS += --with-out-ext=fiddle
|
2014-08-29 00:17:38 +02:00
|
|
|
endif
|
|
|
|
|
2015-11-09 21:25:11 +01:00
|
|
|
ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
|
|
|
|
RUBY_CONF_ENV += stack_protector=no
|
|
|
|
endif
|
|
|
|
|
2010-11-04 20:09:32 +01: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 20:09:32 +01:00
|
|
|
endif
|
2014-05-20 15:44:21 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_GDBM),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += gdbm
|
2014-05-20 15:44:21 +02:00
|
|
|
endif
|
2014-05-20 15:44:20 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_LIBYAML),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += libyaml
|
2014-05-20 15:44:20 +02:00
|
|
|
endif
|
2010-11-04 20:09:32 +01:00
|
|
|
ifeq ($(BR2_PACKAGE_NCURSES),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += ncurses
|
2010-11-04 20:09:32 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += openssl
|
2010-11-04 20:09:32 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_READLINE),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += readline
|
2010-11-04 20:09:32 +01:00
|
|
|
endif
|
|
|
|
ifeq ($(BR2_PACKAGE_ZLIB),y)
|
2015-03-31 09:21:57 +02:00
|
|
|
RUBY_DEPENDENCIES += zlib
|
2010-11-04 20:09:32 +01: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 20:09:32 +01:00
|
|
|
|
2014-12-06 00:23:35 +01:00
|
|
|
# workaround for amazing build failure, see
|
|
|
|
# http://lists.busybox.net/pipermail/buildroot/2014-December/114273.html
|
|
|
|
define RUBY_REMOVE_VERCONF_H
|
|
|
|
rm -f $(@D)/verconf.h
|
|
|
|
endef
|
|
|
|
RUBY_POST_CONFIGURE_HOOKS += RUBY_REMOVE_VERCONF_H
|
|
|
|
|
2014-05-20 15:44:22 +02: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))
|