]> git.lizzy.rs Git - rust.git/commitdiff
configure: Recognize i686 build on msys2
authorklutzy <klutzytheklutzy@gmail.com>
Fri, 22 Aug 2014 16:45:15 +0000 (01:45 +0900)
committerklutzy <klutzytheklutzy@gmail.com>
Fri, 22 Aug 2014 16:47:37 +0000 (01:47 +0900)
README.md
configure

index 1da02fea018784f8a1cb4dc9acb7ba153f824372..e919f3329fe2a4725976b4147cd4790455dec204 100644 (file)
--- a/README.md
+++ b/README.md
@@ -71,7 +71,7 @@ To easily build on windows we can use [MSYS2](http://sourceforge.net/projects/ms
 3. With that now start `mingw32_shell.bat` from where you installed MSYS2 (i.e. `C:\msys`).
 4. From there just navigate to where you have Rust's source code, configure and build it:
 
-        $ ./configure --build=i686-pc-mingw32
+        $ ./configure
         $ make && make install
 
 [repo]: https://github.com/rust-lang/rust
index 636d50276ff543baf97facc4896ec0100d6d6a1e..bb874809d8ee24ba596e495a3ab9d9d3ccdac1f2 100755 (executable)
--- a/configure
+++ b/configure
@@ -299,13 +299,19 @@ case $CFG_OSTYPE in
         CFG_OSTYPE=apple-darwin
         ;;
 
-    MINGW32*)
+    MINGW*)
+        # msys' `uname` does not print gcc configuration, but prints msys
+        # configuration. so we cannot believe `uname -m`:
+        # msys1 is always i686 and msys2 is always x86_64.
+        # instead, msys defines $MSYSTEM which is MINGW32 on i686 and
+        # MINGW64 on x86_64.
+        CFG_CPUTYPE=i686
         CFG_OSTYPE=pc-mingw32
-        ;;
-
-    MINGW64*)
-        # msys2, MSYSTEM=MINGW64
-        CFG_OSTYPE=w64-mingw32
+        if [ "$MSYSTEM" = MINGW64 ]
+        then
+            CFG_CPUTYPE=x86_64
+            CFG_OSTYPE=w64-mingw32
+        fi
         ;;
 
 # Thad's Cygwin identifers below