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