When cross compiling llvm and clang there is a native step where we build
llvm-config llvm-tblgen and clang-tblgen for the host compiler.
When someone in doing this in a stage process they may already have these tools and wish to opt to use the existing ones instead.
This adds support for 3 new optional cmake flags to disable building of the native steps with the expectation of having them on the PATH already.
HAVE_NATIVE_LLVM_CONFIG
HAVE_NATIVE_LLVM_TABLEGEN
HAVE_NATIVE_CLANG_TABLEGEN
Example.
Stage -1 - install gcc or clang for host
Stage 0 - trust untrust
Stage 1 - build host clang and llvm and cross compile a crt, compiler-rt, libunwind, libcxx etc for a different target than the host using compiler we just built
Stage 2 - cross compile llvm and clang using the new target support added in stage 1 and using the native tools built in stage 1.
These defines come in handy in stage 2, removing the need to build these tools twice.
This line already tests whether or not to build a new NATIVE tblgen, so I don't think you need to change this file. Passing -D(CLANG|LLVM)_TABLEGEN should just work here -- or explicitly adding it to the cache in your toolchain file.