11diff --git a/build-aux/ar-lib b/build-aux/ar-lib
2- index 1521987496..edcc491b70 100644
2+ index 1521987496..855ab90a27 100644
33--- a/build-aux/ar-lib
44+++ b/build-aux/ar-lib
5- @@ -1,6 +1,11 @@
5+ @@ -1,6 +1,10 @@
66 #! /bin/sh
77 # Wrapper for Microsoft lib.exe
88+ set -eo pipefail
99
10- + # Wrapper for compilers which do not understand '-c -o'.
1110+ if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 || -v COLOR_MAJOR ]]; then #if COLOR_MAJOR is set we want to include the wrapper so we can unset it otherwise would screw cmd output
1211+ . "$(dirname "$(readlink -f "$0")")/wrapper_helper.sh" "$@"
1312+ fi
1413 me=ar-lib
1514 scriptversion=2024-06-19.01; # UTC
1615
17- @@ -29,6 +34 ,14 @@ scriptversion=2024-06-19.01; # UTC
16+ @@ -29,6 +33 ,14 @@ scriptversion=2024-06-19.01; # UTC
1817 # bugs to <
[email protected] > or send patches to
19182019
@@ -29,7 +28,7 @@ index 1521987496..edcc491b70 100644
2928
3029 # func_error message
3130 func_error ()
32- @@ -49,6 +62 ,10 @@ func_file_conv ()
31+ @@ -49,6 +61 ,10 @@ func_file_conv ()
3332 / | /[!/]*) # absolute file, and not a UNC file
3433 if test -z "$file_conv"; then
3534 # lazily determine how to convert abs files
@@ -40,24 +39,24 @@ index 1521987496..edcc491b70 100644
4039 case `uname -s` in
4140 MINGW*)
4241 file_conv=mingw
43- @@ -60,6 +77 ,7 @@ func_file_conv ()
42+ @@ -60,6 +76 ,7 @@ func_file_conv ()
4443 file_conv=wine
4544 ;;
4645 esac
4746+ fi
4847 fi
4948 case $file_conv in
5049 mingw)
51- @@ -92,7 +110 ,7 @@ func_at_file ()
50+ @@ -92,7 +109 ,7 @@ func_at_file ()
5251
5352 for member
5453 do
5554- $AR -NOLOGO $operation:"$member" "$archive" || exit $?
56- + func_ar_run $operation:"$member" "$archive"
55+ + func_ar_run $operation:"${COLOR_MINOR2}$ member${COLOR_NONE} " "$archive"
5756 done
5857 }
5958
60- @@ -199,7 +217 ,7 @@ esac
59+ @@ -199,7 +216 ,7 @@ esac
6160
6261 if test -n "$delete"; then
6362 if test ! -f "$orig_archive"; then
@@ -66,7 +65,7 @@ index 1521987496..edcc491b70 100644
6665 fi
6766 for member
6867 do
69- @@ -209,14 +227 ,14 @@ if test -n "$delete"; then
68+ @@ -209,14 +226 ,14 @@ if test -n "$delete"; then
7069 ;;
7170 *)
7271 func_file_conv "$1"
@@ -83,7 +82,7 @@ index 1521987496..edcc491b70 100644
8382 fi
8483 if test $# -gt 0; then
8584 for member
86- @@ -227,15 +245 ,15 @@ elif test -n "$extract"; then
85+ @@ -227,15 +244 ,15 @@ elif test -n "$extract"; then
8786 ;;
8887 *)
8988 func_file_conv "$1"
@@ -98,11 +97,11 @@ index 1521987496..edcc491b70 100644
9897 | while read member
9998 do
10099- $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
101- + func_ar_run -EXTRACT:"$member" "$archive"
100+ + func_ar_run -EXTRACT:${COLOR_MINOR2} "$member"${COLOR_NONE} "$archive"
102101 done
103102 fi
104103
105- @@ -266,14 +284 ,14 @@ elif test -n "$quick$replace"; then
104+ @@ -266,14 +283 ,14 @@ elif test -n "$quick$replace"; then
106105 done
107106
108107 if test -n "$orig_archive"; then
@@ -122,7 +121,7 @@ index 1521987496..edcc491b70 100644
122121+ func_ar_run -LIST ${COLOR_MAJOR}"$archive"${COLOR_NONE}
123122 fi
124123diff --git a/build-aux/compile b/build-aux/compile
125- index c3e8760e96..55eb76649e 100644
124+ index c3e8760e96..d0df0ab4ff 100644
126125--- a/build-aux/compile
127126+++ b/build-aux/compile
128127@@ -1,5 +1,10 @@
@@ -353,7 +352,7 @@ index c3e8760e96..55eb76649e 100644
353352 shift
354353 ;;
355354 *)
356- @@ -225,8 +316,29 @@ func_cl_wrapper ()
355+ @@ -225,8 +316,31 @@ func_cl_wrapper ()
357356 if test -n "$linker_opts"; then
358357 linker_opts="-link$linker_opts"
359358 fi
@@ -368,6 +367,8 @@ index c3e8760e96..55eb76649e 100644
368367+ ;;
369368+ \/*) #strip slash commands
370369+ ;;
370+ + -D*) #any defines
371+ + ;;
371372+ *)
372373+ FINAL_ARR+=($VAL)
373374+ ;;
@@ -387,14 +388,14 @@ index c3e8760e96..55eb76649e 100644
387388 eat=
388389diff --git a/build-aux/ld-link b/build-aux/ld-link
389390new file mode 100644
390- index 0000000000..3b57d4e63b
391+ index 0000000000..a8bc17a1a8
391392--- /dev/null
392393+++ b/build-aux/ld-link
393- @@ -0,0 +1,45 @@
394+ @@ -0,0 +1,44 @@
394395+ #!/bin/bash
395396+ set -eo pipefail
396397+
397- + # Wrapper for compilers which do not understand '-c -o' .
398+ + #wrapper around windows 'ld' aka link.exe. Primarily just colorization, path conversion, and making sure the MSVC link.exe is called NOT *nix link .
398399+ if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 || -v COLOR_MAJOR ]]; then #if COLOR_MAJOR is set we want to include the wrapper so we can unset it otherwise would screw cmd output
399400+ . "$(dirname "$(readlink -f "$0")")/wrapper_helper.sh" "$@"
400401+ fi
@@ -407,7 +408,7 @@ index 0000000000..3b57d4e63b
407408+ echo $WPATH
408409+ }
409410+
410- + # with the other wrappers you can use cl or lib as they genreally wont collide with msys but link.exe does
411+ + # with the other wrappers you can use cl or lib as they generally wont collide with msys but link.exe does
411412+ if [[ ! -v MS_LINK ]]; then
412413+ MS_LINK=`cygpath.exe -m "$VCToolsInstallDir"`
413414+ MS_LINK="${LINK_PATH}bin/HostX64/x64/link.exe"
@@ -430,25 +431,29 @@ index 0000000000..3b57d4e63b
430431+ set -- "$@" "$file"
431432+ shift
432433+ done
433- + echo "HI MSLINK IS: $MS_LINK"
434434+ if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 ]]; then
435435+ wrapper_exec "$MS_LINK" -NOLOGO "$@"
436436+ else
437437+ exec "$MS_LINK" -NOLOGO "$@"
438438+ fi
439439diff --git a/build-aux/wrapper_helper.sh b/build-aux/wrapper_helper.sh
440440new file mode 100644
441- index 0000000000..4ff5b73c53
441+ index 0000000000..7f3bc6c350
442442--- /dev/null
443443+++ b/build-aux/wrapper_helper.sh
444- @@ -0,0 +1,57 @@
444+ @@ -0,0 +1,62 @@
445445+ #!/bin/bash
446446+ set -eo pipefail
447447+ shopt -s inherit_errexit
448448+
449449+ function clear_colors {
450450+ unset COLOR_MINOR COLOR_MINOR2 COLOR_MAJOR COLOR_NONE
451451+ }
452+ + function safer_color_echo {
453+ + local STR="${@//\\/\\\\}"
454+ + #prevent escape sequences other than \e[ so we dont get accidental escapes
455+ + echo -e "${STR//\\\\e[/\\e[}" 1>&2
456+ + }
452457+
453458+ CALLER_NAME=`basename ${0^^}`
454459+ if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 ]]; then
@@ -460,7 +465,7 @@ index 0000000000..4ff5b73c53
460465+ else
461466+ clear_colors;
462467+ fi
463- + echo -e ${COLOR_MINOR}GNU ${CALLER_NAME} INPUT${COLOR_NONE}: " $@" 1>&2
468+ + safer_color_echo " ${COLOR_MINOR}GNU ${CALLER_NAME} INPUT${COLOR_NONE}: $@"
464469+ else
465470+ clear_colors;
466471+ fi
@@ -483,7 +488,7 @@ index 0000000000..4ff5b73c53
483488+ echo -e "${@//'\e'\[*([0-9;])m/}" >> "$GNU_BUILD_CMD_FILE"
484489+ fi
485490+ if [[ $GNU_BUILD_WRAPPER_DEBUG -eq 1 ]]; then
486- + echo -e "${COLOR_MINOR}GNU ${CALLER_NAME} OUTPUT${COLOR_NONE}: " " $@" $STD_DECLARE $linker_opts 1>&2
491+ + safer_color_echo "${COLOR_MINOR}GNU ${CALLER_NAME} OUTPUT${COLOR_NONE}: $@"
487492+ fi
488493+ declare -a WLB_RUN_CMD=("$@")
489494+
0 commit comments