ffmpeg: Add support for pic compilation (#1211)

* ffmpeg: Add support for pic compilation

* Update xmake.lua

Co-authored-by: ruki <waruqi@gmail.com>
pull/1220/head
Jérôme Leclercq 3 years ago committed by GitHub
parent d685411453
commit 3bd3e0a03f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      packages/f/ffmpeg/xmake.lua
  2. 3
      packages/x/x264/xmake.lua

@ -56,6 +56,11 @@ package("ffmpeg")
package:add("deps", dep)
end
end
-- https://www.ffmpeg.org/platform.html#toc-Advanced-linking-configuration
if package:config("pic") ~= false then
package:add("shflags", "-Wl,-Bsymbolic")
package:add("ldflags", "-Wl,-Bsymbolic")
end
end)
on_install("windows|x64", "mingw|x86_64", function (package)
@ -86,6 +91,9 @@ package("ffmpeg")
else
table.insert(configs, "--disable-debug")
end
if package:config("pic") ~= false then
table.insert(configs, "--enable-pic")
end
if package:is_plat("android") then
import("core.base.option")
import("core.tool.toolchain")

@ -8,12 +8,13 @@ package("x264")
add_versions("v2018.09.25", "545de2ffec6ae9a80738de1b2c8cf820249a2530")
add_deps("nasm")
add_configs("toolchains", {readonly = true, description = "Set package toolchains only for cross-compilation."})
add_syslinks("pthread", "dl")
on_install("linux", "macosx", function (package)
local configs = {"--disable-avs", "--disable-lsmash", "--disable-lavf", "--disable-bashcompletion"}
table.insert(configs, "--enable-" .. (package:configs("shared") and "shared" or "static"))
if package:config("pic") then
if package:config("pic") ~= false then
table.insert(configs, "--enable-pic")
end
import("package.tools.autoconf").install(package, configs)

Loading…
Cancel
Save