Attempt to work around a gcc bug with -dumpmachine by using -print-multiarch with a second workaround. gcc sucks.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5157 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2017-10-25 09:43:01 +00:00
parent 8bb999f3ca
commit b8d0718b5c

View file

@ -531,7 +531,16 @@ ifeq ($(FTE_TARGET),vc)
ARCH?=i686-w64-mingw32
endif
else
ARCH?=$(shell $(CC) -dumpmachine)
#some idiot decided that -dumpmachine shouldn't respect -m32 etc.
#at the same time, -print-multiarch is not present, buggy, or just screwed in many gcc builds (ones that target a single arch will unhelpfully just give an empty string).
#so try multiarch first, and if that fails risk dumpmachine giving the wrong values.
#really we want dumpmachine's more specific cpu arch included here, so lets hope that idiot burns for all eternity. or something equally melodramatic.
ARCH:=$(shell $(CC) -print-multiarch)
ifneq ($(words $(ARCH)),1)
foo:=$(shell echo falling back on dumpmachine 1>&2 )
ARCH:=$(shell $(CC) -dumpmachine)
endif
foo:=$(shell echo ARCH is $(ARCH) 1>&2 )
endif
ARCHLIBS=$(NATIVE_ABSBASE_DIR)/libs-$(ARCH)