From 2873be2d7a473a2062e63385bd50a63a26f9106d Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 17 Apr 2012 08:45:52 -0700 Subject: [PATCH] Fixed makefile to work for various different gcc versions on OSX (from Craig Berry) --- makefile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/makefile b/makefile index e10f058a..17ada04f 100644 --- a/makefile +++ b/makefile @@ -80,6 +80,10 @@ ifeq ($(WIN32),) #*nix Environments (&& cygwin) ifeq (Darwin,$(OSTYPE)) OSNAME = OSX LIBEXT = dylib + # OSX's XCode gcc doesn't support LTO, but gcc built to explicitly enable it will work + ifeq (,$(shell $(GCC) -v /dev/null 2>&1 | grep '--enable-lto')) + LTO_EXCLUDE_VERSIONS += $(GCC_VERSION) + endif else ifeq (Linux,$(OSTYPE)) LIBPATH := $(sort $(foreach lib,$(shell /sbin/ldconfig -p | grep ' => /' | sed 's/^.* => //'),$(dir $(lib))))