]> git.sesse.net Git - stockfish/blobdiff - src/Makefile
Link with -static in mingw
[stockfish] / src / Makefile
index 8622be3206291abd014304d14007049e762bbcd2..efca3947ee95aaf762f495fc470ec7d5221f11a4 100644 (file)
@@ -151,14 +151,18 @@ ifeq ($(COMP),gcc)
        comp=gcc
        CXX=g++
        CXXFLAGS += -pedantic -Wno-long-long -Wextra -Wshadow
-       LDFLAGS += -Wl,--no-as-needed
+       ifneq ($(UNAME),Darwin)
+          LDFLAGS += -Wl,--no-as-needed
+       else
+          LDFLAGS += -Wl
+       endif
 endif
 
 ifeq ($(COMP),mingw)
        comp=mingw
        CXX=g++
        CXXFLAGS += -Wextra -Wshadow
-       LDFLAGS += -static-libstdc++ -static-libgcc
+       LDFLAGS += -static
 endif
 
 ifeq ($(COMP),icc)
@@ -189,8 +193,8 @@ else
 endif
 
 ifeq ($(UNAME),Darwin)
-       CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.10
-       LDFLAGS += -arch $(arch) -mmacosx-version-min=10.10
+       CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.9
+       LDFLAGS += -arch $(arch) -mmacosx-version-min=10.9
 endif
 
 ### On mingw use Windows threads, otherwise POSIX
@@ -304,12 +308,8 @@ endif
 ifeq ($(comp),gcc)
        ifeq ($(optimize),yes)
        ifeq ($(debug),no)
-               GCC_MAJOR := `$(CXX) -dumpversion | cut -f1 -d.`
-               GCC_MINOR := `$(CXX) -dumpversion | cut -f2 -d.`
-               ifeq (1,$(shell expr \( $(GCC_MAJOR) \> 4 \) \| \( $(GCC_MAJOR) \= 4 \& $(GCC_MINOR) \>= 5 \)))
-                       CXXFLAGS += -flto
-                       LDFLAGS += $(CXXFLAGS)
-               endif
+               CXXFLAGS += -flto
+               LDFLAGS += $(CXXFLAGS)
        endif
        endif
 endif