From c371433e4a2ec0b0223b5834db16b61d018d6669 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 3 Jun 2016 16:17:36 +0000 Subject: [PATCH] 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 --- Makefile.inc1 | 2 +- lib/clang/freebsd_cc_version.h | 3 +++ lib/clang/include/clang/Basic/Version.inc | 2 -- lib/clang/libclangbasic/Makefile | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 lib/clang/freebsd_cc_version.h diff --git a/Makefile.inc1 b/Makefile.inc1 index 2503da3394b..39147a2ac12 100644 --- a/Makefile.inc1 +++ b/Makefile.inc1 @@ -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 diff --git a/lib/clang/freebsd_cc_version.h b/lib/clang/freebsd_cc_version.h new file mode 100644 index 00000000000..0f13792b4a9 --- /dev/null +++ b/lib/clang/freebsd_cc_version.h @@ -0,0 +1,3 @@ +/* $FreeBSD$ */ + +#define FREEBSD_CC_VERSION 1100004 diff --git a/lib/clang/include/clang/Basic/Version.inc b/lib/clang/include/clang/Basic/Version.inc index 72c5bed4e73..94dc282fe8a 100644 --- a/lib/clang/include/clang/Basic/Version.inc +++ b/lib/clang/include/clang/Basic/Version.inc @@ -8,5 +8,3 @@ #define CLANG_VENDOR "FreeBSD " #define SVN_REVISION "262564" - -#define FREEBSD_CC_VERSION 1100004U diff --git a/lib/clang/libclangbasic/Makefile b/lib/clang/libclangbasic/Makefile index 028fcdbdf9e..cfa2049038d 100644 --- a/lib/clang/libclangbasic/Makefile +++ b/lib/clang/libclangbasic/Makefile @@ -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