You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

335 lines
8.6 KiB

  1. #
  2. # Copyright (C) 2009-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=erlang
  9. PKG_VERSION:=17.1
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=otp_src_$(PKG_VERSION).tar.gz
  12. PKG_SOURCE_URL:= http://www.erlang.org/download/ \
  13. http://erlang.mirror.su.se/
  14. PKG_MD5SUM:=9c90706ce70e01651adde34a2b79bf4c
  15. PKG_LICENSE:=ErlPL-1.1
  16. PKG_LICENSE_FILE:=EPLICENCE
  17. PKG_MAINTAINER:=Nicolas Thill <nico@openwrt.org>
  18. PKG_BUILD_DEPENDS:=erlang/host openssl
  19. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/otp_src_$(PKG_VERSION)
  20. PKG_BUILD_DIR:=$(BUILD_DIR)/otp_src_$(PKG_VERSION)
  21. include $(INCLUDE_DIR)/host-build.mk
  22. include $(INCLUDE_DIR)/package.mk
  23. define Package/erlang/Default
  24. SUBMENU:=Erlang
  25. SECTION:=lang
  26. CATEGORY:=Languages
  27. TITLE:=Erlang/OTP programming language
  28. URL:=http://www.erlang.org/
  29. endef
  30. define Package/erlang/Default/description
  31. Erlang/OTP is a general-purpose programming language and runtime
  32. environment. Erlang has built-in support for concurrency, distribution
  33. and fault tolerance.
  34. endef
  35. define Package/erlang
  36. $(call Package/erlang/Default)
  37. DEPENDS+= +libncurses +librt +zlib
  38. PROVIDES:= erlang-erts=6.1 erlang-kernel=3.0.1 erlang-sasl=2.4 erlang-stdlib=2.1
  39. endef
  40. define Package/erlang/description
  41. $(call Package/erlang/Default/description)
  42. .
  43. This package contains the runtime implementation and a minimal set of
  44. modules (erts, kernel, sasl & stdlib).
  45. endef
  46. define Package/erlang-asn1
  47. $(call Package/erlang/Default)
  48. TITLE:=Abstract Syntax Notation One (ASN.1) support
  49. VERSION:=3.0.1
  50. DEPENDS+= +erlang +erlang-syntax-tools
  51. endef
  52. define Package/erlang-asn1/description
  53. $(call Package/erlang/Default/description)
  54. .
  55. This Erlang/OTP package provides Abstract Syntax Notation One (ASN.1)
  56. support.
  57. endef
  58. define Package/erlang-compiler
  59. $(call Package/erlang/Default)
  60. TITLE:=Byte code compiler
  61. VERSION:=5.0.1
  62. DEPENDS+= +erlang +erlang-hipe
  63. endef
  64. define Package/erlang-compiler/description
  65. $(call Package/erlang/Default/description)
  66. .
  67. This Erlang/OTP package provides a byte code compiler for Erlang which
  68. produces highly compact code.
  69. endef
  70. define Package/erlang-crypto
  71. $(call Package/erlang/Default)
  72. TITLE:=Cryptography support
  73. VERSION:=3.4
  74. DEPENDS+= +erlang +libopenssl
  75. endef
  76. define Package/erlang-crypto/description
  77. $(call Package/erlang/Default/description)
  78. .
  79. This Erlang/OTP package provides functions for computation of message
  80. digests, and encryption and decryption functions.
  81. endef
  82. define Package/erlang-hipe
  83. $(call Package/erlang/Default)
  84. TITLE:=High Performance Erlang
  85. VERSION:=3.11
  86. DEPENDS+= +erlang
  87. endef
  88. define Package/erlang-hipe/description
  89. $(call Package/erlang/Default/description)
  90. .
  91. This Erlang/OTP package provides HiPE (High Performance Erlang)
  92. support.
  93. endef
  94. define Package/erlang-inets
  95. $(call Package/erlang/Default)
  96. TITLE:=Internet clients and servers
  97. VERSION:=5.10.2
  98. DEPENDS+= +erlang
  99. endef
  100. define Package/erlang-inets/description
  101. $(call Package/erlang/Default/description)
  102. .
  103. This Erlang/OTP package provides a container for Internet clients and
  104. servers. Currently a FTP client, a HTTP client and server, and a tftp
  105. client and server have been incorporated in Inets.
  106. endef
  107. define Package/erlang-mnesia
  108. $(call Package/erlang/Default)
  109. TITLE:=Distributed database
  110. VERSION:=4.12.1
  111. DEPENDS+= +erlang
  112. endef
  113. define Package/erlang-mnesia/description
  114. $(call Package/erlang/Default/description)
  115. .
  116. This Erlang/OTP package provides a distributed DataBase Management
  117. System (DBMS), appropriate for telecommunications applications and
  118. other Erlang applications which require continuous operation and
  119. exhibit soft real-time properties.
  120. endef
  121. define Package/erlang-runtime-tools
  122. $(call Package/erlang/Default)
  123. TITLE:=Low-profile debugging/tracing tools
  124. VERSION:=1.8.14
  125. DEPENDS+= +erlang
  126. endef
  127. define Package/erlang-runtime-tools/description
  128. $(call Package/erlang/Default/description)
  129. .
  130. This Erlang/OTP package provides low footprint tracing/debugging tools
  131. suitable for inclusion in a production system.
  132. endef
  133. define Package/erlang-snmp
  134. $(call Package/erlang/Default)
  135. TITLE:=Simple Network Management Protocol (SNMP) support
  136. VERSION:=4.25.1
  137. DEPENDS+= +erlang +erlang-asn1
  138. endef
  139. define Package/erlang-snmp/description
  140. $(call Package/erlang/Default/description)
  141. .
  142. This Erlang/OTP package provides Simple Network Management Protocol
  143. (SNMP) support including a MIB compiler and tools for creating SNMP
  144. agents.
  145. endef
  146. define Package/erlang-ssh
  147. $(call Package/erlang/Default)
  148. TITLE:=Secure Shell (SSH) support
  149. VERSION:=3.0.3
  150. DEPENDS+= +erlang +erlang-crypto
  151. endef
  152. define Package/erlang-ssh/description
  153. $(call Package/erlang/Default/description)
  154. .
  155. This Erlang/OTP package provides an implementation of the Secure Shell
  156. protocol, with SSH & SFTP support.
  157. endef
  158. define Package/erlang-ssl
  159. $(call Package/erlang/Default)
  160. TITLE:=Secure Sockets Layer (SSL) support
  161. VERSION:=5.3.5
  162. DEPENDS+= +erlang +erlang-crypto
  163. endef
  164. define Package/erlang-ssl/description
  165. $(call Package/erlang/Default/description)
  166. .
  167. This Erlang/OTP package provides support for secure communication over
  168. sockets.
  169. endef
  170. define Package/erlang-syntax-tools
  171. $(call Package/erlang/Default)
  172. TITLE:=Abstract Erlang syntax trees handling support
  173. VERSION:=1.6.15
  174. DEPENDS+= +erlang
  175. endef
  176. define Package/erlang-syntax-tools/description
  177. $(call Package/erlang/Default/description)
  178. .
  179. This Erlang/OTP package provides support for handling abstract Erlang
  180. syntax trees.
  181. endef
  182. # Host
  183. HOST_CONFIGURE_ARGS += \
  184. --disable-hipe \
  185. --disable-smp-support \
  186. --without-javac
  187. define Host/Compile
  188. $(MAKE) -C $(HOST_BUILD_DIR) all
  189. endef
  190. define Host/Install
  191. $(MAKE) -C $(HOST_BUILD_DIR) install
  192. endef
  193. # Target
  194. CONFIGURE_ARGS += \
  195. --disable-hipe \
  196. --disable-smp-support \
  197. --without-javac \
  198. --enable-dynamic-ssl-lib
  199. CONFIGURE_VARS += \
  200. SHLIB_LD="$(TARGET_CC)" \
  201. TARGET_ARCH="$(TARGET_ARCH)" \
  202. ac_cv_func_mmap_fixed_mapped=yes \
  203. ac_cv_path_WX_CONFIG_PATH=no \
  204. erl_xcomp_getaddrinfo=no \
  205. erl_xcomp_sysroot="$(STAGING_DIR)"
  206. EXTRA_LDFLAGS+=-lz
  207. define Build/Compile
  208. $(MAKE) -C $(PKG_BUILD_DIR) \
  209. noboot
  210. $(MAKE) -C $(PKG_BUILD_DIR) \
  211. INSTALL_PREFIX="$(PKG_INSTALL_DIR)" \
  212. install
  213. endef
  214. define Package/erlang/install
  215. $(INSTALL_DIR) $(1)/usr/bin
  216. for f in epmd erl erlc escript run_erl; do \
  217. $(CP) $(PKG_INSTALL_DIR)/usr/bin/$$$$f $(1)/usr/bin/ ; \
  218. done
  219. $(INSTALL_DIR) $(1)/usr/lib/erlang/bin
  220. for f in erl erlc escript run_erl start start.boot start.script start_clean.boot start_erl start_sasl.boot to_erl; do \
  221. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/bin/$$$$f $(1)/usr/lib/erlang/bin/ ; \
  222. done
  223. $(INSTALL_DIR) $(1)/usr/lib/erlang/lib
  224. for m in erts kernel sasl stdlib; do \
  225. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$m-* $(1)/usr/lib/erlang/lib/ ; \
  226. rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/examples ; \
  227. rm -rf $(1)/usr/lib/erlang/lib/$$$$m-*/src ; \
  228. done
  229. $(INSTALL_DIR) $(1)/usr/lib/erlang
  230. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/erts-* $(1)/usr/lib/erlang/
  231. rm -rf $(1)/usr/lib/erlang/erts-*/{doc,include,lib,man,src}
  232. rm -rf $(1)/usr/lib/erlang/erts-*/bin/*.src
  233. $(INSTALL_DIR) $(1)/usr/lib/erlang/releases
  234. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/releases/* $(1)/usr/lib/erlang/releases/
  235. $(SED) 's,%ERL_ROOT%,/usr/lib/erlang,g' \
  236. $(1)/usr/lib/erlang/releases/RELEASES.src
  237. mv -f $(1)/usr/lib/erlang/releases/RELEASES.src \
  238. $(1)/usr/lib/erlang/releases/RELEASES
  239. for f in bin/erl bin/start erts-*/bin/erl erts-*/bin/start; do \
  240. $(SED) 's,^\(ROOTDIR\)=.*,\1=/usr/lib/erlang,g' \
  241. $(1)/usr/lib/erlang/$$$$f ; \
  242. done
  243. endef
  244. define Build/InstallDev
  245. $(INSTALL_DIR) $(1)/usr/lib
  246. $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/obj/*/*.a $(1)/usr/lib
  247. $(INSTALL_DIR) $(1)/usr/include
  248. $(CP) $(PKG_BUILD_DIR)/lib/erl_interface/include/*.h $(1)/usr/include
  249. endef
  250. define BuildModule
  251. define Package/erlang-$(1)/install
  252. $(INSTALL_DIR) $$(1)/usr/lib/erlang/lib
  253. for m in $(2); do \
  254. $(CP) $(PKG_INSTALL_DIR)/usr/lib/erlang/lib/$$$$$$$$m-* $$(1)/usr/lib/erlang/lib/ ; \
  255. rm -rf $$(1)/usr/lib/erlang/lib/$$$$$$$$m-*/{examples,priv/obj,src} ; \
  256. done
  257. endef
  258. $$(eval $$(call BuildPackage,erlang-$(1)))
  259. endef
  260. $(eval $(call HostBuild))
  261. $(eval $(call BuildPackage,erlang))
  262. $(eval $(call BuildModule,asn1,asn1))
  263. $(eval $(call BuildModule,compiler,compiler))
  264. $(eval $(call BuildModule,crypto,crypto))
  265. $(eval $(call BuildModule,hipe,hipe))
  266. $(eval $(call BuildModule,inets,inets))
  267. $(eval $(call BuildModule,mnesia,mnesia))
  268. $(eval $(call BuildModule,runtime-tools,runtime_tools))
  269. $(eval $(call BuildModule,snmp,snmp))
  270. $(eval $(call BuildModule,ssh,ssh))
  271. $(eval $(call BuildModule,ssl,ssl))
  272. $(eval $(call BuildModule,syntax-tools,syntax_tools))