forked from 0ad/0ad
Attempt to make build system's CPU architecture detection slightly less broken
This was SVN commit r7458.
This commit is contained in:
parent
d6ab843f9d
commit
701fcc18a6
@ -12,7 +12,7 @@ use_dcdt = false -- disable it since it's a non-Free library
|
|||||||
dofile("functions.lua")
|
dofile("functions.lua")
|
||||||
dofile("extern_libs.lua")
|
dofile("extern_libs.lua")
|
||||||
|
|
||||||
-- detect CPU architecture (simplistic, currently only supports x86 and amd64
|
-- detect CPU architecture (simplistic, currently only supports x86 and amd64)
|
||||||
arch = "x86"
|
arch = "x86"
|
||||||
if OS == "windows" then
|
if OS == "windows" then
|
||||||
if os.getenv("PROCESSOR_ARCHITECTURE") == "amd64" or os.getenv("PROCESSOR_ARCHITEW6432") == "amd64" then
|
if os.getenv("PROCESSOR_ARCHITECTURE") == "amd64" or os.getenv("PROCESSOR_ARCHITEW6432") == "amd64" then
|
||||||
@ -22,8 +22,7 @@ else
|
|||||||
arch = os.getenv("HOSTTYPE")
|
arch = os.getenv("HOSTTYPE")
|
||||||
if arch == "x86_64" then
|
if arch == "x86_64" then
|
||||||
arch = "amd64"
|
arch = "amd64"
|
||||||
end
|
else
|
||||||
if not arch then
|
|
||||||
os.execute("gcc -dumpmachine > .gccmachine.tmp")
|
os.execute("gcc -dumpmachine > .gccmachine.tmp")
|
||||||
local f = io.open(".gccmachine.tmp", "r")
|
local f = io.open(".gccmachine.tmp", "r")
|
||||||
local machine = f:read("*line")
|
local machine = f:read("*line")
|
||||||
|
@ -25,4 +25,7 @@ make -C src || die "Premake build failed"
|
|||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
|
# If we're in bash then make HOSTTYPE available to Premake, for primitive arch-detection
|
||||||
|
export HOSTTYPE="$HOSTTYPE"
|
||||||
|
|
||||||
src/bin/premake --outpath ../workspaces/gcc --atlas --collada "$@" --target gnu || die "Premake failed"
|
src/bin/premake --outpath ../workspaces/gcc --atlas --collada "$@" --target gnu || die "Premake failed"
|
||||||
|
Loading…
Reference in New Issue
Block a user