shared-macros.mk: simplify java settings
[oi-userland.git] / components / developer / clang-13 / Makefile
blob5ebd1d00004152b90b4ec3438f1e0b3ff5abe387
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
20 BUILD_STYLE= cmake
21 USE_PARALLEL_BUILD= yes
22 include ../../../make-rules/shared-macros.mk
24 COMPONENT_NAME= clang
25 COMPONENT_VERSION= 13.0.1
26 COMPONENT_REVISION= 2
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:ec6b80d82c384acad2dc192903a6cf2cdbaffb889b84bfb98da9d71e630fc834
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:787a9e2d99f5c8720aa1773e4be009461cd30d3bd40fdd24591e473467c917c9
46 COMPONENT_ARCHIVE_URL_1= https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_1)
48 include $(WS_MAKE_RULES)/common.mk
50 CMAKE_PREFIX = $(CLANG_PREFIX)
52 COMPONENT_POST_UNPACK_ACTION += \
53 $(UNPACK) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_1) && \
54 mv $(CLANG_NAME)-$(COMPONENT_VERSION).src $(COMPONENT_SRC)/tools/clang
56 COMPONENT_PRE_CONFIGURE_ACTION = (cp -a $(SOURCE_DIR)/* $(@D))
58 COMPONENT_POST_INSTALL_ACTION = \
59 for file in `echo $(PROTO_DIR)/$(CMAKE_PREFIX)/bin/*`; do \
60 $(ELFEDIT) -e 'dyn:runpath $(GCC_LIBDIR):$(CMAKE_PREFIX)/lib' $$file ; \
61 done && \
62 for file in \
63 `ggrep -rlh '^\#!*/usr/bin/env python' $(PROTO_DIR)/$(CMAKE_PREFIX)`; do \
64 sed -i -e 's,^\#!*/usr/bin/env python,\#!$(PYTHON),' $$file; \
65 done
67 COMPONENT_TEST_CMD = $(GMAKE)
68 COMPONENT_TEST_ARGS = $(COMPONENT_BUILD_GMAKE_ARGS)
69 COMPONENT_TEST_TARGETS = check-all
70 COMPONENT_TEST_ENV += PATH=$(PATH.gnu)
72 # Do not change the order of these regexp transforms.
73 COMPONENT_TEST_TRANSFORMS += \
74 '-e "/^Testing Time: .*$$/d" ' \
75 '-e "/^make.*$$/d" ' \
76 '-e "/^Failed Tests /,/Unexpected Passed:/p" ' \
77 '-e "" ' \
78 '-e "/.*/d" '
80 TESTSUITE_MAKE = $(GMAKE)
82 CMAKE_OPTIONS += -DCMAKE_C_COMPILER=$(CC)
83 CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER=$(CXX)
84 CMAKE_OPTIONS += -DGCC_INSTALL_PREFIX=$(GCC_ROOT)
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_LINK_LLVM_DYLIB=ON
89 CMAKE_OPTIONS += -DLLVM_INSTALL_UTILS=ON
90 CMAKE_OPTIONS += -DCLANG_DEFAULT_RTLIB=libgcc
91 CMAKE_OPTIONS += -DCLANG_DEFAULT_CXX_STDLIB=libstdc++
92 CMAKE_OPTIONS += -DPYTHON_EXECUTABLE="$(PYTHON)"
94 # Auto-generated dependencies
95 PYTHON_REQUIRED_PACKAGES += runtime/python
96 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
97 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
98 REQUIRED_PACKAGES += SUNWcs
99 REQUIRED_PACKAGES += library/libedit
100 REQUIRED_PACKAGES += library/libxml2
101 REQUIRED_PACKAGES += library/zlib
102 REQUIRED_PACKAGES += system/library
103 REQUIRED_PACKAGES += system/library/math