Alexandre Julliard : configure: Add --with-mingw option and print a notice when not found.

Alexandre Julliard julliard at winehq.org
Thu Apr 4 15:38:07 CDT 2019


Module: wine
Branch: master
Commit: a3cf86a18446e9d7df4e045b83d3aa3d9193512a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=a3cf86a18446e9d7df4e045b83d3aa3d9193512a

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Apr  4 11:13:17 2019 +0200

configure: Add --with-mingw option and print a notice when not found.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure    | 27 ++++++++++++++++++++++++---
 configure.ac | 11 +++++++++--
 2 files changed, 33 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index e1d666c..c7ce13c 100755
--- a/configure
+++ b/configure
@@ -853,6 +853,7 @@ with_hal
 with_jpeg
 with_krb5
 with_ldap
+with_mingw
 with_mpg123
 with_netapi
 with_openal
@@ -2522,6 +2523,7 @@ Optional Packages:
   --without-jpeg          do not use JPEG
   --without-krb5          do not use krb5 (Kerberos)
   --without-ldap          do not use LDAP
+  --without-mingw         do not use the MinGW cross-compiler
   --without-mpg123        do not use the mpg123 library
   --without-netapi        do not use the Samba NetAPI library
   --without-openal        do not use OpenAL
@@ -3945,6 +3947,12 @@ if test "${with_ldap+set}" = set; then :
 fi
 
 
+# Check whether --with-mingw was given.
+if test "${with_mingw+set}" = set; then :
+  withval=$with_mingw;
+fi
+
+
 # Check whether --with-mpg123 was given.
 if test "${with_mpg123+set}" = set; then :
   withval=$with_mpg123;
@@ -5504,6 +5512,7 @@ case $host in
     ;;
   *-mingw32*|*-cygwin*)
     enable_win16=${enable_win16:-no}
+    with_mingw=${with_mingw:-no}
     CFLAGS="$CFLAGS -D_WIN32"
     ;;
 esac
@@ -9592,9 +9601,10 @@ test "$ac_cv_header_linux_joystick_h" = "yes" -o "$ac_cv_header_IOKit_hid_IOHIDL
 
 CROSSTARGET=""
 
-if test "x$enable_tests" != xno -a "$LIBEXT" != "dll"
+if test "x$with_mingw" != xno
 then
-    case "$host_cpu" in
+    case "x$with_mingw" in
+      x|xyes) case "$host_cpu" in
   aarch64*)
     ac_prefix_list="aarch64-w64-mingw32-clang aarch64-w64-mingw32-gcc" ;;
   arm*)
@@ -9651,7 +9661,9 @@ fi
   test -n "$CROSSCC" && break
 done
 test -n "$CROSSCC" || CROSSCC="false"
-
+ ;;
+      *) CROSSCC=$with_mingw ;;
+    esac
     if test "$CROSSCC" != "false"
     then
         ac_save_CC="$CC"
@@ -9692,6 +9704,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
     fi
 fi
+if test "x$CROSSTARGET" = "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
 
 
 if test "$ac_cv_header_pthread_h" = "yes"
diff --git a/configure.ac b/configure.ac
index 4fa77dc..233fabd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -61,6 +61,7 @@ AC_ARG_WITH(jpeg,      AS_HELP_STRING([--without-jpeg],[do not use JPEG]))
 AC_ARG_WITH(krb5,      AS_HELP_STRING([--without-krb5],[do not use krb5 (Kerberos)]))
 AC_ARG_WITH(ldap,      AS_HELP_STRING([--without-ldap],[do not use LDAP]),
             [if test "x$withval" = "xno"; then ac_cv_header_ldap_h=no; ac_cv_header_lber_h=no; fi])
+AC_ARG_WITH(mingw,     AS_HELP_STRING([--without-mingw],[do not use the MinGW cross-compiler]))
 AC_ARG_WITH(mpg123,    AS_HELP_STRING([--without-mpg123],[do not use the mpg123 library]))
 AC_ARG_WITH(netapi,    AS_HELP_STRING([--without-netapi],[do not use the Samba NetAPI library]))
 AC_ARG_WITH(openal,    AS_HELP_STRING([--without-openal],[do not use OpenAL]),
@@ -140,6 +141,7 @@ case $host in
     ;;
   *-mingw32*|*-cygwin*)
     enable_win16=${enable_win16:-no}
+    with_mingw=${with_mingw:-no}
     CFLAGS="$CFLAGS -D_WIN32"
     ;;
 esac
@@ -991,9 +993,12 @@ test "$ac_cv_header_linux_joystick_h" = "yes" -o "$ac_cv_header_IOKit_hid_IOHIDL
 
 dnl Check for cross compiler to build test programs
 AC_SUBST(CROSSTARGET,"")
-if test "x$enable_tests" != xno -a "$LIBEXT" != "dll"
+if test "x$with_mingw" != xno
 then
-    WINE_CHECK_MINGW_PROG(CROSSCC,false)
+    case "x$with_mingw" in
+      x|xyes) WINE_CHECK_MINGW_PROG(CROSSCC,false) ;;
+      *) CROSSCC=$with_mingw ;;
+    esac
     if test "$CROSSCC" != "false"
     then
         ac_save_CC="$CC"
@@ -1016,6 +1021,8 @@ then
         AC_SUBST(CROSSCFLAGS,${CROSSCFLAGS:-$CFLAGS})
     fi
 fi
+WINE_NOTICE_WITH(mingw,[test "x$CROSSTARGET" = "x"],
+                 [MinGW compiler not found, cross-compiling PE files won't be supported.])
 
 dnl **** Check for pthread ****
 




More information about the wine-cvs mailing list