zynq_zed: bump U-Boot to xilinx-v2016.2
[buildroot-gz.git] / package / ruby / ruby.mk
blob3b8310c112aac880cc604bb8526cfe4c4ef3ba65
1 ################################################################################
3 # ruby
5 ################################################################################
7 RUBY_VERSION_MAJOR = 2.3
8 RUBY_VERSION = $(RUBY_VERSION_MAJOR).1
9 RUBY_VERSION_EXT = 2.3.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 \
19 --without-gmp
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.
27 ifeq ($(BR2_sh)$(BR2_sh64),y)
28 RUBY_CFLAGS += -O2
29 endif
30 RUBY_CONF_ENV = CFLAGS="$(RUBY_CFLAGS)"
32 ifeq ($(BR2_bfin),y)
33 RUBY_CONF_ENV += ac_cv_func_dl_iterate_phdr=no
34 # Blackfin doesn't have FFI closure support, needed by the fiddle
35 # extension.
36 RUBY_CONF_OPTS += --with-out-ext=fiddle
37 endif
39 ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
40 RUBY_CONF_ENV += stack_protector=no
41 endif
43 # Force optionals to build before we do
44 ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
45 RUBY_DEPENDENCIES += berkeleydb
46 endif
47 ifeq ($(BR2_PACKAGE_GDBM),y)
48 RUBY_DEPENDENCIES += gdbm
49 endif
50 ifeq ($(BR2_PACKAGE_LIBYAML),y)
51 RUBY_DEPENDENCIES += libyaml
52 endif
53 ifeq ($(BR2_PACKAGE_NCURSES),y)
54 RUBY_DEPENDENCIES += ncurses
55 endif
56 ifeq ($(BR2_PACKAGE_OPENSSL),y)
57 RUBY_DEPENDENCIES += openssl
58 endif
59 ifeq ($(BR2_PACKAGE_READLINE),y)
60 RUBY_DEPENDENCIES += readline
61 endif
62 ifeq ($(BR2_PACKAGE_ZLIB),y)
63 RUBY_DEPENDENCIES += zlib
64 endif
65 ifeq ($(BR2_PACKAGE_GMP),y)
66 RUBY_DEPENDENCIES += gmp
67 RUBY_CONF_OPTS += --with-gmp
68 else
69 RUBY_CONF_OPTS += --without-gmp
70 endif
72 # workaround for amazing build failure, see
73 # http://lists.busybox.net/pipermail/buildroot/2014-December/114273.html
74 define RUBY_REMOVE_VERCONF_H
75 rm -f $(@D)/verconf.h
76 endef
77 RUBY_POST_CONFIGURE_HOOKS += RUBY_REMOVE_VERCONF_H
79 # Remove rubygems and friends, as they need extensions that aren't
80 # built and a target compiler.
81 RUBY_EXTENSIONS_REMOVE = rake* rdoc* rubygems*
82 define RUBY_REMOVE_RUBYGEMS
83 rm -f $(addprefix $(TARGET_DIR)/usr/bin/, gem rdoc ri rake)
84 rm -rf $(TARGET_DIR)/usr/lib/ruby/gems
85 rm -rf $(addprefix $(TARGET_DIR)/usr/lib/ruby/$(RUBY_VERSION_EXT)/, \
86 $(RUBY_EXTENSIONS_REMOVE))
87 endef
88 RUBY_POST_INSTALL_TARGET_HOOKS += RUBY_REMOVE_RUBYGEMS
90 $(eval $(autotools-package))
91 $(eval $(host-autotools-package))