From 2d4b3d58c671ec0c58a381b2ebe9e2f3aad55556 Mon Sep 17 00:00:00 2001 From: noloader Date: Thu, 9 Jul 2015 06:11:28 +0000 Subject: Fixed multiarch detection on OS X git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@576 57ff6487-cd31-0410-9ec3-f628ee90f5f0 --- GNUmakefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'GNUmakefile') diff --git a/GNUmakefile b/GNUmakefile index f1cdc88..ca36725 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,6 @@ CXXFLAGS ?= -DNDEBUG SYMBOLS ?= -g2 -OPTIMIZE ?= -O3 +OPTIMIZE ?= -O2 # -fPIC is supported, and enabled by default for x86_64. # the following options reduce code size, but breaks link or makes link very slow on some systems # CXXFLAGS += -ffunction-sections -fdata-sections @@ -41,6 +41,7 @@ endif endif # End Cygwin work arounds +# Merge symbols and optimizations CXXFLAGS += $(SYMBOLS) $(OPTIMIZE) ifeq ($(IS_X86),1) @@ -60,13 +61,15 @@ CXXFLAGS += -fPIC endif endif -ifneq ($(GCC42_OR_LATER),0) -ifneq ($(IS_DARWIN),0) +# We can do integer math using the Posix shell in a GNUmakefile +# Below, we are building a boolean circuit that says "Darwin && (GCC 4.2 || Clang)" +MULTIARCH_SUPPORT = $(shell echo $$(($(IS_DARWIN) * ($(GCC42_OR_LATER) + $(CLANG_COMPILER))))) + +ifneq ($(MULTIARCH_SUPPORT),0) CXXFLAGS += -arch x86_64 -arch i386 else CXXFLAGS += -march=native endif -endif ifneq ($(INTEL_COMPILER),0) CXXFLAGS += -wd68 -wd186 -wd279 -wd327 -- cgit v1.2.1