ruby.mk 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ################################################################################
  2. #
  3. # ruby
  4. #
  5. ################################################################################
  6. RUBY_VERSION_MAJOR = 3.0
  7. RUBY_VERSION = $(RUBY_VERSION_MAJOR).2
  8. RUBY_VERSION_EXT = 3.0.0
  9. RUBY_SITE = http://cache.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR)
  10. RUBY_SOURCE = ruby-$(RUBY_VERSION).tar.xz
  11. RUBY_DEPENDENCIES = host-pkgconf host-ruby
  12. HOST_RUBY_DEPENDENCIES = host-pkgconf host-openssl
  13. RUBY_MAKE_ENV = $(TARGET_MAKE_ENV)
  14. RUBY_CONF_OPTS = --disable-install-doc --disable-rpath --disable-rubygems
  15. HOST_RUBY_CONF_OPTS = \
  16. --disable-install-doc \
  17. --with-out-ext=curses,readline \
  18. --without-gmp
  19. RUBY_LICENSE = Ruby or BSD-2-Clause, BSD-3-Clause, others
  20. RUBY_LICENSE_FILES = LEGAL COPYING BSDL
  21. RUBY_CPE_ID_VENDOR = ruby-lang
  22. # 0001-fix-default-coroutine-selection.patch
  23. RUBY_AUTORECONF = YES
  24. ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
  25. RUBY_CONF_ENV += LIBS=-latomic
  26. endif
  27. ifeq ($(BR2_TOOLCHAIN_USES_UCLIBC),y)
  28. # On uClibc, finite, isinf and isnan are not directly implemented as
  29. # functions. Instead math.h #define's these to __finite, __isinf and
  30. # __isnan, confusing the Ruby configure script. Tell it that they
  31. # really are available.
  32. RUBY_CONF_ENV += \
  33. ac_cv_func_finite=yes \
  34. ac_cv_func_isinf=yes \
  35. ac_cv_func_isnan=yes
  36. endif
  37. ifeq ($(BR2_TOOLCHAIN_HAS_SSP),)
  38. RUBY_CONF_ENV += stack_protector=no
  39. endif
  40. # Force optionals to build before we do
  41. ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
  42. RUBY_DEPENDENCIES += berkeleydb
  43. endif
  44. ifeq ($(BR2_PACKAGE_LIBFFI),y)
  45. RUBY_DEPENDENCIES += libffi
  46. else
  47. # Disable fiddle to avoid a build failure with bundled-libffi on MIPS
  48. RUBY_CONF_OPTS += --with-out-ext=fiddle
  49. endif
  50. ifeq ($(BR2_PACKAGE_GDBM),y)
  51. RUBY_DEPENDENCIES += gdbm
  52. endif
  53. ifeq ($(BR2_PACKAGE_LIBYAML),y)
  54. RUBY_DEPENDENCIES += libyaml
  55. endif
  56. ifeq ($(BR2_PACKAGE_NCURSES),y)
  57. RUBY_DEPENDENCIES += ncurses
  58. endif
  59. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  60. RUBY_DEPENDENCIES += openssl
  61. endif
  62. ifeq ($(BR2_PACKAGE_READLINE),y)
  63. RUBY_DEPENDENCIES += readline
  64. endif
  65. ifeq ($(BR2_PACKAGE_ZLIB),y)
  66. RUBY_DEPENDENCIES += zlib
  67. endif
  68. ifeq ($(BR2_PACKAGE_GMP),y)
  69. RUBY_DEPENDENCIES += gmp
  70. RUBY_CONF_OPTS += --with-gmp
  71. else
  72. RUBY_CONF_OPTS += --without-gmp
  73. endif
  74. # Remove rubygems and friends, as they need extensions that aren't
  75. # built and a target compiler.
  76. RUBY_EXTENSIONS_REMOVE = rake* rdoc* rubygems*
  77. define RUBY_REMOVE_RUBYGEMS
  78. rm -f $(addprefix $(TARGET_DIR)/usr/bin/, gem rdoc ri rake)
  79. rm -rf $(TARGET_DIR)/usr/lib/ruby/gems
  80. rm -rf $(addprefix $(TARGET_DIR)/usr/lib/ruby/$(RUBY_VERSION_EXT)/, \
  81. $(RUBY_EXTENSIONS_REMOVE))
  82. endef
  83. RUBY_POST_INSTALL_TARGET_HOOKS += RUBY_REMOVE_RUBYGEMS
  84. $(eval $(autotools-package))
  85. $(eval $(host-autotools-package))