options: automatically use ccache on build host if it's available

Use of ccache on build host is now controlled by the
LOCAL_CCACHE_SUPPORT option. Setting it to "no" will disable use
of local ccache.

Signed-off-by: Matthias Reichl <hias@horus.com>
This commit is contained in:
Matthias Reichl 2022-12-04 13:39:47 +01:00
parent 7bf71803f5
commit b9d7841a47
2 changed files with 15 additions and 0 deletions

View File

@ -125,6 +125,18 @@ if [ -f "${HOME}/.libreelec/options" ]; then
. "${HOME}/.libreelec/options" . "${HOME}/.libreelec/options"
fi fi
if [ "${LOCAL_CCACHE_SUPPORT}" = "yes" ] && [ -z "${CCACHE_DISABLE}" ]; then
# like LOCAL_CC check for local ccache only on the very first
# call to config/options, before toolchain has been added to the path,
# otherwise we might pick up ccache from toolchain/bin here
if [ -z "${LOCAL_CCACHE}" ] && [ "${LOCAL_CCACHE_CHECKED}" != "yes" ]; then
export LOCAL_CCACHE="$(command -v ccache)"
export LOCAL_CCACHE_CHECKED="yes"
fi
else
export LOCAL_CCACHE=""
fi
# overwrite OEM_SUPPORT via commandline # overwrite OEM_SUPPORT via commandline
if [ "${OEM}" = "yes" -o "${OEM}" = "no" ]; then if [ "${OEM}" = "yes" -o "${OEM}" = "no" ]; then
OEM_SUPPORT="${OEM}" OEM_SUPPORT="${OEM}"

View File

@ -44,6 +44,9 @@
# Default supported get handlers (archive, git, file etc.) # Default supported get handlers (archive, git, file etc.)
GET_HANDLER_SUPPORT="archive" GET_HANDLER_SUPPORT="archive"
# use local ccache on build host, if available, for early package
# builds before ccache has been built
LOCAL_CCACHE_SUPPORT="yes"
### OS CONFIGURATION ### ### OS CONFIGURATION ###