Disable LLDB builds on 10.x as they don't link.

Attempt to correct default targets. [0]

Fix more references to clang-format50 and use a more future proof
patching approach. [1]

Build and install pp-trace with the EXTRAS target.

PR:		219779 [0], 220995 [1], 222380 [2]
This commit is contained in:
Brooks Davis 2017-09-19 23:44:35 +00:00
parent 2ddda12b0e
commit 058c493f3e
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=450176
5 changed files with 60 additions and 2 deletions

View file

@ -2,6 +2,7 @@
PORTNAME= llvm
DISTVERSION= 5.0.0
PORTREVISON= 1
CATEGORIES= devel lang
MASTER_SITES= http://llvm.org/${PRE_}releases/${LLVM_RELEASE}/${RCDIR}
PKGNAMESUFFIX= ${LLVM_SUFFIX}
@ -39,6 +40,8 @@ SUB_LIST= LLVM_PREFIX="${LLVM_PREFIX}" LLVM_SUFFIX="${LLVM_SUFFIX}"
CMAKE_INSTALL_PREFIX= ${LLVM_PREFIX}
CMAKE_ARGS= -DLLVM_BUILD_LLVM_DYLIB=ON
CMAKE_ARGS+= -DLLVM_DEFAULT_TARGET_TRIPLE=${CONFIGURE_TARGET}
CMAKE_ARGS+= -DLLVM_HOST_TRIPLE=${CONFIGURE_TARGET}
# Following commit https://github.com/kitware/cmake/commit/956054
# we need to either change the whole man-shuffle below, or simply
# redefine CMAKE_INSTALL_MANDIR
@ -50,6 +53,7 @@ OPTIONS_DEFINE_i386= COMPILER_RT
OPTIONS_DEFAULT= CLANG EXTRAS LIT LLD LLDB
OPTIONS_DEFAULT_amd64= COMPILER_RT GOLD OPENMP
OPTIONS_DEFAULT_i386= COMPILER_RT
OPTIONS_EXCLUDE_FreeBSD_10= LLDB
OPTIONS_SUB= yes
CLANG_DESC= Build clang
@ -58,6 +62,8 @@ CLANG_EXTRA_PATCHES= \
${PATCHDIR}/clang-patch-fopenmp.diff \
${PATCHDIR}/clang-patch-tools_clang_lib_Headers_CMakeLists.txt \
${PATCHDIR}/clang-patch-tools_clang_tools_clang-format_clang-format.py \
${PATCHDIR}/clang-patch-tools_clang_tools_clang-format_clang-format-sublime.py \
${PATCHDIR}/clang-patch-tools_clang_tools_clang-format_git-clang-format \
${PATCHDIR}/clang-patch-tools_clang_tools_scan-build_libexec_ccc-analyzer
CLANG_CONFLICTS_INSTALL= clang-devel-3.[1234567]*
CLANG_DISTFILES= cfe-${DISTVERSION}.src${EXTRACT_SUFX}
@ -168,7 +174,8 @@ EXTRAS_COMMANDS+= \
clang-reorder-fields \
clang-tidy \
find-all-symbols \
modularize
modularize \
pp-trace
EXTRAS_LIBS= libclangApplyReplacements \
libclangChangeNamespace \
libclangIncludeFixer \
@ -356,6 +363,10 @@ post-patch:
post-patch-CLANG-on:
${REINPLACE_CMD} -e 's|%%LLVM_PREFIX%%|${LLVM_PREFIX}|' \
${PATCH_WRKSRC}/tools/clang/lib/Driver/ToolChains/CommonArgs.cpp
${REINPLACE_CMD} -e 's|%%LLVM_SUFFIX%%|${LLVM_SUFFIX}|' \
${PATCH_WRKSRC}/tools/clang/tools/clang-format/clang-format.py \
${PATCH_WRKSRC}/tools/clang/tools/clang-format/clang-format-sublime.py \
${PATCH_WRKSRC}/tools/clang/tools/clang-format/git-clang-format
post-build-COMPILER_RT-on:
${MKDIR} ${WRKDIR}/compiler-rt-build

View file

@ -0,0 +1,14 @@
$FreeBSD$
--- tools/clang/tools/clang-format/clang-format-sublime.py.orig
+++ tools/clang/tools/clang-format/clang-format-sublime.py
@@ -18,7 +18,7 @@
import subprocess
# Change this to the full path if clang-format is not on the path.
-binary = 'clang-format'
+binary = 'clang-format%%LLVM_SUFFIX%%'
# Change this to format according to other formatting styles. See the output of
# 'clang-format --help' for a list of supported styles. The default looks for

View file

@ -5,7 +5,7 @@
# set g:clang_format_path to the path to clang-format if it is not on the path
# Change this to the full path if clang-format is not on the path.
-binary = 'clang-format'
+binary = 'clang-format39'
+binary = 'clang-format%%LLVM_SUFFIX%%'
if vim.eval('exists("g:clang_format_path")') == "1":
binary = vim.eval('g:clang_format_path')

View file

@ -0,0 +1,32 @@
$FreeBSD$
--- tools/clang/tools/clang-format/git-clang-format.orig
+++ tools/clang/tools/clang-format/git-clang-format
@@ -90,7 +90,7 @@
usage=usage, formatter_class=argparse.RawDescriptionHelpFormatter,
description=desc)
p.add_argument('--binary',
- default=config.get('clangformat.binary', 'clang-format'),
+ default=config.get('clangformat.binary', 'clang-format%%LLVM_SUFFIX%%'),
help='path to clang-format'),
p.add_argument('--commit',
default=config.get('clangformat.commit', 'HEAD'),
@@ -344,7 +344,7 @@
def run_clang_format_and_save_to_tree(changed_lines, revision=None,
- binary='clang-format', style=None):
+ binary='clang-format%%LLVM_SUFFIX%%', style=None):
"""Run clang-format on each file and save the result to a git tree.
Returns the object ID (SHA-1) of the created tree."""
@@ -397,7 +397,7 @@
def clang_format_to_blob(filename, line_ranges, revision=None,
- binary='clang-format', style=None):
+ binary='clang-format%%LLVM_SUFFIX%%', style=None):
"""Run clang-format on the given file and save the result to a git blob.
Runs on the file in `revision` if not None, or on the file in the working

View file

@ -64,6 +64,7 @@ bin/sancov%%LLVM_SUFFIX%%
%%EXTRAS%%bin/clang-tidy%%LLVM_SUFFIX%%
%%EXTRAS%%bin/find-all-symbols%%LLVM_SUFFIX%%
%%EXTRAS%%bin/modularize%%LLVM_SUFFIX%%
%%EXTRAS%%bin/pp-trace%%LLVM_SUFFIX%%
%%LLD%%bin/lld%%LLVM_SUFFIX%%
%%LLD%%bin/lld-link%%LLVM_SUFFIX%%
%%LIT%%bin/lit%%LLVM_SUFFIX%%