improve pcre

pull/13/head
ruki 6 years ago
parent 5176faa44a
commit ed89fcf3de
No known key found for this signature in database
GPG Key ID: 33341DF9719963FA
  1. 8
      packages/f/ffmpeg/xmake.lua
  2. 48
      packages/p/pcre/xmake.lua
  3. 2
      packages/p/python/xmake.lua
  4. 2
      packages/p/python2/xmake.lua
  5. 2
      packages/p/python3/xmake.lua

@ -22,14 +22,6 @@ package("ffmpeg")
"--enable-version3",
"--enable-hardcoded-tables",
"--enable-avresample"}
local cc = get_config("cc")
if cc then
table.insert(configs, "--cc=" .. cc)
end
local cflags = get_config("cflags")
if cflags then
table.insert(configs, "--host-cflags=" .. cflags)
end
if is_plat("macosx") and macos.version():ge("10.8") then
table.insert(configs, "--enable-videotoolbox")
end

@ -13,10 +13,54 @@ package("pcre")
add_deps("cmake")
end
add_configs("shared", {description = "Enable shared library.", default = false, type = "boolean"})
add_configs("jit", {description = "Enable jit.", default = true, type = "boolean"})
add_configs("bitwidth", {description = "Set the code unit width.", default = "8", values = {"8", "16", "32"}})
on_load(function (package)
local bitwidth = package:config("bitwidth") or "8"
package:add("links", "pcre" .. bitwidth)
if not package:config("shared") then
package:add("defines", "PCRE_STATIC")
end
end)
on_install("windows", function (package)
import("package.tools.cmake").install(package)
local configs = {}
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
table.insert(configs, "-DPCRE_SUPPORT_JIT=" .. (package:config("jit") and "ON" or "OFF"))
local bitwidth = package:config("bitwidth") or "8"
if bitwidth ~= "8" then
table.insert(configs, "-DPCRE_BUILD_PCRE8=OFF")
table.insert(configs, "-DPCRE_BUILD_PCRE" .. bitwidth .. "=ON")
end
if package:debug() then
table.insert(configs, "-DPCRE_DEBUG=ON")
end
import("package.tools.cmake").install(package, configs)
end)
on_install("macosx", "linux", function (package)
import("package.tools.autoconf").install(package, {"--enable-jit"})
local configs = {}
if package:config("shared") then
table.insert(configs, "--enable-shared")
end
if package:config("jit") then
table.insert(configs, "--enable-jit")
end
local bitwidth = package:config("bitwidth") or "8"
if bitwidth ~= "8" then
table.insert(configs, "--disable-pcre8")
table.insert(configs, "--enable-pcre" .. bitwidth)
end
if package:debug() then
table.insert(configs, "--enable-debug")
end
import("package.tools.autoconf").install(package, configs)
end)
on_test(function (package)
local bitwidth = package:config("bitwidth") or "8"
local testfunc = string.format("pcre%s_compile", bitwidth ~= "8" and bitwidth or "")
assert(import("lib.detect.has_cfuncs")(testfunc, {configs = package:fetch(), includes = "pcre.h", links = package:get("links")}))
end)

@ -44,6 +44,6 @@ package("python")
end)
on_install("macosx", "linux", function (package)
import("package.tools.autoconf").install(package, {prefix = package:installdir("share", package:name(), package:version_str())})
import("package.tools.autoconf").install(package)
end)

@ -34,6 +34,6 @@ package("python2")
end)
on_install("macosx", "linux", function (package)
import("package.tools.autoconf").install(package, {prefix = package:installdir("share", package:name(), package:version_str())})
import("package.tools.autoconf").install(package)
end)

@ -32,6 +32,6 @@ package("python3")
end)
on_install("macosx", "linux", function (package)
import("package.tools.autoconf").install(package, {prefix = package:installdir("share", package:name(), package:version_str())})
import("package.tools.autoconf").install(package)
end)

Loading…
Cancel
Save