diff --git a/config/options b/config/options index 412d9e3f87..0702d6e6de 100644 --- a/config/options +++ b/config/options @@ -134,6 +134,18 @@ if [ -f "${HOME}/.libreelec/options" ]; then . "${HOME}/.libreelec/options" 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 if [ "${OEM}" = "yes" -o "${OEM}" = "no" ]; then OEM_SUPPORT="${OEM}" diff --git a/config/show_config b/config/show_config index 82029ff957..9ca1daec4a 100644 --- a/config/show_config +++ b/config/show_config @@ -37,6 +37,7 @@ show_config() { config_message+="\n - DEBUG:\t\t\t\t ${DEBUG:-no}" config_message+="\n - CFLAGS:\t\t\t\t ${TARGET_CFLAGS}" config_message+="\n - LDFLAGS:\t\t\t\t ${TARGET_LDFLAGS}" + config_message+="\n - Local ccache:\t\t\t ${LOCAL_CCACHE:-no}" # Misc. hardware configuration diff --git a/distributions/LibreELEC/options b/distributions/LibreELEC/options index 67402796fc..bcffbf2b04 100644 --- a/distributions/LibreELEC/options +++ b/distributions/LibreELEC/options @@ -44,6 +44,9 @@ # Default supported get handlers (archive, git, file etc.) 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 ###