You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

5412 lines
162KB

  1. #!/bin/sh
  2. #
  3. # Libav configure script
  4. #
  5. # Copyright (c) 2000-2002 Fabrice Bellard
  6. # Copyright (c) 2005-2008 Diego Biurrun
  7. # Copyright (c) 2005-2008 Mans Rullgard
  8. #
  9. # Prevent locale nonsense from breaking basic text processing.
  10. LC_ALL=C
  11. export LC_ALL
  12. # make sure we are running under a compatible shell
  13. # try to make this part work with most shells
  14. try_exec(){
  15. echo "Trying shell $1"
  16. type "$1" > /dev/null 2>&1 && exec "$@"
  17. }
  18. unset foo
  19. (: ${foo%%bar}) 2> /dev/null
  20. E1="$?"
  21. (: ${foo?}) 2> /dev/null
  22. E2="$?"
  23. if test "$E1" != 0 || test "$E2" = 0; then
  24. echo "Broken shell detected. Trying alternatives."
  25. export FF_CONF_EXEC
  26. if test "0$FF_CONF_EXEC" -lt 1; then
  27. FF_CONF_EXEC=1
  28. try_exec bash "$0" "$@"
  29. fi
  30. if test "0$FF_CONF_EXEC" -lt 2; then
  31. FF_CONF_EXEC=2
  32. try_exec ksh "$0" "$@"
  33. fi
  34. if test "0$FF_CONF_EXEC" -lt 3; then
  35. FF_CONF_EXEC=3
  36. try_exec /usr/xpg4/bin/sh "$0" "$@"
  37. fi
  38. echo "No compatible shell script interpreter found."
  39. echo "This configure script requires a POSIX-compatible shell"
  40. echo "such as bash or ksh."
  41. echo "THIS IS NOT A BUG IN LIBAV, DO NOT REPORT IT AS SUCH."
  42. echo "Instead, install a working POSIX-compatible shell."
  43. echo "Disabling this configure test will create a broken Libav."
  44. if test "$BASH_VERSION" = '2.04.0(1)-release'; then
  45. echo "This bash version ($BASH_VERSION) is broken on your platform."
  46. echo "Upgrade to a later version if available."
  47. fi
  48. exit 1
  49. fi
  50. test -d /usr/xpg4/bin && PATH=/usr/xpg4/bin:$PATH
  51. show_help(){
  52. cat <<EOF
  53. Usage: configure [options]
  54. Options: [defaults in brackets after descriptions]
  55. Help options:
  56. --help print this message
  57. --quiet Suppress showing informative output
  58. --list-decoders show all available decoders
  59. --list-encoders show all available encoders
  60. --list-hwaccels show all available hardware accelerators
  61. --list-demuxers show all available demuxers
  62. --list-muxers show all available muxers
  63. --list-parsers show all available parsers
  64. --list-protocols show all available protocols
  65. --list-bsfs show all available bitstream filters
  66. --list-indevs show all available input devices
  67. --list-filters show all available filters
  68. Standard options:
  69. --logfile=FILE log tests and output to FILE [avbuild/config.log]
  70. --disable-logging do not log configure debug information
  71. --prefix=PREFIX install in PREFIX [$prefix_default]
  72. --bindir=DIR install binaries in DIR [PREFIX/bin]
  73. --datadir=DIR install data files in DIR [PREFIX/share/avconv]
  74. --docdir=DIR install documentation in DIR [PREFIX/share/doc/libav]
  75. --libdir=DIR install libs in DIR [PREFIX/lib]
  76. --shlibdir=DIR install shared libs in DIR [PREFIX/lib]
  77. --incdir=DIR install includes in DIR [PREFIX/include]
  78. --mandir=DIR install man page in DIR [PREFIX/share/man]
  79. --enable-rpath use rpath when linking programs (USE WITH CARE)
  80. Licensing options:
  81. --enable-gpl allow use of GPL code, the resulting libs
  82. and binaries will be under GPL [no]
  83. --enable-version3 upgrade (L)GPL to version 3 [no]
  84. --enable-nonfree allow use of nonfree code, the resulting libs
  85. and binaries will be unredistributable [no]
  86. Configuration options:
  87. --disable-static do not build static libraries [no]
  88. --enable-shared build shared libraries [no]
  89. --enable-small optimize for size instead of speed
  90. --enable-runtime-cpudetect detect CPU capabilities at runtime (bigger binary)
  91. --enable-gray enable full grayscale support (slower color)
  92. --disable-swscale-alpha disable alpha channel support in swscale
  93. --disable-all disable building components, libraries and programs
  94. Program options:
  95. --disable-programs do not build command line programs
  96. --disable-avconv disable avconv build
  97. --disable-avplay disable avplay build
  98. --disable-avprobe disable avprobe build
  99. Component options:
  100. --disable-doc do not build documentation
  101. --disable-pod2man do not build manual pages
  102. --disable-texi2html do not build HTML documentation
  103. --disable-avdevice disable libavdevice build
  104. --disable-avcodec disable libavcodec build
  105. --disable-avformat disable libavformat build
  106. --disable-avutil disable libavutil build
  107. --disable-swscale disable libswscale build
  108. --disable-avfilter disable video filter support [no]
  109. --disable-avresample disable libavresample build [no]
  110. --disable-pthreads disable pthreads [auto]
  111. --disable-w32threads disable Win32 threads [auto]
  112. --disable-network disable network support [no]
  113. --disable-dct disable DCT code
  114. --disable-error-resilience disable error resilience code
  115. --disable-lsp disable LSP code
  116. --disable-lzo disable LZO decoder code
  117. --disable-mdct disable MDCT code
  118. --disable-rdft disable RDFT code
  119. --disable-fft disable FFT code
  120. --disable-faan disable floating point AAN (I)DCT code
  121. Individual component options:
  122. --disable-everything disable all components listed below
  123. --disable-encoder=NAME disable encoder NAME
  124. --enable-encoder=NAME enable encoder NAME
  125. --disable-encoders disable all encoders
  126. --disable-decoder=NAME disable decoder NAME
  127. --enable-decoder=NAME enable decoder NAME
  128. --disable-decoders disable all decoders
  129. --disable-hwaccel=NAME disable hwaccel NAME
  130. --enable-hwaccel=NAME enable hwaccel NAME
  131. --disable-hwaccels disable all hwaccels
  132. --disable-muxer=NAME disable muxer NAME
  133. --enable-muxer=NAME enable muxer NAME
  134. --disable-muxers disable all muxers
  135. --disable-demuxer=NAME disable demuxer NAME
  136. --enable-demuxer=NAME enable demuxer NAME
  137. --disable-demuxers disable all demuxers
  138. --enable-parser=NAME enable parser NAME
  139. --disable-parser=NAME disable parser NAME
  140. --disable-parsers disable all parsers
  141. --enable-bsf=NAME enable bitstream filter NAME
  142. --disable-bsf=NAME disable bitstream filter NAME
  143. --disable-bsfs disable all bitstream filters
  144. --enable-protocol=NAME enable protocol NAME
  145. --disable-protocol=NAME disable protocol NAME
  146. --disable-protocols disable all protocols
  147. --enable-indev=NAME enable input device NAME
  148. --disable-indev=NAME disable input device NAME
  149. --disable-indevs disable input devices
  150. --disable-devices disable all devices
  151. --enable-filter=NAME enable filter NAME
  152. --disable-filter=NAME disable filter NAME
  153. --disable-filters disable all filters
  154. External library support:
  155. Using any of the following switches will allow Libav to link to the
  156. corresponding external library. All the components depending on that library
  157. will become enabled, if all their other dependencies are met and they are not
  158. explicitly disabled. E.g. --enable-libwavpack will enable linking to
  159. libwavpack and allow the libwavpack encoder to be built, unless it is
  160. specifically disabled with --disable-encoder=libwavpack.
  161. Note that only the system libraries are auto-detected. All the other external
  162. libraries must be explicitly enabled.
  163. Also note that the following help text describes the purpose of the libraries
  164. themselves, not all their features will necessarily be usable by Libav.
  165. --enable-avisynth video frameserver
  166. --enable-avxsynth Linux version of AviSynth
  167. --enable-bzlib bzip2 compression [autodetect]
  168. --enable-frei0r video filtering plugins
  169. --enable-gnutls crypto
  170. --enable-libbs2b Bauer stereophonic-to-binaural DSP
  171. --enable-libcdio audio CD input
  172. --enable-libdc1394 IEEE 1394/Firewire camera input
  173. --enable-libdcadec DCA audio decoding
  174. --enable-libfaac AAC audio encoding
  175. --enable-libfdk-aac AAC audio encoding/decoding
  176. --enable-libfontconfig font configuration and management
  177. --enable-libfreetype font rendering
  178. --enable-libgsm GSM audio encoding/decoding
  179. --enable-libhdcd HDCD decoding filter
  180. --enable-libilbc ILBC audio encoding/decoding
  181. --enable-libjack JACK audio sound server
  182. --enable-libkvazaar HEVC video encoding
  183. --enable-libmp3lame MP3 audio encoding
  184. --enable-libopencore-amrnb AMR-NB audio encoding/decoding
  185. --enable-libopencore-amrwb AMR-WB audio decoding
  186. --enable-libopencv computer vision
  187. --enable-libopenh264 H.264 video encoding/decoding
  188. --enable-libopenjpeg JPEG 2000 image encoding/decoding
  189. --enable-libopus Opus audio encoding/decoding
  190. --enable-libpulse Pulseaudio sound server
  191. --enable-librtmp RTMP streaming
  192. --enable-libschroedinger Dirac video encoding/decoding
  193. --enable-libsnappy snappy compression
  194. --enable-libspeex Speex audio encoding/decoding
  195. --enable-libtheora Theora video encoding/decoding
  196. --enable-libtwolame MP2 audio encoding
  197. --enable-libvo-aacenc AAC audio encoding
  198. --enable-libvo-amrwbenc AMR-WB audio encoding
  199. --enable-libvorbis Vorbis audio encoding/decoding
  200. --enable-libvpx VP* video encoding/decoding
  201. --enable-libwavpack Wavpack audio encoding/decoding
  202. --enable-libwebp WebP image encoding/decoding
  203. --enable-libx264 H.264 video encoding
  204. --enable-libx265 HEVC video encoding
  205. --enable-libxavs Chinese AVS video encoding
  206. --enable-libxcb X window system protocol communication
  207. --enable-libxcb-shm X11 shm communication [auto]
  208. --enable-libxcb-xfixes X11 mouse rendering [auto]
  209. --enable-libxvid MPEG-4 ASP video encoding
  210. --enable-openssl crypto
  211. --enable-zlib compression [autodetect]
  212. The following libraries provide various hardware acceleration features:
  213. --enable-cuda Nvidia CUDA (dynamically linked)
  214. --enable-cuvid Nvidia CUVID video decode acceleration
  215. --enable-d3d11va Microsoft Direct3D 11 video acceleration [auto]
  216. --enable-dxva2 Microsoft DirectX 9 video acceleration [auto]
  217. --enable-libmfx Intel MediaSDK (AKA Quick Sync Video)
  218. --enable-libnpp Nvidia CUDA processing
  219. --enable-mmal Broadcom Multi-Media Abstraction Layer (Raspberry Pi)
  220. --enable-nvenc Nvidia video encoding
  221. --enable-omx OpenMAX IL
  222. --enable-omx-rpi OpenMAX IL for Raspberry Pi
  223. --enable-vaapi Video Acceleration API (mainly Unix/Intel)
  224. --enable-vda Apple Video Decode Acceleration [auto]
  225. --enable-vdpau Nvidia Video Decode and Presentation API for Unix [auto]
  226. Toolchain options:
  227. --arch=ARCH select architecture [$arch]
  228. --cpu=CPU select the minimum required CPU (affects
  229. instruction selection, may crash on older CPUs)
  230. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  231. --enable-cross-compile assume a cross-compiler is used
  232. --sysroot=PATH root of cross-build tree
  233. --sysinclude=PATH location of cross-build system headers
  234. --target-os=OS compiler targets OS [$target_os]
  235. --target-exec=CMD command to run executables on target
  236. --target-path=DIR path to view of build directory on target
  237. --target-samples=DIR path to samples directory on target
  238. --toolchain=NAME set tool defaults according to NAME
  239. --nm=NM use nm tool
  240. --ar=AR use archive tool AR [$ar_default]
  241. --as=AS use assembler AS [$as_default]
  242. --cc=CC use C compiler CC [$cc_default]
  243. --objcc=OCC use ObjC compiler OCC [$cc_default]
  244. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  245. --ld=LD use linker LD
  246. --x86asmexe=X86ASM use x86 assembler X86ASM
  247. --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
  248. --pkg-config-flags=FLAGS pass additional flags to pkgconf []
  249. --host-cc=HOSTCC use host C compiler HOSTCC
  250. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  251. --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
  252. --host-ld=HOSTLD use host linker HOSTLD
  253. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  254. --host-libs=HLIBS use libs HLIBS when linking for host
  255. --host-os=OS compiler host OS [$target_os]
  256. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  257. --extra-objcflags=FLAGS add FLAGS to OBJCFLAGS [$CFLAGS]
  258. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  259. --extra-ldexeflags=ELDFLAGS add ELDFLAGS to LDEXEFLAGS [$LDEXEFLAGS]
  260. --extra-ldsoflags=ELDFLAGS add ELDFLAGS to LDSOFLAGS [$LDSOFLAGS]
  261. --extra-libs=ELIBS add ELIBS [$ELIBS]
  262. --extra-version=STRING version string suffix []
  263. --optflags=OPTFLAGS override optimization-related compiler flags
  264. --enable-pic build position-independent code
  265. --enable-thumb compile for Thumb instruction set
  266. --enable-lto use link-time optimization
  267. --env="ENV=override" override the environment variables
  268. Advanced options (experts only):
  269. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  270. --custom-allocator=NAME use a supported custom allocator
  271. --disable-symver disable symbol versioning
  272. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  273. --disable-safe-bitstream-reader
  274. disable buffer boundary checking in bitreaders
  275. (faster, but may crash)
  276. --enable-sram allow use of on-chip SRAM
  277. Optimization options (experts only):
  278. --disable-asm disable all assembly optimizations
  279. --disable-altivec disable AltiVec optimizations
  280. --disable-vsx disable VSX optimizations
  281. --disable-power8 disable POWER8 optimizations
  282. --disable-amd3dnow disable 3DNow! optimizations
  283. --disable-amd3dnowext disable 3DNow! extended optimizations
  284. --disable-mmx disable MMX optimizations
  285. --disable-mmxext disable MMXEXT optimizations
  286. --disable-sse disable SSE optimizations
  287. --disable-sse2 disable SSE2 optimizations
  288. --disable-sse3 disable SSE3 optimizations
  289. --disable-ssse3 disable SSSE3 optimizations
  290. --disable-sse4 disable SSE4 optimizations
  291. --disable-sse42 disable SSE4.2 optimizations
  292. --disable-avx disable AVX optimizations
  293. --disable-xop disable XOP optimizations
  294. --disable-fma3 disable FMA3 optimizations
  295. --disable-fma4 disable FMA4 optimizations
  296. --disable-avx2 disable AVX2 optimizations
  297. --disable-armv5te disable armv5te optimizations
  298. --disable-armv6 disable armv6 optimizations
  299. --disable-armv6t2 disable armv6t2 optimizations
  300. --disable-vfp disable VFP optimizations
  301. --disable-neon disable NEON optimizations
  302. --disable-inline-asm disable use of inline assembly
  303. --disable-x86asm disable use of standalone x86 assembly
  304. Developer options (useful when working on Libav itself):
  305. --disable-debug disable debugging symbols
  306. --enable-debug=LEVEL set the debug level [$debuglevel]
  307. --disable-optimizations disable compiler optimizations
  308. --enable-extra-warnings enable more compiler warnings
  309. --samples=PATH location of test samples for FATE, if not set use
  310. \$LIBAV_SAMPLES at make invocation time.
  311. --enable-neon-clobber-test check NEON registers for clobbering (should be
  312. used only for debugging purposes)
  313. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  314. should be used only for debugging purposes)
  315. --disable-valgrind-backtrace do not print a backtrace under Valgrind
  316. (only applies to --disable-optimizations builds)
  317. --ignore-tests=TESTS comma-separated list (without "fate-" prefix
  318. in the name) of tests whose result is ignored
  319. NOTE: Object files are built at the place where configure is launched.
  320. EOF
  321. exit 0
  322. }
  323. quotes='""'
  324. log(){
  325. echo "$@" >> $logfile
  326. }
  327. log_file(){
  328. log BEGIN $1
  329. i=1
  330. while read line; do
  331. printf '%5s %s\n' "${i}" "${line}"
  332. i=$(($i+1))
  333. done < $1 >> $logfile
  334. log END $1
  335. }
  336. echolog(){
  337. log "$@"
  338. echo "$@"
  339. }
  340. warn(){
  341. log "WARNING: $*"
  342. WARNINGS="${WARNINGS}WARNING: $*\n"
  343. }
  344. die(){
  345. echolog "$@"
  346. cat <<EOF
  347. If you think configure made a mistake, make sure you are using the latest
  348. version from Git. If the latest version fails, report the problem to the
  349. libav-tools@libav.org mailing list or IRC #libav on irc.freenode.net.
  350. EOF
  351. if disabled logging; then
  352. cat <<EOF
  353. Rerun configure with logging enabled (do not use --disable-logging), and
  354. include the log this produces with your report.
  355. EOF
  356. else
  357. cat <<EOF
  358. Include the log file "$logfile" produced by configure as this will help
  359. solving the problem.
  360. EOF
  361. fi
  362. exit 1
  363. }
  364. # Avoid locale weirdness, besides we really just want to translate ASCII.
  365. toupper(){
  366. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  367. }
  368. tolower(){
  369. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  370. }
  371. c_escape(){
  372. echo "$*" | sed 's/["\\]/\\\0/g'
  373. }
  374. sh_quote(){
  375. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  376. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  377. echo "$v"
  378. }
  379. cleanws(){
  380. echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//'
  381. }
  382. filter(){
  383. pat=$1
  384. shift
  385. for v; do
  386. eval "case '$v' in $pat) printf '%s ' '$v' ;; esac"
  387. done
  388. }
  389. filter_out(){
  390. pat=$1
  391. shift
  392. for v; do
  393. eval "case '$v' in $pat) ;; *) printf '%s ' '$v' ;; esac"
  394. done
  395. }
  396. map(){
  397. m=$1
  398. shift
  399. for v; do eval $m; done
  400. }
  401. add_suffix(){
  402. suffix=$1
  403. shift
  404. for v; do echo ${v}${suffix}; done
  405. }
  406. set_all(){
  407. value=$1
  408. shift
  409. for var in $*; do
  410. eval $var=$value
  411. done
  412. }
  413. set_weak(){
  414. value=$1
  415. shift
  416. for var; do
  417. eval : \${$var:=$value}
  418. done
  419. }
  420. sanitize_var_name(){
  421. echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
  422. }
  423. set_sanitized(){
  424. var=$1
  425. shift
  426. eval $(sanitize_var_name "$var")='$*'
  427. }
  428. get_sanitized(){
  429. eval echo \$$(sanitize_var_name "$1")
  430. }
  431. pushvar(){
  432. for pvar in $*; do
  433. eval level=\${${pvar}_level:=0}
  434. eval ${pvar}_${level}="\$$pvar"
  435. eval ${pvar}_level=$(($level+1))
  436. done
  437. }
  438. popvar(){
  439. for pvar in $*; do
  440. eval level=\${${pvar}_level:-0}
  441. test $level = 0 && continue
  442. eval level=$(($level-1))
  443. eval $pvar="\${${pvar}_${level}}"
  444. eval ${pvar}_level=$level
  445. eval unset ${pvar}_${level}
  446. done
  447. }
  448. enable(){
  449. set_all yes $*
  450. }
  451. disable(){
  452. set_all no $*
  453. }
  454. enable_weak(){
  455. set_weak yes $*
  456. }
  457. disable_weak(){
  458. set_weak no $*
  459. }
  460. enable_sanitized(){
  461. for var; do
  462. enable $(sanitize_var_name $var)
  463. done
  464. }
  465. disable_sanitized(){
  466. for var; do
  467. disable $(sanitize_var_name $var)
  468. done
  469. }
  470. do_enable_deep(){
  471. for var; do
  472. enabled $var && continue
  473. eval sel="\$${var}_select"
  474. eval sgs="\$${var}_suggest"
  475. pushvar var sgs
  476. enable_deep $sel
  477. popvar sgs
  478. enable_deep_weak $sgs
  479. popvar var
  480. done
  481. }
  482. enable_deep(){
  483. do_enable_deep $*
  484. enable $*
  485. }
  486. enable_deep_weak(){
  487. for var; do
  488. disabled $var && continue
  489. pushvar var
  490. do_enable_deep $var
  491. popvar var
  492. enable_weak $var
  493. done
  494. }
  495. enabled(){
  496. test "${1#!}" = "$1" && op="=" || op="!="
  497. eval test "x\$${1#!}" $op "xyes"
  498. }
  499. disabled(){
  500. test "${1#!}" = "$1" && op="=" || op="!="
  501. eval test "x\$${1#!}" $op "xno"
  502. }
  503. enabled_all(){
  504. for opt; do
  505. enabled $opt || return 1
  506. done
  507. }
  508. disabled_all(){
  509. for opt; do
  510. disabled $opt || return 1
  511. done
  512. }
  513. enabled_any(){
  514. for opt; do
  515. enabled $opt && return 0
  516. done
  517. }
  518. disabled_any(){
  519. for opt; do
  520. disabled $opt && return 0
  521. done
  522. return 1
  523. }
  524. set_default(){
  525. for opt; do
  526. eval : \${$opt:=\$${opt}_default}
  527. done
  528. }
  529. is_in(){
  530. value=$1
  531. shift
  532. for var in $*; do
  533. [ $var = $value ] && return 0
  534. done
  535. return 1
  536. }
  537. check_deps(){
  538. for cfg; do
  539. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  540. disabled ${cfg}_checking && continue
  541. enable ${cfg}_checking
  542. eval dep_all="\$${cfg}_deps"
  543. eval dep_any="\$${cfg}_deps_any"
  544. eval dep_con="\$${cfg}_conflict"
  545. eval dep_sel="\$${cfg}_select"
  546. eval dep_sgs="\$${cfg}_suggest"
  547. eval dep_ifa="\$${cfg}_if"
  548. eval dep_ifn="\$${cfg}_if_any"
  549. pushvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn
  550. check_deps $dep_all $dep_any $dep_con $dep_sel $dep_sgs $dep_ifa $dep_ifn
  551. popvar cfg dep_all dep_any dep_con dep_sel dep_sgs dep_ifa dep_ifn
  552. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  553. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  554. enabled_all $dep_all || disable $cfg
  555. enabled_any $dep_any || disable $cfg
  556. disabled_all $dep_con || disable $cfg
  557. disabled_any $dep_sel && disable $cfg
  558. enabled $cfg && enable_deep_weak $dep_sel $dep_sgs
  559. for dep in $dep_all $dep_any $dep_sel $dep_sgs; do
  560. # filter out library deps, these do not belong in extralibs
  561. is_in $dep $LIBRARY_LIST && continue
  562. enabled $dep && eval append ${cfg}_extralibs ${dep}_extralibs
  563. done
  564. disable ${cfg}_checking
  565. done
  566. }
  567. print_config(){
  568. pfx=$1
  569. files=$2
  570. shift 2
  571. map 'eval echo "$v \${$v:-no}"' "$@" |
  572. awk "BEGIN { split(\"$files\", files) }
  573. {
  574. c = \"$pfx\" toupper(\$1);
  575. v = \$2;
  576. sub(/yes/, 1, v);
  577. sub(/no/, 0, v);
  578. for (f in files) {
  579. file = files[f];
  580. if (file ~ /\\.h\$/) {
  581. printf(\"#define %s %d\\n\", c, v) >>file;
  582. } else if (file ~ /\\.asm\$/) {
  583. printf(\"%%define %s %d\\n\", c, v) >>file;
  584. } else if (file ~ /\\.mak\$/) {
  585. n = -v ? \"\" : \"!\";
  586. printf(\"%s%s=yes\\n\", n, c) >>file;
  587. }
  588. }
  589. }"
  590. }
  591. print_enabled(){
  592. suf=$1
  593. shift
  594. for v; do
  595. enabled $v && printf "%s\n" ${v%$suf}
  596. done
  597. }
  598. append(){
  599. var=$1
  600. shift
  601. eval "$var=\"\$$var $*\""
  602. }
  603. prepend(){
  604. var=$1
  605. shift
  606. eval "$var=\"$* \$$var\""
  607. }
  608. unique(){
  609. var=$1
  610. uniq_list=""
  611. for tok in $(eval echo \$$var); do
  612. uniq_list="$(filter_out $tok $uniq_list) $tok"
  613. done
  614. eval "$var=\"${uniq_list}\""
  615. }
  616. resolve(){
  617. var=$1
  618. tmpvar=
  619. for entry in $(eval echo \$$var); do
  620. tmpvar="$tmpvar $(eval echo \$${entry})"
  621. done
  622. eval "$var=\"${tmpvar}\""
  623. }
  624. add_cppflags(){
  625. append CPPFLAGS "$@"
  626. }
  627. add_cflags(){
  628. append CFLAGS $($cflags_filter "$@")
  629. }
  630. add_cflags_headers(){
  631. append CFLAGS_HEADERS $($cflags_filter "$@")
  632. }
  633. add_asflags(){
  634. append ASFLAGS $($asflags_filter "$@")
  635. }
  636. add_objcflags(){
  637. append OBJCFLAGS $($objcflags_filter "$@")
  638. }
  639. add_ldflags(){
  640. append LDFLAGS $($ldflags_filter "$@")
  641. }
  642. add_ldexeflags(){
  643. append LDEXEFLAGS $($ldflags_filter "$@")
  644. }
  645. add_ldsoflags(){
  646. append LDSOFLAGS $($ldflags_filter "$@")
  647. }
  648. add_stripflags(){
  649. append STRIPFLAGS "$@"
  650. }
  651. add_extralibs(){
  652. prepend extralibs $($ldflags_filter "$@")
  653. }
  654. add_host_cppflags(){
  655. append host_cppflags "$@"
  656. }
  657. add_host_cflags(){
  658. append host_cflags $($host_cflags_filter "$@")
  659. }
  660. add_host_ldflags(){
  661. append host_ldflags $($host_ldflags_filter "$@")
  662. }
  663. add_compat(){
  664. append compat_objs $1
  665. shift
  666. map 'add_cppflags -D$v' "$@"
  667. }
  668. check_cmd(){
  669. log "$@"
  670. "$@" >> $logfile 2>&1
  671. }
  672. cc_o(){
  673. eval printf '%s\\n' $CC_O
  674. }
  675. cc_e(){
  676. eval printf '%s\\n' $CC_E
  677. }
  678. check_cc(){
  679. log check_cc "$@"
  680. cat > $TMPC
  681. log_file $TMPC
  682. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  683. }
  684. check_objcc(){
  685. log check_objcc "$@"
  686. cat > $TMPC
  687. log_file $TMPC
  688. check_cmd $objcc $CPPFLAGS $CFLAGS $OBJCFLAGS "$@" $OBJCC_C $(cc_o $TMPO) $TMPC
  689. }
  690. check_cpp(){
  691. log check_cpp "$@"
  692. cat > $TMPC
  693. log_file $TMPC
  694. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  695. }
  696. as_o(){
  697. eval printf '%s\\n' $AS_O
  698. }
  699. check_as(){
  700. log check_as "$@"
  701. cat > $TMPS
  702. log_file $TMPS
  703. check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
  704. }
  705. check_inline_asm(){
  706. log check_inline_asm "$@"
  707. name="$1"
  708. code="$2"
  709. shift 2
  710. disable $name
  711. check_cc "$@" <<EOF && enable $name
  712. void foo(void){ __asm__ volatile($code); }
  713. EOF
  714. }
  715. check_insn(){
  716. log check_insn "$@"
  717. check_inline_asm ${1}_inline "\"$2\""
  718. echo "$2" | check_as && enable ${1}_external || disable ${1}_external
  719. }
  720. check_x86asm(){
  721. log check_x86asm "$@"
  722. echo "$1" > $TMPS
  723. log_file $TMPS
  724. shift 1
  725. check_cmd $x86asmexe $X86ASMFLAGS "$@" -o $TMPO $TMPS
  726. }
  727. ld_o(){
  728. eval printf '%s\\n' $LD_O
  729. }
  730. check_ld(){
  731. log check_ld "$@"
  732. flags=$(filter_out '-l*' "$@")
  733. libs=$(filter '-l*' "$@")
  734. check_cc $($cflags_filter $flags) || return
  735. flags=$($ldflags_filter $flags)
  736. libs=$($ldflags_filter $libs)
  737. check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
  738. }
  739. print_include(){
  740. hdr=$1
  741. test "${hdr%.h}" = "${hdr}" &&
  742. echo "#include $hdr" ||
  743. echo "#include <$hdr>"
  744. }
  745. check_code(){
  746. log check_code "$@"
  747. check=$1
  748. headers=$2
  749. code=$3
  750. shift 3
  751. {
  752. for hdr in $headers; do
  753. print_include $hdr
  754. done
  755. echo "int main(void) { $code; return 0; }"
  756. } | check_$check "$@"
  757. }
  758. check_cppflags(){
  759. log check_cppflags "$@"
  760. check_cpp "$@" <<EOF && append CPPFLAGS "$@"
  761. #include <stdlib.h>;
  762. EOF
  763. }
  764. test_cflags(){
  765. log test_cflags "$@"
  766. set -- $($cflags_filter "$@")
  767. check_cc "$@" <<EOF
  768. int x;
  769. EOF
  770. }
  771. check_cflags(){
  772. log check_cflags "$@"
  773. test_cflags "$@" && add_cflags "$@"
  774. }
  775. test_objcflags(){
  776. log test_objcflags "$@"
  777. set -- $($objcflags_filter "$@")
  778. check_objcc "$@" <<EOF
  779. int x;
  780. EOF
  781. }
  782. check_objcflags(){
  783. log check_objcflags "$@"
  784. test_objcflags "$@" && add_objcflags "$@"
  785. }
  786. test_ldflags(){
  787. log test_ldflags "$@"
  788. set -- $($ldflags_filter "$@")
  789. check_ld "$@" <<EOF
  790. int main(void){ return 0; }
  791. EOF
  792. }
  793. check_ldflags(){
  794. log check_ldflags "$@"
  795. test_ldflags "$@" && add_ldflags "$@"
  796. }
  797. test_stripflags(){
  798. log test_stripflags "$@"
  799. # call check_cc to get a fresh TMPO
  800. check_cc <<EOF
  801. int main(void) { return 0; }
  802. EOF
  803. check_cmd $strip $STRIPFLAGS "$@" $TMPO
  804. }
  805. check_stripflags(){
  806. log check_stripflags "$@"
  807. test_stripflags "$@" && add_stripflags "$@"
  808. }
  809. check_header(){
  810. log check_header "$@"
  811. headers=$1
  812. shift
  813. disable_sanitized $headers
  814. {
  815. for hdr in $headers; do
  816. print_include $hdr
  817. done
  818. echo "int x;"
  819. } | check_cpp "$@" && enable_sanitized $headers
  820. }
  821. check_func(){
  822. log check_func "$@"
  823. func=$1
  824. shift
  825. disable $func
  826. check_ld "$@" <<EOF && enable $func
  827. extern int $func();
  828. int main(void){ $func(); }
  829. EOF
  830. }
  831. check_mathfunc(){
  832. log check_mathfunc "$@"
  833. func=$1
  834. narg=$2
  835. shift 2
  836. test $narg = 2 && args="f, g" || args="f"
  837. disable $func
  838. check_ld "$@" <<EOF && enable $func
  839. #include <math.h>
  840. float foo(float f, float g) { return $func($args); }
  841. int main(void){ return 0; }
  842. EOF
  843. }
  844. check_func_headers(){
  845. log check_func_headers "$@"
  846. headers=$1
  847. funcs=$2
  848. shift 2
  849. {
  850. for hdr in $headers; do
  851. print_include $hdr
  852. done
  853. for func in $funcs; do
  854. echo "long check_$func(void) { return (long) $func; }"
  855. done
  856. echo "int main(void) { return 0; }"
  857. } | check_ld "$@" && enable $funcs && enable_sanitized $headers
  858. }
  859. check_cpp_condition(){
  860. log check_cpp_condition "$@"
  861. header=$1
  862. condition=$2
  863. shift 2
  864. check_cpp "$@" <<EOF
  865. #include <$header>
  866. #if !($condition)
  867. #error "unsatisfied condition: $condition"
  868. #endif
  869. EOF
  870. }
  871. test_cflags_cpp(){
  872. log test_cflags_cpp "$@"
  873. flags=$1
  874. condition=$2
  875. shift 2
  876. set -- $($cflags_filter "$flags")
  877. check_cpp "$@" <<EOF
  878. #if !($condition)
  879. #error "unsatisfied condition: $condition"
  880. #endif
  881. EOF
  882. }
  883. check_lib(){
  884. log check_lib "$@"
  885. name="$1"
  886. headers="$2"
  887. funcs="$3"
  888. shift 3
  889. disable $name
  890. check_func_headers "$headers" "$funcs" "$@" &&
  891. enable $name && eval ${name}_extralibs="\$@"
  892. }
  893. test_pkg_config(){
  894. log test_pkg_config "$@"
  895. name="$1"
  896. pkg_version="$2"
  897. pkg="${2%% *}"
  898. headers="$3"
  899. funcs="$4"
  900. shift 4
  901. disable $name
  902. check_cmd $pkg_config --exists --print-errors $pkg_version || return
  903. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  904. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  905. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  906. enable $name &&
  907. set_sanitized "${name}_cflags" $pkg_cflags &&
  908. set_sanitized "${name}_extralibs" $pkg_libs
  909. }
  910. check_pkg_config(){
  911. log check_pkg_config "$@"
  912. name="$1"
  913. test_pkg_config "$@" &&
  914. eval add_cflags \$${name}_cflags
  915. }
  916. check_exec(){
  917. check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  918. }
  919. check_exec_crash(){
  920. log check_exec_crash "$@"
  921. code=$(cat)
  922. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  923. # are safe but may not be available everywhere. Thus we use
  924. # raise(SIGTERM) instead. The check is run in a subshell so we
  925. # can redirect the "Terminated" message from the shell. SIGBUS
  926. # is not defined by standard C so it is used conditionally.
  927. (check_exec "$@") >> $logfile 2>&1 <<EOF
  928. #include <signal.h>
  929. static void sighandler(int sig){
  930. raise(SIGTERM);
  931. }
  932. int foo(void){
  933. $code
  934. }
  935. int (*func_ptr)(void) = foo;
  936. int main(void){
  937. signal(SIGILL, sighandler);
  938. signal(SIGFPE, sighandler);
  939. signal(SIGSEGV, sighandler);
  940. #ifdef SIGBUS
  941. signal(SIGBUS, sighandler);
  942. #endif
  943. return func_ptr();
  944. }
  945. EOF
  946. }
  947. check_type(){
  948. log check_type "$@"
  949. headers=$1
  950. type=$2
  951. shift 2
  952. disable_sanitized "$type"
  953. check_code cc "$headers" "$type v" "$@" && enable_sanitized "$type"
  954. }
  955. check_struct(){
  956. log check_struct "$@"
  957. headers=$1
  958. struct=$2
  959. member=$3
  960. shift 3
  961. disable_sanitized "${struct}_${member}"
  962. check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  963. enable_sanitized "${struct}_${member}"
  964. }
  965. check_builtin(){
  966. log check_builtin "$@"
  967. name=$1
  968. headers=$2
  969. builtin=$3
  970. shift 3
  971. disable "$name"
  972. check_code ld "$headers" "$builtin" "$@" && enable "$name"
  973. }
  974. check_compile_assert(){
  975. log check_compile_assert "$@"
  976. name=$1
  977. headers=$2
  978. condition=$3
  979. shift 3
  980. disable "$name"
  981. check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
  982. }
  983. require(){
  984. log require "$@"
  985. name_version="$1"
  986. name="${1%% *}"
  987. headers="$2"
  988. func="$3"
  989. shift 3
  990. check_lib $name "$headers" $func "$@" || die "ERROR: $name_version not found"
  991. }
  992. require_header(){
  993. log require_header "$@"
  994. headers="$1"
  995. shift
  996. check_header "$headers" "$@" || die "ERROR: $headers not found"
  997. }
  998. require_cpp_condition(){
  999. log require_cpp_condition "$@"
  1000. header="$1"
  1001. condition="$2"
  1002. shift 2
  1003. check_cpp_condition "$header" "$condition" "$@" || die "ERROR: $condition not satisfied"
  1004. }
  1005. require_pkg_config(){
  1006. log require_pkg_config "$@"
  1007. pkg_version="$2"
  1008. check_pkg_config "$@" || die "ERROR: $pkg_version not found"
  1009. }
  1010. hostcc_e(){
  1011. eval printf '%s\\n' $HOSTCC_E
  1012. }
  1013. hostcc_o(){
  1014. eval printf '%s\\n' $HOSTCC_O
  1015. }
  1016. check_host_cc(){
  1017. log check_host_cc "$@"
  1018. cat > $TMPC
  1019. log_file $TMPC
  1020. check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
  1021. }
  1022. check_host_cpp(){
  1023. log check_host_cpp "$@"
  1024. cat > $TMPC
  1025. log_file $TMPC
  1026. check_cmd $host_cc $host_cppflags $host_cflags "$@" $(hostcc_e $TMPO) $TMPC
  1027. }
  1028. check_host_cppflags(){
  1029. log check_host_cppflags "$@"
  1030. check_host_cpp "$@" <<EOF && append host_cppflags "$@"
  1031. #include <stdlib.h>;
  1032. EOF
  1033. }
  1034. check_host_cflags(){
  1035. log check_host_cflags "$@"
  1036. set -- $($host_cflags_filter "$@")
  1037. check_host_cc "$@" <<EOF && append host_cflags "$@"
  1038. int x;
  1039. EOF
  1040. }
  1041. check_host_cpp_condition(){
  1042. log check_host_cpp_condition "$@"
  1043. header=$1
  1044. condition=$2
  1045. shift 2
  1046. check_host_cpp "$@" <<EOF
  1047. #include <$header>
  1048. #if !($condition)
  1049. #error "unsatisfied condition: $condition"
  1050. #endif
  1051. EOF
  1052. }
  1053. cp_if_changed(){
  1054. cmp -s "$1" "$2" && { test "$quiet" != "yes" && echo "$2 is unchanged"; } && return
  1055. mkdir -p "$(dirname $2)"
  1056. cp -f "$1" "$2"
  1057. }
  1058. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  1059. # system-dependent things.
  1060. AVCODEC_COMPONENTS="
  1061. bsfs
  1062. decoders
  1063. encoders
  1064. hwaccels
  1065. parsers
  1066. "
  1067. AVDEVICE_COMPONENTS="
  1068. indevs
  1069. "
  1070. AVFILTER_COMPONENTS="
  1071. filters
  1072. "
  1073. AVFORMAT_COMPONENTS="
  1074. demuxers
  1075. muxers
  1076. protocols
  1077. "
  1078. COMPONENT_LIST="
  1079. $AVCODEC_COMPONENTS
  1080. $AVDEVICE_COMPONENTS
  1081. $AVFILTER_COMPONENTS
  1082. $AVFORMAT_COMPONENTS
  1083. "
  1084. EXAMPLE_LIST="
  1085. decode_audio_example
  1086. decode_video_example
  1087. encode_audio_example
  1088. encode_video_example
  1089. filter_audio_example
  1090. metadata_example
  1091. output_example
  1092. qsvdec_example
  1093. transcode_aac_example
  1094. "
  1095. # catchall list of things that require external libs to link
  1096. EXTRALIBS_LIST="
  1097. cpu_init
  1098. cws2fws
  1099. "
  1100. HWACCEL_LIBRARY_NONFREE_LIST="
  1101. cuda
  1102. cuvid
  1103. libnpp
  1104. "
  1105. HWACCEL_LIBRARY_LIST="
  1106. $HWACCEL_LIBRARY_NONFREE_LIST
  1107. d3d11va
  1108. dxva2
  1109. libmfx
  1110. mmal
  1111. nvenc
  1112. omx
  1113. vaapi
  1114. vda
  1115. vdpau
  1116. "
  1117. EXTERNAL_LIBRARY_GPL_LIST="
  1118. libcdio
  1119. libx264
  1120. libx265
  1121. libxavs
  1122. libxvid
  1123. "
  1124. EXTERNAL_LIBRARY_NONFREE_LIST="
  1125. libfaac
  1126. libfdk_aac
  1127. openssl
  1128. "
  1129. EXTERNAL_LIBRARY_VERSION3_LIST="
  1130. libopencore_amrnb
  1131. libopencore_amrwb
  1132. libvo_aacenc
  1133. libvo_amrwbenc
  1134. "
  1135. EXTERNAL_LIBRARY_LIST="
  1136. $EXTERNAL_LIBRARY_GPL_LIST
  1137. $EXTERNAL_LIBRARY_NONFREE_LIST
  1138. $EXTERNAL_LIBRARY_VERSION3_LIST
  1139. avisynth
  1140. avxsynth
  1141. frei0r
  1142. gnutls
  1143. libbs2b
  1144. libdc1394
  1145. libdcadec
  1146. libfontconfig
  1147. libfreetype
  1148. libgsm
  1149. libhdcd
  1150. libilbc
  1151. libjack
  1152. libkvazaar
  1153. libmp3lame
  1154. libopencv
  1155. libopenh264
  1156. libopenjpeg
  1157. libopus
  1158. libpulse
  1159. librtmp
  1160. libschroedinger
  1161. libsnappy
  1162. libspeex
  1163. libtheora
  1164. libtwolame
  1165. libvorbis
  1166. libvpx
  1167. libwavpack
  1168. libwebp
  1169. libxcb
  1170. libxcb_shm
  1171. libxcb_xfixes
  1172. "
  1173. SYSTEM_LIBRARY_LIST="
  1174. bzlib
  1175. zlib
  1176. "
  1177. FEATURE_LIST="
  1178. gray
  1179. hardcoded_tables
  1180. omx_rpi
  1181. runtime_cpudetect
  1182. safe_bitstream_reader
  1183. shared
  1184. small
  1185. sram
  1186. static
  1187. swscale_alpha
  1188. "
  1189. LIBRARY_LIST="
  1190. avcodec
  1191. avdevice
  1192. avfilter
  1193. avformat
  1194. avresample
  1195. avutil
  1196. swscale
  1197. "
  1198. LICENSE_LIST="
  1199. gpl
  1200. nonfree
  1201. version3
  1202. "
  1203. PROGRAM_LIST="
  1204. avconv
  1205. avplay
  1206. avprobe
  1207. "
  1208. SUBSYSTEM_LIST="
  1209. dct
  1210. doc
  1211. error_resilience
  1212. faan
  1213. fft
  1214. lsp
  1215. lzo
  1216. mdct
  1217. network
  1218. rdft
  1219. "
  1220. # COMPONENT_LIST needs to come last to ensure correct dependency checking
  1221. CONFIG_LIST="
  1222. $EXAMPLE_LIST
  1223. $EXTERNAL_LIBRARY_LIST
  1224. $HWACCEL_LIBRARY_LIST
  1225. $FEATURE_LIST
  1226. $LICENSE_LIST
  1227. $LIBRARY_LIST
  1228. $PROGRAM_LIST
  1229. $SUBSYSTEM_LIST
  1230. $SYSTEM_LIBRARY_LIST
  1231. neon_clobber_test
  1232. pic
  1233. pod2man
  1234. texi2html
  1235. thumb
  1236. valgrind_backtrace
  1237. xmm_clobber_test
  1238. $COMPONENT_LIST
  1239. "
  1240. THREADS_LIST="
  1241. pthreads
  1242. w32threads
  1243. "
  1244. ATOMICS_LIST="
  1245. atomics_gcc
  1246. atomics_suncc
  1247. atomics_win32
  1248. "
  1249. ARCH_LIST="
  1250. aarch64
  1251. alpha
  1252. arm
  1253. avr32
  1254. avr32_ap
  1255. avr32_uc
  1256. bfin
  1257. ia64
  1258. m68k
  1259. mips
  1260. mips64
  1261. parisc
  1262. ppc
  1263. ppc64
  1264. s390
  1265. sh4
  1266. sparc
  1267. sparc64
  1268. tilegx
  1269. tilepro
  1270. tomi
  1271. x86
  1272. x86_32
  1273. x86_64
  1274. "
  1275. ARCH_EXT_LIST_ARM="
  1276. armv5te
  1277. armv6
  1278. armv6t2
  1279. armv8
  1280. neon
  1281. vfp
  1282. vfpv3
  1283. "
  1284. ARCH_EXT_LIST_X86_SIMD="
  1285. amd3dnow
  1286. amd3dnowext
  1287. avx
  1288. avx2
  1289. fma3
  1290. fma4
  1291. mmx
  1292. mmxext
  1293. sse
  1294. sse2
  1295. sse3
  1296. sse4
  1297. sse42
  1298. ssse3
  1299. xop
  1300. "
  1301. ARCH_EXT_LIST_PPC="
  1302. altivec
  1303. dcbzl
  1304. ldbrx
  1305. power8
  1306. ppc4xx
  1307. vsx
  1308. "
  1309. ARCH_EXT_LIST_X86="
  1310. $ARCH_EXT_LIST_X86_SIMD
  1311. cpunop
  1312. i686
  1313. "
  1314. ARCH_EXT_LIST_MIPS="
  1315. loongson
  1316. mips32r1
  1317. mips64r1
  1318. mips32r2
  1319. mips64r2
  1320. mips32r6
  1321. mips64r6
  1322. "
  1323. ARCH_EXT_LIST="
  1324. $ARCH_EXT_LIST_ARM
  1325. $ARCH_EXT_LIST_MIPS
  1326. $ARCH_EXT_LIST_PPC
  1327. $ARCH_EXT_LIST_X86
  1328. vis
  1329. "
  1330. ARCH_FEATURES="
  1331. aligned_stack
  1332. fast_64bit
  1333. fast_clz
  1334. fast_cmov
  1335. local_aligned_8
  1336. local_aligned_16
  1337. local_aligned_32
  1338. simd_align_16
  1339. simd_align_32
  1340. "
  1341. BUILTIN_LIST="
  1342. atomic_cas_ptr
  1343. machine_rw_barrier
  1344. MemoryBarrier
  1345. mm_empty
  1346. rdtsc
  1347. sem_timedwait
  1348. sync_val_compare_and_swap
  1349. "
  1350. HAVE_LIST_CMDLINE="
  1351. inline_asm
  1352. symver
  1353. x86asm
  1354. "
  1355. HAVE_LIST_PUB="
  1356. bigendian
  1357. fast_unaligned
  1358. "
  1359. HEADERS_LIST="
  1360. AVFoundation_AVFoundation_h
  1361. arpa_inet_h
  1362. cdio_paranoia_h
  1363. cdio_paranoia_paranoia_h
  1364. dispatch_dispatch_h
  1365. dev_bktr_ioctl_bt848_h
  1366. dev_bktr_ioctl_meteor_h
  1367. dev_ic_bt8xx_h
  1368. dev_video_bktr_ioctl_bt848_h
  1369. dev_video_meteor_ioctl_meteor_h
  1370. direct_h
  1371. dxgidebug_h
  1372. dxva_h
  1373. io_h
  1374. machine_ioctl_bt848_h
  1375. machine_ioctl_meteor_h
  1376. malloc_h
  1377. poll_h
  1378. sys_param_h
  1379. sys_resource_h
  1380. sys_select_h
  1381. sys_soundcard_h
  1382. sys_time_h
  1383. sys_un_h
  1384. sys_videoio_h
  1385. unistd_h
  1386. valgrind_valgrind_h
  1387. windows_h
  1388. winsock2_h
  1389. "
  1390. INTRINSICS_LIST="
  1391. intrinsics_neon
  1392. "
  1393. MATH_FUNCS="
  1394. atanf
  1395. atan2f
  1396. cbrtf
  1397. cosf
  1398. exp2
  1399. exp2f
  1400. expf
  1401. isinf
  1402. isnan
  1403. ldexpf
  1404. llrint
  1405. llrintf
  1406. log2
  1407. log2f
  1408. log10f
  1409. lrint
  1410. lrintf
  1411. powf
  1412. rint
  1413. round
  1414. roundf
  1415. sinf
  1416. trunc
  1417. truncf
  1418. "
  1419. SYSTEM_FEATURES="
  1420. dos_paths
  1421. libc_msvcrt
  1422. MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS
  1423. section_data_rel_ro
  1424. threads
  1425. uwp
  1426. "
  1427. SYSTEM_FUNCS="
  1428. aligned_malloc
  1429. clock_gettime
  1430. closesocket
  1431. CommandLineToArgvW
  1432. fcntl
  1433. getaddrinfo
  1434. gethrtime
  1435. getopt
  1436. GetProcessAffinityMask
  1437. GetProcessMemoryInfo
  1438. GetProcessTimes
  1439. getrusage
  1440. GetSystemTimeAsFileTime
  1441. gettimeofday
  1442. gmtime_r
  1443. inet_aton
  1444. isatty
  1445. localtime_r
  1446. mach_absolute_time
  1447. MapViewOfFile
  1448. memalign
  1449. mmap
  1450. mprotect
  1451. nanosleep
  1452. posix_memalign
  1453. sched_getaffinity
  1454. SetConsoleTextAttribute
  1455. setmode
  1456. setrlimit
  1457. Sleep
  1458. strerror_r
  1459. sysconf
  1460. sysctl
  1461. usleep
  1462. VirtualAlloc
  1463. "
  1464. SYSTEM_LIBRARIES="
  1465. sdl
  1466. vaapi_1
  1467. vaapi_drm
  1468. vaapi_x11
  1469. vdpau_x11
  1470. wincrypt
  1471. "
  1472. TOOLCHAIN_FEATURES="
  1473. as_arch_directive
  1474. as_fpu_directive
  1475. as_func
  1476. as_object_arch
  1477. asm_mod_q
  1478. blocks_extension
  1479. ebp_available
  1480. ebx_available
  1481. gnu_as
  1482. ibm_asm
  1483. inline_asm_labels
  1484. pragma_deprecated
  1485. symver_asm_label
  1486. symver_gnu_asm
  1487. vfp_args
  1488. xform_asm
  1489. xmm_clobbers
  1490. "
  1491. TYPES_LIST="
  1492. CONDITION_VARIABLE_Ptr
  1493. CUVIDDECODECREATEINFO_bitDepthMinus8
  1494. socklen_t
  1495. struct_addrinfo
  1496. struct_group_source_req
  1497. struct_ip_mreq_source
  1498. struct_ipv6_mreq
  1499. struct_pollfd
  1500. struct_rusage_ru_maxrss
  1501. struct_sockaddr_in6
  1502. struct_sockaddr_sa_len
  1503. struct_sockaddr_storage
  1504. struct_v4l2_frmivalenum_discrete
  1505. "
  1506. HAVE_LIST="
  1507. $ARCH_EXT_LIST
  1508. $(add_suffix _external $ARCH_EXT_LIST)
  1509. $(add_suffix _inline $ARCH_EXT_LIST)
  1510. $ARCH_FEATURES
  1511. $BUILTIN_LIST
  1512. $HAVE_LIST_CMDLINE
  1513. $HAVE_LIST_PUB
  1514. $HEADERS_LIST
  1515. $INTRINSICS_LIST
  1516. $MATH_FUNCS
  1517. $SYSTEM_FEATURES
  1518. $SYSTEM_FUNCS
  1519. $SYSTEM_LIBRARIES
  1520. $THREADS_LIST
  1521. $TOOLCHAIN_FEATURES
  1522. $TYPES_LIST
  1523. "
  1524. # options emitted with CONFIG_ prefix but not available on the command line
  1525. CONFIG_EXTRA="
  1526. aandcttables
  1527. ac3dsp
  1528. adts_header
  1529. audio_frame_queue
  1530. audiodsp
  1531. blockdsp
  1532. bswapdsp
  1533. cabac
  1534. cbs
  1535. cbs_h264
  1536. cbs_h265
  1537. cbs_mpeg2
  1538. dirac_parse
  1539. dvprofile
  1540. faandct
  1541. faanidct
  1542. fdctdsp
  1543. flacdsp
  1544. fmtconvert
  1545. g722dsp
  1546. gmp
  1547. golomb
  1548. gplv3
  1549. h263dsp
  1550. h264chroma
  1551. h264dsp
  1552. h264parse
  1553. h264pred
  1554. h264qpel
  1555. hevcparse
  1556. hpeldsp
  1557. huffman
  1558. huffyuvdsp
  1559. huffyuvencdsp
  1560. idctdsp
  1561. iirfilter
  1562. imdct15
  1563. intrax8
  1564. iso_media
  1565. ividsp
  1566. jpegtables
  1567. lgplv3
  1568. libx262
  1569. libxcb_shape
  1570. lpc
  1571. lzf
  1572. me_cmp
  1573. mpeg_er
  1574. mpegaudio
  1575. mpegaudiodsp
  1576. mpegaudioheader
  1577. mpegvideo
  1578. mpegvideoenc
  1579. mss34dsp
  1580. pixblockdsp
  1581. qpeldsp
  1582. qsv
  1583. qsvdec
  1584. qsvenc
  1585. qsvvpp
  1586. rangecoder
  1587. riffdec
  1588. riffenc
  1589. rtpdec
  1590. rtpenc_chain
  1591. rv34dsp
  1592. sinewin
  1593. snappy
  1594. srtp
  1595. startcode
  1596. texturedsp
  1597. texturedspenc
  1598. tpeldsp
  1599. vaapi_encode
  1600. vc1dsp
  1601. videodsp
  1602. vp3dsp
  1603. vp56dsp
  1604. vp8dsp
  1605. wma_freqs
  1606. wmv2dsp
  1607. "
  1608. CMDLINE_SELECT="
  1609. $ARCH_EXT_LIST
  1610. $CONFIG_LIST
  1611. $HAVE_LIST_CMDLINE
  1612. $THREADS_LIST
  1613. asm
  1614. cross_compile
  1615. debug
  1616. extra_warnings
  1617. logging
  1618. lto
  1619. optimizations
  1620. rpath
  1621. "
  1622. PATHS_LIST="
  1623. bindir
  1624. datadir
  1625. docdir
  1626. incdir
  1627. libdir
  1628. mandir
  1629. prefix
  1630. shlibdir
  1631. "
  1632. CMDLINE_SET="
  1633. $PATHS_LIST
  1634. ar
  1635. arch
  1636. as
  1637. cc
  1638. objcc
  1639. cpu
  1640. cross_prefix
  1641. custom_allocator
  1642. dep_cc
  1643. env
  1644. extra_version
  1645. host_cc
  1646. host_cflags
  1647. host_extralibs
  1648. host_ld
  1649. host_ldflags
  1650. host_os
  1651. ignore_tests
  1652. ld
  1653. logfile
  1654. malloc_prefix
  1655. nm
  1656. optflags
  1657. pkg_config
  1658. pkg_config_flags
  1659. samples
  1660. sysinclude
  1661. sysroot
  1662. target_exec
  1663. target_os
  1664. target_path
  1665. target_samples
  1666. toolchain
  1667. x86asmexe
  1668. "
  1669. CMDLINE_APPEND="
  1670. extra_cflags
  1671. extra_objcflags
  1672. host_cppflags
  1673. "
  1674. # code dependency declarations
  1675. # architecture extensions
  1676. armv5te_deps="arm"
  1677. armv6_deps="arm"
  1678. armv6t2_deps="arm"
  1679. armv8_deps="aarch64"
  1680. neon_deps_any="aarch64 arm"
  1681. intrinsics_neon_deps="neon"
  1682. vfp_deps_any="aarch64 arm"
  1683. vfpv3_deps="vfp"
  1684. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  1685. altivec_deps="ppc"
  1686. dcbzl_deps="ppc"
  1687. ldbrx_deps="ppc"
  1688. ppc4xx_deps="ppc"
  1689. vsx_deps="altivec"
  1690. power8_deps="vsx"
  1691. loongson_deps="mips"
  1692. mips32r1_deps="mips32"
  1693. mips32r2_deps="mips32"
  1694. mips32r6_deps="mips32"
  1695. mips64r1_deps="mips64"
  1696. mips64r2_deps="mips64"
  1697. mips64r6_deps="mips64"
  1698. vis_deps="sparc"
  1699. cpunop_deps="i686"
  1700. x86_64_select="i686"
  1701. x86_64_suggest="fast_cmov"
  1702. amd3dnow_deps="mmx"
  1703. amd3dnowext_deps="amd3dnow"
  1704. i686_deps="x86"
  1705. mmx_deps="x86"
  1706. mmxext_deps="mmx"
  1707. sse_deps="mmxext"
  1708. sse2_deps="sse"
  1709. sse3_deps="sse2"
  1710. ssse3_deps="sse3"
  1711. sse4_deps="ssse3"
  1712. sse42_deps="sse4"
  1713. avx_deps="sse42"
  1714. xop_deps="avx"
  1715. fma3_deps="avx"
  1716. fma4_deps="avx"
  1717. avx2_deps="avx"
  1718. mmx_external_deps="x86asm"
  1719. mmx_inline_deps="inline_asm x86"
  1720. mmx_suggest="mmx_external mmx_inline"
  1721. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  1722. eval dep=\$${ext}_deps
  1723. eval ${ext}_external_deps='"${dep}_external"'
  1724. eval ${ext}_inline_deps='"${dep}_inline"'
  1725. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  1726. done
  1727. aligned_stack_if_any="aarch64 ppc x86"
  1728. fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1729. fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
  1730. fast_unaligned_if_any="aarch64 ppc x86"
  1731. simd_align_16_if_any="altivec neon sse"
  1732. simd_align_32_if_any="avx"
  1733. # system capabilities
  1734. symver_if_any="symver_asm_label symver_gnu_asm"
  1735. valgrind_backtrace_conflict="optimizations"
  1736. valgrind_backtrace_deps="valgrind_valgrind_h"
  1737. # threading support
  1738. atomics_gcc_if="sync_val_compare_and_swap"
  1739. atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
  1740. atomics_win32_if="MemoryBarrier"
  1741. atomics_native_if_any="$ATOMICS_LIST"
  1742. w32threads_deps="atomics_native"
  1743. threads_if_any="$THREADS_LIST"
  1744. # subsystems
  1745. cbs_h264_select="cbs golomb"
  1746. cbs_h265_select="cbs golomb"
  1747. cbs_mpeg2_select="cbs"
  1748. dct_select="rdft"
  1749. dirac_parse_select="golomb"
  1750. error_resilience_select="me_cmp"
  1751. faandct_deps="faan"
  1752. faandct_select="fdctdsp"
  1753. faanidct_deps="faan"
  1754. faanidct_select="idctdsp"
  1755. h264dsp_select="startcode"
  1756. hevcparse_select="golomb"
  1757. intrax8_select="blockdsp idctdsp"
  1758. mdct_select="fft"
  1759. rdft_select="fft"
  1760. me_cmp_select="fdctdsp idctdsp pixblockdsp"
  1761. mpeg_er_select="error_resilience"
  1762. mpegaudio_select="mpegaudiodsp mpegaudioheader"
  1763. mpegaudiodsp_select="dct"
  1764. mpegvideo_select="blockdsp hpeldsp idctdsp me_cmp mpeg_er videodsp"
  1765. mpegvideoenc_select="me_cmp mpegvideo pixblockdsp qpeldsp"
  1766. vc1dsp_select="h264chroma qpeldsp startcode"
  1767. # decoders / encoders
  1768. aac_decoder_select="adts_header imdct15 mdct sinewin"
  1769. aac_encoder_select="audio_frame_queue iirfilter mdct sinewin"
  1770. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  1771. ac3_decoder_select="ac3_parser ac3dsp bswapdsp fmtconvert mdct"
  1772. ac3_encoder_select="ac3dsp audiodsp mdct me_cmp"
  1773. ac3_fixed_encoder_select="ac3dsp audiodsp mdct me_cmp"
  1774. adpcm_g722_decoder_select="g722dsp"
  1775. adpcm_g722_encoder_select="g722dsp"
  1776. aic_decoder_select="golomb idctdsp"
  1777. alac_encoder_select="lpc"
  1778. als_decoder_select="bswapdsp"
  1779. amrnb_decoder_select="lsp"
  1780. amrwb_decoder_select="lsp"
  1781. amv_decoder_select="sp5x_decoder"
  1782. ape_decoder_select="bswapdsp"
  1783. asv1_decoder_select="blockdsp bswapdsp idctdsp"
  1784. asv1_encoder_select="bswapdsp fdctdsp pixblockdsp"
  1785. asv2_decoder_select="blockdsp bswapdsp idctdsp"
  1786. asv2_encoder_select="bswapdsp fdctdsp pixblockdsp"
  1787. atrac1_decoder_select="mdct sinewin"
  1788. atrac3_decoder_select="mdct"
  1789. atrac3p_decoder_select="mdct sinewin"
  1790. bink_decoder_select="blockdsp hpeldsp"
  1791. binkaudio_dct_decoder_select="mdct rdft dct sinewin wma_freqs"
  1792. binkaudio_rdft_decoder_select="mdct rdft sinewin wma_freqs"
  1793. cavs_decoder_select="blockdsp golomb h264chroma idctdsp qpeldsp videodsp"
  1794. clearvideo_decoder_select="idctdsp"
  1795. cllc_decoder_select="bswapdsp"
  1796. comfortnoise_encoder_select="lpc"
  1797. cook_decoder_select="audiodsp mdct sinewin"
  1798. cscd_decoder_select="lzo"
  1799. cscd_decoder_suggest="zlib"
  1800. dca_decoder_select="fmtconvert mdct"
  1801. dds_decoder_select="texturedsp"
  1802. dnxhd_decoder_select="blockdsp idctdsp"
  1803. dnxhd_encoder_select="aandcttables blockdsp fdctdsp idctdsp mpegvideoenc pixblockdsp"
  1804. dvvideo_decoder_select="dvprofile idctdsp"
  1805. dvvideo_encoder_select="dvprofile fdctdsp me_cmp pixblockdsp"
  1806. dxa_decoder_deps="zlib"
  1807. dxv_decoder_select="lzf texturedsp"
  1808. eac3_decoder_select="ac3_decoder"
  1809. eac3_encoder_select="ac3_encoder"
  1810. eamad_decoder_select="aandcttables blockdsp bswapdsp idctdsp mpegvideo"
  1811. eatgq_decoder_select="aandcttables idctdsp"
  1812. eatqi_decoder_select="aandcttables blockdsp bswapdsp idctdsp"
  1813. exr_decoder_deps="zlib"
  1814. ffv1_decoder_select="rangecoder"
  1815. ffv1_encoder_select="rangecoder"
  1816. ffvhuff_decoder_select="huffyuv_decoder"
  1817. ffvhuff_encoder_select="huffyuv_encoder"
  1818. fic_decoder_select="golomb"
  1819. flac_decoder_select="flacdsp"
  1820. flac_encoder_select="bswapdsp flacdsp lpc"
  1821. flashsv_decoder_deps="zlib"
  1822. flashsv_encoder_deps="zlib"
  1823. flashsv2_decoder_deps="zlib"
  1824. flv_decoder_select="h263_decoder"
  1825. flv_encoder_select="h263_encoder"
  1826. fourxm_decoder_select="blockdsp bswapdsp"
  1827. fraps_decoder_select="bswapdsp huffman"
  1828. g2m_decoder_deps="zlib"
  1829. g2m_decoder_select="blockdsp idctdsp jpegtables"
  1830. h261_decoder_select="mpeg_er mpegvideo"
  1831. h261_encoder_select="aandcttables mpegvideoenc"
  1832. h263_decoder_select="error_resilience h263_parser h263dsp mpeg_er mpegvideo qpeldsp"
  1833. h263_encoder_select="aandcttables h263dsp mpegvideoenc"
  1834. h263i_decoder_select="h263_decoder"
  1835. h263p_encoder_select="h263_encoder"
  1836. h264_decoder_select="cabac golomb h264chroma h264dsp h264parse h264pred h264qpel videodsp"
  1837. h264_decoder_suggest="error_resilience"
  1838. hap_decoder_select="snappy texturedsp"
  1839. hap_encoder_deps="libsnappy"
  1840. hap_encoder_select="texturedspenc"
  1841. hevc_decoder_select="bswapdsp cabac hevcparse videodsp"
  1842. huffyuv_decoder_select="bswapdsp huffyuvdsp"
  1843. huffyuv_encoder_select="bswapdsp huffman huffyuvencdsp"
  1844. iac_decoder_select="imc_decoder"
  1845. imc_decoder_select="bswapdsp fft mdct sinewin"
  1846. indeo3_decoder_select="hpeldsp"
  1847. indeo4_decoder_select="ividsp"
  1848. indeo5_decoder_select="ividsp"
  1849. interplay_video_decoder_select="hpeldsp"
  1850. jpegls_decoder_select="mjpeg_decoder"
  1851. jv_decoder_select="blockdsp"
  1852. lagarith_decoder_select="huffyuvdsp"
  1853. ljpeg_encoder_select="aandcttables idctdsp jpegtables"
  1854. magicyuv_decoder_select="huffyuvdsp"
  1855. mdec_decoder_select="blockdsp idctdsp mpegvideo"
  1856. metasound_decoder_select="lsp mdct sinewin"
  1857. mimic_decoder_select="blockdsp bswapdsp hpeldsp idctdsp"
  1858. mjpeg_decoder_select="blockdsp hpeldsp idctdsp jpegtables"
  1859. mjpeg_encoder_select="aandcttables jpegtables mpegvideoenc"
  1860. mjpegb_decoder_select="mjpeg_decoder"
  1861. mlp_decoder_select="mlp_parser"
  1862. motionpixels_decoder_select="bswapdsp"
  1863. mp1_decoder_select="mpegaudio"
  1864. mp1float_decoder_select="mpegaudio"
  1865. mp2_decoder_select="mpegaudio"
  1866. mp2float_decoder_select="mpegaudio"
  1867. mp3_decoder_select="mpegaudio"
  1868. mp3adu_decoder_select="mpegaudio"
  1869. mp3adufloat_decoder_select="mpegaudio"
  1870. mp3float_decoder_select="mpegaudio"
  1871. mp3on4_decoder_select="mpegaudio"
  1872. mp3on4float_decoder_select="mpegaudio"
  1873. mpc7_decoder_select="bswapdsp mpegaudiodsp"
  1874. mpc8_decoder_select="mpegaudiodsp"
  1875. mpeg1video_decoder_select="error_resilience mpeg_er mpegvideo"
  1876. mpeg1video_encoder_select="aandcttables mpegvideoenc"
  1877. mpeg2video_decoder_select="error_resilience mpeg_er mpegvideo"
  1878. mpeg2video_encoder_select="aandcttables mpegvideoenc"
  1879. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  1880. mpeg4_encoder_select="h263_encoder"
  1881. msa1_decoder_select="mss34dsp"
  1882. msmpeg4v1_decoder_select="h263_decoder"
  1883. msmpeg4v2_decoder_select="h263_decoder"
  1884. msmpeg4v2_encoder_select="h263_encoder"
  1885. msmpeg4v3_decoder_select="h263_decoder"
  1886. msmpeg4v3_encoder_select="h263_encoder"
  1887. mss2_decoder_select="error_resilience mpeg_er mpegvideo qpeldsp vc1_decoder"
  1888. mts2_decoder_select="mss34dsp"
  1889. mxpeg_decoder_select="mjpeg_decoder"
  1890. nellymoser_decoder_select="mdct sinewin"
  1891. nellymoser_encoder_select="audio_frame_queue mdct sinewin"
  1892. nuv_decoder_select="idctdsp lzo"
  1893. on2avc_decoder_select="mdct"
  1894. opus_decoder_deps="avresample"
  1895. opus_decoder_select="imdct15"
  1896. png_decoder_deps="zlib"
  1897. png_encoder_deps="zlib"
  1898. png_encoder_select="huffyuvencdsp"
  1899. prores_decoder_select="idctdsp"
  1900. prores_encoder_select="fdctdsp"
  1901. qcelp_decoder_select="lsp"
  1902. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  1903. ra_144_encoder_select="audio_frame_queue lpc"
  1904. ralf_decoder_select="golomb"
  1905. rscc_decoder_deps="zlib"
  1906. rv10_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
  1907. rv10_encoder_select="h263_encoder"
  1908. rv20_decoder_select="error_resilience h263_decoder h263dsp mpeg_er"
  1909. rv20_encoder_select="h263_encoder"
  1910. rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo rv34dsp videodsp"
  1911. rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpeg_er mpegvideo rv34dsp videodsp"
  1912. screenpresso_decoder_deps="zlib"
  1913. sipr_decoder_select="lsp"
  1914. sp5x_decoder_select="mjpeg_decoder"
  1915. svq1_decoder_select="hpeldsp"
  1916. svq1_encoder_select="aandcttables hpeldsp me_cmp mpegvideoenc"
  1917. svq3_decoder_select="golomb h264dsp h264parse h264pred hpeldsp tpeldsp videodsp"
  1918. svq3_decoder_suggest="zlib"
  1919. tak_decoder_select="audiodsp"
  1920. tdsc_decoder_deps="zlib"
  1921. tdsc_decoder_select="mjpeg_decoder"
  1922. theora_decoder_select="vp3_decoder"
  1923. thp_decoder_select="mjpeg_decoder"
  1924. tiff_decoder_suggest="zlib"
  1925. tiff_encoder_suggest="zlib"
  1926. truehd_decoder_select="mlp_decoder"
  1927. truemotion2_decoder_select="bswapdsp"
  1928. truespeech_decoder_select="bswapdsp"
  1929. tscc_decoder_deps="zlib"
  1930. txd_decoder_select="texturedsp"
  1931. twinvq_decoder_select="mdct lsp sinewin"
  1932. utvideo_decoder_select="bswapdsp huffyuvdsp"
  1933. utvideo_encoder_select="bswapdsp huffman huffyuvencdsp"
  1934. vble_decoder_select="huffyuvdsp"
  1935. vc1_decoder_select="blockdsp error_resilience h263_decoder h264qpel intrax8 mpeg_er mpegvideo vc1dsp"
  1936. vc1image_decoder_select="vc1_decoder"
  1937. vorbis_decoder_select="mdct"
  1938. vorbis_encoder_select="mdct"
  1939. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  1940. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp vp56dsp"
  1941. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp vp56dsp"
  1942. vp6a_decoder_select="vp6_decoder"
  1943. vp6f_decoder_select="vp6_decoder"
  1944. vp7_decoder_select="h264pred videodsp vp8dsp"
  1945. vp8_decoder_select="h264pred videodsp vp8dsp"
  1946. vp9_decoder_select="videodsp vp9_superframe_split_bsf"
  1947. webp_decoder_select="vp8_decoder"
  1948. wmapro_decoder_select="mdct sinewin wma_freqs"
  1949. wmav1_decoder_select="mdct sinewin wma_freqs"
  1950. wmav1_encoder_select="mdct sinewin wma_freqs"
  1951. wmav2_decoder_select="mdct sinewin wma_freqs"
  1952. wmav2_encoder_select="mdct sinewin wma_freqs"
  1953. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  1954. wmv1_decoder_select="h263_decoder"
  1955. wmv1_encoder_select="h263_encoder"
  1956. wmv2_decoder_select="blockdsp error_resilience h263_decoder idctdsp intrax8 videodsp wmv2dsp"
  1957. wmv2_encoder_select="h263_encoder wmv2dsp"
  1958. wmv3_decoder_select="vc1_decoder"
  1959. wmv3image_decoder_select="wmv3_decoder"
  1960. zerocodec_decoder_deps="zlib"
  1961. zlib_decoder_deps="zlib"
  1962. zlib_encoder_deps="zlib"
  1963. zmbv_decoder_deps="zlib"
  1964. zmbv_encoder_deps="zlib"
  1965. # hardware accelerators
  1966. d3d11va_deps="dxva_h ID3D11VideoDecoder"
  1967. dxva2_deps="dxva2api_h DXVA2_ConfigPictureDecode ole32"
  1968. vda_deps="VideoDecodeAcceleration_VDADecoder_h blocks_extension pthreads"
  1969. vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
  1970. h263_vaapi_hwaccel_deps="vaapi"
  1971. h263_vaapi_hwaccel_select="h263_decoder"
  1972. h264_cuvid_hwaccel_deps="cuvid CUVIDH264PICPARAMS"
  1973. h264_cuvid_hwaccel_select="h264_decoder"
  1974. h264_d3d11va_hwaccel_deps="d3d11va"
  1975. h264_d3d11va_hwaccel_select="h264_decoder"
  1976. h264_d3d11va2_hwaccel_deps="d3d11va"
  1977. h264_d3d11va2_hwaccel_select="h264_decoder"
  1978. h264_dxva2_hwaccel_deps="dxva2"
  1979. h264_dxva2_hwaccel_select="h264_decoder"
  1980. h264_mmal_hwaccel_deps="mmal"
  1981. h264_qsv_hwaccel_deps="libmfx"
  1982. h264_vaapi_hwaccel_deps="vaapi"
  1983. h264_vaapi_hwaccel_select="h264_decoder"
  1984. h264_vda_hwaccel_deps="vda"
  1985. h264_vda_hwaccel_select="h264_decoder"
  1986. h264_vda_old_hwaccel_deps="vda"
  1987. h264_vda_old_hwaccel_select="h264_decoder"
  1988. h264_vdpau_hwaccel_deps="vdpau"
  1989. h264_vdpau_hwaccel_select="h264_decoder"
  1990. hevc_cuvid_hwaccel_deps="cuvid CUVIDHEVCPICPARAMS"
  1991. hevc_cuvid_hwaccel_select="hevc_decoder"
  1992. hevc_d3d11va_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  1993. hevc_d3d11va_hwaccel_select="hevc_decoder"
  1994. hevc_d3d11va2_hwaccel_deps="d3d11va DXVA_PicParams_HEVC"
  1995. hevc_d3d11va2_hwaccel_select="hevc_decoder"
  1996. hevc_dxva2_hwaccel_deps="dxva2 DXVA_PicParams_HEVC"
  1997. hevc_dxva2_hwaccel_select="hevc_decoder"
  1998. hevc_qsv_hwaccel_deps="libmfx"
  1999. hevc_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferHEVC"
  2000. hevc_vaapi_hwaccel_select="hevc_decoder"
  2001. hevc_vdpau_hwaccel_deps="vdpau VdpPictureInfoHEVC"
  2002. hevc_vdpau_hwaccel_select="hevc_decoder"
  2003. mpeg1_vdpau_hwaccel_deps="vdpau"
  2004. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  2005. mpeg2_d3d11va_hwaccel_deps="d3d11va"
  2006. mpeg2_d3d11va_hwaccel_select="mpeg2video_decoder"
  2007. mpeg2_d3d11va2_hwaccel_deps="d3d11va"
  2008. mpeg2_d3d11va2_hwaccel_select="mpeg2video_decoder"
  2009. mpeg2_dxva2_hwaccel_deps="dxva2"
  2010. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  2011. mpeg2_mmal_hwaccel_deps="mmal"
  2012. mpeg2_qsv_hwaccel_deps="libmfx"
  2013. mpeg2_vaapi_hwaccel_deps="vaapi"
  2014. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  2015. mpeg2_vdpau_hwaccel_deps="vdpau"
  2016. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  2017. mpeg4_vaapi_hwaccel_deps="vaapi"
  2018. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  2019. mpeg4_vdpau_hwaccel_deps="vdpau"
  2020. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  2021. vc1_d3d11va_hwaccel_deps="d3d11va"
  2022. vc1_d3d11va_hwaccel_select="vc1_decoder"
  2023. vc1_d3d11va2_hwaccel_deps="d3d11va"
  2024. vc1_d3d11va2_hwaccel_select="vc1_decoder"
  2025. vc1_dxva2_hwaccel_deps="dxva2"
  2026. vc1_dxva2_hwaccel_select="vc1_decoder"
  2027. vc1_mmal_hwaccel_deps="mmal"
  2028. vc1_qsv_hwaccel_deps="libmfx"
  2029. vc1_vaapi_hwaccel_deps="vaapi"
  2030. vc1_vaapi_hwaccel_select="vc1_decoder"
  2031. vc1_vdpau_hwaccel_deps="vdpau"
  2032. vc1_vdpau_hwaccel_select="vc1_decoder"
  2033. vp8_qsv_hwaccel_deps="libmfx"
  2034. vp8_vaapi_hwaccel_deps="vaapi VAPictureParameterBufferVP8"
  2035. vp8_vaapi_hwaccel_select="vp8_decoder"
  2036. wmv3_d3d11va_hwaccel_select="vc1_d3d11va_hwaccel"
  2037. wmv3_d3d11va2_hwaccel_select="vc1_d3d11va2_hwaccel"
  2038. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  2039. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  2040. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  2041. # hardware-accelerated codecs
  2042. nvenc_deps_any="libdl LoadLibrary"
  2043. omx_deps="libdl pthreads"
  2044. omx_rpi_select="omx"
  2045. qsv_deps="libmfx"
  2046. qsvdec_select="qsv"
  2047. qsvenc_select="qsv"
  2048. qsvvpp_select="qsv"
  2049. vaapi_encode_deps="vaapi"
  2050. hwupload_cuda_filter_deps="cuda"
  2051. scale_npp_filter_deps="cuda libnpp"
  2052. h264_mmal_decoder_deps="mmal"
  2053. h264_nvenc_encoder_deps="nvenc"
  2054. h264_omx_encoder_deps="omx"
  2055. h264_qsv_decoder_select="h264_mp4toannexb_bsf h264_parser qsvdec h264_qsv_hwaccel"
  2056. h264_qsv_encoder_select="qsvenc"
  2057. h264_vaapi_encoder_deps="VAEncPictureParameterBufferH264"
  2058. h264_vaapi_encoder_select="cbs_h264 vaapi_encode"
  2059. hevc_nvenc_encoder_deps="nvenc"
  2060. hevc_qsv_decoder_select="hevc_mp4toannexb_bsf hevc_parser hevc_qsv_hwaccel qsvdec"
  2061. hevc_qsv_encoder_select="hevcparse qsvenc"
  2062. hevc_vaapi_encoder_deps="VAEncPictureParameterBufferHEVC"
  2063. hevc_vaapi_encoder_select="cbs_h265 vaapi_encode"
  2064. mjpeg_qsv_encoder_deps="libmfx"
  2065. mjpeg_qsv_encoder_select="qsvenc"
  2066. mjpeg_vaapi_encoder_deps="VAEncPictureParameterBufferJPEG"
  2067. mjpeg_vaapi_encoder_select="vaapi_encode jpegtables"
  2068. mpeg2_mmal_decoder_deps="mmal"
  2069. mpeg2_qsv_decoder_select="qsvdec mpeg2_qsv_hwaccel mpegvideo_parser"
  2070. mpeg2_qsv_encoder_select="qsvenc"
  2071. mpeg2_vaapi_encoder_deps="VAEncPictureParameterBufferMPEG2"
  2072. mpeg2_vaapi_encoder_select="cbs_mpeg2 vaapi_encode"
  2073. mpeg4_omx_encoder_deps="omx"
  2074. vc1_mmal_decoder_deps="mmal"
  2075. vc1_qsv_decoder_select="qsvdec vc1_qsv_hwaccel vc1_parser"
  2076. vp8_qsv_decoder_select="qsvdec vp8_qsv_hwaccel vp8_parser"
  2077. vp8_vaapi_encoder_deps="VAEncPictureParameterBufferVP8"
  2078. vp8_vaapi_encoder_select="vaapi_encode"
  2079. vp9_vaapi_encoder_deps="VAEncPictureParameterBufferVP9"
  2080. vp9_vaapi_encoder_select="vaapi_encode"
  2081. nvenc_h264_encoder_select="h264_nvenc_encoder"
  2082. nvenc_hevc_encoder_select="hevc_nvenc_encoder"
  2083. # parsers
  2084. aac_parser_select="adts_header"
  2085. h264_parser_select="golomb h264dsp h264parse"
  2086. hevc_parser_select="hevcparse"
  2087. mpegaudio_parser_select="mpegaudioheader"
  2088. mpegvideo_parser_select="mpegvideo"
  2089. mpeg4video_parser_select="error_resilience h263dsp mpegvideo qpeldsp"
  2090. vc1_parser_select="vc1dsp"
  2091. # bitstream_filters
  2092. aac_adtstoasc_bsf_select="adts_header"
  2093. h264_metadata_bsf_select="cbs_h264"
  2094. h264_redundant_pps_bsf_select="cbs_h264"
  2095. hevc_metadata_bsf_select="cbs_h265"
  2096. mjpeg2jpeg_bsf_select="jpegtables"
  2097. mpeg2_metadata_bsf_select="cbs_mpeg2"
  2098. trace_headers_bsf_select="cbs_h264 cbs_h265 cbs_mpeg2"
  2099. # external libraries
  2100. avisynth_deps="LoadLibrary"
  2101. avxsynth_deps="libdl"
  2102. avisynth_demuxer_deps_any="avisynth avxsynth"
  2103. avisynth_demuxer_select="riffdec"
  2104. libdcadec_decoder_deps="libdcadec"
  2105. libfaac_encoder_deps="libfaac"
  2106. libfaac_encoder_select="audio_frame_queue"
  2107. libfdk_aac_decoder_deps="libfdk_aac"
  2108. libfdk_aac_encoder_deps="libfdk_aac"
  2109. libfdk_aac_encoder_select="audio_frame_queue"
  2110. libgsm_decoder_deps="libgsm"
  2111. libgsm_encoder_deps="libgsm"
  2112. libgsm_ms_decoder_deps="libgsm"
  2113. libgsm_ms_encoder_deps="libgsm"
  2114. libilbc_decoder_deps="libilbc"
  2115. libilbc_encoder_deps="libilbc"
  2116. libkvazaar_encoder_deps="libkvazaar"
  2117. libmp3lame_encoder_deps="libmp3lame"
  2118. libmp3lame_encoder_select="audio_frame_queue mpegaudioheader"
  2119. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  2120. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  2121. libopencore_amrnb_encoder_select="audio_frame_queue"
  2122. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  2123. libopenh264_decoder_deps="libopenh264"
  2124. libopenh264_decoder_select="h264_mp4toannexb_bsf"
  2125. libopenh264_encoder_deps="libopenh264"
  2126. libopenjpeg_decoder_deps="libopenjpeg"
  2127. libopenjpeg_encoder_deps="libopenjpeg"
  2128. libopus_decoder_deps="libopus"
  2129. libopus_encoder_deps="libopus"
  2130. libopus_encoder_select="audio_frame_queue"
  2131. libschroedinger_decoder_deps="libschroedinger"
  2132. libschroedinger_encoder_deps="libschroedinger"
  2133. libspeex_decoder_deps="libspeex"
  2134. libspeex_encoder_deps="libspeex"
  2135. libspeex_encoder_select="audio_frame_queue"
  2136. libtheora_encoder_deps="libtheora"
  2137. libtwolame_encoder_deps="libtwolame"
  2138. libvo_aacenc_encoder_deps="libvo_aacenc"
  2139. libvo_aacenc_encoder_select="audio_frame_queue"
  2140. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  2141. libvorbis_encoder_deps="libvorbis"
  2142. libvorbis_encoder_select="audio_frame_queue"
  2143. libvpx_vp8_decoder_deps="libvpx"
  2144. libvpx_vp8_encoder_deps="libvpx"
  2145. libvpx_vp9_decoder_deps="libvpx"
  2146. libvpx_vp9_encoder_deps="libvpx"
  2147. libwavpack_encoder_deps="libwavpack"
  2148. libwavpack_encoder_select="audio_frame_queue"
  2149. libwebp_encoder_deps="libwebp"
  2150. libx262_encoder_deps="libx262"
  2151. libx264_encoder_deps="libx264"
  2152. libx265_encoder_deps="libx265"
  2153. libxavs_encoder_deps="libxavs"
  2154. libxvid_encoder_deps="libxvid mkstemp"
  2155. # demuxers / muxers
  2156. ac3_demuxer_select="ac3_parser"
  2157. asf_demuxer_select="riffdec"
  2158. asf_muxer_select="riffenc"
  2159. asf_stream_muxer_select="asf_muxer"
  2160. avi_demuxer_select="iso_media riffdec"
  2161. avi_muxer_select="riffenc"
  2162. caf_demuxer_select="iso_media riffdec"
  2163. dash_muxer_select="mp4_muxer"
  2164. dirac_demuxer_select="dirac_parser"
  2165. dv_demuxer_select="dvprofile"
  2166. dv_muxer_select="dvprofile"
  2167. dxa_demuxer_select="riffdec"
  2168. eac3_demuxer_select="ac3_parser"
  2169. f4v_muxer_select="mov_muxer"
  2170. flac_demuxer_select="flac_parser"
  2171. hds_muxer_select="flv_muxer"
  2172. hls_muxer_select="mpegts_muxer"
  2173. ipod_muxer_select="mov_muxer"
  2174. ismv_muxer_select="mov_muxer"
  2175. matroska_audio_muxer_select="matroska_muxer"
  2176. matroska_demuxer_select="iso_media riffdec"
  2177. matroska_demuxer_suggest="bzlib lzo zlib"
  2178. matroska_muxer_select="iso_media riffenc"
  2179. mmf_muxer_select="riffenc"
  2180. mov_demuxer_select="iso_media riffdec"
  2181. mov_demuxer_suggest="zlib"
  2182. mov_muxer_select="iso_media riffenc rtpenc_chain"
  2183. mp3_demuxer_select="mpegaudio_parser"
  2184. mp3_muxer_select="mpegaudioheader"
  2185. mp4_muxer_select="mov_muxer"
  2186. mpegts_demuxer_select="iso_media"
  2187. mpegts_muxer_select="adts_muxer latm_muxer"
  2188. mpegtsraw_demuxer_select="mpegts_demuxer"
  2189. mxf_d10_muxer_select="mxf_muxer"
  2190. nut_muxer_select="riffenc"
  2191. nuv_demuxer_select="riffdec"
  2192. oga_muxer_select="ogg_muxer"
  2193. ogg_demuxer_select="dirac_parse"
  2194. opus_muxer_select="ogg_muxer"
  2195. psp_muxer_select="mov_muxer"
  2196. rtp_demuxer_select="sdp_demuxer"
  2197. rtpdec_select="asf_demuxer jpegtables mov_demuxer mpegts_demuxer rm_demuxer rtp_protocol srtp"
  2198. rtsp_demuxer_select="http_protocol rtpdec"
  2199. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  2200. sap_demuxer_select="sdp_demuxer"
  2201. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  2202. sdp_demuxer_select="rtpdec"
  2203. smoothstreaming_muxer_select="ismv_muxer"
  2204. spdif_demuxer_select="adts_header"
  2205. spdif_muxer_select="adts_header"
  2206. spx_muxer_select="ogg_muxer"
  2207. swf_demuxer_suggest="zlib"
  2208. tak_demuxer_select="tak_parser"
  2209. tg2_muxer_select="mov_muxer"
  2210. tgp_muxer_select="mov_muxer"
  2211. w64_demuxer_select="wav_demuxer"
  2212. wav_demuxer_select="riffdec"
  2213. wav_muxer_select="riffenc"
  2214. webm_muxer_select="iso_media riffenc"
  2215. wtv_demuxer_select="mpegts_demuxer riffdec"
  2216. xmv_demuxer_select="riffdec"
  2217. xwma_demuxer_select="riffdec"
  2218. # indevs
  2219. alsa_indev_deps="alsa"
  2220. avfoundation_indev_deps="AVFoundation_AVFoundation_h objc_arc pthreads"
  2221. avfoundation_indev_extralibs="-framework Foundation -framework AVFoundation -framework CoreVideo -framework CoreMedia"
  2222. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  2223. fbdev_indev_deps="linux_fb_h"
  2224. jack_indev_deps="libjack"
  2225. jack_indev_deps_any="sem_timedwait dispatch_dispatch_h"
  2226. libcdio_indev_deps="libcdio"
  2227. libdc1394_indev_deps="libdc1394"
  2228. oss_indev_deps_any="sys_soundcard_h"
  2229. pulse_indev_deps="libpulse"
  2230. sndio_indev_deps="sndio"
  2231. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  2232. vfwcap_indev_deps="vfw32 vfwcap_defines"
  2233. xcbgrab_indev_deps="libxcb libxcb_shape"
  2234. xcbgrab_indev_suggest="libxcb_shm libxcb_xfixes"
  2235. # protocols
  2236. ffrtmpcrypt_protocol_conflict="librtmp_protocol"
  2237. ffrtmpcrypt_protocol_deps_any="gmp openssl"
  2238. ffrtmpcrypt_protocol_select="tcp_protocol"
  2239. ffrtmphttp_protocol_conflict="librtmp_protocol"
  2240. ffrtmphttp_protocol_select="http_protocol"
  2241. gopher_protocol_select="network"
  2242. http_protocol_select="tcp_protocol"
  2243. http_protocol_suggest="zlib"
  2244. httpproxy_protocol_select="tcp_protocol"
  2245. httpproxy_protocol_suggest="zlib"
  2246. https_protocol_select="tls_protocol"
  2247. https_protocol_suggest="zlib"
  2248. icecast_protocol_select="http_protocol"
  2249. librtmp_protocol_deps="librtmp"
  2250. librtmpe_protocol_deps="librtmp"
  2251. librtmps_protocol_deps="librtmp"
  2252. librtmpt_protocol_deps="librtmp"
  2253. librtmpte_protocol_deps="librtmp"
  2254. mmsh_protocol_select="http_protocol"
  2255. mmst_protocol_select="network"
  2256. rtmp_protocol_conflict="librtmp_protocol"
  2257. rtmp_protocol_select="tcp_protocol"
  2258. rtmp_protocol_suggest="zlib"
  2259. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  2260. rtmpe_protocol_suggest="zlib"
  2261. rtmps_protocol_conflict="librtmp_protocol"
  2262. rtmps_protocol_select="tls_protocol"
  2263. rtmps_protocol_suggest="zlib"
  2264. rtmpt_protocol_select="ffrtmphttp_protocol"
  2265. rtmpt_protocol_suggest="zlib"
  2266. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  2267. rtmpte_protocol_suggest="zlib"
  2268. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  2269. rtmpts_protocol_suggest="zlib"
  2270. rtp_protocol_select="udp_protocol"
  2271. sctp_protocol_deps="struct_sctp_event_subscribe"
  2272. sctp_protocol_select="network"
  2273. srtp_protocol_select="rtp_protocol srtp"
  2274. tcp_protocol_select="network"
  2275. tls_protocol_deps_any="gnutls openssl"
  2276. tls_protocol_select="tcp_protocol"
  2277. udp_protocol_select="network"
  2278. unix_protocol_deps="sys_un_h"
  2279. unix_protocol_select="network"
  2280. # filters
  2281. asyncts_filter_deps="avresample"
  2282. blackframe_filter_deps="gpl"
  2283. boxblur_filter_deps="gpl"
  2284. bs2b_filter_deps="libbs2b"
  2285. cropdetect_filter_deps="gpl"
  2286. deinterlace_qsv_filter_deps="libmfx"
  2287. deinterlace_vaapi_filter_deps="vaapi"
  2288. delogo_filter_deps="gpl"
  2289. drawtext_filter_deps="libfreetype"
  2290. drawtext_filter_suggest="libfontconfig"
  2291. frei0r_filter_deps="frei0r libdl"
  2292. frei0r_src_filter_deps="frei0r libdl"
  2293. hdcd_filter_deps="libhdcd"
  2294. hqdn3d_filter_deps="gpl"
  2295. interlace_filter_deps="gpl"
  2296. movie_filter_deps="avcodec avformat"
  2297. ocv_filter_deps="libopencv"
  2298. overlay_qsv_filter_deps="libmfx"
  2299. overlay_qsv_filter_select="qsvvpp"
  2300. resample_filter_deps="avresample"
  2301. scale_filter_deps="swscale"
  2302. scale_qsv_filter_deps="libmfx"
  2303. scale_vaapi_filter_deps="vaapi VAProcPipelineParameterBuffer"
  2304. vpp_qsv_filter_deps="libmfx"
  2305. vpp_qsv_filter_select="qsvvpp"
  2306. # examples
  2307. decode_audio_example_deps="avcodec avutil"
  2308. decode_video_example_deps="avcodec avutil"
  2309. encode_audio_example_deps="avcodec avutil"
  2310. encode_video_example_deps="avcodec avutil"
  2311. filter_audio_example_deps="avfilter avutil"
  2312. metadata_example_deps="avformat avutil"
  2313. output_example_deps="avcodec avformat avresample avutil swscale"
  2314. qsvdec_example_deps="avcodec avutil libmfx h264_qsv_decoder"
  2315. transcode_aac_example_deps="avcodec avformat avresample"
  2316. # EXTRALIBS_LIST
  2317. cpu_init_extralibs="pthreads_extralibs"
  2318. cws2fws_extralibs="zlib_extralibs"
  2319. # libraries, in linking order
  2320. avcodec_deps="avutil"
  2321. avcodec_select="null_bsf"
  2322. avdevice_deps="avformat avcodec avutil"
  2323. avfilter_deps="avutil"
  2324. avformat_deps="avcodec avutil"
  2325. avformat_suggest="network"
  2326. avresample_deps="avutil"
  2327. swscale_deps="avutil"
  2328. avcodec_extralibs="pthreads_extralibs libm_extralibs"
  2329. avdevice_extralibs="libm_extralibs"
  2330. avformat_extralibs="libm_extralibs"
  2331. avfilter_extralibs="pthreads_extralibs libm_extralibs"
  2332. avresample_extralibs="libm_extralibs"
  2333. avutil_extralibs="clock_gettime_extralibs cuda_extralibs cuvid_extralibs d3d11va_extralibs libm_extralibs libmfx_extralibs nanosleep_extralibs pthreads_extralibs user32_extralibs vaapi_extralibs vaapi_drm_extralibs vaapi_x11_extralibs vdpau_x11_extralibs wincrypt_extralibs"
  2334. swscale_extralibs="libm_extralibs"
  2335. # programs
  2336. avconv_deps="avcodec avfilter avformat avresample swscale"
  2337. avconv_select="aformat_filter anull_filter asyncts_filter atrim_filter format_filter
  2338. fps_filter null_filter resample_filter scale_filter
  2339. trim_filter"
  2340. avconv_suggest="psapi shell32"
  2341. avplay_deps="avcodec avfilter avformat avresample sdl"
  2342. avplay_select="rdft format_filter transpose_filter hflip_filter vflip_filter"
  2343. avplay_suggest="shell32"
  2344. avprobe_deps="avcodec avformat"
  2345. avprobe_suggest="shell32"
  2346. # documentation
  2347. pod2man_deps="doc"
  2348. texi2html_deps="doc"
  2349. # default parameters
  2350. logfile="avbuild/config.log"
  2351. # installation paths
  2352. prefix_default="/usr/local"
  2353. bindir_default='${prefix}/bin'
  2354. datadir_default='${prefix}/share/avconv'
  2355. docdir_default='${prefix}/share/doc/libav'
  2356. incdir_default='${prefix}/include'
  2357. libdir_default='${prefix}/lib'
  2358. mandir_default='${prefix}/share/man'
  2359. shlibdir_default="$libdir_default"
  2360. # toolchain
  2361. ar_default="ar"
  2362. cc_default="gcc"
  2363. host_cc_default="gcc"
  2364. x86asmexe_default="nasm"
  2365. ln_s="ln -s -f"
  2366. nm_default="nm -g"
  2367. pkg_config_default=pkg-config
  2368. ranlib="ranlib"
  2369. strip="strip"
  2370. version_script='--version-script'
  2371. # machine
  2372. arch_default=$(uname -m)
  2373. cpu="generic"
  2374. intrinsics="none"
  2375. # OS
  2376. target_os_default=$(tolower $(uname -s))
  2377. host_os=$target_os_default
  2378. # configurable options
  2379. enable $EXAMPLE_LIST $LIBRARY_LIST $PROGRAM_LIST
  2380. enable asm
  2381. enable debug
  2382. enable doc
  2383. enable faan faandct faanidct
  2384. enable optimizations
  2385. enable safe_bitstream_reader
  2386. enable static
  2387. enable swscale_alpha
  2388. enable valgrind_backtrace
  2389. # By default, enable only those hwaccels that have no external dependencies.
  2390. enable d3d11va dxva2 vda vdpau
  2391. # internal components are enabled by default
  2392. enable $EXTRALIBS_LIST
  2393. # Avoid external, non-system, libraries getting enabled by dependency resolution
  2394. disable $EXTERNAL_LIBRARY_LIST
  2395. # build settings
  2396. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  2397. LIBPREF="lib"
  2398. LIBSUF=".a"
  2399. LIBNAME='$(LIBPREF)$(NAME)$(LIBSUF)'
  2400. SLIBPREF="lib"
  2401. SLIBSUF=".so"
  2402. SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
  2403. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  2404. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  2405. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  2406. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  2407. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  2408. VERSION_SCRIPT_POSTPROCESS_CMD="cat"
  2409. asflags_filter=echo
  2410. cflags_filter=echo
  2411. ldflags_filter=echo
  2412. AS_C='-c'
  2413. AS_O='-o $@'
  2414. CC_C='-c'
  2415. CC_E='-E -o $@'
  2416. CC_O='-o $@'
  2417. OBJCC_C='-c'
  2418. OBJCC_E='-E -o $@'
  2419. OBJCC_O='-o $@'
  2420. X86ASM_O='-o $@'
  2421. LD_O='-o $@'
  2422. LD_LIB='-l%'
  2423. LD_PATH='-L'
  2424. HOSTCC_C='-c'
  2425. HOSTCC_E='-E -o $@'
  2426. HOSTCC_O='-o $@'
  2427. HOSTLD_O='-o $@'
  2428. host_extralibs='-lm'
  2429. host_cflags_filter=echo
  2430. host_ldflags_filter=echo
  2431. target_path='$(CURDIR)'
  2432. # since the object filename is not given with the -MM flag, the compiler
  2433. # is only able to print the basename, and we must add the path ourselves
  2434. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  2435. DEPFLAGS='-MM'
  2436. mkdir -p avbuild
  2437. # find source path
  2438. if test -f configure; then
  2439. source_path=.
  2440. else
  2441. source_path=$(cd $(dirname "$0"); pwd)
  2442. echo "$source_path" | grep -q '[[:blank:]]' &&
  2443. die "Out of tree builds are impossible with whitespace in source path."
  2444. test -e "$source_path/config.h" &&
  2445. die "Out of tree builds are impossible with config.h in source dir."
  2446. fi
  2447. for v in "$@"; do
  2448. r=${v#*=}
  2449. l=${v%"$r"}
  2450. r=$(sh_quote "$r")
  2451. LIBAV_CONFIGURATION="${LIBAV_CONFIGURATION# } ${l}${r}"
  2452. done
  2453. find_things(){
  2454. thing=$1
  2455. pattern=$2
  2456. file=$source_path/$3
  2457. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  2458. }
  2459. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  2460. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  2461. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  2462. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  2463. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  2464. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  2465. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  2466. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  2467. find_things_extern(){
  2468. thing=$1
  2469. pattern=$2
  2470. file=$source_path/$3
  2471. sed -n "s/^[^#]*extern.*$pattern *ff_\([^ ]*\)_$thing;/\1_$thing/p" "$file"
  2472. }
  2473. BSF_LIST=$(find_things_extern bsf AVBitStreamFilter libavcodec/bitstream_filters.c)
  2474. PROTOCOL_LIST=$(find_things_extern protocol URLProtocol libavformat/protocols.c)
  2475. AVCODEC_COMPONENTS_LIST="
  2476. $BSF_LIST
  2477. $DECODER_LIST
  2478. $ENCODER_LIST
  2479. $HWACCEL_LIST
  2480. $PARSER_LIST
  2481. "
  2482. AVDEVICE_COMPONENTS_LIST="
  2483. $INDEV_LIST
  2484. "
  2485. AVFILTER_COMPONENTS_LIST="
  2486. $FILTER_LIST
  2487. "
  2488. AVFORMAT_COMPONENTS_LIST="
  2489. $DEMUXER_LIST
  2490. $MUXER_LIST
  2491. $PROTOCOL_LIST
  2492. "
  2493. ALL_COMPONENTS="
  2494. $AVCODEC_COMPONENTS_LIST
  2495. $AVDEVICE_COMPONENTS_LIST
  2496. $AVFILTER_COMPONENTS_LIST
  2497. $AVFORMAT_COMPONENTS_LIST
  2498. "
  2499. for n in $COMPONENT_LIST; do
  2500. v=$(toupper ${n%s})_LIST
  2501. eval enable \$$v
  2502. eval ${n}_if_any="\$$v"
  2503. done
  2504. enable $ARCH_EXT_LIST
  2505. die_unknown(){
  2506. echo "Unknown option \"$1\"."
  2507. echo "See $0 --help for available options."
  2508. exit 1
  2509. }
  2510. print_3_columns() {
  2511. printf "%-25s %-25s %-25s\n" $(cat | tr ' ' '\n' | sort)
  2512. }
  2513. show_list() {
  2514. suffix=_$1
  2515. shift
  2516. echo $* | sed s/$suffix//g | print_3_columns
  2517. exit 0
  2518. }
  2519. for opt do
  2520. optval="${opt#*=}"
  2521. case "$opt" in
  2522. --extra-ldflags=*)
  2523. add_ldflags $optval
  2524. ;;
  2525. --extra-ldexeflags=*)
  2526. add_ldexeflags $optval
  2527. ;;
  2528. --extra-ldsoflags=*)
  2529. add_ldsoflags $optval
  2530. ;;
  2531. --extra-libs=*)
  2532. add_extralibs $optval
  2533. ;;
  2534. --disable-devices)
  2535. disable $INDEV_LIST
  2536. ;;
  2537. --enable-debug=*)
  2538. debuglevel="$optval"
  2539. ;;
  2540. --disable-programs)
  2541. disable $PROGRAM_LIST
  2542. ;;
  2543. --disable-everything)
  2544. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2545. ;;
  2546. --disable-all)
  2547. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2548. disable $LIBRARY_LIST $PROGRAM_LIST doc
  2549. ;;
  2550. --enable-*=*|--disable-*=*)
  2551. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  2552. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  2553. eval list=\$$(toupper $thing)_LIST
  2554. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  2555. $action $(filter "$name" $list)
  2556. ;;
  2557. --enable-yasm|--disable-yasm)
  2558. warn "The ${opt} option is only provided for compatibility and will be\n"\
  2559. "removed in the future. Use --enable-x86asm / --disable-x86asm instead."
  2560. test $opt = --enable-yasm && x86asm=yes || x86asm=no
  2561. ;;
  2562. --enable-?*|--disable-?*)
  2563. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  2564. if is_in $option $COMPONENT_LIST; then
  2565. test $action = disable && action=unset
  2566. eval $action \$$(toupper ${option%s})_LIST
  2567. elif is_in $option $CMDLINE_SELECT; then
  2568. $action $option
  2569. else
  2570. die_unknown $opt
  2571. fi
  2572. ;;
  2573. --list-*)
  2574. NAME="${opt#--list-}"
  2575. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  2576. NAME=${NAME%s}
  2577. eval show_list $NAME \$$(toupper $NAME)_LIST
  2578. ;;
  2579. --help|-h) show_help
  2580. ;;
  2581. --quiet|-q) quiet=yes
  2582. ;;
  2583. *)
  2584. optname="${opt%%=*}"
  2585. optname="${optname#--}"
  2586. optname=$(echo "$optname" | sed 's/-/_/g')
  2587. if is_in $optname $CMDLINE_SET; then
  2588. eval $optname='$optval'
  2589. elif is_in $optname $CMDLINE_APPEND; then
  2590. append $optname "$optval"
  2591. else
  2592. die_unknown $opt
  2593. fi
  2594. ;;
  2595. esac
  2596. done
  2597. for e in $env; do
  2598. eval "export $e"
  2599. done
  2600. disabled logging && logfile=/dev/null
  2601. # we need to build at least one lib type
  2602. if ! enabled_any static shared; then
  2603. cat <<EOF
  2604. At least one library type must be built.
  2605. Specify --enable-static to build the static libraries or --enable-shared to
  2606. build the shared libraries as well. To only build the shared libraries specify
  2607. --disable-static in addition to --enable-shared.
  2608. EOF
  2609. exit 1
  2610. fi
  2611. # Die early if licensing-related configure options are incompatible.
  2612. die_license_disabled() {
  2613. enabled $1 || { enabled $v && die "$v is $1 and --enable-$1 is not specified."; }
  2614. }
  2615. map "die_license_disabled gpl" $EXTERNAL_LIBRARY_GPL_LIST
  2616. map "die_license_disabled nonfree" $EXTERNAL_LIBRARY_NONFREE_LIST $HWACCEL_LIBRARY_NONFREE_LIST
  2617. map "die_license_disabled version3" $EXTERNAL_LIBRARY_VERSION3_LIST
  2618. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  2619. enabled_all gnutls openssl &&
  2620. die "GnuTLS and OpenSSL must not be enabled at the same time."
  2621. # Disable all the library-specific components if the library itself
  2622. # is disabled, see AVCODEC_LIST and following _LIST variables.
  2623. disable_components(){
  2624. disabled ${1} && disable $(
  2625. eval components="\$$(toupper ${1})_COMPONENTS"
  2626. map 'eval echo \${$(toupper ${v%s})_LIST}' $components
  2627. )
  2628. }
  2629. map 'disable_components $v' $LIBRARY_LIST
  2630. echo "# $0 $LIBAV_CONFIGURATION" > $logfile
  2631. set >> $logfile
  2632. case "$toolchain" in
  2633. *-asan)
  2634. cc_default="${toolchain%-asan}"
  2635. add_cflags -fsanitize=address
  2636. add_ldflags -fsanitize=address
  2637. ;;
  2638. *-msan)
  2639. cc_default="${toolchain%-msan}"
  2640. add_cflags -fsanitize=memory -fsanitize-memory-track-origins
  2641. add_ldflags -fsanitize=memory
  2642. ;;
  2643. *-tsan)
  2644. cc_default="${toolchain%-tsan}"
  2645. add_cflags -fsanitize=thread -fPIE
  2646. add_ldflags -fsanitize=thread -pie
  2647. case "$toolchain" in
  2648. gcc-tsan)
  2649. add_cflags -fPIC
  2650. add_ldflags -fPIC
  2651. ;;
  2652. esac
  2653. ;;
  2654. *-usan)
  2655. cc_default="${toolchain%-usan}"
  2656. add_cflags -fsanitize=undefined
  2657. add_ldflags -fsanitize=undefined
  2658. case "$toolchain" in
  2659. clang-usan)
  2660. add_cflags -O1
  2661. ;;
  2662. esac
  2663. ;;
  2664. valgrind-*)
  2665. target_exec_default="valgrind"
  2666. case "$toolchain" in
  2667. valgrind-massif)
  2668. target_exec_args="--alloc-fn=av_malloc --alloc-fn=av_mallocz"
  2669. ;;
  2670. valgrind-memcheck)
  2671. target_exec_args="--track-origins=yes --leak-check=full"
  2672. ;;
  2673. esac
  2674. ;;
  2675. msvc)
  2676. # Check whether the current MSVC version needs the C99 converter.
  2677. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  2678. # support enough of C99 to build libav. Default to the new
  2679. # behaviour if the regexp was unable to match anything, since this
  2680. # successfully parses the version number of existing supported
  2681. # versions that require the converter (MSVC 2010 and 2012).
  2682. cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  2683. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  2684. cc_default="cl"
  2685. else
  2686. cc_default="c99wrap cl"
  2687. fi
  2688. ld_default="$source_path/compat/windows/mslink"
  2689. nm_default="dumpbin -symbols"
  2690. ar_default="lib"
  2691. case "$arch" in
  2692. aarch64|arm64)
  2693. as_default="armasm64"
  2694. ;;
  2695. arm*)
  2696. as_default="armasm"
  2697. ;;
  2698. esac
  2699. target_os_default="win32"
  2700. # Use a relative path for TMPDIR. This makes sure all the
  2701. # ffconf temp files are written with a relative path, avoiding
  2702. # issues with msys/win32 path conversion for MSVC parameters
  2703. # such as -Fo<file> or -out:<file>.
  2704. TMPDIR=.
  2705. ;;
  2706. icl)
  2707. cc_default="icl"
  2708. ld_default="xilink"
  2709. nm_default="dumpbin -symbols"
  2710. ar_default="xilib"
  2711. target_os_default="win32"
  2712. TMPDIR=.
  2713. ;;
  2714. gcov)
  2715. add_cflags -fprofile-arcs -ftest-coverage
  2716. add_ldflags -fprofile-arcs -ftest-coverage
  2717. ;;
  2718. llvm-cov)
  2719. add_cflags -fprofile-arcs -ftest-coverage
  2720. add_ldflags --coverage
  2721. ;;
  2722. hardened)
  2723. add_cppflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2
  2724. add_cflags -fno-strict-overflow -fstack-protector-all
  2725. add_ldflags -Wl,-z,relro -Wl,-z,now
  2726. ;;
  2727. ?*)
  2728. die "Unknown toolchain $toolchain"
  2729. ;;
  2730. esac
  2731. test -n "$cross_prefix" && enable cross_compile
  2732. if enabled cross_compile; then
  2733. test -n "$arch" && test -n "$target_os" ||
  2734. die "Must specify target arch (--arch) and OS (--target-os) when cross-compiling"
  2735. fi
  2736. ar_default="${cross_prefix}${ar_default}"
  2737. cc_default="${cross_prefix}${cc_default}"
  2738. objcc_default="${cross_prefix}${objcc_default}"
  2739. x86asmexe_default="${cross_prefix}${x86asmexe_default}"
  2740. nm_default="${cross_prefix}${nm_default}"
  2741. pkg_config_default="${cross_prefix}${pkg_config_default}"
  2742. ranlib="${cross_prefix}${ranlib}"
  2743. strip="${cross_prefix}${strip}"
  2744. sysinclude_default="${sysroot}/usr/include"
  2745. set_default arch cc pkg_config sysinclude target_exec target_os x86asmexe
  2746. enabled cross_compile || host_cc_default=$cc
  2747. set_default host_cc
  2748. if ! $pkg_config --version >/dev/null 2>&1; then
  2749. warn "$pkg_config not found, library detection may fail."
  2750. pkg_config=false
  2751. fi
  2752. exesuf() {
  2753. case $1 in
  2754. mingw32*|mingw64*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  2755. esac
  2756. }
  2757. EXESUF=$(exesuf $target_os)
  2758. HOSTEXESUF=$(exesuf $host_os)
  2759. # set temporary file name
  2760. : ${TMPDIR:=$TEMPDIR}
  2761. : ${TMPDIR:=$TMP}
  2762. : ${TMPDIR:=/tmp}
  2763. if ! check_cmd mktemp -u XXXXXX; then
  2764. # simple replacement for missing mktemp
  2765. # NOT SAFE FOR GENERAL USE
  2766. mktemp(){
  2767. tmpname="${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  2768. echo "$tmpname"
  2769. mkdir "$tmpname"
  2770. }
  2771. fi
  2772. AVTMPDIR=$(mktemp -d "${TMPDIR}/avconf.XXXXXXXX" 2> /dev/null) ||
  2773. die "Unable to create temporary directory in $TMPDIR."
  2774. tmpfile(){
  2775. tmp="${AVTMPDIR}/test"$2
  2776. (set -C; exec > $tmp) 2> /dev/null ||
  2777. die "Unable to create temporary file in $AVTMPDIR."
  2778. eval $1=$tmp
  2779. }
  2780. trap 'rm -rf -- "$AVTMPDIR"' EXIT
  2781. trap 'exit 2' INT
  2782. tmpfile TMPASM .asm
  2783. tmpfile TMPC .c
  2784. tmpfile TMPE $EXESUF
  2785. tmpfile TMPH .h
  2786. tmpfile TMPO .o
  2787. tmpfile TMPS .S
  2788. tmpfile TMPSH .sh
  2789. tmpfile TMPV .ver
  2790. unset -f mktemp
  2791. chmod +x $TMPE
  2792. # make sure we can execute files in $TMPDIR
  2793. cat > $TMPSH 2>> $logfile <<EOF
  2794. #! /bin/sh
  2795. EOF
  2796. chmod +x $TMPSH >> $logfile 2>&1
  2797. if ! $TMPSH >> $logfile 2>&1; then
  2798. cat <<EOF
  2799. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2800. variable to another directory and make sure that it is not mounted noexec.
  2801. EOF
  2802. die "Sanity test failed."
  2803. fi
  2804. armasm_flags(){
  2805. for flag; do
  2806. case $flag in
  2807. # Filter out MSVC cl.exe options from cflags that shouldn't
  2808. # be passed to gas-preprocessor
  2809. -M[TD]*) ;;
  2810. *) echo $flag ;;
  2811. esac
  2812. done
  2813. }
  2814. cparser_flags(){
  2815. for flag; do
  2816. case $flag in
  2817. -Wno-switch) echo -Wno-switch-enum ;;
  2818. -Wno-format-zero-length) ;;
  2819. -Wdisabled-optimization) ;;
  2820. -Wno-pointer-sign) echo -Wno-other ;;
  2821. *) echo $flag ;;
  2822. esac
  2823. done
  2824. }
  2825. msvc_common_flags(){
  2826. for flag; do
  2827. case $flag in
  2828. # In addition to specifying certain flags under the compiler
  2829. # specific filters, they must be specified here as well or else the
  2830. # generic catch all at the bottom will print the original flag.
  2831. -Wall) ;;
  2832. -Wextra) ;;
  2833. -std=c99) ;;
  2834. # Common flags
  2835. -fomit-frame-pointer) ;;
  2836. -g) echo -Z7 ;;
  2837. -fno-math-errno) ;;
  2838. -fno-common) ;;
  2839. -fno-signed-zeros) ;;
  2840. -fPIC) ;;
  2841. -mthumb) ;;
  2842. -march=*) ;;
  2843. -lz) echo zlib.lib ;;
  2844. -lx264) echo libx264.lib ;;
  2845. -l*) echo ${flag#-l}.lib ;;
  2846. -L*) echo -libpath:${flag#-L} ;;
  2847. *) echo $flag ;;
  2848. esac
  2849. done
  2850. }
  2851. msvc_flags(){
  2852. msvc_common_flags "$@"
  2853. for flag; do
  2854. case $flag in
  2855. -Wall) echo -W3 -wd4018 -wd4146 -wd4244 -wd4305 \
  2856. -wd4554 ;;
  2857. -Wextra) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  2858. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  2859. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  2860. -wd4273 -wd4554 -wd4701 -wd4703 ;;
  2861. esac
  2862. done
  2863. }
  2864. icl_flags(){
  2865. msvc_common_flags "$@"
  2866. for flag; do
  2867. case $flag in
  2868. # Despite what Intel's documentation says -Wall, which is supported
  2869. # on Windows, does enable remarks so disable them here.
  2870. -Wall) echo $flag -Qdiag-disable:remark ;;
  2871. -std=c99) echo -Qstd=c99 ;;
  2872. esac
  2873. done
  2874. }
  2875. suncc_flags(){
  2876. for flag; do
  2877. case $flag in
  2878. -march=*|-mcpu=*)
  2879. case "${flag#*=}" in
  2880. native) echo -xtarget=native ;;
  2881. v9|niagara) echo -xarch=sparc ;;
  2882. ultrasparc) echo -xarch=sparcvis ;;
  2883. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  2884. i586|pentium) echo -xchip=pentium ;;
  2885. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  2886. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  2887. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  2888. pentium4*) echo -xtarget=pentium4 ;;
  2889. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  2890. *-sse3) echo -xarch=sse3 ;;
  2891. core2) echo -xarch=ssse3 -xchip=core2 ;;
  2892. corei7) echo -xarch=sse4_2 -xchip=nehalem ;;
  2893. corei7-avx) echo -xarch=avx -xchip=sandybridge ;;
  2894. amdfam10|barcelona|bdver*) echo -xarch=sse4_1 ;;
  2895. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  2896. k8|opteron|athlon64|athlon-fx)
  2897. echo -xarch=sse2a ;;
  2898. athlon*) echo -xarch=pentium_proa ;;
  2899. esac
  2900. ;;
  2901. -std=c99) echo -xc99 ;;
  2902. -fomit-frame-pointer) echo -xregs=frameptr ;;
  2903. -fPIC) echo -KPIC -xcode=pic32 ;;
  2904. -W*,*) echo $flag ;;
  2905. -f*-*|-W*|-mimpure-text) ;;
  2906. -shared) echo -G ;;
  2907. *) echo $flag ;;
  2908. esac
  2909. done
  2910. }
  2911. probe_cc(){
  2912. pfx=$1
  2913. _cc=$2
  2914. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  2915. unset _ld_o _ldflags _ld_lib _ld_path
  2916. unset _depflags _DEPCMD _DEPFLAGS
  2917. _flags_filter=echo
  2918. if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  2919. _type=llvm_gcc
  2920. gcc_extra_ver=$(expr "$($_cc --version 2>/dev/null | head -n1)" : '.*\((.*)\)')
  2921. _ident="llvm-gcc $($_cc -dumpversion 2>/dev/null) $gcc_extra_ver"
  2922. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2923. _cflags_speed='-O3'
  2924. _cflags_size='-Os'
  2925. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  2926. _type=gcc
  2927. gcc_version=$($_cc --version | head -n1)
  2928. gcc_basever=$($_cc -dumpversion)
  2929. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  2930. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  2931. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  2932. if ! $_cc -dumpversion | grep -q '^2\.'; then
  2933. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2934. fi
  2935. _cflags_speed='-O3'
  2936. _cflags_size='-Os'
  2937. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  2938. _type=icc
  2939. _ident=$($_cc --version | head -n1)
  2940. _depflags='-MMD'
  2941. _cflags_speed='-O3'
  2942. _cflags_size='-Os'
  2943. _cflags_noopt='-O1'
  2944. elif $_cc -v 2>&1 | grep -q xlc; then
  2945. _type=xlc
  2946. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  2947. _cflags_speed='-O5'
  2948. _cflags_size='-O5 -qcompact'
  2949. elif $_cc --vsn 2>/dev/null | grep -Eq "ARM (C/C\+\+ )?Compiler"; then
  2950. test -d "$sysroot" || die "No valid sysroot specified."
  2951. _type=armcc
  2952. _ident=$($_cc --vsn | grep -i build | head -n1 | sed 's/.*: //')
  2953. armcc_conf="$PWD/armcc.conf"
  2954. $_cc --arm_linux_configure \
  2955. --arm_linux_config_file="$armcc_conf" \
  2956. --configure_sysroot="$sysroot" \
  2957. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  2958. die "Error creating armcc configuration file."
  2959. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  2960. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  2961. as_default="${cross_prefix}gcc"
  2962. _depflags='-MMD'
  2963. _cflags_speed='-O3'
  2964. _cflags_size='-Os'
  2965. elif $_cc -v 2>&1 | grep -q clang; then
  2966. _type=clang
  2967. _ident=$($_cc --version 2>/dev/null | head -n1)
  2968. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2969. _cflags_speed='-O3'
  2970. _cflags_size='-Os'
  2971. elif $_cc -V 2>&1 | grep -q Sun; then
  2972. _type=suncc
  2973. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  2974. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  2975. _DEPFLAGS='-xM1 -xc99'
  2976. _ldflags='-std=c99'
  2977. _cflags_speed='-O5'
  2978. _cflags_size='-O5 -xspace'
  2979. _flags_filter=suncc_flags
  2980. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  2981. _type=pathscale
  2982. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2983. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2984. _cflags_speed='-O2'
  2985. _cflags_size='-Os'
  2986. _flags_filter='filter_out -Wdisabled-optimization'
  2987. elif $_cc -v 2>&1 | grep -q Open64; then
  2988. _type=open64
  2989. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2990. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2991. _cflags_speed='-O2'
  2992. _cflags_size='-Os'
  2993. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  2994. elif $_cc 2>&1 | grep -q 'Microsoft.*ARM.*Assembler'; then
  2995. _type=armasm
  2996. _ident=$($_cc | head -n1)
  2997. # 4509: "This form of conditional instruction is deprecated"
  2998. _flags="-nologo -ignore 4509"
  2999. _flags_filter=armasm_flags
  3000. elif $_cc -nologo- 2>&1 | grep -q Microsoft; then
  3001. _type=msvc
  3002. _ident=$($_cc 2>&1 | head -n1)
  3003. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  3004. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  3005. _cflags_speed="-O2"
  3006. _cflags_size="-O1"
  3007. _cflags_noopt="-O1"
  3008. if $_cc -nologo- 2>&1 | grep -q Linker; then
  3009. _ld_o='-out:$@'
  3010. else
  3011. _ld_o='-Fe$@'
  3012. fi
  3013. _cc_o='-Fo$@'
  3014. _cc_e='-P -Fi$@'
  3015. _flags_filter=msvc_flags
  3016. _ld_lib='lib%.a'
  3017. _ld_path='-libpath:'
  3018. _flags='-nologo'
  3019. elif $_cc 2>&1 | grep -q Intel; then
  3020. _type=icl
  3021. _ident=$($_cc 2>&1 | head -n1)
  3022. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  3023. # Not only is O3 broken on 13.x+ but it is slower on all previous
  3024. # versions (tested) as well.
  3025. _cflags_speed="-O2"
  3026. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  3027. if $_cc 2>&1 | grep -q Linker; then
  3028. _ld_o='-out:$@'
  3029. else
  3030. _ld_o='-Fe$@'
  3031. fi
  3032. _cc_o='-Fo$@'
  3033. _cc_e='-P'
  3034. _flags_filter=icl_flags
  3035. _ld_lib='lib%.a'
  3036. _ld_path='-libpath:'
  3037. # -Qdiag-error to make icl error when seeing certain unknown arguments
  3038. _flags='-nologo -Qdiag-error:4044,10157'
  3039. # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency
  3040. # with MSVC which enables it by default.
  3041. _cflags='-Qms0 -Qvec- -Qsimd- -GS'
  3042. elif $_cc -? 2>/dev/null | grep -q 'LLVM.*Linker'; then
  3043. # lld can emulate multiple different linkers; in ms link.exe mode,
  3044. # the -? parameter gives the help output which contains an identifyable
  3045. # string, while it gives an error in other modes.
  3046. _type=lld-link
  3047. # The link.exe mode doesn't have a switch for getting the version,
  3048. # but we can force it back to gnu mode and get the version from there.
  3049. _ident=$($_cc -flavor gnu --version 2>/dev/null)
  3050. _ld_o='-out:$@'
  3051. _flags_filter=msvc_flags
  3052. _ld_lib='lib%.a'
  3053. _ld_path='-libpath:'
  3054. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  3055. _type=cparser
  3056. _ident=$($_cc --version | head -n1)
  3057. _depflags='-MMD'
  3058. _cflags_speed='-O4'
  3059. _cflags_size='-O2'
  3060. _flags_filter=cparser_flags
  3061. fi
  3062. eval ${pfx}_type=\$_type
  3063. eval ${pfx}_ident=\$_ident
  3064. }
  3065. set_ccvars(){
  3066. eval ${1}_C=\${_cc_c-\${${1}_C}}
  3067. eval ${1}_E=\${_cc_e-\${${1}_E}}
  3068. eval ${1}_O=\${_cc_o-\${${1}_O}}
  3069. if [ -n "$_depflags" ]; then
  3070. eval ${1}_DEPFLAGS=\$_depflags
  3071. else
  3072. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  3073. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  3074. eval DEP${1}FLAGS=\$_flags
  3075. fi
  3076. }
  3077. probe_cc cc "$cc"
  3078. cflags_filter=$_flags_filter
  3079. cflags_speed=$_cflags_speed
  3080. cflags_size=$_cflags_size
  3081. cflags_noopt=$_cflags_noopt
  3082. add_cflags $_flags $_cflags
  3083. cc_ldflags=$_ldflags
  3084. set_ccvars CC
  3085. probe_cc hostcc "$host_cc"
  3086. host_cflags_filter=$_flags_filter
  3087. host_cflags_speed=$_cflags_speed
  3088. add_host_cflags $_flags $_cflags
  3089. set_ccvars HOSTCC
  3090. test -n "$cc_type" && enable $cc_type ||
  3091. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  3092. : ${as_default:=$cc}
  3093. : ${objcc_default:=$cc}
  3094. : ${dep_cc_default:=$cc}
  3095. : ${ld_default:=$cc}
  3096. : ${host_ld_default:=$host_cc}
  3097. set_default ar as objcc dep_cc ld host_ld
  3098. probe_cc as "$as"
  3099. asflags_filter=$_flags_filter
  3100. add_asflags $_flags $_cflags
  3101. set_ccvars AS
  3102. probe_cc objcc "$objcc"
  3103. objcflags_filter=$_flags_filter
  3104. add_objcflags $_flags $_cflags
  3105. set_ccvars OBJC
  3106. probe_cc ld "$ld"
  3107. ldflags_filter=$_flags_filter
  3108. add_ldflags $_flags $_ldflags
  3109. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  3110. LD_O=${_ld_o-$LD_O}
  3111. LD_LIB=${_ld_lib-$LD_LIB}
  3112. LD_PATH=${_ld_path-$LD_PATH}
  3113. probe_cc hostld "$host_ld"
  3114. host_ldflags_filter=$_flags_filter
  3115. add_host_ldflags $_flags $_ldflags
  3116. HOSTLD_O=${_ld_o-$HOSTLD_O}
  3117. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  3118. probe_cc depcc "$dep_cc"
  3119. CCDEP=${_DEPCMD:-$DEPCMD}
  3120. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  3121. DEPCCFLAGS=$_flags
  3122. fi
  3123. if $ar 2>&1 | grep -q Microsoft; then
  3124. arflags="-nologo"
  3125. ar_o='-out:$@'
  3126. else
  3127. arflags="rc"
  3128. ar_o='$@'
  3129. fi
  3130. add_cflags $extra_cflags
  3131. add_objcflags $extra_objcflags
  3132. add_asflags $extra_cflags
  3133. if test -n "$sysroot"; then
  3134. case "$cc_type" in
  3135. gcc|llvm_gcc|clang)
  3136. add_cppflags --sysroot="$sysroot"
  3137. add_ldflags --sysroot="$sysroot"
  3138. ;;
  3139. esac
  3140. fi
  3141. if test "$cpu" = host; then
  3142. enabled cross_compile &&
  3143. die "--cpu=host makes no sense when cross-compiling."
  3144. case "$cc_type" in
  3145. gcc|llvm_gcc)
  3146. check_native(){
  3147. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  3148. sed -n "/cc1.*$1=/{
  3149. s/.*$1=\\([^ ]*\\).*/\\1/
  3150. p
  3151. q
  3152. }" $TMPE
  3153. }
  3154. cpu=$(check_native -march || check_native -mcpu)
  3155. ;;
  3156. esac
  3157. test "${cpu:-host}" = host &&
  3158. die "--cpu=host not supported with compiler $cc"
  3159. fi
  3160. # Deal with common $arch aliases
  3161. case "$arch" in
  3162. aarch64|arm64)
  3163. arch="aarch64"
  3164. ;;
  3165. arm*)
  3166. arch="arm"
  3167. ;;
  3168. mips*|IP*)
  3169. case "$arch" in
  3170. *el)
  3171. add_cppflags -EL
  3172. add_ldflags -EL
  3173. ;;
  3174. *eb)
  3175. add_cppflags -EB
  3176. add_ldflags -EB
  3177. ;;
  3178. esac
  3179. arch="mips"
  3180. ;;
  3181. parisc*|hppa*)
  3182. arch="parisc"
  3183. ;;
  3184. "Power Macintosh"|ppc*|powerpc*)
  3185. arch="ppc"
  3186. ;;
  3187. s390|s390x)
  3188. arch="s390"
  3189. ;;
  3190. sh4|sh)
  3191. arch="sh4"
  3192. ;;
  3193. sun4u|sparc*)
  3194. arch="sparc"
  3195. ;;
  3196. tilegx|tile-gx)
  3197. arch="tilegx"
  3198. ;;
  3199. i[3-6]86|i86pc|BePC|x86pc|x86_64|amd64)
  3200. arch="x86"
  3201. ;;
  3202. esac
  3203. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  3204. enable $arch
  3205. # Add processor-specific flags
  3206. if enabled aarch64; then
  3207. case $cpu in
  3208. armv*)
  3209. cpuflags="-march=$cpu"
  3210. ;;
  3211. *)
  3212. cpuflags="-mcpu=$cpu"
  3213. ;;
  3214. esac
  3215. elif enabled alpha; then
  3216. cpuflags="-mcpu=$cpu"
  3217. elif enabled arm; then
  3218. check_arm_arch() {
  3219. check_cpp_condition stddef.h \
  3220. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  3221. $cpuflags
  3222. }
  3223. probe_arm_arch() {
  3224. if check_arm_arch 4; then echo armv4
  3225. elif check_arm_arch 4T; then echo armv4t
  3226. elif check_arm_arch 5; then echo armv5
  3227. elif check_arm_arch 5E; then echo armv5e
  3228. elif check_arm_arch 5T; then echo armv5t
  3229. elif check_arm_arch 5TE; then echo armv5te
  3230. elif check_arm_arch 5TEJ; then echo armv5te
  3231. elif check_arm_arch 6; then echo armv6
  3232. elif check_arm_arch 6J; then echo armv6j
  3233. elif check_arm_arch 6K; then echo armv6k
  3234. elif check_arm_arch 6Z; then echo armv6z
  3235. elif check_arm_arch 6ZK; then echo armv6zk
  3236. elif check_arm_arch 6T2; then echo armv6t2
  3237. elif check_arm_arch 7; then echo armv7
  3238. elif check_arm_arch 7A 7_A; then echo armv7-a
  3239. elif check_arm_arch 7S; then echo armv7-a
  3240. elif check_arm_arch 7R 7_R; then echo armv7-r
  3241. elif check_arm_arch 7M 7_M; then echo armv7-m
  3242. elif check_arm_arch 7EM 7E_M; then echo armv7-m
  3243. elif check_arm_arch 8A 8_A; then echo armv8-a
  3244. fi
  3245. }
  3246. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  3247. case $cpu in
  3248. armv*)
  3249. cpuflags="-march=$cpu"
  3250. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  3251. ;;
  3252. *)
  3253. cpuflags="-mcpu=$cpu"
  3254. case $cpu in
  3255. cortex-a*) subarch=armv7a ;;
  3256. cortex-r*) subarch=armv7r ;;
  3257. cortex-m*) enable thumb; subarch=armv7m ;;
  3258. arm11*) subarch=armv6 ;;
  3259. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  3260. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  3261. *) subarch=$(probe_arm_arch) ;;
  3262. esac
  3263. ;;
  3264. esac
  3265. case "$subarch" in
  3266. armv5t*) enable fast_clz ;;
  3267. armv[6-8]*) enable fast_clz fast_unaligned ;;
  3268. esac
  3269. elif enabled avr32; then
  3270. case $cpu in
  3271. ap7[02]0[0-2])
  3272. subarch="avr32_ap"
  3273. cpuflags="-mpart=$cpu"
  3274. ;;
  3275. ap)
  3276. subarch="avr32_ap"
  3277. cpuflags="-march=$cpu"
  3278. ;;
  3279. uc3[ab]*)
  3280. subarch="avr32_uc"
  3281. cpuflags="-mcpu=$cpu"
  3282. ;;
  3283. uc)
  3284. subarch="avr32_uc"
  3285. cpuflags="-march=$cpu"
  3286. ;;
  3287. esac
  3288. elif enabled bfin; then
  3289. cpuflags="-mcpu=$cpu"
  3290. elif enabled mips; then
  3291. cpuflags="-march=$cpu"
  3292. elif enabled ppc; then
  3293. disable ldbrx
  3294. case $(tolower $cpu) in
  3295. 601|ppc601|powerpc601)
  3296. cpuflags="-mcpu=601"
  3297. disable altivec
  3298. ;;
  3299. 603*|ppc603*|powerpc603*)
  3300. cpuflags="-mcpu=603"
  3301. disable altivec
  3302. ;;
  3303. 604*|ppc604*|powerpc604*)
  3304. cpuflags="-mcpu=604"
  3305. disable altivec
  3306. ;;
  3307. g3|75*|ppc75*|powerpc75*)
  3308. cpuflags="-mcpu=750"
  3309. disable altivec
  3310. ;;
  3311. g4|745*|ppc745*|powerpc745*)
  3312. cpuflags="-mcpu=7450"
  3313. disable vsx
  3314. ;;
  3315. 74*|ppc74*|powerpc74*)
  3316. cpuflags="-mcpu=7400"
  3317. disable vsx
  3318. ;;
  3319. g5|970|ppc970|powerpc970)
  3320. cpuflags="-mcpu=970"
  3321. disable vsx
  3322. ;;
  3323. power[3-6]*)
  3324. cpuflags="-mcpu=$cpu"
  3325. disable vsx
  3326. ;;
  3327. power[7-8]*)
  3328. cpuflags="-mcpu=$cpu"
  3329. enable ldbrx
  3330. ;;
  3331. cell)
  3332. cpuflags="-mcpu=cell"
  3333. enable ldbrx
  3334. disable vsx
  3335. ;;
  3336. e500mc)
  3337. cpuflags="-mcpu=e500mc"
  3338. disable altivec
  3339. ;;
  3340. e500v2)
  3341. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  3342. disable altivec
  3343. disable dcbzl
  3344. ;;
  3345. e500)
  3346. cpuflags="-mcpu=8540 -mhard-float"
  3347. disable altivec
  3348. disable dcbzl
  3349. ;;
  3350. esac
  3351. elif enabled sparc; then
  3352. case $cpu in
  3353. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  3354. cpuflags="-mcpu=$cpu"
  3355. ;;
  3356. ultrasparc*|niagara[234])
  3357. cpuflags="-mcpu=$cpu"
  3358. ;;
  3359. esac
  3360. elif enabled x86; then
  3361. case $cpu in
  3362. i[345]86|pentium)
  3363. cpuflags="-march=$cpu"
  3364. disable i686
  3365. disable mmx
  3366. ;;
  3367. # targets that do NOT support nopl and conditional mov (cmov)
  3368. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  3369. cpuflags="-march=$cpu"
  3370. disable i686
  3371. ;;
  3372. # targets that do support nopl and conditional mov (cmov)
  3373. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64*|k8*|opteron*|athlon-fx|core2|corei7*|amdfam10|barcelona|atom|bdver*)
  3374. cpuflags="-march=$cpu"
  3375. enable i686
  3376. enable fast_cmov
  3377. ;;
  3378. # targets that do support conditional mov but on which it's slow
  3379. pentium4|pentium4m|prescott|nocona)
  3380. cpuflags="-march=$cpu"
  3381. enable i686
  3382. disable fast_cmov
  3383. ;;
  3384. esac
  3385. fi
  3386. if [ "$cpu" != generic ]; then
  3387. add_cflags $cpuflags
  3388. add_asflags $cpuflags
  3389. test "$cc_type" = "$ld_type" && add_ldflags $cpuflags
  3390. fi
  3391. # compiler sanity check
  3392. check_exec <<EOF
  3393. int main(void){ return 0; }
  3394. EOF
  3395. if test "$?" != 0; then
  3396. echo "$cc is unable to create an executable file."
  3397. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  3398. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  3399. echo "Only do this if you know what cross compiling means."
  3400. fi
  3401. die "C compiler test failed."
  3402. fi
  3403. add_cppflags -D_ISOC99_SOURCE
  3404. # some compilers silently accept -std=c11, so we also need to check that the
  3405. # version macro is defined properly
  3406. check_cpp_condition stdlib.h "__STDC_VERSION__ >= 201112L" -std=c11 &&
  3407. add_cflags -std=c11 ||
  3408. check_cflags -std=c99
  3409. check_cppflags -D_FILE_OFFSET_BITS=64
  3410. check_cppflags -D_LARGEFILE_SOURCE
  3411. add_host_cppflags -D_ISOC99_SOURCE
  3412. check_host_cflags -std=c99
  3413. check_host_cflags -Wall
  3414. check_host_cflags $host_cflags_speed
  3415. check_64bit(){
  3416. arch32=$1
  3417. arch64=$2
  3418. expr=$3
  3419. check_code cc "" "int test[2*($expr) - 1]" &&
  3420. subarch=$arch64 || subarch=$arch32
  3421. }
  3422. case "$arch" in
  3423. aarch64|alpha|ia64)
  3424. spic=$shared
  3425. ;;
  3426. mips)
  3427. check_64bit mips mips64 '_MIPS_SIM > 1'
  3428. spic=$shared
  3429. ;;
  3430. parisc)
  3431. check_64bit parisc parisc64 'sizeof(void *) > 4'
  3432. spic=$shared
  3433. ;;
  3434. ppc)
  3435. check_64bit ppc ppc64 'sizeof(void *) > 4'
  3436. spic=$shared
  3437. ;;
  3438. s390)
  3439. check_64bit s390 s390x 'sizeof(void *) > 4'
  3440. spic=$shared
  3441. ;;
  3442. sparc)
  3443. check_64bit sparc sparc64 'sizeof(void *) > 4'
  3444. spic=$shared
  3445. ;;
  3446. x86)
  3447. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  3448. if test "$subarch" = "x86_64"; then
  3449. spic=$shared
  3450. fi
  3451. ;;
  3452. esac
  3453. enable $subarch
  3454. enabled spic && enable_weak pic
  3455. enabled x86_64 && objformat=elf64 || objformat="elf32"
  3456. # OS specific
  3457. case $target_os in
  3458. aix)
  3459. SHFLAGS=-shared
  3460. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  3461. enabled shared && add_ldflags -Wl,-brtl
  3462. arflags='-Xany -r -c'
  3463. ;;
  3464. android)
  3465. disable symver
  3466. enable section_data_rel_ro
  3467. SLIB_INSTALL_NAME='$(SLIBNAME)'
  3468. SLIB_INSTALL_LINKS=
  3469. SHFLAGS='-shared -Wl,-soname,$(SLIBNAME)'
  3470. ;;
  3471. haiku)
  3472. prefix_default="/boot/common"
  3473. network_extralibs="-lnetwork"
  3474. host_extralibs=
  3475. ;;
  3476. sunos)
  3477. SHFLAGS='-shared -Wl,-h,$$(@F)'
  3478. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  3479. network_extralibs="-lsocket -lnsl"
  3480. # When using suncc to build, the Solaris linker will mark
  3481. # an executable with each instruction set encountered by
  3482. # the Solaris assembler. As our libraries contain their own
  3483. # guards for processor-specific code, instead suppress
  3484. # generation of the HWCAPS ELF section on Solaris x86 only.
  3485. enabled_all suncc x86 &&
  3486. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  3487. add_ldflags -Wl,-M,mapfile
  3488. nm_default='nm -P -g'
  3489. version_script='-M'
  3490. VERSION_SCRIPT_POSTPROCESS_CMD='perl $(SRC_PATH)/compat/solaris/make_sunver.pl - $(OBJS)'
  3491. ;;
  3492. netbsd)
  3493. disable symver
  3494. oss_indev_extralibs="-lossaudio"
  3495. ;;
  3496. openbsd|bitrig)
  3497. disable symver
  3498. SHFLAGS='-shared'
  3499. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  3500. SLIB_INSTALL_LINKS=
  3501. oss_indev_extralibs="-lossaudio"
  3502. ;;
  3503. dragonfly)
  3504. disable symver
  3505. ;;
  3506. freebsd)
  3507. ;;
  3508. bsd/os)
  3509. add_extralibs -lpoll -lgnugetopt
  3510. ;;
  3511. darwin)
  3512. enabled ppc && add_asflags -force_cpusubtype_ALL
  3513. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  3514. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  3515. add_ldflags -Wl,-dynamic,-search_paths_first
  3516. check_cflags -Werror=partial-availability
  3517. SLIBSUF=".dylib"
  3518. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
  3519. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
  3520. enabled x86_64 && objformat="macho64" || objformat="macho32"
  3521. enabled_any pic shared ||
  3522. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  3523. check_header dispatch/dispatch.h &&
  3524. add_cppflags '-I\$(SRC_PATH)/compat/dispatch_semaphore'
  3525. if test -n "$sysroot"; then
  3526. is_in -isysroot $cc $CPPFLAGS $CFLAGS || check_cppflags -isysroot $sysroot
  3527. is_in -isysroot $ld $LDFLAGS || check_ldflags -isysroot $sysroot
  3528. fi
  3529. ;;
  3530. msys*)
  3531. die "Native MSYS builds are discouraged, please use the MINGW environment."
  3532. ;;
  3533. mingw32*|mingw64*)
  3534. target_os=mingw32
  3535. if enabled shared; then
  3536. # Cannot build both shared and static libs when using dllexport.
  3537. disable static
  3538. fi
  3539. check_ldflags -Wl,--nxcompat
  3540. check_ldflags -Wl,--dynamicbase
  3541. shlibdir_default="$bindir_default"
  3542. SLIBPREF=""
  3543. SLIBSUF=".dll"
  3544. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3545. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  3546. SLIB_EXTRA_CMD='cp $(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3547. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3548. SLIB_INSTALL_LINKS=
  3549. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3550. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3551. SLIB_CREATE_DEF_CMD='ARCH="$(ARCH)" AR="$(AR_CMD)" NM="$(NM_CMD)" $(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  3552. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-auto-image-base $$(@:$(SLIBSUF)=.def)'
  3553. enabled x86_64 && objformat="win64" || objformat="win32"
  3554. ranlib=:
  3555. enable dos_paths
  3556. ;;
  3557. win32|win64)
  3558. disable symver
  3559. if enabled shared; then
  3560. # Link to the import library instead of the normal static library
  3561. # for shared libs.
  3562. LD_LIB='%.lib'
  3563. # Cannot build both shared and static libs with MSVC or icl.
  3564. disable static
  3565. fi
  3566. shlibdir_default="$bindir_default"
  3567. SLIBPREF=""
  3568. SLIBSUF=".dll"
  3569. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3570. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  3571. SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  3572. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3573. SLIB_INSTALL_LINKS=
  3574. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3575. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3576. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3577. enabled x86_64 && objformat="win64" || objformat="win32"
  3578. ranlib=:
  3579. enable dos_paths
  3580. ;;
  3581. cygwin*)
  3582. target_os=cygwin
  3583. shlibdir_default="$bindir_default"
  3584. SLIBPREF="cyg"
  3585. SLIBSUF=".dll"
  3586. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3587. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  3588. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3589. SLIB_INSTALL_LINKS=
  3590. SLIB_INSTALL_EXTRA_LIB='lib$(NAME).dll.a'
  3591. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(NAME).dll.a'
  3592. enabled x86_64 && objformat="win64" || objformat="win32"
  3593. enable dos_paths
  3594. ;;
  3595. *-dos|freedos|opendos)
  3596. network_extralibs="-lsocket"
  3597. objformat="coff"
  3598. enable dos_paths
  3599. add_cppflags -U__STRICT_ANSI__
  3600. ;;
  3601. linux)
  3602. enable section_data_rel_ro
  3603. ;;
  3604. irix*)
  3605. target_os=irix
  3606. ranlib="echo ignoring ranlib"
  3607. ;;
  3608. os/2*)
  3609. ln_s="cp -f"
  3610. objformat="aout"
  3611. add_cppflags -D_GNU_SOURCE
  3612. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zhigh-mem -Zmap
  3613. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  3614. LIBSUF="_s.a"
  3615. SLIBPREF=""
  3616. SLIBSUF=".dll"
  3617. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3618. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  3619. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  3620. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  3621. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  3622. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  3623. emxexp $(OBJS) >> $(SUBDIR)$(NAME).def'
  3624. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  3625. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  3626. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  3627. enable dos_paths
  3628. ;;
  3629. gnu/kfreebsd)
  3630. add_cppflags -D_BSD_SOURCE
  3631. ;;
  3632. gnu)
  3633. ;;
  3634. qnx)
  3635. add_cppflags -D_QNX_SOURCE
  3636. network_extralibs="-lsocket"
  3637. ;;
  3638. symbian)
  3639. SLIBSUF=".dll"
  3640. enable dos_paths
  3641. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  3642. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  3643. add_ldflags -Wl,--target1-abs,--no-undefined \
  3644. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  3645. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  3646. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  3647. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  3648. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  3649. ;;
  3650. minix)
  3651. ;;
  3652. none)
  3653. ;;
  3654. *)
  3655. die "Unknown OS '$target_os'."
  3656. ;;
  3657. esac
  3658. # determine libc flavour
  3659. probe_libc(){
  3660. pfx=$1
  3661. pfx_no_=${pfx%_}
  3662. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  3663. if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  3664. eval ${pfx}libc_type=uclibc
  3665. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3666. elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  3667. eval ${pfx}libc_type=glibc
  3668. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3669. # MinGW headers can be installed on Cygwin, so check for newlib first.
  3670. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  3671. eval ${pfx}libc_type=newlib
  3672. add_${pfx}cppflags -U__STRICT_ANSI__ -D_XOPEN_SOURCE=600
  3673. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  3674. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  3675. eval ${pfx}libc_type=mingw64
  3676. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  3677. eval test \$${pfx_no_}cc_type = "gcc" &&
  3678. add_${pfx}cppflags -D__printf__=__gnu_printf__
  3679. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  3680. check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  3681. eval ${pfx}libc_type=mingw32
  3682. check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  3683. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  3684. die "ERROR: MinGW32 runtime version must be >= 3.15."
  3685. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  3686. check_${pfx}cpp_condition _mingw.h "__MSVCRT_VERSION__ < 0x0700" &&
  3687. add_${pfx}cppflags -D__MSVCRT_VERSION__=0x0700
  3688. check_${pfx}cpp_condition windows.h "defined(_WIN32_WINNT) && _WIN32_WINNT < 0x0502" &&
  3689. add_${pfx}cppflags -D_WIN32_WINNT=0x0502
  3690. eval test \$${pfx_no_}cc_type = "gcc" &&
  3691. add_${pfx}cppflags -D__printf__=__gnu_printf__
  3692. elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  3693. eval ${pfx}libc_type=msvcrt
  3694. if check_${pfx}cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION < 14"; then
  3695. if [ "$pfx" = host_ ]; then
  3696. add_host_cppflags -Dsnprintf=_snprintf
  3697. else
  3698. add_compat strtod.o strtod=avpriv_strtod
  3699. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  3700. _snprintf=avpriv_snprintf \
  3701. vsnprintf=avpriv_vsnprintf
  3702. fi
  3703. fi
  3704. add_${pfx}cppflags -D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_WARNINGS
  3705. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  3706. # 0x601 by default unless something else is set by the user.
  3707. # This can easily lead to us detecting functions only present
  3708. # in such new versions and producing binaries requiring windows 7.0.
  3709. # Therefore explicitly set the default to XP unless the user has
  3710. # set something else on the command line.
  3711. # Don't do this if WINAPI_FAMILY is set and is set to a non-desktop
  3712. # family. For these cases, configure is free to use any functions
  3713. # found in the SDK headers by default. (Alternatively, we could force
  3714. # _WIN32_WINNT to 0x0602 in that case.)
  3715. check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  3716. { check_${pfx}cpp <<EOF && add_${pfx}cppflags -D_WIN32_WINNT=0x0502; }
  3717. #ifdef WINAPI_FAMILY
  3718. #include <winapifamily.h>
  3719. #if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  3720. #error not desktop
  3721. #endif
  3722. #endif
  3723. EOF
  3724. if [ "$pfx" = "" ]; then
  3725. check_func strtoll || add_cflags -Dstrtoll=_strtoi64
  3726. fi
  3727. elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  3728. eval ${pfx}libc_type=klibc
  3729. elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  3730. eval ${pfx}libc_type=bionic
  3731. elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  3732. eval ${pfx}libc_type=solaris
  3733. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  3734. else
  3735. eval ${pfx}libc_type=default
  3736. add_${pfx}cppflags -D_DEFAULT_SOURCE
  3737. fi
  3738. eval test -n "\${${pfx}libc_type}" && enable ${pfx}libc_${libc_type}
  3739. }
  3740. probe_libc
  3741. probe_libc host_
  3742. # hacks for compiler/libc/os combinations
  3743. case $libc_type in
  3744. bionic)
  3745. add_compat strtod.o strtod=avpriv_strtod
  3746. ;;
  3747. esac
  3748. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  3749. add_cppflags '-I\$(SRC_PATH)/compat/float'
  3750. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  3751. set_default $PATHS_LIST
  3752. set_default nm
  3753. disabled optimizations || check_cflags -fomit-frame-pointer
  3754. enable_weak_pic() {
  3755. disabled pic && return
  3756. enable pic
  3757. add_cppflags -DPIC
  3758. case "$target_os" in
  3759. mingw*|cygwin*|win*)
  3760. ;;
  3761. *)
  3762. add_cflags -fPIC
  3763. add_asflags -fPIC
  3764. ;;
  3765. esac
  3766. }
  3767. enabled pic && enable_weak_pic
  3768. check_cc <<EOF || die "Symbol mangling check failed."
  3769. int ff_extern;
  3770. EOF
  3771. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  3772. extern_prefix=${sym%%ff_extern*}
  3773. ! disabled inline_asm && check_inline_asm inline_asm '"" ::'
  3774. _restrict=
  3775. for restrict_keyword in restrict __restrict__ __restrict; do
  3776. check_cc <<EOF && _restrict=$restrict_keyword && break
  3777. void foo(char * $restrict_keyword p);
  3778. EOF
  3779. done
  3780. check_cc <<EOF && enable pragma_deprecated
  3781. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  3782. EOF
  3783. check_cc <<EOF || die "endian test failed"
  3784. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  3785. EOF
  3786. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  3787. check_gas() {
  3788. log "check_gas using '$as' as AS"
  3789. # :vararg is used on aarch64, arm and ppc altivec
  3790. check_as <<EOF || return 1
  3791. .macro m n, y:vararg=0
  3792. \n: .int \y
  3793. .endm
  3794. m x
  3795. EOF
  3796. # .altmacro is only used in arm asm
  3797. ! enabled arm || check_as <<EOF || return 1
  3798. .altmacro
  3799. EOF
  3800. enable gnu_as
  3801. return 0
  3802. }
  3803. if enabled_any arm aarch64 || enabled_all ppc altivec && enabled asm; then
  3804. nogas=:
  3805. enabled_any arm aarch64 && nogas=die
  3806. enabled_all ppc altivec && nogas=warn
  3807. as_noop=-v
  3808. case $as_type in
  3809. arm*) gaspp_as_type=armasm; as_noop=-h ;;
  3810. gcc) gaspp_as_type=gas ;;
  3811. *) gaspp_as_type=$as_type ;;
  3812. esac
  3813. [ $target_os = "darwin" ] && gaspp_as_type="apple-$gaspp_as_type"
  3814. check_cmd gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- $as $as_noop &&
  3815. gas="gas-preprocessor.pl -arch $arch -as-type $gaspp_as_type -- $as"
  3816. if ! check_gas ; then
  3817. as=${gas:=$as}
  3818. check_gas || \
  3819. $nogas "GNU assembler not found, install/update gas-preprocessor"
  3820. fi
  3821. check_as <<EOF && enable as_func
  3822. .func test
  3823. .endfunc
  3824. EOF
  3825. fi
  3826. check_inline_asm inline_asm_labels '"1:\n"'
  3827. if enabled aarch64; then
  3828. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  3829. # internal assembler in clang 3.3 does not support this instruction
  3830. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  3831. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  3832. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  3833. elif enabled alpha; then
  3834. check_cflags -mieee
  3835. elif enabled arm; then
  3836. enabled msvc && check_cpp_condition stddef.h "defined _M_ARMT" && enable thumb
  3837. check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
  3838. enabled thumb && check_cflags -mthumb || check_cflags -marm
  3839. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  3840. enable vfp_args
  3841. elif check_cpp_condition stddef.h "defined _M_ARM_FP && _M_ARM_FP >= 30"; then
  3842. enable vfp_args
  3843. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__" && [ $target_os != darwin ]; then
  3844. case "${cross_prefix:-$cc}" in
  3845. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  3846. *) check_ld <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  3847. __asm__ (".eabi_attribute 28, 1");
  3848. int main(void) { return 0; }
  3849. EOF
  3850. esac
  3851. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  3852. fi
  3853. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  3854. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  3855. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  3856. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  3857. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  3858. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  3859. [ $target_os = linux ] || [ $target_os = android ] ||
  3860. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  3861. $ARCH_EXT_LIST_ARM
  3862. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  3863. check_as <<EOF && enable as_arch_directive
  3864. .arch armv7-a
  3865. EOF
  3866. check_as <<EOF && enable as_fpu_directive
  3867. .fpu neon
  3868. EOF
  3869. # llvm's integrated assembler supports .object_arch from llvm 3.5
  3870. [ "$objformat" = elf32 ] || [ "$objformat" = elf64 ] &&
  3871. check_as <<EOF && enable as_object_arch
  3872. .object_arch armv4
  3873. EOF
  3874. # MS armasm fails to assemble our PIC constructs
  3875. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  3876. elif enabled mips; then
  3877. # make sure that only one instruction set is enabled
  3878. disable $ARCH_EXT_LIST_MIPS
  3879. check_inline_asm loongson '"dmult.g $1, $2, $3"'
  3880. if enabled mips64; then
  3881. check_inline_asm mips64r6 '"dlsa $0, $0, $0, 1"' ||
  3882. check_inline_asm mips64r2 '"dext $0, $0, 0, 1"' ||
  3883. check_inline_asm mips64r1 '"daddi $0, $0, 0"'
  3884. else
  3885. check_inline_asm mips32r6 '"aui $0, $0, 0"' ||
  3886. check_inline_asm mips32r2 '"ext $0, $0, 0, 1"' ||
  3887. check_inline_asm mips32r1 '"addi $0, $0, 0"'
  3888. fi
  3889. elif enabled parisc; then
  3890. if enabled gcc; then
  3891. case $($cc -dumpversion) in
  3892. 4.[3-8].*) check_cflags -fno-optimize-sibling-calls ;;
  3893. esac
  3894. fi
  3895. elif enabled ppc; then
  3896. enable local_aligned_8 local_aligned_16 local_aligned_32
  3897. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  3898. check_inline_asm ibm_asm '"add 0, 0, 0"'
  3899. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  3900. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  3901. if enabled altivec; then
  3902. check_cflags -maltivec -mabi=altivec
  3903. # check if our compiler supports Motorola AltiVec C API
  3904. check_code cc altivec.h "vector signed int v1 = (vector signed int) { 0 };
  3905. vector signed int v2 = (vector signed int) { 1 };
  3906. v1 = vec_add(v1, v2);" ||
  3907. disable altivec
  3908. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  3909. fi
  3910. if enabled vsx; then
  3911. check_cflags -mvsx &&
  3912. check_code cc altivec.h "int v[4] = { 0 };
  3913. vector signed int v1 = vec_vsx_ld(0, v);" ||
  3914. disable vsx
  3915. fi
  3916. if enabled power8; then
  3917. check_cpp_condition "altivec.h" "defined(_ARCH_PWR8)" || disable power8
  3918. fi
  3919. elif enabled x86; then
  3920. check_builtin rdtsc intrin.h "__rdtsc()"
  3921. check_builtin mm_empty mmintrin.h "_mm_empty()"
  3922. enable local_aligned_8 local_aligned_16 local_aligned_32
  3923. # check whether EBP is available on x86
  3924. # As 'i' is stored on the stack, this program will crash
  3925. # if the base pointer is used to access it because the
  3926. # base pointer is cleared in the inline assembly code.
  3927. check_exec_crash <<EOF && enable ebp_available
  3928. volatile int i=0;
  3929. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  3930. return i;
  3931. EOF
  3932. # check whether EBX is available on x86
  3933. check_inline_asm ebx_available '""::"b"(0)' &&
  3934. check_inline_asm ebx_available '"":::"%ebx"'
  3935. # check whether xmm clobbers are supported
  3936. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  3937. # check whether binutils is new enough to compile SSSE3/MMXEXT
  3938. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  3939. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  3940. probe_x86asm(){
  3941. x86asmexe_probe=$1
  3942. if check_cmd $x86asmexe_probe -v; then
  3943. x86asmexe=$x86asmexe_probe
  3944. x86asm_type=nasm
  3945. x86asm_debug="-g -F dwarf"
  3946. X86ASMDEP=
  3947. X86ASM_DEPFLAGS='-MD $(@:.o=.d)'
  3948. elif check_cmd $x86asmexe_probe --version; then
  3949. x86asmexe=$x86asmexe_probe
  3950. x86asm_type=yasm
  3951. x86asm_debug="-g dwarf2"
  3952. X86ASMDEP='$(DEPX86ASM) $(X86ASMFLAGS) -M $(X86ASM_O) $< > $(@:.o=.d)'
  3953. X86ASM_DEPFLAGS=
  3954. fi
  3955. check_x86asm "movbe ecx, [5]" && enable x86asm
  3956. }
  3957. if ! disabled_any asm mmx x86asm; then
  3958. disable x86asm
  3959. for program in $x86asmexe nasm yasm; do
  3960. probe_x86asm $program && break
  3961. done
  3962. disabled x86asm && die "nasm/yasm not found or too old. Use --disable-x86asm for a crippled build."
  3963. X86ASMFLAGS="-f $objformat"
  3964. enabled pic && append X86ASMFLAGS "-DPIC"
  3965. test -n "$extern_prefix" && append X86ASMFLAGS "-DPREFIX"
  3966. case "$objformat" in
  3967. elf*) enabled debug && append X86ASMFLAGS $x86asm_debug ;;
  3968. esac
  3969. check_x86asm "vextracti128 xmm0, ymm0, 0" || disable avx2_external
  3970. check_x86asm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
  3971. check_x86asm "vfmadd132ps ymm0, ymm1, ymm2" || disable fma3_external
  3972. check_x86asm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  3973. check_x86asm "CPU amdnop" || disable cpunop
  3974. fi
  3975. case "$cpu" in
  3976. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  3977. disable fast_clz
  3978. ;;
  3979. esac
  3980. fi
  3981. check_code cc arm_neon.h "int16x8_t test = vdupq_n_s16(0)" && enable intrinsics_neon
  3982. check_ldflags -Wl,--as-needed
  3983. if ! disabled network; then
  3984. check_func getaddrinfo $network_extralibs
  3985. check_func inet_aton $network_extralibs
  3986. check_type netdb.h "struct addrinfo"
  3987. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  3988. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  3989. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  3990. check_type poll.h "struct pollfd"
  3991. check_type netinet/sctp.h "struct sctp_event_subscribe"
  3992. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  3993. check_type netinet/in.h "struct sockaddr_in6"
  3994. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  3995. check_type "sys/types.h sys/socket.h" socklen_t
  3996. # Prefer arpa/inet.h over winsock2
  3997. if check_header arpa/inet.h ; then
  3998. check_func closesocket
  3999. elif check_header winsock2.h ; then
  4000. check_func_headers winsock2.h closesocket -lws2 &&
  4001. network_extralibs="-lws2" ||
  4002. { check_func_headers winsock2.h closesocket -lws2_32 &&
  4003. network_extralibs="-lws2_32"; } || disable winsock2_h network
  4004. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  4005. check_type ws2tcpip.h socklen_t
  4006. check_type ws2tcpip.h "struct addrinfo"
  4007. check_type ws2tcpip.h "struct group_source_req"
  4008. check_type ws2tcpip.h "struct ip_mreq_source"
  4009. check_type ws2tcpip.h "struct ipv6_mreq"
  4010. check_type winsock2.h "struct pollfd"
  4011. check_struct winsock2.h "struct sockaddr" sa_len
  4012. check_type ws2tcpip.h "struct sockaddr_in6"
  4013. check_type ws2tcpip.h "struct sockaddr_storage"
  4014. else
  4015. disable network
  4016. fi
  4017. fi
  4018. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  4019. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  4020. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  4021. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  4022. case "$custom_allocator" in
  4023. jemalloc)
  4024. # jemalloc by default does not use a prefix
  4025. require libjemalloc jemalloc/jemalloc.h malloc -ljemalloc
  4026. ;;
  4027. tcmalloc)
  4028. require_pkg_config libtcmalloc libtcmalloc gperftools/tcmalloc.h tc_malloc
  4029. malloc_prefix=tc_
  4030. ;;
  4031. esac
  4032. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  4033. check_func ${malloc_prefix}memalign && enable memalign
  4034. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  4035. check_cpp_condition unistd.h "defined(_POSIX_MONOTONIC_CLOCK)" &&
  4036. { check_lib clock_gettime time.h clock_gettime ||
  4037. check_lib clock_gettime time.h clock_gettime -lrt; }
  4038. check_func fcntl
  4039. check_func gethrtime
  4040. check_func getopt
  4041. check_func getrusage
  4042. check_func gettimeofday
  4043. check_func gmtime_r
  4044. check_func isatty
  4045. check_func localtime_r
  4046. check_func mkstemp
  4047. check_func mmap
  4048. check_func mprotect
  4049. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  4050. check_func_headers time.h nanosleep || check_lib nanosleep time.h nanosleep -lrt
  4051. check_func sched_getaffinity
  4052. check_func setrlimit
  4053. check_func strerror_r
  4054. check_func sysconf
  4055. check_func sysctl
  4056. check_func usleep
  4057. check_func_headers io.h setmode
  4058. check_func_headers mach/mach_time.h mach_absolute_time
  4059. check_func_headers stdlib.h getenv
  4060. check_func_headers windows.h GetProcessAffinityMask
  4061. check_func_headers windows.h GetProcessTimes
  4062. check_func_headers windows.h GetSystemTimeAsFileTime
  4063. check_func_headers windows.h LoadLibrary
  4064. check_func_headers windows.h MapViewOfFile
  4065. check_func_headers windows.h SetConsoleTextAttribute
  4066. check_func_headers windows.h Sleep
  4067. check_func_headers windows.h VirtualAlloc
  4068. check_struct windows.h "CONDITION_VARIABLE" Ptr
  4069. check_header direct.h
  4070. check_header dxgidebug.h
  4071. check_header dxva.h
  4072. check_header dxva2api.h
  4073. check_header io.h
  4074. check_header malloc.h
  4075. check_header poll.h
  4076. check_header sys/param.h
  4077. check_header sys/resource.h
  4078. check_header sys/select.h
  4079. check_header sys/time.h
  4080. check_header sys/un.h
  4081. check_header unistd.h
  4082. check_header valgrind/valgrind.h
  4083. check_header VideoDecodeAcceleration/VDADecoder.h
  4084. check_header windows.h
  4085. # it seems there are versions of clang in some distros that try to use the
  4086. # gcc headers, which explodes for stdatomic
  4087. # so we also check that atomics actually work here
  4088. check_builtin stdatomic stdatomic.h "atomic_int foo; atomic_store(&foo, 0)"
  4089. check_lib ole32 "windows.h" CoTaskMemFree -lole32
  4090. check_lib shell32 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  4091. check_lib wincrypt "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  4092. check_lib psapi "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  4093. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  4094. check_type "cuviddec.h" "CUVIDH264PICPARAMS"
  4095. check_type "cuviddec.h" "CUVIDHEVCPICPARAMS"
  4096. check_struct "cuviddec.h" "CUVIDDECODECREATEINFO" bitDepthMinus8
  4097. check_type "windows.h dxva.h" "DXVA_PicParams_HEVC" -DWINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP -D_CRT_BUILD_DESKTOP_APP=0
  4098. check_type "windows.h d3d11.h" "ID3D11VideoDecoder"
  4099. check_type "d3d9.h dxva2api.h" DXVA2_ConfigPictureDecode -D_WIN32_WINNT=0x0602
  4100. check_type "va/va.h va/va_dec_hevc.h" "VAPictureParameterBufferHEVC"
  4101. check_type "va/va.h va/va_dec_vp8.h" "VAPictureParameterBufferVP8"
  4102. check_type "va/va.h va/va_vpp.h" "VAProcPipelineParameterBuffer"
  4103. check_type "va/va.h va/va_enc_h264.h" "VAEncPictureParameterBufferH264"
  4104. check_type "va/va.h va/va_enc_hevc.h" "VAEncPictureParameterBufferHEVC"
  4105. check_type "va/va.h va/va_enc_jpeg.h" "VAEncPictureParameterBufferJPEG"
  4106. check_type "va/va.h va/va_enc_mpeg2.h" "VAEncPictureParameterBufferMPEG2"
  4107. check_type "va/va.h va/va_enc_vp8.h" "VAEncPictureParameterBufferVP8"
  4108. check_type "va/va.h va/va_enc_vp9.h" "VAEncPictureParameterBufferVP9"
  4109. check_type "vdpau/vdpau.h" "VdpPictureInfoHEVC"
  4110. if ! disabled w32threads && ! enabled pthreads; then
  4111. check_lib w32threads "windows.h process.h" _beginthreadex
  4112. fi
  4113. # check for some common methods of building with pthread support
  4114. # do this before the optional library checks as some of them require pthreads
  4115. if ! disabled pthreads && ! enabled w32threads; then
  4116. if check_lib pthreads pthread.h pthread_join -pthread; then
  4117. add_cflags -pthread
  4118. elif check_lib pthreads pthread.h pthread_join -pthreads; then
  4119. add_cflags -pthreads
  4120. elif check_lib pthreads pthread.h pthread_join -lpthreadGC2; then
  4121. :
  4122. elif check_lib pthreads pthread.h pthread_join -lpthread; then
  4123. :
  4124. elif check_func pthread_join; then
  4125. enable pthreads
  4126. fi
  4127. fi
  4128. enabled pthreads &&
  4129. check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" $pthreads_extralibs
  4130. disabled zlib || check_lib zlib zlib.h zlibVersion -lz
  4131. disabled bzlib || check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2
  4132. # On some systems dynamic loading requires no extra linker flags
  4133. check_lib libdl dlfcn.h dlopen || check_lib libdl dlfcn.h dlopen -ldl
  4134. check_lib libm math.h sin -lm
  4135. atan2f_args=2
  4136. ldexpf_args=2
  4137. powf_args=2
  4138. for func in $MATH_FUNCS; do
  4139. eval check_mathfunc $func \${${func}_args:-1} $libm_extralibs
  4140. done
  4141. # these are off by default, so fail if requested and not available
  4142. enabled avisynth && require_header avisynth/avisynth_c.h
  4143. enabled avxsynth && require_header avxsynth/avxsynth_c.h
  4144. enabled cuda && require cuda cuda.h cuInit -lcuda
  4145. enabled cuvid && require cuvid cuviddec.h cuvidCreateDecoder -lnvcuvid
  4146. enabled frei0r && require_header frei0r.h
  4147. enabled gnutls && require_pkg_config gnutls gnutls gnutls/gnutls.h gnutls_global_init &&
  4148. check_lib gmp gmp.h mpz_export -lgmp
  4149. enabled libbs2b && require_pkg_config libbs2b libbs2b bs2b.h bs2b_open
  4150. enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
  4151. enabled libdcadec && require libdcadec libdcadec/dca_context.h dcadec_context_create -ldcadec
  4152. enabled libfaac && require libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  4153. enabled libfdk_aac && require_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen
  4154. enabled libfontconfig && require_pkg_config libfontconfig fontconfig "fontconfig/fontconfig.h" FcInit
  4155. enabled libfreetype && require_pkg_config libfreetype freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
  4156. enabled libgsm && require libgsm gsm.h gsm_create -lgsm
  4157. enabled libhdcd && require_pkg_config libhdcd libhdcd "hdcd/hdcd_simple.h" hdcd_new
  4158. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  4159. enabled libkvazaar && require_pkg_config libkvazaar "kvazaar >= 0.8.1" kvazaar.h kvz_api_get
  4160. enabled libmfx && require_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit
  4161. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  4162. enabled libnpp && require libnpp npp.h nppGetLibVersion -lnppi -lnppc
  4163. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  4164. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  4165. enabled libopencv && require_pkg_config libopencv opencv opencv/cv.h cvCreateImageHeader
  4166. enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
  4167. enabled libopenjpeg && { check_lib libopenjpeg openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC ||
  4168. require_pkg_config libopenjpeg libopenjpeg1 openjpeg.h opj_version -DOPJ_STATIC; }
  4169. enabled libopus && require_pkg_config libopus opus opus_multistream.h opus_multistream_decoder_create
  4170. enabled libpulse && require_pkg_config libpulse libpulse-simple pulse/simple.h pa_simple_new
  4171. enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
  4172. enabled libschroedinger && require_pkg_config libschroedinger schroedinger-1.0 schroedinger/schro.h schro_init
  4173. enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy
  4174. enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init
  4175. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  4176. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame
  4177. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  4178. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  4179. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  4180. enabled libvpx && require_pkg_config libvpx "vpx >= 1.3.0" vpx/vpx_codec.h vpx_codec_version &&
  4181. { enabled libvpx_vp8_decoder &&
  4182. check_pkg_config libvpx_vp8_decoder vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp8_dx
  4183. enabled libvpx_vp8_encoder &&
  4184. check_pkg_config libvpx_vp8_encoder vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp8_cx
  4185. enabled libvpx_vp9_decoder &&
  4186. check_pkg_config libvpx_vp9_decoder vpx "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_vp9_dx
  4187. enabled libvpx_vp9_encoder &&
  4188. check_pkg_config libvpx_vp9_encoder vpx "vpx/vpx_encoder.h vpx/vp8cx.h" vpx_codec_vp9_cx
  4189. disabled_all libvpx_vp8_decoder libvpx_vp9_decoder libvpx_vp8_encoder libvpx_vp9_encoder &&
  4190. die "libvpx enabled but no supported decoders/encoders found"
  4191. }
  4192. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  4193. enabled libwebp && require_pkg_config libwebp libwebp webp/encode.h WebPGetEncoderVersion
  4194. enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
  4195. require_cpp_condition x264.h "X264_BUILD >= 118" &&
  4196. { check_cpp_condition x264.h "X264_MPEG2" &&
  4197. enable libx262; }
  4198. enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get &&
  4199. require_cpp_condition x265.h "X265_BUILD >= 57"
  4200. enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode -lxavs
  4201. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  4202. enabled mmal && { check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host ||
  4203. { ! enabled cross_compile &&
  4204. add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
  4205. add_ldflags -L/opt/vc/lib/ &&
  4206. check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host; } ||
  4207. die "ERROR: mmal not found" &&
  4208. check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
  4209. enabled nvenc && require_cpp_condition nvEncodeAPI.h "NVENCAPI_MAJOR_VERSION >= 6"
  4210. enabled omx && require_header OMX_Core.h
  4211. enabled omx_rpi && { check_header OMX_Core.h ||
  4212. { ! enabled cross_compile && add_cflags -isystem/opt/vc/include/IL && check_header OMX_Core.h ; } ||
  4213. die "ERROR: OpenMAX IL headers not found"; } && enable omx
  4214. enabled openssl && { { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
  4215. check_pkg_config openssl openssl openssl/ssl.h SSL_library_init; } ||
  4216. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  4217. check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  4218. check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  4219. die "ERROR: openssl not found"; }
  4220. # SDL adds some CFLAGS that should not be part of the general CFLAGS.
  4221. enabled avplay &&
  4222. test_pkg_config sdl "sdl >= 1.2.1 sdl < 1.3.0" SDL_events.h SDL_PollEvent
  4223. ! disabled pod2man && check_cmd pod2man --help && enable pod2man || disable pod2man
  4224. ! disabled texi2html && check_cmd texi2html -version && enable texi2html || disable texi2html
  4225. check_header linux/fb.h
  4226. check_header linux/videodev2.h
  4227. check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
  4228. check_header AVFoundation/AVFoundation.h
  4229. check_header sys/videoio.h
  4230. check_lib user32 "windows.h winuser.h" GetShellWindow -luser32
  4231. check_lib vfw32 "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  4232. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  4233. # w32api 3.12 had it defined wrong
  4234. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  4235. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  4236. check_header "dev/bktr/ioctl_meteor.h dev/bktr/ioctl_bt848.h" ||
  4237. check_header "machine/ioctl_meteor.h machine/ioctl_bt848.h" ||
  4238. check_header "dev/video/meteor/ioctl_meteor.h dev/video/bktr/ioctl_bt848.h" ||
  4239. check_header "dev/ic/bt8xx.h"
  4240. check_header sys/soundcard.h
  4241. enabled alsa_indev &&
  4242. check_lib alsa alsa/asoundlib.h snd_pcm_htimestamp -lasound
  4243. enabled libjack &&
  4244. require_pkg_config libjack jack jack/jack.h jack_port_get_latency_range
  4245. enabled sndio_indev && check_lib sndio sndio.h sio_open -lsndio
  4246. if enabled libcdio; then
  4247. check_lib libcdio "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4248. check_lib libcdio "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4249. die "ERROR: No usable libcdio/cdparanoia found"
  4250. fi
  4251. if enabled libxcb; then
  4252. require_pkg_config libxcb xcb xcb/xcb.h xcb_connect
  4253. require_pkg_config libxcb_shape xcb-shape xcb/shape.h xcb_shape_rectangles
  4254. disabled libxcb_shm ||
  4255. check_pkg_config libxcb_shm xcb-shm xcb/shm.h xcb_shm_attach
  4256. disabled libxcb_xfixes ||
  4257. check_pkg_config libxcb_xfixes xcb-xfixes xcb/xfixes.h xcb_xfixes_get_cursor_image
  4258. fi
  4259. # d3d11va requires linking directly to dxgi and d3d11 if not building for
  4260. # the desktop api partition
  4261. check_cpp <<EOF && enable uwp && d3d11va_extralibs="-ldxgi -ld3d11"
  4262. #ifdef WINAPI_FAMILY
  4263. #include <winapifamily.h>
  4264. #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
  4265. #error desktop, not uwp
  4266. #else
  4267. // WINAPI_FAMILY_APP, WINAPI_FAMILY_PHONE_APP => UWP
  4268. #endif
  4269. #else
  4270. #error no family set
  4271. #endif
  4272. EOF
  4273. enabled vaapi && require vaapi va/va.h vaInitialize -lva
  4274. enabled vaapi &&
  4275. check_code cc "va/va.h" "vaCreateSurfaces(0, 0, 0, 0, 0, 0, 0, 0)" ||
  4276. disable vaapi
  4277. enabled vaapi &&
  4278. check_lib vaapi_drm "va/va.h va/va_drm.h" vaGetDisplayDRM -lva -lva-drm
  4279. enabled vaapi &&
  4280. check_lib vaapi_x11 "va/va.h va/va_x11.h" vaGetDisplay -lva -lva-x11 -lX11
  4281. enabled vaapi &&
  4282. check_cpp_condition "va/va.h" "VA_CHECK_VERSION(1, 0, 0)" &&
  4283. enable vaapi_1
  4284. enabled vdpau &&
  4285. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  4286. disable vdpau
  4287. enabled vdpau &&
  4288. check_lib vdpau_x11 "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau -lX11
  4289. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  4290. # add some useful compiler flags if supported
  4291. check_cflags -Wdeclaration-after-statement
  4292. check_cflags -Wall
  4293. check_cflags -Wdisabled-optimization
  4294. check_cflags -Wpointer-arith
  4295. check_cflags -Wredundant-decls
  4296. check_cflags -Wwrite-strings
  4297. check_cflags -Wtype-limits
  4298. check_cflags -Wundef
  4299. check_cflags -Wmissing-prototypes
  4300. check_cflags -Wstrict-prototypes
  4301. if enabled extra_warnings; then
  4302. check_cflags -Wcast-qual
  4303. check_cflags -Wextra
  4304. check_cflags -Wpedantic
  4305. fi
  4306. check_disable_warning(){
  4307. warning_flag=-W${1#-Wno-}
  4308. test_cflags $warning_flag && add_cflags $1
  4309. }
  4310. check_disable_warning -Wno-parentheses
  4311. check_disable_warning -Wno-switch
  4312. check_disable_warning -Wno-format-zero-length
  4313. check_disable_warning -Wno-pointer-sign
  4314. check_disable_warning_headers(){
  4315. warning_flag=-W${1#-Wno-}
  4316. test_cflags $warning_flag && add_cflags_headers $1
  4317. }
  4318. check_disable_warning_headers -Wno-deprecated-declarations
  4319. check_disable_warning_headers -Wno-unused-variable
  4320. check_objcflags -fobjc-arc && enable objc_arc
  4321. check_cc <<EOF && enable blocks_extension
  4322. void (^block)(void);
  4323. EOF
  4324. # add some linker flags
  4325. check_ldflags -Wl,--warn-common
  4326. check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  4327. enabled rpath && add_ldexeflags -Wl,-rpath,$libdir && add_ldsoflags -Wl,-rpath,$libdir
  4328. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  4329. # add some strip flags
  4330. # -wN '..@*' is more selective than -x, but not available everywhere.
  4331. check_stripflags -wN \'..@*\' || check_stripflags -x || strip='true'
  4332. enabled neon_clobber_test &&
  4333. check_ldflags -Wl,--wrap,avcodec_open2 \
  4334. -Wl,--wrap,avcodec_decode_audio4 \
  4335. -Wl,--wrap,avcodec_decode_video2 \
  4336. -Wl,--wrap,avcodec_decode_subtitle2 \
  4337. -Wl,--wrap,avcodec_encode_audio2 \
  4338. -Wl,--wrap,avcodec_encode_video2 \
  4339. -Wl,--wrap,avcodec_encode_subtitle \
  4340. -Wl,--wrap,avcodec_send_packet \
  4341. -Wl,--wrap,avcodec_receive_packet \
  4342. -Wl,--wrap,avcodec_send_frame \
  4343. -Wl,--wrap,avcodec_receive_frame \
  4344. -Wl,--wrap,avresample_convert ||
  4345. disable neon_clobber_test
  4346. enabled xmm_clobber_test &&
  4347. check_ldflags -Wl,--wrap,avcodec_open2 \
  4348. -Wl,--wrap,avcodec_decode_audio4 \
  4349. -Wl,--wrap,avcodec_decode_video2 \
  4350. -Wl,--wrap,avcodec_decode_subtitle2 \
  4351. -Wl,--wrap,avcodec_encode_audio2 \
  4352. -Wl,--wrap,avcodec_encode_video2 \
  4353. -Wl,--wrap,avcodec_encode_subtitle \
  4354. -Wl,--wrap,avcodec_send_packet \
  4355. -Wl,--wrap,avcodec_receive_packet \
  4356. -Wl,--wrap,avcodec_send_frame \
  4357. -Wl,--wrap,avcodec_receive_frame \
  4358. -Wl,--wrap,avresample_convert \
  4359. -Wl,--wrap,sws_scale ||
  4360. disable xmm_clobber_test
  4361. check_ld <<EOF && enable proper_dce
  4362. extern const int array[512];
  4363. static inline int func(void) { return array[0]; }
  4364. int main(void) { return 0; }
  4365. EOF
  4366. if enabled proper_dce; then
  4367. echo "X { local: *; };" > $TMPV
  4368. if test_ldflags -Wl,${version_script},$TMPV; then
  4369. append SHFLAGS '-Wl,${version_script},\$(SUBDIR)lib\$(NAME).ver'
  4370. check_cc <<EOF && enable symver_asm_label
  4371. void ff_foo(void) __asm__ ("av_foo@VERSION");
  4372. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  4373. EOF
  4374. check_cc <<EOF && enable symver_gnu_asm
  4375. __asm__(".symver ff_foo,av_foo@VERSION");
  4376. void ff_foo(void) {}
  4377. EOF
  4378. fi
  4379. fi
  4380. if [ -z "$optflags" ]; then
  4381. if enabled small; then
  4382. optflags=$cflags_size
  4383. elif enabled optimizations; then
  4384. optflags=$cflags_speed
  4385. else
  4386. optflags=$cflags_noopt
  4387. fi
  4388. fi
  4389. check_optflags(){
  4390. check_cflags "$@"
  4391. enabled lto && check_ldflags "$@"
  4392. }
  4393. check_optflags $optflags
  4394. check_optflags -fno-math-errno
  4395. check_optflags -fno-signed-zeros
  4396. if enabled lto; then
  4397. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  4398. check_cflags -flto
  4399. check_ldflags -flto $cpuflags
  4400. fi
  4401. if enabled icc; then
  4402. # Just warnings, no remarks
  4403. check_cflags -w1
  4404. # -wd: Disable following warnings
  4405. # 144, 167, 556: -Wno-pointer-sign
  4406. # 1292: attribute "foo" ignored
  4407. # 1419: external declaration in primary source file
  4408. # 10006: ignoring unknown option -fno-signed-zeros
  4409. # 10148: ignoring unknown option -Wno-parentheses
  4410. # 10156: ignoring option '-W'; no argument required
  4411. check_cflags -wd144,167,556,1292,1419,10006,10148,10156
  4412. # 11030: Warning unknown option --as-needed
  4413. # 10156: ignoring option '-export'; no argument required
  4414. check_ldflags -wd10156,11030
  4415. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  4416. enable ebp_available
  4417. if enabled x86_32; then
  4418. icc_version=$($cc -dumpversion)
  4419. test ${icc_version%%.*} -ge 11 &&
  4420. check_cflags -falign-stack=maintain-16-byte ||
  4421. disable aligned_stack
  4422. fi
  4423. elif enabled gcc; then
  4424. check_optflags -fno-tree-vectorize
  4425. check_cflags -Werror=implicit-function-declaration
  4426. check_cflags -Werror=missing-prototypes
  4427. check_cflags -Werror=return-type
  4428. check_cflags -Werror=declaration-after-statement
  4429. check_cflags -Werror=vla
  4430. check_cflags -Werror=format-security
  4431. check_cflags -fdiagnostics-color=auto
  4432. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  4433. elif enabled llvm_gcc; then
  4434. check_cflags -mllvm -stack-alignment=16
  4435. elif enabled clang; then
  4436. check_cflags -mllvm -stack-alignment=16
  4437. check_cflags -Qunused-arguments
  4438. check_cflags -Werror=implicit-function-declaration
  4439. check_cflags -Werror=missing-prototypes
  4440. check_cflags -Werror=return-type
  4441. elif enabled cparser; then
  4442. add_cflags -Wno-missing-variable-declarations
  4443. add_cflags -Wno-empty-statement
  4444. elif enabled armcc; then
  4445. add_cflags -W${armcc_opt},--diag_suppress=4343 # hardfp compat
  4446. add_cflags -W${armcc_opt},--diag_suppress=3036 # using . as system include dir
  4447. # 2523: use of inline assembly is deprecated
  4448. add_cflags -W${armcc_opt},--diag_suppress=2523
  4449. add_cflags -W${armcc_opt},--diag_suppress=1207
  4450. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  4451. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  4452. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  4453. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  4454. elif enabled pathscale; then
  4455. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  4456. disable inline_asm
  4457. elif enabled_any msvc icl; then
  4458. enabled x86_32 && disable aligned_stack
  4459. enabled_all x86_32 debug && add_cflags -Oy-
  4460. enabled debug && add_ldflags -debug
  4461. enable pragma_deprecated
  4462. if enabled icl; then
  4463. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  4464. # (correctly) on icl 13.x.
  4465. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  4466. add_cflags -Qansi-alias
  4467. # icl will pass the inline asm tests but inline asm is currently
  4468. # not supported (build will fail)
  4469. disable inline_asm
  4470. fi
  4471. # msvcrt10 x64 incorrectly enables log2, only msvcrt12 (MSVC 2013) onwards actually has log2.
  4472. check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
  4473. # The CRT headers contain __declspec(restrict) in a few places, but if redefining
  4474. # restrict, this might break. MSVC 2010 and 2012 fail with __declspec(__restrict)
  4475. # (as it ends up if the restrict redefine is done before including stdlib.h), while
  4476. # MSVC 2013 and newer can handle it fine.
  4477. # If this declspec fails, force including stdlib.h before the restrict redefinition
  4478. # happens in config.h.
  4479. if [ $_restrict != restrict ]; then
  4480. check_cc <<EOF || add_cflags -FIstdlib.h
  4481. __declspec($_restrict) void* foo(int);
  4482. EOF
  4483. fi
  4484. fi
  4485. for pfx in "" host_; do
  4486. varname=${pfx%_}cc_type
  4487. eval "type=\$$varname"
  4488. if [ "$type" = "msvc" ]; then
  4489. check_${pfx}cc <<EOF || add_${pfx}cflags -Dinline=__inline
  4490. static inline int foo(int a) { return a; }
  4491. EOF
  4492. fi
  4493. done
  4494. case $as_type in
  4495. clang)
  4496. add_asflags -Qunused-arguments
  4497. ;;
  4498. esac
  4499. case $ld_type in
  4500. clang)
  4501. check_ldflags -Qunused-arguments
  4502. ;;
  4503. esac
  4504. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  4505. check_deps $CONFIG_LIST \
  4506. $CONFIG_EXTRA \
  4507. $HAVE_LIST \
  4508. $ALL_COMPONENTS \
  4509. flatten_extralibs(){
  4510. unset nested_entries
  4511. list_name=$1
  4512. eval list=\$${1}
  4513. for entry in $list; do
  4514. entry_copy=$entry
  4515. resolve entry_copy
  4516. append nested_entries $(filter '*_extralibs' $entry_copy)
  4517. flat_entries=$(filter_out '*_extralibs' $entry_copy)
  4518. eval $entry="\$flat_entries"
  4519. done
  4520. append $list_name "$nested_entries"
  4521. resolve nested_entries
  4522. if test -n "$(filter '*_extralibs' $nested_entries)"; then
  4523. flatten_extralibs $list_name
  4524. fi
  4525. }
  4526. for linkunit in $LIBRARY_LIST; do
  4527. unset current_extralibs
  4528. eval components=\$$(toupper ${linkunit})_COMPONENTS_LIST
  4529. for comp in ${components}; do
  4530. enabled $comp || continue
  4531. comp_extralibs="${comp}_extralibs"
  4532. append current_extralibs $comp_extralibs
  4533. done
  4534. eval prepend ${linkunit}_extralibs $current_extralibs
  4535. done
  4536. for linkunit in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  4537. flatten_extralibs ${linkunit}_extralibs
  4538. unique ${linkunit}_extralibs
  4539. resolve ${linkunit}_extralibs
  4540. eval ${linkunit}_extralibs=\$\(\$ldflags_filter \$${linkunit}_extralibs\)
  4541. done
  4542. map 'enabled $v && intrinsics=${v#intrinsics_}' $INTRINSICS_LIST
  4543. for thread in $THREADS_LIST; do
  4544. if enabled $thread; then
  4545. test -n "$thread_type" &&
  4546. die "ERROR: Only one thread type must be selected." ||
  4547. thread_type="$thread"
  4548. fi
  4549. done
  4550. if disabled stdatomic; then
  4551. if enabled atomics_gcc; then
  4552. add_cppflags '-I\$(SRC_PATH)/compat/atomics/gcc'
  4553. elif enabled atomics_win32; then
  4554. add_cppflags '-I\$(SRC_PATH)/compat/atomics/win32'
  4555. elif enabled atomics_suncc; then
  4556. add_cppflags '-I\$(SRC_PATH)/compat/atomics/suncc'
  4557. elif enabled pthreads; then
  4558. add_compat atomics/pthread/stdatomic.o
  4559. add_cppflags '-I\$(SRC_PATH)/compat/atomics/pthread'
  4560. else
  4561. enabled threads && die "Threading is enabled, but no atomics are available"
  4562. add_cppflags '-I\$(SRC_PATH)/compat/atomics/dummy'
  4563. fi
  4564. fi
  4565. enabled zlib && add_cppflags -DZLIB_CONST
  4566. # conditional library dependencies, in linking order
  4567. enabled movie_filter && prepend avfilter_deps "avformat avcodec"
  4568. enabled_any asyncts_filter resample_filter &&
  4569. prepend avfilter_deps "avresample"
  4570. enabled scale_filter && prepend avfilter_deps "swscale"
  4571. enabled opus_decoder && prepend avcodec_deps "avresample"
  4572. expand_deps(){
  4573. lib_deps=${1}_deps
  4574. eval "deps=\$$lib_deps"
  4575. append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
  4576. unique $lib_deps
  4577. }
  4578. map 'expand_deps $v' $LIBRARY_LIST
  4579. if test "$quiet" != "yes"; then
  4580. echo "install prefix $prefix"
  4581. echo "source path $source_path"
  4582. echo "C compiler $cc"
  4583. echo "C library $libc_type"
  4584. if test "$host_cc" != "$cc"; then
  4585. echo "host C compiler $host_cc"
  4586. echo "host C library $host_libc_type"
  4587. fi
  4588. echo "ARCH $arch ($cpu)"
  4589. if test "$extra_version" != ""; then
  4590. echo "version string suffix $extra_version"
  4591. fi
  4592. echo "big-endian ${bigendian-no}"
  4593. echo "runtime cpu detection ${runtime_cpudetect-no}"
  4594. if enabled x86; then
  4595. echo "standalone assembly ${x86asm-no}"
  4596. echo "x86 assembler ${x86asmexe}"
  4597. echo "MMX enabled ${mmx-no}"
  4598. echo "MMXEXT enabled ${mmxext-no}"
  4599. echo "3DNow! enabled ${amd3dnow-no}"
  4600. echo "3DNow! extended enabled ${amd3dnowext-no}"
  4601. echo "SSE enabled ${sse-no}"
  4602. echo "SSSE3 enabled ${ssse3-no}"
  4603. echo "AVX enabled ${avx-no}"
  4604. echo "XOP enabled ${xop-no}"
  4605. echo "FMA3 enabled ${fma3-no}"
  4606. echo "FMA4 enabled ${fma4-no}"
  4607. echo "i686 features enabled ${i686-no}"
  4608. echo "CMOV is fast ${fast_cmov-no}"
  4609. echo "EBX available ${ebx_available-no}"
  4610. echo "EBP available ${ebp_available-no}"
  4611. fi
  4612. if enabled aarch64; then
  4613. echo "NEON enabled ${neon-no}"
  4614. echo "VFP enabled ${vfp-no}"
  4615. fi
  4616. if enabled arm; then
  4617. echo "ARMv5TE enabled ${armv5te-no}"
  4618. echo "ARMv6 enabled ${armv6-no}"
  4619. echo "ARMv6T2 enabled ${armv6t2-no}"
  4620. echo "VFP enabled ${vfp-no}"
  4621. echo "NEON enabled ${neon-no}"
  4622. fi
  4623. if enabled ppc; then
  4624. echo "AltiVec enabled ${altivec-no}"
  4625. echo "VSX enabled ${vsx-no}"
  4626. echo "POWER8 enabled ${power8-no}"
  4627. echo "PPC 4xx optimizations ${ppc4xx-no}"
  4628. echo "dcbzl available ${dcbzl-no}"
  4629. fi
  4630. echo "debug symbols ${debug-no}"
  4631. echo "optimize for size ${small-no}"
  4632. echo "optimizations ${optimizations-no}"
  4633. echo "static ${static-no}"
  4634. echo "shared ${shared-no}"
  4635. echo "network support ${network-no}"
  4636. echo "threading support ${thread_type-no}"
  4637. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  4638. echo "External libraries:"
  4639. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
  4640. echo
  4641. echo "External libraries providing hardware acceleration:"
  4642. print_enabled '' $HWACCEL_LIBRARY_LIST | print_3_columns
  4643. echo
  4644. echo "Libraries:"
  4645. print_enabled '' $LIBRARY_LIST | print_3_columns
  4646. echo
  4647. echo "Programs:"
  4648. print_enabled '' $PROGRAM_LIST | print_3_columns
  4649. echo
  4650. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev; do
  4651. echo "Enabled ${type}s:"
  4652. eval list=\$$(toupper $type)_LIST
  4653. print_enabled '_*' $list | print_3_columns
  4654. echo
  4655. done
  4656. if test -n "$ignore_tests"; then
  4657. ignore_tests=$(echo $ignore_tests | tr ',' ' ')
  4658. echo "Ignored FATE tests:"
  4659. echo $ignore_tests | print_3_columns
  4660. echo
  4661. fi
  4662. license="LGPL version 2.1 or later"
  4663. if enabled nonfree; then
  4664. license="nonfree and unredistributable"
  4665. elif enabled gplv3; then
  4666. license="GPL version 3 or later"
  4667. elif enabled lgplv3; then
  4668. license="LGPL version 3 or later"
  4669. elif enabled gpl; then
  4670. license="GPL version 2 or later"
  4671. fi
  4672. echo "License: $license"
  4673. fi # test "$quiet" != "yes"
  4674. test -n "$WARNINGS" && printf "\n$WARNINGS"
  4675. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  4676. esc(){
  4677. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  4678. }
  4679. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" > avbuild/config.fate
  4680. config_files="$TMPH avbuild/config.mak"
  4681. cat > avbuild/config.mak <<EOF
  4682. # Automatically generated by configure - do not modify!
  4683. LIBAV_CONFIGURATION=$LIBAV_CONFIGURATION
  4684. prefix=$prefix
  4685. LIBDIR=\$(DESTDIR)$libdir
  4686. SHLIBDIR=\$(DESTDIR)$shlibdir
  4687. INCDIR=\$(DESTDIR)$incdir
  4688. BINDIR=\$(DESTDIR)$bindir
  4689. DATADIR=\$(DESTDIR)$datadir
  4690. DOCDIR=\$(DESTDIR)$docdir
  4691. MANDIR=\$(DESTDIR)$mandir
  4692. SRC_PATH=$source_path
  4693. CC_IDENT=$cc_ident
  4694. ARCH=$arch
  4695. INTRINSICS=$intrinsics
  4696. CC=$cc
  4697. AS=$as
  4698. OBJCC=$objcc
  4699. LD=$ld
  4700. DEPCC=$dep_cc
  4701. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  4702. DEPAS=$as
  4703. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  4704. X86ASM=$x86asmexe
  4705. DEPX86ASM=$x86asmexe
  4706. DEPX86ASMFLAGS=\$(X86ASMFLAGS)
  4707. AR=$ar
  4708. ARFLAGS=$arflags
  4709. AR_O=$ar_o
  4710. AR_CMD=$ar
  4711. NM_CMD=$nm
  4712. RANLIB=$ranlib
  4713. STRIP=$strip
  4714. LN_S=$ln_s
  4715. CPPFLAGS=$CPPFLAGS
  4716. CFLAGS=$CFLAGS
  4717. OBJCFLAGS=$OBJCFLAGS
  4718. ASFLAGS=$ASFLAGS
  4719. AS_C=$AS_C
  4720. AS_O=$AS_O
  4721. OBJCC_C=$OBJCC_C
  4722. OBJCC_E=$OBJCC_E
  4723. OBJCC_O=$OBJCC_O
  4724. CC_C=$CC_C
  4725. CC_E=$CC_E
  4726. CC_O=$CC_O
  4727. X86ASM_O=$X86ASM_O
  4728. LD_O=$LD_O
  4729. LD_LIB=$LD_LIB
  4730. LD_PATH=$LD_PATH
  4731. LDFLAGS=$LDFLAGS
  4732. LDEXEFLAGS=$LDEXEFLAGS
  4733. LDSOFLAGS=$LDSOFLAGS
  4734. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  4735. STRIPFLAGS=$STRIPFLAGS
  4736. X86ASMFLAGS=$X86ASMFLAGS
  4737. LIBPREF=$LIBPREF
  4738. LIBSUF=$LIBSUF
  4739. LIBNAME=$LIBNAME
  4740. SLIBPREF=$SLIBPREF
  4741. SLIBSUF=$SLIBSUF
  4742. EXESUF=$EXESUF
  4743. EXTRA_VERSION=$extra_version
  4744. CCDEP=$CCDEP
  4745. CCDEP_FLAGS=$CCDEP_FLAGS
  4746. ASDEP=$ASDEP
  4747. ASDEP_FLAGS=$ASDEP_FLAGS
  4748. X86ASMDEP=$X86ASMDEP
  4749. X86ASMDEP_FLAGS=$X86ASMDEP_FLAGS
  4750. CC_DEPFLAGS=$CC_DEPFLAGS
  4751. AS_DEPFLAGS=$AS_DEPFLAGS
  4752. X86ASM_DEPFLAGS=$X86ASM_DEPFLAGS
  4753. HOSTCC=$host_cc
  4754. HOSTLD=$host_ld
  4755. HOSTCFLAGS=$host_cflags
  4756. HOSTCPPFLAGS=$host_cppflags
  4757. HOSTEXESUF=$HOSTEXESUF
  4758. HOSTLDFLAGS=$host_ldflags
  4759. HOSTEXTRALIBS=$host_extralibs
  4760. DEPHOSTCC=$host_cc
  4761. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  4762. HOSTCCDEP=$HOSTCCDEP
  4763. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  4764. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  4765. HOSTCC_C=$HOSTCC_C
  4766. HOSTCC_O=$HOSTCC_O
  4767. HOSTLD_O=$HOSTLD_O
  4768. TARGET_EXEC=$target_exec $target_exec_args
  4769. TARGET_PATH=$target_path
  4770. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  4771. CFLAGS-avplay=$sdl_cflags
  4772. CFLAGS_HEADERS=$CFLAGS_HEADERS
  4773. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  4774. EXTRALIBS=$extralibs
  4775. COMPAT_OBJS=$compat_objs
  4776. INSTALL=install
  4777. SLIBNAME=${SLIBNAME}
  4778. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  4779. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  4780. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  4781. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  4782. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  4783. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  4784. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  4785. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  4786. VERSION_SCRIPT_POSTPROCESS_CMD=${VERSION_SCRIPT_POSTPROCESS_CMD}
  4787. SAMPLES:=${samples:-\$(LIBAV_SAMPLES)}
  4788. IGNORE_TESTS=$ignore_tests
  4789. EOF
  4790. map 'eval echo "${v}_FFLIBS=\$${v}_deps" >> avbuild/config.mak' $LIBRARY_LIST
  4791. for entry in $LIBRARY_LIST $PROGRAM_LIST $EXTRALIBS_LIST; do
  4792. eval echo "EXTRALIBS-${entry}=\$${entry}_extralibs" >> avbuild/config.mak
  4793. done
  4794. cat > $TMPH <<EOF
  4795. /* Automatically generated by configure - do not modify! */
  4796. #ifndef LIBAV_CONFIG_H
  4797. #define LIBAV_CONFIG_H
  4798. #define LIBAV_CONFIGURATION "$(c_escape $LIBAV_CONFIGURATION)"
  4799. #define LIBAV_LICENSE "$(c_escape $license)"
  4800. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  4801. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  4802. #define restrict $_restrict
  4803. #define EXTERN_PREFIX "${extern_prefix}"
  4804. #define EXTERN_ASM ${extern_prefix}
  4805. #define SLIBSUF "$SLIBSUF"
  4806. EOF
  4807. test -n "$malloc_prefix" &&
  4808. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  4809. if enabled x86asm; then
  4810. append config_files $TMPASM
  4811. cat > $TMPASM <<EOF
  4812. ; Automatically generated by configure - do not modify!
  4813. EOF
  4814. fi
  4815. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  4816. print_config ARCH_ "$config_files" $ARCH_LIST
  4817. print_config HAVE_ "$config_files" $HAVE_LIST
  4818. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  4819. $CONFIG_EXTRA \
  4820. $ALL_COMPONENTS \
  4821. echo "#endif /* LIBAV_CONFIG_H */" >> $TMPH
  4822. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  4823. cp_if_changed $TMPH config.h
  4824. touch avbuild/.config
  4825. enabled x86asm && cp_if_changed $TMPASM config.asm
  4826. cat > $TMPH <<EOF
  4827. /* Generated by libav configure */
  4828. #ifndef AVUTIL_AVCONFIG_H
  4829. #define AVUTIL_AVCONFIG_H
  4830. EOF
  4831. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  4832. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  4833. cp_if_changed $TMPH libavutil/avconfig.h
  4834. # generate the lists of enabled components
  4835. print_enabled_components(){
  4836. file=$1
  4837. struct_name=$2
  4838. name=$3
  4839. shift 3
  4840. echo "static const $struct_name * const $name[] = {" > $TMPH
  4841. for c in $*; do
  4842. enabled $c && printf " &ff_%s,\n" $c >> $TMPH
  4843. done
  4844. echo " NULL };" >> $TMPH
  4845. cp_if_changed $TMPH $file
  4846. }
  4847. print_enabled_components libavcodec/bsf_list.c AVBitStreamFilter bitstream_filters $BSF_LIST
  4848. print_enabled_components libavformat/protocol_list.c URLProtocol url_protocols $PROTOCOL_LIST
  4849. # Settings for pkg-config files
  4850. cat > $TMPH <<EOF
  4851. # Automatically generated by configure - do not modify!
  4852. shared=$shared
  4853. prefix=$prefix
  4854. libdir=$libdir
  4855. incdir=$incdir
  4856. source_path=${source_path}
  4857. LIBPREF=${LIBPREF}
  4858. LIBSUF=${LIBSUF}
  4859. extralibs_avutil="$avutil_extralibs"
  4860. extralibs_avcodec="$avcodec_extralibs"
  4861. extralibs_avformat="$avformat_extralibs"
  4862. extralibs_avdevice="$avdevice_extralibs"
  4863. extralibs_avfilter="$avfilter_extralibs"
  4864. extralibs_avresample="$avresample_extralibs"
  4865. extralibs_swscale="$swscale_extralibs"
  4866. EOF
  4867. for lib in $LIBRARY_LIST; do
  4868. lib_deps="$(eval echo \$${lib}_deps)"
  4869. echo ${lib}_deps=\"$lib_deps\" >> $TMPH
  4870. done
  4871. cp_if_changed $TMPH avbuild/config.sh