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.

339 lines
8.6 KiB

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