Revert "Fix compiling of 32 bit binary on 64-bit Windows"
authorMarco Costalba <mcostalba@gmail.com>
Wed, 23 Dec 2015 08:37:59 +0000 (09:37 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 23 Dec 2015 08:41:56 +0000 (09:41 +0100)
This reverts commit 1e8836d921b3

Broken compile on mingw under Windows:

Config:
debug: 'yes'
optimize: 'yes'
arch: 'i386'
bits: '32'
prefetch: 'yes'
bsfq: 'no'
popcnt: 'no'
sse: 'yes'
pext: 'no'

Flags:
CXX: i686-w64-mingw32-c++
CXXFLAGS: -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11  -Wextra -Wshadow -g -O3 -msse
LDFLAGS:  -static

Testing config sanity. If this fails, try 'make help' ...

mingw32-make[1]: Leaving directory 'C:/stockfish/src'
c:/MinGw/bin/mingw32-make ARCH=x86-32 COMP=mingw all
mingw32-make[1]: Entering directory 'C:/stockfish/src'
sh: C:\Program: No such file or directory
i686-w64-mingw32-c++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11  -Wextra -Wshadow -g -O3 -msse   -c -o benchmark.o benchmark.cpp
<builtin>: recipe for target 'benchmark.o' failed
process_begin: CreateProcess(NULL, i686-w64-mingw32-c++ -Wall -Wcast-qual -fno-exceptions -fno-rtti -std=c++11 -Wextra -Wshadow -g -O3 -msse -c -o benchmark.o benchmark.cpp, ...) failed.
make (e=2): Impossibile trovare il file specificato.

mingw32-make[1]: *** [benchmark.o] Error 2
mingw32-make[1]: Leaving directory 'C:/stockfish/src'
makefile:401: recipe for target 'build' failed
mingw32-make: *** [build] Error 2

No functional change.

src/Makefile

index ee09dc7..4e4d3d9 100644 (file)
@@ -160,18 +160,22 @@ endif
 ifeq ($(COMP),mingw)
        comp=mingw
 
-       ifeq ($(bits),64)
-               ifeq ($(shell which x86_64-w64-mingw32-c++-posix),)
-                       CXX=x86_64-w64-mingw32-c++
+       ifeq ($(UNAME),Linux)
+               ifeq ($(bits),64)
+                       ifeq ($(shell which x86_64-w64-mingw32-c++-posix),)
+                               CXX=x86_64-w64-mingw32-c++
+                       else
+                               CXX=x86_64-w64-mingw32-c++-posix
+                       endif
                else
-                       CXX=x86_64-w64-mingw32-c++-posix
+                       ifeq ($(shell which i686-w64-mingw32-c++-posix),)
+                               CXX=i686-w64-mingw32-c++
+                       else
+                               CXX=i686-w64-mingw32-c++-posix
+                       endif
                endif
        else
-               ifeq ($(shell which i686-w64-mingw32-c++-posix),)
-                       CXX=i686-w64-mingw32-c++
-               else
-                       CXX=i686-w64-mingw32-c++-posix
-               endif
+               CXX=g++
        endif
 
        CXXFLAGS += -Wextra -Wshadow