diff options
Diffstat (limited to 'contrib/autotools-patches/apply-all.sh')
-rwxr-xr-x | contrib/autotools-patches/apply-all.sh | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/contrib/autotools-patches/apply-all.sh b/contrib/autotools-patches/apply-all.sh new file mode 100755 index 00000000..0febcd2d --- /dev/null +++ b/contrib/autotools-patches/apply-all.sh | |||
@@ -0,0 +1,33 @@ | |||
1 | #!/bin/bash | ||
2 | |||
3 | # | ||
4 | # This file applies optional libtool patches mainly for better MSys2 compatibility, | ||
5 | # especially for MSys2/Clang{64,32} toolchains. | ||
6 | # It's a pity that these patches haven't been sent upstream. | ||
7 | # | ||
8 | # Based on Debian SID baseline files as of December 2021. | ||
9 | # | ||
10 | |||
11 | patchesdir="$(pwd)" | ||
12 | |||
13 | patches=( | ||
14 | 0003-Pass-various-flags-to-GCC.patch | ||
15 | 0006-Fix-strict-ansi-vs-posix-mod.patch | ||
16 | 0009-libtool-2.4.2.418-msysize-mod.patch | ||
17 | 0010-libtool-2.4.2-include-process-h-mod.patch | ||
18 | 0011-Pick-up-clang_rt-static-archives-compiler-internal-l.patch | ||
19 | 0012-Prefer-response-files-over-linker-scripts-for-mingw-mod.patch | ||
20 | 0013-Allow-statically-linking-compiler-support-libraries-mod.patch | ||
21 | 0014-Support-llvm-objdump-f-output-mod.patch | ||
22 | ) | ||
23 | |||
24 | failed=( ) | ||
25 | |||
26 | cd ../.. || exit 1 | ||
27 | |||
28 | for patch in ${patches[@]}; do | ||
29 | patch -N -p1 --no-backup-if-mismatch -r - -i "${patchesdir}/${patch}" || failed+=("$patch") | ||
30 | done | ||
31 | |||
32 | [[ -n "${failed[@]}" ]] && printf 'Failed patch: %s\n' "${failed[@]}" >&2 | ||
33 | |||