Add arch defines for Linux alpha and mips64el.

Add detection for Linux architectures alpha and mips64el, to avoid
using gcc -m64, which isn't available on them.
This commit is contained in:
Jordi Mallach 2016-07-14 01:01:04 +02:00
parent 62f2777ce2
commit 0e5db039d8
2 changed files with 23 additions and 0 deletions

View File

@ -140,6 +140,12 @@ endif
ifneq ($(filter %86,$(UNAME_P)),)
PLATFORM := x86
endif
ifneq ($(filter alpha,$(UNAME_M)),)
PLATFORM := alpha
endif
ifneq ($(filter alpha,$(UNAME_P)),)
PLATFORM := alpha
endif
ifneq ($(filter arm%,$(UNAME_M)),)
PLATFORM := arm
endif
@ -155,6 +161,11 @@ endif
ifneq ($(filter powerpc,$(UNAME_P)),)
PLATFORM := powerpc
endif
ifneq ($(filter mips64%,$(UNAME_M)),)
ifeq ($(shell getconf LONG_BIT),64)
PLATFORM := mips64
endif
endif
ifeq ($(firstword $(filter Linux,$(UNAME))),Linux)
OS := linux
endif

View File

@ -982,6 +982,12 @@ end
end
end
if (_OPTIONS["PLATFORM"]=="alpha") then
defines {
"PTR64=1",
}
end
if (_OPTIONS["PLATFORM"]=="arm") then
buildoptions {
"-Wno-cast-align",
@ -997,6 +1003,12 @@ if (_OPTIONS["PLATFORM"]=="arm64") then
}
end
if (_OPTIONS["PLATFORM"]=="mips64") then
defines {
"PTR64=1",
}
end
local subdir
if (_OPTIONS["target"] == _OPTIONS["subtarget"]) then
subdir = _OPTIONS["osd"] .. "/" .. _OPTIONS["target"]