Skip to content

Commit

Permalink
Get aclocal path by running command
Browse files Browse the repository at this point in the history
  • Loading branch information
Doekin committed Oct 9, 2024
1 parent 4e18b43 commit f829164
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions packages/z/zbar/xmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -41,27 +41,22 @@ package("zbar")

local cflags = {}
local ldflags = {}
for _, name in ipairs({"libiconv","pthread"}) do
local dep = package:dep(name)
if dep then
local depinfo = dep:fetch()
if depinfo then
for _, includedir in ipairs(depinfo.includedirs or depinfo.sysincludedirs) do
table.insert(cflags, "-I" .. includedir)
end
for _, linkdir in ipairs(depinfo.linkdirs) do
table.insert(ldflags, "-L" .. linkdir)
end
for _, link in ipairs(depinfo.links) do
table.insert(ldflags, "-l" .. link)
end
end
local depinfo = package:dep("libiconv"):fetch()
if depinfo then
for _, includedir in ipairs(depinfo.includedirs or depinfo.sysincludedirs) do
table.insert(cflags, "-I" .. includedir)
end
for _, linkdir in ipairs(depinfo.linkdirs) do
table.insert(ldflags, "-L" .. linkdir)
end
for _, link in ipairs(depinfo.links) do
table.insert(ldflags, "-l" .. link)
end
end

local libtool = package:dep("libtool")
if libtool then
os.vrun("autoreconf --force --install -I" .. libtool:installdir("share", "aclocal"))
local aclocal_dir = os.iorun("aclocal --print-ac-dir")
if aclocal_dir then
os.vrun("autoreconf --force --install -I" .. aclocal_dir)
else
os.vrun("autoreconf --force --install")
end
Expand Down

0 comments on commit f829164

Please sign in to comment.