erlang: bump to version 18.3
[buildroot-gz.git] / package / erlang / erlang.mk
blobff4452f68d61d75e636bcfad2da5c8a03a82ce4a
1 ################################################################################
3 # erlang
5 ################################################################################
7 # See note below when updating Erlang
8 ERLANG_VERSION = 18.3
9 ERLANG_SITE = http://www.erlang.org/download
10 ERLANG_SOURCE = otp_src_$(ERLANG_VERSION).tar.gz
11 ERLANG_DEPENDENCIES = host-erlang
13 ERLANG_LICENSE = Apache-2.0
14 ERLANG_LICENSE_FILES = LICENSE.txt
15 ERLANG_INSTALL_STAGING = YES
17 # Patched erts/aclocal.m4
18 ERLANG_AUTORECONF = YES
20 # Whenever updating Erlang, this value should be updated as well, to the
21 # value of EI_VSN in the file lib/erl_interface/vsn.mk
22 ERLANG_EI_VSN = 3.8.2
24 # The configure checks for these functions fail incorrectly
25 ERLANG_CONF_ENV = ac_cv_func_isnan=yes ac_cv_func_isinf=yes
27 # Set erl_xcomp variables. See xcomp/erl-xcomp.conf.template
28 # for documentation.
29 ERLANG_CONF_ENV += erl_xcomp_sysroot=$(STAGING_DIR)
31 ERLANG_CONF_OPTS = --without-javac
33 ERLANG_DEPENDENCIES += libatomic_ops
34 ERLANG_CONF_OPTS += --with-libatomic_ops=$(STAGING_DIR)/usr LIBS=-latomic_ops
36 # erlang uses openssl for all things crypto. Since the host tools (such as
37 # rebar) uses crypto, we need to build host-erlang with support for openssl.
38 HOST_ERLANG_DEPENDENCIES = host-openssl
39 HOST_ERLANG_CONF_OPTS = --without-javac --with-ssl=$(HOST_DIR)/usr
41 HOST_ERLANG_CONF_OPTS += --without-termcap
43 ifeq ($(BR2_TOOLCHAIN_HAS_THREADS),)
44 ERLANG_CONF_OPTS += --disable-threads
45 endif
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
54 ifeq ($(BR2_PACKAGE_OPENSSL),y)
55 ERLANG_CONF_OPTS += --with-ssl
56 ERLANG_DEPENDENCIES += openssl
57 else
58 ERLANG_CONF_OPTS += --without-ssl
59 endif
61 ifeq ($(BR2_PACKAGE_ZLIB),y)
62 ERLANG_CONF_OPTS += --enable-shared-zlib
63 ERLANG_DEPENDENCIES += zlib
64 endif
66 ifeq ($(BR2_PACKAGE_ERLANG_SMP),)
67 ERLANG_CONF_OPTS += --disable-smp-support
68 endif
70 # Remove source, example, gs and wx files from staging and target.
71 ERLANG_REMOVE_PACKAGES = gs wx
73 ifneq ($(BR2_PACKAGE_ERLANG_MEGACO),y)
74 ERLANG_REMOVE_PACKAGES += megaco
75 endif
77 define ERLANG_REMOVE_STAGING_UNUSED
78 for package in $(ERLANG_REMOVE_PACKAGES); do \
79 rm -rf $(STAGING_DIR)/usr/lib/erlang/lib/$${package}-*; \
80 done
81 endef
83 define ERLANG_REMOVE_TARGET_UNUSED
84 find $(TARGET_DIR)/usr/lib/erlang -type d -name src -prune -exec rm -rf {} \;
85 find $(TARGET_DIR)/usr/lib/erlang -type d -name examples -prune -exec rm -rf {} \;
86 for package in $(ERLANG_REMOVE_PACKAGES); do \
87 rm -rf $(TARGET_DIR)/usr/lib/erlang/lib/$${package}-*; \
88 done
89 endef
91 ERLANG_POST_INSTALL_STAGING_HOOKS += ERLANG_REMOVE_STAGING_UNUSED
92 ERLANG_POST_INSTALL_TARGET_HOOKS += ERLANG_REMOVE_TARGET_UNUSED
94 $(eval $(autotools-package))
95 $(eval $(host-autotools-package))