summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2020-08-18 13:55:39 -0700
committerMichael Forney <mforney@mforney.org>2020-08-19 12:43:47 -0700
commit9e23813adc6441b605eb8164f5580edcc7ddba2e (patch)
tree175c93e06543297c34506b23f69b6974aeb59f7c /pkg
parentfc47c7322d7e43e47df41c7e8c5ad955a60e278b (diff)
ffmpeg: Detect library dependencies from options.h
Diffstat (limited to 'pkg')
-rw-r--r--pkg/ffmpeg/gen.lua26
1 files changed, 18 insertions, 8 deletions
diff --git a/pkg/ffmpeg/gen.lua b/pkg/ffmpeg/gen.lua
index 1ba19328..72370562 100644
--- a/pkg/ffmpeg/gen.lua
+++ b/pkg/ffmpeg/gen.lua
@@ -7,9 +7,6 @@ cflags{
'-I $outdir/include',
'-I $outdir/internal',
'-I $srcdir',
- '-isystem $builddir/pkg/alsa-lib/include',
- '-isystem $builddir/pkg/libtls-bearssl/include',
- '-isystem $builddir/pkg/zlib/include',
}
nasmflags{
'-i $srcdir/',
@@ -31,9 +28,6 @@ pkg.hdrs = {
pkg.deps = {
'$outdir/config.asm',
'$gendir/headers',
- 'pkg/alsa-lib/headers',
- 'pkg/libtls-bearssl/headers',
- 'pkg/zlib/headers',
}
build('awk', '$outdir/config.asm', '$dir/options.h', {
@@ -104,12 +98,30 @@ for lib, srcs in pairs(sources) do
sources[lib] = table.keys(srcs)
end
+if options.CONFIG_ALSA_INDEV or options.config_ALSA_OUTDEV then
+ cflags{'-isystem $builddir/pkg/alsa-lib/include'}
+ table.insert(pkg.deps, 'pkg/alsa-lib/headers')
+ table.insert(sources.libavdevice, '$builddir/pkg/alsa-lib/libasound.a')
+end
+
+if options.CONFIG_TLS_PROTOCOL and options.CONFIG_LIBTLS then
+ cflags{'-isystem $builddir/pkg/libtls-bearssl/include'}
+ table.insert(pkg.deps, 'pkg/libtls-bearssl/headers')
+ table.insert(sources.libavformat, '$builddir/pkg/libtls-bearssl/libtls.a.d')
+end
+
if options.CONFIG_LIBOPUS_ENCODER or options.CONFIG_LIBOPUS_DECODER then
cflags{'-isystem $builddir/pkg/opus/include'}
table.insert(pkg.deps, 'pkg/opus/headers')
table.insert(sources.libavcodec, '$builddir/pkg/opus/libopus.a')
end
+if options.CONFIG_ZLIB then
+ cflags{'-isystem $builddir/pkg/zlib/include'}
+ table.insert(pkg.deps, 'pkg/zlib/headers')
+ table.insert(sources.libavformat, '$builddir/pkg/zlib/libz.a')
+end
+
lib('libavcodec.a', {
expand{'libavcodec/', {
'ac3_parser.c',
@@ -208,8 +220,6 @@ lib('libavformat.a', {
sources.libavformat,
'libavcodec.a.d',
'libavutil.a',
- '$builddir/pkg/libtls-bearssl/libtls.a.d',
- '$builddir/pkg/zlib/libz.a',
})
lib('libavutil.a', {