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 2023 Friedrich Kink
23 include ..
/..
/..
/make-rules
/shared-macros.mk
25 COMPONENT_MJR_VERSION
= 15
26 COMPONENT_BASE_VERSION
= $(COMPONENT_MJR_VERSION
).0
27 COMPONENT_NAME
= clang-
$(COMPONENT_MJR_VERSION
)
28 COMPONENT_VERSION
= $(COMPONENT_BASE_VERSION
).7
30 COMPONENT_SUMMARY
= LLVM tools and Clang compiler
31 COMPONENT_PROJECT_URL
= https
://llvm.org
/
32 COMPONENT_SRC
= $(LLVM_NAME
)-$(COMPONENT_VERSION
).src
33 COMPONENT_ARCHIVE
= $(COMPONENT_SRC
).
tar.xz
34 COMPONENT_ARCHIVE_HASH
= sha256
:4ad8b2cc8003c86d0078d15d987d84e3a739f24aae9033865c027abae93ee7a4
35 COMPONENT_ARCHIVE_URL
= https
://github.com
/llvm
/llvm-project
/releases
/download
/llvmorg-
$(COMPONENT_VERSION
)/$(COMPONENT_ARCHIVE
)
36 COMPONENT_FMRI
= developer
/$(COMPONENT_NAME
)
37 COMPONENT_CLASSIFICATION
= Development
/C
38 COMPONENT_LICENSE
= BSD
39 COMPONENT_LICENSE_FILE
= LICENSE.TXT
44 COMPONENT_ARCHIVE_1
= $(CLANG_NAME
)-$(COMPONENT_VERSION
).src.
tar.xz
45 COMPONENT_ARCHIVE_HASH_1
= sha256
:a6b673ef15377fb46062d164e8ddc4d05c348ff8968f015f7f4af03f51000067
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
:8986f29b634fdaa9862eedda78513969fe9788301c9f2d938f4c10a3e7a3e7ea
50 COMPONENT_ARCHIVE_URL_2
= https
://github.com
/llvm
/llvm-project
/releases
/download
/llvmorg-
$(COMPONENT_VERSION
)/$(COMPONENT_ARCHIVE_2
)
52 include $(WS_MAKE_RULES
)/common.mk
54 CMAKE_PREFIX
= /usr
/clang
/$(COMPONENT_BASE_VERSION
)
56 PKG_MACROS
+= GCC_VERSION
=$(GCC_VERSION
)
58 COMPONENT_POST_UNPACK_ACTION
+= \
59 $(UNPACK
) $(USERLAND_ARCHIVES
)$(COMPONENT_ARCHIVE_1
) && \
60 mv
$(CLANG_NAME
)-$(COMPONENT_VERSION
).src
$(COMPONENT_SRC
)/tools
/clang
&& \
61 $(UNPACK
) $(USERLAND_ARCHIVES
)$(COMPONENT_ARCHIVE_2
) && \
62 mv cmake-
$(COMPONENT_VERSION
).src
/Modules
/* $(COMPONENT_SRC
)/cmake
/modules
&& \
63 $(RM
) -r cmake-
$(COMPONENT_VERSION
).src
65 COMPONENT_PRE_CONFIGURE_ACTION
= ( $(CLONEY
) $(SOURCE_DIR
) $(@D
); )
67 COMPONENT_POST_INSTALL_ACTION
= \
68 for file in
`echo $(PROTO_DIR)/$(CMAKE_PREFIX)/bin/*`; do \
69 /usr
/bin
/elfedit
-e
'dyn:runpath $(GCC_LIBDIR):$(CMAKE_PREFIX)/lib' $$file ; \
72 `ggrep -rlh '^\#!*/usr/bin/env python' $(PROTO_DIR)/$(CMAKE_PREFIX)`; do \
73 sed
-i
-e
's:\#!/usr/bin/env.*:\#!$(PYTHON):' $$file; \
76 COMPONENT_TEST_CMD
= $(GMAKE
)
77 COMPONENT_TEST_TARGETS
= check-all
78 COMPONENT_TEST_ENV
+= PATH
=$(PATH.gnu
)
80 # Do not change the order of these regexp transforms.
81 COMPONENT_TEST_TRANSFORMS
+= \
82 '-e "/^Testing Time: .*$$/d" ' \
83 '-e "/^make.*$$/d" ' \
84 '-e "/^Failed Tests /,/Unexpected Passed:/p" ' \
88 TESTSUITE_MAKE
= $(GMAKE
)
90 CMAKE_OPTIONS
+= -DCMAKE_C_COMPILER
=$(CC
)
91 CMAKE_OPTIONS
+= -DCMAKE_CXX_COMPILER
=$(CXX
)
92 CMAKE_OPTIONS
+= -DGCC_INSTALL_PREFIX
=$(GCC_ROOT
)
93 CMAKE_OPTIONS
+= -DCMAKE_CXX_LINK_FLAGS
="-L$(GCC_LIBDIR) -Wl,-rpath,$(GCC_LIBDIR)"
94 CMAKE_OPTIONS
+= -DCMAKE_BUILD_TYPE
=Release
95 CMAKE_OPTIONS
+= -DCLANG_DEFAULT_LINKER
="/usr/bin/ld"
96 CMAKE_OPTIONS
+= -DLLVM_ENABLE_EH
=ON
97 CMAKE_OPTIONS
+= -DLLVM_ENABLE_RTTI
=ON
98 CMAKE_OPTIONS
+= -DLLVM_LINK_LLVM_DYLIB
=ON
99 CMAKE_OPTIONS
+= -DLLVM_INCLUDE_BENCHMARKS
=OFF
100 CMAKE_OPTIONS
+= -DLLVM_INSTALL_UTILS
=ON
101 CMAKE_OPTIONS
+= -DCLANG_DEFAULT_RTLIB
=libgcc
102 CMAKE_OPTIONS
+= -DCLANG_DEFAULT_CXX_STDLIB
=libstdc
++
103 CMAKE_OPTIONS
+= -DPYTHON_EXECUTABLE
="$(PYTHON)"
105 # Auto-generated dependencies
106 PYTHON_REQUIRED_PACKAGES
+= runtime
/python
107 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
108 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
109 REQUIRED_PACKAGES
+= SUNWcs
110 REQUIRED_PACKAGES
+= compress
/zstd
111 REQUIRED_PACKAGES
+= library
/libedit
112 REQUIRED_PACKAGES
+= library
/libxml2
113 REQUIRED_PACKAGES
+= library
/zlib
114 REQUIRED_PACKAGES
+= system
/library
115 REQUIRED_PACKAGES
+= system
/library
/math