ruby.mk 2.8 KB

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