2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2012-08-24 23:39:26 +02:00
|
|
|
#
|
|
|
|
# erlang
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2012-08-24 23:39:26 +02:00
|
|
|
|
2015-01-12 10:32:05 +01:00
|
|
|
# See note below when updating Erlang
|
2021-11-05 17:45:09 +01:00
|
|
|
ERLANG_VERSION = 22.3.4.22
|
|
|
|
ERLANG_SITE = \
|
|
|
|
https://github.com/erlang/otp/releases/download/OTP-$(ERLANG_VERSION)
|
2012-08-24 23:39:26 +02:00
|
|
|
ERLANG_SOURCE = otp_src_$(ERLANG_VERSION).tar.gz
|
|
|
|
ERLANG_DEPENDENCIES = host-erlang
|
|
|
|
|
2016-02-02 20:57:27 +01:00
|
|
|
ERLANG_LICENSE = Apache-2.0
|
|
|
|
ERLANG_LICENSE_FILES = LICENSE.txt
|
2021-03-05 10:49:57 +01:00
|
|
|
ERLANG_CPE_ID_VENDOR = erlang
|
|
|
|
ERLANG_CPE_ID_PRODUCT = erlang\/otp
|
2013-08-09 03:37:24 +02:00
|
|
|
ERLANG_INSTALL_STAGING = YES
|
2012-08-24 23:39:26 +02:00
|
|
|
|
2021-09-18 18:59:46 +02:00
|
|
|
# windows specific issue: https://nvd.nist.gov/vuln/detail/CVE-2021-29221
|
|
|
|
ERLANG_IGNORE_CVES += CVE-2021-29221
|
|
|
|
|
2020-02-10 17:58:24 +01:00
|
|
|
# Remove the leftover deps directory from the ssl app
|
|
|
|
# See https://bugs.erlang.org/browse/ERL-1168
|
|
|
|
define ERLANG_REMOVE_SSL_DEPS
|
|
|
|
rm -rf $(@D)/lib/ssl/src/deps
|
|
|
|
endef
|
|
|
|
ERLANG_POST_PATCH_HOOKS += ERLANG_REMOVE_SSL_DEPS
|
|
|
|
|
2016-02-02 20:57:27 +01:00
|
|
|
# Patched erts/aclocal.m4
|
2020-02-04 11:07:31 +01:00
|
|
|
define ERLANG_RUN_AUTOCONF
|
|
|
|
cd $(@D) && PATH=$(BR_PATH) ./otp_build autoconf
|
|
|
|
endef
|
|
|
|
ERLANG_DEPENDENCIES += host-autoconf
|
|
|
|
ERLANG_PRE_CONFIGURE_HOOKS += ERLANG_RUN_AUTOCONF
|
|
|
|
HOST_ERLANG_DEPENDENCIES += host-autoconf
|
|
|
|
HOST_ERLANG_PRE_CONFIGURE_HOOKS += ERLANG_RUN_AUTOCONF
|
package/erlang: fix detection of libatomic_ops
For some platforms, hardware-assisted compare-and-swap may not be
available, so libatomic_ops will not provide it.
However, libatomic_ops can provide a purely software CAS emulation, but
must be instructed to do so. erlang just forgot to tell libatomic_ops
that it does require CAS.
Fix that by defining AO_REQUIRE_CAS before including atmoic_ops.h, like
is done in libunwind, as pointed out by Thomas.
Also, erlang has a convoluted, mind-alterating set on aclocal.m4 macros,
that just forgets to link against -latomic_ops when checking CAS is
available, so that even if CAS is available, configure chokes.
Since I would like to keep the little sanity I still have, just force
linking with -latomic_ops. This is useless when the check is natrally
sucessful (i.e. on platforms where CAS is available in HW), but we
would eventually link with -latomic_ops there, too; it's just redundant.
Overall, just consider that erlang requires libatomic_ops, so forcibly
depend on it, it is easier than trying to disable it. We can revisit
that whenever someone wants to run erlang on a platform for which there
is no libatomic_ops support.
Fixes a slew of autobuild ARM failures:
http://autobuild.buildroot.org/results/e7b/e7bfc4893dea6b133f0794ef44d50ad89bcb6662/
http://autobuild.buildroot.org/results/3e9/3e9c307f1ec6536482641019dcaa94677f7267a3/
http://autobuild.buildroot.org/results/a85/a85ca414e5b67af46510abd7b610eb5ae8661de4/
[...]
[Thomas: fix minor typos in commit log, add dependency on
BR2_PACKAGE_LIBATOMIC_ARCH_SUPPORTS to the Erlang comment about thread
and shared library dependency.]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Frank Hunleth <fhunleth@troodon-software.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-01-04 15:17:14 +01:00
|
|
|
|
2015-01-12 10:32:05 +01:00
|
|
|
# Whenever updating Erlang, this value should be updated as well, to the
|
|
|
|
# value of EI_VSN in the file lib/erl_interface/vsn.mk
|
2021-11-05 17:45:09 +01:00
|
|
|
ERLANG_EI_VSN = 3.13.2.2
|
2015-01-12 10:32:05 +01:00
|
|
|
|
2012-08-24 23:39:26 +02:00
|
|
|
# The configure checks for these functions fail incorrectly
|
|
|
|
ERLANG_CONF_ENV = ac_cv_func_isnan=yes ac_cv_func_isinf=yes
|
|
|
|
|
2013-09-13 17:46:01 +02:00
|
|
|
# Set erl_xcomp variables. See xcomp/erl-xcomp.conf.template
|
|
|
|
# for documentation.
|
|
|
|
ERLANG_CONF_ENV += erl_xcomp_sysroot=$(STAGING_DIR)
|
|
|
|
|
2014-09-27 21:32:44 +02:00
|
|
|
ERLANG_CONF_OPTS = --without-javac
|
2014-08-15 17:49:15 +02:00
|
|
|
|
2017-02-18 22:01:11 +01:00
|
|
|
# Force ERL_TOP to the downloaded source directory. This prevents
|
|
|
|
# Erlang's configure script from inadvertantly using files from
|
|
|
|
# a version of Erlang installed on the host.
|
|
|
|
ERLANG_CONF_ENV += ERL_TOP=$(@D)
|
|
|
|
HOST_ERLANG_CONF_ENV += ERL_TOP=$(@D)
|
|
|
|
|
2014-08-15 17:49:15 +02:00
|
|
|
# erlang uses openssl for all things crypto. Since the host tools (such as
|
|
|
|
# rebar) uses crypto, we need to build host-erlang with support for openssl.
|
2020-02-04 11:07:31 +01:00
|
|
|
HOST_ERLANG_DEPENDENCIES += host-openssl
|
2017-07-05 13:14:24 +02:00
|
|
|
HOST_ERLANG_CONF_OPTS = --without-javac --with-ssl=$(HOST_DIR)
|
2012-08-24 23:39:26 +02:00
|
|
|
|
2014-11-17 23:33:16 +01:00
|
|
|
HOST_ERLANG_CONF_OPTS += --without-termcap
|
|
|
|
|
2012-08-24 23:39:26 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_NCURSES),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
ERLANG_CONF_OPTS += --with-termcap
|
2012-08-24 23:39:26 +02:00
|
|
|
ERLANG_DEPENDENCIES += ncurses
|
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
ERLANG_CONF_OPTS += --without-termcap
|
2012-08-24 23:39:26 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
2014-09-27 21:32:44 +02:00
|
|
|
ERLANG_CONF_OPTS += --with-ssl
|
2012-08-24 23:39:26 +02:00
|
|
|
ERLANG_DEPENDENCIES += openssl
|
|
|
|
else
|
2014-09-27 21:32:44 +02:00
|
|
|
ERLANG_CONF_OPTS += --without-ssl
|
2012-08-24 23:39:26 +02:00
|
|
|
endif
|
|
|
|
|
2018-07-21 11:13:38 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_UNIXODBC),y)
|
2016-10-23 17:34:03 +02:00
|
|
|
ERLANG_DEPENDENCIES += unixodbc
|
2016-12-04 22:44:56 +01:00
|
|
|
ERLANG_CONF_OPTS += --with-odbc
|
|
|
|
else
|
|
|
|
ERLANG_CONF_OPTS += --without-odbc
|
2016-10-23 17:34:03 +02:00
|
|
|
endif
|
|
|
|
|
2018-10-12 16:11:49 +02:00
|
|
|
# Always use Buildroot's zlib
|
2020-02-04 11:07:31 +01:00
|
|
|
ERLANG_CONF_OPTS += --disable-builtin-zlib
|
2012-08-24 23:39:26 +02:00
|
|
|
ERLANG_DEPENDENCIES += zlib
|
|
|
|
|
2016-02-25 15:56:35 +01:00
|
|
|
# Remove source, example, gs and wx files from staging and target.
|
2012-08-24 23:39:26 +02:00
|
|
|
ERLANG_REMOVE_PACKAGES = gs wx
|
|
|
|
|
|
|
|
ifneq ($(BR2_PACKAGE_ERLANG_MEGACO),y)
|
|
|
|
ERLANG_REMOVE_PACKAGES += megaco
|
|
|
|
endif
|
|
|
|
|
2016-02-25 15:56:35 +01:00
|
|
|
define ERLANG_REMOVE_STAGING_UNUSED
|
|
|
|
for package in $(ERLANG_REMOVE_PACKAGES); do \
|
|
|
|
rm -rf $(STAGING_DIR)/usr/lib/erlang/lib/$${package}-*; \
|
|
|
|
done
|
|
|
|
endef
|
|
|
|
|
|
|
|
define ERLANG_REMOVE_TARGET_UNUSED
|
2012-08-24 23:39:26 +02:00
|
|
|
find $(TARGET_DIR)/usr/lib/erlang -type d -name src -prune -exec rm -rf {} \;
|
|
|
|
find $(TARGET_DIR)/usr/lib/erlang -type d -name examples -prune -exec rm -rf {} \;
|
|
|
|
for package in $(ERLANG_REMOVE_PACKAGES); do \
|
|
|
|
rm -rf $(TARGET_DIR)/usr/lib/erlang/lib/$${package}-*; \
|
|
|
|
done
|
|
|
|
endef
|
|
|
|
|
2016-02-25 15:56:35 +01:00
|
|
|
ERLANG_POST_INSTALL_STAGING_HOOKS += ERLANG_REMOVE_STAGING_UNUSED
|
|
|
|
ERLANG_POST_INSTALL_TARGET_HOOKS += ERLANG_REMOVE_TARGET_UNUSED
|
2012-08-24 23:39:26 +02:00
|
|
|
|
|
|
|
$(eval $(autotools-package))
|
|
|
|
$(eval $(host-autotools-package))
|