diff --git a/tools/builder/core.sh b/tools/builder/core.sh index 28a57d61..caec89d6 100644 --- a/tools/builder/core.sh +++ b/tools/builder/core.sh @@ -13,7 +13,7 @@ export PERL_MAKE="${PERL_MAKE:-make}" BUILD_ENV=$BUILD_ENV$(cat </dev/null || : +} + +host_env() { if [ -z "$OCC" ]; then cat </dev/null || : + host_env_base 2>/dev/null || : } -target_env() { +target_env_base() { rm -f "$BUILD_ROOT/root" ln -sf "$BUILD_ROOT/target" "$BUILD_ROOT/root" + # make links to executables in the target as well + IFS=$NL + for exe in $(find "$BUILD_ROOT/host/bin" -maxdepth 1 -type f); do + IFS=$OIFS + basename=${exe##*/} + if ! path_exists "$BUILD_ROOT/target/bin/$basename"; then + ln -s "$exe" "$BUILD_ROOT/target/bin/$basename"; + fi + done + IFS=$OIFS + + target_env_hook 2>/dev/null || : +} + +target_env() { if [ -n "$OCC" ]; then cat </dev/null || : + target_env_base 2>/dev/null || : } # replace install artifact paths with absolute paths into host and target trees diff --git a/tools/win/msys2-builder b/tools/win/msys2-builder index a11d20fa..b320e27f 100755 --- a/tools/win/msys2-builder +++ b/tools/win/msys2-builder @@ -107,8 +107,6 @@ DIST_TAR_ARGS=" . "${0%/*}/../builder/mingw.sh" host_env() { - ln -sf "$BUILD_ROOT/host" "$BUILD_ROOT/root" - cat </dev/null || : } target_env() { - ln -sf "$BUILD_ROOT/target" "$BUILD_ROOT/root" - cat </dev/null || : } table_line_append DIST_PRE_BUILD c2man ":; \