diff --git a/src/build/Common.gmake b/src/build/Common.gmake index c145c4c0262169d7ed874320ba660d6663592321..29ae1ca3b4b8da19f699d61a91574f6498b287fb 100644 --- a/src/build/Common.gmake +++ b/src/build/Common.gmake @@ -196,8 +196,13 @@ ifndef os endif os := $(shell echo $(os) | tr '[A-Z]' '[a-z]' | tr ' ' '_') -machine := $(shell if uname -m | egrep -v "(i[3456789]*|x)86" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; fi) -machine := $(shell if uname -m | egrep "64" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; else echo $(machine) ; fi) +ifeq ($(os),darwin) + machine := $(shell ld -w 2>&1 | sed -E 's/.*[[:space:]]//') +else + machine := $(shell if uname -m | egrep -v "(i[3456789]*|x)86" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; fi) + machine := $(shell if uname -m | egrep "64" > /dev/null; then uname -m | tr "[A-Z]" "[a-z]" | tr " " "_" ; else echo $(machine) ; fi) +endif + ifeq ($(machine),x86_64) machine := x64 endif