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
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
22 USE_PARALLEL_BUILD
= yes
23 include ..
/..
/..
/make-rules
/shared-macros.mk
25 COMPONENT_MJR_VERSION
= 18
26 COMPONENT_BASE_VERSION
= $(COMPONENT_MJR_VERSION
).1
27 COMPONENT_NAME
= clang-
$(COMPONENT_MJR_VERSION
)
28 COMPONENT_VERSION
= $(COMPONENT_BASE_VERSION
).8
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
= developer
/$(COMPONENT_NAME
)
36 COMPONENT_CLASSIFICATION
= Development
/C
37 COMPONENT_LICENSE
= BSD
38 COMPONENT_LICENSE_FILE
= LICENSE.TXT
43 COMPONENT_ARCHIVE_1
= $(CLANG_NAME
)-$(COMPONENT_VERSION
).src.
tar.xz
44 COMPONENT_ARCHIVE_HASH_1
= sha256
:5724fe0a13087d5579104cedd2f8b3bc10a212fb79a0fcdac98f4880e19f4519
45 COMPONENT_ARCHIVE_URL_1
=https
://github.com
/llvm
/llvm-project
/releases
/download
/llvmorg-
$(COMPONENT_VERSION
)/$(COMPONENT_ARCHIVE_1
)
47 COMPONENT_ARCHIVE_2
= cmake-
$(COMPONENT_VERSION
).src.
tar.xz
48 COMPONENT_ARCHIVE_HASH_2
= sha256
:59badef592dd34893cd319d42b323aaa990b452d05c7180ff20f23ab1b41e837
49 COMPONENT_ARCHIVE_URL_2
=https
://github.com
/llvm
/llvm-project
/releases
/download
/llvmorg-
$(COMPONENT_VERSION
)/$(COMPONENT_ARCHIVE_2
)
51 COMPONENT_ARCHIVE_3
= third-party-
$(COMPONENT_VERSION
).src.
tar.xz
52 COMPONENT_ARCHIVE_HASH_3
= sha256
:b76b810f3d3dc5d08e83c4236cb6e395aa9bd5e3ea861e8c319b216d093db074
53 COMPONENT_ARCHIVE_URL_3
=https
://github.com
/llvm
/llvm-project
/releases
/download
/llvmorg-
$(COMPONENT_VERSION
)/$(COMPONENT_ARCHIVE_3
)
55 include $(WS_MAKE_RULES
)/common.mk
57 CMAKE_PREFIX
= /usr
/clang
/$(COMPONENT_BASE_VERSION
)
59 PKG_MACROS
+= GCC_VERSION
=$(GCC_VERSION
)
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 ; \
80 `ggrep -rlh '^\#!*/usr/bin/env python' $(PROTO_DIR)/$(CMAKE_PREFIX)`; do \
81 sed
-i
-e
's:\#!/usr/bin/env.*:\#!$(PYTHON):' $$file; \
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_TARGETS
= check-all
102 COMPONENT_TEST_ENV
+= PATH
=$(PATH.gnu
)
104 # Do not change the order of these regexp transforms.
105 COMPONENT_TEST_TRANSFORMS
+= \
106 '-e "/^Testing Time: .*$$/d" ' \
107 '-e "/^make.*$$/d" ' \
108 '-e "/^Failed Tests /,/Unexpected Passed:/p" ' \
112 TESTSUITE_MAKE
= $(GMAKE
)
114 # Auto-generated dependencies
115 PYTHON_REQUIRED_PACKAGES
+= runtime
/python
116 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
117 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
118 REQUIRED_PACKAGES
+= SUNWcs
119 REQUIRED_PACKAGES
+= compress
/zstd
120 REQUIRED_PACKAGES
+= library
/libedit
121 REQUIRED_PACKAGES
+= library
/libxml2
122 REQUIRED_PACKAGES
+= library
/zlib
123 REQUIRED_PACKAGES
+= system
/library
124 REQUIRED_PACKAGES
+= system
/library
/math