This returns the name of the C preprocessor for the toolchain being
built if CTARGET is defined, or the toolchain being used otherwise. It
is primarily intended to determine characteristics about an existing
toolchain's target as these may differ from what the tuple suggests.
It is not necessary to add the full set of tc-getTARGET_* helper
functions as this is probably the only reason we would ever invoke a
toolchain in the context of CTARGET.
# @RETURN: name of the pkg-config tool for building binaries to run on the build machine
tc-getBUILD_PKG_CONFIG() { tc-getBUILD_PROG PKG_CONFIG pkg-config "$@"; }
+# @FUNCTION: tc-getTARGET_CPP
+# @USAGE: [toolchain prefix]
+# @RETURN: name of the C preprocessor for the toolchain being built (or used)
+tc-getTARGET_CPP() {
+ if [[ -n ${CTARGET} ]]; then
+ _tc-getPROG CTARGET TARGET_CPP "gcc -E" "$@"
+ else
+ tc-getCPP "$@"
+ fi
+}
+
# @FUNCTION: tc-export
# @USAGE: <list of toolchain variables>
# @DESCRIPTION: