]> git.sesse.net Git - stockfish/blobdiff - src/Makefile
Improve compatibility with older versions of Mac OS X
[stockfish] / src / Makefile
index 3fd601ffe20c96cee61c94c1ab9ec5e2a8aa2078..fc6a4fae3fb81254460882a0d0b5e4709676b41e 100644 (file)
@@ -175,6 +175,7 @@ endif
 ifeq ($(COMP),mingw)
        comp=mingw
        CXX=g++
+       prefetch = yes
        profile_prepare = gcc-profile-prepare
        profile_make = gcc-profile-make
        profile_use = gcc-profile-use
@@ -184,6 +185,7 @@ endif
 ifeq ($(COMP),gcc)
        comp=gcc
        CXX=g++
+       prefetch = yes
        profile_prepare = gcc-profile-prepare
        profile_make = gcc-profile-make
        profile_use = gcc-profile-use
@@ -202,6 +204,7 @@ endif
 ifeq ($(COMP),clang)
        comp=clang
        CXX=clang++
+       prefetch = yes
        profile_prepare = gcc-profile-prepare
        profile_make = gcc-profile-make
        profile_use = gcc-profile-use
@@ -228,7 +231,7 @@ ifeq ($(comp),clang)
 endif
 
 ifeq ($(os),osx)
-       CXXFLAGS += -arch $(arch)
+       CXXFLAGS += -arch $(arch) -mmacosx-version-min=10.6
 endif
 
 ### 3.3 General linker settings
@@ -243,7 +246,7 @@ ifneq ($(comp),mingw)
 endif
 
 ifeq ($(os),osx)
-       LDFLAGS += -arch $(arch)
+       LDFLAGS += -arch $(arch) -mmacosx-version-min=10.6
 endif
 
 ### 3.4 Debugging
@@ -321,11 +324,13 @@ endif
 ### This is a mix of compile and link time options because the lto link phase
 ### needs access to the optimization flags.
 ifeq ($(comp),gcc)
-       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)
+       ifeq ($(optimize),yes)
+               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
        endif
 endif