ruby.mk 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. ################################################################################
  2. #
  3. # ruby
  4. #
  5. ################################################################################
  6. RUBY_VERSION_MAJOR = 1.9
  7. RUBY_VERSION = $(RUBY_VERSION_MAJOR).3-p545
  8. # 1.9.1 directory used for extensions
  9. RUBY_VERSION_EXT = 1.9.1
  10. RUBY_SITE = ftp://ftp.ruby-lang.org/pub/ruby/$(RUBY_VERSION_MAJOR)
  11. RUBY_DEPENDENCIES = host-pkgconf host-ruby
  12. HOST_RUBY_DEPENDENCIES = host-pkgconf
  13. RUBY_MAKE_ENV = $(TARGET_MAKE_ENV)
  14. RUBY_MAKE = $(MAKE1)
  15. RUBY_CONF_OPT = --disable-install-doc --disable-rpath
  16. HOST_RUBY_CONF_OPT = --disable-install-doc \
  17. --with-out-ext=curses,openssl,readline
  18. RUBY_LICENSE = Ruby or BSD-2c, BSD-3c, others
  19. RUBY_LICENSE_FILES = LEGAL COPYING BSDL
  20. RUBY_CFLAGS = $(TARGET_CFLAGS)
  21. # With some SuperH toolchains (like Sourcery CodeBench 2012.09), ruby fails to
  22. # build with 'pcrel too far'. This seems to be caused by the -Os option we pass
  23. # by default. To fix the problem, use standard -O2 optimization instead.
  24. ifeq ($(BR2_sh)$(BR2_sh64),y)
  25. RUBY_CFLAGS += -O2
  26. endif
  27. RUBY_CONF_ENV = CFLAGS="$(RUBY_CFLAGS)"
  28. # Force optionals to build before we do
  29. ifeq ($(BR2_PACKAGE_BERKELEYDB),y)
  30. RUBY_DEPENDENCIES += berkeleydb
  31. endif
  32. ifeq ($(BR2_PACKAGE_GDBM),y)
  33. RUBY_DEPENDENCIES += gdbm
  34. endif
  35. ifeq ($(BR2_PACKAGE_LIBYAML),y)
  36. RUBY_DEPENDENCIES += libyaml
  37. endif
  38. ifeq ($(BR2_PACKAGE_NCURSES),y)
  39. RUBY_DEPENDENCIES += ncurses
  40. endif
  41. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  42. RUBY_DEPENDENCIES += openssl
  43. endif
  44. ifeq ($(BR2_PACKAGE_READLINE),y)
  45. RUBY_DEPENDENCIES += readline
  46. endif
  47. ifeq ($(BR2_PACKAGE_ZLIB),y)
  48. RUBY_DEPENDENCIES += zlib
  49. endif
  50. # Remove rubygems and friends, as they need extensions that aren't
  51. # built and a target compiler.
  52. RUBY_EXTENSIONS_REMOVE = rake* rdoc* rubygems*
  53. define RUBY_REMOVE_RUBYGEMS
  54. rm -f $(addprefix $(TARGET_DIR)/usr/bin/, gem rdoc ri rake)
  55. rm -rf $(TARGET_DIR)/usr/lib/ruby/gems
  56. rm -rf $(addprefix $(TARGET_DIR)/usr/lib/ruby/$(RUBY_VERSION_EXT)/, \
  57. $(RUBY_EXTENSIONS_REMOVE))
  58. endef
  59. RUBY_POST_INSTALL_TARGET_HOOKS += RUBY_REMOVE_RUBYGEMS
  60. $(eval $(autotools-package))
  61. $(eval $(host-autotools-package))