# # This file and its contents are supplied under the terms of the # Common Development and Distribution License ("CDDL"), version 1.0. # You may only use this file in accordance with the terms of version # 1.0 of the CDDL. # # A full copy of the text of the CDDL should have accompanied this # source. A copy of the CDDL is also available via the Internet at # http://www.illumos.org/license/CDDL. # # # Copyright 2016 Aurelien Larcher. All rights reserved. # Copyright 2019 Alexander Pyhalov # Copyright 2019 Michal Nowak # Copyright 2019 Till Wegmüller # Copyright 2022 Klaus Ziegler # BUILD_STYLE= cmake USE_PARALLEL_BUILD= yes include ../../../make-rules/shared-macros.mk COMPONENT_NAME= clang COMPONENT_VERSION= 13.0.1 COMPONENT_REVISION= 2 CLANG_VERSION= $(firstword $(subst ., ,$(COMPONENT_VERSION))) COMPONENT_SUMMARY= LLVM tools and Clang compiler COMPONENT_PROJECT_URL= https://llvm.org/ COMPONENT_SRC= $(LLVM_NAME)-$(COMPONENT_VERSION).src COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz COMPONENT_ARCHIVE_HASH= sha256:ec6b80d82c384acad2dc192903a6cf2cdbaffb889b84bfb98da9d71e630fc834 COMPONENT_ARCHIVE_URL= https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE) COMPONENT_FMRI= $(CLANG_DEVELOPER_PKG) COMPONENT_CLASSIFICATION= Development/C COMPONENT_LICENSE= BSD COMPONENT_LICENSE_FILE= LICENSE.TXT COMPONENT_FMRI.clang-runtime = $(CLANG_RUNTIME_PKG) LLVM_NAME= llvm CLANG_NAME= clang COMPONENT_ARCHIVE_1= $(CLANG_NAME)-$(COMPONENT_VERSION).src.tar.xz COMPONENT_ARCHIVE_HASH_1= sha256:787a9e2d99f5c8720aa1773e4be009461cd30d3bd40fdd24591e473467c917c9 COMPONENT_ARCHIVE_URL_1= https://github.com/llvm/llvm-project/releases/download/llvmorg-$(COMPONENT_VERSION)/$(COMPONENT_ARCHIVE_1) include $(WS_MAKE_RULES)/common.mk CMAKE_PREFIX = $(CLANG_PREFIX) COMPONENT_POST_UNPACK_ACTION += \ $(UNPACK) $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_1) && \ mv $(CLANG_NAME)-$(COMPONENT_VERSION).src $(COMPONENT_SRC)/tools/clang COMPONENT_PRE_CONFIGURE_ACTION = (cp -a $(SOURCE_DIR)/* $(@D)) COMPONENT_POST_INSTALL_ACTION = \ for file in `echo $(PROTO_DIR)/$(CMAKE_PREFIX)/bin/*`; do \ $(ELFEDIT) -e 'dyn:runpath $(GCC_LIBDIR):$(CMAKE_PREFIX)/lib' $$file ; \ done && \ for file in \ `ggrep -rlh '^\#!*/usr/bin/env python' $(PROTO_DIR)/$(CMAKE_PREFIX)`; do \ sed -i -e 's,^\#!*/usr/bin/env python,\#!$(PYTHON),' $$file; \ done COMPONENT_TEST_CMD = $(GMAKE) COMPONENT_TEST_ARGS = $(COMPONENT_BUILD_GMAKE_ARGS) COMPONENT_TEST_TARGETS = check-all COMPONENT_TEST_ENV += PATH=$(PATH.gnu) # Do not change the order of these regexp transforms. COMPONENT_TEST_TRANSFORMS += \ '-e "/^Testing Time: .*$$/d" ' \ '-e "/^make.*$$/d" ' \ '-e "/^Failed Tests /,/Unexpected Passed:/p" ' \ '-e "" ' \ '-e "/.*/d" ' TESTSUITE_MAKE = $(GMAKE) CMAKE_OPTIONS += -DCMAKE_C_COMPILER=$(CC) CMAKE_OPTIONS += -DCMAKE_CXX_COMPILER=$(CXX) CMAKE_OPTIONS += -DGCC_INSTALL_PREFIX=$(GCC_ROOT) CMAKE_OPTIONS += -DCMAKE_CXX_LINK_FLAGS="-L$(GCC_LIBDIR) -Wl,-rpath,$(GCC_LIBDIR)" CMAKE_OPTIONS += -DCMAKE_BUILD_TYPE=Release CMAKE_OPTIONS += -DCLANG_DEFAULT_LINKER="/usr/bin/ld" CMAKE_OPTIONS += -DLLVM_LINK_LLVM_DYLIB=ON CMAKE_OPTIONS += -DLLVM_INSTALL_UTILS=ON CMAKE_OPTIONS += -DCLANG_DEFAULT_RTLIB=libgcc CMAKE_OPTIONS += -DCLANG_DEFAULT_CXX_STDLIB=libstdc++ CMAKE_OPTIONS += -DPYTHON_EXECUTABLE="$(PYTHON)" # Auto-generated dependencies PYTHON_REQUIRED_PACKAGES += runtime/python REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG) REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG) REQUIRED_PACKAGES += SUNWcs REQUIRED_PACKAGES += library/libedit REQUIRED_PACKAGES += library/libxml2 REQUIRED_PACKAGES += library/zlib REQUIRED_PACKAGES += system/library REQUIRED_PACKAGES += system/library/math