[FFmpeg-cvslog] configure: Use MSYSTEM_CARCH for default arch on msys2

Coia Prant git at videolan.org
Wed May 28 10:55:49 EEST 2025


ffmpeg | branch: release/7.1 | Coia Prant <coiaprant at gmail.com> | Fri May 23 17:32:00 2025 +0800| [9373b442a689455bb5fcfddcfe70dfb8e4352fbc] | committer: Martin Storsjö

configure: Use MSYSTEM_CARCH for default arch on msys2

On msys2, `uname -m` returns the architecture of the base msys2
layer. On Windows on arm64, the base msys2 layer itself is still
x86_64 only, even if running with e.g. the clangarm64 where the
windows native applications are built as aarch64.

If MSYSTEM_CARCH is set, use this instead of `uname -m` for
the default architecture. This gives the correct behaviour
for the clangarm64 environments. It also gives the correct
default for the 32 bit x86 environments such as `mingw32`.

(On `mingw32`, the fact that `uname -m` returned `x86_64`
hasn't been an issue, as both that and `i686` gets normalized
into `x86` internally in ffmpeg's configure.)

Signed-off-by: Coia Prant <coiaprant at gmail.com>
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit df967d095ae6a42a46cd4c46b96d61cc1c319b23)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9373b442a689455bb5fcfddcfe70dfb8e4352fbc
---

 configure | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/configure b/configure
index 0aa7b72af3..b559dca5d0 100755
--- a/configure
+++ b/configure
@@ -4112,6 +4112,8 @@ if test "$target_os_default" = aix; then
     arch_default=$(uname -p)
     strip_default="strip -X32_64"
     nm_default="nm -g -X32_64"
+elif test "$MSYSTEM_CARCH" != ""; then
+    arch_default="$MSYSTEM_CARCH"
 else
     arch_default=$(uname -m)
 fi



More information about the ffmpeg-cvslog mailing list