|
@@ -1,8 +1,7 @@
|
|
|
package("libtool")
|
|
|
- set_kind("binary")
|
|
|
set_homepage("https://www.gnu.org/software/libtool/")
|
|
|
set_description("A generic library support script.")
|
|
|
-
|
|
|
+ set_kind("binary")
|
|
|
add_urls("http://ftpmirror.gnu.org/libtool/libtool-$(version).tar.gz",
|
|
|
"https://mirrors.ustc.edu.cn/gnu/libtool/libtool-$(version).tar.gz",
|
|
|
"git://git.savannah.gnu.org/libtool.git")
|
|
@@ -11,6 +10,16 @@ package("libtool")
|
|
|
add_versions("2.4.5", "509cb49c7de14ce7eaf88993cf09fd4071882699dfd874c2e95b31ab107d6987")
|
|
|
add_versions("2.4.7", "04e96c2404ea70c590c546eba4202a4e12722c640016c12b9b2f1ce3d481e9a8")
|
|
|
|
|
|
+ on_load(function (package)
|
|
|
+ if package:is_library() then
|
|
|
+ package:addenv("PATH", "bin")
|
|
|
+ end
|
|
|
+ end)
|
|
|
+
|
|
|
+ if is_plat("linux") then
|
|
|
+ add_syslinks("dl")
|
|
|
+ end
|
|
|
+
|
|
|
if is_host("linux") then
|
|
|
add_extsources("apt::libtool", "pacman::libtool")
|
|
|
elseif is_host("macosx") then
|
|
@@ -20,7 +29,10 @@ package("libtool")
|
|
|
add_deps("autoconf")
|
|
|
|
|
|
on_install("@macosx", "@linux", "@bsd", function (package)
|
|
|
- import("package.tools.autoconf").install(package, {"--disable-dependency-tracking", "--enable-ltdl-install"})
|
|
|
+ local configs = {"--disable-dependency-tracking", "--enable-ltdl-install"}
|
|
|
+ table.insert(configs, "--enable-shared=" .. (package:config("shared") and "yes" or "no"))
|
|
|
+ table.insert(configs, "--enable-static=" .. (package:config("shared") and "no" or "yes"))
|
|
|
+ import("package.tools.autoconf").install(package, configs)
|
|
|
if package:is_plat("macosx") then
|
|
|
local bindir = package:installdir("bin")
|
|
|
os.ln(path.join(bindir, "libtoolize"), path.join(bindir, "glibtoolize"))
|
|
@@ -28,5 +40,9 @@ package("libtool")
|
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|
|
|
- os.vrun("libtool --version")
|
|
|
+ if not package:is_binary() then
|
|
|
+ assert(package:has_cfuncs("lt_dlopen", {includes = "ltdl.h"}))
|
|
|
+ else
|
|
|
+ os.vrun("libtool --version")
|
|
|
+ end
|
|
|
end)
|