shared-macros.mk: simplify java settings
[oi-userland.git] / components / developer / clang-19 / Makefile
blobdb03eca8aca5d8462c81565b5a3fbad03c5329da
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= 19.1.6
27 CLANG_VERSION= $(firstword $(subst ., ,$(COMPONENT_VERSION)))
28 COMPONENT_SUMMARY= LLVM tools and Clang compiler
29 COMPONENT_PROJECT_URL= https://llvm.org/
30 COMPONENT_SRC= $(LLVM_NAME)-$(COMPONENT_VERSION).src
31 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
32 COMPONENT_ARCHIVE_HASH= sha256:ad1a3b125ff014ded290094088de40efb9193ce81a24278184230b7d401f8a3e
33 COMPONENT_ARCHIVE_URL= https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE)
34 COMPONENT_FMRI= $(CLANG_DEVELOPER_PKG)
35 COMPONENT_CLASSIFICATION= Development/C
36 COMPONENT_LICENSE= BSD
37 COMPONENT_LICENSE_FILE= LICENSE.TXT
39 COMPONENT_FMRI.clang-runtime = $(CLANG_RUNTIME_PKG)
41 LLVM_NAME= llvm
42 CLANG_NAME= clang
44 COMPONENT_ARCHIVE_1= $(CLANG_NAME)-$(COMPONENT_VERSION).src.tar.xz
45 COMPONENT_ARCHIVE_HASH_1= sha256:6358cbb3e14687ca2f3465c61cffc65589b448aaa912ec2c163ef9fc046e8a89
46 COMPONENT_ARCHIVE_URL_1=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_1)
48 COMPONENT_ARCHIVE_2= cmake-$(COMPONENT_VERSION).src.tar.xz
49 COMPONENT_ARCHIVE_HASH_2= sha256:9c7ec82d9a240dc2287b8de89d6881bb64ceea0dcd6ce133c34ef65bda22d99e
50 COMPONENT_ARCHIVE_URL_2=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_2)
52 COMPONENT_ARCHIVE_3= third-party-$(COMPONENT_VERSION).src.tar.xz
53 COMPONENT_ARCHIVE_HASH_3= sha256:0e8048333bab2ba3607910e5d074259f08dccf00615778d03a2a55416718eb45
54 COMPONENT_ARCHIVE_URL_3=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_3)
56 include $(WS_MAKE_RULES)/common.mk
58 CMAKE_PREFIX = $(CLANG_PREFIX)
60 COMPONENT_POST_UNPACK_ACTION += \
61 $(UNPACK) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_1) && \
62 $(MV) $(CLANG_NAME)-$(COMPONENT_VERSION).src $(COMPONENT_SRC)/tools/clang && \
63 $(UNPACK) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_2) && \
64 $(MV) cmake-$(COMPONENT_VERSION).src/Modules $(COMPONENT_SRC)/cmake/ && \
65 $(RM) -r cmake-$(COMPONENT_VERSION).src && \
66 $(UNPACK) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_3) && \
67 $(MKDIR) $(COMPONENT_SRC)/third-party && \
68 $(MV) third-party-$(COMPONENT_VERSION).src/unittest $(COMPONENT_SRC)/third-party && \
69 $(MV) third-party-$(COMPONENT_VERSION).src/benchmark $(COMPONENT_SRC)/third-party && \
70 $(RM) -r third-party-$(COMPONENT_VERSION).src
72 COMPONENT_PRE_CONFIGURE_ACTION = ( $(CLONEY) $(SOURCE_DIR) $(@D); )
74 COMPONENT_POST_INSTALL_ACTION = \
75 for file in `echo $(PROTO_DIR)/$(CMAKE_PREFIX)/bin/*`; do \
76 /usr/bin/elfedit -e 'dyn:runpath $(GCC_LIBDIR):$(CMAKE_PREFIX)/lib' $$file ; \
77 done && \
78 for file in \
79 `ggrep -rlh '^\#!*/usr/bin/env python' $(PROTO_DIR)/$(CMAKE_PREFIX)`; do \
80 sed -i -e 's:\#!/usr/bin/env.*:\#!$(PYTHON):' $$file; \
81 done
83 CMAKE_OPTIONS += -DCMAKE_C_COMPILER=$(CC)
84 CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER=$(CXX)
85 CMAKE_OPTIONS += -DCMAKE_CXX_LINK_FLAGS="-L$(GCC_LIBDIR) -Wl,-rpath,$(GCC_LIBDIR)"
86 CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=Release
87 CMAKE_OPTIONS += -DCLANG_DEFAULT_LINKER="/usr/bin/ld"
88 CMAKE_OPTIONS += -DLLVM_ENABLE_EH=ON
89 CMAKE_OPTIONS += -DLLVM_ENABLE_RTTI=ON
90 CMAKE_OPTIONS += -DLLVM_LINK_LLVM_DYLIB=ON
91 CMAKE_OPTIONS += -DLLVM_INCLUDE_BENCHMARKS=OFF
92 CMAKE_OPTIONS += -DLLVM_INSTALL_UTILS=ON
93 CMAKE_OPTIONS += -DCLANG_DEFAULT_RTLIB=libgcc
94 CMAKE_OPTIONS += -DCLANG_DEFAULT_CXX_STDLIB=libstdc++
95 CMAKE_OPTIONS += -DPYTHON_EXECUTABLE="$(PYTHON)"
96 CMAKE_OPTIONS += -DCMAKE_MODULE_PATH="$(SOURCE_DIR)/$(COMPONENT_SRC)/cmake/Modules"
98 COMPONENT_TEST_CMD = $(GMAKE)
99 COMPONENT_TEST_ARGS = $(COMPONENT_BUILD_GMAKE_ARGS)
100 COMPONENT_TEST_TARGETS = check-all
101 COMPONENT_TEST_ENV += PATH=$(PATH.gnu)
103 # Do not change the order of these regexp transforms.
104 COMPONENT_TEST_TRANSFORMS += \
105 '-e "/^Testing Time: .*$$/d" ' \
106 '-e "/^make.*$$/d" ' \
107 '-e "/^Failed Tests /,/Unexpected Passed:/p" ' \
108 '-e "" ' \
109 '-e "/.*/d" '
111 TESTSUITE_MAKE = $(GMAKE)
113 # Auto-generated dependencies
114 PYTHON_REQUIRED_PACKAGES += runtime/python
115 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
116 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
117 REQUIRED_PACKAGES += SUNWcs
118 REQUIRED_PACKAGES += compress/zstd
119 REQUIRED_PACKAGES += library/libedit
120 REQUIRED_PACKAGES += library/libxml2
121 REQUIRED_PACKAGES += library/zlib
122 REQUIRED_PACKAGES += system/library
123 REQUIRED_PACKAGES += system/library/math