Carsten Grzemba
2023-10-07 b4f9b7f0b8c10390eebeaed998fa4deef0f665ff
commit | author | age
236357 1 #
G 2 # CDDL HEADER START
3 #
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.
7 #
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.
12 #
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]
18 #
19 # CDDL HEADER END
20 #
21
22 #
23 # Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
b6be1c 24 # Copyright 2021 Andreas Grueninger, Grueninger GmbH, (grueni). All rights reserved.
b4f9b7 25 # Copyright 2023 Carsten Grzemba
236357 26 #
G 27 # Built in SFW with gcc and builds cleanly now only with gcc
28
b6be1c 29 BUILD_BITS= 64
236357 30 include ../../../make-rules/shared-macros.mk
G 31
32 PATH=$(JAVA_HOME)/bin:$(USRBINDIR)
33
34 COMPONENT_FMRI=           runtime/erlang
b6be1c 35 COMPONENT_NAME=     erlang
b4f9b7 36 COMPONENT_VERSION=    24.2.2
b6be1c 37 COMPONENT_PROJECT_URL=  http://www.erlang.org/
G 38 COMPONENT_SRC_NAME= otp_src
39 COMPONENT_SRC=    $(COMPONENT_SRC_NAME)_$(COMPONENT_VERSION)
40 COMPONENT_ARCHIVE= OTP-${COMPONENT_VERSION}.tar.gz
41 COMPONENT_ARCHIVE_HASH= \
b4f9b7 42     sha256:b6adfc0bf14d94348146ae26cc38d09dca545f8e14ebab7ddcf9482a6e8d1162
b6be1c 43 COMPONENT_ARCHIVE_URL=  https://github.com/erlang/otp/archive/${COMPONENT_ARCHIVE}
G 44 COMPONENT_POST_UNPACK_ACTION= ( $(MV) otp-OTP-$(COMPONENT_VERSION) $(COMPONENT_SRC))
b4f9b7 45 COMPONENT_PREP_ACTION = (cd $(@D); ./otp_build update_configure --no-commit)
b6be1c 46 COMPONENT_VERSION_SHORT= $(shell echo $(COMPONENT_VERSION) | cut -d'.' -f1-2)
236357 47 COMPONENT_CLASSIFICATION= Development/Other Languages
G 48 COMPONENT_LICENSE=        Apache-2.0
49 COMPONENT_LICENSE_FILE=   LICENSE.txt
50 COMPONENT_SUMMARY= Erlang/OTP
51 COMPONENT_DESCRIPTION= Erlang programming language and OTP libraries
52
53 # manpages
b6be1c 54 COMPONENT_NAME_1= otp_doc_man
G 55 COMPONENT_SRC_1=  $(COMPONENT_NAME_1)_$(COMPONENT_VERSION_SHORT)
56 COMPONENT_ARCHIVE_1=  $(COMPONENT_SRC_1).tar.gz
57 COMPONENT_ARCHIVE_HASH_1= \
b4f9b7 58     sha256:56ae4b13fc7c003f4dd9951a9ff2a0bae0b38473df2c078d79c8553c277c5f4c
b6be1c 59 COMPONENT_ARCHIVE_URL_1=  $(COMPONENT_PROJECT_URL)download/$(COMPONENT_ARCHIVE_1)
G 60 UNPACK_ARGS_1=  -r $(COMPONENT_SRC_1)
61 PKG_PROTO_DIRS += $(COMPONENT_SRC_1)
236357 62
G 63 # HTML documentation
b6be1c 64 COMPONENT_NAME_2= otp_doc_html
G 65 COMPONENT_SRC_2=  $(COMPONENT_NAME_2)_$(COMPONENT_VERSION_SHORT)
66 COMPONENT_ARCHIVE_2=  $(COMPONENT_SRC_2).tar.gz
67 COMPONENT_ARCHIVE_HASH_2= \
b4f9b7 68     sha256:f479cbc8a28532fd6a0a55fc26684b4e79312da4f86ee0735d0757f936672bbc
b6be1c 69 COMPONENT_ARCHIVE_URL_2=  $(COMPONENT_PROJECT_URL)download/$(COMPONENT_ARCHIVE_2)
G 70 UNPACK_ARGS_2=  -r $(COMPONENT_SRC_2)
71 PKG_PROTO_DIRS += $(COMPONENT_SRC_2)
236357 72
b6be1c 73 include $(WS_MAKE_RULES)/common.mk
236357 74
G 75 SYSTEM_TEST_TARGET= configure $(SYSTEM_TEST_64)
76
b4f9b7 77 CFLAGS += -DOPENSSL_NO_MD4 -DOPENSSL_NO_RC2 -DOPENSSL_NO_RC4
236357 78
G 79 # Fix 64-bit linking.
80 LDFLAGS += $(CC_BITS)
81
82 CXXFLAGS += -std=c++11
83
84 CONFIGURE_OPTIONS.64 += --with-wx-config=/usr/bin/$(MACH64)/wx-config
85 CONFIGURE_OPTIONS += CPPFLAGS="$(CPPFLAGS) -I/usr/include/gd2"
86 CONFIGURE_OPTIONS += --enable-smp-support
87 CONFIGURE_OPTIONS += --enable-threads
b4f9b7 88 CONFIGURE_OPTIONS += --with-ssl=$(OPENSSL_PREFIX)
b6be1c 89 CONFIGURE_OPTIONS += --enable-fips
G 90 CONFIGURE_OPTIONS += --enable-dynamic-ssl-lib
91
236357 92 # The HiPE portion is a bit sensitive, and only seems to work 64-bit on
G 93 # amd64 (thus the variant.arch tagging in erlang.p5m). erts/config.log
94 # can be very interesting if issues occur.
b6be1c 95 CONFIGURE_OPTIONS.i386  = --enable-hipe
G 96 CONFIGURE_OPTIONS.sparc = --disable-hipe
97 # Disable kernel poll on sparc to avoid hangs in erl_child_setup (bug 31443512).
98 CONFIGURE_OPTIONS.sparc += --disable-kernel-poll
b4f9b7 99 CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.$(MACH))
236357 100
G 101 # Erlang doesn't appear to like ASLR: it uses mmap() with MAP_FIXED, and
102 # makes assumptions about memory layout that aren't true on Solaris x86,
103 # leading to segmentation faults in erlc.
104 ASLR_MODE =    $(ASLR_DISABLE)
105
106 # Use cp(1) instead of cloney because erlang's 'install' target uses 'tar'
107 # to copy files and our tar doesn't handle long links by default.  Between
108 # the use of 'tar' and 'ld', a path adjustment wasn't an option due to the
109 # need for /usr/bin/ld and /usr/gnu/bin/tar.  This is still the case with
110 # erlang version 17.5.
111 COMPONENT_PRE_CONFIGURE_ACTION = \
112     ($(CP) -rp $(SOURCE_DIR)/. $(@D))
b4f9b7 113
236357 114 CONFIGURE_SCRIPT =        $(@D)/configure
G 115
116 # We need to re-run the nested configure script for the wx sub-component so
117 # that it will properly detect wxWidgets support by adding -std=c++11 to $(CXX)
118 # (workaround for the configure script ignoring CXXFLAGS) and with ERL_TOP set
119 # so that the wx component knows we're building inside the erlang source tree.
120 COMPONENT_POST_CONFIGURE_ACTION = \
121     (cd $(@D)/lib/wx; $(ENV) $(CONFIGURE_ENV) \
122         CXX="$(CXX) -std=c++11" \
123         ERL_TOP="$(@D)" \
124         $(CONFIG_SHELL) \
125         ./configure $(CONFIGURE_OPTIONS))
126
127 # Always show the build and link lines for easier debugging.
128 COMPONENT_BUILD_ARGS +=    V=1
129
7a78f9 130 # fix build on jenkins
AP 131 COMPONENT_BUILD_ENV += HOME=/tmp
132 COMPONENT_INSTALL_ENV += HOME=/tmp
133 COMPONENT_TEST_ENV += HOME=/tmp
134
236357 135 COMPONENT_INSTALL_ARGS += INSTALL_PREFIX=$(PROTO_DIR)
G 136
137 COMPONENT_TEST_ENV +=        ERL_TOP=$(BUILD_DIR_64)
138 COMPONENT_TEST_TARGETS =    tests
139
140 COMPONENT_SYSTEM_TEST_ENV +=    ERL_TOP=$(BUILD_DIR_64)
141 COMPONENT_SYSTEM_TEST_TARGETS =    tests
142
143 COMPONENT_TEST_TRANSFORMS += \
144     '-e "/^gmake.*release_tests_spec/d" '
145
146 # remove INSTALL_PREFIX from path
147 COMPONENT_POST_INSTALL_ACTION += \
148     $(PERL) -pi -e "s|$(PROTO_DIR)||g" \
149         $(PROTOUSRLIBDIR64)/erlang/bin/erl \
150         $(PROTOUSRLIBDIR64)/erlang/releases/RELEASES
151
152 # common targets
153 build:    $(BUILD_64)
154
155 install:  $(INSTALL_64)
156
157 test:     $(TEST_64)
158
b6be1c 159 # manually added
G 160 REQUIRED_PACKAGES += runtime/java/openjdk8
161
483212 162 # Auto-generated dependencies
b6be1c 163 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
G 164 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
b4f9b7 165 REQUIRED_PACKAGES += SUNWcs
236357 166 REQUIRED_PACKAGES += library/ncurses
b4f9b7 167 REQUIRED_PACKAGES += library/security/openssl-31
236357 168 REQUIRED_PACKAGES += library/zlib
b6be1c 169 REQUIRED_PACKAGES += shell/ksh93
236357 170 REQUIRED_PACKAGES += system/library
G 171 REQUIRED_PACKAGES += system/library/math