Commit 6b5143bc authored by nanahira's avatar nanahira

fix digits

parent 0522a080
......@@ -109,6 +109,6 @@ project "YGOPro"
links { "IrrKlang" }
linkoptions{ IRRKLANG_LINK_RPATH }
end
if GLIBC_VERSION < 546 then -- glibc less than 2.34
if GLIBC_VERSION < ((2 << 16) | (34 << 8)) then -- glibc less than 2.34
links { "dl", "pthread" }
end
......@@ -260,20 +260,23 @@ end
function getGlibcVersion()
local output = os.outputof("getconf GNU_LIBC_VERSION")
local major, minor = output:match("glibc (%d+)%.(%d+)")
local major, minor, patch = output:match("glibc (%d+)%.(%d+)%.?(%d*)")
if major and minor then
major = tonumber(major)
minor = tonumber(minor)
return (major << 8) | minor
patch = tonumber(patch) or 0
return (major << 16) | (minor << 8) | patch
end
return 0
return nil
end
GLIBC_VERSION=0
if os.ishost("linux") then
GLIBC_VERSION = getGlibcVersion()
if GLIBC_VERSION>0 then
print("Detected glibc version: " .. string.format("%d.%d", GLIBC_VERSION >> 8, GLIBC_VERSION & 0xFF))
print("Detected glibc version: " .. string.format("%d.%d.%d", GLIBC_VERSION >> 16, (GLIBC_VERSION >> 8) & 0xFF, GLIBC_VERSION & 0xFF))
else
print("Could not detect glibc version, assuming it is sufficient.")
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment