Commit 6b5143bc authored by nanahira's avatar nanahira

fix digits

parent 0522a080
...@@ -109,6 +109,6 @@ project "YGOPro" ...@@ -109,6 +109,6 @@ project "YGOPro"
links { "IrrKlang" } links { "IrrKlang" }
linkoptions{ IRRKLANG_LINK_RPATH } linkoptions{ IRRKLANG_LINK_RPATH }
end 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" } links { "dl", "pthread" }
end end
...@@ -260,20 +260,23 @@ end ...@@ -260,20 +260,23 @@ end
function getGlibcVersion() function getGlibcVersion()
local output = os.outputof("getconf GNU_LIBC_VERSION") 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 if major and minor then
major = tonumber(major) major = tonumber(major)
minor = tonumber(minor) minor = tonumber(minor)
return (major << 8) | minor patch = tonumber(patch) or 0
return (major << 16) | (minor << 8) | patch
end end
return 0
return nil
end end
GLIBC_VERSION=0 GLIBC_VERSION=0
if os.ishost("linux") then if os.ishost("linux") then
GLIBC_VERSION = getGlibcVersion() GLIBC_VERSION = getGlibcVersion()
if GLIBC_VERSION>0 then 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 else
print("Could not detect glibc version, assuming it is sufficient.") print("Could not detect glibc version, assuming it is sufficient.")
end 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