For clang, move the definition of FREEBSD_CC_VERSION into its own header

file, lib/clang/freebsd_cc_version.h, instead of reusing Version.inc.
The header is only included from one .cpp file in the clang tree.

This minimizes the number of .cpp files that need to be rebuilt if the
version is bumped.

Discussed with:	bdrewery
This commit is contained in:
dim 2016-06-03 16:17:36 +00:00
parent daeae55cad
commit 788d26643d
4 changed files with 7 additions and 3 deletions

View File

@ -99,7 +99,7 @@ _expected_compiler_type= gcc
.if ${_expected_compiler_type} == "clang"
CROSS_COMPILER_FREEBSD_VERSION!= \
awk '$$2 == "FREEBSD_CC_VERSION" {printf("%d\n", $$3)}' \
${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown
${SRCDIR}/lib/clang/freebsd_cc_version.h || echo unknown
CROSS_COMPILER_VERSION!= \
awk '$$2 == "CLANG_VERSION" {split($$3, a, "."); print a[1] * 10000 + a[2] * 100 + a[3]}' \
${SRCDIR}/lib/clang/include/clang/Basic/Version.inc || echo unknown

View File

@ -0,0 +1,3 @@
/* $FreeBSD$ */
#define FREEBSD_CC_VERSION 1100004

View File

@ -8,5 +8,3 @@
#define CLANG_VENDOR "FreeBSD "
#define SVN_REVISION "262564"
#define FREEBSD_CC_VERSION 1100004U

View File

@ -50,3 +50,6 @@ TGHDRS= AttrHasAttributeImpl \
# XX: work around GCC bug 67888
CFLAGS.gcc += -fpermissive
# Ensure FREEBSD_CC_VERSION is defined for Targets.cpp
CFLAGS.Targets.cpp+= -include ../freebsd_cc_version.h