commit 8b4dd9e
chld
·
2026-08-22 20:59:27 +0000 UTC
parent d1d3dad
ffmpeg: disable vorbis; libass, mpv: init
12 files changed,
+382,
-8174
+4,
-0
1@@ -0,0 +1,4 @@
2+/freetype
3+/fontconfig
4+.muon
5+.nasm
+6,
-0
1@@ -0,0 +1,6 @@
2+name: libass
3+description: portable subtitle renderer for ASS/SSA
4+license: ISC
5+upstream: https://github.com/libass/libass/releases/download/0.17.4/libass-0.17.4.tar.gz
6+version: 0.17.4
7+maintainer:
+10,
-0
1@@ -0,0 +1,10 @@
2+#!/bin/sh -ue
3+NAME=libass
4+VERSION=0.17.4
5+RELEASE=1
6+SOURCE="https://github.com/libass/libass/releases/download/0.17.4/libass-0.17.4.tar.gz
7+ no-fribidi.patch"
8+BUILD_STYLE=meson
9+BUILD_OPT=""
10+
11+. ${0%/*}/../../libsh/libdmake.sh
+275,
-0
1@@ -0,0 +1,275 @@
2+diff --git a/libass/ass_render.h b/libass/ass_render.h
3+index 7a157ab..c8adf1d 100644
4+--- a/libass/ass_render.h
5++++ b/libass/ass_render.h
6+@@ -22,7 +22,6 @@
7+
8+ #include <inttypes.h>
9+ #include <stdbool.h>
10+-#include <fribidi.h>
11+ #include <ft2build.h>
12+ #include FT_FREETYPE_H
13+ #include FT_GLYPH_H
14+@@ -49,6 +48,8 @@
15+ #define PARSED_FADE (1<<0)
16+ #define PARSED_A (1<<1)
17+
18++typedef uint32_t FriBidiChar;
19++
20+ typedef struct {
21+ ASS_Image result;
22+ CompositeHashValue *source;
23+diff --git a/libass/ass_shaper.c b/libass/ass_shaper.c
24+index 86f2c66..e72a7d5 100644
25+--- a/libass/ass_shaper.c
26++++ b/libass/ass_shaper.c
27+@@ -87,8 +87,7 @@ struct ass_shaper_metrics_data {
28+ */
29+ void ass_shaper_info(ASS_Library *lib)
30+ {
31+- ass_msg(lib, MSGL_INFO, "Shaper: FriBidi "
32+- FRIBIDI_VERSION " (SIMPLE)"
33++ ass_msg(lib, MSGL_INFO, "Shaper: "
34+ " HarfBuzz-ng %s (COMPLEX)", hb_version_string()
35+ );
36+ }
37+@@ -705,8 +704,7 @@ static bool shape_harfbuzz(ASS_Shaper *shaper, GlyphInfo *glyphs, size_t len)
38+ lead_context, i - offset + 1);
39+ }
40+
41+- props.direction = FRIBIDI_LEVEL_IS_RTL(level) ?
42+- HB_DIRECTION_RTL : HB_DIRECTION_LTR;
43++ props.direction = HB_DIRECTION_LTR;
44+ props.script = glyphs[offset].script;
45+ props.language = hb_shaper_get_run_language(shaper, props.script);
46+ hb_buffer_set_segment_properties(buf, &props);
47+@@ -774,35 +772,6 @@ void ass_shaper_determine_script(ASS_Shaper *shaper, GlyphInfo *glyphs,
48+ }
49+ }
50+
51+-/**
52+- * \brief Shape event text with FriBidi. Does mirroring and simple
53+- * Arabic shaping.
54+- * \param len number of clusters
55+- */
56+-static void shape_fribidi(ASS_Shaper *shaper, GlyphInfo *glyphs, size_t len)
57+-{
58+- int i;
59+- FriBidiJoiningType *joins = calloc(len, sizeof(*joins));
60+-
61+- // shape on codepoint level
62+- fribidi_get_joining_types(shaper->event_text, len, joins);
63+- fribidi_join_arabic(shaper->ctypes, len, shaper->emblevels, joins);
64+- fribidi_shape(FRIBIDI_FLAGS_DEFAULT | FRIBIDI_FLAGS_ARABIC,
65+- shaper->emblevels, len, joins, shaper->event_text);
66+-
67+- // update indexes
68+- for (i = 0; i < len; i++) {
69+- GlyphInfo *info = glyphs + i;
70+- FT_Face face = info->font->faces[info->face_index];
71+- info->symbol = shaper->event_text[i];
72+- info->glyph_index = ass_font_index_magic(face, shaper->event_text[i]);
73+- if (info->glyph_index)
74+- info->glyph_index = FT_Get_Char_Index(face, info->glyph_index);
75+- }
76+-
77+- free(joins);
78+-}
79+-
80+ /**
81+ * \brief Toggle kerning for HarfBuzz shaping.
82+ * \param shaper shaper instance
83+@@ -895,7 +864,7 @@ void ass_shaper_set_base_direction(ASS_Shaper *shaper, FriBidiParType dir)
84+ shaper->base_direction = dir;
85+
86+ if (shaper->whole_text_layout != WHOLE_TEXT_LAYOUT_EXPLICIT)
87+- shaper->whole_text_layout = dir == FRIBIDI_PAR_ON ?
88++ shaper->whole_text_layout = dir == 0 ?
89+ WHOLE_TEXT_LAYOUT_IMPLICIT : WHOLE_TEXT_LAYOUT_OFF;
90+ }
91+
92+@@ -935,7 +904,7 @@ void ass_shaper_set_whole_text_layout(ASS_Shaper *shaper, bool enable)
93+ {
94+ shaper->whole_text_layout = enable ?
95+ WHOLE_TEXT_LAYOUT_EXPLICIT :
96+- shaper->base_direction == FRIBIDI_PAR_ON ?
97++ shaper->base_direction == 0 ?
98+ WHOLE_TEXT_LAYOUT_IMPLICIT : WHOLE_TEXT_LAYOUT_OFF;
99+ }
100+
101+@@ -946,8 +915,7 @@ void ass_shaper_set_whole_text_layout(ASS_Shaper *shaper, bool enable)
102+ */
103+ bool ass_shaper_shape(ASS_Shaper *shaper, TextInfo *text_info)
104+ {
105+- int i, ret, last_break;
106+- FriBidiParType dir, *pdir;
107++ int i;
108+ GlyphInfo *glyphs = text_info->glyphs;
109+ shaper->event_text = text_info->event_text;
110+
111+@@ -957,61 +925,7 @@ bool ass_shaper_shape(ASS_Shaper *shaper, TextInfo *text_info)
112+ for (i = 0; i < text_info->length; i++)
113+ shaper->event_text[i] = glyphs[i].symbol;
114+
115+- fribidi_get_bidi_types(shaper->event_text,
116+- text_info->length, shaper->ctypes);
117+-
118+- int n_pars = 1;
119+- for (i = 0; i < text_info->length - 1; i++)
120+- if (shaper->ctypes[i] == FRIBIDI_TYPE_BS)
121+- n_pars++;
122+-
123+- if (!check_par_allocations(shaper, n_pars))
124+- return false;
125+-
126+-#ifdef USE_FRIBIDI_EX_API
127+- if (shaper->bidi_brackets) {
128+- fribidi_get_bracket_types(shaper->event_text,
129+- text_info->length, shaper->ctypes, shaper->btypes);
130+- }
131+-#endif
132+-
133+- // Get bidi embedding levels
134+- last_break = 0;
135+- pdir = shaper->pbase_dir;
136+- for (i = 0; i < text_info->length; i++) {
137+- // Embedding levels must be calculated one bidi "paragraph" at a time
138+- if (i == text_info->length - 1 ||
139+- shaper->ctypes[i] == FRIBIDI_TYPE_BS ||
140+- (!shaper->whole_text_layout &&
141+- (glyphs[i + 1].starts_new_run || glyphs[i].hspacing))) {
142+- dir = shaper->base_direction;
143+-#ifdef USE_FRIBIDI_EX_API
144+- FriBidiBracketType *btypes = NULL;
145+- if (shaper->bidi_brackets)
146+- btypes = shaper->btypes + last_break;
147+- ret = fribidi_get_par_embedding_levels_ex(
148+- shaper->ctypes + last_break, btypes,
149+- i - last_break + 1, &dir, shaper->emblevels + last_break);
150+-#else
151+- ret = fribidi_get_par_embedding_levels(shaper->ctypes + last_break,
152+- i - last_break + 1, &dir, shaper->emblevels + last_break);
153+-#endif
154+- if (ret == 0)
155+- return false;
156+- last_break = i + 1;
157+- if (shaper->whole_text_layout)
158+- *pdir++ = dir;
159+- }
160+- }
161+-
162+- switch (shaper->shaping_level) {
163+- case ASS_SHAPING_SIMPLE:
164+- shape_fribidi(shaper, glyphs, text_info->length);
165+- return true;
166+- case ASS_SHAPING_COMPLEX:
167+- default:
168+- return shape_harfbuzz(shaper, glyphs, text_info->length);
169+- }
170++ return shape_harfbuzz(shaper, glyphs, text_info->length);
171+ }
172+
173+ /**
174+@@ -1025,7 +939,7 @@ ASS_Shaper *ass_shaper_new(Cache *metrics_cache, Cache *face_size_metrics_cache)
175+ if (!shaper)
176+ return NULL;
177+
178+- shaper->base_direction = FRIBIDI_PAR_ON;
179++ shaper->base_direction = 0;
180+
181+ if (!init_features(shaper))
182+ goto error;
183+@@ -1087,38 +1001,12 @@ void ass_shaper_cleanup(ASS_Shaper *shaper, TextInfo *text_info)
184+ */
185+ FriBidiStrIndex *ass_shaper_reorder(ASS_Shaper *shaper, TextInfo *text_info)
186+ {
187+- int i, ret;
188++ int i;
189+
190+ // Initialize reorder map
191+ for (i = 0; i < text_info->length; i++)
192+ shaper->cmap[i] = i;
193+
194+- // Create reorder map line-by-line or run-by-run
195+- int last_break = 0;
196+- FriBidiParType *pdir = shaper->whole_text_layout ?
197+- shaper->pbase_dir : &shaper->base_direction;
198+- GlyphInfo *glyphs = text_info->glyphs;
199+- for (i = 0; i < text_info->length; i++) {
200+- // Bidi "paragraph separators" may occur between line breaks:
201+- // U+001C..1E even with ASS_FEATURE_WRAP_UNICODE,
202+- // or U+000D, U+0085, U+2029 only without it
203+- if (i == text_info->length - 1 || glyphs[i + 1].linebreak ||
204+- shaper->ctypes[i] == FRIBIDI_TYPE_BS ||
205+- (!shaper->whole_text_layout &&
206+- (glyphs[i + 1].starts_new_run || glyphs[i].hspacing))) {
207+- ret = fribidi_reorder_line(0,
208+- shaper->ctypes, i - last_break + 1, last_break, *pdir,
209+- shaper->emblevels, NULL,
210+- shaper->cmap);
211+- if (ret == 0)
212+- return NULL;
213+-
214+- last_break = i + 1;
215+- if (shaper->whole_text_layout && shaper->ctypes[i] == FRIBIDI_TYPE_BS)
216+- pdir++;
217+- }
218+- }
219+-
220+ return shaper->cmap;
221+ }
222+
223+@@ -1136,10 +1024,5 @@ FriBidiStrIndex *ass_shaper_get_reorder_map(ASS_Shaper *shaper)
224+ */
225+ FriBidiParType ass_resolve_base_direction(int enc)
226+ {
227+- switch (enc) {
228+- case -1:
229+- return FRIBIDI_PAR_ON;
230+- default:
231+- return FRIBIDI_PAR_LTR;
232+- }
233++ return 0;
234+ }
235+diff --git a/libass/ass_shaper.h b/libass/ass_shaper.h
236+index 06f868d..333252b 100644
237+--- a/libass/ass_shaper.h
238++++ b/libass/ass_shaper.h
239+@@ -21,14 +21,15 @@
240+
241+ typedef struct ass_shaper ASS_Shaper;
242+
243+-#include <fribidi.h>
244+ #include <stdbool.h>
245+ #include "ass_render.h"
246+ #include "ass_cache.h"
247+
248+-#if FRIBIDI_MAJOR_VERSION >= 1
249+-#define USE_FRIBIDI_EX_API
250+-#endif
251++typedef uint32_t FriBidiChar;
252++typedef uint32_t FriBidiCharType;
253++typedef int FriBidiStrIndex;
254++typedef int FriBidiParType;
255++typedef signed char FriBidiLevel;
256+
257+ void ass_shaper_info(ASS_Library *lib);
258+ ASS_Shaper *ass_shaper_new(Cache *metrics_cache, Cache *face_size_metrics_cache);
259+diff --git a/meson.build b/meson.build
260+index 9eb7969..bc40a57 100644
261+--- a/meson.build
262++++ b/meson.build
263+@@ -87,12 +87,6 @@ deps += dependency(
264+ default_options: ['harfbuzz=disabled'],
265+ )
266+
267+-deps += dependency(
268+- 'fribidi',
269+- version: '>= 0.19.1',
270+- default_options: ['docs=false', 'tests=false'],
271+-)
272+-
273+ harfbuzz_options = [
274+ 'tests=disabled',
275+ 'cairo=disabled',
276+
+1,
-0
1@@ -0,0 +1 @@
2+.hell
+6,
-0
1@@ -0,0 +1,6 @@
2+name: libogg
3+description: reference implementation of the ogg codec
4+license: 3BSD
5+upstream: https://github.com/xiph/ogg/releases/download/v1.3.6/libogg-1.3.6.tar.gz
6+version: 1.3.6
7+maintainer:
+42,
-0
1@@ -0,0 +1,42 @@
2+#!/bin/sh -ue
3+NAME=libogg
4+VERSION=1.3.6
5+RELEASE=1
6+SOURCE="https://github.com/xiph/ogg/releases/download/v1.3.6/libogg-1.3.6.tar.gz"
7+BUILD_STYLE=hell
8+
9+build() {
10+ msg "generating with demiurge..."
11+ demiurge . || die "demiurge failed"
12+
13+ msg "generating ninja files with hell..."
14+ satan gen PREFIX="$PREFIX" DESTDIR="$PKG" . || die "satan gen failed"
15+
16+ msg "fixing config_types.h..."
17+ cat > include/ogg/config_types.h <<'EOF' || die "config_types.h patch failed"
18+#ifndef __CONFIG_TYPES_H__
19+#define __CONFIG_TYPES_H__
20+
21+#include <stdint.h>
22+
23+typedef int16_t ogg_int16_t;
24+typedef uint16_t ogg_uint16_t;
25+typedef int32_t ogg_int32_t;
26+typedef uint32_t ogg_uint32_t;
27+typedef int64_t ogg_int64_t;
28+typedef uint64_t ogg_uint64_t;
29+
30+#endif
31+EOF
32+
33+ msg "building libogg..."
34+ samu || die "samu build failed"
35+
36+ msg "installing libogg..."
37+ samu install || die "samu install failed"
38+
39+ mkdir -p $PKG$PREFIX/include/ogg
40+ cp include/ogg/config_types.h $PKG$PREFIX/include/ogg/
41+}
42+
43+. ${0%/*}/../../libsh/libdmake.sh
+0,
-8170
1@@ -1,8170 +0,0 @@
2-#!/bin/sh
3-#
4-# FFmpeg configure script
5-#
6-# Copyright (c) 2000-2002 Fabrice Bellard
7-# Copyright (c) 2005-2008 Diego Biurrun
8-# Copyright (c) 2005-2008 Mans Rullgard
9-#
10-
11-# Prevent locale nonsense from breaking basic text processing.
12-LC_ALL=C
13-export LC_ALL
14-
15-# make sure we are running under a compatible shell
16-# try to make this part work with most shells
17-
18-try_exec(){
19- echo "Trying shell $1"
20- type "$1" > /dev/null 2>&1 && exec "$@"
21-}
22-
23-unset foo
24-(: ${foo%%bar}) 2> /dev/null
25-E1="$?"
26-
27-(: ${foo?}) 2> /dev/null
28-E2="$?"
29-
30-if test "$E1" != 0 || test "$E2" = 0; then
31- echo "Broken shell detected. Trying alternatives."
32- export FF_CONF_EXEC
33- if test "0$FF_CONF_EXEC" -lt 1; then
34- FF_CONF_EXEC=1
35- try_exec bash "$0" "$@"
36- fi
37- if test "0$FF_CONF_EXEC" -lt 2; then
38- FF_CONF_EXEC=2
39- try_exec ksh "$0" "$@"
40- fi
41- if test "0$FF_CONF_EXEC" -lt 3; then
42- FF_CONF_EXEC=3
43- try_exec /usr/xpg4/bin/sh "$0" "$@"
44- fi
45- echo "No compatible shell script interpreter found."
46- echo "This configure script requires a POSIX-compatible shell"
47- echo "such as bash or ksh."
48- echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH."
49- echo "Instead, install a working POSIX-compatible shell."
50- echo "Disabling this configure test will create a broken FFmpeg."
51- if test "$BASH_VERSION" = '2.04.0(1)-release'; then
52- echo "This bash version ($BASH_VERSION) is broken on your platform."
53- echo "Upgrade to a later version if available."
54- fi
55- exit 1
56-fi
57-
58-test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
59-
60-show_help(){
61- cat <<EOF
62-Usage: configure [options]
63-Options: [defaults in brackets after descriptions]
64-
65-Help options:
66- --help print this message
67- --quiet Suppress showing informative output
68- --list-decoders show all available decoders
69- --list-encoders show all available encoders
70- --list-hwaccels show all available hardware accelerators
71- --list-demuxers show all available demuxers
72- --list-muxers show all available muxers
73- --list-parsers show all available parsers
74- --list-protocols show all available protocols
75- --list-bsfs show all available bitstream filters
76- --list-indevs show all available input devices
77- --list-outdevs show all available output devices
78- --list-filters show all available filters
79-
80-Standard options:
81- --logfile=FILE log tests and output to FILE [ffbuild/config.log]
82- --disable-logging do not log configure debug information
83- --fatal-warnings fail if any configure warning is generated
84- --prefix=PREFIX install in PREFIX [$prefix_default]
85- --bindir=DIR install binaries in DIR [PREFIX/bin]
86- --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]
87- --docdir=DIR install documentation in DIR [PREFIX/share/doc/ffmpeg]
88- --libdir=DIR install libs in DIR [PREFIX/lib]
89- --shlibdir=DIR install shared libs in DIR [LIBDIR]
90- --incdir=DIR install includes in DIR [PREFIX/include]
91- --mandir=DIR install man page in DIR [PREFIX/share/man]
92- --pkgconfigdir=DIR install pkg-config files in DIR [LIBDIR/pkgconfig]
93- --enable-rpath use rpath to allow installing libraries in paths
94- not part of the dynamic linker search path
95- use rpath when linking programs (USE WITH CARE)
96- --install-name-dir=DIR Darwin directory name for installed targets
97-
98-Licensing options:
99- --enable-gpl allow use of GPL code, the resulting libs
100- and binaries will be under GPL [no]
101- --enable-version3 upgrade (L)GPL to version 3 [no]
102- --enable-nonfree allow use of nonfree code, the resulting libs
103- and binaries will be unredistributable [no]
104-
105-Configuration options:
106- --disable-static do not build static libraries [no]
107- --enable-shared build shared libraries [no]
108- --enable-small optimize for size instead of speed
109- --disable-runtime-cpudetect disable detecting CPU capabilities at runtime (smaller binary)
110- --enable-gray enable full grayscale support (slower color)
111- --disable-swscale-alpha disable alpha channel support in swscale
112- --disable-all disable building components, libraries and programs
113- --disable-autodetect disable automatically detected external libraries [no]
114-
115-Program options:
116- --disable-programs do not build command line programs
117- --disable-ffmpeg disable ffmpeg build
118- --disable-ffplay disable ffplay build
119- --disable-ffprobe disable ffprobe build
120-
121-Documentation options:
122- --disable-doc do not build documentation
123- --disable-htmlpages do not build HTML documentation pages
124- --disable-manpages do not build man documentation pages
125- --disable-podpages do not build POD documentation pages
126- --disable-txtpages do not build text documentation pages
127-
128-Component options:
129- --disable-avdevice disable libavdevice build
130- --disable-avcodec disable libavcodec build
131- --disable-avformat disable libavformat build
132- --disable-swresample disable libswresample build
133- --disable-swscale disable libswscale build
134- --disable-postproc disable libpostproc build
135- --disable-avfilter disable libavfilter build
136- --disable-pthreads disable pthreads [autodetect]
137- --disable-w32threads disable Win32 threads [autodetect]
138- --disable-os2threads disable OS/2 threads [autodetect]
139- --disable-network disable network support [no]
140- --disable-dwt disable DWT code
141- --disable-error-resilience disable error resilience code
142- --disable-lsp disable LSP code
143- --disable-faan disable floating point AAN (I)DCT code
144- --disable-pixelutils disable pixel utils in libavutil
145-
146-Individual component options:
147- --disable-everything disable all components listed below
148- --disable-encoder=NAME disable encoder NAME
149- --enable-encoder=NAME enable encoder NAME
150- --disable-encoders disable all encoders
151- --disable-decoder=NAME disable decoder NAME
152- --enable-decoder=NAME enable decoder NAME
153- --disable-decoders disable all decoders
154- --disable-hwaccel=NAME disable hwaccel NAME
155- --enable-hwaccel=NAME enable hwaccel NAME
156- --disable-hwaccels disable all hwaccels
157- --disable-muxer=NAME disable muxer NAME
158- --enable-muxer=NAME enable muxer NAME
159- --disable-muxers disable all muxers
160- --disable-demuxer=NAME disable demuxer NAME
161- --enable-demuxer=NAME enable demuxer NAME
162- --disable-demuxers disable all demuxers
163- --enable-parser=NAME enable parser NAME
164- --disable-parser=NAME disable parser NAME
165- --disable-parsers disable all parsers
166- --enable-bsf=NAME enable bitstream filter NAME
167- --disable-bsf=NAME disable bitstream filter NAME
168- --disable-bsfs disable all bitstream filters
169- --enable-protocol=NAME enable protocol NAME
170- --disable-protocol=NAME disable protocol NAME
171- --disable-protocols disable all protocols
172- --enable-indev=NAME enable input device NAME
173- --disable-indev=NAME disable input device NAME
174- --disable-indevs disable input devices
175- --enable-outdev=NAME enable output device NAME
176- --disable-outdev=NAME disable output device NAME
177- --disable-outdevs disable output devices
178- --disable-devices disable all devices
179- --enable-filter=NAME enable filter NAME
180- --disable-filter=NAME disable filter NAME
181- --disable-filters disable all filters
182-
183-External library support:
184-
185- Using any of the following switches will allow FFmpeg to link to the
186- corresponding external library. All the components depending on that library
187- will become enabled, if all their other dependencies are met and they are not
188- explicitly disabled. E.g. --enable-libopus will enable linking to
189- libopus and allow the libopus encoder to be built, unless it is
190- specifically disabled with --disable-encoder=libopus.
191-
192- Note that only the system libraries are auto-detected. All the other external
193- libraries must be explicitly enabled.
194-
195- Also note that the following help text describes the purpose of the libraries
196- themselves, not all their features will necessarily be usable by FFmpeg.
197-
198- --disable-alsa disable ALSA support [autodetect]
199- --disable-appkit disable Apple AppKit framework [autodetect]
200- --disable-avfoundation disable Apple AVFoundation framework [autodetect]
201- --enable-avisynth enable reading of AviSynth script files [no]
202- --disable-bzlib disable bzlib [autodetect]
203- --disable-coreimage disable Apple CoreImage framework [autodetect]
204- --enable-chromaprint enable audio fingerprinting with chromaprint [no]
205- --enable-frei0r enable frei0r video filtering [no]
206- --enable-gcrypt enable gcrypt, needed for rtmp(t)e support
207- if openssl, librtmp or gmp is not used [no]
208- --enable-gmp enable gmp, needed for rtmp(t)e support
209- if openssl or librtmp is not used [no]
210- --enable-gnutls enable gnutls, needed for https support
211- if openssl, libtls or mbedtls is not used [no]
212- --disable-iconv disable iconv [autodetect]
213- --enable-jni enable JNI support [no]
214- --enable-ladspa enable LADSPA audio filtering [no]
215- --enable-lcms2 enable ICC profile support via LittleCMS 2 [no]
216- --enable-libaom enable AV1 video encoding/decoding via libaom [no]
217- --enable-libaribb24 enable ARIB text and caption decoding via libaribb24 [no]
218- --enable-libaribcaption enable ARIB text and caption decoding via libaribcaption [no]
219- --enable-libass enable libass subtitles rendering,
220- needed for subtitles and ass filter [no]
221- --enable-libbluray enable BluRay reading using libbluray [no]
222- --enable-libbs2b enable bs2b DSP library [no]
223- --enable-libcaca enable textual display using libcaca [no]
224- --enable-libcelt enable CELT decoding via libcelt [no]
225- --enable-libcdio enable audio CD grabbing with libcdio [no]
226- --enable-libcodec2 enable codec2 en/decoding using libcodec2 [no]
227- --enable-libdav1d enable AV1 decoding via libdav1d [no]
228- --enable-libdavs2 enable AVS2 decoding via libdavs2 [no]
229- --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
230- and libraw1394 [no]
231- --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
232- --enable-libflite enable flite (voice synthesis) support via libflite [no]
233- --enable-libfontconfig enable libfontconfig, useful for drawtext filter [no]
234- --enable-libfreetype enable libfreetype, needed for drawtext filter [no]
235- --enable-libfribidi enable libfribidi, improves drawtext filter [no]
236- --enable-libharfbuzz enable libharfbuzz, needed for drawtext filter [no]
237- --enable-libglslang enable GLSL->SPIRV compilation via libglslang [no]
238- --enable-libgme enable Game Music Emu via libgme [no]
239- --enable-libgsm enable GSM de/encoding via libgsm [no]
240- --enable-libiec61883 enable iec61883 via libiec61883 [no]
241- --enable-libilbc enable iLBC de/encoding via libilbc [no]
242- --enable-libjack enable JACK audio sound server [no]
243- --enable-libjxl enable JPEG XL de/encoding via libjxl [no]
244- --enable-libklvanc enable Kernel Labs VANC processing [no]
245- --enable-libkvazaar enable HEVC encoding via libkvazaar [no]
246- --enable-liblensfun enable lensfun lens correction [no]
247- --enable-libmodplug enable ModPlug via libmodplug [no]
248- --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
249- --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
250- --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
251- --enable-libopencv enable video filtering via libopencv [no]
252- --enable-libopenh264 enable H.264 encoding via OpenH264 [no]
253- --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
254- --enable-libopenmpt enable decoding tracked files via libopenmpt [no]
255- --enable-libopenvino enable OpenVINO as a DNN module backend
256- for DNN based filters like dnn_processing [no]
257- --enable-libopus enable Opus de/encoding via libopus [no]
258- --enable-libplacebo enable libplacebo library [no]
259- --enable-libpulse enable Pulseaudio input via libpulse [no]
260- --enable-librabbitmq enable RabbitMQ library [no]
261- --enable-librav1e enable AV1 encoding via rav1e [no]
262- --enable-librist enable RIST via librist [no]
263- --enable-librsvg enable SVG rasterization via librsvg [no]
264- --enable-librubberband enable rubberband needed for rubberband filter [no]
265- --enable-librtmp enable RTMP[E] support via librtmp [no]
266- --enable-libshaderc enable GLSL->SPIRV compilation via libshaderc [no]
267- --enable-libshine enable fixed-point MP3 encoding via libshine [no]
268- --enable-libsmbclient enable Samba protocol via libsmbclient [no]
269- --enable-libsnappy enable Snappy compression, needed for hap encoding [no]
270- --enable-libsoxr enable Include libsoxr resampling [no]
271- --enable-libspeex enable Speex de/encoding via libspeex [no]
272- --enable-libsrt enable Haivision SRT protocol via libsrt [no]
273- --enable-libssh enable SFTP protocol via libssh [no]
274- --enable-libsvtav1 enable AV1 encoding via SVT [no]
275- --enable-libtensorflow enable TensorFlow as a DNN module backend
276- for DNN based filters like sr [no]
277- --enable-libtesseract enable Tesseract, needed for ocr filter [no]
278- --enable-libtheora enable Theora encoding via libtheora [no]
279- --enable-libtls enable LibreSSL (via libtls), needed for https support
280- if openssl, gnutls or mbedtls is not used [no]
281- --enable-libtwolame enable MP2 encoding via libtwolame [no]
282- --enable-libuavs3d enable AVS3 decoding via libuavs3d [no]
283- --enable-libv4l2 enable libv4l2/v4l-utils [no]
284- --enable-libvidstab enable video stabilization using vid.stab [no]
285- --enable-libvmaf enable vmaf filter via libvmaf [no]
286- --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
287- --enable-libvorbis enable Vorbis en/decoding via libvorbis,
288- native implementation exists [no]
289- --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
290- --enable-libwebp enable WebP encoding via libwebp [no]
291- --enable-libx264 enable H.264 encoding via x264 [no]
292- --enable-libx265 enable HEVC encoding via x265 [no]
293- --enable-libxavs enable AVS encoding via xavs [no]
294- --enable-libxavs2 enable AVS2 encoding via xavs2 [no]
295- --enable-libxcb enable X11 grabbing using XCB [autodetect]
296- --enable-libxcb-shm enable X11 grabbing shm communication [autodetect]
297- --enable-libxcb-xfixes enable X11 grabbing mouse rendering [autodetect]
298- --enable-libxcb-shape enable X11 grabbing shape rendering [autodetect]
299- --enable-libxvid enable Xvid encoding via xvidcore,
300- native MPEG-4/Xvid encoder exists [no]
301- --enable-libxml2 enable XML parsing using the C library libxml2, needed
302- for dash and imf demuxing support [no]
303- --enable-libzimg enable z.lib, needed for zscale filter [no]
304- --enable-libzmq enable message passing via libzmq [no]
305- --enable-libzvbi enable teletext support via libzvbi [no]
306- --enable-lv2 enable LV2 audio filtering [no]
307- --disable-lzma disable lzma [autodetect]
308- --enable-decklink enable Blackmagic DeckLink I/O support [no]
309- --enable-mbedtls enable mbedTLS, needed for https support
310- if openssl, gnutls or libtls is not used [no]
311- --enable-mediacodec enable Android MediaCodec support [no]
312- --enable-mediafoundation enable encoding via MediaFoundation [auto]
313- --disable-metal disable Apple Metal framework [autodetect]
314- --enable-libmysofa enable libmysofa, needed for sofalizer filter [no]
315- --enable-openal enable OpenAL 1.1 capture support [no]
316- --enable-opencl enable OpenCL processing [no]
317- --enable-opengl enable OpenGL rendering [no]
318- --enable-openssl enable openssl, needed for https support
319- if gnutls, libtls or mbedtls is not used [no]
320- --enable-pocketsphinx enable PocketSphinx, needed for asr filter [no]
321- --disable-sndio disable sndio support [autodetect]
322- --disable-schannel disable SChannel SSP, needed for TLS support on
323- Windows if openssl and gnutls are not used [autodetect]
324- --disable-sdl2 disable sdl2 [autodetect]
325- --disable-securetransport disable Secure Transport, needed for TLS support
326- on OSX if openssl and gnutls are not used [autodetect]
327- --enable-vapoursynth enable VapourSynth demuxer [no]
328- --disable-xlib disable xlib [autodetect]
329- --disable-zlib disable zlib [autodetect]
330-
331- The following libraries provide various hardware acceleration features:
332- --disable-amf disable AMF video encoding code [autodetect]
333- --disable-audiotoolbox disable Apple AudioToolbox code [autodetect]
334- --enable-cuda-nvcc enable Nvidia CUDA compiler [no]
335- --disable-cuda-llvm disable CUDA compilation using clang [autodetect]
336- --disable-cuvid disable Nvidia CUVID support [autodetect]
337- --disable-d3d11va disable Microsoft Direct3D 11 video acceleration code [autodetect]
338- --disable-dxva2 disable Microsoft DirectX 9 video acceleration code [autodetect]
339- --disable-ffnvcodec disable dynamically linked Nvidia code [autodetect]
340- --enable-libdrm enable DRM code (Linux) [no]
341- --enable-libmfx enable Intel MediaSDK (AKA Quick Sync Video) code via libmfx [no]
342- --enable-libvpl enable Intel oneVPL code via libvpl if libmfx is not used [no]
343- --enable-libnpp enable Nvidia Performance Primitives-based code [no]
344- --enable-mmal enable Broadcom Multi-Media Abstraction Layer (Raspberry Pi) via MMAL [no]
345- --disable-nvdec disable Nvidia video decoding acceleration (via hwaccel) [autodetect]
346- --disable-nvenc disable Nvidia video encoding code [autodetect]
347- --enable-omx enable OpenMAX IL code [no]
348- --enable-omx-rpi enable OpenMAX IL code for Raspberry Pi [no]
349- --enable-rkmpp enable Rockchip Media Process Platform code [no]
350- --disable-v4l2-m2m disable V4L2 mem2mem code [autodetect]
351- --disable-vaapi disable Video Acceleration API (mainly Unix/Intel) code [autodetect]
352- --disable-vdpau disable Nvidia Video Decode and Presentation API for Unix code [autodetect]
353- --disable-videotoolbox disable VideoToolbox code [autodetect]
354- --disable-vulkan disable Vulkan code [autodetect]
355-
356-Toolchain options:
357- --arch=ARCH select architecture [$arch]
358- --cpu=CPU select the minimum required CPU (affects
359- instruction selection, may crash on older CPUs)
360- --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
361- --progs-suffix=SUFFIX program name suffix []
362- --enable-cross-compile assume a cross-compiler is used
363- --sysroot=PATH root of cross-build tree
364- --sysinclude=PATH location of cross-build system headers
365- --target-os=OS compiler targets OS [$target_os]
366- --target-exec=CMD command to run executables on target
367- --target-path=DIR path to view of build directory on target
368- --target-samples=DIR path to samples directory on target
369- --tempprefix=PATH force fixed dir/prefix instead of mktemp for checks
370- --toolchain=NAME set tool defaults according to NAME
371- (gcc-asan, clang-asan, gcc-msan, clang-msan,
372- gcc-tsan, clang-tsan, gcc-usan, clang-usan,
373- valgrind-massif, valgrind-memcheck,
374- msvc, icl, gcov, llvm-cov, hardened)
375- --nm=NM use nm tool NM [$nm_default]
376- --ar=AR use archive tool AR [$ar_default]
377- --as=AS use assembler AS [$as_default]
378- --ln_s=LN_S use symbolic link tool LN_S [$ln_s_default]
379- --strip=STRIP use strip tool STRIP [$strip_default]
380- --windres=WINDRES use windows resource compiler WINDRES [$windres_default]
381- --x86asmexe=EXE use nasm-compatible assembler EXE [$x86asmexe_default]
382- --cc=CC use C compiler CC [$cc_default]
383- --cxx=CXX use C compiler CXX [$cxx_default]
384- --objcc=OCC use ObjC compiler OCC [$cc_default]
385- --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
386- --nvcc=NVCC use Nvidia CUDA compiler NVCC or clang [$nvcc_default]
387- --ld=LD use linker LD [$ld_default]
388- --metalcc=METALCC use metal compiler METALCC [$metalcc_default]
389- --metallib=METALLIB use metal linker METALLIB [$metallib_default]
390- --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
391- --pkg-config-flags=FLAGS pass additional flags to pkgconf []
392- --ranlib=RANLIB use ranlib RANLIB [$ranlib_default]
393- --doxygen=DOXYGEN use DOXYGEN to generate API doc [$doxygen_default]
394- --host-cc=HOSTCC use host C compiler HOSTCC
395- --host-cflags=HCFLAGS use HCFLAGS when compiling for host
396- --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
397- --host-ld=HOSTLD use host linker HOSTLD
398- --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
399- --host-extralibs=HLIBS use libs HLIBS when linking for host
400- --host-os=OS compiler host OS [$target_os]
401- --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
402- --extra-cxxflags=ECFLAGS add ECFLAGS to CXXFLAGS [$CXXFLAGS]
403- --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
404- --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
405- --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
406- --extra-ldsoflags=ELDFLAGS add ELDFLAGS to LDSOFLAGS [$LDSOFLAGS]
407- --extra-libs=ELIBS add ELIBS [$ELIBS]
408- --extra-version=STRING version string suffix []
409- --optflags=OPTFLAGS override optimization-related compiler flags
410- --nvccflags=NVCCFLAGS override nvcc flags [$nvccflags_default]
411- --build-suffix=SUFFIX library name suffix []
412- --enable-pic build position-independent code
413- --enable-thumb compile for Thumb instruction set
414- --enable-lto[=arg] use link-time optimization
415- --env="ENV=override" override the environment variables
416-
417-Advanced options (experts only):
418- --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
419- --custom-allocator=NAME use a supported custom allocator
420- --disable-symver disable symbol versioning
421- --enable-hardcoded-tables use hardcoded tables instead of runtime generation
422- --disable-safe-bitstream-reader
423- disable buffer boundary checking in bitreaders
424- (This disables some security checks and can cause undefined behavior,
425- crashes and arbitrary code execution, it may be faster, but
426- should only be used with trusted input)
427- --sws-max-filter-size=N the max filter size swscale uses [$sws_max_filter_size_default]
428-
429-Optimization options (experts only):
430- --disable-asm disable all assembly optimizations
431- --disable-altivec disable AltiVec optimizations
432- --disable-vsx disable VSX optimizations
433- --disable-power8 disable POWER8 optimizations
434- --disable-amd3dnow disable 3DNow! optimizations
435- --disable-amd3dnowext disable 3DNow! extended optimizations
436- --disable-mmx disable MMX optimizations
437- --disable-mmxext disable MMXEXT optimizations
438- --disable-sse disable SSE optimizations
439- --disable-sse2 disable SSE2 optimizations
440- --disable-sse3 disable SSE3 optimizations
441- --disable-ssse3 disable SSSE3 optimizations
442- --disable-sse4 disable SSE4 optimizations
443- --disable-sse42 disable SSE4.2 optimizations
444- --disable-avx disable AVX optimizations
445- --disable-xop disable XOP optimizations
446- --disable-fma3 disable FMA3 optimizations
447- --disable-fma4 disable FMA4 optimizations
448- --disable-avx2 disable AVX2 optimizations
449- --disable-avx512 disable AVX-512 optimizations
450- --disable-avx512icl disable AVX-512ICL optimizations
451- --disable-aesni disable AESNI optimizations
452- --disable-armv5te disable armv5te optimizations
453- --disable-armv6 disable armv6 optimizations
454- --disable-armv6t2 disable armv6t2 optimizations
455- --disable-vfp disable VFP optimizations
456- --disable-neon disable NEON optimizations
457- --disable-dotprod disable DOTPROD optimizations
458- --disable-i8mm disable I8MM optimizations
459- --disable-inline-asm disable use of inline assembly
460- --disable-x86asm disable use of standalone x86 assembly
461- --disable-mipsdsp disable MIPS DSP ASE R1 optimizations
462- --disable-mipsdspr2 disable MIPS DSP ASE R2 optimizations
463- --disable-msa disable MSA optimizations
464- --disable-mipsfpu disable floating point MIPS optimizations
465- --disable-mmi disable Loongson MMI optimizations
466- --disable-lsx disable Loongson LSX optimizations
467- --disable-lasx disable Loongson LASX optimizations
468- --disable-rvv disable RISC-V Vector optimizations
469- --disable-fast-unaligned consider unaligned accesses slow
470-
471-Developer options (useful when working on FFmpeg itself):
472- --disable-debug disable debugging symbols
473- --enable-debug=LEVEL set the debug level [$debuglevel]
474- --disable-optimizations disable compiler optimizations
475- --enable-extra-warnings enable more compiler warnings
476- --disable-stripping disable stripping of executables and shared libraries
477- --assert-level=level 0(default), 1 or 2, amount of assertion testing,
478- 2 causes a slowdown at runtime.
479- --enable-memory-poisoning fill heap uninitialized allocated space with arbitrary data
480- --valgrind=VALGRIND run "make fate" tests through valgrind to detect memory
481- leaks and errors, using the specified valgrind binary.
482- Cannot be combined with --target-exec
483- --enable-ftrapv Trap arithmetic overflows
484- --samples=PATH location of test samples for FATE, if not set use
485- \$FATE_SAMPLES at make invocation time.
486- --enable-neon-clobber-test check NEON registers for clobbering (should be
487- used only for debugging purposes)
488- --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
489- should be used only for debugging purposes)
490- --enable-random randomly enable/disable components
491- --disable-random
492- --enable-random=LIST randomly enable/disable specific components or
493- --disable-random=LIST component groups. LIST is a comma-separated list
494- of NAME[:PROB] entries where NAME is a component
495- (group) and PROB the probability associated with
496- NAME (default 0.5).
497- --random-seed=VALUE seed value for --enable/disable-random
498- --disable-valgrind-backtrace do not print a backtrace under Valgrind
499- (only applies to --disable-optimizations builds)
500- --enable-ossfuzz Enable building fuzzer tool
501- --libfuzzer=PATH path to libfuzzer
502- --ignore-tests=TESTS comma-separated list (without "fate-" prefix
503- in the name) of tests whose result is ignored
504- --enable-linux-perf enable Linux Performance Monitor API
505- --enable-macos-kperf enable macOS kperf (private) API
506- --disable-large-tests disable tests that use a large amount of memory
507- --disable-ptx-compression don't compress CUDA PTX code even when possible
508-
509-NOTE: Object files are built at the place where configure is launched.
510-EOF
511- exit 0
512-}
513-
514-if test -t 1 && which tput >/dev/null 2>&1; then
515- ncolors=$(tput colors)
516- if test -n "$ncolors" && test $ncolors -ge 8; then
517- bold_color=$(tput bold)
518- warn_color=$(tput setaf 3)
519- error_color=$(tput setaf 1)
520- reset_color=$(tput sgr0)
521- fi
522- # 72 used instead of 80 since that's the default of pr
523- ncols=$(tput cols)
524-fi
525-: ${ncols:=72}
526-
527-log(){
528- echo "$@" >> $logfile
529-}
530-
531-log_file(){
532- log BEGIN "$1"
533- log_file_i=1
534- while IFS= read -r log_file_line; do
535- printf '%5d\t%s\n' "$log_file_i" "$log_file_line"
536- log_file_i=$(($log_file_i+1))
537- done < "$1" >> "$logfile"
538- log END "$1"
539-}
540-
541-warn(){
542- log "WARNING: $*"
543- WARNINGS="${WARNINGS}WARNING: $*\n"
544-}
545-
546-die(){
547- log "$@"
548- echo "$error_color$bold_color$@$reset_color"
549- cat <<EOF
550-
551-If you think configure made a mistake, make sure you are using the latest
552-version from Git. If the latest version fails, report the problem to the
553-ffmpeg-user@ffmpeg.org mailing list or IRC #ffmpeg on irc.libera.chat.
554-EOF
555- if disabled logging; then
556- cat <<EOF
557-Rerun configure with logging enabled (do not use --disable-logging), and
558-include the log this produces with your report.
559-EOF
560- else
561- cat <<EOF
562-Include the log file "$logfile" produced by configure as this will help
563-solve the problem.
564-EOF
565- fi
566- exit 1
567-}
568-
569-# Avoid locale weirdness, besides we really just want to translate ASCII.
570-toupper(){
571- echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
572-}
573-
574-tolower(){
575- echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
576-}
577-
578-c_escape(){
579- echo "$*" | sed 's/["\\]/\\\0/g'
580-}
581-
582-sh_quote(){
583- v=$(echo "$1" | sed "s/'/'\\\\''/g")
584- test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
585- echo "$v"
586-}
587-
588-cleanws(){
589- echo "$@" | sed 's/^ *//;s/[[:space:]][[:space:]]*/ /g;s/ *$//'
590-}
591-
592-filter(){
593- pat=$1
594- shift
595- for v; do
596- eval "case '$v' in $pat) printf '%s ' '$v' ;; esac"
597- done
598-}
599-
600-filter_out(){
601- pat=$1
602- shift
603- for v; do
604- eval "case '$v' in $pat) ;; *) printf '%s ' '$v' ;; esac"
605- done
606-}
607-
608-map(){
609- m=$1
610- shift
611- for v; do eval $m; done
612-}
613-
614-add_suffix(){
615- suffix=$1
616- shift
617- for v; do echo ${v}${suffix}; done
618-}
619-
620-remove_suffix(){
621- suffix=$1
622- shift
623- for v; do echo ${v%$suffix}; done
624-}
625-
626-set_all(){
627- value=$1
628- shift
629- for var in $*; do
630- eval $var=$value
631- done
632-}
633-
634-set_weak(){
635- value=$1
636- shift
637- for var; do
638- eval : \${$var:=$value}
639- done
640-}
641-
642-sanitize_var_name(){
643- echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
644-}
645-
646-set_sanitized(){
647- var=$1
648- shift
649- eval $(sanitize_var_name "$var")='$*'
650-}
651-
652-get_sanitized(){
653- eval echo \$$(sanitize_var_name "$1")
654-}
655-
656-pushvar(){
657- for pvar in $*; do
658- eval level=\${${pvar}_level:=0}
659- eval ${pvar}_${level}="\$$pvar"
660- eval ${pvar}_level=$(($level+1))
661- done
662-}
663-
664-popvar(){
665- for pvar in $*; do
666- eval level=\${${pvar}_level:-0}
667- test $level = 0 && continue
668- eval level=$(($level-1))
669- eval $pvar="\${${pvar}_${level}}"
670- eval ${pvar}_level=$level
671- eval unset ${pvar}_${level}
672- done
673-}
674-
675-request(){
676- for var in $*; do
677- eval ${var}_requested=yes
678- eval $var=
679- done
680-}
681-
682-warn_if_gets_disabled(){
683- for var in $*; do
684- WARN_IF_GETS_DISABLED_LIST="$WARN_IF_GETS_DISABLED_LIST $var"
685- done
686-}
687-
688-enable(){
689- set_all yes $*
690-}
691-
692-disable(){
693- set_all no $*
694-}
695-
696-disable_with_reason(){
697- disable $1
698- eval "${1}_disable_reason=\"$2\""
699- if requested $1; then
700- die "ERROR: $1 requested, but $2"
701- fi
702-}
703-
704-enable_weak(){
705- set_weak yes $*
706-}
707-
708-disable_weak(){
709- set_weak no $*
710-}
711-
712-enable_sanitized(){
713- for var; do
714- enable $(sanitize_var_name $var)
715- done
716-}
717-
718-disable_sanitized(){
719- for var; do
720- disable $(sanitize_var_name $var)
721- done
722-}
723-
724-do_enable_deep(){
725- for var; do
726- enabled $var && continue
727- set -- $var
728- eval enable_deep \$${var}_select
729- var=$1
730- eval enable_deep_weak \$${var}_suggest
731- done
732-}
733-
734-enable_deep(){
735- do_enable_deep $*
736- enable $*
737-}
738-
739-enable_deep_weak(){
740- for var; do
741- disabled $var && continue
742- set -- $var
743- do_enable_deep $var
744- var=$1
745- enable_weak $var
746- done
747-}
748-
749-requested(){
750- test "${1#!}" = "$1" && op="=" || op="!="
751- eval test "x\$${1#!}_requested" $op "xyes"
752-}
753-
754-enabled(){
755- test "${1#!}" = "$1" && op="=" || op="!="
756- eval test "x\$${1#!}" $op "xyes"
757-}
758-
759-disabled(){
760- test "${1#!}" = "$1" && op="=" || op="!="
761- eval test "x\$${1#!}" $op "xno"
762-}
763-
764-enabled_all(){
765- for opt; do
766- enabled $opt || return 1
767- done
768-}
769-
770-disabled_all(){
771- for opt; do
772- disabled $opt || return 1
773- done
774-}
775-
776-enabled_any(){
777- for opt; do
778- enabled $opt && return 0
779- done
780-}
781-
782-disabled_any(){
783- for opt; do
784- disabled $opt && return 0
785- done
786- return 1
787-}
788-
789-set_default(){
790- for opt; do
791- eval : \${$opt:=\$${opt}_default}
792- done
793-}
794-
795-is_in(){
796- value=$1
797- shift
798- for var in $*; do
799- [ $var = $value ] && return 0
800- done
801- return 1
802-}
803-
804-# The cfg loop is very hot (several thousands iterations), and in bash also
805-# potentialy quite slow. Try to abort the iterations early, preferably without
806-# calling functions. 70%+ of the time cfg is already done or without deps.
807-check_deps(){
808- for cfg; do
809- eval [ x\$${cfg}_checking = xdone ] && continue
810- eval [ x\$${cfg}_checking = xinprogress ] && die "Circular dependency for $cfg."
811-
812- eval "
813- dep_all=\$${cfg}_deps
814- dep_any=\$${cfg}_deps_any
815- dep_con=\$${cfg}_conflict
816- dep_sel=\$${cfg}_select
817- dep_sgs=\$${cfg}_suggest
818- dep_ifa=\$${cfg}_if
819- dep_ifn=\$${cfg}_if_any
820- "
821-
822- # most of the time here $cfg has no deps - avoid costly no-op work
823- if [ "$dep_all$dep_any$dep_con$dep_sel$dep_sgs$dep_ifa$dep_ifn" ]; then
824- eval ${cfg}_checking=inprogress
825-
826- set -- $cfg "$dep_all" "$dep_any" "$dep_con" "$dep_sel" "$dep_sgs" "$dep_ifa" "$dep_ifn"
827- check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn
828- cfg=$1; dep_all=$2; dep_any=$3; dep_con=$4; dep_sel=$5 dep_sgs=$6; dep_ifa=$7; dep_ifn=$8
829-
830- [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
831- [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
832- enabled_all $dep_all || { disable_with_reason $cfg "not all dependencies are satisfied: $dep_all"; }
833- enabled_any $dep_any || { disable_with_reason $cfg "not any dependency is satisfied: $dep_any"; }
834- disabled_all $dep_con || { disable_with_reason $cfg "some conflicting dependencies are unsatisfied: $dep_con"; }
835- disabled_any $dep_sel && { disable_with_reason $cfg "some selected dependency is unsatisfied: $dep_sel"; }
836-
837- enabled $cfg && enable_deep_weak $dep_sel $dep_sgs
838-
839- for dep in $dep_all $dep_any $dep_sel $dep_sgs; do
840- # filter out library deps, these do not belong in extralibs
841- is_in $dep $LIBRARY_LIST && continue
842- enabled $dep && eval append ${cfg}_extralibs ${dep}_extralibs
843- done
844- fi
845-
846- eval ${cfg}_checking=done
847- done
848-}
849-
850-print_config(){
851- pfx=$1
852- files=$2
853- shift 2
854- map 'eval echo "$v \${$v:-no}"' "$@" |
855- awk "BEGIN { split(\"$files\", files) }
856- {
857- c = \"$pfx\" toupper(\$1);
858- v = \$2;
859- sub(/yes/, 1, v);
860- sub(/no/, 0, v);
861- for (f in files) {
862- file = files[f];
863- if (file ~ /\\.h\$/) {
864- printf(\"#define %s %d\\n\", c, v) >>file;
865- } else if (file ~ /\\.asm\$/) {
866- printf(\"%%define %s %d\\n\", c, v) >>file;
867- } else if (file ~ /\\.mak\$/) {
868- n = -v ? \"\" : \"!\";
869- printf(\"%s%s=yes\\n\", n, c) >>file;
870- } else if (file ~ /\\.texi\$/) {
871- pre = -v ? \"\" : \"@c \";
872- yesno = \$2;
873- c2 = tolower(c);
874- gsub(/_/, \"-\", c2);
875- printf(\"%s@set %s %s\\n\", pre, c2, yesno) >>file;
876- }
877- }
878- }"
879-}
880-
881-print_enabled(){
882- suf=$1
883- shift
884- for v; do
885- enabled $v && printf "%s\n" ${v%$suf}
886- done
887-}
888-
889-append(){
890- var=$1
891- shift
892- eval "$var=\"\$$var $*\""
893-}
894-
895-prepend(){
896- var=$1
897- shift
898- eval "$var=\"$* \$$var\""
899-}
900-
901-reverse () {
902- eval '
903- reverse_out=
904- for v in $'$1'; do
905- reverse_out="$v $reverse_out"
906- done
907- '$1'=$reverse_out
908- '
909-}
910-
911-# keeps the last occurence of each non-unique item
912-unique(){
913- unique_out=
914- eval unique_in=\$$1
915- reverse unique_in
916- for v in $unique_in; do
917- # " $unique_out" +space such that every item is surrounded with spaces
918- case " $unique_out" in *" $v "*) continue; esac # already in list
919- unique_out="$unique_out$v "
920- done
921- reverse unique_out
922- eval $1=\$unique_out
923-}
924-
925-resolve(){
926- resolve_out=
927- eval resolve_in=\$$1
928- for v in $resolve_in; do
929- eval 'resolve_out="$resolve_out$'$v' "'
930- done
931- eval $1=\$resolve_out
932-}
933-
934-add_cppflags(){
935- append CPPFLAGS "$@"
936-}
937-
938-add_cflags(){
939- append CFLAGS $($cflags_filter "$@")
940-}
941-
942-add_cflags_headers(){
943- append CFLAGS_HEADERS $($cflags_filter "$@")
944-}
945-
946-add_cxxflags(){
947- append CXXFLAGS $($cflags_filter "$@")
948-}
949-
950-add_objcflags(){
951- append OBJCFLAGS $($objcflags_filter "$@")
952-}
953-
954-add_asflags(){
955- append ASFLAGS $($asflags_filter "$@")
956-}
957-
958-add_ldflags(){
959- append LDFLAGS $($ldflags_filter "$@")
960-}
961-
962-add_ldexeflags(){
963- append LDEXEFLAGS $($ldflags_filter "$@")
964-}
965-
966-add_ldsoflags(){
967- append LDSOFLAGS $($ldflags_filter "$@")
968-}
969-
970-add_extralibs(){
971- prepend extralibs $($ldflags_filter "$@")
972-}
973-
974-add_stripflags(){
975- append ASMSTRIPFLAGS "$@"
976-}
977-
978-add_host_cppflags(){
979- append host_cppflags "$@"
980-}
981-
982-add_host_cflags(){
983- append host_cflags $($host_cflags_filter "$@")
984-}
985-
986-add_host_ldflags(){
987- append host_ldflags $($host_ldflags_filter "$@")
988-}
989-
990-add_compat(){
991- append compat_objs $1
992- shift
993- map 'add_cppflags -D$v' "$@"
994-}
995-
996-test_cmd(){
997- log "$@"
998- "$@" >> $logfile 2>&1
999-}
1000-
1001-test_stat(){
1002- log test_stat "$@"
1003- stat "$1" >> $logfile 2>&1
1004-}
1005-
1006-cc_e(){
1007- eval printf '%s\\n' $CC_E
1008-}
1009-
1010-cc_o(){
1011- eval printf '%s\\n' $CC_O
1012-}
1013-
1014-as_o(){
1015- eval printf '%s\\n' $AS_O
1016-}
1017-
1018-x86asm_o(){
1019- eval printf '%s\\n' $X86ASM_O
1020-}
1021-
1022-ld_o(){
1023- eval printf '%s\\n' $LD_O
1024-}
1025-
1026-hostcc_e(){
1027- eval printf '%s\\n' $HOSTCC_E
1028-}
1029-
1030-hostcc_o(){
1031- eval printf '%s\\n' $HOSTCC_O
1032-}
1033-
1034-nvcc_o(){
1035- eval printf '%s\\n' $NVCC_O
1036-}
1037-
1038-test_cc(){
1039- log test_cc "$@"
1040- cat > $TMPC
1041- log_file $TMPC
1042- test_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
1043-}
1044-
1045-test_cxx(){
1046- log test_cxx "$@"
1047- cat > $TMPCPP
1048- log_file $TMPCPP
1049- test_cmd $cxx $CPPFLAGS $CFLAGS $CXXFLAGS "$@" $CXX_C -o $TMPO $TMPCPP
1050-}
1051-
1052-test_objcc(){
1053- log test_objcc "$@"
1054- cat > $TMPM
1055- log_file $TMPM
1056- test_cmd $objcc -Werror=missing-prototypes $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPM
1057-}
1058-
1059-test_nvcc(){
1060- log test_nvcc "$@"
1061- cat > $TMPCU
1062- log_file $TMPCU
1063- tmpcu_=$TMPCU
1064- tmpo_=$TMPO
1065- [ -x "$(command -v cygpath)" ] && tmpcu_=$(cygpath -m $tmpcu_) && tmpo_=$(cygpath -m $tmpo_)
1066- test_cmd $nvcc $nvccflags "$@" $NVCC_C $(nvcc_o $tmpo_) $tmpcu_
1067-}
1068-
1069-check_nvcc() {
1070- log check_nvcc "$@"
1071- name=$1
1072- shift 1
1073- disabled $name && return
1074- disable $name
1075- test_nvcc "$@" <<EOF && enable $name
1076-extern "C" {
1077- __global__ void hello(unsigned char *data) {}
1078-}
1079-EOF
1080-}
1081-
1082-test_cpp(){
1083- log test_cpp "$@"
1084- cat > $TMPC
1085- log_file $TMPC
1086- test_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
1087-}
1088-
1089-test_as(){
1090- log test_as "$@"
1091- cat > $TMPS
1092- log_file $TMPS
1093- test_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
1094-}
1095-
1096-test_x86asm(){
1097- log test_x86asm "$@"
1098- echo "$1" > $TMPASM
1099- log_file $TMPASM
1100- shift
1101- test_cmd $x86asmexe $X86ASMFLAGS -Werror "$@" $(x86asm_o $TMPO) $TMPASM
1102-}
1103-
1104-check_cmd(){
1105- log check_cmd "$@"
1106- cmd=$1
1107- disabled $cmd && return
1108- disable $cmd
1109- test_cmd $@ && enable $cmd
1110-}
1111-
1112-check_as(){
1113- log check_as "$@"
1114- name=$1
1115- code=$2
1116- shift 2
1117- disable $name
1118- test_as $@ <<EOF && enable $name
1119-$code
1120-EOF
1121-}
1122-
1123-check_inline_asm(){
1124- log check_inline_asm "$@"
1125- name="$1"
1126- code="$2"
1127- shift 2
1128- disable $name
1129- test_cc "$@" <<EOF && enable $name
1130-void foo(void){ __asm__ volatile($code); }
1131-EOF
1132-}
1133-
1134-check_inline_asm_flags(){
1135- log check_inline_asm_flags "$@"
1136- name="$1"
1137- code="$2"
1138- flags=''
1139- shift 2
1140- while [ "$1" != "" ]; do
1141- append flags $1
1142- shift
1143- done;
1144- disable $name
1145- cat > $TMPC <<EOF
1146-void foo(void){ __asm__ volatile($code); }
1147-EOF
1148- log_file $TMPC
1149- test_cmd $cc $CPPFLAGS $CFLAGS $flags "$@" $CC_C $(cc_o $TMPO) $TMPC &&
1150- enable $name && add_cflags $flags && add_asflags $flags && add_ldflags $flags
1151-}
1152-
1153-check_insn(){
1154- log check_insn "$@"
1155- check_inline_asm ${1}_inline "\"$2\""
1156- check_as ${1}_external "$2"
1157-}
1158-
1159-check_arch_level(){
1160- log check_arch_level "$@"
1161- level="$1"
1162- check_as tested_arch_level ".arch $level"
1163- enabled tested_arch_level && as_arch_level="$level"
1164-}
1165-
1166-check_archext_insn(){
1167- log check_archext_insn "$@"
1168- feature="$1"
1169- instr="$2"
1170- # Check if the assembly is accepted in inline assembly.
1171- check_inline_asm ${feature}_inline "\"$instr\""
1172- # We don't check if the instruction is supported out of the box by the
1173- # external assembler (we don't try to set ${feature}_external) as we don't
1174- # need to use these instructions in non-runtime detected codepaths.
1175-
1176- disable $feature
1177-
1178- enabled as_arch_directive && arch_directive=".arch $as_arch_level" || arch_directive=""
1179-
1180- # Test if the assembler supports the .arch_extension $feature directive.
1181- arch_extension_directive=".arch_extension $feature"
1182- test_as <<EOF && enable as_archext_${feature}_directive || arch_extension_directive=""
1183-$arch_directive
1184-$arch_extension_directive
1185-EOF
1186-
1187- # Test if we can assemble the instruction after potential .arch and
1188- # .arch_extension directives.
1189- test_as <<EOF && enable ${feature}
1190-$arch_directive
1191-$arch_extension_directive
1192-$instr
1193-EOF
1194-}
1195-
1196-check_x86asm(){
1197- log check_x86asm "$@"
1198- name=$1
1199- shift
1200- disable $name
1201- test_x86asm "$@" && enable $name
1202-}
1203-
1204-test_ld(){
1205- log test_ld "$@"
1206- type=$1
1207- shift 1
1208- flags=$(filter_out '-l*|*.so' $@)
1209- libs=$(filter '-l*|*.so' $@)
1210- test_$type $($cflags_filter $flags) || return
1211- flags=$($ldflags_filter $flags)
1212- libs=$($ldflags_filter $libs)
1213- test_cmd $ld $LDFLAGS $LDEXEFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
1214-}
1215-
1216-check_ld(){
1217- log check_ld "$@"
1218- type=$1
1219- name=$2
1220- shift 2
1221- disable $name
1222- test_ld $type $@ && enable $name
1223-}
1224-
1225-print_include(){
1226- hdr=$1
1227- test "${hdr%.h}" = "${hdr}" &&
1228- echo "#include $hdr" ||
1229- echo "#include <$hdr>"
1230-}
1231-
1232-test_code(){
1233- log test_code "$@"
1234- check=$1
1235- headers=$2
1236- code=$3
1237- shift 3
1238- {
1239- for hdr in $headers; do
1240- print_include $hdr
1241- done
1242- echo "int main(void) { $code; return 0; }"
1243- } | test_$check "$@"
1244-}
1245-
1246-check_cppflags(){
1247- log check_cppflags "$@"
1248- test_cpp "$@" <<EOF && append CPPFLAGS "$@"
1249-#include <stdlib.h>
1250-EOF
1251-}
1252-
1253-test_cflags(){
1254- log test_cflags "$@"
1255- set -- $($cflags_filter "$@")
1256- test_cc "$@" <<EOF
1257-int x;
1258-EOF
1259-}
1260-
1261-check_cflags(){
1262- log check_cflags "$@"
1263- test_cflags "$@" && add_cflags "$@"
1264-}
1265-
1266-check_cxxflags(){
1267- log check_cxxflags "$@"
1268- set -- $($cflags_filter "$@")
1269- test_cxx "$@" <<EOF && append CXXFLAGS "$@"
1270-int x;
1271-EOF
1272-}
1273-
1274-test_objcflags(){
1275- log test_objcflags "$@"
1276- set -- $($objcflags_filter "$@")
1277- test_objcc "$@" <<EOF
1278-int x;
1279-EOF
1280-}
1281-
1282-check_objcflags(){
1283- log check_objcflags "$@"
1284- test_objcflags "$@" && add_objcflags "$@"
1285-}
1286-
1287-test_ldflags(){
1288- log test_ldflags "$@"
1289- set -- $($ldflags_filter "$@")
1290- test_ld "cc" "$@" <<EOF
1291-int main(void){ return 0; }
1292-EOF
1293-}
1294-
1295-check_ldflags(){
1296- log check_ldflags "$@"
1297- test_ldflags "$@" && add_ldflags "$@"
1298-}
1299-
1300-test_stripflags(){
1301- log test_stripflags "$@"
1302- # call test_cc to get a fresh TMPO
1303- test_cc <<EOF
1304-int main(void) { return 0; }
1305-EOF
1306- test_cmd $strip $ASMSTRIPFLAGS "$@" $TMPO
1307-}
1308-
1309-check_stripflags(){
1310- log check_stripflags "$@"
1311- test_stripflags "$@" && add_stripflags "$@"
1312-}
1313-
1314-check_headers(){
1315- log check_headers "$@"
1316- headers=$1
1317- shift
1318- disable_sanitized $headers
1319- {
1320- for hdr in $headers; do
1321- print_include $hdr
1322- done
1323- echo "int x;"
1324- } | test_cpp "$@" && enable_sanitized $headers
1325-}
1326-
1327-check_header_objcc(){
1328- log check_header_objcc "$@"
1329- rm -f -- "$TMPO"
1330- header=$1
1331- shift
1332- disable_sanitized $header
1333- {
1334- echo "#include <$header>"
1335- echo "int main(void) { return 0; }"
1336- } | test_objcc && test_stat "$TMPO" && enable_sanitized $header
1337-}
1338-
1339-check_apple_framework(){
1340- log check_apple_framework "$@"
1341- framework="$1"
1342- name="$(tolower $framework)"
1343- header="${framework}/${framework}.h"
1344- disable $name
1345- check_header_objcc $header &&
1346- enable $name && eval ${name}_extralibs='"-framework $framework"'
1347-}
1348-
1349-check_func(){
1350- log check_func "$@"
1351- func=$1
1352- shift
1353- disable $func
1354- test_ld "cc" "$@" <<EOF && enable $func
1355-extern int $func();
1356-int main(void){ $func(); }
1357-EOF
1358-}
1359-
1360-check_mathfunc(){
1361- log check_mathfunc "$@"
1362- func=$1
1363- narg=$2
1364- shift 2
1365- test $narg = 2 && args="f, g" || args="f"
1366- disable $func
1367- test_ld "cc" "$@" <<EOF && enable $func
1368-#include <math.h>
1369-float foo(float f, float g) { return $func($args); }
1370-int main(void){ return (int) foo; }
1371-EOF
1372-}
1373-
1374-check_func_headers(){
1375- log check_func_headers "$@"
1376- headers=$1
1377- funcs=$2
1378- shift 2
1379- {
1380- for hdr in $headers; do
1381- print_include $hdr
1382- done
1383- echo "#include <stdint.h>"
1384- for func in $funcs; do
1385- echo "long check_$func(void) { return (long) $func; }"
1386- done
1387- echo "int main(void) { int ret = 0;"
1388- # LTO could optimize out the test functions without this
1389- for func in $funcs; do
1390- echo " ret |= ((intptr_t)check_$func) & 0xFFFF;"
1391- done
1392- echo "return ret; }"
1393- } | test_ld "cc" "$@" && enable $funcs && enable_sanitized $headers
1394-}
1395-
1396-check_class_headers_cpp(){
1397- log check_class_headers_cpp "$@"
1398- headers=$1
1399- classes=$2
1400- shift 2
1401- {
1402- for hdr in $headers; do
1403- echo "#include <$hdr>"
1404- done
1405- echo "int main(void) { "
1406- i=1
1407- for class in $classes; do
1408- echo "$class obj$i;"
1409- i=$(expr $i + 1)
1410- done
1411- echo "return 0; }"
1412- } | test_ld "cxx" "$@" && enable $funcs && enable_sanitized $headers
1413-}
1414-
1415-test_cpp_condition(){
1416- log test_cpp_condition "$@"
1417- header=$1
1418- condition=$2
1419- shift 2
1420- test_cpp "$@" <<EOF
1421-#include <$header>
1422-#if !($condition)
1423-#error "unsatisfied condition: $condition"
1424-#endif
1425-EOF
1426-}
1427-
1428-check_cpp_condition(){
1429- log check_cpp_condition "$@"
1430- name=$1
1431- shift 1
1432- disable $name
1433- test_cpp_condition "$@" && enable $name
1434-}
1435-
1436-test_cflags_cc(){
1437- log test_cflags_cc "$@"
1438- flags=$1
1439- header=$2
1440- condition=$3
1441- shift 3
1442- set -- $($cflags_filter "$flags")
1443- test_cc "$@" <<EOF
1444-#include <$header>
1445-#if !($condition)
1446-#error "unsatisfied condition: $condition"
1447-#endif
1448-EOF
1449-}
1450-
1451-check_lib(){
1452- log check_lib "$@"
1453- name="$1"
1454- headers="$2"
1455- funcs="$3"
1456- shift 3
1457- disable $name
1458- check_func_headers "$headers" "$funcs" "$@" &&
1459- enable $name && eval ${name}_extralibs="\$@"
1460-}
1461-
1462-check_lib_cpp(){
1463- log check_lib_cpp "$@"
1464- name="$1"
1465- headers="$2"
1466- classes="$3"
1467- shift 3
1468- disable $name
1469- check_class_headers_cpp "$headers" "$classes" "$@" &&
1470- enable $name && eval ${name}_extralibs="\$@"
1471-}
1472-
1473-test_pkg_config(){
1474- log test_pkg_config "$@"
1475- name="$1"
1476- pkg_version="$2"
1477- pkg="${2%% *}"
1478- headers="$3"
1479- funcs="$4"
1480- shift 4
1481- disable $name
1482- test_cmd $pkg_config --exists --print-errors $pkg_version || return
1483- pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
1484- pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
1485- pkg_incdir=$($pkg_config --variable=includedir $pkg_config_flags $pkg)
1486- check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
1487- enable $name &&
1488- set_sanitized "${name}_cflags" $pkg_cflags &&
1489- set_sanitized "${name}_incdir" $pkg_incdir &&
1490- set_sanitized "${name}_extralibs" $pkg_libs
1491-}
1492-
1493-test_pkg_config_cpp(){
1494- log test_pkg_config_cpp "$@"
1495- name="$1"
1496- pkg_version="$2"
1497- pkg="${2%% *}"
1498- headers="$3"
1499- cond="$4"
1500- shift 4
1501- disable $name
1502- test_cmd $pkg_config --exists --print-errors $pkg_version || return
1503- pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
1504- pkg_incdir=$($pkg_config --variable=includedir $pkg_config_flags $pkg)
1505- pkg_incflags=$($pkg_config --cflags-only-I $pkg_config_flags $pkg)
1506- test_cpp_condition "$pkg_incdir/$headers" "$cond" "$@" &&
1507- enable $name &&
1508- set_sanitized "${name}_cflags" $pkg_cflags &&
1509- set_sanitized "${name}_incdir" $pkg_incdir &&
1510- set_sanitized "${name}_incflags" $pkg_incflags
1511-}
1512-
1513-check_pkg_config(){
1514- log check_pkg_config "$@"
1515- name="$1"
1516- test_pkg_config "$@" &&
1517- eval add_cflags \$${name}_cflags
1518-}
1519-
1520-check_pkg_config_cpp(){
1521- log check_pkg_config_cpp "$@"
1522- name="$1"
1523- test_pkg_config_cpp "$@" &&
1524- eval add_cflags \$${name}_cflags
1525-}
1526-
1527-check_pkg_config_header_only(){
1528- log check_pkg_config_cpp "$@"
1529- name="$1"
1530- test_pkg_config_cpp "$@" &&
1531- eval add_cflags \$${name}_incflags
1532-}
1533-
1534-test_exec(){
1535- test_ld "cc" "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
1536-}
1537-
1538-check_exec_crash(){
1539- log check_exec_crash "$@"
1540- code=$(cat)
1541-
1542- # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
1543- # are safe but may not be available everywhere. Thus we use
1544- # raise(SIGTERM) instead. The check is run in a subshell so we
1545- # can redirect the "Terminated" message from the shell. SIGBUS
1546- # is not defined by standard C so it is used conditionally.
1547-
1548- (test_exec "$@") >> $logfile 2>&1 <<EOF
1549-#include <signal.h>
1550-static void sighandler(int sig){
1551- raise(SIGTERM);
1552-}
1553-int foo(void){
1554- $code
1555-}
1556-int (*func_ptr)(void) = foo;
1557-int main(void){
1558- signal(SIGILL, sighandler);
1559- signal(SIGFPE, sighandler);
1560- signal(SIGSEGV, sighandler);
1561-#ifdef SIGBUS
1562- signal(SIGBUS, sighandler);
1563-#endif
1564- return func_ptr();
1565-}
1566-EOF
1567-}
1568-
1569-check_type(){
1570- log check_type "$@"
1571- headers=$1
1572- type=$2
1573- shift 2
1574- disable_sanitized "$type"
1575- test_code cc "$headers" "$type v" "$@" && enable_sanitized "$type"
1576-}
1577-
1578-check_struct(){
1579- log check_struct "$@"
1580- headers=$1
1581- struct=$2
1582- member=$3
1583- shift 3
1584- disable_sanitized "${struct}_${member}"
1585- test_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
1586- enable_sanitized "${struct}_${member}"
1587-}
1588-
1589-check_builtin(){
1590- log check_builtin "$@"
1591- name=$1
1592- headers=$2
1593- builtin=$3
1594- shift 3
1595- disable "$name"
1596- test_code ld "$headers" "$builtin" "cc" "$@" && enable "$name"
1597-}
1598-
1599-check_compile_assert(){
1600- log check_compile_assert "$@"
1601- name=$1
1602- headers=$2
1603- condition=$3
1604- shift 3
1605- disable "$name"
1606- test_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
1607-}
1608-
1609-check_cc(){
1610- log check_cc "$@"
1611- name=$1
1612- shift
1613- disable "$name"
1614- test_code cc "$@" && enable "$name"
1615-}
1616-
1617-require(){
1618- log require "$@"
1619- name_version="$1"
1620- name="${1%% *}"
1621- shift
1622- check_lib $name "$@" || die "ERROR: $name_version not found"
1623-}
1624-
1625-require_cc(){
1626- log require_cc "$@"
1627- name="$1"
1628- check_cc "$@" || die "ERROR: $name failed"
1629-}
1630-
1631-require_cpp(){
1632- log require_cpp "$@"
1633- name_version="$1"
1634- name="${1%% *}"
1635- shift
1636- check_lib_cpp "$name" "$@" || die "ERROR: $name_version not found"
1637-}
1638-
1639-require_headers(){
1640- log require_headers "$@"
1641- headers="$1"
1642- check_headers "$@" || die "ERROR: $headers not found"
1643-}
1644-
1645-require_cpp_condition(){
1646- log require_cpp_condition "$@"
1647- condition="$3"
1648- check_cpp_condition "$@" || die "ERROR: $condition not satisfied"
1649-}
1650-
1651-require_pkg_config(){
1652- log require_pkg_config "$@"
1653- pkg_version="$2"
1654- check_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
1655-}
1656-
1657-require_pkg_config_cpp(){
1658- log require_pkg_config_cpp "$@"
1659- pkg_version="$2"
1660- check_pkg_config_cpp "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message"
1661-}
1662-
1663-test_host_cc(){
1664- log test_host_cc "$@"
1665- cat > $TMPC
1666- log_file $TMPC
1667- test_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
1668-}
1669-
1670-test_host_cpp(){
1671- log test_host_cpp "$@"
1672- cat > $TMPC
1673- log_file $TMPC
1674- test_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
1675-}
1676-
1677-check_host_cppflags(){
1678- log check_host_cppflags "$@"
1679- test_host_cpp "$@" <<EOF && append host_cppflags "$@"
1680-#include <stdlib.h>
1681-EOF
1682-}
1683-
1684-check_host_cflags(){
1685- log check_host_cflags "$@"
1686- set -- $($host_cflags_filter "$@")
1687- test_host_cc "$@" <<EOF && append host_cflags "$@"
1688-int x;
1689-EOF
1690-}
1691-
1692-test_host_cpp_condition(){
1693- log test_host_cpp_condition "$@"
1694- header=$1
1695- condition=$2
1696- shift 2
1697- test_host_cpp "$@" <<EOF
1698-#include <$header>
1699-#if !($condition)
1700-#error "unsatisfied condition: $condition"
1701-#endif
1702-EOF
1703-}
1704-
1705-check_host_cpp_condition(){
1706- log check_host_cpp_condition "$@"
1707- name=$1
1708- shift 1
1709- disable $name
1710- test_host_cpp_condition "$@" && enable $name
1711-}
1712-
1713-cp_if_changed(){
1714- cmp -s "$1" "$2" && { test "$quiet" != "yes" && echo "$2 is unchanged"; } && return
1715- mkdir -p "$(dirname $2)"
1716- cp -f "$1" "$2"
1717-}
1718-
1719-# CONFIG_LIST contains configurable options, while HAVE_LIST is for
1720-# system-dependent things.
1721-
1722-AVCODEC_COMPONENTS="
1723- bsfs
1724- decoders
1725- encoders
1726- hwaccels
1727- parsers
1728-"
1729-
1730-AVDEVICE_COMPONENTS="
1731- indevs
1732- outdevs
1733-"
1734-
1735-AVFILTER_COMPONENTS="
1736- filters
1737-"
1738-
1739-AVFORMAT_COMPONENTS="
1740- demuxers
1741- muxers
1742- protocols
1743-"
1744-
1745-COMPONENT_LIST="
1746- $AVCODEC_COMPONENTS
1747- $AVDEVICE_COMPONENTS
1748- $AVFILTER_COMPONENTS
1749- $AVFORMAT_COMPONENTS
1750-"
1751-
1752-EXAMPLE_LIST="
1753- avio_http_serve_files_example
1754- avio_list_dir_example
1755- avio_read_callback_example
1756- decode_audio_example
1757- decode_filter_audio_example
1758- decode_filter_video_example
1759- decode_video_example
1760- demux_decode_example
1761- encode_audio_example
1762- encode_video_example
1763- extract_mvs_example
1764- filter_audio_example
1765- hw_decode_example
1766- mux_example
1767- qsv_decode_example
1768- remux_example
1769- resample_audio_example
1770- scale_video_example
1771- show_metadata_example
1772- transcode_aac_example
1773- transcode_example
1774- vaapi_encode_example
1775- vaapi_transcode_example
1776- qsv_transcode_example
1777-"
1778-
1779-EXTERNAL_AUTODETECT_LIBRARY_LIST="
1780- alsa
1781- appkit
1782- avfoundation
1783- bzlib
1784- coreimage
1785- iconv
1786- libxcb
1787- libxcb_shm
1788- libxcb_shape
1789- libxcb_xfixes
1790- lzma
1791- mediafoundation
1792- metal
1793- schannel
1794- sdl2
1795- securetransport
1796- sndio
1797- xlib
1798- zlib
1799-"
1800-
1801-EXTERNAL_LIBRARY_GPL_LIST="
1802- avisynth
1803- frei0r
1804- libcdio
1805- libdavs2
1806- librubberband
1807- libvidstab
1808- libx264
1809- libx265
1810- libxavs
1811- libxavs2
1812- libxvid
1813-"
1814-
1815-EXTERNAL_LIBRARY_NONFREE_LIST="
1816- decklink
1817- libfdk_aac
1818- libtls
1819-"
1820-
1821-EXTERNAL_LIBRARY_VERSION3_LIST="
1822- gmp
1823- libaribb24
1824- liblensfun
1825- libopencore_amrnb
1826- libopencore_amrwb
1827- libvo_amrwbenc
1828- mbedtls
1829- rkmpp
1830-"
1831-
1832-EXTERNAL_LIBRARY_GPLV3_LIST="
1833- libsmbclient
1834-"
1835-
1836-EXTERNAL_LIBRARY_LIST="
1837- $EXTERNAL_LIBRARY_GPL_LIST
1838- $EXTERNAL_LIBRARY_NONFREE_LIST
1839- $EXTERNAL_LIBRARY_VERSION3_LIST
1840- $EXTERNAL_LIBRARY_GPLV3_LIST
1841- chromaprint
1842- gcrypt
1843- gnutls
1844- jni
1845- ladspa
1846- lcms2
1847- libaom
1848- libaribcaption
1849- libass
1850- libbluray
1851- libbs2b
1852- libcaca
1853- libcelt
1854- libcodec2
1855- libdav1d
1856- libdc1394
1857- libdrm
1858- libflite
1859- libfontconfig
1860- libfreetype
1861- libfribidi
1862- libharfbuzz
1863- libglslang
1864- libgme
1865- libgsm
1866- libiec61883
1867- libilbc
1868- libjack
1869- libjxl
1870- libklvanc
1871- libkvazaar
1872- libmodplug
1873- libmp3lame
1874- libmysofa
1875- libopencv
1876- libopenh264
1877- libopenjpeg
1878- libopenmpt
1879- libopenvino
1880- libopus
1881- libplacebo
1882- libpulse
1883- librabbitmq
1884- librav1e
1885- librist
1886- librsvg
1887- librtmp
1888- libshaderc
1889- libshine
1890- libsmbclient
1891- libsnappy
1892- libsoxr
1893- libspeex
1894- libsrt
1895- libssh
1896- libsvtav1
1897- libtensorflow
1898- libtesseract
1899- libtheora
1900- libtwolame
1901- libuavs3d
1902- libv4l2
1903- libvmaf
1904- libvorbis
1905- libvpx
1906- libwebp
1907- libxml2
1908- libzimg
1909- libzmq
1910- libzvbi
1911- lv2
1912- mediacodec
1913- openal
1914- opengl
1915- openssl
1916- pocketsphinx
1917- vapoursynth
1918-"
1919-
1920-HWACCEL_AUTODETECT_LIBRARY_LIST="
1921- amf
1922- audiotoolbox
1923- crystalhd
1924- cuda
1925- cuda_llvm
1926- cuvid
1927- d3d11va
1928- dxva2
1929- ffnvcodec
1930- nvdec
1931- nvenc
1932- vaapi
1933- vdpau
1934- videotoolbox
1935- vulkan
1936- v4l2_m2m
1937-"
1938-
1939-# catchall list of things that require external libs to link
1940-EXTRALIBS_LIST="
1941- cpu_init
1942- cws2fws
1943-"
1944-
1945-HWACCEL_LIBRARY_NONFREE_LIST="
1946- cuda_nvcc
1947- cuda_sdk
1948- libnpp
1949-"
1950-
1951-HWACCEL_LIBRARY_LIST="
1952- $HWACCEL_LIBRARY_NONFREE_LIST
1953- libmfx
1954- libvpl
1955- mmal
1956- omx
1957- opencl
1958-"
1959-
1960-DOCUMENT_LIST="
1961- doc
1962- htmlpages
1963- manpages
1964- podpages
1965- txtpages
1966-"
1967-
1968-FEATURE_LIST="
1969- ftrapv
1970- gray
1971- hardcoded_tables
1972- omx_rpi
1973- runtime_cpudetect
1974- safe_bitstream_reader
1975- shared
1976- small
1977- static
1978- swscale_alpha
1979-"
1980-
1981-# this list should be kept in linking order
1982-LIBRARY_LIST="
1983- avdevice
1984- avfilter
1985- swscale
1986- postproc
1987- avformat
1988- avcodec
1989- swresample
1990- avutil
1991-"
1992-
1993-LICENSE_LIST="
1994- gpl
1995- nonfree
1996- version3
1997-"
1998-
1999-PROGRAM_LIST="
2000- ffplay
2001- ffprobe
2002- ffmpeg
2003-"
2004-
2005-SUBSYSTEM_LIST="
2006- dwt
2007- error_resilience
2008- faan
2009- fast_unaligned
2010- lsp
2011- pixelutils
2012- network
2013-"
2014-
2015-# COMPONENT_LIST needs to come last to ensure correct dependency checking
2016-CONFIG_LIST="
2017- $DOCUMENT_LIST
2018- $EXAMPLE_LIST
2019- $EXTERNAL_LIBRARY_LIST
2020- $EXTERNAL_AUTODETECT_LIBRARY_LIST
2021- $HWACCEL_LIBRARY_LIST
2022- $HWACCEL_AUTODETECT_LIBRARY_LIST
2023- $FEATURE_LIST
2024- $LICENSE_LIST
2025- $LIBRARY_LIST
2026- $PROGRAM_LIST
2027- $SUBSYSTEM_LIST
2028- autodetect
2029- fontconfig
2030- large_tests
2031- linux_perf
2032- macos_kperf
2033- memory_poisoning
2034- neon_clobber_test
2035- ossfuzz
2036- pic
2037- ptx_compression
2038- thumb
2039- valgrind_backtrace
2040- xmm_clobber_test
2041- $COMPONENT_LIST
2042-"
2043-
2044-THREADS_LIST="
2045- pthreads
2046- os2threads
2047- w32threads
2048-"
2049-
2050-ATOMICS_LIST="
2051- atomics_gcc
2052- atomics_suncc
2053- atomics_win32
2054-"
2055-
2056-AUTODETECT_LIBS="
2057- $EXTERNAL_AUTODETECT_LIBRARY_LIST
2058- $HWACCEL_AUTODETECT_LIBRARY_LIST
2059- $THREADS_LIST
2060-"
2061-
2062-ARCH_LIST="
2063- aarch64
2064- alpha
2065- arm
2066- avr32
2067- avr32_ap
2068- avr32_uc
2069- bfin
2070- ia64
2071- loongarch
2072- loongarch32
2073- loongarch64
2074- m68k
2075- mips
2076- mips64
2077- parisc
2078- ppc
2079- ppc64
2080- riscv
2081- s390
2082- sh4
2083- sparc
2084- sparc64
2085- tilegx
2086- tilepro
2087- x86
2088- x86_32
2089- x86_64
2090-"
2091-
2092-ARCH_EXT_LIST_ARM="
2093- armv5te
2094- armv6
2095- armv6t2
2096- armv8
2097- dotprod
2098- i8mm
2099- neon
2100- vfp
2101- vfpv3
2102- setend
2103-"
2104-
2105-ARCH_EXT_LIST_MIPS="
2106- mipsfpu
2107- mips32r2
2108- mips32r5
2109- mips64r2
2110- mips32r6
2111- mips64r6
2112- mipsdsp
2113- mipsdspr2
2114- msa
2115-"
2116-
2117-ARCH_EXT_LIST_LOONGSON="
2118- loongson2
2119- loongson3
2120- mmi
2121- lsx
2122- lasx
2123-"
2124-
2125-ARCH_EXT_LIST_X86_SIMD="
2126- aesni
2127- amd3dnow
2128- amd3dnowext
2129- avx
2130- avx2
2131- avx512
2132- avx512icl
2133- fma3
2134- fma4
2135- mmx
2136- mmxext
2137- sse
2138- sse2
2139- sse3
2140- sse4
2141- sse42
2142- ssse3
2143- xop
2144-"
2145-
2146-ARCH_EXT_LIST_PPC="
2147- altivec
2148- dcbzl
2149- ldbrx
2150- power8
2151- ppc4xx
2152- vec_xl
2153- vsx
2154-"
2155-
2156-ARCH_EXT_LIST_RISCV="
2157- rv
2158- rvv
2159-"
2160-
2161-ARCH_EXT_LIST_X86="
2162- $ARCH_EXT_LIST_X86_SIMD
2163- cpunop
2164- i686
2165-"
2166-
2167-ARCH_EXT_LIST="
2168- $ARCH_EXT_LIST_ARM
2169- $ARCH_EXT_LIST_PPC
2170- $ARCH_EXT_LIST_RISCV
2171- $ARCH_EXT_LIST_X86
2172- $ARCH_EXT_LIST_MIPS
2173- $ARCH_EXT_LIST_LOONGSON
2174-"
2175-
2176-ARCH_FEATURES="
2177- aligned_stack
2178- fast_64bit
2179- fast_clz
2180- fast_cmov
2181- fast_float16
2182- local_aligned
2183- simd_align_16
2184- simd_align_32
2185- simd_align_64
2186-"
2187-
2188-BUILTIN_LIST="
2189- atomic_cas_ptr
2190- machine_rw_barrier
2191- MemoryBarrier
2192- mm_empty
2193- rdtsc
2194- sem_timedwait
2195- sync_val_compare_and_swap
2196-"
2197-HAVE_LIST_CMDLINE="
2198- inline_asm
2199- symver
2200- x86asm
2201-"
2202-
2203-HAVE_LIST_PUB="
2204- bigendian
2205- fast_unaligned
2206-"
2207-
2208-HEADERS_LIST="
2209- arpa_inet_h
2210- asm_types_h
2211- cdio_paranoia_h
2212- cdio_paranoia_paranoia_h
2213- cuda_h
2214- dispatch_dispatch_h
2215- dev_bktr_ioctl_bt848_h
2216- dev_bktr_ioctl_meteor_h
2217- dev_ic_bt8xx_h
2218- dev_video_bktr_ioctl_bt848_h
2219- dev_video_meteor_ioctl_meteor_h
2220- direct_h
2221- dirent_h
2222- dxgidebug_h
2223- dxva_h
2224- ES2_gl_h
2225- gsm_h
2226- io_h
2227- linux_dma_buf_h
2228- linux_perf_event_h
2229- machine_ioctl_bt848_h
2230- machine_ioctl_meteor_h
2231- malloc_h
2232- opencv2_core_core_c_h
2233- OpenGL_gl3_h
2234- poll_h
2235- pthread_np_h
2236- sys_param_h
2237- sys_resource_h
2238- sys_select_h
2239- sys_soundcard_h
2240- sys_time_h
2241- sys_un_h
2242- sys_videoio_h
2243- termios_h
2244- udplite_h
2245- unistd_h
2246- valgrind_valgrind_h
2247- windows_h
2248- winsock2_h
2249-"
2250-
2251-INTRINSICS_LIST="
2252- intrinsics_neon
2253-"
2254-
2255-MATH_FUNCS="
2256- atanf
2257- atan2f
2258- cbrt
2259- cbrtf
2260- copysign
2261- cosf
2262- erf
2263- exp2
2264- exp2f
2265- expf
2266- hypot
2267- isfinite
2268- isinf
2269- isnan
2270- ldexpf
2271- llrint
2272- llrintf
2273- log2
2274- log2f
2275- log10f
2276- lrint
2277- lrintf
2278- powf
2279- rint
2280- round
2281- roundf
2282- sinf
2283- trunc
2284- truncf
2285-"
2286-
2287-SYSTEM_FEATURES="
2288- dos_paths
2289- libc_msvcrt
2290- MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
2291- section_data_rel_ro
2292- threads
2293- uwp
2294- winrt
2295-"
2296-
2297-SYSTEM_FUNCS="
2298- access
2299- aligned_malloc
2300- arc4random_buf
2301- clock_gettime
2302- closesocket
2303- CommandLineToArgvW
2304- fcntl
2305- getaddrinfo
2306- getauxval
2307- getenv
2308- gethrtime
2309- getopt
2310- GetModuleHandle
2311- GetProcessAffinityMask
2312- GetProcessMemoryInfo
2313- GetProcessTimes
2314- getrusage
2315- GetStdHandle
2316- GetSystemTimeAsFileTime
2317- gettimeofday
2318- glob
2319- glXGetProcAddress
2320- gmtime_r
2321- inet_aton
2322- isatty
2323- kbhit
2324- localtime_r
2325- lstat
2326- lzo1x_999_compress
2327- mach_absolute_time
2328- MapViewOfFile
2329- memalign
2330- mkstemp
2331- mmap
2332- mprotect
2333- nanosleep
2334- PeekNamedPipe
2335- posix_memalign
2336- prctl
2337- pthread_cancel
2338- pthread_set_name_np
2339- pthread_setname_np
2340- sched_getaffinity
2341- SecItemImport
2342- SetConsoleTextAttribute
2343- SetConsoleCtrlHandler
2344- SetDllDirectory
2345- setmode
2346- setrlimit
2347- Sleep
2348- strerror_r
2349- sysconf
2350- sysctl
2351- sysctlbyname
2352- usleep
2353- UTGetOSTypeFromString
2354- VirtualAlloc
2355- wglGetProcAddress
2356-"
2357-
2358-SYSTEM_LIBRARIES="
2359- bcrypt
2360- vaapi_drm
2361- vaapi_x11
2362- vaapi_win32
2363- vdpau_x11
2364-"
2365-
2366-TOOLCHAIN_FEATURES="
2367- as_arch_directive
2368- as_archext_dotprod_directive
2369- as_archext_i8mm_directive
2370- as_dn_directive
2371- as_fpu_directive
2372- as_func
2373- as_object_arch
2374- asm_mod_q
2375- blocks_extension
2376- ebp_available
2377- ebx_available
2378- gnu_as
2379- gnu_windres
2380- ibm_asm
2381- inline_asm_direct_symbol_refs
2382- inline_asm_labels
2383- inline_asm_nonlocal_labels
2384- pragma_deprecated
2385- rsync_contimeout
2386- symver_asm_label
2387- symver_gnu_asm
2388- vfp_args
2389- xform_asm
2390- xmm_clobbers
2391-"
2392-
2393-TYPES_LIST="
2394- DPI_AWARENESS_CONTEXT
2395- IDXGIOutput5
2396- kCMVideoCodecType_HEVC
2397- kCMVideoCodecType_HEVCWithAlpha
2398- kCMVideoCodecType_VP9
2399- kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange
2400- kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange
2401- kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange
2402- kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange
2403- kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange
2404- kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange
2405- kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange
2406- kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ
2407- kCVImageBufferTransferFunction_ITU_R_2100_HLG
2408- kCVImageBufferTransferFunction_Linear
2409- kCVImageBufferYCbCrMatrix_ITU_R_2020
2410- kCVImageBufferColorPrimaries_ITU_R_2020
2411- kCVImageBufferTransferFunction_ITU_R_2020
2412- kCVImageBufferTransferFunction_SMPTE_ST_428_1
2413- socklen_t
2414- struct_addrinfo
2415- struct_group_source_req
2416- struct_ip_mreq_source
2417- struct_ipv6_mreq
2418- struct_msghdr_msg_flags
2419- struct_pollfd
2420- struct_rusage_ru_maxrss
2421- struct_sctp_event_subscribe
2422- struct_sockaddr_in6
2423- struct_sockaddr_sa_len
2424- struct_sockaddr_storage
2425- struct_stat_st_mtim_tv_nsec
2426- struct_v4l2_frmivalenum_discrete
2427-"
2428-
2429-HAVE_LIST="
2430- $ARCH_EXT_LIST
2431- $(add_suffix _external $ARCH_EXT_LIST)
2432- $(add_suffix _inline $ARCH_EXT_LIST)
2433- $ARCH_FEATURES
2434- $BUILTIN_LIST
2435- $HAVE_LIST_CMDLINE
2436- $HAVE_LIST_PUB
2437- $HEADERS_LIST
2438- $INTRINSICS_LIST
2439- $MATH_FUNCS
2440- $SYSTEM_FEATURES
2441- $SYSTEM_FUNCS
2442- $SYSTEM_LIBRARIES
2443- $THREADS_LIST
2444- $TOOLCHAIN_FEATURES
2445- $TYPES_LIST
2446- gzip
2447- libdrm_getfb2
2448- makeinfo
2449- makeinfo_html
2450- opencl_d3d11
2451- opencl_drm_arm
2452- opencl_drm_beignet
2453- opencl_dxva2
2454- opencl_vaapi_beignet
2455- opencl_vaapi_intel_media
2456- perl
2457- pod2man
2458- posix_ioctl
2459- texi2html
2460- xmllint
2461- zlib_gzip
2462- openvino2
2463-"
2464-
2465-# options emitted with CONFIG_ prefix but not available on the command line
2466-CONFIG_EXTRA="
2467- aandcttables
2468- ac3dsp
2469- adts_header
2470- atsc_a53
2471- audio_frame_queue
2472- audiodsp
2473- blockdsp
2474- bswapdsp
2475- cabac
2476- cbs
2477- cbs_av1
2478- cbs_h264
2479- cbs_h265
2480- cbs_h266
2481- cbs_jpeg
2482- cbs_mpeg2
2483- cbs_vp9
2484- deflate_wrapper
2485- dirac_parse
2486- dnn
2487- dovi_rpu
2488- dvprofile
2489- evcparse
2490- exif
2491- faandct
2492- faanidct
2493- fdctdsp
2494- fmtconvert
2495- frame_thread_encoder
2496- g722dsp
2497- golomb
2498- gplv3
2499- h263dsp
2500- h264chroma
2501- h264dsp
2502- h264parse
2503- h264pred
2504- h264qpel
2505- h264_sei
2506- hevcparse
2507- hevc_sei
2508- hpeldsp
2509- huffman
2510- huffyuvdsp
2511- huffyuvencdsp
2512- idctdsp
2513- iirfilter
2514- inflate_wrapper
2515- intrax8
2516- iso_media
2517- ividsp
2518- jpegtables
2519- lgplv3
2520- libx262
2521- llauddsp
2522- llviddsp
2523- llvidencdsp
2524- lpc
2525- lzf
2526- me_cmp
2527- mpeg_er
2528- mpegaudio
2529- mpegaudiodsp
2530- mpegaudioheader
2531- mpeg4audio
2532- mpegvideo
2533- mpegvideodec
2534- mpegvideoenc
2535- msmpeg4dec
2536- msmpeg4enc
2537- mss34dsp
2538- pixblockdsp
2539- qpeldsp
2540- qsv
2541- qsvdec
2542- qsvenc
2543- qsvvpp
2544- rangecoder
2545- riffdec
2546- riffenc
2547- rtpdec
2548- rtpenc_chain
2549- rv34dsp
2550- scene_sad
2551- sinewin
2552- snappy
2553- srtp
2554- startcode
2555- texturedsp
2556- texturedspenc
2557- tpeldsp
2558- vaapi_1
2559- vaapi_encode
2560- vc1dsp
2561- videodsp
2562- vp3dsp
2563- vp56dsp
2564- vp8dsp
2565- wma_freqs
2566- wmv2dsp
2567-"
2568-
2569-CMDLINE_SELECT="
2570- $ARCH_EXT_LIST
2571- $CONFIG_LIST
2572- $HAVE_LIST_CMDLINE
2573- $THREADS_LIST
2574- asm
2575- cross_compile
2576- debug
2577- extra_warnings
2578- logging
2579- optimizations
2580- rpath
2581- stripping
2582-"
2583-
2584-PATHS_LIST="
2585- bindir
2586- datadir
2587- docdir
2588- incdir
2589- libdir
2590- mandir
2591- pkgconfigdir
2592- prefix
2593- shlibdir
2594- install_name_dir
2595-"
2596-
2597-CMDLINE_SET="
2598- $PATHS_LIST
2599- ar
2600- arch
2601- as
2602- assert_level
2603- build_suffix
2604- cc
2605- objcc
2606- cpu
2607- cross_prefix
2608- custom_allocator
2609- cxx
2610- dep_cc
2611- doxygen
2612- env
2613- extra_version
2614- gas
2615- host_cc
2616- host_cflags
2617- host_extralibs
2618- host_ld
2619- host_ldflags
2620- host_os
2621- ignore_tests
2622- install
2623- ld
2624- ln_s
2625- logfile
2626- malloc_prefix
2627- metalcc
2628- metallib
2629- nm
2630- optflags
2631- nvcc
2632- nvccflags
2633- pkg_config
2634- pkg_config_flags
2635- progs_suffix
2636- random_seed
2637- ranlib
2638- samples
2639- strip
2640- sws_max_filter_size
2641- sysinclude
2642- sysroot
2643- target_exec
2644- target_os
2645- target_path
2646- target_samples
2647- tempprefix
2648- toolchain
2649- valgrind
2650- windres
2651- x86asmexe
2652-"
2653-
2654-CMDLINE_APPEND="
2655- extra_cflags
2656- extra_cxxflags
2657- extra_objcflags
2658- host_cppflags
2659-"
2660-
2661-# code dependency declarations
2662-
2663-# architecture extensions
2664-
2665-armv5te_deps="arm"
2666-armv6_deps="arm"
2667-armv6t2_deps="arm"
2668-armv8_deps="aarch64"
2669-neon_deps_any="aarch64 arm"
2670-intrinsics_neon_deps="neon"
2671-vfp_deps="arm"
2672-vfpv3_deps="vfp"
2673-setend_deps="arm"
2674-dotprod_deps="aarch64 neon"
2675-i8mm_deps="aarch64 neon"
2676-
2677-map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
2678-
2679-altivec_deps="ppc"
2680-dcbzl_deps="ppc"
2681-ldbrx_deps="ppc"
2682-ppc4xx_deps="ppc"
2683-vec_xl_deps="altivec"
2684-vsx_deps="altivec"
2685-power8_deps="vsx"
2686-
2687-rv_deps="riscv"
2688-rvv_deps="rv"
2689-
2690-loongson2_deps="mips"
2691-loongson3_deps="mips"
2692-mmi_deps_any="loongson2 loongson3"
2693-lsx_deps="loongarch"
2694-lasx_deps="lsx"
2695-
2696-mips32r2_deps="mips"
2697-mips32r5_deps="mips"
2698-mips32r6_deps="mips"
2699-mips64r2_deps="mips"
2700-mips64r6_deps="mips"
2701-mipsfpu_deps="mips"
2702-mipsdsp_deps="mips"
2703-mipsdspr2_deps="mips"
2704-msa_deps="mipsfpu"
2705-
2706-cpunop_deps="i686"
2707-x86_64_select="i686"
2708-x86_64_suggest="fast_cmov"
2709-
2710-amd3dnow_deps="mmx"
2711-amd3dnowext_deps="amd3dnow"
2712-i686_deps="x86"
2713-mmx_deps="x86"
2714-mmxext_deps="mmx"
2715-sse_deps="mmxext"
2716-sse2_deps="sse"
2717-sse3_deps="sse2"
2718-ssse3_deps="sse3"
2719-sse4_deps="ssse3"
2720-sse42_deps="sse4"
2721-aesni_deps="sse42"
2722-avx_deps="sse42"
2723-xop_deps="avx"
2724-fma3_deps="avx"
2725-fma4_deps="avx"
2726-avx2_deps="avx"
2727-avx512_deps="avx2"
2728-avx512icl_deps="avx512"
2729-
2730-mmx_external_deps="x86asm"
2731-mmx_inline_deps="inline_asm x86"
2732-mmx_suggest="mmx_external mmx_inline"
2733-
2734-for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
2735- eval dep=\$${ext}_deps
2736- eval ${ext}_external_deps='"${dep}_external"'
2737- eval ${ext}_inline_deps='"${dep}_inline"'
2738- eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
2739-done
2740-
2741-aligned_stack_if_any="aarch64 ppc x86"
2742-fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 riscv64 sparc64 x86_64"
2743-fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
2744-fast_unaligned_if_any="aarch64 ppc x86"
2745-simd_align_16_if_any="altivec neon sse"
2746-simd_align_32_if_any="avx"
2747-simd_align_64_if_any="avx512"
2748-
2749-# system capabilities
2750-linux_perf_deps="linux_perf_event_h"
2751-symver_if_any="symver_asm_label symver_gnu_asm"
2752-valgrind_backtrace_conflict="optimizations"
2753-valgrind_backtrace_deps="valgrind_valgrind_h"
2754-
2755-# threading support
2756-atomics_gcc_if="sync_val_compare_and_swap"
2757-atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
2758-atomics_win32_if="MemoryBarrier"
2759-atomics_native_if_any="$ATOMICS_LIST"
2760-w32threads_deps="atomics_native"
2761-threads_if_any="$THREADS_LIST"
2762-
2763-# subsystems
2764-cbs_av1_select="cbs"
2765-cbs_h264_select="cbs"
2766-cbs_h265_select="cbs"
2767-cbs_h266_select="cbs"
2768-cbs_jpeg_select="cbs"
2769-cbs_mpeg2_select="cbs"
2770-cbs_vp9_select="cbs"
2771-deflate_wrapper_deps="zlib"
2772-dirac_parse_select="golomb"
2773-dovi_rpu_select="golomb"
2774-dnn_suggest="libtensorflow libopenvino"
2775-dnn_deps="avformat swscale"
2776-error_resilience_select="me_cmp"
2777-evcparse_select="golomb"
2778-faandct_deps="faan"
2779-faandct_select="fdctdsp"
2780-faanidct_deps="faan"
2781-faanidct_select="idctdsp"
2782-h264dsp_select="startcode"
2783-h264_sei_select="atsc_a53 golomb"
2784-hevcparse_select="golomb"
2785-hevc_sei_select="atsc_a53 golomb"
2786-frame_thread_encoder_deps="encoders threads"
2787-inflate_wrapper_deps="zlib"
2788-intrax8_select="blockdsp wmv2dsp"
2789-iso_media_select="mpeg4audio"
2790-me_cmp_select="idctdsp"
2791-mpeg_er_select="error_resilience"
2792-mpegaudio_select="mpegaudiodsp mpegaudioheader"
2793-mpegvideo_select="blockdsp hpeldsp idctdsp videodsp"
2794-mpegvideodec_select="h264chroma mpegvideo mpeg_er"
2795-mpegvideoenc_select="aandcttables fdctdsp me_cmp mpegvideo pixblockdsp"
2796-msmpeg4dec_select="h263_decoder"
2797-msmpeg4enc_select="h263_encoder"
2798-vc1dsp_select="h264chroma qpeldsp startcode"
2799-
2800-# decoders / encoders
2801-aac_decoder_select="adts_header mpeg4audio sinewin"
2802-aac_fixed_decoder_select="adts_header mpeg4audio"
2803-aac_encoder_select="audio_frame_queue iirfilter lpc sinewin"
2804-aac_latm_decoder_select="aac_decoder aac_latm_parser"
2805-ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert"
2806-ac3_fixed_decoder_select="ac3_parser ac3dsp bswapdsp"
2807-ac3_encoder_select="ac3dsp audiodsp me_cmp"
2808-ac3_fixed_encoder_select="ac3dsp audiodsp me_cmp"
2809-acelp_kelvin_decoder_select="audiodsp"
2810-adpcm_g722_decoder_select="g722dsp"
2811-adpcm_g722_encoder_select="g722dsp"
2812-agm_decoder_select="idctdsp"
2813-aic_decoder_select="golomb idctdsp"
2814-alac_encoder_select="lpc"
2815-als_decoder_select="bswapdsp mpeg4audio"
2816-amrnb_decoder_select="lsp"
2817-amrwb_decoder_select="lsp"
2818-amv_decoder_select="sp5x_decoder exif"
2819-amv_encoder_select="jpegtables mpegvideoenc"
2820-ape_decoder_select="bswapdsp llauddsp"
2821-apng_decoder_select="inflate_wrapper"
2822-apng_encoder_select="deflate_wrapper llvidencdsp"
2823-aptx_encoder_select="audio_frame_queue"
2824-aptx_hd_encoder_select="audio_frame_queue"
2825-asv1_decoder_select="blockdsp bswapdsp idctdsp"
2826-asv1_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
2827-asv2_decoder_select="blockdsp bswapdsp idctdsp"
2828-asv2_encoder_select="aandcttables bswapdsp fdctdsp pixblockdsp"
2829-atrac1_decoder_select="sinewin"
2830-av1_decoder_select="cbs_av1 atsc_a53"
2831-bink_decoder_select="blockdsp hpeldsp"
2832-binkaudio_dct_decoder_select="wma_freqs"
2833-binkaudio_rdft_decoder_select="wma_freqs"
2834-cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
2835-clearvideo_decoder_select="idctdsp"
2836-cllc_decoder_select="bswapdsp"
2837-comfortnoise_encoder_select="lpc"
2838-cook_decoder_select="audiodsp sinewin"
2839-cri_decoder_select="mjpeg_decoder"
2840-cscd_decoder_suggest="zlib"
2841-dds_decoder_select="texturedsp"
2842-dirac_decoder_select="dirac_parse dwt golomb videodsp mpegvideoenc"
2843-dnxhd_decoder_select="blockdsp idctdsp"
2844-dnxhd_encoder_select="blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp videodsp"
2845-dvvideo_decoder_select="dvprofile idctdsp"
2846-dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
2847-dxa_decoder_deps="zlib"
2848-dxv_decoder_select="lzf texturedsp"
2849-eac3_decoder_select="ac3_decoder"
2850-eac3_encoder_select="ac3_encoder"
2851-eamad_decoder_select="aandcttables blockdsp bswapdsp"
2852-eatgq_decoder_select="aandcttables"
2853-eatqi_decoder_select="aandcttables blockdsp bswapdsp"
2854-exr_decoder_deps="zlib"
2855-exr_encoder_deps="zlib"
2856-ffv1_decoder_select="rangecoder"
2857-ffv1_encoder_select="rangecoder"
2858-ffvhuff_decoder_select="huffyuv_decoder"
2859-ffvhuff_encoder_select="huffyuv_encoder"
2860-fic_decoder_select="golomb"
2861-flac_encoder_select="bswapdsp lpc"
2862-flashsv2_decoder_select="inflate_wrapper"
2863-flashsv2_encoder_select="deflate_wrapper"
2864-flashsv_decoder_select="inflate_wrapper"
2865-flashsv_encoder_deps="zlib"
2866-flv_decoder_select="h263_decoder"
2867-flv_encoder_select="h263_encoder"
2868-fourxm_decoder_select="blockdsp bswapdsp"
2869-fraps_decoder_select="bswapdsp huffman"
2870-g2m_decoder_deps="zlib"
2871-g2m_decoder_select="blockdsp idctdsp jpegtables"
2872-g729_decoder_select="audiodsp"
2873-h261_decoder_select="mpegvideodec"
2874-h261_encoder_select="mpegvideoenc"
2875-h263_decoder_select="h263_parser h263dsp mpegvideodec qpeldsp"
2876-h263_encoder_select="h263dsp mpegvideoenc"
2877-h263i_decoder_select="h263_decoder"
2878-h263p_decoder_select="h263_decoder"
2879-h263p_encoder_select="h263_encoder"
2880-h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel h264_sei videodsp"
2881-h264_decoder_suggest="error_resilience"
2882-hap_decoder_select="snappy texturedsp"
2883-hap_encoder_deps="libsnappy"
2884-hap_encoder_select="texturedspenc"
2885-hevc_decoder_select="bswapdsp cabac dovi_rpu golomb hevcparse hevc_sei videodsp"
2886-huffyuv_decoder_select="bswapdsp huffyuvdsp llviddsp"
2887-huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp llvidencdsp"
2888-hymt_decoder_select="huffyuv_decoder"
2889-iac_decoder_select="imc_decoder"
2890-imc_decoder_select="bswapdsp sinewin"
2891-imm4_decoder_select="bswapdsp idctdsp"
2892-imm5_decoder_select="h264_decoder hevc_decoder"
2893-indeo3_decoder_select="hpeldsp"
2894-indeo4_decoder_select="ividsp"
2895-indeo5_decoder_select="ividsp"
2896-interplay_video_decoder_select="hpeldsp"
2897-ipu_decoder_select="mpegvideodec"
2898-jpegls_decoder_select="mjpeg_decoder"
2899-jv_decoder_select="blockdsp"
2900-lagarith_decoder_select="llviddsp"
2901-ljpeg_encoder_select="jpegtables"
2902-lscr_decoder_select="inflate_wrapper"
2903-magicyuv_decoder_select="llviddsp"
2904-magicyuv_encoder_select="llvidencdsp"
2905-mdec_decoder_select="blockdsp bswapdsp idctdsp"
2906-media100_decoder_select="media100_to_mjpegb_bsf mjpegb_decoder"
2907-metasound_decoder_select="lsp sinewin"
2908-mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
2909-mjpeg_decoder_select="blockdsp hpeldsp exif idctdsp jpegtables"
2910-mjpeg_encoder_select="jpegtables mpegvideoenc"
2911-mjpegb_decoder_select="mjpeg_decoder"
2912-mlp_decoder_select="mlp_parser"
2913-mlp_encoder_select="lpc audio_frame_queue"
2914-mobiclip_decoder_select="bswapdsp golomb"
2915-motionpixels_decoder_select="bswapdsp"
2916-mp1_decoder_select="mpegaudio"
2917-mp1float_decoder_select="mpegaudio"
2918-mp2_decoder_select="mpegaudio"
2919-mp2float_decoder_select="mpegaudio"
2920-mp3_decoder_select="mpegaudio"
2921-mp3adu_decoder_select="mpegaudio"
2922-mp3adufloat_decoder_select="mpegaudio"
2923-mp3float_decoder_select="mpegaudio"
2924-mp3on4_decoder_select="mpegaudio mpeg4audio"
2925-mp3on4float_decoder_select="mpegaudio mpeg4audio"
2926-mpc7_decoder_select="bswapdsp mpegaudiodsp"
2927-mpc8_decoder_select="mpegaudiodsp"
2928-mpegvideo_decoder_select="mpegvideodec"
2929-mpeg1video_decoder_select="mpegvideodec"
2930-mpeg1video_encoder_select="mpegvideoenc"
2931-mpeg2video_decoder_select="mpegvideodec"
2932-mpeg2video_encoder_select="mpegvideoenc"
2933-mpeg4_decoder_select="h263_decoder mpeg4video_parser"
2934-mpeg4_encoder_select="h263_encoder qpeldsp"
2935-msa1_decoder_select="mss34dsp"
2936-mscc_decoder_select="inflate_wrapper"
2937-msmpeg4v1_decoder_select="msmpeg4dec"
2938-msmpeg4v2_decoder_select="msmpeg4dec"
2939-msmpeg4v2_encoder_select="msmpeg4enc"
2940-msmpeg4v3_decoder_select="msmpeg4dec"
2941-msmpeg4v3_encoder_select="msmpeg4enc"
2942-mss2_decoder_select="mpegvideodec qpeldsp vc1_decoder"
2943-mts2_decoder_select="jpegtables mss34dsp"
2944-mv30_decoder_select="aandcttables blockdsp"
2945-mvha_decoder_select="inflate_wrapper llviddsp"
2946-mwsc_decoder_select="inflate_wrapper"
2947-mxpeg_decoder_select="mjpeg_decoder"
2948-nellymoser_decoder_select="sinewin"
2949-nellymoser_encoder_select="audio_frame_queue sinewin"
2950-notchlc_decoder_select="lzf"
2951-nuv_decoder_select="idctdsp"
2952-opus_decoder_deps="swresample"
2953-opus_encoder_select="audio_frame_queue"
2954-pdv_decoder_deps="zlib"
2955-png_decoder_select="inflate_wrapper"
2956-png_encoder_select="deflate_wrapper llvidencdsp"
2957-prores_decoder_select="blockdsp idctdsp"
2958-prores_encoder_select="fdctdsp"
2959-prores_aw_encoder_select="fdctdsp"
2960-prores_ks_encoder_select="fdctdsp"
2961-qcelp_decoder_select="lsp"
2962-qdm2_decoder_select="mpegaudiodsp"
2963-ra_144_decoder_select="audiodsp"
2964-ra_144_encoder_select="audio_frame_queue lpc audiodsp"
2965-ralf_decoder_select="golomb"
2966-rasc_decoder_select="inflate_wrapper"
2967-rawvideo_decoder_select="bswapdsp"
2968-rscc_decoder_deps="zlib"
2969-rtv1_decoder_select="texturedsp"
2970-rv10_decoder_select="h263_decoder"
2971-rv10_encoder_select="h263_encoder"
2972-rv20_decoder_select="h263_decoder"
2973-rv20_encoder_select="h263_encoder"
2974-rv30_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
2975-rv40_decoder_select="golomb h264pred h264qpel mpegvideodec rv34dsp"
2976-screenpresso_decoder_deps="zlib"
2977-shorten_decoder_select="bswapdsp"
2978-sipr_decoder_select="lsp"
2979-smvjpeg_decoder_select="mjpeg_decoder"
2980-snow_decoder_select="dwt h264qpel rangecoder videodsp"
2981-snow_encoder_select="dwt h264qpel hpeldsp me_cmp mpegvideoenc rangecoder videodsp"
2982-sonic_decoder_select="golomb rangecoder"
2983-sonic_encoder_select="golomb rangecoder"
2984-sonic_ls_encoder_select="golomb rangecoder"
2985-sp5x_decoder_select="mjpeg_decoder"
2986-speedhq_decoder_select="blockdsp idctdsp"
2987-speedhq_encoder_select="mpegvideoenc"
2988-srgc_decoder_select="inflate_wrapper"
2989-svq1_decoder_select="hpeldsp"
2990-svq1_encoder_select="hpeldsp me_cmp mpegvideoenc"
2991-svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp"
2992-svq3_decoder_suggest="zlib"
2993-tak_decoder_select="audiodsp"
2994-tdsc_decoder_deps="zlib"
2995-tdsc_decoder_select="mjpeg_decoder"
2996-theora_decoder_select="vp3_decoder"
2997-thp_decoder_select="mjpeg_decoder"
2998-tiff_decoder_select="mjpeg_decoder"
2999-tiff_decoder_suggest="zlib lzma"
3000-tiff_encoder_suggest="zlib"
3001-truehd_decoder_select="mlp_parser"
3002-truehd_encoder_select="lpc audio_frame_queue"
3003-truemotion2_decoder_select="bswapdsp"
3004-truespeech_decoder_select="bswapdsp"
3005-tscc_decoder_select="inflate_wrapper"
3006-twinvq_decoder_select="lsp sinewin"
3007-txd_decoder_select="texturedsp"
3008-utvideo_decoder_select="bswapdsp llviddsp"
3009-utvideo_encoder_select="bswapdsp huffman llvidencdsp"
3010-vble_decoder_select="llviddsp"
3011-vbn_decoder_select="texturedsp"
3012-vbn_encoder_select="texturedspenc"
3013-vmix_decoder_select="idctdsp"
3014-vc1_decoder_select="blockdsp h264qpel intrax8 mpegvideodec qpeldsp vc1dsp"
3015-vc1image_decoder_select="vc1_decoder"
3016-vorbis_encoder_select="audio_frame_queue"
3017-vp3_decoder_select="hpeldsp vp3dsp videodsp"
3018-vp4_decoder_select="vp3_decoder"
3019-vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
3020-vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
3021-vp6a_decoder_select="vp6_decoder"
3022-vp6f_decoder_select="vp6_decoder"
3023-vp7_decoder_select="h264pred videodsp vp8dsp"
3024-vp8_decoder_select="h264pred videodsp vp8dsp"
3025-vp9_decoder_select="videodsp vp9_parser vp9_superframe_split_bsf"
3026-wcmv_decoder_select="inflate_wrapper"
3027-webp_decoder_select="vp8_decoder exif"
3028-wmalossless_decoder_select="llauddsp"
3029-wmapro_decoder_select="sinewin wma_freqs"
3030-wmav1_decoder_select="sinewin wma_freqs"
3031-wmav1_encoder_select="sinewin wma_freqs"
3032-wmav2_decoder_select="sinewin wma_freqs"
3033-wmav2_encoder_select="sinewin wma_freqs"
3034-wmavoice_decoder_select="lsp sinewin"
3035-wmv1_decoder_select="msmpeg4dec"
3036-wmv1_encoder_select="msmpeg4enc"
3037-wmv2_decoder_select="blockdsp error_resilience idctdsp intrax8 msmpeg4dec videodsp wmv2dsp"
3038-wmv2_encoder_select="msmpeg4enc wmv2dsp"
3039-wmv3_decoder_select="vc1_decoder"
3040-wmv3image_decoder_select="wmv3_decoder"
3041-xma1_decoder_select="wmapro_decoder"
3042-xma2_decoder_select="wmapro_decoder"
3043-ylc_decoder_select="bswapdsp"
3044-zerocodec_decoder_select="inflate_wrapper"
3045-zlib_decoder_select="inflate_wrapper"
3046-zlib_encoder_select="deflate_wrapper"
3047-zmbv_decoder_select="inflate_wrapper"
3048-zmbv_encoder_select="deflate_wrapper"
3049-
3050-# hardware accelerators
3051-crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
3052-cuda_deps="ffnvcodec"
3053-cuvid_deps="ffnvcodec"
3054-d3d11va_deps="dxva_h ID3D11VideoDecoder ID3D11VideoContext"
3055-dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32 user32"
3056-ffnvcodec_deps_any="libdl LoadLibrary"
3057-mediacodec_deps="android"
3058-nvdec_deps="ffnvcodec"
3059-vaapi_x11_deps="xlib_x11"
3060-videotoolbox_hwaccel_deps="videotoolbox pthreads"
3061-videotoolbox_hwaccel_extralibs="-framework QuartzCore"
3062-vulkan_deps_any="libdl LoadLibrary"
3063-
3064-av1_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
3065-av1_d3d11va_hwaccel_select="av1_decoder"
3066-av1_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_AV1"
3067-av1_d3d11va2_hwaccel_select="av1_decoder"
3068-av1_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_AV1"
3069-av1_dxva2_hwaccel_select="av1_decoder"
3070-av1_nvdec_hwaccel_deps="nvdec CUVIDAV1PICPARAMS"
3071-av1_nvdec_hwaccel_select="av1_decoder"
3072-av1_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferAV1_bit_depth_idx"
3073-av1_vaapi_hwaccel_select="av1_decoder"
3074-av1_vdpau_hwaccel_deps="vdpau VdpPictureInfoAV1"
3075-av1_vdpau_hwaccel_select="av1_decoder"
3076-av1_vulkan_hwaccel_deps="vulkan"
3077-av1_vulkan_hwaccel_select="av1_decoder"
3078-h263_vaapi_hwaccel_deps="vaapi"
3079-h263_vaapi_hwaccel_select="h263_decoder"
3080-h263_videotoolbox_hwaccel_deps="videotoolbox"
3081-h263_videotoolbox_hwaccel_select="h263_decoder"
3082-h264_d3d11va_hwaccel_deps="d3d11va"
3083-h264_d3d11va_hwaccel_select="h264_decoder"
3084-h264_d3d11va2_hwaccel_deps="d3d11va"
3085-h264_d3d11va2_hwaccel_select="h264_decoder"
3086-h264_dxva2_hwaccel_deps="dxva2"
3087-h264_dxva2_hwaccel_select="h264_decoder"
3088-h264_nvdec_hwaccel_deps="nvdec"
3089-h264_nvdec_hwaccel_select="h264_decoder"
3090-h264_vaapi_hwaccel_deps="vaapi"
3091-h264_vaapi_hwaccel_select="h264_decoder"
3092-h264_vdpau_hwaccel_deps="vdpau"
3093-h264_vdpau_hwaccel_select="h264_decoder"
3094-h264_videotoolbox_hwaccel_deps="videotoolbox"
3095-h264_videotoolbox_hwaccel_select="h264_decoder"
3096-h264_vulkan_hwaccel_deps="vulkan"
3097-h264_vulkan_hwaccel_select="h264_decoder"
3098-hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
3099-hevc_d3d11va_hwaccel_select="hevc_decoder"
3100-hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
3101-hevc_d3d11va2_hwaccel_select="hevc_decoder"
3102-hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
3103-hevc_dxva2_hwaccel_select="hevc_decoder"
3104-hevc_nvdec_hwaccel_deps="nvdec"
3105-hevc_nvdec_hwaccel_select="hevc_decoder"
3106-hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
3107-hevc_vaapi_hwaccel_select="hevc_decoder"
3108-hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
3109-hevc_vdpau_hwaccel_select="hevc_decoder"
3110-hevc_videotoolbox_hwaccel_deps="videotoolbox"
3111-hevc_videotoolbox_hwaccel_select="hevc_decoder"
3112-hevc_vulkan_hwaccel_deps="vulkan"
3113-hevc_vulkan_hwaccel_select="hevc_decoder"
3114-mjpeg_nvdec_hwaccel_deps="nvdec"
3115-mjpeg_nvdec_hwaccel_select="mjpeg_decoder"
3116-mjpeg_vaapi_hwaccel_deps="vaapi"
3117-mjpeg_vaapi_hwaccel_select="mjpeg_decoder"
3118-mpeg1_nvdec_hwaccel_deps="nvdec"
3119-mpeg1_nvdec_hwaccel_select="mpeg1video_decoder"
3120-mpeg1_vdpau_hwaccel_deps="vdpau"
3121-mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
3122-mpeg1_videotoolbox_hwaccel_deps="videotoolbox"
3123-mpeg1_videotoolbox_hwaccel_select="mpeg1video_decoder"
3124-mpeg2_d3d11va_hwaccel_deps="d3d11va"
3125-mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
3126-mpeg2_d3d11va2_hwaccel_deps="d3d11va"
3127-mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder"
3128-mpeg2_dxva2_hwaccel_deps="dxva2"
3129-mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
3130-mpeg2_nvdec_hwaccel_deps="nvdec"
3131-mpeg2_nvdec_hwaccel_select="mpeg2video_decoder"
3132-mpeg2_vaapi_hwaccel_deps="vaapi"
3133-mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
3134-mpeg2_vdpau_hwaccel_deps="vdpau"
3135-mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
3136-mpeg2_videotoolbox_hwaccel_deps="videotoolbox"
3137-mpeg2_videotoolbox_hwaccel_select="mpeg2video_decoder"
3138-mpeg4_nvdec_hwaccel_deps="nvdec"
3139-mpeg4_nvdec_hwaccel_select="mpeg4_decoder"
3140-mpeg4_vaapi_hwaccel_deps="vaapi"
3141-mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
3142-mpeg4_vdpau_hwaccel_deps="vdpau"
3143-mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
3144-mpeg4_videotoolbox_hwaccel_deps="videotoolbox"
3145-mpeg4_videotoolbox_hwaccel_select="mpeg4_decoder"
3146-prores_videotoolbox_hwaccel_deps="videotoolbox"
3147-prores_videotoolbox_hwaccel_select="prores_decoder"
3148-vc1_d3d11va_hwaccel_deps="d3d11va"
3149-vc1_d3d11va_hwaccel_select="vc1_decoder"
3150-vc1_d3d11va2_hwaccel_deps="d3d11va"
3151-vc1_d3d11va2_hwaccel_select="vc1_decoder"
3152-vc1_dxva2_hwaccel_deps="dxva2"
3153-vc1_dxva2_hwaccel_select="vc1_decoder"
3154-vc1_nvdec_hwaccel_deps="nvdec"
3155-vc1_nvdec_hwaccel_select="vc1_decoder"
3156-vc1_vaapi_hwaccel_deps="vaapi"
3157-vc1_vaapi_hwaccel_select="vc1_decoder"
3158-vc1_vdpau_hwaccel_deps="vdpau"
3159-vc1_vdpau_hwaccel_select="vc1_decoder"
3160-vp8_nvdec_hwaccel_deps="nvdec"
3161-vp8_nvdec_hwaccel_select="vp8_decoder"
3162-vp8_vaapi_hwaccel_deps="vaapi"
3163-vp8_vaapi_hwaccel_select="vp8_decoder"
3164-vp9_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
3165-vp9_d3d11va_hwaccel_select="vp9_decoder"
3166-vp9_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_VP9"
3167-vp9_d3d11va2_hwaccel_select="vp9_decoder"
3168-vp9_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_VP9"
3169-vp9_dxva2_hwaccel_select="vp9_decoder"
3170-vp9_nvdec_hwaccel_deps="nvdec"
3171-vp9_nvdec_hwaccel_select="vp9_decoder"
3172-vp9_vaapi_hwaccel_deps="vaapi VADecPictureParameterBufferVP9_bit_depth"
3173-vp9_vaapi_hwaccel_select="vp9_decoder"
3174-vp9_vdpau_hwaccel_deps="vdpau VdpPictureInfoVP9"
3175-vp9_vdpau_hwaccel_select="vp9_decoder"
3176-vp9_videotoolbox_hwaccel_deps="videotoolbox"
3177-vp9_videotoolbox_hwaccel_select="vp9_decoder"
3178-wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
3179-wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
3180-wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
3181-wmv3_nvdec_hwaccel_select="vc1_nvdec_hwaccel"
3182-wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
3183-wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
3184-
3185-# hardware-accelerated codecs
3186-mediafoundation_deps="mftransform_h MFCreateAlignedMemoryBuffer"
3187-omx_deps="libdl pthreads"
3188-omx_rpi_select="omx"
3189-qsv_deps="libmfx"
3190-qsvdec_select="qsv"
3191-qsvenc_select="qsv"
3192-qsvvpp_select="qsv"
3193-vaapi_encode_deps="vaapi"
3194-v4l2_m2m_deps="linux_videodev2_h sem_timedwait"
3195-
3196-bilateral_cuda_filter_deps="ffnvcodec"
3197-bilateral_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3198-chromakey_cuda_filter_deps="ffnvcodec"
3199-chromakey_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3200-colorspace_cuda_filter_deps="ffnvcodec"
3201-colorspace_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3202-hwupload_cuda_filter_deps="ffnvcodec"
3203-scale_npp_filter_deps="ffnvcodec libnpp"
3204-scale2ref_npp_filter_deps="ffnvcodec libnpp"
3205-scale_cuda_filter_deps="ffnvcodec"
3206-scale_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3207-thumbnail_cuda_filter_deps="ffnvcodec"
3208-thumbnail_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3209-transpose_npp_filter_deps="ffnvcodec libnpp"
3210-overlay_cuda_filter_deps="ffnvcodec"
3211-overlay_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3212-sharpen_npp_filter_deps="ffnvcodec libnpp"
3213-
3214-ddagrab_filter_deps="d3d11va IDXGIOutput1 DXGI_OUTDUPL_FRAME_INFO"
3215-
3216-amf_deps_any="libdl LoadLibrary"
3217-nvenc_deps="ffnvcodec"
3218-nvenc_deps_any="libdl LoadLibrary"
3219-
3220-aac_mf_encoder_deps="mediafoundation"
3221-ac3_mf_encoder_deps="mediafoundation"
3222-av1_cuvid_decoder_deps="cuvid CUVIDAV1PICPARAMS"
3223-av1_mediacodec_decoder_deps="mediacodec"
3224-av1_mediacodec_encoder_deps="mediacodec"
3225-av1_nvenc_encoder_deps="nvenc NV_ENC_PIC_PARAMS_AV1"
3226-av1_nvenc_encoder_select="atsc_a53"
3227-h263_v4l2m2m_decoder_deps="v4l2_m2m h263_v4l2_m2m"
3228-h263_v4l2m2m_encoder_deps="v4l2_m2m h263_v4l2_m2m"
3229-h264_amf_encoder_deps="amf"
3230-h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
3231-h264_cuvid_decoder_deps="cuvid"
3232-h264_cuvid_decoder_select="h264_mp4toannexb_bsf"
3233-h264_mediacodec_decoder_deps="mediacodec"
3234-h264_mediacodec_decoder_select="h264_mp4toannexb_bsf h264_parser"
3235-h264_mediacodec_encoder_deps="mediacodec"
3236-h264_mediacodec_encoder_select="h264_metadata"
3237-h264_mf_encoder_deps="mediafoundation"
3238-h264_mmal_decoder_deps="mmal"
3239-h264_nvenc_encoder_deps="nvenc"
3240-h264_nvenc_encoder_select="atsc_a53"
3241-h264_omx_encoder_deps="omx"
3242-h264_qsv_decoder_select="h264_mp4toannexb_bsf qsvdec"
3243-h264_qsv_encoder_select="atsc_a53 qsvenc"
3244-h264_rkmpp_decoder_deps="rkmpp"
3245-h264_rkmpp_decoder_select="h264_mp4toannexb_bsf"
3246-h264_vaapi_encoder_select="atsc_a53 cbs_h264 vaapi_encode"
3247-h264_v4l2m2m_decoder_deps="v4l2_m2m h264_v4l2_m2m"
3248-h264_v4l2m2m_decoder_select="h264_mp4toannexb_bsf"
3249-h264_v4l2m2m_encoder_deps="v4l2_m2m h264_v4l2_m2m"
3250-hevc_amf_encoder_deps="amf"
3251-hevc_cuvid_decoder_deps="cuvid"
3252-hevc_cuvid_decoder_select="hevc_mp4toannexb_bsf"
3253-hevc_mediacodec_decoder_deps="mediacodec"
3254-hevc_mediacodec_decoder_select="hevc_mp4toannexb_bsf hevc_parser"
3255-hevc_mediacodec_encoder_deps="mediacodec"
3256-hevc_mediacodec_encoder_select="hevc_metadata"
3257-hevc_mf_encoder_deps="mediafoundation"
3258-hevc_nvenc_encoder_deps="nvenc"
3259-hevc_nvenc_encoder_select="atsc_a53"
3260-hevc_qsv_decoder_select="hevc_mp4toannexb_bsf qsvdec"
3261-hevc_qsv_encoder_select="hevcparse qsvenc"
3262-hevc_rkmpp_decoder_deps="rkmpp"
3263-hevc_rkmpp_decoder_select="hevc_mp4toannexb_bsf"
3264-hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
3265-hevc_vaapi_encoder_select="atsc_a53 cbs_h265 vaapi_encode"
3266-hevc_v4l2m2m_decoder_deps="v4l2_m2m hevc_v4l2_m2m"
3267-hevc_v4l2m2m_decoder_select="hevc_mp4toannexb_bsf"
3268-hevc_v4l2m2m_encoder_deps="v4l2_m2m hevc_v4l2_m2m"
3269-mjpeg_cuvid_decoder_deps="cuvid"
3270-mjpeg_qsv_decoder_select="qsvdec"
3271-mjpeg_qsv_encoder_deps="libmfx"
3272-mjpeg_qsv_encoder_select="qsvenc"
3273-mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
3274-mjpeg_vaapi_encoder_select="cbs_jpeg jpegtables vaapi_encode"
3275-mp3_mf_encoder_deps="mediafoundation"
3276-mpeg1_cuvid_decoder_deps="cuvid"
3277-mpeg1_v4l2m2m_decoder_deps="v4l2_m2m mpeg1_v4l2_m2m"
3278-mpeg2_crystalhd_decoder_select="crystalhd"
3279-mpeg2_cuvid_decoder_deps="cuvid"
3280-mpeg2_mmal_decoder_deps="mmal"
3281-mpeg2_mediacodec_decoder_deps="mediacodec"
3282-mpeg2_qsv_decoder_select="qsvdec"
3283-mpeg2_qsv_encoder_select="qsvenc"
3284-mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode"
3285-mpeg2_v4l2m2m_decoder_deps="v4l2_m2m mpeg2_v4l2_m2m"
3286-mpeg4_crystalhd_decoder_select="crystalhd"
3287-mpeg4_cuvid_decoder_deps="cuvid"
3288-mpeg4_mediacodec_decoder_deps="mediacodec"
3289-mpeg4_mediacodec_encoder_deps="mediacodec"
3290-mpeg4_mmal_decoder_deps="mmal"
3291-mpeg4_omx_encoder_deps="omx"
3292-mpeg4_v4l2m2m_decoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
3293-mpeg4_v4l2m2m_encoder_deps="v4l2_m2m mpeg4_v4l2_m2m"
3294-msmpeg4_crystalhd_decoder_select="crystalhd"
3295-vc1_crystalhd_decoder_select="crystalhd"
3296-vc1_cuvid_decoder_deps="cuvid"
3297-vc1_mmal_decoder_deps="mmal"
3298-vc1_qsv_decoder_select="qsvdec"
3299-vc1_v4l2m2m_decoder_deps="v4l2_m2m vc1_v4l2_m2m"
3300-vp8_cuvid_decoder_deps="cuvid"
3301-vp8_mediacodec_decoder_deps="mediacodec"
3302-vp8_mediacodec_encoder_deps="mediacodec"
3303-vp8_qsv_decoder_select="qsvdec"
3304-vp8_rkmpp_decoder_deps="rkmpp"
3305-vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
3306-vp8_vaapi_encoder_select="vaapi_encode"
3307-vp8_v4l2m2m_decoder_deps="v4l2_m2m vp8_v4l2_m2m"
3308-vp8_v4l2m2m_encoder_deps="v4l2_m2m vp8_v4l2_m2m"
3309-vp9_cuvid_decoder_deps="cuvid"
3310-vp9_mediacodec_decoder_deps="mediacodec"
3311-vp9_mediacodec_encoder_deps="mediacodec"
3312-vp9_qsv_decoder_select="qsvdec"
3313-vp9_rkmpp_decoder_deps="rkmpp"
3314-vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
3315-vp9_vaapi_encoder_select="vaapi_encode"
3316-vp9_qsv_encoder_deps="libmfx MFX_CODEC_VP9"
3317-vp9_qsv_encoder_select="qsvenc"
3318-vp9_v4l2m2m_decoder_deps="v4l2_m2m vp9_v4l2_m2m"
3319-wmv3_crystalhd_decoder_select="crystalhd"
3320-av1_qsv_decoder_select="qsvdec"
3321-av1_qsv_encoder_select="qsvenc"
3322-av1_qsv_encoder_deps="libvpl"
3323-av1_amf_encoder_deps="amf"
3324-av1_vaapi_encoder_deps="VAEncPictureParameterBufferAV1"
3325-av1_vaapi_encoder_select="cbs_av1 vaapi_encode"
3326-
3327-# parsers
3328-aac_parser_select="adts_header mpeg4audio"
3329-av1_parser_select="cbs_av1"
3330-evc_parser_select="evcparse"
3331-h264_parser_select="golomb h264dsp h264parse h264_sei"
3332-hevc_parser_select="hevcparse hevc_sei"
3333-mpegaudio_parser_select="mpegaudioheader"
3334-mpeg4video_parser_select="h263dsp mpegvideodec qpeldsp"
3335-vc1_parser_select="vc1dsp"
3336-vvc_parser_select="cbs_h266"
3337-
3338-# bitstream_filters
3339-aac_adtstoasc_bsf_select="adts_header mpeg4audio"
3340-av1_frame_merge_bsf_select="cbs_av1"
3341-av1_frame_split_bsf_select="cbs_av1"
3342-av1_metadata_bsf_select="cbs_av1"
3343-dts2pts_bsf_select="cbs_h264 h264parse"
3344-eac3_core_bsf_select="ac3_parser"
3345-evc_frame_merge_bsf_select="evcparse"
3346-filter_units_bsf_select="cbs"
3347-h264_metadata_bsf_deps="const_nan"
3348-h264_metadata_bsf_select="cbs_h264"
3349-h264_redundant_pps_bsf_select="cbs_h264"
3350-hevc_metadata_bsf_select="cbs_h265"
3351-mjpeg2jpeg_bsf_select="jpegtables"
3352-mpeg2_metadata_bsf_select="cbs_mpeg2"
3353-trace_headers_bsf_select="cbs"
3354-vp9_metadata_bsf_select="cbs_vp9"
3355-vvc_metadata_bsf_select="cbs_h266"
3356-
3357-# external libraries
3358-aac_at_decoder_deps="audiotoolbox"
3359-aac_at_decoder_select="aac_adtstoasc_bsf"
3360-ac3_at_decoder_deps="audiotoolbox"
3361-ac3_at_decoder_select="ac3_parser"
3362-adpcm_ima_qt_at_decoder_deps="audiotoolbox"
3363-alac_at_decoder_deps="audiotoolbox"
3364-amr_nb_at_decoder_deps="audiotoolbox"
3365-avisynth_deps_any="libdl LoadLibrary"
3366-avisynth_demuxer_deps="avisynth"
3367-avisynth_demuxer_select="riffdec"
3368-eac3_at_decoder_deps="audiotoolbox"
3369-eac3_at_decoder_select="ac3_parser"
3370-gsm_ms_at_decoder_deps="audiotoolbox"
3371-ilbc_at_decoder_deps="audiotoolbox"
3372-mp1_at_decoder_deps="audiotoolbox"
3373-mp2_at_decoder_deps="audiotoolbox"
3374-mp3_at_decoder_deps="audiotoolbox"
3375-mp1_at_decoder_select="mpegaudioheader"
3376-mp2_at_decoder_select="mpegaudioheader"
3377-mp3_at_decoder_select="mpegaudioheader"
3378-pcm_alaw_at_decoder_deps="audiotoolbox"
3379-pcm_mulaw_at_decoder_deps="audiotoolbox"
3380-qdmc_at_decoder_deps="audiotoolbox"
3381-qdm2_at_decoder_deps="audiotoolbox"
3382-aac_at_encoder_deps="audiotoolbox"
3383-aac_at_encoder_select="audio_frame_queue"
3384-alac_at_encoder_deps="audiotoolbox"
3385-alac_at_encoder_select="audio_frame_queue"
3386-ilbc_at_encoder_deps="audiotoolbox"
3387-ilbc_at_encoder_select="audio_frame_queue"
3388-pcm_alaw_at_encoder_deps="audiotoolbox"
3389-pcm_alaw_at_encoder_select="audio_frame_queue"
3390-pcm_mulaw_at_encoder_deps="audiotoolbox"
3391-pcm_mulaw_at_encoder_select="audio_frame_queue"
3392-chromaprint_muxer_deps="chromaprint"
3393-h264_videotoolbox_encoder_deps="pthreads"
3394-h264_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
3395-hevc_videotoolbox_encoder_deps="pthreads"
3396-hevc_videotoolbox_encoder_select="atsc_a53 videotoolbox_encoder"
3397-prores_videotoolbox_encoder_deps="pthreads"
3398-prores_videotoolbox_encoder_select="videotoolbox_encoder"
3399-libaom_av1_decoder_deps="libaom"
3400-libaom_av1_encoder_deps="libaom"
3401-libaom_av1_encoder_select="extract_extradata_bsf"
3402-libaribb24_decoder_deps="libaribb24"
3403-libaribcaption_decoder_deps="libaribcaption"
3404-libcelt_decoder_deps="libcelt"
3405-libcodec2_decoder_deps="libcodec2"
3406-libcodec2_encoder_deps="libcodec2"
3407-libdav1d_decoder_deps="libdav1d"
3408-libdav1d_decoder_select="atsc_a53"
3409-libdavs2_decoder_deps="libdavs2"
3410-libdavs2_decoder_select="avs2_parser"
3411-libfdk_aac_decoder_deps="libfdk_aac"
3412-libfdk_aac_encoder_deps="libfdk_aac"
3413-libfdk_aac_encoder_select="audio_frame_queue"
3414-libgme_demuxer_deps="libgme"
3415-libgsm_decoder_deps="libgsm"
3416-libgsm_encoder_deps="libgsm"
3417-libgsm_ms_decoder_deps="libgsm"
3418-libgsm_ms_encoder_deps="libgsm"
3419-libilbc_decoder_deps="libilbc"
3420-libilbc_encoder_deps="libilbc"
3421-libjxl_decoder_deps="libjxl libjxl_threads"
3422-libjxl_encoder_deps="libjxl libjxl_threads"
3423-libkvazaar_encoder_deps="libkvazaar"
3424-libmodplug_demuxer_deps="libmodplug"
3425-libmp3lame_encoder_deps="libmp3lame"
3426-libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
3427-libopencore_amrnb_decoder_deps="libopencore_amrnb"
3428-libopencore_amrnb_encoder_deps="libopencore_amrnb"
3429-libopencore_amrnb_encoder_select="audio_frame_queue"
3430-libopencore_amrwb_decoder_deps="libopencore_amrwb"
3431-libopenh264_decoder_deps="libopenh264"
3432-libopenh264_decoder_select="h264_mp4toannexb_bsf"
3433-libopenh264_encoder_deps="libopenh264"
3434-libopenjpeg_encoder_deps="libopenjpeg"
3435-libopenmpt_demuxer_deps="libopenmpt"
3436-libopus_decoder_deps="libopus"
3437-libopus_encoder_deps="libopus"
3438-libopus_encoder_select="audio_frame_queue"
3439-librav1e_encoder_deps="librav1e"
3440-librsvg_decoder_deps="librsvg"
3441-libshine_encoder_deps="libshine"
3442-libshine_encoder_select="audio_frame_queue mpegaudioheader"
3443-libspeex_decoder_deps="libspeex"
3444-libspeex_encoder_deps="libspeex"
3445-libspeex_encoder_select="audio_frame_queue"
3446-libsvtav1_encoder_deps="libsvtav1"
3447-libtheora_encoder_deps="libtheora"
3448-libtwolame_encoder_deps="libtwolame"
3449-libuavs3d_decoder_deps="libuavs3d"
3450-libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
3451-libvorbis_decoder_deps="libvorbis"
3452-libvorbis_encoder_deps="libvorbis libvorbisenc"
3453-libvorbis_encoder_select="audio_frame_queue"
3454-libvpx_vp8_decoder_deps="libvpx"
3455-libvpx_vp8_encoder_deps="libvpx"
3456-libvpx_vp9_decoder_deps="libvpx"
3457-libvpx_vp9_encoder_deps="libvpx"
3458-libwebp_encoder_deps="libwebp"
3459-libwebp_anim_encoder_deps="libwebp"
3460-libx262_encoder_deps="libx262"
3461-libx264_encoder_deps="libx264"
3462-libx264_encoder_select="atsc_a53"
3463-libx264rgb_encoder_deps="libx264"
3464-libx264rgb_encoder_select="libx264_encoder"
3465-libx265_encoder_deps="libx265"
3466-libx265_encoder_select="atsc_a53"
3467-libxavs_encoder_deps="libxavs"
3468-libxavs2_encoder_deps="libxavs2"
3469-libxvid_encoder_deps="libxvid"
3470-libzvbi_teletext_decoder_deps="libzvbi"
3471-vapoursynth_demuxer_deps="vapoursynth"
3472-videotoolbox_suggest="coreservices"
3473-videotoolbox_deps="corefoundation coremedia corevideo"
3474-videotoolbox_encoder_deps="videotoolbox VTCompressionSessionPrepareToEncodeFrames"
3475-
3476-# demuxers / muxers
3477-ac3_demuxer_select="ac3_parser"
3478-act_demuxer_select="riffdec"
3479-adts_muxer_select="mpeg4audio"
3480-aiff_muxer_select="iso_media"
3481-amv_muxer_select="riffenc"
3482-asf_demuxer_select="riffdec"
3483-asf_o_demuxer_select="riffdec"
3484-asf_muxer_select="riffenc"
3485-asf_stream_muxer_select="asf_muxer"
3486-av1_demuxer_select="av1_frame_merge_bsf av1_parser"
3487-avi_demuxer_select="riffdec exif"
3488-avi_muxer_select="riffenc"
3489-avif_muxer_select="mov_muxer"
3490-caf_demuxer_select="iso_media"
3491-caf_muxer_select="iso_media"
3492-dash_muxer_select="mp4_muxer"
3493-dash_demuxer_deps="libxml2"
3494-dirac_demuxer_select="dirac_parser"
3495-dts_demuxer_select="dca_parser"
3496-dtshd_demuxer_select="dca_parser"
3497-dv_demuxer_select="dvprofile"
3498-dv_muxer_select="dvprofile"
3499-dxa_demuxer_select="riffdec"
3500-eac3_demuxer_select="ac3_parser"
3501-evc_demuxer_select="evc_frame_merge_bsf evc_parser"
3502-f4v_muxer_select="mov_muxer"
3503-fifo_muxer_deps="threads"
3504-flac_demuxer_select="flac_parser"
3505-flv_muxer_select="aac_adtstoasc_bsf"
3506-gxf_muxer_select="pcm_rechunk_bsf"
3507-hds_muxer_select="flv_muxer"
3508-hls_demuxer_select="adts_header ac3_parser mov_demuxer mpegts_demuxer"
3509-hls_muxer_select="mov_muxer mpegts_muxer"
3510-image2_alias_pix_demuxer_select="image2_demuxer"
3511-image2_brender_pix_demuxer_select="image2_demuxer"
3512-imf_demuxer_deps="libxml2"
3513-imf_demuxer_select="mxf_demuxer"
3514-ipod_muxer_select="mov_muxer"
3515-ismv_muxer_select="mov_muxer"
3516-ivf_muxer_select="av1_metadata_bsf vp9_superframe_bsf"
3517-latm_muxer_select="aac_adtstoasc_bsf mpeg4audio"
3518-matroska_audio_muxer_select="matroska_muxer"
3519-matroska_demuxer_select="riffdec"
3520-matroska_demuxer_suggest="bzlib zlib"
3521-matroska_muxer_select="mpeg4audio riffenc aac_adtstoasc_bsf pgs_frame_merge_bsf vp9_superframe_bsf"
3522-mlp_demuxer_select="mlp_parser"
3523-mmf_muxer_select="riffenc"
3524-mov_demuxer_select="iso_media riffdec"
3525-mov_demuxer_suggest="zlib"
3526-mov_muxer_select="iso_media riffenc rtpenc_chain vp9_superframe_bsf aac_adtstoasc_bsf ac3_parser"
3527-mp3_demuxer_select="mpegaudio_parser"
3528-mp3_muxer_select="mpegaudioheader"
3529-mp4_muxer_select="mov_muxer"
3530-mpegts_demuxer_select="iso_media"
3531-mpegts_muxer_select="ac3_parser adts_muxer latm_muxer h264_mp4toannexb_bsf hevc_mp4toannexb_bsf"
3532-mpegtsraw_demuxer_select="mpegts_demuxer"
3533-mxf_muxer_select="pcm_rechunk_bsf rangecoder"
3534-mxf_d10_muxer_select="mxf_muxer"
3535-mxf_opatom_muxer_select="mxf_muxer"
3536-nut_muxer_select="riffenc"
3537-nuv_demuxer_select="riffdec"
3538-obu_demuxer_select="av1_frame_merge_bsf av1_parser"
3539-obu_muxer_select="av1_metadata_bsf"
3540-oga_muxer_select="ogg_muxer"
3541-ogg_demuxer_select="dirac_parse"
3542-ogv_muxer_select="ogg_muxer"
3543-opus_muxer_select="ogg_muxer"
3544-psp_muxer_select="mov_muxer"
3545-rtp_demuxer_select="sdp_demuxer"
3546-rtp_mpegts_muxer_select="mpegts_muxer rtp_muxer"
3547-rtpdec_select="asf_demuxer mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
3548-rtsp_demuxer_select="http_protocol rtpdec"
3549-rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
3550-sap_demuxer_select="sdp_demuxer"
3551-sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
3552-sdp_demuxer_select="rtpdec"
3553-smoothstreaming_muxer_select="ismv_muxer"
3554-spdif_demuxer_select="adts_header"
3555-spdif_muxer_select="adts_header"
3556-spx_muxer_select="ogg_muxer"
3557-swf_demuxer_suggest="zlib"
3558-tak_demuxer_select="tak_parser"
3559-truehd_demuxer_select="mlp_parser"
3560-tg2_muxer_select="mov_muxer"
3561-tgp_muxer_select="mov_muxer"
3562-vobsub_demuxer_select="mpegps_demuxer"
3563-w64_demuxer_select="wav_demuxer"
3564-w64_muxer_select="wav_muxer"
3565-wav_demuxer_select="riffdec"
3566-wav_muxer_select="riffenc"
3567-webm_chunk_muxer_select="webm_muxer"
3568-webm_dash_manifest_demuxer_select="matroska_demuxer"
3569-wtv_demuxer_select="mpegts_demuxer riffdec"
3570-wtv_muxer_select="mpegts_muxer riffenc"
3571-xmv_demuxer_select="riffdec"
3572-xwma_demuxer_select="riffdec"
3573-
3574-# indevs / outdevs
3575-android_camera_indev_deps="android camera2ndk mediandk pthreads"
3576-alsa_indev_deps="alsa"
3577-alsa_outdev_deps="alsa"
3578-avfoundation_indev_deps="avfoundation corevideo coremedia pthreads"
3579-avfoundation_indev_suggest="coregraphics applicationservices"
3580-avfoundation_indev_extralibs="-framework Foundation"
3581-audiotoolbox_outdev_deps="audiotoolbox pthreads"
3582-audiotoolbox_outdev_extralibs="-framework AudioToolbox -framework CoreAudio"
3583-bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
3584-caca_outdev_deps="libcaca"
3585-decklink_deps_any="libdl LoadLibrary"
3586-decklink_indev_deps="decklink threads"
3587-decklink_indev_extralibs="-lstdc++"
3588-decklink_indev_suggest="libzvbi"
3589-decklink_outdev_deps="decklink threads"
3590-decklink_outdev_suggest="libklvanc"
3591-decklink_outdev_extralibs="-lstdc++"
3592-dshow_indev_deps="IBaseFilter"
3593-dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid -loleaut32 -lshlwapi"
3594-fbdev_indev_deps="linux_fb_h"
3595-fbdev_outdev_deps="linux_fb_h"
3596-gdigrab_indev_deps="CreateDIBSection"
3597-gdigrab_indev_extralibs="-lgdi32"
3598-gdigrab_indev_select="bmp_decoder"
3599-iec61883_indev_deps="libiec61883"
3600-iec61883_indev_select="dv_demuxer"
3601-jack_indev_deps="libjack"
3602-jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
3603-kmsgrab_indev_deps="libdrm"
3604-lavfi_indev_deps="avfilter"
3605-libcdio_indev_deps="libcdio"
3606-libdc1394_indev_deps="libdc1394"
3607-openal_indev_deps="openal"
3608-opengl_outdev_deps="opengl"
3609-opengl_outdev_suggest="sdl2"
3610-oss_indev_deps_any="sys_soundcard_h"
3611-oss_outdev_deps_any="sys_soundcard_h"
3612-pulse_indev_deps="libpulse"
3613-pulse_outdev_deps="libpulse"
3614-sdl2_outdev_deps="sdl2"
3615-sndio_indev_deps="sndio"
3616-sndio_outdev_deps="sndio"
3617-v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
3618-v4l2_indev_suggest="libv4l2"
3619-v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
3620-v4l2_outdev_suggest="libv4l2"
3621-vfwcap_indev_deps="vfw32 vfwcap_defines"
3622-xcbgrab_indev_deps="libxcb"
3623-xcbgrab_indev_suggest="libxcb_shm libxcb_shape libxcb_xfixes"
3624-xv_outdev_deps="xlib_xv xlib_x11 xlib_xext"
3625-
3626-# protocols
3627-async_protocol_deps="threads"
3628-bluray_protocol_deps="libbluray"
3629-ffrtmpcrypt_protocol_conflict="librtmp_protocol"
3630-ffrtmpcrypt_protocol_deps_any="gcrypt gmp openssl mbedtls"
3631-ffrtmpcrypt_protocol_select="tcp_protocol"
3632-ffrtmphttp_protocol_conflict="librtmp_protocol"
3633-ffrtmphttp_protocol_select="http_protocol"
3634-ftp_protocol_select="tcp_protocol"
3635-gopher_protocol_select="tcp_protocol"
3636-gophers_protocol_select="tls_protocol"
3637-http_protocol_select="tcp_protocol"
3638-http_protocol_suggest="zlib"
3639-httpproxy_protocol_select="tcp_protocol"
3640-httpproxy_protocol_suggest="zlib"
3641-https_protocol_select="tls_protocol"
3642-https_protocol_suggest="zlib"
3643-icecast_protocol_select="http_protocol"
3644-mmsh_protocol_select="http_protocol"
3645-mmst_protocol_select="network"
3646-rtmp_protocol_conflict="librtmp_protocol"
3647-rtmp_protocol_select="tcp_protocol"
3648-rtmp_protocol_suggest="zlib"
3649-rtmpe_protocol_select="ffrtmpcrypt_protocol"
3650-rtmpe_protocol_suggest="zlib"
3651-rtmps_protocol_conflict="librtmp_protocol"
3652-rtmps_protocol_select="tls_protocol"
3653-rtmps_protocol_suggest="zlib"
3654-rtmpt_protocol_select="ffrtmphttp_protocol"
3655-rtmpt_protocol_suggest="zlib"
3656-rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
3657-rtmpte_protocol_suggest="zlib"
3658-rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
3659-rtmpts_protocol_suggest="zlib"
3660-rtp_protocol_select="udp_protocol"
3661-schannel_conflict="openssl gnutls libtls mbedtls"
3662-sctp_protocol_deps="struct_sctp_event_subscribe struct_msghdr_msg_flags"
3663-sctp_protocol_select="network"
3664-securetransport_conflict="openssl gnutls libtls mbedtls"
3665-srtp_protocol_select="rtp_protocol srtp"
3666-tcp_protocol_select="network"
3667-tls_protocol_deps_any="gnutls openssl schannel securetransport libtls mbedtls"
3668-tls_protocol_select="tcp_protocol"
3669-udp_protocol_select="network"
3670-udplite_protocol_select="network"
3671-unix_protocol_deps="sys_un_h"
3672-unix_protocol_select="network"
3673-ipfs_gateway_protocol_select="https_protocol"
3674-ipns_gateway_protocol_select="https_protocol"
3675-
3676-# external library protocols
3677-libamqp_protocol_deps="librabbitmq"
3678-libamqp_protocol_select="network"
3679-librist_protocol_deps="librist"
3680-librist_protocol_select="network"
3681-librtmp_protocol_deps="librtmp"
3682-librtmpe_protocol_deps="librtmp"
3683-librtmps_protocol_deps="librtmp"
3684-librtmpt_protocol_deps="librtmp"
3685-librtmpte_protocol_deps="librtmp"
3686-libsmbclient_protocol_deps="libsmbclient gplv3"
3687-libsrt_protocol_deps="libsrt"
3688-libsrt_protocol_select="network"
3689-libssh_protocol_deps="libssh"
3690-libtls_conflict="openssl gnutls mbedtls"
3691-libzmq_protocol_deps="libzmq"
3692-libzmq_protocol_select="network"
3693-
3694-# filters
3695-ametadata_filter_deps="avformat"
3696-amovie_filter_deps="avcodec avformat"
3697-aresample_filter_deps="swresample"
3698-asr_filter_deps="pocketsphinx"
3699-ass_filter_deps="libass"
3700-avgblur_opencl_filter_deps="opencl"
3701-avgblur_vulkan_filter_deps="vulkan spirv_compiler"
3702-azmq_filter_deps="libzmq"
3703-blackframe_filter_deps="gpl"
3704-blend_vulkan_filter_deps="vulkan spirv_compiler"
3705-boxblur_filter_deps="gpl"
3706-boxblur_opencl_filter_deps="opencl gpl"
3707-bs2b_filter_deps="libbs2b"
3708-bwdif_cuda_filter_deps="ffnvcodec"
3709-bwdif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3710-bwdif_vulkan_filter_deps="vulkan spirv_compiler"
3711-chromaber_vulkan_filter_deps="vulkan spirv_compiler"
3712-color_vulkan_filter_deps="vulkan spirv_compiler"
3713-colorkey_opencl_filter_deps="opencl"
3714-colormatrix_filter_deps="gpl"
3715-convolution_opencl_filter_deps="opencl"
3716-coreimage_filter_deps="coreimage appkit"
3717-coreimage_filter_extralibs="-framework OpenGL"
3718-coreimagesrc_filter_deps="coreimage appkit"
3719-coreimagesrc_filter_extralibs="-framework OpenGL"
3720-cover_rect_filter_deps="avcodec avformat gpl"
3721-cropdetect_filter_deps="gpl"
3722-deinterlace_qsv_filter_deps="libmfx"
3723-deinterlace_qsv_filter_select="qsvvpp"
3724-deinterlace_vaapi_filter_deps="vaapi"
3725-delogo_filter_deps="gpl"
3726-denoise_vaapi_filter_deps="vaapi"
3727-derain_filter_select="dnn"
3728-deshake_filter_select="pixelutils"
3729-deshake_opencl_filter_deps="opencl"
3730-dilation_opencl_filter_deps="opencl"
3731-dnn_classify_filter_select="dnn"
3732-dnn_detect_filter_select="dnn"
3733-dnn_processing_filter_select="dnn"
3734-drawtext_filter_deps="libfreetype libharfbuzz"
3735-drawtext_filter_suggest="libfontconfig libfribidi"
3736-elbg_filter_deps="avcodec"
3737-eq_filter_deps="gpl"
3738-erosion_opencl_filter_deps="opencl"
3739-find_rect_filter_deps="avcodec avformat gpl"
3740-flip_vulkan_filter_deps="vulkan spirv_compiler"
3741-flite_filter_deps="libflite threads"
3742-framerate_filter_select="scene_sad"
3743-freezedetect_filter_select="scene_sad"
3744-frei0r_deps_any="libdl LoadLibrary"
3745-frei0r_filter_deps="frei0r"
3746-frei0r_src_filter_deps="frei0r"
3747-fspp_filter_deps="gpl"
3748-gblur_vulkan_filter_deps="vulkan spirv_compiler"
3749-hflip_vulkan_filter_deps="vulkan spirv_compiler"
3750-histeq_filter_deps="gpl"
3751-hqdn3d_filter_deps="gpl"
3752-iccdetect_filter_deps="lcms2"
3753-iccgen_filter_deps="lcms2"
3754-interlace_filter_deps="gpl"
3755-kerndeint_filter_deps="gpl"
3756-ladspa_filter_deps="ladspa libdl"
3757-lensfun_filter_deps="liblensfun version3"
3758-libplacebo_filter_deps="libplacebo vulkan"
3759-lv2_filter_deps="lv2"
3760-mcdeint_filter_deps="avcodec gpl"
3761-metadata_filter_deps="avformat"
3762-movie_filter_deps="avcodec avformat"
3763-mpdecimate_filter_deps="gpl"
3764-mpdecimate_filter_select="pixelutils"
3765-minterpolate_filter_select="scene_sad"
3766-mptestsrc_filter_deps="gpl"
3767-negate_filter_deps="lut_filter"
3768-nlmeans_opencl_filter_deps="opencl"
3769-nlmeans_vulkan_filter_deps="vulkan spirv_compiler"
3770-nnedi_filter_deps="gpl"
3771-ocr_filter_deps="libtesseract"
3772-ocv_filter_deps="libopencv"
3773-openclsrc_filter_deps="opencl"
3774-overlay_opencl_filter_deps="opencl"
3775-overlay_qsv_filter_deps="libmfx"
3776-overlay_qsv_filter_select="qsvvpp"
3777-overlay_vaapi_filter_deps="vaapi VAProcPipelineCaps_blend_flags"
3778-overlay_vulkan_filter_deps="vulkan spirv_compiler"
3779-owdenoise_filter_deps="gpl"
3780-pad_opencl_filter_deps="opencl"
3781-pan_filter_deps="swresample"
3782-perspective_filter_deps="gpl"
3783-phase_filter_deps="gpl"
3784-pp7_filter_deps="gpl"
3785-pp_filter_deps="gpl postproc"
3786-prewitt_opencl_filter_deps="opencl"
3787-procamp_vaapi_filter_deps="vaapi"
3788-program_opencl_filter_deps="opencl"
3789-pullup_filter_deps="gpl"
3790-remap_opencl_filter_deps="opencl"
3791-removelogo_filter_deps="avcodec avformat swscale"
3792-repeatfields_filter_deps="gpl"
3793-roberts_opencl_filter_deps="opencl"
3794-rubberband_filter_deps="librubberband"
3795-sab_filter_deps="gpl swscale"
3796-scale2ref_filter_deps="swscale"
3797-scale_filter_deps="swscale"
3798-scale_qsv_filter_deps="libmfx"
3799-scale_qsv_filter_select="qsvvpp"
3800-scdet_filter_select="scene_sad"
3801-select_filter_select="scene_sad"
3802-sharpness_vaapi_filter_deps="vaapi"
3803-showcqt_filter_deps="avformat swscale"
3804-showcqt_filter_suggest="libfontconfig libfreetype"
3805-signature_filter_deps="gpl avcodec avformat"
3806-smartblur_filter_deps="gpl swscale"
3807-sobel_opencl_filter_deps="opencl"
3808-sofalizer_filter_deps="libmysofa"
3809-spp_filter_deps="gpl avcodec"
3810-spp_filter_select="idctdsp fdctdsp me_cmp pixblockdsp"
3811-sr_filter_deps="avformat swscale"
3812-sr_filter_select="dnn"
3813-stereo3d_filter_deps="gpl"
3814-subtitles_filter_deps="avformat avcodec libass"
3815-super2xsai_filter_deps="gpl"
3816-pixfmts_super2xsai_test_deps="super2xsai_filter"
3817-tinterlace_filter_deps="gpl"
3818-tinterlace_merge_test_deps="tinterlace_filter"
3819-tinterlace_pad_test_deps="tinterlace_filter"
3820-tonemap_filter_deps="const_nan"
3821-tonemap_vaapi_filter_deps="vaapi VAProcFilterParameterBufferHDRToneMapping"
3822-tonemap_opencl_filter_deps="opencl const_nan"
3823-transpose_opencl_filter_deps="opencl"
3824-transpose_vaapi_filter_deps="vaapi VAProcPipelineCaps_rotation_flags"
3825-transpose_vt_filter_deps="videotoolbox VTPixelRotationSessionCreate"
3826-transpose_vulkan_filter_deps="vulkan spirv_compiler"
3827-unsharp_opencl_filter_deps="opencl"
3828-uspp_filter_deps="gpl avcodec"
3829-vaguedenoiser_filter_deps="gpl"
3830-vflip_vulkan_filter_deps="vulkan spirv_compiler"
3831-vidstabdetect_filter_deps="libvidstab"
3832-vidstabtransform_filter_deps="libvidstab"
3833-libvmaf_filter_deps="libvmaf"
3834-libvmaf_cuda_filter_deps="libvmaf libvmaf_cuda ffnvcodec"
3835-zmq_filter_deps="libzmq"
3836-zoompan_filter_deps="swscale"
3837-zscale_filter_deps="libzimg const_nan"
3838-scale_vaapi_filter_deps="vaapi"
3839-scale_vt_filter_deps="videotoolbox"
3840-scale_vulkan_filter_deps="vulkan spirv_compiler"
3841-vpp_qsv_filter_deps="libmfx"
3842-vpp_qsv_filter_select="qsvvpp"
3843-xfade_opencl_filter_deps="opencl"
3844-xfade_vulkan_filter_deps="vulkan spirv_compiler"
3845-yadif_cuda_filter_deps="ffnvcodec"
3846-yadif_cuda_filter_deps_any="cuda_nvcc cuda_llvm"
3847-yadif_videotoolbox_filter_deps="metal corevideo videotoolbox"
3848-hstack_vaapi_filter_deps="vaapi_1"
3849-vstack_vaapi_filter_deps="vaapi_1"
3850-xstack_vaapi_filter_deps="vaapi_1"
3851-hstack_qsv_filter_deps="libmfx"
3852-hstack_qsv_filter_select="qsvvpp"
3853-vstack_qsv_filter_deps="libmfx"
3854-vstack_qsv_filter_select="qsvvpp"
3855-xstack_qsv_filter_deps="libmfx"
3856-xstack_qsv_filter_select="qsvvpp"
3857-
3858-# examples
3859-avio_http_serve_files_deps="avformat avutil fork"
3860-avio_list_dir_deps="avformat avutil"
3861-avio_read_callback_deps="avformat avcodec avutil"
3862-decode_audio_example_deps="avcodec avutil"
3863-decode_filter_audio_example_deps="avfilter avcodec avformat avutil"
3864-decode_filter_video_example_deps="avfilter avcodec avformat avutil"
3865-decode_video_example_deps="avcodec avutil"
3866-demux_decode_example_deps="avcodec avformat avutil"
3867-encode_audio_example_deps="avcodec avutil"
3868-encode_video_example_deps="avcodec avutil"
3869-extract_mvs_example_deps="avcodec avformat avutil"
3870-filter_audio_example_deps="avfilter avutil"
3871-hw_decode_example_deps="avcodec avformat avutil"
3872-mux_example_deps="avcodec avformat avutil swscale"
3873-qsv_decode_example_deps="avcodec avutil libmfx h264_qsv_decoder"
3874-remux_example_deps="avcodec avformat avutil"
3875-resample_audio_example_deps="avutil swresample"
3876-scale_video_example_deps="avutil swscale"
3877-show_metadata_example_deps="avformat avutil"
3878-transcode_aac_example_deps="avcodec avformat swresample"
3879-transcode_example_deps="avfilter avcodec avformat avutil"
3880-vaapi_encode_example_deps="avcodec avutil h264_vaapi_encoder"
3881-vaapi_transcode_example_deps="avcodec avformat avutil h264_vaapi_encoder"
3882-qsv_transcode_example_deps="avcodec avformat avutil h264_qsv_encoder"
3883-
3884-# EXTRALIBS_LIST
3885-cpu_init_extralibs="pthreads_extralibs"
3886-cws2fws_extralibs="zlib_extralibs"
3887-
3888-# libraries, in any order
3889-avcodec_deps="avutil"
3890-avcodec_suggest="libm stdatomic"
3891-avdevice_deps="avformat avcodec avutil"
3892-avdevice_suggest="libm stdatomic"
3893-avfilter_deps="avutil"
3894-avfilter_suggest="libm stdatomic"
3895-avformat_deps="avcodec avutil"
3896-avformat_suggest="libm network zlib stdatomic"
3897-avutil_suggest="clock_gettime ffnvcodec gcrypt libm libdrm libmfx opencl openssl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic"
3898-postproc_deps="avutil gpl"
3899-postproc_suggest="libm stdatomic"
3900-swresample_deps="avutil"
3901-swresample_suggest="libm libsoxr stdatomic"
3902-swscale_deps="avutil"
3903-swscale_suggest="libm stdatomic"
3904-
3905-avcodec_extralibs="pthreads_extralibs iconv_extralibs dxva2_extralibs lcms2_extralibs"
3906-avfilter_extralibs="pthreads_extralibs"
3907-avutil_extralibs="d3d11va_extralibs mediacodec_extralibs nanosleep_extralibs pthreads_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vaapi_win32_extralibs vdpau_x11_extralibs"
3908-
3909-# programs
3910-ffmpeg_deps="avcodec avfilter avformat threads"
3911-ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
3912- hflip_filter null_filter
3913- transpose_filter trim_filter vflip_filter"
3914-ffmpeg_suggest="ole32 psapi shell32"
3915-ffplay_deps="avcodec avformat avfilter swscale swresample sdl2"
3916-ffplay_select="crop_filter transpose_filter hflip_filter vflip_filter rotate_filter"
3917-ffplay_suggest="shell32"
3918-ffprobe_deps="avcodec avformat"
3919-ffprobe_suggest="shell32"
3920-
3921-# documentation
3922-podpages_deps="perl"
3923-manpages_deps="perl pod2man"
3924-htmlpages_deps="perl"
3925-htmlpages_deps_any="makeinfo_html texi2html"
3926-txtpages_deps="perl makeinfo"
3927-doc_deps_any="manpages htmlpages podpages txtpages"
3928-
3929-# default parameters
3930-
3931-logfile="ffbuild/config.log"
3932-
3933-# installation paths
3934-prefix_default="/usr/local"
3935-bindir_default='${prefix}/bin'
3936-datadir_default='${prefix}/share/ffmpeg'
3937-docdir_default='${prefix}/share/doc/ffmpeg'
3938-incdir_default='${prefix}/include'
3939-libdir_default='${prefix}/lib'
3940-mandir_default='${prefix}/share/man'
3941-
3942-# toolchain
3943-ar_default="ar"
3944-cc_default="gcc"
3945-cxx_default="g++"
3946-host_cc_default="gcc"
3947-doxygen_default="doxygen"
3948-install="install"
3949-ln_s_default="ln -s -f"
3950-metalcc_default="xcrun -sdk macosx metal"
3951-metallib_default="xcrun -sdk macosx metallib"
3952-nm_default="nm -g"
3953-pkg_config_default=pkg-config
3954-ranlib_default="ranlib"
3955-strip_default="strip"
3956-version_script='--version-script'
3957-objformat="elf32"
3958-x86asmexe_default="nasm"
3959-windres_default="windres"
3960-striptype="direct"
3961-
3962-# OS
3963-target_os_default=$(tolower $(uname -s))
3964-host_os=$target_os_default
3965-
3966-# machine
3967-if test "$target_os_default" = aix; then
3968- arch_default=$(uname -p)
3969- strip_default="strip -X32_64"
3970- nm_default="nm -g -X32_64"
3971-elif test "$MSYSTEM_CARCH" != ""; then
3972- arch_default="$MSYSTEM_CARCH"
3973-else
3974- arch_default=$(uname -m)
3975-fi
3976-cpu="generic"
3977-intrinsics="none"
3978-
3979-# configurable options
3980-enable $PROGRAM_LIST
3981-enable $DOCUMENT_LIST
3982-enable $EXAMPLE_LIST
3983-enable $LIBRARY_LIST
3984-enable stripping
3985-
3986-enable asm
3987-enable debug
3988-enable doc
3989-enable faan faandct faanidct
3990-enable large_tests
3991-enable optimizations
3992-enable ptx_compression
3993-enable runtime_cpudetect
3994-enable safe_bitstream_reader
3995-enable static
3996-enable swscale_alpha
3997-enable valgrind_backtrace
3998-
3999-sws_max_filter_size_default=256
4000-set_default sws_max_filter_size
4001-
4002-# internal components are enabled by default
4003-enable $EXTRALIBS_LIST
4004-
4005-# Avoid external, non-system, libraries getting enabled by dependency resolution
4006-disable $EXTERNAL_LIBRARY_LIST $HWACCEL_LIBRARY_LIST
4007-
4008-# build settings
4009-SHFLAGS='-shared -Wl,-soname,$$(@F)'
4010-LIBPREF="lib"
4011-LIBSUF=".a"
4012-FULLNAME='$(NAME)$(BUILDSUF)'
4013-LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
4014-SLIBPREF="lib"
4015-SLIBSUF=".so"
4016-SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
4017-SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
4018-SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
4019-LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
4020-SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
4021-SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
4022-VERSION_SCRIPT_POSTPROCESS_CMD="cat"
4023-
4024-asflags_filter=echo
4025-cflags_filter=echo
4026-ldflags_filter=echo
4027-
4028-AS_C='-c'
4029-AS_O='-o $@'
4030-CC_C='-c'
4031-CC_E='-E -o $@'
4032-CC_O='-o $@'
4033-CXX_C='-c'
4034-CXX_O='-o $@'
4035-OBJCC_C='-c'
4036-OBJCC_E='-E -o $@'
4037-OBJCC_O='-o $@'
4038-X86ASM_O='-o $@'
4039-LD_O='-o $@'
4040-LD_LIB='-l%'
4041-LD_PATH='-L'
4042-HOSTCC_C='-c'
4043-HOSTCC_E='-E -o $@'
4044-HOSTCC_O='-o $@'
4045-HOSTLD_O='-o $@'
4046-NVCC_C='-c'
4047-NVCC_O='-o $@'
4048-
4049-host_extralibs='-lm'
4050-host_cflags_filter=echo
4051-host_ldflags_filter=echo
4052-
4053-target_path='$(CURDIR)'
4054-
4055-# since the object filename is not given with the -MM flag, the compiler
4056-# is only able to print the basename, and we must add the path ourselves
4057-DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>/dev/null | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(@F),$(@D)/$(@F)," > $(@:.o=.d)'
4058-DEPFLAGS='-MM'
4059-
4060-mkdir -p ffbuild
4061-
4062-# find source path
4063-if test -f configure; then
4064- source_path=.
4065-elif test -f src/configure; then
4066- source_path=src
4067-else
4068- source_path=$(cd $(dirname "$0"); pwd)
4069- case "$source_path" in
4070- *[[:blank:]]*) die "Out of tree builds are impossible with whitespace in source path." ;;
4071- esac
4072- test -e "$source_path/config.h" &&
4073- die "Out of tree builds are impossible with config.h in source dir."
4074-fi
4075-
4076-for v in "$@"; do
4077- r=${v#*=}
4078- l=${v%"$r"}
4079- r=$(sh_quote "$r")
4080- FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
4081-done
4082-
4083-find_things_extern(){
4084- thing=$1
4085- pattern=$2
4086- file=$source_path/$3
4087- out=${4:-$thing}
4088- sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$out/p" "$file"
4089-}
4090-
4091-find_filters_extern(){
4092- file=$source_path/$1
4093- sed -n 's/^extern const AVFilter ff_[avfsinkrc]\{2,5\}_\([[:alnum:]_]\{1,\}\);/\1_filter/p' $file
4094-}
4095-
4096-FILTER_LIST=$(find_filters_extern libavfilter/allfilters.c)
4097-OUTDEV_LIST=$(find_things_extern muxer FFOutputFormat libavdevice/alldevices.c outdev)
4098-INDEV_LIST=$(find_things_extern demuxer AVInputFormat libavdevice/alldevices.c indev)
4099-MUXER_LIST=$(find_things_extern muxer FFOutputFormat libavformat/allformats.c)
4100-DEMUXER_LIST=$(find_things_extern demuxer AVInputFormat libavformat/allformats.c)
4101-ENCODER_LIST=$(find_things_extern encoder FFCodec libavcodec/allcodecs.c)
4102-DECODER_LIST=$(find_things_extern decoder FFCodec libavcodec/allcodecs.c)
4103-CODEC_LIST="
4104- $ENCODER_LIST
4105- $DECODER_LIST
4106-"
4107-PARSER_LIST=$(find_things_extern parser AVCodecParser libavcodec/parsers.c)
4108-BSF_LIST=$(find_things_extern bsf FFBitStreamFilter libavcodec/bitstream_filters.c)
4109-HWACCEL_LIST=$(find_things_extern hwaccel FFHWAccel libavcodec/hwaccels.h)
4110-PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
4111-
4112-AVCODEC_COMPONENTS_LIST="
4113- $BSF_LIST
4114- $DECODER_LIST
4115- $ENCODER_LIST
4116- $HWACCEL_LIST
4117- $PARSER_LIST
4118-"
4119-
4120-AVDEVICE_COMPONENTS_LIST="
4121- $INDEV_LIST
4122- $OUTDEV_LIST
4123-"
4124-
4125-AVFILTER_COMPONENTS_LIST="
4126- $FILTER_LIST
4127-"
4128-
4129-AVFORMAT_COMPONENTS_LIST="
4130- $DEMUXER_LIST
4131- $MUXER_LIST
4132- $PROTOCOL_LIST
4133-"
4134-
4135-ALL_COMPONENTS="
4136- $AVCODEC_COMPONENTS_LIST
4137- $AVDEVICE_COMPONENTS_LIST
4138- $AVFILTER_COMPONENTS_LIST
4139- $AVFORMAT_COMPONENTS_LIST
4140-"
4141-
4142-for n in $COMPONENT_LIST; do
4143- v=$(toupper ${n%s})_LIST
4144- eval enable \$$v
4145- eval ${n}_if_any="\$$v"
4146-done
4147-
4148-enable $ARCH_EXT_LIST
4149-
4150-die_unknown(){
4151- echo "Unknown option \"$1\"."
4152- echo "See $0 --help for available options."
4153- exit 1
4154-}
4155-
4156-print_in_columns() {
4157- tr ' ' '\n' | sort | tr '\r\n' ' ' | awk -v col_width=24 -v width="$ncols" '
4158- {
4159- num_cols = width > col_width ? int(width / col_width) : 1;
4160- num_rows = int((NF + num_cols-1) / num_cols);
4161- y = x = 1;
4162- for (y = 1; y <= num_rows; y++) {
4163- i = y;
4164- for (x = 1; x <= num_cols; x++) {
4165- if (i <= NF) {
4166- line = sprintf("%s%-" col_width "s", line, $i);
4167- }
4168- i = i + num_rows;
4169- }
4170- print line; line = "";
4171- }
4172- }' | sed 's/ *$//'
4173-}
4174-
4175-show_list() {
4176- suffix=_$1
4177- shift
4178- echo $* | sed s/$suffix//g | print_in_columns
4179- exit 0
4180-}
4181-
4182-rand_list(){
4183- IFS=', '
4184- set -- $*
4185- unset IFS
4186- for thing; do
4187- comp=${thing%:*}
4188- prob=${thing#$comp}
4189- prob=${prob#:}
4190- is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
4191- echo "prob ${prob:-0.5}"
4192- printf '%s\n' $comp
4193- done
4194-}
4195-
4196-do_random(){
4197- action=$1
4198- shift
4199- random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
4200- $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
4201-}
4202-
4203-for opt do
4204- optval="${opt#*=}"
4205- case "$opt" in
4206- --extra-ldflags=*)
4207- add_ldflags $optval
4208- ;;
4209- --extra-ldexeflags=*)
4210- add_ldexeflags $optval
4211- ;;
4212- --extra-ldsoflags=*)
4213- add_ldsoflags $optval
4214- ;;
4215- --extra-ldlibflags=*)
4216- warn "The --extra-ldlibflags option is only provided for compatibility and will be\n"\
4217- "removed in the future. Use --extra-ldsoflags instead."
4218- add_ldsoflags $optval
4219- ;;
4220- --extra-libs=*)
4221- add_extralibs $optval
4222- ;;
4223- --disable-devices)
4224- disable $INDEV_LIST $OUTDEV_LIST
4225- ;;
4226- --enable-debug=*)
4227- debuglevel="$optval"
4228- ;;
4229- --disable-programs)
4230- disable $PROGRAM_LIST
4231- ;;
4232- --disable-everything)
4233- map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
4234- ;;
4235- --disable-all)
4236- map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
4237- disable $LIBRARY_LIST $PROGRAM_LIST doc
4238- enable avutil
4239- ;;
4240- --enable-random|--disable-random)
4241- action=${opt%%-random}
4242- do_random ${action#--} $COMPONENT_LIST
4243- ;;
4244- --enable-random=*|--disable-random=*)
4245- action=${opt%%-random=*}
4246- do_random ${action#--} $optval
4247- ;;
4248- --enable-sdl)
4249- enable sdl2
4250- ;;
4251- --enable-lto*)
4252- lto=-f${opt#--enable-}
4253- ;;
4254- --enable-*=*|--disable-*=*)
4255- eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
4256- is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
4257- eval list=\$$(toupper $thing)_LIST
4258- name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
4259- list=$(filter "$name" $list)
4260- [ "$list" = "" ] && warn "Option $opt did not match anything"
4261- test $action = enable && warn_if_gets_disabled $list
4262- $action $list
4263- ;;
4264- --enable-yasm|--disable-yasm)
4265- warn "The ${opt} option is only provided for compatibility and will be\n"\
4266- "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
4267- test $opt = --enable-yasm && x86asm=yes || x86asm=no
4268- ;;
4269- --yasmexe=*)
4270- warn "The --yasmexe option is only provided for compatibility and will be\n"\
4271- "removed in the future. Use --x86asmexe instead."
4272- x86asmexe="$optval"
4273- ;;
4274- --enable-?*|--disable-?*)
4275- eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
4276- if is_in $option $COMPONENT_LIST; then
4277- test $action = disable && action=unset
4278- eval $action \$$(toupper ${option%s})_LIST
4279- elif is_in $option $CMDLINE_SELECT; then
4280- $action $option
4281- else
4282- die_unknown $opt
4283- fi
4284- ;;
4285- --list-*)
4286- NAME="${opt#--list-}"
4287- is_in $NAME $COMPONENT_LIST || die_unknown $opt
4288- NAME=${NAME%s}
4289- eval show_list $NAME \$$(toupper $NAME)_LIST
4290- ;;
4291- --help|-h) show_help
4292- ;;
4293- --quiet|-q) quiet=yes
4294- ;;
4295- --fatal-warnings) enable fatal_warnings
4296- ;;
4297- --libfuzzer=*)
4298- libfuzzer_path="$optval"
4299- ;;
4300- *)
4301- optname="${opt%%=*}"
4302- optname="${optname#--}"
4303- optname=$(echo "$optname" | sed 's/-/_/g')
4304- if is_in $optname $CMDLINE_SET; then
4305- eval $optname='$optval'
4306- elif is_in $optname $CMDLINE_APPEND; then
4307- append $optname "$optval"
4308- else
4309- die_unknown $opt
4310- fi
4311- ;;
4312- esac
4313-done
4314-
4315-for e in $env; do
4316- eval "export $e"
4317-done
4318-
4319-if disabled autodetect; then
4320-
4321- # Unless iconv is explicitely disabled by the user, we still want to probe
4322- # for the iconv from the libc.
4323- disabled iconv || enable libc_iconv
4324-
4325- disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
4326- disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
4327-fi
4328-# Mark specifically enabled, but normally autodetected libraries as requested.
4329-for lib in $AUTODETECT_LIBS; do
4330- enabled $lib && request $lib
4331-done
4332-#TODO: switch to $AUTODETECT_LIBS when $THREADS_LIST is supported the same way
4333-enable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST
4334-enable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST
4335-
4336-disabled logging && logfile=/dev/null
4337-
4338-# command line configuration sanity checks
4339-
4340-# we need to build at least one lib type
4341-if ! enabled_any static shared; then
4342- cat <<EOF
4343-At least one library type must be built.
4344-Specify --enable-static to build the static libraries or --enable-shared to
4345-build the shared libraries as well. To only build the shared libraries specify
4346---disable-static in addition to --enable-shared.
4347-EOF
4348- exit 1
4349-fi
4350-
4351-die_license_disabled() {
4352- enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
4353-}
4354-
4355-die_license_disabled_gpl() {
4356- enabled $1 || { enabled $v && die "$v is incompatible with the gpl and --enable-$1 is not specified."; }
4357-}
4358-
4359-map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
4360-map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST $EXTERNAL_LIBRARY_GPLV3_LIST
4361-
4362-enabled gpl && map "die_license_disabled_gpl nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST
4363-map "die_license_disabled nonfree" $HWACCEL_LIBRARY_NONFREE_LIST
4364-
4365-enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
4366-
4367-if enabled nonfree; then
4368- license="nonfree and unredistributable"
4369-elif enabled gplv3; then
4370- license="GPL version 3 or later"
4371-elif enabled lgplv3; then
4372- license="LGPL version 3 or later"
4373-elif enabled gpl; then
4374- license="GPL version 2 or later"
4375-else
4376- license="LGPL version 2.1 or later"
4377-fi
4378-
4379-enabled_all gnutls openssl &&
4380- die "GnuTLS and OpenSSL must not be enabled at the same time."
4381-
4382-enabled_all gnutls mbedtls &&
4383- die "GnuTLS and mbedTLS must not be enabled at the same time."
4384-
4385-enabled_all openssl mbedtls &&
4386- die "OpenSSL and mbedTLS must not be enabled at the same time."
4387-
4388-# Disable all the library-specific components if the library itself
4389-# is disabled, see AVCODEC_LIST and following _LIST variables.
4390-
4391-disable_components(){
4392- disabled ${1} && disable $(
4393- eval components="\$$(toupper ${1})_COMPONENTS"
4394- map 'eval echo \${$(toupper ${v%s})_LIST}' $components
4395- )
4396-}
4397-
4398-map 'disable_components $v' $LIBRARY_LIST
4399-
4400-echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
4401-set >> $logfile
4402-
4403-test -n "$valgrind" && toolchain="valgrind-memcheck"
4404-
4405-enabled ossfuzz && ! echo $CFLAGS | grep -q -- "-fsanitize=" && ! echo $CFLAGS | grep -q -- "-fcoverage-mapping" &&{
4406- add_cflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp -fno-omit-frame-pointer
4407- add_ldflags -fsanitize=address,undefined -fsanitize-coverage=trace-pc-guard,trace-cmp
4408-}
4409-
4410-case "$toolchain" in
4411- *-asan)
4412- cc_default="${toolchain%-asan}"
4413- add_cflags -fsanitize=address
4414- add_ldflags -fsanitize=address
4415- ;;
4416- *-lsan)
4417- cc_default="${toolchain%-lsan}"
4418- add_cflags -fsanitize=leak
4419- add_ldflags -fsanitize=leak
4420- ;;
4421- *-msan)
4422- cc_default="${toolchain%-msan}"
4423- add_cflags -fsanitize=memory -fsanitize-memory-track-origins
4424- add_ldflags -fsanitize=memory
4425- ;;
4426- *-tsan)
4427- cc_default="${toolchain%-tsan}"
4428- add_cflags -fsanitize=thread
4429- add_ldflags -fsanitize=thread
4430- case "$toolchain" in
4431- gcc-tsan)
4432- add_cflags -fPIC
4433- add_ldflags -fPIC
4434- ;;
4435- esac
4436- ;;
4437- *-usan)
4438- cc_default="${toolchain%-usan}"
4439- add_cflags -fsanitize=undefined
4440- add_ldflags -fsanitize=undefined
4441- ;;
4442- valgrind-*)
4443- target_exec_default="valgrind"
4444- case "$toolchain" in
4445- valgrind-massif)
4446- target_exec_args="--tool=massif --alloc-fn=av_malloc --alloc-fn=av_mallocz --alloc-fn=av_calloc --alloc-fn=av_fast_padded_malloc --alloc-fn=av_fast_malloc --alloc-fn=av_realloc_f --alloc-fn=av_fast_realloc --alloc-fn=av_realloc"
4447- ;;
4448- valgrind-memcheck)
4449- target_exec_args="--error-exitcode=1 --malloc-fill=0x2a --track-origins=yes --leak-check=full --gen-suppressions=all --suppressions=$source_path/tests/fate-valgrind.supp"
4450- ;;
4451- esac
4452- ;;
4453- msvc)
4454- cl_major_ver=$(cl.exe 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
4455- if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
4456- cc_default="cl.exe"
4457- cxx_default="cl.exe"
4458- else
4459- die "Unsupported MSVC version (2013 or newer required)"
4460- fi
4461- ld_default="$source_path/compat/windows/mslink"
4462- windres_default="$source_path/compat/windows/mswindres"
4463- nm_default="dumpbin.exe -symbols"
4464- ar_default="lib.exe"
4465- case "${arch:-$arch_default}" in
4466- aarch64|arm64)
4467- as_default="armasm64.exe"
4468- ;;
4469- arm*)
4470- as_default="armasm.exe"
4471- ;;
4472- esac
4473- target_os_default="win32"
4474- # Use a relative path for TMPDIR. This makes sure all the
4475- # ffconf temp files are written with a relative path, avoiding
4476- # issues with msys/win32 path conversion for MSVC parameters
4477- # such as -Fo<file> or -out:<file>.
4478- TMPDIR=.
4479- ;;
4480- icl)
4481- cc_default="icl"
4482- ld_default="xilink"
4483- nm_default="dumpbin -symbols"
4484- ar_default="xilib"
4485- target_os_default="win32"
4486- TMPDIR=.
4487- ;;
4488- gcov)
4489- add_cflags -fprofile-arcs -ftest-coverage
4490- add_ldflags -fprofile-arcs -ftest-coverage
4491- ;;
4492- llvm-cov)
4493- add_cflags -fprofile-arcs -ftest-coverage
4494- add_ldflags --coverage
4495- ;;
4496- hardened)
4497- add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
4498- add_cflags -fno-strict-overflow -fstack-protector-all
4499- add_ldflags -Wl,-z,relro -Wl,-z,now
4500- add_cflags -fPIE
4501- add_ldexeflags -fPIE -pie
4502- ;;
4503- ?*)
4504- die "Unknown toolchain $toolchain"
4505- ;;
4506-esac
4507-
4508-if test -n "$cross_prefix"; then
4509- test -n "$arch" && test -n "$target_os" ||
4510- die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
4511- enable cross_compile
4512-fi
4513-
4514-set_default target_os
4515-if test "$target_os" = android; then
4516- cc_default="clang"
4517-fi
4518-
4519-ar_default="${cross_prefix}${ar_default}"
4520-cc_default="${cross_prefix}${cc_default}"
4521-cxx_default="${cross_prefix}${cxx_default}"
4522-nm_default="${cross_prefix}${nm_default}"
4523-pkg_config_default="${cross_prefix}${pkg_config_default}"
4524-ranlib_default="${cross_prefix}${ranlib_default}"
4525-strip_default="${cross_prefix}${strip_default}"
4526-windres_default="${cross_prefix}${windres_default}"
4527-
4528-sysinclude_default="${sysroot}/usr/include"
4529-
4530-if enabled cuda_sdk; then
4531- warn "Option --enable-cuda-sdk is deprecated. Use --enable-cuda-nvcc instead."
4532- enable cuda_nvcc
4533-fi
4534-
4535-if enabled cuda_nvcc; then
4536- nvcc_default="nvcc"
4537- nvccflags_default="-gencode arch=compute_30,code=sm_30 -O2"
4538-else
4539- nvcc_default="clang"
4540- nvccflags_default="--cuda-gpu-arch=sm_30 -O2"
4541- NVCC_C=""
4542-fi
4543-
4544-set_default nvcc
4545-
4546-if enabled cuda_nvcc; then
4547- if $nvcc $nvccflags_default 2>&1 | grep -qi unsupported; then
4548- nvccflags_default="-gencode arch=compute_60,code=sm_60 -O2"
4549- fi
4550-fi
4551-
4552-set_default arch cc cxx doxygen pkg_config ranlib strip sysinclude \
4553- target_exec x86asmexe metalcc metallib
4554-enabled cross_compile || host_cc_default=$cc
4555-set_default host_cc
4556-
4557-if ${ranlib} 2>&1 | grep -q "\-D "; then
4558- ranlib="${ranlib} -D"
4559-fi
4560-
4561-pkg_config_fail_message=""
4562-if ! $pkg_config --version >/dev/null 2>&1; then
4563- warn "$pkg_config not found, library detection may fail."
4564- pkg_config=false
4565-elif is_in -static $cc $LDFLAGS && ! is_in --static $pkg_config $pkg_config_flags; then
4566- pkg_config_fail_message="
4567-Note: When building a static binary, add --pkg-config-flags=\"--static\"."
4568-fi
4569-
4570-if test $doxygen != $doxygen_default && \
4571- ! $doxygen --version >/dev/null 2>&1; then
4572- warn "Specified doxygen \"$doxygen\" not found, API documentation will fail to build."
4573-fi
4574-
4575-exesuf() {
4576- case $1 in
4577- mingw32*|mingw64*|msys*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
4578- esac
4579-}
4580-
4581-EXESUF=$(exesuf $target_os)
4582-HOSTEXESUF=$(exesuf $host_os)
4583-
4584-# set temporary file name
4585-: ${TMPDIR:=$TEMPDIR}
4586-: ${TMPDIR:=$TMP}
4587-: ${TMPDIR:=/tmp}
4588-
4589-if [ -n "$tempprefix" ] ; then
4590- mktemp(){
4591- tmpname="$tempprefix.${HOSTNAME}.${UID}"
4592- echo "$tmpname"
4593- mkdir "$tmpname"
4594- }
4595-elif ! test_cmd mktemp -u XXXXXX; then
4596- # simple replacement for missing mktemp
4597- # NOT SAFE FOR GENERAL USE
4598- mktemp(){
4599- tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$"
4600- echo "$tmpname"
4601- mkdir "$tmpname"
4602- }
4603-fi
4604-
4605-FFTMPDIR=$(mktemp -d "${TMPDIR}/ffconf.XXXXXXXX" 2> /dev/null) ||
4606- die "Unable to create temporary directory in $TMPDIR."
4607-
4608-tmpfile(){
4609- tmp="${FFTMPDIR}/test"$2
4610- (set -C; exec > $tmp) 2> /dev/null ||
4611- die "Unable to create temporary file in $FFTMPDIR."
4612- eval $1=$tmp
4613-}
4614-
4615-trap 'rm -rf -- "$FFTMPDIR"' EXIT
4616-trap 'exit 2' INT
4617-
4618-tmpfile TMPASM .asm
4619-tmpfile TMPC .c
4620-tmpfile TMPCPP .cpp
4621-tmpfile TMPE $EXESUF
4622-tmpfile TMPH .h
4623-tmpfile TMPM .m
4624-tmpfile TMPCU .cu
4625-tmpfile TMPO .o
4626-tmpfile TMPS .S
4627-tmpfile TMPSH .sh
4628-tmpfile TMPV .ver
4629-
4630-unset -f mktemp
4631-
4632-chmod +x $TMPE
4633-
4634-# make sure we can execute files in $TMPDIR
4635-cat > $TMPSH 2>> $logfile <<EOF
4636-#! /bin/sh
4637-EOF
4638-chmod +x $TMPSH >> $logfile 2>&1
4639-if ! $TMPSH >> $logfile 2>&1; then
4640- cat <<EOF
4641-Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
4642-variable to another directory and make sure that it is not mounted noexec.
4643-EOF
4644- die "Sanity test failed."
4645-fi
4646-
4647-armasm_flags(){
4648- for flag; do
4649- case $flag in
4650- # Filter out MSVC cl.exe options from cflags that shouldn't
4651- # be passed to gas-preprocessor
4652- -M[TD]*) ;;
4653- *) echo $flag ;;
4654- esac
4655- done
4656-}
4657-
4658-cparser_flags(){
4659- for flag; do
4660- case $flag in
4661- -Wno-switch) echo -Wno-switch-enum ;;
4662- -Wno-format-zero-length) ;;
4663- -Wdisabled-optimization) ;;
4664- -Wno-pointer-sign) echo -Wno-other ;;
4665- *) echo $flag ;;
4666- esac
4667- done
4668-}
4669-
4670-msvc_common_flags(){
4671- for flag; do
4672- case $flag in
4673- # In addition to specifying certain flags under the compiler
4674- # specific filters, they must be specified here as well or else the
4675- # generic catch all at the bottom will print the original flag.
4676- -Wall) ;;
4677- -Wextra) ;;
4678- -std=c*) ;;
4679- # Common flags
4680- -fomit-frame-pointer) ;;
4681- -g) echo -Z7 ;;
4682- -fno-math-errno) ;;
4683- -fno-common) ;;
4684- -fno-signed-zeros) ;;
4685- -fPIC) ;;
4686- -mthumb) ;;
4687- -march=*) ;;
4688- -lz) echo zlib.lib ;;
4689- -lx264) echo libx264.lib ;;
4690- -lstdc++) ;;
4691- -l*) echo ${flag#-l}.lib ;;
4692- -LARGEADDRESSAWARE) echo $flag ;;
4693- -L*) echo -libpath:${flag#-L} ;;
4694- -Wl,*) ;;
4695- *) echo $flag ;;
4696- esac
4697- done
4698-}
4699-
4700-msvc_flags(){
4701- msvc_common_flags "$@"
4702- for flag; do
4703- case $flag in
4704- -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \
4705- -wd4554 ;;
4706- -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
4707- -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
4708- -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
4709- -wd4307 \
4710- -wd4273 -wd4554 -wd4701 -wd4703 ;;
4711- esac
4712- done
4713-}
4714-
4715-icl_flags(){
4716- msvc_common_flags "$@"
4717- for flag; do
4718- case $flag in
4719- # Despite what Intel's documentation says -Wall, which is supported
4720- # on Windows, does enable remarks so disable them here.
4721- -Wall) echo $flag -Qdiag-disable:remark ;;
4722- -std=c99) echo -Qstd=c99 ;;
4723- -flto*) echo -ipo ;;
4724- esac
4725- done
4726-}
4727-
4728-icc_flags(){
4729- for flag; do
4730- case $flag in
4731- -flto*) echo -ipo ;;
4732- *) echo $flag ;;
4733- esac
4734- done
4735-}
4736-
4737-suncc_flags(){
4738- for flag; do
4739- case $flag in
4740- -march=*|-mcpu=*)
4741- case "${flag#*=}" in
4742- native) echo -xtarget=native ;;
4743- v9|niagara) echo -xarch=sparc ;;
4744- ultrasparc) echo -xarch=sparcvis ;;
4745- ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
4746- i586|pentium) echo -xchip=pentium ;;
4747- i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
4748- pentium3*|c3-2) echo -xtarget=pentium3 ;;
4749- pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
4750- pentium4*) echo -xtarget=pentium4 ;;
4751- prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
4752- *-sse3) echo -xarch=sse3 ;;
4753- core2) echo -xarch=ssse3 -xchip=core2 ;;
4754- bonnell) echo -xarch=ssse3 ;;
4755- corei7|nehalem) echo -xtarget=nehalem ;;
4756- westmere) echo -xtarget=westmere ;;
4757- silvermont) echo -xarch=sse4_2 ;;
4758- corei7-avx|sandybridge) echo -xtarget=sandybridge ;;
4759- core-avx*|ivybridge|haswell|broadwell|skylake*|knl)
4760- echo -xarch=avx ;;
4761- amdfam10|barcelona) echo -xtarget=barcelona ;;
4762- btver1) echo -xarch=amdsse4a ;;
4763- btver2|bdver*|znver*) echo -xarch=avx ;;
4764- athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
4765- k8|opteron|athlon64|athlon-fx)
4766- echo -xarch=sse2a ;;
4767- athlon*) echo -xarch=pentium_proa ;;
4768- esac
4769- ;;
4770- -std=c99) echo -xc99 ;;
4771- -fomit-frame-pointer) echo -xregs=frameptr ;;
4772- -fPIC) echo -KPIC -xcode=pic32 ;;
4773- -W*,*) echo $flag ;;
4774- -f*-*|-W*|-mimpure-text) ;;
4775- -shared) echo -G ;;
4776- *) echo $flag ;;
4777- esac
4778- done
4779-}
4780-
4781-probe_cc(){
4782- pfx=$1
4783- _cc=$2
4784- first=$3
4785-
4786- unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
4787- unset _ld_o _ldflags _ld_lib _ld_path
4788- unset _depflags _DEPCMD _DEPFLAGS
4789- _flags_filter=echo
4790-
4791- if $_cc --version 2>&1 | grep -q '^GNU assembler'; then
4792- true # no-op to avoid reading stdin in following checks
4793- elif $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
4794- _type=llvm_gcc
4795- gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
4796- _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
4797- _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4798- _cflags_speed='-O3'
4799- _cflags_size='-Os'
4800- elif $_cc -v 2>&1 | grep -qi ^gcc; then
4801- _type=gcc
4802- gcc_version=$($_cc --version | head -n1)
4803- gcc_basever=$($_cc -dumpversion)
4804- gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
4805- gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
4806- _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
4807- case $gcc_basever in
4808- 2) ;;
4809- 2.*) ;;
4810- *) _depflags='-MMD -MF $(@:.o=.d) -MT $@' ;;
4811- esac
4812- if [ "$first" = true ]; then
4813- case $gcc_basever in
4814- 4.2*)
4815- warn "gcc 4.2 is outdated and may miscompile FFmpeg. Please use a newer compiler." ;;
4816- esac
4817- fi
4818- _cflags_speed='-O3'
4819- _cflags_size='-Os'
4820- elif $_cc --version 2>/dev/null | grep -q ^icc; then
4821- _type=icc
4822- _ident=$($_cc --version | head -n1)
4823- _depflags='-MMD'
4824- _cflags_speed='-O3'
4825- _cflags_size='-Os'
4826- _cflags_noopt='-O1'
4827- _flags_filter=icc_flags
4828- elif $_cc -v 2>&1 | grep -q xlc; then
4829- _type=xlc
4830- _ident=$($_cc -qversion 2>/dev/null | head -n1)
4831- _cflags_speed='-O5'
4832- _cflags_size='-O5 -qcompact'
4833- elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
4834- test -d "$sysroot" || die "No valid sysroot specified."
4835- _type=armcc
4836- _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
4837- armcc_conf="$PWD/armcc.conf"
4838- $_cc --arm_linux_configure \
4839- --arm_linux_config_file="$armcc_conf" \
4840- --configure_sysroot="$sysroot" \
4841- --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
4842- die "Error creating armcc configuration file."
4843- $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
4844- _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
4845- as_default="${cross_prefix}gcc"
4846- _depflags='-MMD'
4847- _cflags_speed='-O3'
4848- _cflags_size='-Os'
4849- elif $_cc -v 2>&1 | grep -q clang && ! $_cc -? > /dev/null 2>&1; then
4850- _type=clang
4851- _ident=$($_cc --version 2>/dev/null | head -n1)
4852- _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4853- _cflags_speed='-O3'
4854- _cflags_size='-Oz'
4855- elif $_cc -V 2>&1 | grep -q Sun; then
4856- _type=suncc
4857- _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
4858- _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
4859- _DEPFLAGS='-xM1 -xc99'
4860- _ldflags='-std=c99'
4861- _cflags_speed='-O5'
4862- _cflags_size='-O5 -xspace'
4863- _flags_filter=suncc_flags
4864- elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
4865- _type=pathscale
4866- _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
4867- _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4868- _cflags_speed='-O2'
4869- _cflags_size='-Os'
4870- _flags_filter='filter_out -Wdisabled-optimization'
4871- elif $_cc -v 2>&1 | grep -q Open64; then
4872- _type=open64
4873- _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
4874- _depflags='-MMD -MF $(@:.o=.d) -MT $@'
4875- _cflags_speed='-O2'
4876- _cflags_size='-Os'
4877- _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
4878- elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
4879- _type=armasm
4880- _ident=$($_cc | head -n1)
4881- # 4509: "This form of conditional instruction is deprecated"
4882- _flags="-nologo -ignore 4509"
4883- _flags_filter=armasm_flags
4884- elif $_cc 2>&1 | grep -q Intel; then
4885- _type=icl
4886- _ident=$($_cc 2>&1 | head -n1)
4887- _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
4888- # Not only is O3 broken on 13.x+ but it is slower on all previous
4889- # versions (tested) as well.
4890- _cflags_speed="-O2"
4891- _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
4892- if $_cc 2>&1 | grep -q Linker; then
4893- _ld_o='-out:$@'
4894- else
4895- _ld_o='-Fe$@'
4896- fi
4897- _cc_o='-Fo$@'
4898- _cc_e='-P'
4899- _flags_filter=icl_flags
4900- _ld_lib='lib%.a'
4901- _ld_path='-libpath:'
4902- # -Qdiag-error to make icl error when seeing certain unknown arguments
4903- _flags='-nologo -Qdiag-error:4044,10157'
4904- # -Qvec- -Qsimd- to prevent miscompilation, -GS, fp:precise for consistency
4905- # with MSVC which enables it by default.
4906- _cflags='-Qms0 -Qvec- -Qsimd- -GS -fp:precise'
4907- disable stripping
4908- elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
4909- # lld can emulate multiple different linkers; in ms link.exe mode,
4910- # the -? parameter gives the help output which contains an identifyable
4911- # string, while it gives an error in other modes.
4912- _type=lld-link
4913- # The link.exe mode doesn't have a switch for getting the version,
4914- # but we can force it back to gnu mode and get the version from there.
4915- _ident=$($_cc -flavor gnu --version 2>/dev/null)
4916- _ld_o='-out:$@'
4917- _flags_filter=msvc_flags
4918- _ld_lib='lib%.a'
4919- _ld_path='-libpath:'
4920- elif $_cc -nologo- 2>&1 | grep -q Microsoft || { $_cc -v 2>&1 | grep -q clang && $_cc -? > /dev/null 2>&1; }; then
4921- _type=msvc
4922- if $_cc -nologo- 2>&1 | grep -q Microsoft; then
4923- _ident=$($_cc 2>&1 | head -n1 | tr -d '\r')
4924- else
4925- _ident=$($_cc --version 2>/dev/null | head -n1 | tr -d '\r')
4926- fi
4927- _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
4928- _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
4929- _cflags_speed="-O2"
4930- _cflags_size="-O1"
4931- _cflags_noopt="-O1"
4932- if $_cc -nologo- 2>&1 | grep -q Linker; then
4933- _ld_o='-out:$@'
4934- else
4935- _ld_o='-Fe$@'
4936- fi
4937- _cc_o='-Fo$@'
4938- _cc_e='-P -Fi$@'
4939- _flags_filter=msvc_flags
4940- _ld_lib='lib%.a'
4941- _ld_path='-libpath:'
4942- _flags='-nologo'
4943- disable stripping
4944- elif $_cc --version 2>/dev/null | grep -q ^cparser; then
4945- _type=cparser
4946- _ident=$($_cc --version | head -n1)
4947- _depflags='-MMD'
4948- _cflags_speed='-O4'
4949- _cflags_size='-O2'
4950- _flags_filter=cparser_flags
4951- fi
4952-
4953- eval ${pfx}_type=\$_type
4954- eval ${pfx}_ident=\$_ident
4955-}
4956-
4957-set_ccvars(){
4958- eval ${1}_C=\${_cc_c-\${${1}_C}}
4959- eval ${1}_E=\${_cc_e-\${${1}_E}}
4960- eval ${1}_O=\${_cc_o-\${${1}_O}}
4961-
4962- if [ -n "$_depflags" ]; then
4963- eval ${1}_DEPFLAGS=\$_depflags
4964- else
4965- eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
4966- eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
4967- eval DEP${1}FLAGS=\$_flags
4968- fi
4969-}
4970-
4971-probe_cc cc "$cc" "true"
4972-cflags_filter=$_flags_filter
4973-cflags_speed=$_cflags_speed
4974-cflags_size=$_cflags_size
4975-cflags_noopt=$_cflags_noopt
4976-add_cflags $_flags $_cflags
4977-cc_ldflags=$_ldflags
4978-set_ccvars CC
4979-set_ccvars CXX
4980-
4981-probe_cc hostcc "$host_cc"
4982-host_cflags_filter=$_flags_filter
4983-host_cflags_speed=$_cflags_speed
4984-add_host_cflags $_flags $_cflags
4985-set_ccvars HOSTCC
4986-
4987-test -n "$cc_type" && enable $cc_type ||
4988- warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
4989-
4990-: ${as_default:=$cc}
4991-: ${objcc_default:=$cc}
4992-: ${dep_cc_default:=$cc}
4993-: ${ld_default:=$cc}
4994-: ${host_ld_default:=$host_cc}
4995-set_default ar as objcc dep_cc ld ln_s host_ld windres
4996-
4997-probe_cc as "$as"
4998-asflags_filter=$_flags_filter
4999-add_asflags $_flags $_cflags
5000-set_ccvars AS
5001-
5002-probe_cc objcc "$objcc"
5003-objcflags_filter=$_flags_filter
5004-add_objcflags $_flags $_cflags
5005-set_ccvars OBJC
5006-
5007-probe_cc ld "$ld"
5008-ldflags_filter=$_flags_filter
5009-add_ldflags $_flags $_ldflags
5010-test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
5011-LD_O=${_ld_o-$LD_O}
5012-LD_LIB=${_ld_lib-$LD_LIB}
5013-LD_PATH=${_ld_path-$LD_PATH}
5014-
5015-probe_cc hostld "$host_ld"
5016-host_ldflags_filter=$_flags_filter
5017-add_host_ldflags $_flags $_ldflags
5018-HOSTLD_O=${_ld_o-$HOSTLD_O}
5019-
5020-if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
5021- probe_cc depcc "$dep_cc"
5022- CCDEP=${_DEPCMD:-$DEPCMD}
5023- CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
5024- DEPCCFLAGS=$_flags
5025-fi
5026-
5027-if $ar 2>&1 | grep -q Microsoft; then
5028- arflags="-nologo"
5029- ar_o='-out:$@'
5030-elif $ar 2>&1 | grep -q "\[D\] "; then
5031- arflags="rcD"
5032- ar_o='$@'
5033-else
5034- arflags="rc"
5035- ar_o='$@'
5036-fi
5037-
5038-add_cflags $extra_cflags
5039-add_cxxflags $extra_cxxflags
5040-add_objcflags $extra_objcflags
5041-add_asflags $extra_cflags
5042-
5043-if test -n "$sysroot"; then
5044- case "$cc_type" in
5045- gcc|llvm_gcc|clang)
5046- add_cppflags --sysroot="$sysroot"
5047- add_ldflags --sysroot="$sysroot"
5048- ;;
5049- esac
5050-fi
5051-
5052-if test "$cpu" = host; then
5053- enabled cross_compile &&
5054- warn "--cpu=host makes no sense when cross-compiling."
5055-
5056- case "$cc_type" in
5057- gcc|llvm_gcc)
5058- check_native(){
5059- $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
5060- sed -n "/cc1.*$1=/{
5061- s/.*$1=\\([^ ]*\\).*/\\1/
5062- p
5063- q
5064- }" $TMPE
5065- }
5066- cpu=$(check_native -march || check_native -mcpu)
5067- ;;
5068- clang)
5069- check_native(){
5070- $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
5071- sed -n "/cc1.*-target-cpu /{
5072- s/.*-target-cpu \\([^ ]*\\).*/\\1/
5073- p
5074- q
5075- }" $TMPE
5076- }
5077- cpu=$(check_native -march)
5078- ;;
5079- esac
5080-
5081- test "${cpu:-host}" = host &&
5082- die "--cpu=host not supported with compiler $cc"
5083-fi
5084-
5085-# Deal with common $arch aliases
5086-case "$arch" in
5087- aarch64|arm64)
5088- arch="aarch64"
5089- ;;
5090- arm*|iPad*|iPhone*)
5091- arch="arm"
5092- ;;
5093- loongarch*)
5094- arch="loongarch"
5095- ;;
5096- mips*|IP*)
5097- case "$arch" in
5098- *el)
5099- add_cppflags -EL
5100- add_ldflags -EL
5101- ;;
5102- *eb)
5103- add_cppflags -EB
5104- add_ldflags -EB
5105- ;;
5106- esac
5107- arch="mips"
5108- ;;
5109- parisc*|hppa*)
5110- arch="parisc"
5111- ;;
5112- "Power Macintosh"|ppc*|powerpc*)
5113- arch="ppc"
5114- ;;
5115- riscv*)
5116- arch="riscv"
5117- ;;
5118- s390|s390x)
5119- arch="s390"
5120- ;;
5121- sh4|sh)
5122- arch="sh4"
5123- ;;
5124- sun4*|sparc*)
5125- arch="sparc"
5126- ;;
5127- tilegx|tile-gx)
5128- arch="tilegx"
5129- ;;
5130- i[3-6]86*|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
5131- arch="x86"
5132- ;;
5133-esac
5134-
5135-is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
5136-enable $arch
5137-
5138-# Add processor-specific flags
5139-if enabled aarch64; then
5140-
5141- case $cpu in
5142- armv*)
5143- cpuflags="-march=$cpu"
5144- ;;
5145- *)
5146- cpuflags="-mcpu=$cpu"
5147- ;;
5148- esac
5149-
5150-elif enabled alpha; then
5151-
5152- cpuflags="-mcpu=$cpu"
5153-
5154-elif enabled arm; then
5155-
5156- check_arm_arch() {
5157- test_cpp_condition stddef.h \
5158- "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
5159- $cpuflags
5160- }
5161-
5162- probe_arm_arch() {
5163- if check_arm_arch 4; then echo armv4
5164- elif check_arm_arch 4T; then echo armv4t
5165- elif check_arm_arch 5; then echo armv5
5166- elif check_arm_arch 5E; then echo armv5e
5167- elif check_arm_arch 5T; then echo armv5t
5168- elif check_arm_arch 5TE; then echo armv5te
5169- elif check_arm_arch 5TEJ; then echo armv5te
5170- elif check_arm_arch 6; then echo armv6
5171- elif check_arm_arch 6J; then echo armv6j
5172- elif check_arm_arch 6K; then echo armv6k
5173- elif check_arm_arch 6Z; then echo armv6z
5174- elif check_arm_arch 6KZ; then echo armv6zk
5175- elif check_arm_arch 6ZK; then echo armv6zk
5176- elif check_arm_arch 6T2; then echo armv6t2
5177- elif check_arm_arch 7; then echo armv7
5178- elif check_arm_arch 7A 7_A; then echo armv7-a
5179- elif check_arm_arch 7S; then echo armv7-a
5180- elif check_arm_arch 7R 7_R; then echo armv7-r
5181- elif check_arm_arch 7M 7_M; then echo armv7-m
5182- elif check_arm_arch 7EM 7E_M; then echo armv7-m
5183- elif check_arm_arch 8A 8_A; then echo armv8-a
5184- fi
5185- }
5186-
5187-
5188- case $cpu in
5189- generic)
5190- subarch=$(probe_arm_arch | sed 's/[^a-z0-9]//g')
5191- ;;
5192- armv*)
5193- cpuflags="-march=$cpu"
5194- subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
5195- ;;
5196- *)
5197- cpuflags="-mcpu=$cpu"
5198- case $cpu in
5199- cortex-a*) subarch=armv7a ;;
5200- cortex-r*) subarch=armv7r ;;
5201- cortex-m*) enable thumb; subarch=armv7m ;;
5202- arm11*) subarch=armv6 ;;
5203- arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
5204- armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
5205- *) subarch=$(probe_arm_arch) ;;
5206- esac
5207- ;;
5208- esac
5209-
5210- case "$subarch" in
5211- armv5t*) enable fast_clz ;;
5212- armv[6-8]*)
5213- enable fast_clz
5214- disabled fast_unaligned || enable fast_unaligned
5215- ;;
5216- esac
5217-
5218- test_cflags -mfp16-format=ieee && add_cflags -mfp16-format=ieee
5219-
5220-elif enabled avr32; then
5221-
5222- case $cpu in
5223- ap7[02]0[0-2])
5224- subarch="avr32_ap"
5225- cpuflags="-mpart=$cpu"
5226- ;;
5227- ap)
5228- subarch="avr32_ap"
5229- cpuflags="-march=$cpu"
5230- ;;
5231- uc3[ab]*)
5232- subarch="avr32_uc"
5233- cpuflags="-mcpu=$cpu"
5234- ;;
5235- uc)
5236- subarch="avr32_uc"
5237- cpuflags="-march=$cpu"
5238- ;;
5239- esac
5240-
5241-elif enabled bfin; then
5242-
5243- cpuflags="-mcpu=$cpu"
5244-
5245-elif enabled loongarch; then
5246-
5247- enable local_aligned
5248- enable simd_align_32
5249- enable fast_64bit
5250- enable fast_clz
5251- enable fast_unaligned
5252- case $cpu in
5253- la464)
5254- cpuflags="-march=$cpu"
5255- ;;
5256- esac
5257-elif enabled mips; then
5258-
5259- if [ "$cpu" != "generic" ]; then
5260- disable mips32r2
5261- disable mips32r5
5262- disable mips64r2
5263- disable mips32r6
5264- disable mips64r6
5265- disable loongson2
5266- disable loongson3
5267- disable mipsdsp
5268- disable mipsdspr2
5269-
5270- cpuflags="-march=$cpu"
5271-
5272- case $cpu in
5273- # General ISA levels
5274- mips1|mips3)
5275- ;;
5276- mips32r2)
5277- enable mips32r2
5278- ;;
5279- mips32r5)
5280- enable mips32r2
5281- enable mips32r5
5282- ;;
5283- mips64r2|mips64r5)
5284- enable mips64r2
5285- enable loongson3
5286- ;;
5287- # Cores from MIPS(MTI)
5288- 24kc)
5289- disable mipsfpu
5290- enable mips32r2
5291- ;;
5292- 24kf*|24kec|34kc|74Kc|1004kc)
5293- enable mips32r2
5294- ;;
5295- 24kef*|34kf*|1004kf*)
5296- enable mipsdsp
5297- enable mips32r2
5298- ;;
5299- p5600)
5300- enable mips32r2
5301- enable mips32r5
5302- check_cflags "-mtune=p5600" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops"
5303- ;;
5304- i6400)
5305- enable mips64r6
5306- check_cflags "-mtune=i6400 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
5307- ;;
5308- p6600)
5309- enable mips64r6
5310- check_cflags "-mtune=p6600 -mabi=64" && check_cflags "-msched-weight -mload-store-pairs -funroll-loops" && check_ldflags "-mabi=64"
5311- ;;
5312- # Cores from Loongson
5313- loongson2e|loongson2f|loongson3*)
5314- enable local_aligned
5315- enable simd_align_16
5316- enable fast_64bit
5317- enable fast_clz
5318- enable fast_cmov
5319- enable fast_unaligned
5320- disable aligned_stack
5321- # When gcc version less than 5.3.0, add -fno-expensive-optimizations flag.
5322- if test "$cc_type" = "gcc"; then
5323- case $gcc_basever in
5324- 2|2.*|3.*|4.*|5.0|5.1|5.2)
5325- expensive_optimization_flag="-fno-expensive-optimizations"
5326- ;;
5327- *)
5328- expensive_optimization_flag=""
5329- ;;
5330- esac
5331- fi
5332-
5333- case $cpu in
5334- loongson3*)
5335- enable loongson3
5336- cpuflags="-march=loongson3a -mhard-float $expensive_optimization_flag"
5337- ;;
5338- loongson2e)
5339- enable loongson2
5340- cpuflags="-march=loongson2e -mhard-float $expensive_optimization_flag"
5341- ;;
5342- loongson2f)
5343- enable loongson2
5344- cpuflags="-march=loongson2f -mhard-float $expensive_optimization_flag"
5345- ;;
5346- esac
5347- ;;
5348- *)
5349- warn "unknown MIPS CPU"
5350- ;;
5351- esac
5352-
5353- else
5354- disable mipsdsp
5355- disable mipsdspr2
5356- # Disable DSP stuff for generic CPU, it can't be detected at runtime.
5357- warn 'generic cpu selected'
5358- fi
5359-
5360-elif enabled ppc; then
5361-
5362- disable ldbrx
5363-
5364- case $(tolower $cpu) in
5365- 601|ppc601|powerpc601)
5366- cpuflags="-mcpu=601"
5367- disable altivec
5368- ;;
5369- 603*|ppc603*|powerpc603*)
5370- cpuflags="-mcpu=603"
5371- disable altivec
5372- ;;
5373- 604*|ppc604*|powerpc604*)
5374- cpuflags="-mcpu=604"
5375- disable altivec
5376- ;;
5377- g3|75*|ppc75*|powerpc75*)
5378- cpuflags="-mcpu=750"
5379- disable altivec
5380- ;;
5381- g4|745*|ppc745*|powerpc745*)
5382- cpuflags="-mcpu=7450"
5383- disable vsx
5384- ;;
5385- 74*|ppc74*|powerpc74*)
5386- cpuflags="-mcpu=7400"
5387- disable vsx
5388- ;;
5389- g5|970|ppc970|powerpc970)
5390- cpuflags="-mcpu=970"
5391- disable vsx
5392- ;;
5393- power[3-6]*)
5394- cpuflags="-mcpu=$cpu"
5395- disable vsx
5396- ;;
5397- power[7-8]*)
5398- cpuflags="-mcpu=$cpu"
5399- ;;
5400- cell)
5401- cpuflags="-mcpu=cell"
5402- enable ldbrx
5403- disable vsx
5404- ;;
5405- e500mc)
5406- cpuflags="-mcpu=e500mc"
5407- disable altivec
5408- ;;
5409- e500v2)
5410- cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
5411- disable altivec
5412- disable dcbzl
5413- ;;
5414- e500)
5415- cpuflags="-mcpu=8540 -mhard-float"
5416- disable altivec
5417- disable dcbzl
5418- ;;
5419- esac
5420-
5421-elif enabled riscv; then
5422-
5423- if test_cpp_condition stddef.h "__riscv_zbb"; then
5424- enable fast_clz
5425- fi
5426-
5427-elif enabled sparc; then
5428-
5429- case $cpu in
5430- cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
5431- cpuflags="-mcpu=$cpu"
5432- ;;
5433- ultrasparc*|niagara[234])
5434- cpuflags="-mcpu=$cpu"
5435- ;;
5436- esac
5437-
5438-elif enabled x86; then
5439-
5440- case $cpu in
5441- i[345]86|pentium)
5442- cpuflags="-march=$cpu"
5443- disable i686
5444- disable mmx
5445- ;;
5446- # targets that do NOT support nopl and conditional mov (cmov)
5447- pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
5448- cpuflags="-march=$cpu"
5449- disable i686
5450- ;;
5451- # targets that do support conditional mov but on which it's slow
5452- pentium4|pentium4m|prescott|nocona)
5453- cpuflags="-march=$cpu"
5454- enable i686
5455- disable fast_cmov
5456- ;;
5457- # everything else should support nopl and conditional mov (cmov)
5458- *)
5459- cpuflags="-march=$cpu"
5460- enable i686
5461- enable fast_cmov
5462- ;;
5463- esac
5464-
5465-fi
5466-
5467-if [ "$cpu" != generic ]; then
5468- add_cflags $cpuflags
5469- add_asflags $cpuflags
5470- test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
5471-fi
5472-
5473-# compiler sanity check
5474-test_exec <<EOF
5475-int main(void){ return 0; }
5476-EOF
5477-if test "$?" != 0; then
5478- echo "$cc is unable to create an executable file."
5479- if test -z "$cross_prefix" && ! enabled cross_compile ; then
5480- echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
5481- echo "Only do this if you know what cross compiling means."
5482- fi
5483- die "C compiler test failed."
5484-fi
5485-
5486-add_cppflags -D_ISOC99_SOURCE
5487-add_cxxflags -D__STDC_CONSTANT_MACROS
5488-check_cxxflags -std=c++11 || check_cxxflags -std=c++0x
5489-
5490-# some compilers silently accept -std=c11, so we also need to check that the
5491-# version macro is defined properly
5492-test_cflags_cc -std=c11 ctype.h "__STDC_VERSION__ >= 201112L" &&
5493- add_cflags -std=c11 ||
5494- check_cflags -std=c99
5495-
5496-check_cppflags -D_FILE_OFFSET_BITS=64
5497-check_cppflags -D_LARGEFILE_SOURCE
5498-
5499-add_host_cppflags -D_ISOC99_SOURCE
5500-check_host_cflags -std=c99
5501-check_host_cflags -Wall
5502-check_host_cflags $host_cflags_speed
5503-
5504-check_64bit(){
5505- arch32=$1
5506- arch64=$2
5507- expr=${3:-'sizeof(void *) > 4'}
5508- test_code cc "" "int test[2*($expr) - 1]" &&
5509- subarch=$arch64 || subarch=$arch32
5510- enable $subarch
5511-}
5512-
5513-case "$arch" in
5514- aarch64|alpha|ia64)
5515- enabled shared && enable_weak pic
5516- ;;
5517- loongarch)
5518- check_64bit loongarch32 loongarch64
5519- enabled loongarch64 && disable loongarch32
5520- enabled shared && enable_weak pic
5521- ;;
5522- mips)
5523- check_64bit mips mips64 '_MIPS_SIM > 1'
5524- enabled shared && enable_weak pic
5525- ;;
5526- parisc)
5527- check_64bit parisc parisc64
5528- enabled shared && enable_weak pic
5529- ;;
5530- ppc)
5531- check_64bit ppc ppc64
5532- enabled shared && enable_weak pic
5533- ;;
5534- riscv)
5535- check_64bit riscv32 riscv64
5536- enabled shared && enable_weak pic
5537- ;;
5538- s390)
5539- check_64bit s390 s390x
5540- enabled shared && enable_weak pic
5541- ;;
5542- sparc)
5543- check_64bit sparc sparc64
5544- enabled shared && enable_weak pic
5545- ;;
5546- x86)
5547- check_64bit x86_32 x86_64
5548- # Treat x32 as x64 for now. Note it also needs pic if shared
5549- test "$subarch" = "x86_32" && test_cpp_condition stddef.h 'defined(__x86_64__)' &&
5550- subarch=x86_64 && enable x86_64 && disable x86_32
5551- if enabled x86_64; then
5552- enabled shared && enable_weak pic
5553- objformat=elf64
5554- fi
5555- ;;
5556-esac
5557-
5558-# OS specific
5559-case $target_os in
5560- aix)
5561- SHFLAGS=-shared
5562- add_cppflags '-I\$(SRC_PATH)/compat/aix'
5563- enabled shared && add_ldflags -Wl,-brtl
5564- arflags='-Xany -r -c'
5565- striptype=""
5566- ;;
5567- android)
5568- disable symver
5569- enable section_data_rel_ro
5570- add_cflags -fPIE
5571- add_ldexeflags -fPIE -pie
5572- SLIB_INSTALL_NAME='$(SLIBNAME)'
5573- SLIB_INSTALL_LINKS=
5574- SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
5575- ;;
5576- haiku)
5577- prefix_default="/boot/common"
5578- network_extralibs="-lnetwork"
5579- host_extralibs=
5580- ;;
5581- sunos)
5582- SHFLAGS='-shared -Wl,-h,$$(@F)'
5583- enabled x86 && append SHFLAGS -mimpure-text
5584- network_extralibs="-lsocket -lnsl"
5585- add_cppflags -D__EXTENSIONS__
5586- # When using suncc to build, the Solaris linker will mark
5587- # an executable with each instruction set encountered by
5588- # the Solaris assembler. As our libraries contain their own
5589- # guards for processor-specific code, instead suppress
5590- # generation of the HWCAPS ELF section on Solaris x86 only.
5591- enabled_all suncc x86 &&
5592- echo "hwcap_1 = OVERRIDE;" > mapfile &&
5593- add_ldflags -Wl,-M,mapfile
5594- nm_default='nm -P -g'
5595- striptype=""
5596- version_script='-M'
5597- VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
5598- ;;
5599- netbsd)
5600- disable symver
5601- enable section_data_rel_ro
5602- oss_indev_extralibs="-lossaudio"
5603- oss_outdev_extralibs="-lossaudio"
5604- enabled gcc || check_ldflags -Wl,-zmuldefs
5605- ;;
5606- openbsd|bitrig)
5607- disable symver
5608- enable section_data_rel_ro
5609- striptype=""
5610- SHFLAGS='-shared'
5611- SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
5612- SLIB_INSTALL_LINKS=
5613- oss_indev_extralibs="-lossaudio"
5614- oss_outdev_extralibs="-lossaudio"
5615- ;;
5616- dragonfly)
5617- disable symver
5618- ;;
5619- freebsd)
5620- enable section_data_rel_ro
5621- ;;
5622- bsd/os)
5623- add_extralibs -lpoll -lgnugetopt
5624- strip="strip -d"
5625- ;;
5626- darwin)
5627- enabled ppc && add_asflags -force_cpusubtype_ALL
5628- install_name_dir_default='$(SHLIBDIR)'
5629- SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(INSTALL_NAME_DIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
5630- enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
5631- strip="${strip} -x"
5632- add_ldflags -Wl,-dynamic,-search_paths_first
5633- check_cflags -Werror=partial-availability
5634- SLIBSUF=".dylib"
5635- SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
5636- SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
5637- enabled x86_64 && objformat="macho64" || objformat="macho32"
5638- enabled_any pic shared x86_64 ||
5639- { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
5640- check_headers dispatch/dispatch.h &&
5641- add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
5642- if test -n "$sysroot"; then
5643- is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
5644- is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
5645- fi
5646- version_script='-exported_symbols_list'
5647- VERSION_SCRIPT_POSTPROCESS_CMD='tr " " "\n" | sed -n /global:/,/local:/p | grep ";" | tr ";" "\n" | sed -E "s/(.+)/_\1/g" | sed -E "s/(.+[^*])$$$$/\1*/"'
5648- # Workaround for Xcode 11 -fstack-check bug
5649- if enabled clang; then
5650- clang_version=$($cc -dumpversion)
5651- test ${clang_version%%.*} -eq 11 && add_cflags -fno-stack-check
5652- fi
5653- ;;
5654- msys*)
5655- die "Native MSYS builds are discouraged, please use the MINGW environment."
5656- ;;
5657- mingw32*|mingw64*)
5658- target_os=mingw32
5659- LIBTARGET=i386
5660- if enabled x86_64; then
5661- LIBTARGET="i386:x86-64"
5662- elif enabled arm; then
5663- LIBTARGET="arm"
5664- elif enabled aarch64; then
5665- LIBTARGET="arm64"
5666- fi
5667- if enabled shared; then
5668- # Cannot build both shared and static libs when using dllimport.
5669- disable static
5670- fi
5671- ! enabled small && test_cmd $windres --version && enable gnu_windres
5672- enabled x86_32 && check_ldflags -Wl,--large-address-aware
5673- add_cppflags -DWIN32_LEAN_AND_MEAN
5674- shlibdir_default="$bindir_default"
5675- SLIBPREF=""
5676- SLIBSUF=".dll"
5677- SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5678- SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
5679- if test_cmd lib.exe -list; then
5680- SLIB_EXTRA_CMD=-'lib.exe -nologo -machine:$(LIBTARGET) -def:$$(@:$(SLIBSUF)=.def) -out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
5681- if enabled x86_64; then
5682- LIBTARGET=x64
5683- fi
5684- else
5685- SLIB_EXTRA_CMD=-'$(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
5686- fi
5687- SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5688- SLIB_INSTALL_LINKS=
5689- SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
5690- SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
5691- SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
5692- SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--disable-auto-image-base $$(@:$(SLIBSUF)=.def)'
5693- enabled x86_64 && objformat="win64" || objformat="win32"
5694- dlltool="${cross_prefix}dlltool"
5695- ranlib=:
5696- enable dos_paths
5697- check_ldflags -Wl,--nxcompat,--dynamicbase
5698- # Lets work around some stupidity in binutils.
5699- # ld will strip relocations from executables even though we need them
5700- # for dynamicbase (ASLR). Using -pie does retain the reloc section
5701- # however ld then forgets what the entry point should be (oops) so we
5702- # have to manually (re)set it.
5703- if enabled x86_32; then
5704- disabled debug && add_ldexeflags -Wl,--pic-executable,-e,_mainCRTStartup
5705- elif enabled x86_64; then
5706- disabled debug && add_ldexeflags -Wl,--pic-executable,-e,mainCRTStartup
5707- check_ldflags -Wl,--high-entropy-va # binutils 2.25
5708- # Set image base >4GB for extra entropy with HEASLR
5709- add_ldexeflags -Wl,--image-base,0x140000000
5710- append SHFLAGS -Wl,--image-base,0x180000000
5711- fi
5712- ;;
5713- win32|win64)
5714- disable symver
5715- if enabled shared; then
5716- # Link to the import library instead of the normal static library
5717- # for shared libs.
5718- LD_LIB='%.lib'
5719- # Cannot build both shared and static libs with MSVC or icl.
5720- disable static
5721- fi
5722- ! enabled small && test_cmd $windres --version && enable gnu_windres
5723- enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
5724- add_cppflags -DWIN32_LEAN_AND_MEAN
5725- shlibdir_default="$bindir_default"
5726- SLIBPREF=""
5727- SLIBSUF=".dll"
5728- SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5729- SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
5730- SLIB_CREATE_DEF_CMD='EXTERN_PREFIX="$(EXTERN_PREFIX)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
5731- SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5732- SLIB_INSTALL_LINKS=
5733- SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
5734- SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
5735- SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
5736- enabled x86_64 && objformat="win64" || objformat="win32"
5737- ranlib=:
5738- enable dos_paths
5739- ;;
5740- cygwin*)
5741- target_os=cygwin
5742- shlibdir_default="$bindir_default"
5743- SLIBPREF="cyg"
5744- SLIBSUF=".dll"
5745- SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5746- SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
5747- SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5748- SLIB_INSTALL_LINKS=
5749- SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
5750- SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
5751- enabled x86_64 && objformat="win64" || objformat="win32"
5752- enable dos_paths
5753- ! enabled small && test_cmd $windres --version && enable gnu_windres
5754- add_cppflags -DWIN32_LEAN_AND_MEAN
5755- add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5756- ;;
5757- *-dos|freedos|opendos)
5758- network_extralibs="-lsocket"
5759- objformat="coff"
5760- enable dos_paths
5761- ;;
5762- linux)
5763- enable section_data_rel_ro
5764- enabled_any arm aarch64 && enable_weak linux_perf
5765- ;;
5766- irix*)
5767- target_os=irix
5768- ranlib="echo ignoring ranlib"
5769- ;;
5770- os/2*)
5771- strip="lxlite -CS"
5772- striptype=""
5773- objformat="aout"
5774- add_cppflags -D_GNU_SOURCE
5775- add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap
5776- SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
5777- LIBSUF="_s.a"
5778- SLIBPREF=""
5779- SLIBSUF=".dll"
5780- SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
5781- SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(FULLNAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
5782- SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(FULLNAME).def; \
5783- echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(FULLNAME).def; \
5784- echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(FULLNAME).def; \
5785- echo EXPORTS >> $(SUBDIR)$(FULLNAME).def; \
5786- emxexp $(OBJS) >> $(SUBDIR)$(FULLNAME).def'
5787- SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.a $(SUBDIR)$(FULLNAME).def; \
5788- emximp -o $(SUBDIR)$(LIBPREF)$(FULLNAME)_dll.lib $(SUBDIR)$(FULLNAME).def;'
5789- SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
5790- SLIB_INSTALL_LINKS=
5791- SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(FULLNAME)_dll.a $(LIBPREF)$(FULLNAME)_dll.lib'
5792- enable dos_paths
5793- enable_weak os2threads
5794- ;;
5795- gnu/kfreebsd)
5796- add_cppflags -D_BSD_SOURCE
5797- ;;
5798- gnu)
5799- ;;
5800- qnx)
5801- add_cppflags -D_QNX_SOURCE
5802- network_extralibs="-lsocket"
5803- ;;
5804- symbian)
5805- SLIBSUF=".dll"
5806- enable dos_paths
5807- add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
5808- add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
5809- add_ldflags -Wl,--target1-abs,--no-undefined \
5810- -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
5811- -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
5812- add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
5813- -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
5814- -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
5815- ;;
5816- minix)
5817- ;;
5818- none)
5819- ;;
5820- *)
5821- die "Unknown OS '$target_os'."
5822- ;;
5823-esac
5824-
5825-# test if creating links works
5826-link_dest=$(mktemp -u $TMPDIR/dest_XXXXXXXX)
5827-link_name=$(mktemp -u $TMPDIR/name_XXXXXXXX)
5828-mkdir "$link_dest"
5829-$ln_s "$link_dest" "$link_name"
5830-touch "$link_dest/test_file"
5831-if [ "$source_path" != "." ] && [ "$source_path" != "src" ] && ([ ! -d src ] || [ -L src ]) && [ -e "$link_name/test_file" ]; then
5832- # create link to source path
5833- [ -e src ] && rm src
5834- $ln_s "$source_path" src
5835- source_link=src
5836-else
5837- # creating directory links doesn't work
5838- # fall back to using the full source path
5839- source_link="$source_path"
5840-fi
5841-# cleanup
5842-rm -r "$link_dest"
5843-rm -r "$link_name"
5844-
5845-# determine libc flavour
5846-
5847-probe_libc(){
5848- pfx=$1
5849- pfx_no_=${pfx%_}
5850- # uclibc defines __GLIBC__, so it needs to be checked before glibc.
5851- if test_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
5852- eval ${pfx}libc_type=uclibc
5853- add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5854- elif test_${pfx}cpp_condition features.h "defined __GLIBC__"; then
5855- eval ${pfx}libc_type=glibc
5856- add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5857- # MinGW headers can be installed on Cygwin, so check for newlib first.
5858- elif test_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
5859- eval ${pfx}libc_type=newlib
5860- add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600
5861- # MinGW64 is backwards compatible with MinGW32, so check for it first.
5862- elif test_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
5863- eval ${pfx}libc_type=mingw64
5864- if test_${pfx}cpp_condition _mingw.h "__MINGW64_VERSION_MAJOR < 3"; then
5865- add_compat msvcrt/snprintf.o
5866- add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
5867- fi
5868- add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
5869- eval test \$${pfx_no_}cc_type = "gcc" &&
5870- add_${pfx}cppflags -D__printf__=__gnu_printf__
5871- test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
5872- add_${pfx}cppflags -D_WIN32_WINNT=0x0600
5873- add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5874- elif test_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
5875- test_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
5876- eval ${pfx}libc_type=mingw32
5877- test_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
5878- (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
5879- die "ERROR: MinGW32 runtime version must be >= 3.15."
5880- add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
5881- test_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
5882- add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
5883- test_${pfx}cpp_condition windows.h "!defined(_WIN32_WINNT) || _WIN32_WINNT < 0x0600" &&
5884- add_${pfx}cppflags -D_WIN32_WINNT=0x0600
5885- eval test \$${pfx_no_}cc_type = "gcc" &&
5886- add_${pfx}cppflags -D__printf__=__gnu_printf__
5887- add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5888- elif test_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
5889- eval ${pfx}libc_type=msvcrt
5890- if test_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
5891- if [ "$pfx" = host_ ]; then
5892- add_host_cppflags -Dsnprintf=_snprintf
5893- else
5894- add_compat strtod.o strtod=avpriv_strtod
5895- add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
5896- _snprintf=avpriv_snprintf \
5897- vsnprintf=avpriv_vsnprintf
5898- fi
5899- fi
5900- add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
5901- # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
5902- # 0x601 by default unless something else is set by the user.
5903- # This can easily lead to us detecting functions only present
5904- # in such new versions and producing binaries requiring windows 7.0.
5905- # Therefore explicitly set the default to Vista unless the user has
5906- # set something else on the command line.
5907- # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
5908- # family. For these cases, configure is free to use any functions
5909- # found in the SDK headers by default. (Alternatively, we could force
5910- # _WIN32_WINNT to 0x0602 in that case.)
5911- test_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
5912- { test_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0600; }
5913-#ifdef WINAPI_FAMILY
5914-#include <winapifamily.h>
5915-#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
5916-#error not desktop
5917-#endif
5918-#endif
5919-EOF
5920- if [ "$pfx" = "" ]; then
5921- check_func strtoll || add_cflags -Dstrtoll=_strtoi64
5922- check_func strtoull || add_cflags -Dstrtoull=_strtoui64
5923- fi
5924- elif test_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
5925- eval ${pfx}libc_type=klibc
5926- elif test_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
5927- eval ${pfx}libc_type=bionic
5928- elif test_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
5929- eval ${pfx}libc_type=solaris
5930- add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
5931- elif test_${pfx}cpp_condition sys/version.h "defined __DJGPP__"; then
5932- eval ${pfx}libc_type=djgpp
5933- add_cppflags -U__STRICT_ANSI__
5934- add_cflags "-include $source_path/compat/djgpp/math.h"
5935- add_compat djgpp/math.o
5936- fi
5937- test_${pfx}cc <<EOF
5938-#include <time.h>
5939-void *v = localtime_r;
5940-EOF
5941-test "$?" != 0 && test_${pfx}cc -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 <<EOF && add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
5942-#include <time.h>
5943-void *v = localtime_r;
5944-EOF
5945-
5946- eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
5947-}
5948-
5949-probe_libc
5950-probe_libc host_
5951-
5952-# hacks for compiler/libc/os combinations
5953-
5954-case $libc_type in
5955- bionic)
5956- add_compat strtod.o strtod=avpriv_strtod
5957- ;;
5958-esac
5959-
5960-check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
5961- add_cppflags '-I\$(SRC_PATH)/compat/float'
5962-
5963-test_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
5964-
5965-set_default libdir
5966-: ${shlibdir_default:="$libdir"}
5967-: ${pkgconfigdir_default:="$libdir/pkgconfig"}
5968-
5969-set_default $PATHS_LIST
5970-set_default nm
5971-
5972-disabled optimizations || enabled ossfuzz || check_cflags -fomit-frame-pointer
5973-
5974-enable_weak_pic() {
5975- disabled pic && return
5976- enable pic
5977- add_cppflags -DPIC
5978- case "$target_os" in
5979- mingw*|cygwin*|win*)
5980- ;;
5981- *)
5982- add_cflags -fPIC
5983- add_asflags -fPIC
5984- ;;
5985- esac
5986-}
5987-
5988-enabled pic && enable_weak_pic
5989-
5990-test_cc <<EOF || die "Symbol mangling check failed."
5991-int ff_extern;
5992-EOF
5993-sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
5994-extern_prefix=${sym%%ff_extern*}
5995-
5996-! disabled inline_asm && check_inline_asm inline_asm '"" ::'
5997-
5998-for restrict_keyword in restrict __restrict__ __restrict ""; do
5999- test_code cc "" "char * $restrict_keyword p" && break
6000-done
6001-
6002-check_cc pragma_deprecated "" '_Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"")'
6003-
6004-# The global variable ensures the bits appear unchanged in the object file.
6005-test_cc <<EOF || die "endian test failed"
6006-unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
6007-EOF
6008-od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
6009-
6010-check_cc const_nan math.h "struct { double d; } static const bar[] = { { NAN } }"
6011-
6012-if ! enabled ppc64 || enabled bigendian; then
6013- disable vsx
6014-fi
6015-
6016-check_gas() {
6017- log "check_gas using '$as' as AS"
6018- # :vararg is used on aarch64, arm and ppc altivec
6019- check_as vararg "
6020-.macro m n, y:vararg=0
6021-\n: .int \y
6022-.endm
6023-m x" || return 1
6024- # .altmacro is only used in arm asm
6025- ! enabled arm || check_as gnu_as ".altmacro"
6026-}
6027-
6028-if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
6029- nogas=:
6030- enabled_any arm aarch64 && nogas=die
6031- enabled_all ppc altivec && [ $target_os_default != aix ] && nogas=warn
6032- as_noop=-v
6033-
6034- case $as_type in
6035- arm*) gaspp_as_type=armasm; as_noop=-h ;;
6036- gcc) gaspp_as_type=gas ;;
6037- *) gaspp_as_type=$as_type ;;
6038- esac
6039-
6040- [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
6041-
6042- test "${as#*gas-preprocessor.pl}" != "$as" ||
6043- test_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- ${as:=$cc} $as_noop &&
6044- gas="${gas:=gas-preprocessor.pl} -arch $arch -as-type $gaspp_as_type -- ${as:=$cc}"
6045-
6046- if ! check_gas ; then
6047- as=${gas:=$as}
6048- check_gas || \
6049- $nogas "GNU assembler not found, install/update gas-preprocessor"
6050- fi
6051-
6052- check_as as_func ".func test
6053- .endfunc"
6054-fi
6055-
6056-check_inline_asm inline_asm_labels '"1:\n"'
6057-
6058-check_inline_asm inline_asm_nonlocal_labels '"Label:\n"'
6059-
6060-if enabled aarch64; then
6061- as_arch_level="armv8-a"
6062- check_as as_arch_directive ".arch $as_arch_level"
6063- enabled as_arch_directive && check_arch_level armv8.2-a
6064-
6065- enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
6066- # internal assembler in clang 3.3 does not support this instruction
6067- enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
6068-
6069- archext_list="dotprod i8mm"
6070- enabled dotprod && check_archext_insn dotprod 'udot v0.4s, v0.16b, v0.16b'
6071- enabled i8mm && check_archext_insn i8mm 'usdot v0.4s, v0.16b, v0.16b'
6072-
6073- # Disable the main feature (e.g. HAVE_NEON) if neither inline nor external
6074- # assembly support the feature out of the box. Skip this for the features
6075- # checked with check_archext_insn above, as that function takes care of
6076- # updating all the variables as necessary.
6077- for v in $ARCH_EXT_LIST_ARM; do
6078- is_in $v $archext_list && continue
6079- enabled_any ${v}_external ${v}_inline || disable $v
6080- done
6081-
6082-elif enabled alpha; then
6083-
6084- check_cflags -mieee
6085-
6086-elif enabled arm; then
6087-
6088- enabled msvc && check_cpp_condition thumb stddef.h "defined _M_ARMT"
6089- test_cpp_condition stddef.h "defined __thumb__" && test_cc <<EOF && enable_weak thumb
6090-float func(float a, float b){ return a+b; }
6091-EOF
6092- enabled thumb && check_cflags -mthumb || check_cflags -marm
6093-
6094- if check_cpp_condition vfp_args stddef.h "defined __ARM_PCS_VFP"; then
6095- :
6096- elif check_cpp_condition vfp_args stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
6097- :
6098- elif ! test_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
6099- case "${cross_prefix:-$cc}" in
6100- *hardfloat*) enable vfp_args; fpabi=vfp ;;
6101- *) check_ld "cc" vfp_args <<EOF && fpabi=vfp || fpabi=soft ;;
6102-__asm__ (".eabi_attribute 28, 1");
6103-int main(void) { return 0; }
6104-EOF
6105- esac
6106- warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
6107- fi
6108-
6109- # Test for various instruction sets, testing support both in inline and
6110- # external assembly. This sets the ${v}_inline or ${v}_external flags
6111- # if the instruction can be used unconditionally in either inline or
6112- # external assembly. This means that if the ${v}_external feature is set,
6113- # that feature can be used unconditionally in various support macros
6114- # anywhere in external assembly, in any function.
6115- enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
6116- enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
6117- enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
6118- enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
6119- enabled vfp && check_insn vfp 'fadds s0, s0, s0'
6120- enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
6121- enabled setend && check_insn setend 'setend be'
6122-
6123- # If neither inline nor external assembly can use the feature by default,
6124- # disable the main unsuffixed feature (e.g. HAVE_NEON).
6125- #
6126- # For targets that support runtime CPU feature detection, don't disable
6127- # the main feature flag - there we assume that all supported toolchains
6128- # can assemble code for all instruction set features (e.g. NEON) with
6129- # suitable assembly flags (such as ".fpu neon"); we don't check
6130- # specifically that they really do.
6131- [ $target_os = linux ] || [ $target_os = android ] ||
6132- map 'enabled_any ${v}_external ${v}_inline || disable $v' \
6133- $ARCH_EXT_LIST_ARM
6134-
6135- check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
6136-
6137- check_as as_arch_directive ".arch armv7-a"
6138- check_as as_dn_directive "ra .dn d0.i16"
6139- check_as as_fpu_directive ".fpu neon"
6140-
6141- # llvm's integrated assembler supports .object_arch from llvm 3.5
6142- [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
6143- check_as as_object_arch ".object_arch armv4"
6144-
6145- # MS armasm fails to assemble our PIC constructs
6146- [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
6147-
6148-elif enabled mips; then
6149-
6150- # Check toolchain ISA level
6151- if enabled mips64; then
6152- enabled mips64r6 && check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' &&
6153- disable mips64r2
6154-
6155- enabled mips64r2 && check_inline_asm mips64r2 '"dext $0, $0, 0, 1"'
6156-
6157- disable mips32r6 && disable mips32r5 && disable mips32r2
6158- else
6159- enabled mips32r6 && check_inline_asm mips32r6 '"aui $0, $0, 0"' &&
6160- disable mips32r5 && disable mips32r2
6161-
6162- enabled mips32r5 && check_inline_asm mips32r5 '"eretnc"'
6163- enabled mips32r2 && check_inline_asm mips32r2 '"ext $0, $0, 0, 1"'
6164-
6165- disable mips64r6 && disable mips64r5 && disable mips64r2
6166- fi
6167-
6168- enabled mipsfpu && check_inline_asm mipsfpu '"cvt.d.l $f0, $f2"'
6169- enabled mipsfpu && (enabled mips32r5 || enabled mips32r6 || enabled mips64r6) && check_inline_asm_flags mipsfpu '"cvt.d.l $f0, $f1"' '-mfp64'
6170-
6171- enabled mipsdsp && check_inline_asm_flags mipsdsp '"addu.qb $t0, $t1, $t2"' '-mdsp'
6172- enabled mipsdspr2 && check_inline_asm_flags mipsdspr2 '"absq_s.qb $t0, $t1"' '-mdspr2'
6173-
6174- # MSA can be detected at runtime so we supply extra flags here
6175- enabled mipsfpu && enabled msa && check_inline_asm msa '"addvi.b $w0, $w1, 1"' '-mmsa' && append MSAFLAGS '-mmsa'
6176-
6177- # loongson2 have no switch cflag so we can only probe toolchain ability
6178- enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"' && disable loongson3
6179-
6180- # loongson3 is paired with MMI
6181- enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"' '-mloongson-ext' && append MMIFLAGS '-mloongson-ext'
6182-
6183- # MMI can be detected at runtime too
6184- enabled mmi && check_inline_asm mmi '"pxor $f0, $f0, $f0"' '-mloongson-mmi' && append MMIFLAGS '-mloongson-mmi'
6185-
6186- if enabled bigendian && enabled msa; then
6187- disable msa
6188- fi
6189-
6190-elif enabled parisc; then
6191-
6192- if enabled gcc; then
6193- case $($cc -dumpversion) in
6194- 4.[3-9].*) check_cflags -fno-optimize-sibling-calls ;;
6195- esac
6196- fi
6197-
6198-elif enabled ppc; then
6199-
6200- enable local_aligned
6201-
6202- check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
6203- check_inline_asm ibm_asm '"add 0, 0, 0"'
6204- check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
6205- check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
6206-
6207- if enabled altivec; then
6208- check_cflags -maltivec -mabi=altivec
6209-
6210- # check if our compiler supports Motorola AltiVec C API
6211- check_cc altivec altivec.h "vector signed int v1 = (vector signed int) { 0 };
6212- vector signed int v2 = (vector signed int) { 1 };
6213- v1 = vec_add(v1, v2);"
6214-
6215- enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
6216- fi
6217-
6218- if enabled vsx; then
6219- check_cflags -mvsx &&
6220- check_cc vsx altivec.h "int v[4] = { 0 };
6221- vector signed int v1 = vec_vsx_ld(0, v);"
6222- fi
6223-
6224- if enabled power8; then
6225- check_cpp_condition power8 "altivec.h" "defined(_ARCH_PWR8)"
6226- fi
6227-
6228- if enabled altivec; then
6229- check_cc vec_xl altivec.h "const unsigned char *y1i = { 0 };
6230- vector unsigned char y0 = vec_xl(0, y1i);"
6231- fi
6232-
6233-elif enabled riscv; then
6234-
6235- enabled rv && check_inline_asm rv '".option arch, +zbb\nrev8 t0, t1"'
6236- enabled rvv && check_inline_asm rvv '".option arch, +v\nvsetivli zero, 0, e8, m1, ta, ma"'
6237-
6238-elif enabled x86; then
6239-
6240- check_builtin rdtsc intrin.h "__rdtsc()"
6241- check_builtin mm_empty mmintrin.h "_mm_empty()"
6242-
6243- enable local_aligned
6244-
6245- # check whether EBP is available on x86
6246- # As 'i' is stored on the stack, this program will crash
6247- # if the base pointer is used to access it because the
6248- # base pointer is cleared in the inline assembly code.
6249- check_exec_crash <<EOF && enable ebp_available
6250-volatile int i=0;
6251-__asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
6252-return i;
6253-EOF
6254-
6255- # check whether EBX is available on x86
6256- check_inline_asm ebx_available '""::"b"(0)' &&
6257- check_inline_asm ebx_available '"":::"%ebx"'
6258-
6259- # check whether xmm clobbers are supported
6260- check_inline_asm xmm_clobbers '"":::"%xmm0"'
6261-
6262- check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
6263- check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
6264-
6265- # check whether binutils is new enough to compile SSSE3/MMXEXT
6266- enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
6267- enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
6268-
6269- probe_x86asm(){
6270- x86asmexe_probe=$1
6271- if test_cmd $x86asmexe_probe -v; then
6272- x86asmexe=$x86asmexe_probe
6273- x86asm_type=nasm
6274- x86asm_debug="-g -F dwarf"
6275- X86ASMDEP=
6276- X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
6277- elif test_cmd $x86asmexe_probe --version; then
6278- x86asmexe=$x86asmexe_probe
6279- x86asm_type=yasm
6280- x86asm_debug="-g dwarf2"
6281- X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
6282- X86ASM_DEPFLAGS=
6283- fi
6284- check_x86asm x86asm "movbe ecx, [5]"
6285- }
6286-
6287- if ! disabled_any asm mmx x86asm; then
6288- disable x86asm
6289- for program in $x86asmexe nasm yasm; do
6290- probe_x86asm $program && break
6291- done
6292- disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
6293- X86ASMFLAGS="-f $objformat"
6294- enabled pic && append X86ASMFLAGS "-DPIC"
6295- test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
6296- case "$objformat" in
6297- elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
6298- esac
6299-
6300- enabled avx512 && check_x86asm avx512_external "vmovdqa32 [eax]{k1}{z}, zmm0"
6301- enabled avx512icl && check_x86asm avx512icl_external "vpdpwssds zmm31{k1}{z}, zmm29, zmm28"
6302- enabled avx2 && check_x86asm avx2_external "vextracti128 xmm0, ymm0, 0"
6303- enabled xop && check_x86asm xop_external "vpmacsdd xmm0, xmm1, xmm2, xmm3"
6304- enabled fma4 && check_x86asm fma4_external "vfmaddps ymm0, ymm1, ymm2, ymm3"
6305- check_x86asm cpunop "CPU amdnop"
6306- fi
6307-
6308- case "$cpu" in
6309- athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
6310- disable fast_clz
6311- ;;
6312- esac
6313-
6314-elif enabled loongarch; then
6315- enabled lsx && check_inline_asm lsx '"vadd.b $vr0, $vr1, $vr2"' '-mlsx' && append LSXFLAGS '-mlsx'
6316- enabled lasx && check_inline_asm lasx '"xvadd.b $xr0, $xr1, $xr2"' '-mlasx' && append LASXFLAGS '-mlasx'
6317-fi
6318-
6319-check_cc intrinsics_neon arm_neon.h "int16x8_t test = vdupq_n_s16(0)"
6320-
6321-check_ldflags -Wl,--as-needed
6322-check_ldflags -Wl,-z,noexecstack
6323-
6324-if ! disabled network; then
6325- check_func getaddrinfo $network_extralibs
6326- check_func inet_aton $network_extralibs
6327-
6328- check_type netdb.h "struct addrinfo"
6329- check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
6330- check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
6331- check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
6332- check_type poll.h "struct pollfd"
6333- check_type netinet/sctp.h "struct sctp_event_subscribe"
6334- check_struct "sys/socket.h" "struct msghdr" msg_flags
6335- check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
6336- check_type netinet/in.h "struct sockaddr_in6"
6337- check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
6338- check_type "sys/types.h sys/socket.h" socklen_t
6339-
6340- # Prefer arpa/inet.h over winsock2
6341- if check_headers arpa/inet.h ; then
6342- check_func closesocket
6343- elif check_headers winsock2.h ; then
6344- check_func_headers winsock2.h closesocket -lws2 &&
6345- network_extralibs="-lws2" ||
6346- { check_func_headers winsock2.h closesocket -lws2_32 &&
6347- network_extralibs="-lws2_32"; } || disable winsock2_h network
6348- check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
6349-
6350- check_type ws2tcpip.h socklen_t
6351- check_type ws2tcpip.h "struct addrinfo"
6352- check_type ws2tcpip.h "struct group_source_req"
6353- check_type ws2tcpip.h "struct ip_mreq_source"
6354- check_type ws2tcpip.h "struct ipv6_mreq"
6355- check_type winsock2.h "struct pollfd"
6356- check_struct winsock2.h "struct sockaddr" sa_len
6357- check_type ws2tcpip.h "struct sockaddr_in6"
6358- check_type ws2tcpip.h "struct sockaddr_storage"
6359- else
6360- disable network
6361- fi
6362-fi
6363-
6364-check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
6365-check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
6366-check_builtin MemoryBarrier windows.h "MemoryBarrier()"
6367-check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
6368-check_builtin gmtime_r time.h "time_t *time; struct tm *tm; gmtime_r(time, tm)"
6369-check_builtin localtime_r time.h "time_t *time; struct tm *tm; localtime_r(time, tm)"
6370-
6371-check_builtin float16 "" "_Float16 f16var"
6372-if enabled float16; then
6373- if enabled x86; then
6374- test_cpp_condition stddef.h "defined(__F16C__)" && enable fast_float16
6375- elif enabled arm || enabled aarch64; then
6376- enable fast_float16
6377- fi
6378-fi
6379-
6380-case "$custom_allocator" in
6381- "")
6382- ;;
6383- jemalloc)
6384- test -n "$malloc_prefix" ||
6385- malloc_prefix=$($pkg_config --variable=jemalloc_prefix $pkg_config_flags jemalloc 2>/dev/null)
6386- require_pkg_config custom_allocator jemalloc jemalloc/jemalloc.h ${malloc_prefix}malloc
6387- ;;
6388- tcmalloc)
6389- require_pkg_config custom_allocator libtcmalloc gperftools/tcmalloc.h tc_malloc
6390- malloc_prefix=tc_
6391- ;;
6392- *)
6393- require_pkg_config custom_allocator "$custom_allocator" stdlib.h malloc
6394- ;;
6395-esac
6396-
6397-if test -n "$custom_allocator"; then
6398- add_extralibs "$custom_allocator_extralibs"
6399-fi
6400-
6401-check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
6402-check_func ${malloc_prefix}memalign && enable memalign
6403-check_func ${malloc_prefix}posix_memalign && enable posix_memalign
6404-
6405-check_func access
6406-check_func_headers stdlib.h arc4random_buf
6407-check_lib clock_gettime time.h clock_gettime || check_lib clock_gettime time.h clock_gettime -lrt
6408-check_func fcntl
6409-check_func fork
6410-check_func gethrtime
6411-check_func getopt
6412-check_func getrusage
6413-check_func gettimeofday
6414-check_func isatty
6415-check_func mkstemp
6416-check_func mmap
6417-check_func mprotect
6418-# Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
6419-check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt
6420-check_func_headers sys/prctl.h prctl
6421-check_func sched_getaffinity
6422-check_func setrlimit
6423-check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
6424-check_func strerror_r
6425-check_func sysconf
6426-check_func sysctl
6427-check_func usleep
6428-
6429-check_func_headers conio.h kbhit
6430-check_func_headers io.h setmode
6431-check_func_headers lzo/lzo1x.h lzo1x_999_compress
6432-check_func_headers mach/mach_time.h mach_absolute_time
6433-check_func_headers stdlib.h getenv
6434-check_func_headers sys/stat.h lstat
6435-check_func_headers sys/auxv.h getauxval
6436-check_func_headers sys/sysctl.h sysctlbyname
6437-
6438-check_func_headers windows.h GetModuleHandle
6439-check_func_headers windows.h GetProcessAffinityMask
6440-check_func_headers windows.h GetProcessTimes
6441-check_func_headers windows.h GetStdHandle
6442-check_func_headers windows.h GetSystemTimeAsFileTime
6443-check_func_headers windows.h LoadLibrary
6444-check_func_headers windows.h MapViewOfFile
6445-check_func_headers windows.h PeekNamedPipe
6446-check_func_headers windows.h SetConsoleTextAttribute
6447-check_func_headers windows.h SetConsoleCtrlHandler
6448-check_func_headers windows.h SetDllDirectory
6449-check_func_headers windows.h Sleep
6450-check_func_headers windows.h VirtualAlloc
6451-check_func_headers glob.h glob
6452-
6453-if enabled xlib; then
6454- check_pkg_config xlib_x11 x11 "X11/Xlib.h" XPending ||
6455- check_lib xlib_x11 "X11/Xlib.h" XPending -lX11 ||
6456- disable xlib
6457-
6458- check_pkg_config xlib_xext xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach ||
6459- check_lib xlib_xext "X11/Xlib.h X11/extensions/XShm.h" XShmAttach -lXext ||
6460- disable xlib
6461-
6462- check_pkg_config xlib_xv xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute ||
6463- check_lib xlib_xv "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv ||
6464- disable xlib
6465-fi
6466-
6467-check_headers direct.h
6468-check_headers dirent.h
6469-check_headers dxgidebug.h
6470-check_headers dxva.h
6471-check_headers dxva2api.h -D_WIN32_WINNT=0x0600
6472-check_headers io.h
6473-enabled libdrm &&
6474- check_headers linux/dma-buf.h
6475-
6476-check_headers linux/perf_event.h
6477-check_headers libcrystalhd/libcrystalhd_if.h
6478-check_headers malloc.h
6479-check_headers mftransform.h
6480-check_headers net/udplite.h
6481-check_headers poll.h
6482-check_headers pthread_np.h
6483-check_headers sys/param.h
6484-check_headers sys/resource.h
6485-check_headers sys/select.h
6486-check_headers sys/time.h
6487-check_headers sys/un.h
6488-check_headers termios.h
6489-check_headers unistd.h
6490-check_headers valgrind/valgrind.h
6491-check_func_headers VideoToolbox/VTCompressionSession.h VTCompressionSessionPrepareToEncodeFrames -framework VideoToolbox
6492-check_func_headers VideoToolbox/VideoToolbox.h VTPixelRotationSessionCreate -framework VideoToolbox
6493-check_headers windows.h
6494-check_headers asm/types.h
6495-
6496-# it seems there are versions of clang in some distros that try to use the
6497-# gcc headers, which explodes for stdatomic
6498-# so we also check that atomics actually work here
6499-#
6500-# some configurations also require linking to libatomic, so try
6501-# both with -latomic and without
6502-for LATOMIC in "-latomic" ""; do
6503- check_builtin stdatomic stdatomic.h \
6504- "atomic_int foo, bar = ATOMIC_VAR_INIT(-1); atomic_store(&foo, 0); foo += bar" \
6505- $LATOMIC && eval stdatomic_extralibs="\$LATOMIC" && break
6506-done
6507-
6508-check_lib advapi32 "windows.h" RegCloseKey -ladvapi32
6509-check_lib bcrypt "windows.h bcrypt.h" BCryptGenRandom -lbcrypt &&
6510- check_cpp_condition bcrypt bcrypt.h "defined BCRYPT_RNG_ALGORITHM"
6511-check_lib ole32 "windows.h objbase.h" CoTaskMemFree -lole32
6512-check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
6513-check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
6514-
6515-check_lib android android/native_window.h ANativeWindow_acquire -landroid
6516-check_lib mediandk "stdint.h media/NdkImage.h" AImage_delete -lmediandk
6517-check_lib camera2ndk "stdbool.h stdint.h camera/NdkCameraManager.h" ACameraManager_create -lcamera2ndk
6518-
6519-enabled appkit && check_apple_framework AppKit
6520-enabled audiotoolbox && check_apple_framework AudioToolbox
6521-enabled avfoundation && check_apple_framework AVFoundation
6522-enabled coreimage && check_apple_framework CoreImage
6523-enabled metal && check_apple_framework Metal
6524-enabled videotoolbox && check_apple_framework VideoToolbox
6525-
6526-check_apple_framework CoreFoundation
6527-check_apple_framework CoreMedia
6528-check_apple_framework CoreVideo
6529-check_apple_framework CoreAudio
6530-
6531-enabled avfoundation && {
6532- disable coregraphics applicationservices
6533- check_lib coregraphics CoreGraphics/CoreGraphics.h CGGetActiveDisplayList "-framework CoreGraphics" ||
6534- check_lib applicationservices ApplicationServices/ApplicationServices.h CGGetActiveDisplayList "-framework ApplicationServices"; }
6535-
6536-enabled videotoolbox && {
6537- check_lib coreservices CoreServices/CoreServices.h UTGetOSTypeFromString "-framework CoreServices"
6538- check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVC "-framework CoreMedia"
6539- check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_HEVCWithAlpha "-framework CoreMedia"
6540- check_func_headers CoreMedia/CMFormatDescription.h kCMVideoCodecType_VP9 "-framework CoreMedia"
6541- check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
6542- check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
6543- check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
6544- check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_422YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
6545- check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr8BiPlanarVideoRange "-framework CoreVideo"
6546- check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr10BiPlanarVideoRange "-framework CoreVideo"
6547- check_func_headers CoreVideo/CVPixelBuffer.h kCVPixelFormatType_444YpCbCr16BiPlanarVideoRange "-framework CoreVideo"
6548- check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_2084_PQ "-framework CoreVideo"
6549- check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2100_HLG "-framework CoreVideo"
6550- check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_Linear "-framework CoreVideo"
6551- check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferYCbCrMatrix_ITU_R_2020 "-framework CoreVideo"
6552- check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferColorPrimaries_ITU_R_2020 "-framework CoreVideo"
6553- check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_ITU_R_2020 "-framework CoreVideo"
6554- check_func_headers CoreVideo/CVImageBuffer.h kCVImageBufferTransferFunction_SMPTE_ST_428_1 "-framework CoreVideo"
6555-}
6556-
6557-enabled metal && test_cmd $metalcc -v || disable metal
6558-
6559-check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
6560-
6561-check_type "windows.h dxva.h" "DXVA_PicParams_AV1" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
6562-check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
6563-check_type "windows.h dxva.h" "DXVA_PicParams_VP9" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
6564-check_type "windows.h dxgi1_2.h" "DXGI_OUTDUPL_FRAME_INFO"
6565-check_type "windows.h dxgi1_2.h" "IDXGIOutput1"
6566-check_type "windows.h dxgi1_5.h" "IDXGIOutput5"
6567-check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
6568-check_type "windows.h d3d11.h" "ID3D11VideoContext"
6569-check_type "windows.h" "DPI_AWARENESS_CONTEXT" -D_WIN32_WINNT=0x0A00
6570-check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
6571-check_func_headers mfapi.h MFCreateAlignedMemoryBuffer -lmfplat
6572-
6573-check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
6574-check_type "vdpau/vdpau.h" "VdpPictureInfoVP9"
6575-check_type "vdpau/vdpau.h" "VdpPictureInfoAV1"
6576-
6577-if [ -z "$nvccflags" ]; then
6578- nvccflags=$nvccflags_default
6579-fi
6580-
6581-nvccflags="$nvccflags -std=c++11"
6582-
6583-if enabled x86_64 || enabled ppc64 || enabled aarch64; then
6584- nvccflags="$nvccflags -m64"
6585-else
6586- nvccflags="$nvccflags -m32"
6587-fi
6588-
6589-if enabled cuda_nvcc; then
6590- nvccflags="$nvccflags -ptx"
6591-else
6592- nvccflags="$nvccflags -S -nocudalib -nocudainc --cuda-device-only -Wno-c++11-narrowing -include ${source_link}/compat/cuda/cuda_runtime.h"
6593- check_nvcc cuda_llvm
6594-fi
6595-
6596-if ! disabled ffnvcodec; then
6597- ffnv_hdr_list="ffnvcodec/nvEncodeAPI.h ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h ffnvcodec/dynlink_nvcuvid.h"
6598- check_pkg_config ffnvcodec "ffnvcodec >= 12.1.14.0" "$ffnv_hdr_list" "" || \
6599- check_pkg_config ffnvcodec "ffnvcodec >= 12.0.16.1 ffnvcodec < 12.1" "$ffnv_hdr_list" "" || \
6600- check_pkg_config ffnvcodec "ffnvcodec >= 11.1.5.3 ffnvcodec < 12.0" "$ffnv_hdr_list" "" || \
6601- check_pkg_config ffnvcodec "ffnvcodec >= 11.0.10.3 ffnvcodec < 11.1" "$ffnv_hdr_list" "" || \
6602- check_pkg_config ffnvcodec "ffnvcodec >= 8.1.24.15 ffnvcodec < 8.2" "$ffnv_hdr_list" ""
6603-fi
6604-
6605-if enabled_all libglslang libshaderc; then
6606- die "ERROR: libshaderc and libglslang are mutually exclusive, if in doubt, disable libglslang"
6607-fi
6608-
6609-check_cpp_condition winrt windows.h "!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)"
6610-
6611-if ! disabled w32threads && ! enabled pthreads; then
6612- check_func_headers "windows.h process.h" _beginthreadex &&
6613- check_type "windows.h" CONDITION_VARIABLE &&
6614- check_type "windows.h" INIT_ONCE &&
6615- enable w32threads || disable w32threads
6616- if ! enabled w32threads && enabled winrt; then
6617- check_func_headers "windows.h" CreateThread &&
6618- enable w32threads || disable w32threads
6619- fi
6620-fi
6621-
6622-# check for some common methods of building with pthread support
6623-# do this before the optional library checks as some of them require pthreads
6624-if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
6625- if check_lib pthreads pthread.h pthread_join -pthread &&
6626- check_lib pthreads pthread.h pthread_create -pthread; then
6627- add_cflags -pthread
6628- elif check_lib pthreads pthread.h pthread_join -pthreads &&
6629- check_lib pthreads pthread.h pthread_create -pthreads; then
6630- add_cflags -pthreads
6631- elif check_lib pthreads pthread.h pthread_join -ldl -pthread &&
6632- check_lib pthreads pthread.h pthread_create -ldl -pthread; then
6633- add_cflags -ldl -pthread
6634- elif check_lib pthreads pthread.h pthread_join -lpthreadGC2 &&
6635- check_lib pthreads pthread.h pthread_create -lpthreadGC2; then
6636- :
6637- elif check_lib pthreads pthread.h pthread_join -lpthread &&
6638- check_lib pthreads pthread.h pthread_create -lpthread; then
6639- :
6640- elif check_func pthread_join && check_func pthread_create; then
6641- enable pthreads
6642- fi
6643- check_cc pthreads "pthread.h" "static pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER"
6644-
6645- if enabled pthreads; then
6646- check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
6647- check_func pthread_cancel $pthreads_extralibs
6648- hdrs=pthread.h
6649- if enabled pthread_np_h; then
6650- hdrs="$hdrs pthread_np.h"
6651- fi
6652- check_lib pthread_set_name_np "$hdrs" pthread_set_name_np -lpthread
6653- check_lib pthread_setname_np "$hdrs" pthread_setname_np -lpthread
6654- fi
6655-fi
6656-
6657-enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
6658- check_lib zlib zlib.h zlibVersion -lz; }
6659-enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
6660-enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma
6661-
6662-enabled zlib && test_exec $zlib_extralibs <<EOF && enable zlib_gzip
6663-#include <zlib.h>
6664-int main(void) {
6665- if (zlibCompileFlags() & (1 << 17)) return 1;
6666- return 0;
6667-}
6668-EOF
6669-
6670-[ -x "$(command -v gzip)" ] && enable gzip
6671-
6672-enabled zlib_gzip && enabled gzip || disable ptx_compression
6673-
6674-# On some systems dynamic loading requires no extra linker flags
6675-check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl
6676-
6677-check_lib libm math.h sin -lm
6678-
6679-atan2f_args=2
6680-copysign_args=2
6681-hypot_args=2
6682-ldexpf_args=2
6683-powf_args=2
6684-
6685-for func in $MATH_FUNCS; do
6686- eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
6687-done
6688-
6689-# these are off by default, so fail if requested and not available
6690-enabled avisynth && { require_headers "avisynth/avisynth_c.h avisynth/avs/version.h" &&
6691- { test_cpp_condition avisynth/avs/version.h "AVS_MAJOR_VER >= 3 && AVS_MINOR_VER >= 7 && AVS_BUGFIX_VER >= 3 || AVS_MAJOR_VER >= 3 && AVS_MINOR_VER > 7 || AVS_MAJOR_VER > 3" ||
6692- die "ERROR: AviSynth+ header version must be >= 3.7.3"; } }
6693-enabled cuda_nvcc && { check_nvcc cuda_nvcc || die "ERROR: failed checking for nvcc."; }
6694-enabled chromaprint && { check_pkg_config chromaprint libchromaprint "chromaprint.h" chromaprint_get_version ||
6695- require chromaprint chromaprint.h chromaprint_get_version -lchromaprint; }
6696-enabled decklink && { require_headers DeckLinkAPI.h &&
6697- { test_cpp_condition DeckLinkAPIVersion.h "BLACKMAGIC_DECKLINK_API_VERSION >= 0x0a0b0000" || die "ERROR: Decklink API version must be >= 10.11"; } }
6698-enabled frei0r && require_headers "frei0r.h"
6699-enabled gmp && require gmp gmp.h mpz_export -lgmp
6700-enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init
6701-enabled jni && { [ $target_os = "android" ] && check_headers jni.h && enabled pthreads || die "ERROR: jni not found"; }
6702-enabled ladspa && require_headers "ladspa.h dlfcn.h"
6703-enabled lcms2 && require_pkg_config lcms2 "lcms2 >= 2.13" lcms2.h cmsCreateContext
6704-enabled libaom && require_pkg_config libaom "aom >= 1.0.0" aom/aom_codec.h aom_codec_version
6705-enabled libaribb24 && { check_pkg_config libaribb24 "aribb24 > 1.0.3" "aribb24/aribb24.h" arib_instance_new ||
6706- { enabled gpl && require_pkg_config libaribb24 aribb24 "aribb24/aribb24.h" arib_instance_new; } ||
6707- die "ERROR: libaribb24 requires version higher than 1.0.3 or --enable-gpl."; }
6708-enabled libaribcaption && require_pkg_config libaribcaption "libaribcaption >= 1.1.1" "aribcaption/aribcaption.h" aribcc_context_alloc
6709-enabled lv2 && require_pkg_config lv2 lilv-0 "lilv/lilv.h" lilv_world_new
6710-enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
6711-enabled libass && require_pkg_config libass "libass >= 0.11.0" ass/ass.h ass_library_init
6712-enabled libbluray && require_pkg_config libbluray libbluray libbluray/bluray.h bd_open
6713-enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
6714-enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
6715- { check_lib libcelt celt/celt.h celt_decoder_create_custom -lcelt0 ||
6716- die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
6717-enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
6718-enabled libcodec2 && require libcodec2 codec2/codec2.h codec2_create -lcodec2
6719-enabled libdav1d && require_pkg_config libdav1d "dav1d >= 0.5.0" "dav1d/dav1d.h" dav1d_version
6720-enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2.h davs2_decoder_open
6721-enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
6722-enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
6723-enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
6724- { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
6725- warn "using libfdk without pkg-config"; } }
6726-flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite"
6727-enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs
6728-enabled fontconfig && enable libfontconfig
6729-enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
6730-enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
6731-enabled libfribidi && require_pkg_config libfribidi fribidi fribidi.h fribidi_version_info
6732-enabled libharfbuzz && require_pkg_config libharfbuzz harfbuzz hb.h hb_buffer_create
6733-enabled libglslang && { check_lib spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
6734- -lglslang -lMachineIndependent -lOSDependent -lHLSL -lOGLCompiler -lGenericCodeGen \
6735- -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm ||
6736- require spirv_compiler glslang/Include/glslang_c_interface.h glslang_initialize_process \
6737- -lglslang -lOSDependent -lHLSL -lOGLCompiler \
6738- -lSPVRemapper -lSPIRV -lSPIRV-Tools-opt -lSPIRV-Tools -lpthread -lstdc++ -lm; }
6739-enabled libgme && { check_pkg_config libgme libgme gme/gme.h gme_new_emu ||
6740- require libgme gme/gme.h gme_new_emu -lgme -lstdc++; }
6741-enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
6742- check_lib libgsm "${gsm_hdr}" gsm_create -lgsm && break;
6743- done || die "ERROR: libgsm not found"; }
6744-enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc $pthreads_extralibs
6745-enabled libjxl && require_pkg_config libjxl "libjxl >= 0.7.0" jxl/decode.h JxlDecoderVersion &&
6746- require_pkg_config libjxl_threads "libjxl_threads >= 0.7.0" jxl/thread_parallel_runner.h JxlThreadParallelRunner
6747-enabled libklvanc && require libklvanc libklvanc/vanc.h klvanc_context_create -lklvanc
6748-enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 2.0.0" kvazaar.h kvz_api_get
6749-enabled liblensfun && require_pkg_config liblensfun lensfun lensfun.h lf_db_new
6750-
6751-if enabled libmfx && enabled libvpl; then
6752- die "ERROR: can not use libmfx and libvpl together"
6753-# While it may appear that require is being used as a pkg-config
6754-# fallback for libmfx, it is actually being used to detect a different
6755-# installation route altogether. If libmfx is installed via the Intel
6756-# Media SDK or Intel Media Server Studio, these don't come with
6757-# pkg-config support. Instead, users should make sure that the build
6758-# can find the libraries and headers through other means.
6759-elif enabled libmfx; then
6760- { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfxvideo.h" MFXInit ||
6761-# Some old versions of libmfx have the following settings in libmfx.pc:
6762-# includedir=/usr/include
6763-# Cflags: -I${includedir}
6764-# So add -I${includedir}/mfx to CFLAGS
6765- { check_pkg_config libmfx "libmfx >= 1.28 libmfx < 2.0" "mfx/mfxvideo.h" MFXInit && add_cflags -I${libmfx_incdir}/mfx; } ||
6766- { require libmfx "mfxvideo.h mfxdefs.h" MFXInit "-llibmfx $advapi32_extralibs" &&
6767- { test_cpp_condition mfxdefs.h "MFX_VERSION >= 1028 && MFX_VERSION < 2000" || die "ERROR: libmfx version must be >= 1.28 and < 2.0"; } &&
6768- warn "using libmfx without pkg-config"; } } &&
6769- warn "libmfx is deprecated. Please run configure with --enable-libvpl to use libvpl instead."
6770-elif enabled libvpl; then
6771-# Consider pkg-config only. The name of libmfx is still passed to check_pkg_config function for --enable-libvpl option
6772-# because QSV has dependency on libmfx, we can use the same dependency if using libmfx in this check. The package name
6773-# is extracted from "vpl >= 2.6"
6774- check_pkg_config libmfx "vpl >= 2.6" "mfxvideo.h mfxdispatcher.h" MFXLoad || \
6775- die "ERROR: libvpl >= 2.6 not found"
6776-fi
6777-
6778-if enabled libmfx; then
6779- check_cc MFX_CODEC_VP9 "mfxdefs.h mfxstructures.h" "MFX_CODEC_VP9"
6780-fi
6781-
6782-enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load
6783-enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs
6784-enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
6785- require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
6786-enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei -lnppif ||
6787- check_lib libnpp npp.h nppGetLibVersion -lnppi -lnppif -lnppc -lnppidei ||
6788- die "ERROR: libnpp not found"; }
6789-enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
6790-enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
6791-enabled libopencv && { check_headers opencv2/core/core_c.h &&
6792- { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
6793- require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
6794- require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
6795-enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
6796-enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
6797- { require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
6798-enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
6799-enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } ||
6800- { check_pkg_config libopenvino openvino c_api/ie_c_api.h ie_c_api_version ||
6801- require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api; } }
6802-enabled libopus && {
6803- enabled libopus_decoder && {
6804- require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
6805- }
6806- enabled libopus_encoder && {
6807- require_pkg_config libopus opus opus_multistream.h opus_multistream_surround_encoder_create
6808- }
6809-}
6810-enabled libplacebo && require_pkg_config libplacebo "libplacebo >= 4.192.0" libplacebo/vulkan.h pl_vulkan_create
6811-enabled libpulse && require_pkg_config libpulse libpulse pulse/pulseaudio.h pa_context_new
6812-enabled librabbitmq && require_pkg_config librabbitmq "librabbitmq >= 0.7.1" amqp.h amqp_new_connection
6813-enabled librav1e && require_pkg_config librav1e "rav1e >= 0.5.0" rav1e.h rav1e_context_new
6814-enabled librist && require_pkg_config librist "librist >= 0.2.7" librist/librist.h rist_receiver_create
6815-enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/librsvg/rsvg.h rsvg_handle_new_from_data
6816-enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
6817-enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
6818-enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.1" shaderc/shaderc.h shaderc_compiler_initialize
6819-enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
6820-enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
6821- require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
6822-enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
6823-enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
6824-enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" libssh/sftp.h sftp_init
6825-enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
6826-enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket
6827-enabled libsvtav1 && require_pkg_config libsvtav1 "SvtAv1Enc >= 0.9.0" EbSvtAv1Enc.h svt_av1_enc_init_handle
6828-enabled libtensorflow && require libtensorflow tensorflow/c/c_api.h TF_Version -ltensorflow
6829-enabled libtesseract && require_pkg_config libtesseract tesseract tesseract/capi.h TessBaseAPICreate
6830-enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
6831-enabled libtls && require_pkg_config libtls libtls tls.h tls_configure
6832-enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
6833- { check_lib libtwolame twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
6834- die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
6835-enabled libuavs3d && require_pkg_config libuavs3d "uavs3d >= 1.1.41" uavs3d.h uavs3d_decode
6836-enabled libv4l2 && require_pkg_config libv4l2 libv4l2 libv4l2.h v4l2_ioctl
6837-enabled libvidstab && require_pkg_config libvidstab "vidstab >= 0.98" vid.stab/libvidstab.h vsMotionDetectInit
6838-enabled libvmaf && require_pkg_config libvmaf "libvmaf >= 2.0.0" libvmaf.h vmaf_init
6839-enabled libvmaf && check_pkg_config libvmaf_cuda "libvmaf >= 2.0.0" libvmaf_cuda.h vmaf_cuda_state_init
6840-enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
6841-enabled libvorbis && # require_pkg_config libvorbis vorbis vorbis/codec.h vorbis_info_init &&
6842- # require_pkg_config libvorbisenc vorbisenc vorbis/vorbisenc.h vorbis_encode_init
6843-
6844-enabled libvpx && {
6845- enabled libvpx_vp8_decoder && {
6846- check_pkg_config libvpx_vp8_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx ||
6847- check_lib libvpx_vp8_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp8_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
6848- }
6849- enabled libvpx_vp8_encoder && {
6850- check_pkg_config libvpx_vp8_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx ||
6851- check_lib libvpx_vp8_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp8_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
6852- }
6853- enabled libvpx_vp9_decoder && {
6854- check_pkg_config libvpx_vp9_decoder "vpx >= 1.4.0" "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx ||
6855- check_lib libvpx_vp9_decoder "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
6856- }
6857- enabled libvpx_vp9_encoder && {
6858- check_pkg_config libvpx_vp9_encoder "vpx >= 1.4.0" "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx ||
6859- check_lib libvpx_vp9_encoder "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx VPX_IMG_FMT_HIGHBITDEPTH" "-lvpx $libm_extralibs $pthreads_extralibs"
6860- }
6861- if disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder; then
6862- die "libvpx enabled but no supported decoders found"
6863- fi
6864-}
6865-
6866-enabled libwebp && {
6867- enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
6868- enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
6869-enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
6870- require_cpp_condition libx264 x264.h "X264_BUILD >= 122" && {
6871- [ "$toolchain" != "msvc" ] ||
6872- require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&
6873- check_cpp_condition libx262 x264.h "X264_MPEG2"
6874-enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
6875- require_cpp_condition libx265 x265.h "X265_BUILD >= 89"
6876-enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"
6877-enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get
6878-enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
6879-enabled libzimg && require_pkg_config libzimg "zimg >= 2.7.0" zimg.h zimg_get_api_version
6880-enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h zmq_ctx_new
6881-enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new &&
6882- { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" ||
6883- enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; }
6884-enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion
6885-enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init ||
6886- check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init ||
6887- check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto ||
6888- die "ERROR: mbedTLS not found"; }
6889-enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
6890-enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
6891- { ! enabled cross_compile &&
6892- add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
6893- add_ldflags -L/opt/vc/lib/ &&
6894- check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
6895- die "ERROR: mmal not found" &&
6896- check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
6897-enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h" alGetError ||
6898- { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
6899- check_lib openal 'AL/al.h' alGetError "${al_extralibs}" && break; done } ||
6900- die "ERROR: openal not found"; } &&
6901- { test_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
6902- die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
6903-enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel ||
6904- check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
6905- check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
6906- die "ERROR: opencl not found"; } &&
6907- { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
6908- test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
6909- die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
6910-enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL" ||
6911- check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
6912- check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
6913- check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
6914- die "ERROR: opengl not found."
6915- }
6916-enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
6917- { ! enabled cross_compile &&
6918- add_cflags -isystem/opt/vc/include/IL &&
6919- test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
6920- die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
6921- enable omx
6922-enabled omx && require_headers OMX_Core.h
6923-enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" openssl/ssl.h OPENSSL_init_ssl &&
6924- { enabled gplv3 || ! enabled gpl || enabled nonfree || die "ERROR: OpenSSL >=3.0.0 requires --enable-version3"; }; } ||
6925- { enabled gpl && ! enabled nonfree && die "ERROR: OpenSSL <3.0.0 is incompatible with the gpl"; } ||
6926- check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
6927- check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
6928- check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
6929- check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
6930- check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
6931- check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
6932- die "ERROR: openssl not found"; }
6933-enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init
6934-enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
6935- require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
6936- { enabled libdrm ||
6937- die "ERROR: rkmpp requires --enable-libdrm"; }
6938- }
6939-enabled vapoursynth && require_pkg_config vapoursynth "vapoursynth-script >= 42" VSScript.h vsscript_init
6940-
6941-
6942-if enabled gcrypt; then
6943- GCRYPT_CONFIG="${cross_prefix}libgcrypt-config"
6944- if "${GCRYPT_CONFIG}" --version > /dev/null 2>&1; then
6945- gcrypt_cflags=$("${GCRYPT_CONFIG}" --cflags)
6946- gcrypt_extralibs=$("${GCRYPT_CONFIG}" --libs)
6947- check_func_headers gcrypt.h gcry_mpi_new $gcrypt_cflags $gcrypt_extralibs ||
6948- die "ERROR: gcrypt not found"
6949- add_cflags $gcrypt_cflags
6950- else
6951- require gcrypt gcrypt.h gcry_mpi_new -lgcrypt
6952- fi
6953-fi
6954-
6955-if enabled sdl2; then
6956- SDL2_CONFIG="${cross_prefix}sdl2-config"
6957- test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 3.0.0" SDL_events.h SDL_PollEvent
6958- if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
6959- sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
6960- sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
6961- test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
6962- test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x030000" $sdl2_cflags &&
6963- check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags &&
6964- enable sdl2
6965- fi
6966- if test $target_os = "mingw32"; then
6967- sdl2_extralibs=$(filter_out '-mwindows' $sdl2_extralibs)
6968- fi
6969-fi
6970-
6971-if enabled decklink; then
6972- case $target_os in
6973- mingw32*|mingw64*|win32|win64)
6974- decklink_outdev_extralibs="$decklink_outdev_extralibs -lole32 -loleaut32"
6975- decklink_indev_extralibs="$decklink_indev_extralibs -lole32 -loleaut32"
6976- ;;
6977- esac
6978-fi
6979-
6980-enabled securetransport &&
6981- check_func SecIdentityCreate "-Wl,-framework,CoreFoundation -Wl,-framework,Security" &&
6982- check_lib securetransport "Security/SecureTransport.h Security/Security.h" "SSLCreateContext" "-Wl,-framework,CoreFoundation -Wl,-framework,Security" ||
6983- disable securetransport
6984-
6985-enabled securetransport &&
6986- check_func SecItemImport "-Wl,-framework,CoreFoundation -Wl,-framework,Security"
6987-
6988-enabled schannel &&
6989- check_func_headers "windows.h security.h" InitializeSecurityContext -DSECURITY_WIN32 -lsecur32 &&
6990- test_cpp_condition winerror.h "defined(SEC_I_CONTEXT_EXPIRED)" &&
6991- schannel_extralibs="-lsecur32" ||
6992- disable schannel
6993-
6994-makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
6995-enabled makeinfo \
6996- && [ 0$(makeinfo --version | grep "texinfo" | sed 's/.*texinfo[^0-9]*\([0-9]*\)\..*/\1/') -ge 5 ] \
6997- && enable makeinfo_html || disable makeinfo_html
6998-disabled makeinfo_html && texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
6999-perl -v > /dev/null 2>&1 && enable perl || disable perl
7000-pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
7001-rsync --help 2> /dev/null | grep -q 'contimeout=' && enable rsync_contimeout || disable rsync_contimeout
7002-xmllint --version > /dev/null 2>&1 && enable xmllint || disable xmllint
7003-
7004-check_headers linux/fb.h
7005-check_headers linux/videodev2.h
7006-test_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
7007-test_code cc sys/ioctl.h "int ioctl(int, int, ...)" && enable posix_ioctl
7008-
7009-# check V4L2 codecs available in the API
7010-if enabled v4l2_m2m; then
7011- check_cc v4l2_m2m linux/videodev2.h "int i = V4L2_CAP_VIDEO_M2M_MPLANE | V4L2_CAP_VIDEO_M2M | V4L2_BUF_FLAG_LAST;"
7012- check_cc vc1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VC1_ANNEX_G;"
7013- check_cc mpeg1_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG1;"
7014- check_cc mpeg2_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG2;"
7015- check_cc mpeg4_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_MPEG4;"
7016- check_cc hevc_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_HEVC;"
7017- check_cc h263_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H263;"
7018- check_cc h264_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_H264;"
7019- check_cc vp8_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP8;"
7020- check_cc vp9_v4l2_m2m linux/videodev2.h "int i = V4L2_PIX_FMT_VP9;"
7021-fi
7022-
7023-check_headers sys/videoio.h
7024-test_code cc sys/videoio.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_sanitized struct_v4l2_frmivalenum_discrete
7025-
7026-check_lib user32 "windows.h winuser.h" GetShellWindow -luser32
7027-check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
7028-# check that WM_CAP_DRIVER_CONNECT is defined to the proper value
7029-# w32api 3.12 had it defined wrong
7030-check_cpp_condition vfwcap_defines vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER"
7031-
7032-check_type "dshow.h" IBaseFilter
7033-
7034-# check for ioctl_meteor.h, ioctl_bt848.h and alternatives
7035-check_headers "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
7036- check_headers "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
7037- check_headers "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
7038- check_headers "dev/ic/bt8xx.h"
7039-
7040-if check_struct sys/soundcard.h audio_buf_info bytes; then
7041- enable_sanitized sys/soundcard.h
7042-else
7043- test_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_sanitized sys/soundcard.h
7044- #include <sys/soundcard.h>
7045- audio_buf_info abc;
7046-EOF
7047-fi
7048-
7049-enabled alsa && { check_pkg_config alsa alsa "alsa/asoundlib.h" snd_pcm_htimestamp ||
7050- check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound; }
7051-
7052-enabled libjack &&
7053- require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
7054-
7055-enabled sndio && check_pkg_config sndio sndio sndio.h sio_open
7056-
7057-if enabled libcdio; then
7058- check_pkg_config libcdio libcdio_paranoia "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open ||
7059- check_pkg_config libcdio libcdio_paranoia "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open ||
7060- check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
7061- check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
7062- die "ERROR: No usable libcdio/cdparanoia found"
7063-fi
7064-
7065-enabled libxcb && check_pkg_config libxcb "xcb >= 1.4" xcb/xcb.h xcb_connect ||
7066- disable libxcb_shm libxcb_shape libxcb_xfixes
7067-
7068-if enabled libxcb; then
7069- enabled libxcb_shm && check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
7070- enabled libxcb_shape && check_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_get_rectangles
7071- enabled libxcb_xfixes && check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
7072-fi
7073-
7074-check_func_headers "windows.h" CreateDIBSection "$gdigrab_indev_extralibs"
7075-
7076-# d3d11va requires linking directly to dxgi and d3d11 if not building for
7077-# the desktop api partition
7078-test_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
7079-#ifdef WINAPI_FAMILY
7080-#include <winapifamily.h>
7081-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
7082-#error desktop, not uwp
7083-#else
7084-// WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
7085-#endif
7086-#else
7087-#error no family set
7088-#endif
7089-EOF
7090-
7091-# vaapi_win32 requires linking directly to dxgi if not building for
7092-# the desktop api partition
7093-test_cpp <<EOF && enable uwp && vaapi_win32_extralibs="-ldxgi"
7094-#ifdef WINAPI_FAMILY
7095-#include <winapifamily.h>
7096-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
7097-#error desktop, not uwp
7098-#else
7099-// WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
7100-#endif
7101-#else
7102-#error no family set
7103-#endif
7104-EOF
7105-
7106-# mediafoundation requires linking directly to mfplat if building for uwp target
7107-enabled uwp && mediafoundation_extralibs="-lmfplat -lmfuuid -lole32 -lstrmiids" || mediafoundation_extralibs="-lmfuuid -lole32 -lstrmiids"
7108-
7109-enabled libdrm &&
7110- check_pkg_config libdrm_getfb2 libdrm "xf86drmMode.h" drmModeGetFB2
7111-
7112-enabled vaapi &&
7113- check_pkg_config vaapi "libva >= 0.35.0" "va/va.h" vaInitialize
7114-
7115-if enabled vaapi; then
7116- case $target_os in
7117- mingw32*|mingw64*|win32|win64)
7118- check_pkg_config vaapi_win32 "libva-win32" "va/va_win32.h" vaGetDisplayWin32
7119- ;;
7120- *)
7121- check_pkg_config vaapi_drm "libva-drm" "va/va_drm.h" vaGetDisplayDRM
7122- ;;
7123- esac
7124-
7125- if enabled xlib_x11; then
7126- check_pkg_config vaapi_x11 "libva-x11" "va/va_x11.h" vaGetDisplay
7127- fi
7128-
7129- check_cpp_condition vaapi_1 "va/va.h" "VA_CHECK_VERSION(1, 0, 0)"
7130-
7131- check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
7132- check_struct "va/va.h" "VADecPictureParameterBufferVP9" bit_depth
7133- check_struct "va/va.h" "VADecPictureParameterBufferAV1" bit_depth_idx
7134- check_type "va/va.h va/va_vpp.h" "VAProcFilterParameterBufferHDRToneMapping"
7135- check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" rotation_flags
7136- check_struct "va/va.h va/va_vpp.h" "VAProcPipelineCaps" blend_flags
7137- check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
7138- check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
7139- check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
7140- check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
7141- check_type "va/va.h va/va_enc_av1.h" "VAEncPictureParameterBufferAV1"
7142-fi
7143-
7144-if enabled_all opencl libdrm ; then
7145- check_type "CL/cl_intel.h" "clCreateImageFromFdINTEL_fn" &&
7146- enable opencl_drm_beignet
7147- check_func_headers "CL/cl_ext.h" clImportMemoryARM &&
7148- enable opencl_drm_arm
7149-fi
7150-
7151-if enabled_all opencl vaapi ; then
7152- if enabled opencl_drm_beignet ; then
7153- enable opencl_vaapi_beignet
7154- else
7155- check_type "CL/cl.h CL/cl_va_api_media_sharing_intel.h" "clCreateFromVA_APIMediaSurfaceINTEL_fn" &&
7156- enable opencl_vaapi_intel_media
7157- fi
7158-fi
7159-
7160-if enabled_all opencl dxva2 ; then
7161- check_type "CL/cl_dx9_media_sharing.h" cl_dx9_surface_info_khr &&
7162- enable opencl_dxva2
7163-fi
7164-
7165-if enabled_all opencl d3d11va ; then
7166- check_type "CL/cl_d3d11.h" clGetDeviceIDsFromD3D11KHR_fn &&
7167- enable opencl_d3d11
7168-fi
7169-
7170-enabled vdpau &&
7171- check_cpp_condition vdpau vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP"
7172-
7173-enabled vdpau &&
7174- check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
7175-
7176-enabled crystalhd && check_lib crystalhd "stdint.h libcrystalhd/libcrystalhd_if.h" DtsCrystalHDVersion -lcrystalhd && \
7177- warn "CrystalHD support is deprecated and will be removed, please contact the developers if you are interested" \
7178- "in maintaining it."
7179-
7180-if enabled vulkan; then
7181- check_pkg_config_header_only vulkan "vulkan >= 1.3.255" "vulkan/vulkan.h" "defined VK_VERSION_1_3" ||
7182- check_cpp_condition vulkan "vulkan/vulkan.h" "defined(VK_VERSION_1_4) || (defined(VK_VERSION_1_3) && VK_HEADER_VERSION >= 255)"
7183-fi
7184-
7185-if disabled vulkan; then
7186- disable libglslang libshaderc spirv_compiler
7187-fi
7188-
7189-if enabled x86; then
7190- case $target_os in
7191- freebsd|mingw32*|mingw64*|win32|win64|linux|cygwin*)
7192- ;;
7193- *)
7194- disable ffnvcodec cuvid nvdec nvenc
7195- ;;
7196- esac
7197-elif enabled_any aarch64 ppc64 && ! enabled bigendian; then
7198- case $target_os in
7199- linux)
7200- ;;
7201- *)
7202- disable ffnvcodec cuvid nvdec nvenc
7203- ;;
7204- esac
7205-else
7206- disable ffnvcodec cuvid nvdec nvenc
7207-fi
7208-
7209-enabled ffnvcodec && enable cuda
7210-
7211-enabled nvenc &&
7212- test_cc -I$source_path <<EOF || disable nvenc
7213-#include <ffnvcodec/nvEncodeAPI.h>
7214-NV_ENCODE_API_FUNCTION_LIST flist;
7215-void f(void) { struct { const GUID guid; } s[] = { { NV_ENC_CODEC_H264_GUID } }; }
7216-int main(void) { return 0; }
7217-EOF
7218-
7219-if enabled nvenc; then
7220- check_type "ffnvcodec/nvEncodeAPI.h" "NV_ENC_PIC_PARAMS_AV1"
7221-fi
7222-
7223-if enabled_any nvdec cuvid; then
7224- check_type "ffnvcodec/dynlink_cuda.h ffnvcodec/dynlink_cuviddec.h" "CUVIDAV1PICPARAMS"
7225-fi
7226-
7227-enabled amf &&
7228- check_cpp_condition amf "AMF/core/Version.h" \
7229- "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x00010004001d0000"
7230-
7231-# Funny iconv installations are not unusual, so check it after all flags have been set
7232-if enabled libc_iconv; then
7233- check_func_headers iconv.h iconv
7234-elif enabled iconv; then
7235- check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv
7236-fi
7237-
7238-enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
7239-
7240-# add some useful compiler flags if supported
7241-check_cflags -Wdeclaration-after-statement
7242-check_cflags -Wall
7243-check_cflags -Wdisabled-optimization
7244-check_cflags -Wpointer-arith
7245-check_cflags -Wredundant-decls
7246-check_cflags -Wwrite-strings
7247-check_cflags -Wtype-limits
7248-check_cflags -Wundef
7249-check_cflags -Wmissing-prototypes
7250-check_cflags -Wstrict-prototypes
7251-check_cflags -Wempty-body
7252-
7253-if enabled extra_warnings; then
7254- check_cflags -Wcast-qual
7255- check_cflags -Wextra
7256- check_cflags -Wpedantic
7257-fi
7258-
7259-check_disable_warning(){
7260- warning_flag=-W${1#-Wno-}
7261- test_cflags $unknown_warning_flags $warning_flag && add_cflags $1
7262-}
7263-
7264-test_cflags -Werror=unused-command-line-argument &&
7265- append unknown_warning_flags "-Werror=unused-command-line-argument"
7266-test_cflags -Werror=unknown-warning-option &&
7267- append unknown_warning_flags "-Werror=unknown-warning-option"
7268-
7269-check_disable_warning -Wno-parentheses
7270-check_disable_warning -Wno-switch
7271-check_disable_warning -Wno-format-zero-length
7272-check_disable_warning -Wno-pointer-sign
7273-check_disable_warning -Wno-unused-const-variable
7274-check_disable_warning -Wno-bool-operation
7275-check_disable_warning -Wno-char-subscripts
7276-
7277-check_disable_warning_headers(){
7278- warning_flag=-W${1#-Wno-}
7279- test_cflags $warning_flag && add_cflags_headers $1
7280-}
7281-
7282-check_disable_warning_headers -Wno-deprecated-declarations
7283-check_disable_warning_headers -Wno-unused-variable
7284-
7285-test_cc <<EOF && enable blocks_extension
7286-void (^block)(void);
7287-EOF
7288-
7289-# add some linker flags
7290-check_ldflags -Wl,--warn-common
7291-check_ldflags -Wl,-rpath-link=:libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil
7292-enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
7293-test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
7294-
7295-# add some strip flags
7296-check_stripflags -x
7297-
7298-enabled neon_clobber_test &&
7299- check_ldflags -Wl,--wrap,avcodec_open2 \
7300- -Wl,--wrap,avcodec_decode_subtitle2 \
7301- -Wl,--wrap,avcodec_encode_subtitle \
7302- -Wl,--wrap,avcodec_send_packet \
7303- -Wl,--wrap,avcodec_receive_packet \
7304- -Wl,--wrap,avcodec_send_frame \
7305- -Wl,--wrap,avcodec_receive_frame \
7306- -Wl,--wrap,swr_convert ||
7307- disable neon_clobber_test
7308-
7309-enabled xmm_clobber_test &&
7310- check_ldflags -Wl,--wrap,avcodec_open2 \
7311- -Wl,--wrap,avcodec_decode_subtitle2 \
7312- -Wl,--wrap,avcodec_encode_subtitle \
7313- -Wl,--wrap,avcodec_send_packet \
7314- -Wl,--wrap,avcodec_receive_packet \
7315- -Wl,--wrap,avcodec_send_frame \
7316- -Wl,--wrap,avcodec_receive_frame \
7317- -Wl,--wrap,swr_convert \
7318- -Wl,--wrap,sws_scale ||
7319- disable xmm_clobber_test
7320-
7321-check_ld "cc" proper_dce <<EOF
7322-extern const int array[512];
7323-static inline int func(void) { return array[0]; }
7324-int main(void) { return 0; }
7325-EOF
7326-
7327-if enabled proper_dce; then
7328- echo "X { local: *; };" > $TMPV
7329- if test_ldflags -Wl,${version_script},$TMPV; then
7330- append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
7331- quotes='""'
7332- test_cc <<EOF && enable symver_asm_label
7333-void ff_foo(void) __asm__ ("av_foo@VERSION");
7334-void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
7335-EOF
7336- test_cc <<EOF && enable symver_gnu_asm
7337-__asm__(".symver ff_foo,av_foo@VERSION");
7338-void ff_foo(void) {}
7339-EOF
7340- fi
7341-fi
7342-
7343-if [ -z "$optflags" ]; then
7344- if enabled small; then
7345- optflags=$cflags_size
7346- elif enabled optimizations; then
7347- optflags=$cflags_speed
7348- else
7349- optflags=$cflags_noopt
7350- fi
7351-fi
7352-
7353-check_optflags(){
7354- check_cflags "$@"
7355- [ -n "$lto" ] && check_ldflags "$@"
7356-}
7357-
7358-check_optflags $optflags
7359-check_optflags -fno-math-errno
7360-check_optflags -fno-signed-zeros
7361-
7362-if [ -n "$lto" ]; then
7363- test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
7364- check_cflags $lto
7365- check_ldflags $lto $cpuflags
7366- disable inline_asm_direct_symbol_refs
7367-fi
7368-
7369-enabled ftrapv && check_cflags -ftrapv
7370-
7371-test_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
7372-int x;
7373-EOF
7374-
7375-
7376-if enabled icc; then
7377- # Just warnings, no remarks
7378- check_cflags -w1
7379- # -wd: Disable following warnings
7380- # 144, 167, 556: -Wno-pointer-sign
7381- # 188: enumerated type mixed with another type
7382- # 1292: attribute "foo" ignored
7383- # 1419: external declaration in primary source file
7384- # 10006: ignoring unknown option -fno-signed-zeros
7385- # 10148: ignoring unknown option -Wno-parentheses
7386- # 10156: ignoring option '-W'; no argument required
7387- # 13200: No EMMS instruction before call to function
7388- # 13203: No EMMS instruction before return from function
7389- check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156,13200,13203
7390- # 11030: Warning unknown option --as-needed
7391- # 10156: ignoring option '-export'; no argument required
7392- check_ldflags -wd10156,11030
7393- # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
7394- enable ebp_available
7395- # The test above does not test linking
7396- [ -n "$lto" ] && disable symver_asm_label
7397- if enabled x86_32; then
7398- icc_version=$($cc -dumpversion)
7399- test ${icc_version%%.*} -ge 11 &&
7400- check_cflags -falign-stack=maintain-16-byte ||
7401- disable aligned_stack
7402- fi
7403-elif enabled gcc; then
7404- check_optflags -fno-tree-vectorize
7405- check_cflags -Werror=format-security
7406- check_cflags -Werror=implicit-function-declaration
7407- check_cflags -Werror=missing-prototypes
7408- check_cflags -Werror=return-type
7409- check_cflags -Werror=vla
7410- check_cflags -Wformat
7411- check_cflags -fdiagnostics-color=auto
7412- enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
7413- if enabled x86_32; then
7414- case $target_os in
7415- *bsd*)
7416- # BSDs don't guarantee a 16 byte aligned stack, but we can
7417- # request GCC to try to maintain 16 byte alignment throughout
7418- # function calls. Library entry points that might call assembly
7419- # functions align the stack. (The parameter means 2^4 bytes.)
7420- check_cflags -mpreferred-stack-boundary=4
7421- ;;
7422- esac
7423- fi
7424-elif enabled llvm_gcc; then
7425- check_cflags -mllvm -stack-alignment=16
7426-elif enabled clang; then
7427- if enabled x86_32; then
7428- # Clang doesn't support maintaining alignment without assuming the
7429- # same alignment in every function. If 16 byte alignment would be
7430- # enabled, one would also have to either add attribute_align_arg on
7431- # every single entry point into the libraries or enable -mstackrealign
7432- # (doing stack realignment in every single function).
7433- case $target_os in
7434- mingw32|win32|*bsd*)
7435- disable aligned_stack
7436- ;;
7437- *)
7438- check_cflags -mllvm -stack-alignment=16
7439- check_cflags -mstack-alignment=16
7440- ;;
7441- esac
7442- else
7443- check_cflags -mllvm -stack-alignment=16
7444- check_cflags -mstack-alignment=16
7445- fi
7446- check_cflags -Qunused-arguments
7447- check_cflags -Werror=implicit-function-declaration
7448- check_cflags -Werror=missing-prototypes
7449- check_cflags -Werror=return-type
7450-elif enabled cparser; then
7451- add_cflags -Wno-missing-variable-declarations
7452- add_cflags -Wno-empty-statement
7453-elif enabled armcc; then
7454- add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
7455- add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
7456- # 2523: use of inline assembly is deprecated
7457- add_cflags -W${armcc_opt},--diag_suppress=2523
7458- add_cflags -W${armcc_opt},--diag_suppress=1207
7459- add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
7460- add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
7461- add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
7462- add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
7463-elif enabled pathscale; then
7464- add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
7465- disable inline_asm
7466-elif enabled_any msvc icl; then
7467- enabled x86_32 && disable aligned_stack
7468- enabled_all x86_32 debug && add_cflags -Oy-
7469- enabled debug && add_ldflags -debug
7470- enable pragma_deprecated
7471- if enabled icl; then
7472- # -Qansi-alias is basically -fstrict-aliasing, but does not work
7473- # (correctly) on icl 13.x.
7474- test_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
7475- add_cflags -Qansi-alias
7476- # Some inline asm is not compilable in debug
7477- if enabled debug; then
7478- disable ebp_available
7479- disable ebx_available
7480- fi
7481- fi
7482- # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
7483- check_cpp_condition log2 crtversion.h "_VC_CRT_MAJOR_VERSION >= 12"
7484- # The CRT headers contain __declspec(restrict) in a few places, but if redefining
7485- # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
7486- # (as it ends up if the restrict redefine is done before including stdlib.h), while
7487- # MSVC 2013 and newer can handle it fine.
7488- # If this declspec fails, force including stdlib.h before the restrict redefinition
7489- # happens in config.h.
7490- if [ $restrict_keyword != restrict ]; then
7491- test_cc <<EOF || add_cflags -FIstdlib.h
7492-__declspec($restrict_keyword) void *foo(int);
7493-EOF
7494- fi
7495- # the new SSA optimzer in VS2015 U3 is mis-optimizing some parts of the code
7496- # Issue has been fixed in MSVC v19.00.24218.
7497- test_cpp_condition windows.h "_MSC_FULL_VER >= 190024218" ||
7498- check_cflags -d2SSAOptimizer-
7499- # enable utf-8 source processing on VS2015 U2 and newer
7500- test_cpp_condition windows.h "_MSC_FULL_VER >= 190023918" &&
7501- add_cflags -utf-8
7502-fi
7503-
7504-for pfx in "" host_; do
7505- varname=${pfx%_}cc_type
7506- eval "type=\$$varname"
7507- if [ "$type" = "msvc" ]; then
7508- test_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
7509-static inline int foo(int a) { return a; }
7510-EOF
7511- fi
7512-done
7513-
7514-case $as_type in
7515- clang)
7516- add_asflags -Qunused-arguments
7517- ;;
7518-esac
7519-
7520-case $ld_type in
7521- clang)
7522- check_ldflags -Qunused-arguments
7523- ;;
7524-esac
7525-
7526-enable frame_thread_encoder
7527-
7528-enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
7529-
7530-check_deps $CONFIG_LIST \
7531- $CONFIG_EXTRA \
7532- $HAVE_LIST \
7533- $ALL_COMPONENTS \
7534-
7535-enabled threads && ! enabled pthreads && ! enabled atomics_native && die "non pthread threading without atomics not supported, try adding --enable-pthreads or --cpu=i486 or higher if you are on x86"
7536-
7537-case $target_os in
7538-haiku)
7539- disable memalign
7540- disable posix_memalign
7541- ;;
7542-*-dos|freedos|opendos)
7543- if test_cpp_condition sys/version.h "defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 5"; then
7544- disable memalign
7545- fi
7546- ;;
7547-esac
7548-
7549-flatten_extralibs(){
7550- nested_entries=
7551- list_name=$1
7552- eval list=\$${1}
7553- for entry in $list; do
7554- entry_copy=$entry
7555- resolve entry_copy
7556- flat_entries=
7557- for e in $entry_copy; do
7558- case $e in
7559- *_extralibs) nested_entries="$nested_entries$e ";;
7560- *) flat_entries="$flat_entries$e ";;
7561- esac
7562- done
7563- eval $entry="\$flat_entries"
7564- done
7565- append $list_name "$nested_entries"
7566-
7567- resolve nested_entries
7568- if test -n "$(filter '*_extralibs' $nested_entries)"; then
7569- flatten_extralibs $list_name
7570- fi
7571-}
7572-
7573-flatten_extralibs_wrapper(){
7574- list_name=$1
7575- flatten_extralibs $list_name
7576- unique $list_name
7577- resolve $list_name
7578- eval $list_name=\$\(\$ldflags_filter \$$list_name\)
7579- eval printf \''%s'\' \""\$$list_name"\"
7580-}
7581-
7582-for linkunit in $LIBRARY_LIST; do
7583- unset current_extralibs
7584- eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
7585- for comp in ${components}; do
7586- enabled $comp || continue
7587- comp_extralibs="${comp}_extralibs"
7588- append current_extralibs $comp_extralibs
7589- done
7590- eval prepend ${linkunit}_extralibs $current_extralibs
7591-done
7592-
7593-for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
7594- eval ${linkunit}_extralibs=\$\(flatten_extralibs_wrapper ${linkunit}_extralibs\)
7595-done
7596-
7597-map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
7598-
7599-for thread in $THREADS_LIST; do
7600- if enabled $thread; then
7601- test -n "$thread_type" &&
7602- die "ERROR: Only one thread type must be selected." ||
7603- thread_type="$thread"
7604- fi
7605-done
7606-
7607-if disabled stdatomic; then
7608- if enabled atomics_gcc; then
7609- add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
7610- elif enabled atomics_win32; then
7611- add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
7612- elif enabled atomics_suncc; then
7613- add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc'
7614- elif enabled pthreads; then
7615- add_compat atomics/pthread/stdatomic.o
7616- add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
7617- else
7618- enabled threads && die "Threading is enabled, but no atomics are available"
7619- add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
7620- fi
7621-fi
7622-
7623-# Check if requested libraries were found.
7624-for lib in $AUTODETECT_LIBS; do
7625- requested $lib && ! enabled $lib && die "ERROR: $lib requested but not found";
7626-done
7627-
7628-enabled zlib && add_cppflags -DZLIB_CONST
7629-
7630-# conditional library dependencies, in any order
7631-enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
7632-enabled aresample_filter && prepend avfilter_deps "swresample"
7633-enabled cover_rect_filter && prepend avfilter_deps "avformat avcodec"
7634-enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
7635-enabled elbg_filter && prepend avfilter_deps "avcodec"
7636-enabled find_rect_filter && prepend avfilter_deps "avformat avcodec"
7637-enabled mcdeint_filter && prepend avfilter_deps "avcodec"
7638-enabled movie_filter && prepend avfilter_deps "avformat avcodec"
7639-enabled pan_filter && prepend avfilter_deps "swresample"
7640-enabled pp_filter && prepend avfilter_deps "postproc"
7641-enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
7642-enabled sab_filter && prepend avfilter_deps "swscale"
7643-enabled scale_filter && prepend avfilter_deps "swscale"
7644-enabled scale2ref_filter && prepend avfilter_deps "swscale"
7645-enabled showcqt_filter && prepend avfilter_deps "avformat swscale"
7646-enabled signature_filter && prepend avfilter_deps "avcodec avformat"
7647-enabled smartblur_filter && prepend avfilter_deps "swscale"
7648-enabled spp_filter && prepend avfilter_deps "avcodec"
7649-enabled sr_filter && prepend avfilter_deps "avformat swscale"
7650-enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
7651-enabled uspp_filter && prepend avfilter_deps "avcodec"
7652-enabled zoompan_filter && prepend avfilter_deps "swscale"
7653-
7654-enabled lavfi_indev && prepend avdevice_deps "avfilter"
7655-
7656-#FIXME
7657-enabled_any sdl2_outdev opengl_outdev && enabled sdl2 &&
7658- add_cflags $(filter_out '-Dmain=SDL_main' $sdl2_cflags)
7659-
7660-enabled opus_decoder && prepend avcodec_deps "swresample"
7661-
7662-# reorder the items at var $1 to align with the items order at var $2 .
7663-# die if an item at $1 is not at $2 .
7664-reorder_by(){
7665- eval rb_in=\$$1
7666- eval rb_ordered=\$$2
7667-
7668- for rb in $rb_in; do
7669- is_in $rb $rb_ordered || die "$rb at \$$1 is not at \$$2"
7670- done
7671-
7672- rb_out=
7673- for rb in $rb_ordered; do
7674- is_in $rb $rb_in && rb_out="$rb_out$rb "
7675- done
7676- eval $1=\$rb_out
7677-}
7678-
7679-# deps-expand fflib $1: N x {append all expanded deps; unique}
7680-# within a set of N items, N expansions are enough to expose a cycle.
7681-expand_deps(){
7682- unique ${1}_deps # required for the early break test.
7683- for dummy in $LIBRARY_LIST; do # N iteratios
7684- eval deps=\$${1}_deps
7685- append ${1}_deps $(map 'eval echo \$${v}_deps' $deps)
7686- unique ${1}_deps
7687- eval '[ ${#deps} = ${#'${1}_deps'} ]' && break # doesn't expand anymore
7688- done
7689-
7690- eval is_in $1 \$${1}_deps && die "Dependency cycle at ${1}_deps"
7691- reorder_by ${1}_deps LIBRARY_LIST # linking order is expected later
7692-}
7693-
7694-#we have to remove gpl from the deps here as some code assumes all lib deps are libs
7695-postproc_deps="$(filter_out 'gpl' $postproc_deps)"
7696-
7697-map 'expand_deps $v' $LIBRARY_LIST
7698-
7699-if test "$quiet" != "yes"; then
7700-
7701-echo "install prefix $prefix"
7702-echo "source path $source_path"
7703-echo "C compiler $cc"
7704-echo "C library $libc_type"
7705-if test "$host_cc" != "$cc"; then
7706- echo "host C compiler $host_cc"
7707- echo "host C library $host_libc_type"
7708-fi
7709-echo "ARCH $arch ($cpu)"
7710-if test "$build_suffix" != ""; then
7711- echo "build suffix $build_suffix"
7712-fi
7713-if test "$progs_suffix" != ""; then
7714- echo "progs suffix $progs_suffix"
7715-fi
7716-if test "$extra_version" != ""; then
7717- echo "version string suffix $extra_version"
7718-fi
7719-echo "big-endian ${bigendian-no}"
7720-echo "runtime cpu detection ${runtime_cpudetect-no}"
7721-if enabled x86; then
7722- echo "standalone assembly ${x86asm-no}"
7723- echo "x86 assembler ${x86asmexe}"
7724- echo "MMX enabled ${mmx-no}"
7725- echo "MMXEXT enabled ${mmxext-no}"
7726- echo "3DNow! enabled ${amd3dnow-no}"
7727- echo "3DNow! extended enabled ${amd3dnowext-no}"
7728- echo "SSE enabled ${sse-no}"
7729- echo "SSSE3 enabled ${ssse3-no}"
7730- echo "AESNI enabled ${aesni-no}"
7731- echo "AVX enabled ${avx-no}"
7732- echo "AVX2 enabled ${avx2-no}"
7733- echo "AVX-512 enabled ${avx512-no}"
7734- echo "AVX-512ICL enabled ${avx512icl-no}"
7735- echo "XOP enabled ${xop-no}"
7736- echo "FMA3 enabled ${fma3-no}"
7737- echo "FMA4 enabled ${fma4-no}"
7738- echo "i686 features enabled ${i686-no}"
7739- echo "CMOV is fast ${fast_cmov-no}"
7740- echo "EBX available ${ebx_available-no}"
7741- echo "EBP available ${ebp_available-no}"
7742-fi
7743-if enabled aarch64; then
7744- echo "NEON enabled ${neon-no}"
7745- echo "DOTPROD enabled ${dotprod-no}"
7746- echo "I8MM enabled ${i8mm-no}"
7747-fi
7748-if enabled arm; then
7749- echo "ARMv5TE enabled ${armv5te-no}"
7750- echo "ARMv6 enabled ${armv6-no}"
7751- echo "ARMv6T2 enabled ${armv6t2-no}"
7752- echo "VFP enabled ${vfp-no}"
7753- echo "NEON enabled ${neon-no}"
7754- echo "THUMB enabled ${thumb-no}"
7755-fi
7756-if enabled mips; then
7757- echo "MIPS FPU enabled ${mipsfpu-no}"
7758- echo "MIPS DSP R1 enabled ${mipsdsp-no}"
7759- echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
7760- echo "MIPS MSA enabled ${msa-no}"
7761- echo "LOONGSON MMI enabled ${mmi-no}"
7762-fi
7763-if enabled ppc; then
7764- echo "AltiVec enabled ${altivec-no}"
7765- echo "VSX enabled ${vsx-no}"
7766- echo "POWER8 enabled ${power8-no}"
7767- echo "PPC 4xx optimizations ${ppc4xx-no}"
7768- echo "dcbzl available ${dcbzl-no}"
7769- echo "vec_xl available ${vec_xl-no}"
7770-fi
7771-if enabled loongarch; then
7772- echo "LSX enabled ${lsx-no}"
7773- echo "LASX enabled ${lasx-no}"
7774-fi
7775-if enabled riscv; then
7776- echo "RISC-V Vector enabled ${rvv-no}"
7777-fi
7778-echo "debug symbols ${debug-no}"
7779-echo "strip symbols ${stripping-no}"
7780-echo "optimize for size ${small-no}"
7781-echo "optimizations ${optimizations-no}"
7782-echo "static ${static-no}"
7783-echo "shared ${shared-no}"
7784-echo "postprocessing support ${postproc-no}"
7785-echo "network support ${network-no}"
7786-echo "threading support ${thread_type-no}"
7787-echo "safe bitstream reader ${safe_bitstream_reader-no}"
7788-echo "texi2html enabled ${texi2html-no}"
7789-echo "perl enabled ${perl-no}"
7790-echo "pod2man enabled ${pod2man-no}"
7791-echo "makeinfo enabled ${makeinfo-no}"
7792-echo "makeinfo supports HTML ${makeinfo_html-no}"
7793-echo "xmllint enabled ${xmllint-no}"
7794-test -n "$random_seed" &&
7795- echo "random seed ${random_seed}"
7796-echo
7797-
7798-echo "External libraries:"
7799-print_enabled '' $EXTERNAL_LIBRARY_LIST $EXTERNAL_AUTODETECT_LIBRARY_LIST | print_in_columns
7800-echo
7801-
7802-echo "External libraries providing hardware acceleration:"
7803-print_enabled '' $HWACCEL_LIBRARY_LIST $HWACCEL_AUTODETECT_LIBRARY_LIST | print_in_columns
7804-echo
7805-
7806-echo "Libraries:"
7807-print_enabled '' $LIBRARY_LIST | print_in_columns
7808-echo
7809-
7810-echo "Programs:"
7811-print_enabled '' $PROGRAM_LIST | print_in_columns
7812-echo
7813-
7814-for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
7815- echo "Enabled ${type}s:"
7816- eval list=\$$(toupper $type)_LIST
7817- print_enabled '_*' $list | print_in_columns
7818- echo
7819-done
7820-
7821-if test -n "$ignore_tests"; then
7822- ignore_tests=$(echo $ignore_tests | tr ',' ' ')
7823- echo "Ignored FATE tests:"
7824- echo $ignore_tests | print_in_columns
7825- echo
7826-fi
7827-
7828-echo "License: $license"
7829-
7830-fi # test "$quiet" != "yes"
7831-
7832-if test -n "$WARN_IF_GETS_DISABLED_LIST"; then
7833- for cfg in $WARN_IF_GETS_DISABLED_LIST; do
7834- if disabled $cfg; then
7835- varname=${cfg}_disable_reason
7836- eval "warn \"Disabled $cfg because \$$varname\""
7837- fi
7838- done
7839-fi
7840-
7841-if test -n "$WARNINGS"; then
7842- printf "\n%s%s$WARNINGS%s" "$warn_color" "$bold_color" "$reset_color"
7843- enabled fatal_warnings && exit 1
7844-fi
7845-
7846-test -e Makefile || echo "include $source_path/Makefile" > Makefile
7847-
7848-esc(){
7849- echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
7850-}
7851-
7852-echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" > ffbuild/config.fate
7853-
7854-enabled stripping || strip="echo skipping strip"
7855-enabled stripping || striptype=""
7856-
7857-config_files="$TMPH ffbuild/config.mak doc/config.texi"
7858-
7859-cat > ffbuild/config.mak <<EOF
7860-# Automatically generated by configure - do not modify!
7861-ifndef FFMPEG_CONFIG_MAK
7862-FFMPEG_CONFIG_MAK=1
7863-FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
7864-prefix=$prefix
7865-LIBDIR=\$(DESTDIR)$libdir
7866-SHLIBDIR=\$(DESTDIR)$shlibdir
7867-INCDIR=\$(DESTDIR)$incdir
7868-BINDIR=\$(DESTDIR)$bindir
7869-DATADIR=\$(DESTDIR)$datadir
7870-DOCDIR=\$(DESTDIR)$docdir
7871-MANDIR=\$(DESTDIR)$mandir
7872-PKGCONFIGDIR=\$(DESTDIR)$pkgconfigdir
7873-INSTALL_NAME_DIR=$install_name_dir
7874-SRC_PATH=$source_path
7875-SRC_LINK=$source_link
7876-ifndef MAIN_MAKEFILE
7877-SRC_PATH:=\$(SRC_PATH:.%=..%)
7878-endif
7879-CC_IDENT=$cc_ident
7880-ARCH=$arch
7881-INTRINSICS=$intrinsics
7882-EXTERN_PREFIX=$extern_prefix
7883-CC=$cc
7884-CXX=$cxx
7885-AS=$as
7886-OBJCC=$objcc
7887-LD=$ld
7888-DEPCC=$dep_cc
7889-DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
7890-DEPAS=$as
7891-DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
7892-X86ASM=$x86asmexe
7893-DEPX86ASM=$x86asmexe
7894-DEPX86ASMFLAGS=\$(X86ASMFLAGS)
7895-AR=$ar
7896-ARFLAGS=$arflags
7897-AR_O=$ar_o
7898-AR_CMD=$ar
7899-NM_CMD=$nm
7900-METALCC=$metalcc
7901-METALLIB=$metallib
7902-RANLIB=$ranlib
7903-STRIP=$strip
7904-STRIPTYPE=$striptype
7905-NVCC=$nvcc
7906-CP=cp -p
7907-LN_S=$ln_s
7908-CPPFLAGS=$CPPFLAGS
7909-CFLAGS=$CFLAGS
7910-CXXFLAGS=$CXXFLAGS
7911-OBJCCFLAGS=$OBJCFLAGS
7912-ASFLAGS=$ASFLAGS
7913-NVCCFLAGS=$nvccflags
7914-AS_C=$AS_C
7915-AS_O=$AS_O
7916-OBJCC_C=$OBJCC_C
7917-OBJCC_E=$OBJCC_E
7918-OBJCC_O=$OBJCC_O
7919-CC_C=$CC_C
7920-CC_E=$CC_E
7921-CC_O=$CC_O
7922-CXX_C=$CXX_C
7923-CXX_O=$CXX_O
7924-NVCC_C=$NVCC_C
7925-NVCC_O=$NVCC_O
7926-LD_O=$LD_O
7927-X86ASM_O=$X86ASM_O
7928-LD_LIB=$LD_LIB
7929-LD_PATH=$LD_PATH
7930-DLLTOOL=$dlltool
7931-WINDRES=$windres
7932-DOXYGEN=$doxygen
7933-LDFLAGS=$LDFLAGS
7934-LDEXEFLAGS=$LDEXEFLAGS
7935-LDSOFLAGS=$LDSOFLAGS
7936-SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
7937-ASMSTRIPFLAGS=$ASMSTRIPFLAGS
7938-X86ASMFLAGS=$X86ASMFLAGS
7939-MSAFLAGS=$MSAFLAGS
7940-MMIFLAGS=$MMIFLAGS
7941-LSXFLAGS=$LSXFLAGS
7942-LASXFLAGS=$LASXFLAGS
7943-BUILDSUF=$build_suffix
7944-PROGSSUF=$progs_suffix
7945-FULLNAME=$FULLNAME
7946-LIBPREF=$LIBPREF
7947-LIBSUF=$LIBSUF
7948-LIBNAME=$LIBNAME
7949-SLIBPREF=$SLIBPREF
7950-SLIBSUF=$SLIBSUF
7951-EXESUF=$EXESUF
7952-EXTRA_VERSION=$extra_version
7953-CCDEP=$CCDEP
7954-CXXDEP=$CXXDEP
7955-CCDEP_FLAGS=$CCDEP_FLAGS
7956-ASDEP=$ASDEP
7957-ASDEP_FLAGS=$ASDEP_FLAGS
7958-X86ASMDEP=$X86ASMDEP
7959-X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
7960-CC_DEPFLAGS=$CC_DEPFLAGS
7961-CXX_DEPFLAGS=$CXX_DEPFLAGS
7962-OBJCC_DEPFLAGS=$OBJC_DEPFLAGS
7963-AS_DEPFLAGS=$AS_DEPFLAGS
7964-X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
7965-HOSTCC=$host_cc
7966-HOSTLD=$host_ld
7967-HOSTCFLAGS=$host_cflags
7968-HOSTCPPFLAGS=$host_cppflags
7969-HOSTEXESUF=$HOSTEXESUF
7970-HOSTLDFLAGS=$host_ldflags
7971-HOSTEXTRALIBS=$host_extralibs
7972-DEPHOSTCC=$host_cc
7973-DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
7974-HOSTCCDEP=$HOSTCCDEP
7975-HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
7976-HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
7977-HOSTCC_C=$HOSTCC_C
7978-HOSTCC_O=$HOSTCC_O
7979-HOSTLD_O=$HOSTLD_O
7980-TARGET_EXEC=$target_exec $target_exec_args
7981-TARGET_PATH=$target_path
7982-TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
7983-CFLAGS-ffplay=${sdl2_cflags}
7984-CFLAGS_HEADERS=$CFLAGS_HEADERS
7985-LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
7986-EXTRALIBS=$extralibs
7987-COMPAT_OBJS=$compat_objs
7988-INSTALL=$install
7989-LIBTARGET=${LIBTARGET}
7990-SLIBNAME=${SLIBNAME}
7991-SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
7992-SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
7993-SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
7994-SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
7995-SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
7996-SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
7997-SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
7998-SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
7999-VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
8000-SAMPLES:=${samples:-\$(FATE_SAMPLES)}
8001-NOREDZONE_FLAGS=$noredzone_flags
8002-LIBFUZZER_PATH=$libfuzzer_path
8003-IGNORE_TESTS=$ignore_tests
8004-EOF
8005-
8006-map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> ffbuild/config.mak' $LIBRARY_LIST
8007-
8008-for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
8009- eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> ffbuild/config.mak
8010-done
8011-
8012-cat > $TMPH <<EOF
8013-/* Automatically generated by configure - do not modify! */
8014-#ifndef FFMPEG_CONFIG_H
8015-#define FFMPEG_CONFIG_H
8016-#define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
8017-#define FFMPEG_LICENSE "$(c_escape $license)"
8018-#define CONFIG_THIS_YEAR 2025
8019-#define FFMPEG_DATADIR "$(eval c_escape $datadir)"
8020-#define AVCONV_DATADIR "$(eval c_escape $datadir)"
8021-#define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
8022-#define OS_NAME $target_os
8023-#define av_restrict $restrict_keyword
8024-#define EXTERN_PREFIX "${extern_prefix}"
8025-#define EXTERN_ASM ${extern_prefix}
8026-#define BUILDSUF "$build_suffix"
8027-#define SLIBSUF "$SLIBSUF"
8028-#define HAVE_MMX2 HAVE_MMXEXT
8029-#define SWS_MAX_FILTER_SIZE $sws_max_filter_size
8030-EOF
8031-
8032-test -n "$assert_level" &&
8033- echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
8034-
8035-test -n "$malloc_prefix" &&
8036- echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
8037-
8038-enabled aarch64 &&
8039- echo "#define AS_ARCH_LEVEL $as_arch_level" >>$TMPH
8040-
8041-if enabled x86asm; then
8042- append config_files $TMPASM
8043- cat > $TMPASM <<EOF
8044-; Automatically generated by configure - do not modify!
8045-EOF
8046-fi
8047-
8048-enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
8049-
8050-
8051-mkdir -p doc
8052-mkdir -p tests
8053-mkdir -p tests/api
8054-echo "@c auto-generated by configure - do not modify! " > doc/config.texi
8055-
8056-print_config ARCH_ "$config_files" $ARCH_LIST
8057-print_config HAVE_ "$config_files" $HAVE_LIST
8058-print_config CONFIG_ "$config_files" $CONFIG_LIST \
8059- $CONFIG_EXTRA \
8060-
8061-echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
8062-
8063-# Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
8064-cp_if_changed $TMPH config.h
8065-touch ffbuild/.config
8066-
8067-# Copy config.asm before printing ALL_COMPONENTS; that's not needed in assembly.
8068-enabled x86asm && cp_if_changed $TMPASM config.asm
8069-
8070-# Reopen a new TMPH for config_components.h.
8071-cat > $TMPH <<EOF
8072-/* Automatically generated by configure - do not modify! */
8073-#ifndef FFMPEG_CONFIG_COMPONENTS_H
8074-#define FFMPEG_CONFIG_COMPONENTS_H
8075-EOF
8076-
8077-print_config CONFIG_ "$config_files" $ALL_COMPONENTS
8078-
8079-echo "#endif /* FFMPEG_CONFIG_COMPONENTS_H */" >> $TMPH
8080-echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak
8081-
8082-cp_if_changed $TMPH config_components.h
8083-
8084-cat > $TMPH <<EOF
8085-/* Generated by ffmpeg configure */
8086-#ifndef AVUTIL_AVCONFIG_H
8087-#define AVUTIL_AVCONFIG_H
8088-EOF
8089-
8090-print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
8091-
8092-echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
8093-
8094-cp_if_changed $TMPH libavutil/avconfig.h
8095-
8096-# full_filter_name_foo=vf_foo
8097-# full_filter_name_bar=asrc_bar
8098-# ...
8099-eval "$(sed -n "s/^extern const AVFilter ff_\([avfsinkrc]\{2,5\}\)_\(.*\);/full_filter_name_\2=\1_\2/p" $source_path/libavfilter/allfilters.c)"
8100-
8101-# generate the lists of enabled components
8102-print_enabled_components(){
8103- file=$1
8104- struct_name=$2
8105- name=$3
8106- shift 3
8107- echo "static const $struct_name * const $name[] = {" > $TMPH
8108- for c in $*; do
8109- if enabled $c; then
8110- case $name in
8111- filter_list)
8112- eval c=\$full_filter_name_${c%_filter}
8113- ;;
8114- indev_list)
8115- c=${c%_indev}_demuxer
8116- ;;
8117- outdev_list)
8118- c=${c%_outdev}_muxer
8119- ;;
8120- esac
8121- printf " &ff_%s,\n" $c >> $TMPH
8122- fi
8123- done
8124- if [ "$name" = "filter_list" ]; then
8125- for c in asrc_abuffer vsrc_buffer asink_abuffer vsink_buffer; do
8126- printf " &ff_%s,\n" $c >> $TMPH
8127- done
8128- fi
8129- echo " NULL };" >> $TMPH
8130- cp_if_changed $TMPH $file
8131-}
8132-
8133-print_enabled_components libavfilter/filter_list.c AVFilter filter_list $FILTER_LIST
8134-print_enabled_components libavcodec/codec_list.c FFCodec codec_list $CODEC_LIST
8135-print_enabled_components libavcodec/parser_list.c AVCodecParser parser_list $PARSER_LIST
8136-print_enabled_components libavcodec/bsf_list.c FFBitStreamFilter bitstream_filters $BSF_LIST
8137-print_enabled_components libavformat/demuxer_list.c AVInputFormat demuxer_list $DEMUXER_LIST
8138-print_enabled_components libavformat/muxer_list.c FFOutputFormat muxer_list $MUXER_LIST
8139-print_enabled_components libavdevice/indev_list.c AVInputFormat indev_list $INDEV_LIST
8140-print_enabled_components libavdevice/outdev_list.c FFOutputFormat outdev_list $OUTDEV_LIST
8141-print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
8142-
8143-# Settings for pkg-config files
8144-
8145-cat > $TMPH <<EOF
8146-# Automatically generated by configure - do not modify!
8147-shared=$shared
8148-build_suffix=$build_suffix
8149-prefix=$prefix
8150-libdir=$libdir
8151-incdir=$incdir
8152-rpath=$(enabled rpath && echo "-Wl,-rpath,\${libdir}")
8153-source_path=${source_path}
8154-LIBPREF=${LIBPREF}
8155-LIBSUF=${LIBSUF}
8156-extralibs_avutil="$avutil_extralibs"
8157-extralibs_avcodec="$avcodec_extralibs"
8158-extralibs_avformat="$avformat_extralibs"
8159-extralibs_avdevice="$avdevice_extralibs"
8160-extralibs_avfilter="$avfilter_extralibs"
8161-extralibs_postproc="$postproc_extralibs"
8162-extralibs_swscale="$swscale_extralibs"
8163-extralibs_swresample="$swresample_extralibs"
8164-EOF
8165-
8166-for lib in $LIBRARY_LIST; do
8167- lib_deps="$(eval echo \$${lib}_deps)"
8168- echo ${lib}_deps=\"$lib_deps\" >> $TMPH
8169-done
8170-
8171-cp_if_changed $TMPH ffbuild/config.sh
+2,
-4
1@@ -2,11 +2,9 @@
2 NAME=ffmpeg
3 VERSION=git:n6.1.4
4 RELEASE=1
5-SOURCE="https://git.ffmpeg.org/ffmpeg.git
6- configure"
7+SOURCE="https://git.ffmpeg.org/ffmpeg.git"
8
9 build() {
10- cp -f ../configure ./configure
11 ./configure \
12 --pkg-config-flags=--static \
13 --extra-cflags="-I$PREFIX/include" \
14@@ -18,7 +16,7 @@ build() {
15 --disable-libxml2 \
16 --enable-static \
17 --enable-gpl \
18- --enable-libvorbis \
19+ --disable-libvorbis \
20 --enable-libdrm \
21 --enable-libmp3lame \
22 --enable-libopus \
+3,
-0
1@@ -0,0 +1,3 @@
2+/ffmpeg
3+/wayland
4+/libass
+6,
-0
1@@ -0,0 +1,6 @@
2+name: mpv
3+description: media player
4+license: GPLV2
5+upstream: https://mpv.io
6+version: 0.36.0
7+maintainer:
+27,
-0
1@@ -0,0 +1,27 @@
2+#!/bin/sh -ue
3+NAME=mpv
4+VERSION=git:v0.36.0
5+RELEASE=1
6+SOURCE="https://github.com/mpv-player/mpv"
7+BUILD_OPT="-Ddefault_library=static -Dx11=disabled -Dwayland=enabled -Dvulkan=disabled -Degl-x11=disabled -Degl-wayland=disabled -Dgl-x11=disabled -Dmanpage-build=disabled -Dhtml-build=disabled -Dtests=false -Dlua=disabled -Djavascript=disabled"
8+
9+build() {
10+ export PKG_CONFIG="pkg-config --static"
11+
12+ muon setup \
13+ -Dprefix="$PREFIX" \
14+ -Dlibdir=lib \
15+ -Ddefault_library=static \
16+ -Dprefer_static=true \
17+ -Dbuildtype=release \
18+ ${BUILD_OPT} \
19+ build || die "muon setup failed"
20+
21+ samu -C build || die "samu build failed"
22+
23+ mkdir -p "$PKG/$PREFIX/bin"
24+ install -m 755 build/mpv "$PKG/$PREFIX/bin/mpv" ||
25+ die "failed to install mpv binary"
26+}
27+
28+. ${0%/*}/../../libsh/libdmake.sh