xca: fix project url; rebuild for openssl-3
[oi-userland.git] / components / developer / clang-18 / Makefile
blob325f7bd3dfa7401d6d49f81da3dde43cfd8f8bdd
2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
5 # 1.0 of the CDDL.
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2016 Aurelien Larcher. All rights reserved.
14 # Copyright 2019 Alexander Pyhalov
15 # Copyright 2019 Michal Nowak
16 # Copyright 2019 Till Wegmüller
17 # Copyright 2022 Klaus Ziegler
18 # Copyright 2024 Friedrich Kink
21 BUILD_STYLE= cmake
22 USE_PARALLEL_BUILD= yes
23 include ../../../make-rules/shared-macros.mk
25 COMPONENT_NAME= clang
26 COMPONENT_VERSION= 18.1.8
27 COMPONENT_REVISION= 2
28 CLANG_VERSION= $(firstword $(subst ., ,$(COMPONENT_VERSION)))
29 COMPONENT_SUMMARY= LLVM tools and Clang compiler
30 COMPONENT_PROJECT_URL= https://llvm.org/
31 COMPONENT_SRC= $(LLVM_NAME)-$(COMPONENT_VERSION).src
32 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
33 COMPONENT_ARCHIVE_HASH= sha256:f68cf90f369bc7d0158ba70d860b0cb34dbc163d6ff0ebc6cfa5e515b9b2e28d
34 COMPONENT_ARCHIVE_URL= https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
35 COMPONENT_FMRI= $(CLANG_DEVELOPER_PKG)
36 COMPONENT_CLASSIFICATION= Development/C
37 COMPONENT_LICENSE= BSD
38 COMPONENT_LICENSE_FILE= LICENSE.TXT
40 COMPONENT_FMRI.clang-runtime = $(CLANG_RUNTIME_PKG)
42 LLVM_NAME= llvm
43 CLANG_NAME= clang
45 COMPONENT_ARCHIVE_1= $(CLANG_NAME)-$(COMPONENT_VERSION).src.tar.xz
46 COMPONENT_ARCHIVE_HASH_1= sha256:5724fe0a13087d5579104cedd2f8b3bc10a212fb79a0fcdac98f4880e19f4519
47 COMPONENT_ARCHIVE_URL_1=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_1)
49 COMPONENT_ARCHIVE_2= cmake-$(COMPONENT_VERSION).src.tar.xz
50 COMPONENT_ARCHIVE_HASH_2= sha256:59badef592dd34893cd319d42b323aaa990b452d05c7180ff20f23ab1b41e837
51 COMPONENT_ARCHIVE_URL_2=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_2)
53 COMPONENT_ARCHIVE_3= third-party-$(COMPONENT_VERSION).src.tar.xz
54 COMPONENT_ARCHIVE_HASH_3= sha256:b76b810f3d3dc5d08e83c4236cb6e395aa9bd5e3ea861e8c319b216d093db074
55 COMPONENT_ARCHIVE_URL_3=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_3)
57 include $(WS_MAKE_RULES)/common.mk
59 CMAKE_PREFIX = $(CLANG_PREFIX)
61 COMPONENT_POST_UNPACK_ACTION += \
62 $(UNPACK) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_1) && \
63 $(MV) $(CLANG_NAME)-$(COMPONENT_VERSION).src $(COMPONENT_SRC)/tools/clang && \
64 $(UNPACK) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_2) && \
65 $(MV) cmake-$(COMPONENT_VERSION).src/Modules $(COMPONENT_SRC)/cmake/ && \
66 $(RM) -r cmake-$(COMPONENT_VERSION).src && \
67 $(UNPACK) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_3) && \
68 $(MKDIR) $(COMPONENT_SRC)/third-party && \
69 $(MV) third-party-$(COMPONENT_VERSION).src/unittest $(COMPONENT_SRC)/third-party && \
70 $(MV) third-party-$(COMPONENT_VERSION).src/benchmark $(COMPONENT_SRC)/third-party && \
71 $(RM) -r third-party-$(COMPONENT_VERSION).src
73 COMPONENT_PRE_CONFIGURE_ACTION = ( $(CLONEY) $(SOURCE_DIR) $(@D); )
75 COMPONENT_POST_INSTALL_ACTION = \
76 for file in `echo $(PROTO_DIR)/$(CMAKE_PREFIX)/bin/*`; do \
77 /usr/bin/elfedit -e 'dyn:runpath $(GCC_LIBDIR):$(CMAKE_PREFIX)/lib' $$file ; \
78 done && \
79 for file in \
80 `ggrep -rlh '^\#!*/usr/bin/env python' $(PROTO_DIR)/$(CMAKE_PREFIX)`; do \
81 sed -i -e 's:\#!/usr/bin/env.*:\#!$(PYTHON):' $$file; \
82 done
84 CMAKE_OPTIONS += -DCMAKE_C_COMPILER=$(CC)
85 CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER=$(CXX)
86 CMAKE_OPTIONS += -DGCC_INSTALL_PREFIX=$(GCC_ROOT)
87 CMAKE_OPTIONS += -DCMAKE_CXX_LINK_FLAGS="-L$(GCC_LIBDIR) -Wl,-rpath,$(GCC_LIBDIR)"
88 CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=Release
89 CMAKE_OPTIONS += -DCLANG_DEFAULT_LINKER="/usr/bin/ld"
90 CMAKE_OPTIONS += -DLLVM_ENABLE_EH=ON
91 CMAKE_OPTIONS += -DLLVM_ENABLE_RTTI=ON
92 CMAKE_OPTIONS += -DLLVM_LINK_LLVM_DYLIB=ON
93 CMAKE_OPTIONS += -DLLVM_INCLUDE_BENCHMARKS=OFF
94 CMAKE_OPTIONS += -DLLVM_INSTALL_UTILS=ON
95 CMAKE_OPTIONS += -DCLANG_DEFAULT_RTLIB=libgcc
96 CMAKE_OPTIONS += -DCLANG_DEFAULT_CXX_STDLIB=libstdc++
97 CMAKE_OPTIONS += -DPYTHON_EXECUTABLE="$(PYTHON)"
98 CMAKE_OPTIONS += -DCMAKE_MODULE_PATH="$(SOURCE_DIR)/$(COMPONENT_SRC)/cmake/Modules"
100 COMPONENT_TEST_CMD = $(GMAKE)
101 COMPONENT_TEST_ARGS = $(COMPONENT_BUILD_GMAKE_ARGS)
102 COMPONENT_TEST_TARGETS = check-all
103 COMPONENT_TEST_ENV += PATH=$(PATH.gnu)
105 # Do not change the order of these regexp transforms.
106 COMPONENT_TEST_TRANSFORMS += \
107 '-e "/^Testing Time: .*$$/d" ' \
108 '-e "/^make.*$$/d" ' \
109 '-e "/^Failed Tests /,/Unexpected Passed:/p" ' \
110 '-e "" ' \
111 '-e "/.*/d" '
113 TESTSUITE_MAKE = $(GMAKE)
115 # Auto-generated dependencies
116 PYTHON_REQUIRED_PACKAGES += runtime/python
117 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
118 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
119 REQUIRED_PACKAGES += SUNWcs
120 REQUIRED_PACKAGES += compress/zstd
121 REQUIRED_PACKAGES += library/libedit
122 REQUIRED_PACKAGES += library/libxml2
123 REQUIRED_PACKAGES += library/zlib
124 REQUIRED_PACKAGES += system/library
125 REQUIRED_PACKAGES += system/library/math