From f8291646e548a6c9ee452c5e6d05e1e18e067c55 Mon Sep 17 00:00:00 2001 From: Doekin Date: Wed, 9 Oct 2024 23:41:57 +0800 Subject: [PATCH] Get aclocal path by running command --- packages/z/zbar/xmake.lua | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/packages/z/zbar/xmake.lua b/packages/z/zbar/xmake.lua index 7837f15f4b6..afa82b7339d 100644 --- a/packages/z/zbar/xmake.lua +++ b/packages/z/zbar/xmake.lua @@ -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