From owner-svn-src-head@freebsd.org Wed Jun 24 17:03:44 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E6045353C3E; Wed, 24 Jun 2020 17:03:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49sTxr5cVCz4PYb; Wed, 24 Jun 2020 17:03:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BBE52150D7; Wed, 24 Jun 2020 17:03:44 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 05OH3i6E063212; Wed, 24 Jun 2020 17:03:44 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 05OH3htJ063205; Wed, 24 Jun 2020 17:03:43 GMT (envelope-from cem@FreeBSD.org) Message-Id: <202006241703.05OH3htJ063205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: Conrad Meyer Date: Wed, 24 Jun 2020 17:03:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r362587 - in head: . lib/clang/libclang share/mk targets/pseudo/bootstrap-tools targets/pseudo/clang tools/build/mk tools/build/options usr.bin/clang X-SVN-Group: head X-SVN-Commit-Author: cem X-SVN-Commit-Paths: in head: . lib/clang/libclang share/mk targets/pseudo/bootstrap-tools targets/pseudo/clang tools/build/mk tools/build/options usr.bin/clang X-SVN-Commit-Revision: 362587 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Jun 2020 17:03:45 -0000 Author: cem Date: Wed Jun 24 17:03:42 2020 New Revision: 362587 URL: https://svnweb.freebsd.org/changeset/base/362587 Log: Add WITH_CLANG_FORMAT option clang-format is enabled conditional on either WITH_CLANG_EXTRAS or WITH_CLANG_FORMAT. Some sources in libclang are build conditional on either rule, and obviously the clang-format binary itself depends on the rule. clang-format could still use a manual page. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D25427 Added: head/tools/build/options/WITH_CLANG_FORMAT (contents, props changed) Modified: head/Makefile.inc1 head/lib/clang/libclang/Makefile head/share/mk/src.opts.mk head/targets/pseudo/bootstrap-tools/Makefile head/targets/pseudo/clang/Makefile.depend head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile Modified: head/Makefile.inc1 ============================================================================== --- head/Makefile.inc1 Wed Jun 24 16:17:58 2020 (r362586) +++ head/Makefile.inc1 Wed Jun 24 17:03:42 2020 (r362587) @@ -676,7 +676,7 @@ BSARGS= DESTDIR= \ MK_HTML=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no \ MK_INCLUDES=yes @@ -697,7 +697,7 @@ TMAKE= \ SSP_CFLAGS= \ -DNO_LINT \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_RETPOLINE=no MK_TESTS=no # cross-tools stage @@ -2577,6 +2577,7 @@ NXBMAKEARGS+= \ SSP_CFLAGS= \ MK_CASPER=no \ MK_CLANG_EXTRAS=no \ + MK_CLANG_FORMAT=no \ MK_CLANG_FULL=no \ MK_CTF=no \ MK_DEBUG_FILES=no \ Modified: head/lib/clang/libclang/Makefile ============================================================================== --- head/lib/clang/libclang/Makefile Wed Jun 24 16:17:58 2020 (r362586) +++ head/lib/clang/libclang/Makefile Wed Jun 24 17:03:42 2020 (r362587) @@ -22,7 +22,7 @@ SRCDIR= clang/lib # Explanation of different SRCS variants below: # SRCS_MIN: always required, even for bootstrap -# SRCS_EXT: required for MK_CLANG_EXTRAS +# SRCS_EXT: required for MK_CLANG_EXTRAS || MK_CLANG_FORMAT # SRCS_FUL: required for MK_CLANG_FULL # SRCS_LDB: required for MK_LLDB @@ -686,7 +686,7 @@ SRCS_MIN+= Tooling/RefactoringCallbacks.cpp SRCS_MIN+= Tooling/Tooling.cpp SRCS_ALL+= ${SRCS_MIN} -.if ${MK_CLANG_EXTRAS} != "no" +.if ${MK_CLANG_EXTRAS} != "no" || ${MK_CLANG_FORMAT} != "no" SRCS_ALL+= ${SRCS_EXT} .endif .if ${MK_CLANG_FULL} != "no" Modified: head/share/mk/src.opts.mk ============================================================================== --- head/share/mk/src.opts.mk Wed Jun 24 16:17:58 2020 (r362586) +++ head/share/mk/src.opts.mk Wed Jun 24 17:03:42 2020 (r362587) @@ -202,6 +202,7 @@ __DEFAULT_NO_OPTIONS = \ BHYVE_SNAPSHOT \ BSD_GREP \ CLANG_EXTRAS \ + CLANG_FORMAT \ DTRACE_TESTS \ EXPERIMENTAL \ GNU_GREP_COMPAT \ @@ -482,6 +483,7 @@ MK_LLDB:= no .if ${MK_CLANG} == "no" MK_CLANG_EXTRAS:= no +MK_CLANG_FORMAT:= no MK_CLANG_FULL:= no MK_LLVM_COV:= no .endif Modified: head/targets/pseudo/bootstrap-tools/Makefile ============================================================================== --- head/targets/pseudo/bootstrap-tools/Makefile Wed Jun 24 16:17:58 2020 (r362586) +++ head/targets/pseudo/bootstrap-tools/Makefile Wed Jun 24 17:03:42 2020 (r362587) @@ -43,7 +43,7 @@ BSARGS= DESTDIR= \ MK_HTML=no NO_LINT=yes MK_MAN=no \ -DNO_PIC MK_PROFILE=no -DNO_SHARED \ -DNO_CPU_CFLAGS MK_WARNS=no MK_CTF=no \ - MK_CLANG_EXTRAS=no MK_CLANG_FULL=no \ + MK_CLANG_EXTRAS=no MK_CLANG_FORMAT=no MK_CLANG_FULL=no \ MK_LLDB=no MK_TESTS=no \ MK_INCLUDES=yes Modified: head/targets/pseudo/clang/Makefile.depend ============================================================================== --- head/targets/pseudo/clang/Makefile.depend Wed Jun 24 16:17:58 2020 (r362586) +++ head/targets/pseudo/clang/Makefile.depend Wed Jun 24 17:03:42 2020 (r362587) @@ -42,7 +42,6 @@ DIRDEPS+= \ .if ${MK_CLANG_EXTRAS} == "yes" DIRDEPS+= \ usr.bin/clang/bugpoint \ - usr.bin/clang/clang-format \ usr.bin/clang/llc \ usr.bin/clang/lli \ usr.bin/clang/llvm-ar \ @@ -69,6 +68,10 @@ DIRDEPS+= \ usr.bin/clang/llvm-xray \ usr.bin/clang/opt \ +.endif + +.if ${MK_CLANG_EXTRAS} == "yes" || ${MK_CLANG_FORMAT} == "yes" +DIRDEPS+= usr.bin/clang/clang-format .endif .if ${MK_LLD} == "yes" Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 24 16:17:58 2020 (r362586) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Wed Jun 24 17:03:42 2020 (r362587) @@ -1481,7 +1481,6 @@ OLD_FILES+=usr/share/man/man1/llvm-tblgen.1.gz .if ${MK_CLANG_EXTRAS} == no OLD_FILES+=usr/bin/bugpoint -OLD_FILES+=usr/bin/clang-format OLD_FILES+=usr/bin/llc OLD_FILES+=usr/bin/lli OLD_FILES+=usr/bin/llvm-as @@ -1515,6 +1514,10 @@ OLD_FILES+=usr/share/man/man1/llvm-extract.1.gz OLD_FILES+=usr/share/man/man1/llvm-link.1.gz OLD_FILES+=usr/share/man/man1/llvm-pdbutil.1.gz OLD_FILES+=usr/share/man/man1/opt.1.gz +.endif + +.if ${MK_CLANG_EXTRAS} == no && ${MK_CLANG_FORMAT} == no +OLD_FILES+=usr/bin/clang-format .endif .if ${MK_CPP} == no Added: head/tools/build/options/WITH_CLANG_FORMAT ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_CLANG_FORMAT Wed Jun 24 17:03:42 2020 (r362587) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build clang-format. Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Wed Jun 24 16:17:58 2020 (r362586) +++ head/usr.bin/clang/Makefile Wed Jun 24 17:03:42 2020 (r362587) @@ -18,7 +18,6 @@ SUBDIR+= llvm-symbolizer .if ${MK_CLANG_EXTRAS} != "no" SUBDIR+= bugpoint -SUBDIR+= clang-format SUBDIR+= llc SUBDIR+= lli SUBDIR+= llvm-as @@ -40,6 +39,10 @@ SUBDIR+= llvm-pdbutil SUBDIR+= llvm-rtdyld SUBDIR+= llvm-xray SUBDIR+= opt +.endif + +.if ${MK_CLANG_EXTRAS} != "no" || ${MK_CLANG_FORMAT} != "no" +SUBDIR+= clang-format .endif .if ${MK_LLD} != "no"