erlang.mk 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ################################################################################
  2. #
  3. # erlang
  4. #
  5. ################################################################################
  6. # See note below when updating Erlang
  7. ERLANG_VERSION = 22.2
  8. ERLANG_SITE = http://www.erlang.org/download
  9. ERLANG_SOURCE = otp_src_$(ERLANG_VERSION).tar.gz
  10. ERLANG_DEPENDENCIES = host-erlang
  11. ERLANG_LICENSE = Apache-2.0
  12. ERLANG_LICENSE_FILES = LICENSE.txt
  13. ERLANG_INSTALL_STAGING = YES
  14. # Remove the leftover deps directory from the ssl app
  15. # See https://bugs.erlang.org/browse/ERL-1168
  16. define ERLANG_REMOVE_SSL_DEPS
  17. rm -rf $(@D)/lib/ssl/src/deps
  18. endef
  19. ERLANG_POST_PATCH_HOOKS += ERLANG_REMOVE_SSL_DEPS
  20. # Patched erts/aclocal.m4
  21. define ERLANG_RUN_AUTOCONF
  22. cd $(@D) && PATH=$(BR_PATH) ./otp_build autoconf
  23. endef
  24. ERLANG_DEPENDENCIES += host-autoconf
  25. ERLANG_PRE_CONFIGURE_HOOKS += ERLANG_RUN_AUTOCONF
  26. HOST_ERLANG_DEPENDENCIES += host-autoconf
  27. HOST_ERLANG_PRE_CONFIGURE_HOOKS += ERLANG_RUN_AUTOCONF
  28. # Whenever updating Erlang, this value should be updated as well, to the
  29. # value of EI_VSN in the file lib/erl_interface/vsn.mk
  30. ERLANG_EI_VSN = 3.13.1
  31. # The configure checks for these functions fail incorrectly
  32. ERLANG_CONF_ENV = ac_cv_func_isnan=yes ac_cv_func_isinf=yes
  33. # Set erl_xcomp variables. See xcomp/erl-xcomp.conf.template
  34. # for documentation.
  35. ERLANG_CONF_ENV += erl_xcomp_sysroot=$(STAGING_DIR)
  36. ERLANG_CONF_OPTS = --without-javac
  37. # Force ERL_TOP to the downloaded source directory. This prevents
  38. # Erlang's configure script from inadvertantly using files from
  39. # a version of Erlang installed on the host.
  40. ERLANG_CONF_ENV += ERL_TOP=$(@D)
  41. HOST_ERLANG_CONF_ENV += ERL_TOP=$(@D)
  42. # erlang uses openssl for all things crypto. Since the host tools (such as
  43. # rebar) uses crypto, we need to build host-erlang with support for openssl.
  44. HOST_ERLANG_DEPENDENCIES += host-openssl
  45. HOST_ERLANG_CONF_OPTS = --without-javac --with-ssl=$(HOST_DIR)
  46. HOST_ERLANG_CONF_OPTS += --without-termcap
  47. ifeq ($(BR2_PACKAGE_NCURSES),y)
  48. ERLANG_CONF_OPTS += --with-termcap
  49. ERLANG_DEPENDENCIES += ncurses
  50. else
  51. ERLANG_CONF_OPTS += --without-termcap
  52. endif
  53. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  54. ERLANG_CONF_OPTS += --with-ssl
  55. ERLANG_DEPENDENCIES += openssl
  56. else
  57. ERLANG_CONF_OPTS += --without-ssl
  58. endif
  59. ifeq ($(BR2_PACKAGE_UNIXODBC),y)
  60. ERLANG_DEPENDENCIES += unixodbc
  61. ERLANG_CONF_OPTS += --with-odbc
  62. else
  63. ERLANG_CONF_OPTS += --without-odbc
  64. endif
  65. # Always use Buildroot's zlib
  66. ERLANG_CONF_OPTS += --disable-builtin-zlib
  67. ERLANG_DEPENDENCIES += zlib
  68. # Remove source, example, gs and wx files from staging and target.
  69. ERLANG_REMOVE_PACKAGES = gs wx
  70. ifneq ($(BR2_PACKAGE_ERLANG_MEGACO),y)
  71. ERLANG_REMOVE_PACKAGES += megaco
  72. endif
  73. define ERLANG_REMOVE_STAGING_UNUSED
  74. for package in $(ERLANG_REMOVE_PACKAGES); do \
  75. rm -rf $(STAGING_DIR)/usr/lib/erlang/lib/$${package}-*; \
  76. done
  77. endef
  78. define ERLANG_REMOVE_TARGET_UNUSED
  79. find $(TARGET_DIR)/usr/lib/erlang -type d -name src -prune -exec rm -rf {} \;
  80. find $(TARGET_DIR)/usr/lib/erlang -type d -name examples -prune -exec rm -rf {} \;
  81. for package in $(ERLANG_REMOVE_PACKAGES); do \
  82. rm -rf $(TARGET_DIR)/usr/lib/erlang/lib/$${package}-*; \
  83. done
  84. endef
  85. ERLANG_POST_INSTALL_STAGING_HOOKS += ERLANG_REMOVE_STAGING_UNUSED
  86. ERLANG_POST_INSTALL_TARGET_HOOKS += ERLANG_REMOVE_TARGET_UNUSED
  87. $(eval $(autotools-package))
  88. $(eval $(host-autotools-package))