medfall

A super great game engine
Log | Files | Refs

commit f4d1f5b0044179b63ef45587b76ad1f772ff1326
parent bb428975a4e248145cae40b6e11bb93d656c5564
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Jun 25 14:04:33 +0300

Detect more than just Windows and Linux

Diffstat:
scripts/gen_makefile.lua | 17++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/scripts/gen_makefile.lua b/scripts/gen_makefile.lua @@ -62,9 +62,24 @@ local function identify_host() return "windows", "32" end - if dll_ext == "so" then + local p = assert( io.popen( "uname -s" ) ) + local uname = assert( p:read( "*all" ) ):gsub( "%s*$", "" ) + assert( p:close() ) + + if uname == "Linux" then return "linux", "64" end + + if uname == "Darwin" then + return "macos", "64" + end + + if uname == "OpenBSD" then + return "openbsd", "64" + end + + io.stderr:write( "can't identify host OS" ) + os.exit( 1 ) end OS, arch = identify_host()