python/cmd2: update to 2.5.6
[oi-userland.git] / components / runtime / erlang / Makefile
blob70f276fe4fd97b83d8ce10d7dd9a7f3d268c724f
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
23 # Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2021 Andreas Grueninger, Grueninger GmbH, (grueni). All rights reserved.
25 # Copyright 2023 Carsten Grzemba
26 # Copyright 2024 Goetz Fischer, R-A-C. All rights reserved.
29 USE_PARALLEL_BUILD= yes
30 include ../../../make-rules/shared-macros.mk
32 COMPONENT_NAME= erlang
33 COMPONENT_VERSION= 27.1.2
34 COMPONENT_VERSION_SHORT= $(shell echo $(COMPONENT_VERSION) | cut -d'.' -f1-2)
35 COMPONENT_SUMMARY= Erlang programming language and OTP libraries
36 COMPONENT_PROJECT_URL= https://erlang.org/
37 COMPONENT_SRC_NAME= otp_src
38 COMPONENT_SRC= $(COMPONENT_SRC_NAME)_$(COMPONENT_VERSION)
39 COMPONENT_ARCHIVE= ${COMPONENT_SRC}.tar.gz
40 COMPONENT_ARCHIVE_HASH= sha256:1772e9fa07b2b020ed5911d6ce78b251dfb6ed8509ed7de9d372e96b87251d14
41 COMPONENT_ARCHIVE_URL= https://github.com/erlang/otp/releases/download/OTP-${COMPONENT_VERSION}/${COMPONENT_ARCHIVE}
42 COMPONENT_FMRI= runtime/erlang
43 COMPONENT_CLASSIFICATION= Development/Other Languages
44 COMPONENT_LICENSE= Apache-2.0
45 COMPONENT_LICENSE_FILE= LICENSE.txt
47 # manpages
48 COMPONENT_NAME_1= otp_doc_man
49 COMPONENT_SRC_1= $(COMPONENT_NAME_1)_$(COMPONENT_VERSION)
50 COMPONENT_ARCHIVE_1= $(COMPONENT_SRC_1).tar.gz
51 COMPONENT_ARCHIVE_HASH_1= sha256:76f01e6833d841e614929a2b7426b0b08b32daae985ee3e81f2dedb17d367048
52 COMPONENT_ARCHIVE_URL_1= https://github.com/erlang/otp/releases/download/OTP-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_1)
53 UNPACK_ARGS_1= -r $(COMPONENT_SRC_1)
55 include $(WS_MAKE_RULES)/common.mk
57 COMPONENT_POST_UNPACK_ACTION= ( $(RM) -r $(COMPONENT_SRC)/lib/wx )
59 # Fix 64-bit linking.
60 LDFLAGS += $(CC_BITS)
62 # testing these with gcc 13. can safely be omitted in doubt.
63 CFLAGS += -finline-functions -funroll-loops
64 CXXFLAGS += -finline-functions -funroll-loops -fno-exceptions -fno-rtti
66 CONFIGURE_OPTIONS += --enable-smp-support
67 CONFIGURE_OPTIONS += --enable-threads
68 CONFIGURE_OPTIONS += --with-ssl=$(OPENSSL_PREFIX)
69 CONFIGURE_OPTIONS += --with-ssl-lib-subdir=/amd64
70 CONFIGURE_OPTIONS += --enable-dynamic-ssl-lib
71 CONFIGURE_OPTIONS += --disable-silent-rules
72 CONFIGURE_OPTIONS += --without-javac
74 # The HiPE portion is a bit sensitive, and only seems to work 64-bit on
75 # amd64 (thus the variant.arch tagging in erlang.p5m). erts/config.log
76 # can be very interesting if issues occur.
77 CONFIGURE_OPTIONS.i386 = --enable-hipe
78 CONFIGURE_OPTIONS.sparc = --disable-hipe
79 # Disable kernel poll on sparc to avoid hangs in erl_child_setup (bug 31443512).
80 CONFIGURE_OPTIONS.sparc += --disable-kernel-poll
81 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
83 # Erlang doesn't appear to like ASLR: it uses mmap() with MAP_FIXED, and
84 # makes assumptions about memory layout that aren't true on Solaris x86,
85 # leading to segmentation faults in erlc.
86 ASLR_MODE = $(ASLR_DISABLE)
88 COMPONENT_PRE_CONFIGURE_ACTION= ( CLONEY_MODE=copy $(CLONEY) $(SOURCE_DIR)/. $(@D) )
90 CONFIGURE_SCRIPT = $(@D)/configure
92 # fix build on jenkins
93 COMPONENT_BUILD_ENV += HOME=/tmp
94 COMPONENT_INSTALL_ENV += HOME=/tmp
95 COMPONENT_INSTALL_ARGS += INSTALL_PREFIX=$(PROTO_DIR)
96 COMPONENT_TEST_ENV += HOME=/tmp
97 COMPONENT_TEST_ENV += ERL_TOP=$(BUILD_DIR_64)
98 # Run Erlang release tests; it takes many hours...
99 COMPONENT_TEST_DIR = $(COMPONENT_DIR)
100 COMPONENT_TEST_CMD = $(SHELL)
101 COMPONENT_TEST_TARGETS = run_erlang_tests.sh $(BUILD_DIR_64)
102 COMPONENT_TEST_TRANSFORMS += '-e "/^gmake.*release_tests_spec/d" '
103 COMPONENT_TEST_TRANSFORMS += '-e "/^run_erlang_tests.sh/d" '
105 # remove INSTALL_PREFIX from path
106 COMPONENT_POST_INSTALL_ACTION += \
107 $(PERL) -pi -e "s|$(PROTO_DIR)||g" \
108 $(PROTOUSRLIBDIR64)/erlang/bin/erl \
109 $(PROTOUSRLIBDIR64)/erlang/releases/RELEASES ;
110 COMPONENT_POST_INSTALL_ACTION += ( $(MKDIR) $(PROTO_DIR)/usr/share ) ;
111 COMPONENT_POST_INSTALL_ACTION += ( $(MV) $(COMPONENT_SRC_1)/man $(PROTO_DIR)/usr/share/ )
113 # common targets
114 build: $(BUILD_64)
115 install: $(INSTALL_64)
116 test: $(TEST_64)
118 # Auto-generated dependencies
119 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
120 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
121 REQUIRED_PACKAGES += $(OPENSSL_PKG)
122 REQUIRED_PACKAGES += SUNWcs
123 REQUIRED_PACKAGES += library/ncurses
124 REQUIRED_PACKAGES += library/zlib
125 REQUIRED_PACKAGES += shell/ksh93
126 REQUIRED_PACKAGES += system/library
127 REQUIRED_PACKAGES += system/library/math