Module: wine Branch: master Commit: cda2886fd3018c9e8c12791238db481b528f6a65 URL: https://gitlab.winehq.org/wine/wine/-/commit/cda2886fd3018c9e8c12791238db481...
Author: Zebediah Figura zfigura@codeweavers.com Date: Sat Aug 12 17:43:08 2023 -0500
configure: Fail if --enable-archs is used and any cross-compiler is missing.
For example, currently, if --enable-archs=i386,x86_64 is used, and there is an x86_64 cross compiler present but no i386 cross compiler, Wine will silently remove i386 from the list of cross-compiled architechtures, and only compile PE code for x86_64. This seems quite undesirable.
I am not aware of any practical reason for this to happen. Debian does ship i686 and x86_64 MinGW compilers in separate packages, though, so it is possible in theory.
---
configure | 33 ++++++++++++++++----------------- configure.ac | 18 ++++++++++-------- 2 files changed, 26 insertions(+), 25 deletions(-)
diff --git a/configure b/configure index d5e699ca7d9..829741a5c0e 100755 --- a/configure +++ b/configure @@ -10512,11 +10512,6 @@ test -n "$x86_64_CC" || x86_64_CC="false" esac fi
- if eval test "x$"${wine_arch}_CC"" = x"false" -then : - continue -fi - saved_CC=$CC saved_CFLAGS=$CFLAGS saved_LDFLAGS=$LDFLAGS @@ -10531,7 +10526,11 @@ fi target="" as_wine_cv_crosscc=`printf "%s\n" "ac_cv_${wine_arch}_crosscc" | $as_tr_sh`
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC works" >&5 + if eval test "x$"${wine_arch}_CC"" = x"false" +then : + +else $as_nop + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC works" >&5 printf %s "checking whether $CC works... " >&6; } if eval test ${$as_wine_cv_crosscc+y} then : @@ -10559,6 +10558,7 @@ fi eval ac_res=$$as_wine_cv_crosscc { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 printf "%s\n" "$ac_res" >&6; } +fi if eval test "x$"$as_wine_cv_crosscc"" = x"yes" then : set x $CC @@ -10627,6 +10627,11 @@ fi
if test -z "$target" then + if test ${enable_archs+y} +then : + as_fn_error $? "MinGW $wine_arch compiler not found. +This is an error since --enable-archs=$wine_arch was requested." "$LINENO" 5 +fi CC=$saved_CC CFLAGS=$saved_CFLAGS LDFLAGS=$saved_LDFLAGS @@ -10676,6 +10681,11 @@ printf "%s\n" "unsupported" >&6; } CC=$saved_CC CFLAGS=$saved_CFLAGS LDFLAGS=$saved_LDFLAGS + if test ${enable_archs+y} +then : + as_fn_error $? "MinGW $wine_arch compiler supporting C99 not found. +This is an error since --enable-archs=$wine_arch was requested." "$LINENO" 5 +fi continue ;; x*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $res" >&5 @@ -11648,17 +11658,6 @@ if test $HOST_ARCH = aarch64 then test "x$PE_ARCHS" != x || as_fn_error $? "PE cross-compilation is required for ARM64, please install clang/llvm-dlltool/lld, or llvm-mingw." "$LINENO" 5 DLLEXT="" -else - if test "x$PE_ARCHS" = "x" -then : - case "x$with_mingw" in - x) as_fn_append wine_notices "|MinGW compiler not found, cross-compiling PE files won't be supported." ;; - xno) ;; - *) as_fn_error $? "MinGW compiler not found, cross-compiling PE files won't be supported. -This is an error since --with-mingw was requested." "$LINENO" 5 ;; -esac - -fi fi
diff --git a/configure.ac b/configure.ac index 0a683212866..90f4fd3809d 100644 --- a/configure.ac +++ b/configure.ac @@ -849,8 +849,6 @@ do ;; esac])
- AS_VAR_IF([${wine_arch}_CC],[false],[continue]) - saved_CC=$CC saved_CFLAGS=$CFLAGS saved_LDFLAGS=$LDFLAGS @@ -864,9 +862,10 @@ do
target="" AS_VAR_PUSHDEF([wine_cv_crosscc],[ac_cv_${wine_arch}_crosscc]) - AC_CACHE_CHECK([whether $CC works],[wine_cv_crosscc], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], - [AS_VAR_SET([wine_cv_crosscc],[yes])],[AS_VAR_SET([wine_cv_crosscc],[no])])]) + AS_VAR_IF([${wine_arch}_CC],[false],[], + [AC_CACHE_CHECK([whether $CC works],[wine_cv_crosscc], + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])], + [AS_VAR_SET([wine_cv_crosscc],[yes])],[AS_VAR_SET([wine_cv_crosscc],[no])])])]) AS_VAR_IF([wine_cv_crosscc],[yes], [set x $CC shift @@ -903,6 +902,9 @@ do
if test -z "$target" then + AS_VAR_SET_IF([enable_archs], + [AC_MSG_ERROR([MinGW $wine_arch compiler not found. +This is an error since --enable-archs=$wine_arch was requested.])]) CC=$saved_CC CFLAGS=$saved_CFLAGS LDFLAGS=$saved_LDFLAGS @@ -930,6 +932,9 @@ do CC=$saved_CC CFLAGS=$saved_CFLAGS LDFLAGS=$saved_LDFLAGS + AS_VAR_SET_IF([enable_archs], + [AC_MSG_ERROR([MinGW $wine_arch compiler supporting C99 not found. +This is an error since --enable-archs=$wine_arch was requested.])]) continue ;; x*) AC_MSG_RESULT([$res]) @@ -1009,9 +1014,6 @@ if test $HOST_ARCH = aarch64 then test "x$PE_ARCHS" != x || AC_MSG_ERROR([PE cross-compilation is required for ARM64, please install clang/llvm-dlltool/lld, or llvm-mingw.]) DLLEXT="" -else - WINE_NOTICE_WITH(mingw,[test "x$PE_ARCHS" = "x"], - [MinGW compiler not found, cross-compiling PE files won't be supported.]) fi
dnl **** External libraries ****