diff --git a/scripts/build b/scripts/build index 23243a6aca..7c961ee548 100755 --- a/scripts/build +++ b/scripts/build @@ -238,6 +238,23 @@ if [ -f "${PKG_CONFIGURE_SCRIPT}" -o -f "${PKG_CMAKE_SCRIPT}" -o -f "${PKG_MESON MESON_CONF="${PKG_REAL_BUILD}/meson.conf" fi +# create wrapper scripts in build dir and use them for CC/CXX when +# building for host and local-cc build flag is set +if [ "${TARGET}" = "host" ] && flag_enabled "local-cc" "no"; then + cat > libreelec-local-cc << EOF +#!/bin/sh +exec ${CC} "\$@" +EOF + chmod +x libreelec-local-cc + export CC=$(pwd)/libreelec-local-cc + cat > libreelec-local-cxx << EOF +#!/bin/sh +exec ${CXX} "\$@" +EOF + chmod +x libreelec-local-cxx + export CXX=$(pwd)/libreelec-local-cxx +fi + # configure if [ -n "${PKG_DEPENDS_CONFIG}" -a -n "${PKG_INSTALL}" ]; then for pkg in ${PKG_DEPENDS_CONFIG}; do