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.

4677 lines
137KB

  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. --list-decoders show all available decoders
  58. --list-encoders show all available encoders
  59. --list-hwaccels show all available hardware accelerators
  60. --list-demuxers show all available demuxers
  61. --list-muxers show all available muxers
  62. --list-parsers show all available parsers
  63. --list-protocols show all available protocols
  64. --list-bsfs show all available bitstream filters
  65. --list-indevs show all available input devices
  66. --list-outdevs show all available output devices
  67. --list-filters show all available filters
  68. Standard options:
  69. --logfile=FILE log tests and output to FILE [config.log]
  70. --disable-logging do not log configure debug information
  71. --prefix=PREFIX install in PREFIX [$prefix]
  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. Licensing options:
  80. --enable-gpl allow use of GPL code, the resulting libs
  81. and binaries will be under GPL [no]
  82. --enable-version3 upgrade (L)GPL to version 3 [no]
  83. --enable-nonfree allow use of nonfree code, the resulting libs
  84. and binaries will be unredistributable [no]
  85. Configuration options:
  86. --disable-static do not build static libraries [no]
  87. --enable-shared build shared libraries [no]
  88. --enable-small optimize for size instead of speed
  89. --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)
  90. --enable-gray enable full grayscale support (slower color)
  91. --disable-swscale-alpha disable alpha channel support in swscale
  92. --disable-all disable building components, libraries and programs
  93. Program options:
  94. --disable-programs do not build command line programs
  95. --disable-avconv disable avconv build
  96. --disable-avplay disable avplay build
  97. --disable-avprobe disable avprobe build
  98. --disable-avserver disable avserver build
  99. Component options:
  100. --disable-doc do not build documentation
  101. --disable-avdevice disable libavdevice build
  102. --disable-avcodec disable libavcodec build
  103. --disable-avformat disable libavformat build
  104. --disable-avutil disable libavutil build
  105. --disable-swscale disable libswscale build
  106. --disable-avfilter disable video filter support [no]
  107. --disable-avresample disable libavresample build [no]
  108. --disable-pthreads disable pthreads [auto]
  109. --disable-w32threads disable Win32 threads [auto]
  110. --disable-network disable network support [no]
  111. --disable-dct disable DCT code
  112. --disable-error-resilience disable error resilience code
  113. --disable-lsp disable LSP code
  114. --disable-lzo disable LZO decoder code
  115. --disable-mdct disable MDCT code
  116. --disable-rdft disable RDFT code
  117. --disable-fft disable FFT code
  118. Hardware accelerators:
  119. --enable-dxva2 enable DXVA2 code
  120. --enable-vaapi enable VAAPI code
  121. --enable-vda enable VDA code
  122. --enable-vdpau enable VDPAU code
  123. Individual component options:
  124. --disable-everything disable all components listed below
  125. --disable-encoder=NAME disable encoder NAME
  126. --enable-encoder=NAME enable encoder NAME
  127. --disable-encoders disable all encoders
  128. --disable-decoder=NAME disable decoder NAME
  129. --enable-decoder=NAME enable decoder NAME
  130. --disable-decoders disable all decoders
  131. --disable-hwaccel=NAME disable hwaccel NAME
  132. --enable-hwaccel=NAME enable hwaccel NAME
  133. --disable-hwaccels disable all hwaccels
  134. --disable-muxer=NAME disable muxer NAME
  135. --enable-muxer=NAME enable muxer NAME
  136. --disable-muxers disable all muxers
  137. --disable-demuxer=NAME disable demuxer NAME
  138. --enable-demuxer=NAME enable demuxer NAME
  139. --disable-demuxers disable all demuxers
  140. --enable-parser=NAME enable parser NAME
  141. --disable-parser=NAME disable parser NAME
  142. --disable-parsers disable all parsers
  143. --enable-bsf=NAME enable bitstream filter NAME
  144. --disable-bsf=NAME disable bitstream filter NAME
  145. --disable-bsfs disable all bitstream filters
  146. --enable-protocol=NAME enable protocol NAME
  147. --disable-protocol=NAME disable protocol NAME
  148. --disable-protocols disable all protocols
  149. --enable-indev=NAME enable input device NAME
  150. --disable-indev=NAME disable input device NAME
  151. --disable-indevs disable input devices
  152. --enable-outdev=NAME enable output device NAME
  153. --disable-outdev=NAME disable output device NAME
  154. --disable-outdevs disable output devices
  155. --disable-devices disable all devices
  156. --enable-filter=NAME enable filter NAME
  157. --disable-filter=NAME disable filter NAME
  158. --disable-filters disable all filters
  159. External library support:
  160. --enable-avisynth enable reading of AviSynth script files [no]
  161. --enable-bzlib enable bzlib [autodetect]
  162. --enable-frei0r enable frei0r video filtering
  163. --enable-gnutls enable gnutls [no]
  164. --enable-libcdio enable audio CD grabbing with libcdio
  165. --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
  166. and libraw1394 [no]
  167. --enable-libfaac enable AAC encoding via libfaac [no]
  168. --enable-libfdk-aac enable AAC de/encoding via libfdk-aac [no]
  169. --enable-libfreetype enable libfreetype [no]
  170. --enable-libgsm enable GSM de/encoding via libgsm [no]
  171. --enable-libilbc enable iLBC de/encoding via libilbc [no]
  172. --enable-libmp3lame enable MP3 encoding via libmp3lame [no]
  173. --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]
  174. --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
  175. --enable-libopencv enable video filtering via libopencv [no]
  176. --enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
  177. --enable-libopus enable Opus decoding via libopus [no]
  178. --enable-libpulse enable Pulseaudio input via libpulse [no]
  179. --enable-librtmp enable RTMP[E] support via librtmp [no]
  180. --enable-libschroedinger enable Dirac de/encoding via libschroedinger [no]
  181. --enable-libspeex enable Speex de/encoding via libspeex [no]
  182. --enable-libtheora enable Theora encoding via libtheora [no]
  183. --enable-libtwolame enable MP2 encoding via libtwolame [no]
  184. --enable-libvo-aacenc enable AAC encoding via libvo-aacenc [no]
  185. --enable-libvo-amrwbenc enable AMR-WB encoding via libvo-amrwbenc [no]
  186. --enable-libvorbis enable Vorbis encoding via libvorbis [no]
  187. --enable-libvpx enable VP8 and VP9 de/encoding via libvpx [no]
  188. --enable-libwavpack enable wavpack encoding via libwavpack [no]
  189. --enable-libwebp enable WebP encoding via libwebp [no]
  190. --enable-libx264 enable H.264 encoding via x264 [no]
  191. --enable-libx265 enable HEVC encoding via x265 [no]
  192. --enable-libxavs enable AVS encoding via xavs [no]
  193. --enable-libxvid enable Xvid encoding via xvidcore,
  194. native MPEG-4/Xvid encoder exists [no]
  195. --enable-openssl enable openssl [no]
  196. --enable-x11grab enable X11 grabbing [no]
  197. --enable-zlib enable zlib [autodetect]
  198. Toolchain options:
  199. --arch=ARCH select architecture [$arch]
  200. --cpu=CPU select the minimum required CPU (affects
  201. instruction selection, may crash on older CPUs)
  202. --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]
  203. --enable-cross-compile assume a cross-compiler is used
  204. --sysroot=PATH root of cross-build tree
  205. --sysinclude=PATH location of cross-build system headers
  206. --target-os=OS compiler targets OS [$target_os]
  207. --target-exec=CMD command to run executables on target
  208. --target-path=DIR path to view of build directory on target
  209. --target-samples=DIR path to samples directory on target
  210. --toolchain=NAME set tool defaults according to NAME
  211. --pkg-config=PKGCONFIG use pkg-config tool PKGCONFIG [$pkg_config_default]
  212. --nm=NM use nm tool
  213. --ar=AR use archive tool AR [$ar_default]
  214. --as=AS use assembler AS [$as_default]
  215. --cc=CC use C compiler CC [$cc_default]
  216. --dep-cc=DEPCC use dependency generator DEPCC [$cc_default]
  217. --ld=LD use linker LD
  218. --pkg-config=PKGCONF use pkg-config PKGCONF [$pkg_config_default]
  219. --pkg-config-flags=FLAGS pass additional flags to pkgconf []
  220. --host-cc=HOSTCC use host C compiler HOSTCC
  221. --host-cflags=HCFLAGS use HCFLAGS when compiling for host
  222. --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host
  223. --host-ld=HOSTLD use host linker HOSTLD
  224. --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host
  225. --host-libs=HLIBS use libs HLIBS when linking for host
  226. --host-os=OS compiler host OS [$target_os]
  227. --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]
  228. --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]
  229. --extra-libs=ELIBS add ELIBS [$ELIBS]
  230. --extra-version=STRING version string suffix []
  231. --optflags=OPTFLAGS override optimization-related compiler flags
  232. --build-suffix=SUFFIX library name suffix []
  233. --enable-pic build position-independent code
  234. --enable-thumb compile for Thumb instruction set
  235. --enable-lto use link-time optimization
  236. Advanced options (experts only):
  237. --malloc-prefix=PREFIX prefix malloc and related names with PREFIX
  238. --disable-symver disable symbol versioning
  239. --enable-hardcoded-tables use hardcoded tables instead of runtime generation
  240. --disable-safe-bitstream-reader
  241. disable buffer boundary checking in bitreaders
  242. (faster, but may crash)
  243. --enable-memalign-hack emulate memalign, interferes with memory debuggers
  244. --enable-sram allow use of on-chip SRAM
  245. Optimization options (experts only):
  246. --disable-asm disable all assembler optimizations
  247. --disable-altivec disable AltiVec optimizations
  248. --disable-amd3dnow disable 3DNow! optimizations
  249. --disable-amd3dnowext disable 3DNow! extended optimizations
  250. --disable-mmx disable MMX optimizations
  251. --disable-mmxext disable MMXEXT optimizations
  252. --disable-sse disable SSE optimizations
  253. --disable-sse2 disable SSE2 optimizations
  254. --disable-sse3 disable SSE3 optimizations
  255. --disable-ssse3 disable SSSE3 optimizations
  256. --disable-sse4 disable SSE4 optimizations
  257. --disable-sse42 disable SSE4.2 optimizations
  258. --disable-avx disable AVX optimizations
  259. --disable-xop disable XOP optimizations
  260. --disable-fma3 disable FMA3 optimizations
  261. --disable-fma4 disable FMA4 optimizations
  262. --disable-avx2 disable AVX2 optimizations
  263. --disable-armv5te disable armv5te optimizations
  264. --disable-armv6 disable armv6 optimizations
  265. --disable-armv6t2 disable armv6t2 optimizations
  266. --disable-vfp disable VFP optimizations
  267. --disable-neon disable NEON optimizations
  268. --disable-inline-asm disable use of inline assembler
  269. --disable-yasm disable use of yasm assembler
  270. Developer options (useful when working on Libav itself):
  271. --disable-debug disable debugging symbols
  272. --enable-debug=LEVEL set the debug level [$debuglevel]
  273. --disable-optimizations disable compiler optimizations
  274. --enable-extra-warnings enable more compiler warnings
  275. --samples=PATH location of test samples for FATE, if not set use
  276. \$LIBAV_SAMPLES at make invocation time.
  277. --enable-neon-clobber-test check NEON registers for clobbering (should be
  278. used only for debugging purposes)
  279. --enable-xmm-clobber-test check XMM registers for clobbering (Win64-only;
  280. should be used only for debugging purposes)
  281. --enable-random randomly enable/disable components
  282. --disable-random
  283. --enable-random=LIST randomly enable/disable specific components or
  284. --disable-random=LIST component groups. LIST is a comma-separated list
  285. of NAME[:PROB] entries where NAME is a component
  286. (group) and PROB the probability associated with
  287. NAME (default 0.5).
  288. --random-seed=VALUE seed value for --enable/disable-random
  289. NOTE: Object files are built at the place where configure is launched.
  290. EOF
  291. exit 0
  292. }
  293. quotes='""'
  294. log(){
  295. echo "$@" >> $logfile
  296. }
  297. log_file(){
  298. log BEGIN $1
  299. pr -n -t $1 >> $logfile
  300. log END $1
  301. }
  302. echolog(){
  303. log "$@"
  304. echo "$@"
  305. }
  306. warn(){
  307. log "WARNING: $*"
  308. WARNINGS="${WARNINGS}WARNING: $*\n"
  309. }
  310. die(){
  311. echolog "$@"
  312. cat <<EOF
  313. If you think configure made a mistake, make sure you are using the latest
  314. version from Git. If the latest version fails, report the problem to the
  315. libav-tools@libav.org mailing list or IRC #libav on irc.freenode.net.
  316. EOF
  317. if disabled logging; then
  318. cat <<EOF
  319. Rerun configure with logging enabled (do not use --disable-logging), and
  320. include the log this produces with your report.
  321. EOF
  322. else
  323. cat <<EOF
  324. Include the log file "$logfile" produced by configure as this will help
  325. solving the problem.
  326. EOF
  327. fi
  328. exit 1
  329. }
  330. # Avoid locale weirdness, besides we really just want to translate ASCII.
  331. toupper(){
  332. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  333. }
  334. tolower(){
  335. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  336. }
  337. c_escape(){
  338. echo "$*" | sed 's/["\\]/\\\0/g'
  339. }
  340. sh_quote(){
  341. v=$(echo "$1" | sed "s/'/'\\\\''/g")
  342. test "x$v" = "x${v#*[!A-Za-z0-9_/.+-]}" || v="'$v'"
  343. echo "$v"
  344. }
  345. cleanws(){
  346. echo "$@" | sed 's/^ *//;s/ */ /g;s/ *$//'
  347. }
  348. filter(){
  349. pat=$1
  350. shift
  351. for v; do
  352. eval "case $v in $pat) echo $v ;; esac"
  353. done
  354. }
  355. filter_out(){
  356. pat=$1
  357. shift
  358. for v; do
  359. eval "case $v in $pat) ;; *) echo $v ;; esac"
  360. done
  361. }
  362. map(){
  363. m=$1
  364. shift
  365. for v; do eval $m; done
  366. }
  367. add_suffix(){
  368. suffix=$1
  369. shift
  370. for v; do echo ${v}${suffix}; done
  371. }
  372. set_all(){
  373. value=$1
  374. shift
  375. for var in $*; do
  376. eval $var=$value
  377. done
  378. }
  379. set_weak(){
  380. value=$1
  381. shift
  382. for var; do
  383. eval : \${$var:=$value}
  384. done
  385. }
  386. sanitize_var_name(){
  387. echo $@ | sed 's/[^A-Za-z0-9_]/_/g'
  388. }
  389. set_safe(){
  390. var=$1
  391. shift
  392. eval $(sanitize_var_name "$var")='$*'
  393. }
  394. get_safe(){
  395. eval echo \$$(sanitize_var_name "$1")
  396. }
  397. pushvar(){
  398. for pvar in $*; do
  399. eval level=\${${pvar}_level:=0}
  400. eval ${pvar}_${level}="\$$pvar"
  401. eval ${pvar}_level=$(($level+1))
  402. done
  403. }
  404. popvar(){
  405. for pvar in $*; do
  406. eval level=\${${pvar}_level:-0}
  407. test $level = 0 && continue
  408. eval level=$(($level-1))
  409. eval $pvar="\${${pvar}_${level}}"
  410. eval ${pvar}_level=$level
  411. eval unset ${pvar}_${level}
  412. done
  413. }
  414. enable(){
  415. set_all yes $*
  416. }
  417. disable(){
  418. set_all no $*
  419. }
  420. enable_weak(){
  421. set_weak yes $*
  422. }
  423. disable_weak(){
  424. set_weak no $*
  425. }
  426. enable_safe(){
  427. for var; do
  428. enable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  429. done
  430. }
  431. disable_safe(){
  432. for var; do
  433. disable $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')
  434. done
  435. }
  436. do_enable_deep(){
  437. for var; do
  438. enabled $var && continue
  439. eval sel="\$${var}_select"
  440. eval sgs="\$${var}_suggest"
  441. pushvar var sgs
  442. enable_deep $sel
  443. popvar sgs
  444. enable_deep_weak $sgs
  445. popvar var
  446. done
  447. }
  448. enable_deep(){
  449. do_enable_deep $*
  450. enable $*
  451. }
  452. enable_deep_weak(){
  453. for var; do
  454. disabled $var && continue
  455. pushvar var
  456. do_enable_deep $var
  457. popvar var
  458. enable_weak $var
  459. done
  460. }
  461. enabled(){
  462. test "${1#!}" = "$1" && op== || op=!=
  463. eval test "x\$${1#!}" $op "xyes"
  464. }
  465. disabled(){
  466. test "${1#!}" = "$1" && op== || op=!=
  467. eval test "x\$${1#!}" $op "xno"
  468. }
  469. enabled_all(){
  470. for opt; do
  471. enabled $opt || return 1
  472. done
  473. }
  474. disabled_all(){
  475. for opt; do
  476. disabled $opt || return 1
  477. done
  478. }
  479. enabled_any(){
  480. for opt; do
  481. enabled $opt && return 0
  482. done
  483. }
  484. disabled_any(){
  485. for opt; do
  486. disabled $opt && return 0
  487. done
  488. return 1
  489. }
  490. set_default(){
  491. for opt; do
  492. eval : \${$opt:=\$${opt}_default}
  493. done
  494. }
  495. is_in(){
  496. value=$1
  497. shift
  498. for var in $*; do
  499. [ $var = $value ] && return 0
  500. done
  501. return 1
  502. }
  503. do_check_deps(){
  504. for cfg; do
  505. cfg="${cfg#!}"
  506. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  507. disabled ${cfg}_checking && continue
  508. enable ${cfg}_checking
  509. append allopts $cfg
  510. eval dep_all="\$${cfg}_deps"
  511. eval dep_any="\$${cfg}_deps_any"
  512. eval dep_sel="\$${cfg}_select"
  513. eval dep_sgs="\$${cfg}_suggest"
  514. eval dep_ifa="\$${cfg}_if"
  515. eval dep_ifn="\$${cfg}_if_any"
  516. pushvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  517. do_check_deps $dep_all $dep_any $dep_sel $dep_sgs $dep_ifa $dep_ifn
  518. popvar cfg dep_all dep_any dep_sel dep_sgs dep_ifa dep_ifn
  519. [ -n "$dep_ifa" ] && { enabled_all $dep_ifa && enable_weak $cfg; }
  520. [ -n "$dep_ifn" ] && { enabled_any $dep_ifn && enable_weak $cfg; }
  521. enabled_all $dep_all || disable $cfg
  522. enabled_any $dep_any || disable $cfg
  523. disabled_any $dep_sel && disable $cfg
  524. if enabled $cfg; then
  525. enable_deep $dep_sel
  526. enable_deep_weak $dep_sgs
  527. fi
  528. disable ${cfg}_checking
  529. done
  530. }
  531. check_deps(){
  532. unset allopts
  533. do_check_deps "$@"
  534. for cfg in $allopts; do
  535. enabled $cfg || continue
  536. eval dep_extralibs="\$${cfg}_extralibs"
  537. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  538. done
  539. }
  540. print_config(){
  541. pfx=$1
  542. files=$2
  543. shift 2
  544. map 'eval echo "$v \${$v:-no}"' "$@" |
  545. awk "BEGIN { split(\"$files\", files) }
  546. {
  547. c = \"$pfx\" toupper(\$1);
  548. v = \$2;
  549. sub(/yes/, 1, v);
  550. sub(/no/, 0, v);
  551. for (f in files) {
  552. file = files[f];
  553. if (file ~ /\\.h\$/) {
  554. printf(\"#define %s %d\\n\", c, v) >>file;
  555. } else if (file ~ /\\.asm\$/) {
  556. printf(\"%%define %s %d\\n\", c, v) >>file;
  557. } else if (file ~ /\\.mak\$/) {
  558. n = -v ? \"\" : \"!\";
  559. printf(\"%s%s=yes\\n\", n, c) >>file;
  560. }
  561. }
  562. }"
  563. }
  564. print_enabled(){
  565. suf=$1
  566. shift
  567. for v; do
  568. enabled $v && printf "%s\n" ${v%$suf};
  569. done
  570. }
  571. append(){
  572. var=$1
  573. shift
  574. eval "$var=\"\$$var $*\""
  575. }
  576. prepend(){
  577. var=$1
  578. shift
  579. eval "$var=\"$* \$$var\""
  580. }
  581. add_cppflags(){
  582. append CPPFLAGS "$@"
  583. }
  584. add_cflags(){
  585. append CFLAGS $($cflags_filter "$@")
  586. }
  587. add_asflags(){
  588. append ASFLAGS $($asflags_filter "$@")
  589. }
  590. add_ldflags(){
  591. append LDFLAGS $($ldflags_filter "$@")
  592. }
  593. add_stripflags(){
  594. append STRIPFLAGS "$@"
  595. }
  596. add_extralibs(){
  597. prepend extralibs $($ldflags_filter "$@")
  598. }
  599. add_host_cppflags(){
  600. append host_cppflags "$@"
  601. }
  602. add_host_cflags(){
  603. append host_cflags $($host_cflags_filter "$@")
  604. }
  605. add_host_ldflags(){
  606. append host_ldflags $($host_ldflags_filter "$@")
  607. }
  608. add_compat(){
  609. append compat_objs $1
  610. shift
  611. map 'add_cppflags -D$v' "$@"
  612. }
  613. check_cmd(){
  614. log "$@"
  615. "$@" >> $logfile 2>&1
  616. }
  617. cc_o(){
  618. eval printf '%s\\n' $CC_O
  619. }
  620. cc_e(){
  621. eval printf '%s\\n' $CC_E
  622. }
  623. check_cc(){
  624. log check_cc "$@"
  625. cat > $TMPC
  626. log_file $TMPC
  627. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $CC_C $(cc_o $TMPO) $TMPC
  628. }
  629. check_cpp(){
  630. log check_cpp "$@"
  631. cat > $TMPC
  632. log_file $TMPC
  633. check_cmd $cc $CPPFLAGS $CFLAGS "$@" $(cc_e $TMPO) $TMPC
  634. }
  635. as_o(){
  636. eval printf '%s\\n' $AS_O
  637. }
  638. check_as(){
  639. log check_as "$@"
  640. cat > $TMPS
  641. log_file $TMPS
  642. check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
  643. }
  644. check_inline_asm(){
  645. log check_inline_asm "$@"
  646. name="$1"
  647. code="$2"
  648. shift 2
  649. disable $name
  650. check_cc "$@" <<EOF && enable $name
  651. void foo(void){ __asm__ volatile($code); }
  652. EOF
  653. }
  654. check_insn(){
  655. log check_insn "$@"
  656. check_inline_asm ${1}_inline "\"$2\""
  657. echo "$2" | check_as && enable ${1}_external || disable ${1}_external
  658. }
  659. check_yasm(){
  660. log check_yasm "$@"
  661. echo "$1" > $TMPS
  662. log_file $TMPS
  663. shift 1
  664. check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
  665. }
  666. ld_o(){
  667. eval printf '%s\\n' $LD_O
  668. }
  669. check_ld(){
  670. log check_ld "$@"
  671. flags=$(filter_out '-l*' "$@")
  672. libs=$(filter '-l*' "$@")
  673. check_cc $($cflags_filter $flags) || return
  674. flags=$($ldflags_filter $flags)
  675. libs=$($ldflags_filter $libs)
  676. check_cmd $ld $LDFLAGS $flags $(ld_o $TMPE) $TMPO $libs $extralibs
  677. }
  678. print_include(){
  679. hdr=$1
  680. test "${hdr%.h}" = "${hdr}" &&
  681. echo "#include $hdr" ||
  682. echo "#include <$hdr>"
  683. }
  684. check_code(){
  685. log check_code "$@"
  686. check=$1
  687. headers=$2
  688. code=$3
  689. shift 3
  690. {
  691. for hdr in $headers; do
  692. print_include $hdr
  693. done
  694. echo "int main(void) { $code; return 0; }"
  695. } | check_$check "$@"
  696. }
  697. check_cppflags(){
  698. log check_cppflags "$@"
  699. check_cc "$@" <<EOF && append CPPFLAGS "$@"
  700. int x;
  701. EOF
  702. }
  703. test_cflags(){
  704. log test_cflags "$@"
  705. set -- $($cflags_filter "$@")
  706. check_cc "$@" <<EOF
  707. int x;
  708. EOF
  709. }
  710. check_cflags(){
  711. log check_cflags "$@"
  712. test_cflags "$@" && add_cflags "$@"
  713. }
  714. test_ldflags(){
  715. log test_ldflags "$@"
  716. check_ld "$@" <<EOF
  717. int main(void){ return 0; }
  718. EOF
  719. }
  720. check_ldflags(){
  721. log check_ldflags "$@"
  722. test_ldflags "$@" && add_ldflags "$@"
  723. }
  724. test_stripflags(){
  725. log test_stripflags "$@"
  726. # call check_cc to get a fresh TMPO
  727. check_cc <<EOF
  728. int main(void) { return 0; }
  729. EOF
  730. check_cmd $strip $STRIPFLAGS "$@" $TMPO
  731. }
  732. check_stripflags(){
  733. log check_stripflags "$@"
  734. test_stripflags "$@" && add_stripflags "$@"
  735. }
  736. check_header(){
  737. log check_header "$@"
  738. header=$1
  739. shift
  740. disable_safe $header
  741. check_cpp "$@" <<EOF && enable_safe $header
  742. #include <$header>
  743. int x;
  744. EOF
  745. }
  746. check_func(){
  747. log check_func "$@"
  748. func=$1
  749. shift
  750. disable $func
  751. check_ld "$@" <<EOF && enable $func
  752. extern int $func();
  753. int main(void){ $func(); }
  754. EOF
  755. }
  756. check_mathfunc(){
  757. log check_mathfunc "$@"
  758. func=$1
  759. narg=$2
  760. shift 2
  761. test $narg = 2 && args="f, g" || args="f"
  762. disable $func
  763. check_ld "$@" <<EOF && enable $func
  764. #include <math.h>
  765. float foo(float f, float g) { return $func($args); }
  766. int main(void){ return 0; }
  767. EOF
  768. }
  769. check_func_headers(){
  770. log check_func_headers "$@"
  771. headers=$1
  772. funcs=$2
  773. shift 2
  774. {
  775. for hdr in $headers; do
  776. print_include $hdr
  777. done
  778. for func in $funcs; do
  779. echo "long check_$func(void) { return (long) $func; }"
  780. done
  781. echo "int main(void) { return 0; }"
  782. } | check_ld "$@" && enable $funcs && enable_safe $headers
  783. }
  784. check_cpp_condition(){
  785. log check_cpp_condition "$@"
  786. header=$1
  787. condition=$2
  788. shift 2
  789. check_cpp "$@" <<EOF
  790. #include <$header>
  791. #if !($condition)
  792. #error "unsatisfied condition: $condition"
  793. #endif
  794. EOF
  795. }
  796. check_lib(){
  797. log check_lib "$@"
  798. header="$1"
  799. func="$2"
  800. shift 2
  801. check_header $header && check_func $func "$@" && add_extralibs "$@"
  802. }
  803. check_lib2(){
  804. log check_lib2 "$@"
  805. headers="$1"
  806. funcs="$2"
  807. shift 2
  808. check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
  809. }
  810. check_pkg_config(){
  811. log check_pkg_config "$@"
  812. pkg="$1"
  813. headers="$2"
  814. funcs="$3"
  815. shift 3
  816. check_cmd $pkg_config --exists --print-errors $pkg || return
  817. pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
  818. pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
  819. check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
  820. set_safe ${pkg}_cflags $pkg_cflags &&
  821. set_safe ${pkg}_libs $pkg_libs
  822. }
  823. check_exec(){
  824. check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  825. }
  826. check_exec_crash(){
  827. code=$(cat)
  828. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  829. # are safe but may not be available everywhere. Thus we use
  830. # raise(SIGTERM) instead. The check is run in a subshell so we
  831. # can redirect the "Terminated" message from the shell. SIGBUS
  832. # is not defined by standard C so it is used conditionally.
  833. (check_exec "$@") >> $logfile 2>&1 <<EOF
  834. #include <signal.h>
  835. static void sighandler(int sig){
  836. raise(SIGTERM);
  837. }
  838. int foo(void){
  839. $code
  840. }
  841. int (*func_ptr)(void) = foo;
  842. int main(void){
  843. signal(SIGILL, sighandler);
  844. signal(SIGFPE, sighandler);
  845. signal(SIGSEGV, sighandler);
  846. #ifdef SIGBUS
  847. signal(SIGBUS, sighandler);
  848. #endif
  849. return func_ptr();
  850. }
  851. EOF
  852. }
  853. check_type(){
  854. log check_type "$@"
  855. headers=$1
  856. type=$2
  857. shift 2
  858. disable_safe "$type"
  859. check_code cc "$headers" "$type v" "$@" && enable_safe "$type"
  860. }
  861. check_struct(){
  862. log check_struct "$@"
  863. headers=$1
  864. struct=$2
  865. member=$3
  866. shift 3
  867. disable_safe "${struct}_${member}"
  868. check_code cc "$headers" "const void *p = &(($struct *)0)->$member" "$@" &&
  869. enable_safe "${struct}_${member}"
  870. }
  871. check_builtin(){
  872. log check_builtin "$@"
  873. name=$1
  874. headers=$2
  875. builtin=$3
  876. shift 3
  877. disable "$name"
  878. check_code ld "$headers" "$builtin" "$@" && enable "$name"
  879. }
  880. check_compile_assert(){
  881. log check_compile_assert "$@"
  882. name=$1
  883. headers=$2
  884. condition=$3
  885. shift 3
  886. disable "$name"
  887. check_code cc "$headers" "char c[2 * !!($condition) - 1]" "$@" && enable "$name"
  888. }
  889. require(){
  890. name="$1"
  891. header="$2"
  892. func="$3"
  893. shift 3
  894. check_lib $header $func "$@" || die "ERROR: $name not found"
  895. }
  896. require2(){
  897. name="$1"
  898. headers="$2"
  899. func="$3"
  900. shift 3
  901. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  902. }
  903. require_pkg_config(){
  904. pkg="$1"
  905. check_pkg_config "$@" || die "ERROR: $pkg not found"
  906. add_cflags $(get_safe ${pkg}_cflags)
  907. add_extralibs $(get_safe ${pkg}_libs)
  908. }
  909. hostcc_e(){
  910. eval printf '%s\\n' $HOSTCC_E
  911. }
  912. hostcc_o(){
  913. eval printf '%s\\n' $HOSTCC_O
  914. }
  915. check_host_cc(){
  916. log check_host_cc "$@"
  917. cat > $TMPC
  918. log_file $TMPC
  919. check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC
  920. }
  921. check_host_cpp(){
  922. log check_host_cpp "$@"
  923. cat > $TMPC
  924. log_file $TMPC
  925. check_cmd $host_cc $HOSTCPPFLAGS $HOSTCFLAGS "$@" $(hostcc_e $TMPO) $TMPC
  926. }
  927. check_host_cppflags(){
  928. log check_host_cppflags "$@"
  929. check_host_cc "$@" <<EOF && append host_cppflags "$@"
  930. int x;
  931. EOF
  932. }
  933. check_host_cflags(){
  934. log check_host_cflags "$@"
  935. set -- $($host_cflags_filter "$@")
  936. check_host_cc "$@" <<EOF && append host_cflags "$@"
  937. int x;
  938. EOF
  939. }
  940. check_host_cpp_condition(){
  941. log check_host_cpp_condition "$@"
  942. header=$1
  943. condition=$2
  944. shift 2
  945. check_host_cpp "$@" <<EOF
  946. #include <$header>
  947. #if !($condition)
  948. #error "unsatisfied condition: $condition"
  949. #endif
  950. EOF
  951. }
  952. apply(){
  953. file=$1
  954. shift
  955. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  956. }
  957. cp_if_changed(){
  958. cmp -s "$1" "$2" && echo "$2 is unchanged" && return
  959. mkdir -p "$(dirname $2)"
  960. $cp_f "$1" "$2"
  961. }
  962. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  963. # system-dependent things.
  964. COMPONENT_LIST="
  965. bsfs
  966. decoders
  967. demuxers
  968. encoders
  969. filters
  970. hwaccels
  971. indevs
  972. muxers
  973. outdevs
  974. parsers
  975. protocols
  976. "
  977. EXAMPLE_LIST="
  978. avcodec_example
  979. filter_audio_example
  980. metadata_example
  981. output_example
  982. transcode_aac_example
  983. "
  984. EXTERNAL_LIBRARY_LIST="
  985. avisynth
  986. bzlib
  987. frei0r
  988. gnutls
  989. libcdio
  990. libdc1394
  991. libfaac
  992. libfdk_aac
  993. libfreetype
  994. libgsm
  995. libilbc
  996. libmp3lame
  997. libopencore_amrnb
  998. libopencore_amrwb
  999. libopencv
  1000. libopenjpeg
  1001. libopus
  1002. libpulse
  1003. librtmp
  1004. libschroedinger
  1005. libspeex
  1006. libtheora
  1007. libtwolame
  1008. libvo_aacenc
  1009. libvo_amrwbenc
  1010. libvorbis
  1011. libvpx
  1012. libwavpack
  1013. libwebp
  1014. libx264
  1015. libx265
  1016. libxavs
  1017. libxvid
  1018. openssl
  1019. x11grab
  1020. zlib
  1021. "
  1022. FEATURE_LIST="
  1023. gray
  1024. hardcoded_tables
  1025. runtime_cpudetect
  1026. safe_bitstream_reader
  1027. shared
  1028. small
  1029. sram
  1030. static
  1031. swscale_alpha
  1032. "
  1033. HWACCEL_LIST="
  1034. dxva2
  1035. vaapi
  1036. vda
  1037. vdpau
  1038. "
  1039. LIBRARY_LIST="
  1040. avcodec
  1041. avdevice
  1042. avfilter
  1043. avformat
  1044. avresample
  1045. avutil
  1046. swscale
  1047. "
  1048. LICENSE_LIST="
  1049. gpl
  1050. nonfree
  1051. version3
  1052. "
  1053. PROGRAM_LIST="
  1054. avconv
  1055. avplay
  1056. avprobe
  1057. avserver
  1058. "
  1059. SUBSYSTEM_LIST="
  1060. dct
  1061. doc
  1062. error_resilience
  1063. fft
  1064. lsp
  1065. lzo
  1066. mdct
  1067. network
  1068. rdft
  1069. "
  1070. CONFIG_LIST="
  1071. $COMPONENT_LIST
  1072. $EXAMPLE_LIST
  1073. $EXTERNAL_LIBRARY_LIST
  1074. $FEATURE_LIST
  1075. $HWACCEL_LIST
  1076. $LICENSE_LIST
  1077. $LIBRARY_LIST
  1078. $PROGRAM_LIST
  1079. $SUBSYSTEM_LIST
  1080. memalign_hack
  1081. neon_clobber_test
  1082. pic
  1083. pod2man
  1084. texi2html
  1085. thumb
  1086. xmm_clobber_test
  1087. "
  1088. THREADS_LIST="
  1089. pthreads
  1090. w32threads
  1091. "
  1092. ATOMICS_LIST="
  1093. atomics_gcc
  1094. atomics_suncc
  1095. atomics_win32
  1096. "
  1097. ARCH_LIST="
  1098. aarch64
  1099. alpha
  1100. arm
  1101. avr32
  1102. avr32_ap
  1103. avr32_uc
  1104. bfin
  1105. ia64
  1106. m68k
  1107. mips
  1108. mips64
  1109. parisc
  1110. ppc
  1111. ppc64
  1112. s390
  1113. sh4
  1114. sparc
  1115. sparc64
  1116. tilegx
  1117. tilepro
  1118. tomi
  1119. x86
  1120. x86_32
  1121. x86_64
  1122. "
  1123. ARCH_EXT_LIST_ARM="
  1124. armv5te
  1125. armv6
  1126. armv6t2
  1127. armv8
  1128. neon
  1129. vfp
  1130. vfpv3
  1131. "
  1132. ARCH_EXT_LIST_X86_SIMD="
  1133. amd3dnow
  1134. amd3dnowext
  1135. avx
  1136. avx2
  1137. fma3
  1138. fma4
  1139. mmx
  1140. mmxext
  1141. sse
  1142. sse2
  1143. sse3
  1144. sse4
  1145. sse42
  1146. ssse3
  1147. xop
  1148. "
  1149. ARCH_EXT_LIST_PPC="
  1150. altivec
  1151. dcbzl
  1152. ldbrx
  1153. ppc4xx
  1154. "
  1155. ARCH_EXT_LIST_X86="
  1156. $ARCH_EXT_LIST_X86_SIMD
  1157. cpunop
  1158. i686
  1159. "
  1160. ARCH_EXT_LIST="
  1161. $ARCH_EXT_LIST_ARM
  1162. $ARCH_EXT_LIST_PPC
  1163. $ARCH_EXT_LIST_X86
  1164. loongson
  1165. vis
  1166. "
  1167. ARCH_FEATURES="
  1168. aligned_stack
  1169. fast_64bit
  1170. fast_clz
  1171. fast_cmov
  1172. local_aligned_8
  1173. local_aligned_16
  1174. "
  1175. BUILTIN_LIST="
  1176. atomic_cas_ptr
  1177. machine_rw_barrier
  1178. MemoryBarrier
  1179. mm_empty
  1180. rdtsc
  1181. sync_val_compare_and_swap
  1182. "
  1183. HAVE_LIST_CMDLINE="
  1184. inline_asm
  1185. symver
  1186. yasm
  1187. "
  1188. HAVE_LIST_PUB="
  1189. bigendian
  1190. fast_unaligned
  1191. "
  1192. HEADERS_LIST="
  1193. alsa_asoundlib_h
  1194. altivec_h
  1195. arpa_inet_h
  1196. cdio_paranoia_h
  1197. cdio_paranoia_paranoia_h
  1198. dev_bktr_ioctl_bt848_h
  1199. dev_bktr_ioctl_meteor_h
  1200. dev_ic_bt8xx_h
  1201. dev_video_bktr_ioctl_bt848_h
  1202. dev_video_meteor_ioctl_meteor_h
  1203. direct_h
  1204. dlfcn_h
  1205. dxva_h
  1206. gsm_h
  1207. io_h
  1208. mach_mach_time_h
  1209. machine_ioctl_bt848_h
  1210. machine_ioctl_meteor_h
  1211. malloc_h
  1212. poll_h
  1213. sndio_h
  1214. soundcard_h
  1215. sys_mman_h
  1216. sys_param_h
  1217. sys_resource_h
  1218. sys_select_h
  1219. sys_soundcard_h
  1220. sys_time_h
  1221. sys_un_h
  1222. sys_videoio_h
  1223. unistd_h
  1224. windows_h
  1225. winsock2_h
  1226. "
  1227. MATH_FUNCS="
  1228. atanf
  1229. atan2f
  1230. cbrtf
  1231. cosf
  1232. exp2
  1233. exp2f
  1234. expf
  1235. isinf
  1236. isnan
  1237. ldexpf
  1238. llrint
  1239. llrintf
  1240. log2
  1241. log2f
  1242. log10f
  1243. lrint
  1244. lrintf
  1245. powf
  1246. rint
  1247. round
  1248. roundf
  1249. sinf
  1250. trunc
  1251. truncf
  1252. "
  1253. SYSTEM_FUNCS="
  1254. aligned_malloc
  1255. closesocket
  1256. CommandLineToArgvW
  1257. CryptGenRandom
  1258. dlopen
  1259. fcntl
  1260. flt_lim
  1261. fork
  1262. getaddrinfo
  1263. gethrtime
  1264. getopt
  1265. GetProcessAffinityMask
  1266. GetProcessMemoryInfo
  1267. GetProcessTimes
  1268. getrusage
  1269. getservbyport
  1270. GetSystemTimeAsFileTime
  1271. gettimeofday
  1272. inet_aton
  1273. isatty
  1274. jack_port_get_latency_range
  1275. localtime_r
  1276. mach_absolute_time
  1277. MapViewOfFile
  1278. memalign
  1279. mkstemp
  1280. mmap
  1281. mprotect
  1282. nanosleep
  1283. posix_memalign
  1284. sched_getaffinity
  1285. SetConsoleTextAttribute
  1286. setmode
  1287. setrlimit
  1288. Sleep
  1289. strerror_r
  1290. strptime
  1291. sysconf
  1292. sysctl
  1293. usleep
  1294. VirtualAlloc
  1295. "
  1296. TOOLCHAIN_FEATURES="
  1297. asm_mod_q
  1298. attribute_may_alias
  1299. attribute_packed
  1300. ebp_available
  1301. ebx_available
  1302. gnu_as
  1303. ibm_asm
  1304. inline_asm_labels
  1305. pragma_deprecated
  1306. symver_asm_label
  1307. symver_gnu_asm
  1308. vfp_args
  1309. xform_asm
  1310. xmm_clobbers
  1311. "
  1312. TYPES_LIST="
  1313. socklen_t
  1314. struct_addrinfo
  1315. struct_group_source_req
  1316. struct_ip_mreq_source
  1317. struct_ipv6_mreq
  1318. struct_pollfd
  1319. struct_rusage_ru_maxrss
  1320. struct_sockaddr_in6
  1321. struct_sockaddr_sa_len
  1322. struct_sockaddr_storage
  1323. struct_v4l2_frmivalenum_discrete
  1324. "
  1325. HAVE_LIST="
  1326. $ARCH_EXT_LIST
  1327. $(add_suffix _external $ARCH_EXT_LIST)
  1328. $(add_suffix _inline $ARCH_EXT_LIST)
  1329. $ARCH_FEATURES
  1330. $ATOMICS_LIST
  1331. $BUILTIN_LIST
  1332. $HAVE_LIST_CMDLINE
  1333. $HAVE_LIST_PUB
  1334. $HEADERS_LIST
  1335. $MATH_FUNCS
  1336. $SYSTEM_FUNCS
  1337. $THREADS_LIST
  1338. $TOOLCHAIN_FEATURES
  1339. $TYPES_LIST
  1340. atomics_native
  1341. dos_paths
  1342. libc_msvcrt
  1343. libdc1394_1
  1344. libdc1394_2
  1345. sdl
  1346. threads
  1347. vdpau_x11
  1348. xlib
  1349. "
  1350. # options emitted with CONFIG_ prefix but not available on the command line
  1351. CONFIG_EXTRA="
  1352. aandcttables
  1353. ac3dsp
  1354. audio_frame_queue
  1355. cabac
  1356. dsputil
  1357. gcrypt
  1358. golomb
  1359. gplv3
  1360. h263dsp
  1361. h264chroma
  1362. h264dsp
  1363. h264pred
  1364. h264qpel
  1365. hpeldsp
  1366. huffman
  1367. intrax8
  1368. lgplv3
  1369. lpc
  1370. mpegaudio
  1371. mpegaudiodsp
  1372. mpegvideo
  1373. mpegvideoenc
  1374. nettle
  1375. rangecoder
  1376. riffdec
  1377. riffenc
  1378. rtpdec
  1379. rtpenc_chain
  1380. sinewin
  1381. tpeldsp
  1382. videodsp
  1383. vp3dsp
  1384. "
  1385. CMDLINE_SELECT="
  1386. $ARCH_EXT_LIST
  1387. $CONFIG_LIST
  1388. $HAVE_LIST_CMDLINE
  1389. $THREADS_LIST
  1390. asm
  1391. cross_compile
  1392. debug
  1393. extra_warnings
  1394. logging
  1395. lto
  1396. optimizations
  1397. "
  1398. PATHS_LIST="
  1399. bindir
  1400. datadir
  1401. docdir
  1402. incdir
  1403. libdir
  1404. mandir
  1405. prefix
  1406. shlibdir
  1407. "
  1408. CMDLINE_SET="
  1409. $PATHS_LIST
  1410. ar
  1411. arch
  1412. as
  1413. build_suffix
  1414. cc
  1415. cpu
  1416. cross_prefix
  1417. dep_cc
  1418. extra_version
  1419. host_cc
  1420. host_cflags
  1421. host_ld
  1422. host_ldflags
  1423. host_libs
  1424. host_os
  1425. ld
  1426. logfile
  1427. malloc_prefix
  1428. nm
  1429. optflags
  1430. pkg_config
  1431. pkg_config_flags
  1432. random_seed
  1433. samples
  1434. sysinclude
  1435. sysroot
  1436. target_exec
  1437. target_os
  1438. target_path
  1439. target_samples
  1440. toolchain
  1441. "
  1442. CMDLINE_APPEND="
  1443. extra_cflags
  1444. host_cppflags
  1445. "
  1446. # code dependency declarations
  1447. # architecture extensions
  1448. armv5te_deps="arm"
  1449. armv6_deps="arm"
  1450. armv6t2_deps="arm"
  1451. armv8_deps="aarch64"
  1452. neon_deps_any="aarch64 arm"
  1453. vfp_deps_any="aarch64 arm"
  1454. vfpv3_deps="vfp"
  1455. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  1456. altivec_deps="ppc"
  1457. ppc4xx_deps="ppc"
  1458. cpunop_deps="i686"
  1459. x86_64_select="i686"
  1460. x86_64_suggest="fast_cmov"
  1461. amd3dnow_deps="mmx"
  1462. amd3dnowext_deps="amd3dnow"
  1463. i686_deps="x86"
  1464. mmx_deps="x86"
  1465. mmxext_deps="mmx"
  1466. sse_deps="mmxext"
  1467. sse2_deps="sse"
  1468. sse3_deps="sse2"
  1469. ssse3_deps="sse3"
  1470. sse4_deps="ssse3"
  1471. sse42_deps="sse4"
  1472. avx_deps="sse42"
  1473. xop_deps="avx"
  1474. fma3_deps="avx"
  1475. fma4_deps="avx"
  1476. avx2_deps="avx"
  1477. mmx_external_deps="yasm"
  1478. mmx_inline_deps="inline_asm"
  1479. mmx_suggest="mmx_external mmx_inline"
  1480. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86_SIMD); do
  1481. eval dep=\$${ext}_deps
  1482. eval ${ext}_external_deps='"${dep}_external"'
  1483. eval ${ext}_inline_deps='"${dep}_inline"'
  1484. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  1485. done
  1486. aligned_stack_if_any="aarch64 ppc x86"
  1487. fast_64bit_if_any="aarch64 alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1488. fast_clz_if_any="aarch64 alpha avr32 mips ppc x86"
  1489. fast_unaligned_if_any="aarch64 ppc x86"
  1490. need_memalign="altivec neon sse"
  1491. # system capabilities
  1492. log2_deps="!libc_msvcrt"
  1493. symver_if_any="symver_asm_label symver_gnu_asm"
  1494. # threading support
  1495. atomics_gcc_if="sync_val_compare_and_swap"
  1496. atomics_suncc_if="atomic_cas_ptr machine_rw_barrier"
  1497. atomics_win32_if="MemoryBarrier"
  1498. atomics_native_if_any="$ATOMICS_LIST"
  1499. w32threads_deps="atomics_native"
  1500. threads_if_any="$THREADS_LIST"
  1501. # subsystems
  1502. dct_select="rdft"
  1503. error_resilience_select="dsputil"
  1504. mdct_select="fft"
  1505. rdft_select="fft"
  1506. mpegaudio_select="mpegaudiodsp"
  1507. mpegaudiodsp_select="dct"
  1508. mpegvideo_select="dsputil hpeldsp videodsp"
  1509. mpegvideoenc_select="dsputil mpegvideo"
  1510. # decoders / encoders
  1511. aac_decoder_select="mdct sinewin"
  1512. aac_encoder_select="audio_frame_queue mdct sinewin"
  1513. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  1514. ac3_decoder_select="mdct ac3dsp ac3_parser dsputil"
  1515. ac3_encoder_select="mdct ac3dsp dsputil"
  1516. ac3_fixed_encoder_select="mdct ac3dsp dsputil"
  1517. aic_decoder_select="dsputil golomb"
  1518. alac_encoder_select="lpc"
  1519. als_decoder_select="dsputil"
  1520. amrnb_decoder_select="lsp"
  1521. amrwb_decoder_select="lsp"
  1522. amv_decoder_select="sp5x_decoder"
  1523. ape_decoder_select="dsputil"
  1524. asv1_decoder_select="dsputil"
  1525. asv1_encoder_select="dsputil"
  1526. asv2_decoder_select="dsputil"
  1527. asv2_encoder_select="dsputil"
  1528. atrac1_decoder_select="mdct sinewin"
  1529. atrac3_decoder_select="mdct"
  1530. atrac3p_decoder_select="mdct sinewin"
  1531. bink_decoder_select="dsputil hpeldsp"
  1532. binkaudio_dct_decoder_select="mdct rdft dct sinewin"
  1533. binkaudio_rdft_decoder_select="mdct rdft sinewin"
  1534. cavs_decoder_select="dsputil golomb h264chroma videodsp"
  1535. cllc_decoder_select="dsputil"
  1536. comfortnoise_encoder_select="lpc"
  1537. cook_decoder_select="dsputil mdct sinewin"
  1538. cscd_decoder_select="lzo"
  1539. cscd_decoder_suggest="zlib"
  1540. dca_decoder_select="mdct"
  1541. dnxhd_decoder_select="dsputil"
  1542. dnxhd_encoder_select="aandcttables dsputil mpegvideoenc"
  1543. dvvideo_decoder_select="dsputil"
  1544. dvvideo_encoder_select="dsputil"
  1545. dxa_decoder_deps="zlib"
  1546. eac3_decoder_select="ac3_decoder"
  1547. eac3_encoder_select="ac3_encoder"
  1548. eamad_decoder_select="aandcttables dsputil mpegvideo"
  1549. eatgq_decoder_select="aandcttables dsputil"
  1550. eatqi_decoder_select="aandcttables dsputil error_resilience mpegvideo"
  1551. exr_decoder_deps="zlib"
  1552. ffv1_decoder_select="golomb rangecoder"
  1553. ffv1_encoder_select="rangecoder"
  1554. ffvhuff_decoder_select="huffyuv_decoder"
  1555. ffvhuff_encoder_select="huffyuv_encoder"
  1556. fic_decoder_select="dsputil golomb"
  1557. flac_decoder_select="golomb"
  1558. flac_encoder_select="dsputil golomb lpc"
  1559. flashsv_decoder_deps="zlib"
  1560. flashsv_encoder_deps="zlib"
  1561. flashsv2_decoder_deps="zlib"
  1562. flv_decoder_select="h263_decoder"
  1563. flv_encoder_select="h263_encoder"
  1564. fourxm_decoder_select="dsputil"
  1565. fraps_decoder_select="dsputil huffman"
  1566. g2m_decoder_deps="zlib"
  1567. g2m_decoder_select="dsputil"
  1568. h261_decoder_select="error_resilience mpegvideo"
  1569. h261_encoder_select="aandcttables mpegvideoenc"
  1570. h263_decoder_select="error_resilience h263_parser h263dsp mpegvideo"
  1571. h263_encoder_select="aandcttables h263dsp mpegvideoenc"
  1572. h263i_decoder_select="h263_decoder"
  1573. h263p_encoder_select="h263_encoder"
  1574. h264_decoder_select="cabac golomb h264chroma h264dsp h264pred h264qpel videodsp"
  1575. h264_decoder_suggest="error_resilience"
  1576. hevc_decoder_select="cabac dsputil golomb videodsp"
  1577. huffyuv_decoder_select="dsputil"
  1578. huffyuv_encoder_select="dsputil huffman"
  1579. iac_decoder_select="imc_decoder"
  1580. imc_decoder_select="dsputil fft mdct sinewin"
  1581. indeo3_decoder_select="hpeldsp"
  1582. interplay_video_decoder_select="hpeldsp"
  1583. jpegls_decoder_select="golomb mjpeg_decoder"
  1584. jpegls_encoder_select="golomb"
  1585. jv_decoder_select="dsputil"
  1586. lagarith_decoder_select="dsputil"
  1587. ljpeg_encoder_select="aandcttables mpegvideoenc"
  1588. loco_decoder_select="golomb"
  1589. mdec_decoder_select="dsputil error_resilience mpegvideo"
  1590. metasound_decoder_select="lsp mdct sinewin"
  1591. mimic_decoder_select="dsputil hpeldsp"
  1592. mjpeg_decoder_select="dsputil hpeldsp"
  1593. mjpeg_encoder_select="aandcttables mpegvideoenc"
  1594. mjpegb_decoder_select="mjpeg_decoder"
  1595. mlp_decoder_select="mlp_parser"
  1596. motionpixels_decoder_select="dsputil"
  1597. mp1_decoder_select="mpegaudio"
  1598. mp1float_decoder_select="mpegaudio"
  1599. mp2_decoder_select="mpegaudio"
  1600. mp2float_decoder_select="mpegaudio"
  1601. mp3_decoder_select="mpegaudio"
  1602. mp3adu_decoder_select="mpegaudio"
  1603. mp3adufloat_decoder_select="mpegaudio"
  1604. mp3float_decoder_select="mpegaudio"
  1605. mp3on4_decoder_select="mpegaudio"
  1606. mp3on4float_decoder_select="mpegaudio"
  1607. mpc7_decoder_select="dsputil mpegaudiodsp"
  1608. mpc8_decoder_select="mpegaudiodsp"
  1609. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1610. mpeg_xvmc_decoder_select="mpeg2video_decoder"
  1611. mpeg1video_decoder_select="error_resilience mpegvideo"
  1612. mpeg1video_encoder_select="aandcttables mpegvideoenc"
  1613. mpeg2video_decoder_select="error_resilience mpegvideo"
  1614. mpeg2video_encoder_select="aandcttables mpegvideoenc"
  1615. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  1616. mpeg4_encoder_select="h263_encoder"
  1617. msmpeg4v1_decoder_select="h263_decoder"
  1618. msmpeg4v2_decoder_select="h263_decoder"
  1619. msmpeg4v2_encoder_select="h263_encoder"
  1620. msmpeg4v3_decoder_select="h263_decoder"
  1621. msmpeg4v3_encoder_select="h263_encoder"
  1622. mss2_decoder_select="error_resilience vc1_decoder"
  1623. mxpeg_decoder_select="mjpeg_decoder"
  1624. nellymoser_decoder_select="mdct sinewin"
  1625. nellymoser_encoder_select="audio_frame_queue mdct sinewin"
  1626. nuv_decoder_select="dsputil lzo"
  1627. png_decoder_deps="zlib"
  1628. png_encoder_deps="zlib"
  1629. png_encoder_select="dsputil"
  1630. prores_decoder_select="dsputil"
  1631. prores_encoder_select="dsputil"
  1632. qcelp_decoder_select="lsp"
  1633. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  1634. ra_144_encoder_select="audio_frame_queue lpc"
  1635. ralf_decoder_select="golomb"
  1636. rv10_decoder_select="error_resilience h263_decoder h263dsp"
  1637. rv10_encoder_select="h263_encoder"
  1638. rv20_decoder_select="error_resilience h263_decoder h263dsp"
  1639. rv20_encoder_select="h263_encoder"
  1640. rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp"
  1641. rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp"
  1642. shorten_decoder_select="golomb"
  1643. sipr_decoder_select="lsp"
  1644. sp5x_decoder_select="mjpeg_decoder"
  1645. svq1_decoder_select="hpeldsp"
  1646. svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
  1647. svq3_decoder_select="h264_decoder hpeldsp tpeldsp"
  1648. svq3_decoder_suggest="zlib"
  1649. tak_decoder_select="dsputil"
  1650. theora_decoder_select="vp3_decoder"
  1651. thp_decoder_select="mjpeg_decoder"
  1652. tiff_decoder_suggest="zlib"
  1653. tiff_encoder_suggest="zlib"
  1654. truehd_decoder_select="mlp_decoder"
  1655. truemotion2_decoder_select="dsputil"
  1656. truespeech_decoder_select="dsputil"
  1657. tscc_decoder_deps="zlib"
  1658. twinvq_decoder_select="mdct lsp sinewin"
  1659. utvideo_decoder_select="dsputil"
  1660. utvideo_encoder_select="dsputil huffman"
  1661. vble_decoder_select="dsputil"
  1662. vc1_decoder_select="error_resilience h263_decoder h264chroma h264qpel intrax8"
  1663. vc1image_decoder_select="vc1_decoder"
  1664. vorbis_decoder_select="mdct"
  1665. vorbis_encoder_select="mdct"
  1666. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  1667. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp"
  1668. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
  1669. vp6a_decoder_select="vp6_decoder"
  1670. vp6f_decoder_select="vp6_decoder"
  1671. vp7_decoder_select="h264pred videodsp"
  1672. vp8_decoder_select="h264pred videodsp"
  1673. vp9_decoder_select="videodsp"
  1674. webp_decoder_select="vp8_decoder"
  1675. wmapro_decoder_select="mdct sinewin"
  1676. wmav1_decoder_select="mdct sinewin"
  1677. wmav1_encoder_select="mdct sinewin"
  1678. wmav2_decoder_select="mdct sinewin"
  1679. wmav2_encoder_select="mdct sinewin"
  1680. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  1681. wmv1_decoder_select="h263_decoder"
  1682. wmv1_encoder_select="h263_encoder"
  1683. wmv2_decoder_select="h263_decoder intrax8 videodsp"
  1684. wmv2_encoder_select="h263_encoder"
  1685. wmv3_decoder_select="vc1_decoder"
  1686. wmv3image_decoder_select="wmv3_decoder"
  1687. zerocodec_decoder_deps="zlib"
  1688. zlib_decoder_deps="zlib"
  1689. zlib_encoder_deps="zlib"
  1690. zmbv_decoder_deps="zlib"
  1691. zmbv_encoder_deps="zlib"
  1692. # hardware accelerators
  1693. dxva2_deps="dxva2api_h"
  1694. vaapi_deps="va_va_h"
  1695. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1696. vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
  1697. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1698. h263_vaapi_hwaccel_deps="vaapi"
  1699. h263_vaapi_hwaccel_select="h263_decoder"
  1700. h263_vdpau_hwaccel_deps="vdpau"
  1701. h263_vdpau_hwaccel_select="h263_decoder"
  1702. h264_dxva2_hwaccel_deps="dxva2"
  1703. h264_dxva2_hwaccel_select="h264_decoder"
  1704. h264_vaapi_hwaccel_deps="vaapi"
  1705. h264_vaapi_hwaccel_select="h264_decoder"
  1706. h264_vda_hwaccel_deps="vda"
  1707. h264_vda_hwaccel_select="h264_decoder"
  1708. h264_vdpau_hwaccel_deps="vdpau"
  1709. h264_vdpau_hwaccel_select="h264_decoder"
  1710. mpeg1_vdpau_hwaccel_deps="vdpau"
  1711. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  1712. mpeg2_dxva2_hwaccel_deps="dxva2"
  1713. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  1714. mpeg2_vaapi_hwaccel_deps="vaapi"
  1715. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  1716. mpeg2_vdpau_hwaccel_deps="vdpau"
  1717. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  1718. mpeg4_vaapi_hwaccel_deps="vaapi"
  1719. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  1720. mpeg4_vdpau_hwaccel_deps="vdpau"
  1721. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  1722. vc1_dxva2_hwaccel_deps="dxva2"
  1723. vc1_dxva2_hwaccel_select="vc1_decoder"
  1724. vc1_vaapi_hwaccel_deps="vaapi"
  1725. vc1_vaapi_hwaccel_select="vc1_decoder"
  1726. vc1_vdpau_hwaccel_deps="vdpau"
  1727. vc1_vdpau_hwaccel_select="vc1_decoder"
  1728. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  1729. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  1730. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  1731. # parsers
  1732. h264_parser_select="h264_decoder"
  1733. mpeg4video_parser_select="error_resilience h263dsp mpegvideo"
  1734. mpegvideo_parser_select="error_resilience mpegvideo"
  1735. vc1_parser_select="mpegvideo"
  1736. # external libraries
  1737. libfaac_encoder_deps="libfaac"
  1738. libfaac_encoder_select="audio_frame_queue"
  1739. libfdk_aac_decoder_deps="libfdk_aac"
  1740. libfdk_aac_encoder_deps="libfdk_aac"
  1741. libfdk_aac_encoder_select="audio_frame_queue"
  1742. libgsm_decoder_deps="libgsm"
  1743. libgsm_encoder_deps="libgsm"
  1744. libgsm_ms_decoder_deps="libgsm"
  1745. libgsm_ms_encoder_deps="libgsm"
  1746. libilbc_decoder_deps="libilbc"
  1747. libilbc_encoder_deps="libilbc"
  1748. libmp3lame_encoder_deps="libmp3lame"
  1749. libmp3lame_encoder_select="audio_frame_queue"
  1750. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  1751. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  1752. libopencore_amrnb_encoder_select="audio_frame_queue"
  1753. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  1754. libopenjpeg_decoder_deps="libopenjpeg"
  1755. libopenjpeg_encoder_deps="libopenjpeg"
  1756. libopus_decoder_deps="libopus"
  1757. libopus_encoder_deps="libopus"
  1758. libopus_encoder_select="audio_frame_queue"
  1759. libschroedinger_decoder_deps="libschroedinger"
  1760. libschroedinger_encoder_deps="libschroedinger"
  1761. libspeex_decoder_deps="libspeex"
  1762. libspeex_encoder_deps="libspeex"
  1763. libspeex_encoder_select="audio_frame_queue"
  1764. libtheora_encoder_deps="libtheora"
  1765. libtwolame_encoder_deps="libtwolame"
  1766. libvo_aacenc_encoder_deps="libvo_aacenc"
  1767. libvo_aacenc_encoder_select="audio_frame_queue"
  1768. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  1769. libvorbis_encoder_deps="libvorbis"
  1770. libvorbis_encoder_select="audio_frame_queue"
  1771. libvpx_vp8_decoder_deps="libvpx"
  1772. libvpx_vp8_encoder_deps="libvpx"
  1773. libvpx_vp9_decoder_deps="libvpx"
  1774. libvpx_vp9_encoder_deps="libvpx"
  1775. libwavpack_encoder_deps="libwavpack"
  1776. libwebp_encoder_deps="libwebp"
  1777. libx264_encoder_deps="libx264"
  1778. libx265_encoder_deps="libx265"
  1779. libxavs_encoder_deps="libxavs"
  1780. libxvid_encoder_deps="libxvid"
  1781. # demuxers / muxers
  1782. ac3_demuxer_select="ac3_parser"
  1783. asf_demuxer_select="riffdec"
  1784. asf_muxer_select="riffenc"
  1785. asf_stream_muxer_select="asf_muxer"
  1786. avi_demuxer_select="riffdec"
  1787. avi_muxer_select="riffenc"
  1788. avisynth_demuxer_deps="avisynth"
  1789. avisynth_demuxer_select="riffdec"
  1790. caf_demuxer_select="riffdec"
  1791. dirac_demuxer_select="dirac_parser"
  1792. dxa_demuxer_select="riffdec"
  1793. eac3_demuxer_select="ac3_parser"
  1794. f4v_muxer_select="mov_muxer"
  1795. flac_demuxer_select="flac_parser"
  1796. hds_muxer_select="flv_muxer"
  1797. hls_muxer_select="mpegts_muxer"
  1798. ipod_muxer_select="mov_muxer"
  1799. ismv_muxer_select="mov_muxer"
  1800. matroska_audio_muxer_select="matroska_muxer"
  1801. matroska_demuxer_select="riffdec"
  1802. matroska_demuxer_suggest="bzlib lzo zlib"
  1803. matroska_muxer_select="riffenc"
  1804. mmf_muxer_select="riffenc"
  1805. mov_demuxer_select="riffdec"
  1806. mov_demuxer_suggest="zlib"
  1807. mov_muxer_select="riffenc rtpenc_chain"
  1808. mp3_demuxer_select="mpegaudio_parser"
  1809. mp4_muxer_select="mov_muxer"
  1810. mpegts_muxer_select="adts_muxer latm_muxer"
  1811. mpegtsraw_demuxer_select="mpegts_demuxer"
  1812. mxf_d10_muxer_select="mxf_muxer"
  1813. nut_muxer_select="riffenc"
  1814. nuv_demuxer_select="riffdec"
  1815. ogg_demuxer_select="golomb"
  1816. psp_muxer_select="mov_muxer"
  1817. rtp_demuxer_select="sdp_demuxer"
  1818. rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
  1819. rtsp_demuxer_select="http_protocol rtpdec"
  1820. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  1821. sap_demuxer_select="sdp_demuxer"
  1822. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  1823. sdp_demuxer_select="rtpdec"
  1824. smoothstreaming_muxer_select="ismv_muxer"
  1825. spdif_muxer_select="aac_parser"
  1826. tak_demuxer_select="tak_parser"
  1827. tg2_muxer_select="mov_muxer"
  1828. tgp_muxer_select="mov_muxer"
  1829. w64_demuxer_select="wav_demuxer"
  1830. wav_demuxer_select="riffdec"
  1831. wav_muxer_select="riffenc"
  1832. webm_muxer_select="riffenc"
  1833. wtv_demuxer_select="riffdec"
  1834. xmv_demuxer_select="riffdec"
  1835. xwma_demuxer_select="riffdec"
  1836. # indevs / outdevs
  1837. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  1838. alsa_outdev_deps="alsa_asoundlib_h"
  1839. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  1840. dv1394_indev_deps="dv1394"
  1841. dv1394_indev_select="dv_demuxer"
  1842. fbdev_indev_deps="linux_fb_h"
  1843. jack_indev_deps="jack_jack_h pthreads"
  1844. libcdio_indev_deps="libcdio"
  1845. libdc1394_indev_deps="libdc1394"
  1846. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  1847. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  1848. pulse_indev_deps="libpulse"
  1849. sndio_indev_deps="sndio_h"
  1850. sndio_outdev_deps="sndio_h"
  1851. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  1852. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  1853. vfwcap_indev_extralibs="-lavicap32"
  1854. x11grab_indev_deps="x11grab XShmCreateImage"
  1855. # protocols
  1856. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  1857. ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
  1858. ffrtmpcrypt_protocol_select="tcp_protocol"
  1859. ffrtmphttp_protocol_deps="!librtmp_protocol"
  1860. ffrtmphttp_protocol_select="http_protocol"
  1861. gopher_protocol_select="network"
  1862. http_protocol_select="tcp_protocol"
  1863. httpproxy_protocol_select="tcp_protocol"
  1864. https_protocol_select="tls_protocol"
  1865. librtmp_protocol_deps="librtmp"
  1866. librtmpe_protocol_deps="librtmp"
  1867. librtmps_protocol_deps="librtmp"
  1868. librtmpt_protocol_deps="librtmp"
  1869. librtmpte_protocol_deps="librtmp"
  1870. mmsh_protocol_select="http_protocol"
  1871. mmst_protocol_select="network"
  1872. rtmp_protocol_deps="!librtmp_protocol"
  1873. rtmp_protocol_select="tcp_protocol"
  1874. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  1875. rtmps_protocol_deps="!librtmp_protocol"
  1876. rtmps_protocol_select="tls_protocol"
  1877. rtmpt_protocol_select="ffrtmphttp_protocol"
  1878. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  1879. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  1880. rtp_protocol_select="udp_protocol"
  1881. sctp_protocol_deps="struct_sctp_event_subscribe"
  1882. sctp_protocol_select="network"
  1883. srtp_protocol_select="rtp_protocol"
  1884. tcp_protocol_select="network"
  1885. tls_protocol_deps_any="openssl gnutls"
  1886. tls_protocol_select="tcp_protocol"
  1887. udp_protocol_select="network"
  1888. unix_protocol_deps="sys_un_h"
  1889. unix_protocol_select="network"
  1890. # filters
  1891. blackframe_filter_deps="gpl"
  1892. boxblur_filter_deps="gpl"
  1893. cropdetect_filter_deps="gpl"
  1894. delogo_filter_deps="gpl"
  1895. drawtext_filter_deps="libfreetype"
  1896. frei0r_filter_deps="frei0r dlopen"
  1897. frei0r_filter_extralibs='$ldl'
  1898. frei0r_src_filter_deps="frei0r dlopen"
  1899. frei0r_src_filter_extralibs='$ldl'
  1900. hqdn3d_filter_deps="gpl"
  1901. interlace_filter_deps="gpl"
  1902. ocv_filter_deps="libopencv"
  1903. resample_filter_deps="avresample"
  1904. scale_filter_deps="swscale"
  1905. # examples
  1906. avcodec_example_deps="avcodec avutil"
  1907. filter_audio_example_deps="avfilter avutil"
  1908. metadata_example_deps="avformat avutil"
  1909. output_example_deps="avcodec avformat avutil swscale"
  1910. transcode_aac_example_deps="avcodec avformat avresample"
  1911. # libraries
  1912. avcodec_deps="avutil"
  1913. avdevice_deps="avutil avcodec avformat"
  1914. avfilter_deps="avutil"
  1915. avformat_deps="avutil avcodec"
  1916. avresample_deps="avutil"
  1917. swscale_deps="avutil"
  1918. # programs
  1919. avconv_deps="avcodec avfilter avformat avresample swscale"
  1920. avconv_select="aformat_filter anull_filter asyncts_filter atrim_filter format_filter
  1921. fps_filter null_filter resample_filter scale_filter
  1922. setpts_filter trim_filter"
  1923. avplay_deps="avcodec avformat avresample swscale sdl"
  1924. avplay_libs='$sdl_libs'
  1925. avplay_select="rdft"
  1926. avprobe_deps="avcodec avformat"
  1927. avserver_deps="avformat fork !shared"
  1928. avserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
  1929. # documentation
  1930. pod2man_deps="doc"
  1931. texi2html_deps="doc"
  1932. # default parameters
  1933. logfile="config.log"
  1934. # installation paths
  1935. prefix_default="/usr/local"
  1936. bindir_default='${prefix}/bin'
  1937. datadir_default='${prefix}/share/avconv'
  1938. docdir_default='${prefix}/share/doc/libav'
  1939. incdir_default='${prefix}/include'
  1940. libdir_default='${prefix}/lib'
  1941. mandir_default='${prefix}/share/man'
  1942. shlibdir_default="$libdir_default"
  1943. # toolchain
  1944. ar_default="ar"
  1945. cc_default="gcc"
  1946. host_cc_default="gcc"
  1947. cp_f="cp -f"
  1948. ln_s="ln -s -f"
  1949. nm_default="nm -g"
  1950. objformat="elf"
  1951. pkg_config_default=pkg-config
  1952. ranlib="ranlib"
  1953. strip="strip"
  1954. yasmexe="yasm"
  1955. nogas=":"
  1956. # machine
  1957. arch_default=$(uname -m)
  1958. cpu="generic"
  1959. # OS
  1960. target_os_default=$(tolower $(uname -s))
  1961. host_os=$target_os_default
  1962. # configurable options
  1963. enable $EXAMPLE_LIST $LIBRARY_LIST $PROGRAM_LIST
  1964. enable asm
  1965. enable debug
  1966. enable doc
  1967. enable optimizations
  1968. enable safe_bitstream_reader
  1969. enable static
  1970. enable swscale_alpha
  1971. # By default, enable only those hwaccels that have no external dependencies.
  1972. enable dxva2 vdpau
  1973. # build settings
  1974. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  1975. LIBPREF="lib"
  1976. LIBSUF=".a"
  1977. FULLNAME='$(NAME)$(BUILDSUF)'
  1978. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  1979. SLIBPREF="lib"
  1980. SLIBSUF=".so"
  1981. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  1982. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  1983. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  1984. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  1985. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  1986. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  1987. asflags_filter=echo
  1988. cflags_filter=echo
  1989. ldflags_filter=echo
  1990. AS_C='-c'
  1991. AS_O='-o $@'
  1992. CC_C='-c'
  1993. CC_E='-E -o $@'
  1994. CC_O='-o $@'
  1995. LD_O='-o $@'
  1996. LD_LIB='-l%'
  1997. LD_PATH='-L'
  1998. HOSTCC_C='-c'
  1999. HOSTCC_E='-E -o $@'
  2000. HOSTCC_O='-o $@'
  2001. HOSTLD_O='-o $@'
  2002. host_libs='-lm'
  2003. host_cflags_filter=echo
  2004. host_ldflags_filter=echo
  2005. target_path='$(CURDIR)'
  2006. # since the object filename is not given with the -MM flag, the compiler
  2007. # is only able to print the basename, and we must add the path ourselves
  2008. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  2009. DEPFLAGS='-MM'
  2010. # find source path
  2011. if test -f configure; then
  2012. source_path=.
  2013. else
  2014. source_path=$(cd $(dirname "$0"); pwd)
  2015. echo "$source_path" | grep -q '[[:blank:]]' &&
  2016. die "Out of tree builds are impossible with whitespace in source path."
  2017. test -e "$source_path/config.h" &&
  2018. die "Out of tree builds are impossible with config.h in source dir."
  2019. fi
  2020. for v in "$@"; do
  2021. r=${v#*=}
  2022. l=${v%"$r"}
  2023. r=$(sh_quote "$r")
  2024. LIBAV_CONFIGURATION="${LIBAV_CONFIGURATION# } ${l}${r}"
  2025. done
  2026. find_things(){
  2027. thing=$1
  2028. pattern=$2
  2029. file=$source_path/$3
  2030. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  2031. }
  2032. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  2033. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  2034. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  2035. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  2036. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  2037. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  2038. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  2039. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  2040. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  2041. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  2042. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  2043. ALL_COMPONENTS="
  2044. $BSF_LIST
  2045. $DECODER_LIST
  2046. $DEMUXER_LIST
  2047. $ENCODER_LIST
  2048. $FILTER_LIST
  2049. $HWACCEL_LIST
  2050. $INDEV_LIST
  2051. $MUXER_LIST
  2052. $OUTDEV_LIST
  2053. $PARSER_LIST
  2054. $PROTOCOL_LIST
  2055. "
  2056. for n in $COMPONENT_LIST; do
  2057. v=$(toupper ${n%s})_LIST
  2058. eval enable \$$v
  2059. eval ${n}_if_any="\$$v"
  2060. done
  2061. enable $ARCH_EXT_LIST
  2062. die_unknown(){
  2063. echo "Unknown option \"$1\"."
  2064. echo "See $0 --help for available options."
  2065. exit 1
  2066. }
  2067. print_3_columns() {
  2068. cat | tr ' ' '\n' | sort | pr -r -3 -t
  2069. }
  2070. show_list() {
  2071. suffix=_$1
  2072. shift
  2073. echo $* | sed s/$suffix//g | print_3_columns
  2074. exit 0
  2075. }
  2076. rand_list(){
  2077. IFS=', '
  2078. set -- $*
  2079. unset IFS
  2080. for thing; do
  2081. comp=${thing%:*}
  2082. prob=${thing#$comp}
  2083. prob=${prob#:}
  2084. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  2085. echo "prob ${prob:-0.5}"
  2086. printf '%s\n' $comp
  2087. done
  2088. }
  2089. do_random(){
  2090. action=$1
  2091. shift
  2092. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  2093. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  2094. }
  2095. for opt do
  2096. optval="${opt#*=}"
  2097. case "$opt" in
  2098. --extra-ldflags=*)
  2099. add_ldflags $optval
  2100. ;;
  2101. --extra-libs=*)
  2102. add_extralibs $optval
  2103. ;;
  2104. --disable-devices)
  2105. disable $INDEV_LIST $OUTDEV_LIST
  2106. ;;
  2107. --enable-debug=*)
  2108. debuglevel="$optval"
  2109. ;;
  2110. --disable-programs)
  2111. disable $PROGRAM_LIST
  2112. ;;
  2113. --disable-everything)
  2114. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2115. ;;
  2116. --disable-all)
  2117. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2118. disable $LIBRARY_LIST $PROGRAM_LIST doc
  2119. ;;
  2120. --enable-random|--disable-random)
  2121. action=${opt%%-random}
  2122. do_random ${action#--} $COMPONENT_LIST
  2123. ;;
  2124. --enable-random=*|--disable-random=*)
  2125. action=${opt%%-random=*}
  2126. do_random ${action#--} $optval
  2127. ;;
  2128. --enable-*=*|--disable-*=*)
  2129. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  2130. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  2131. eval list=\$$(toupper $thing)_LIST
  2132. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  2133. $action $(filter "$name" $list)
  2134. ;;
  2135. --enable-?*|--disable-?*)
  2136. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  2137. if is_in $option $COMPONENT_LIST; then
  2138. test $action = disable && action=unset
  2139. eval $action \$$(toupper ${option%s})_LIST
  2140. elif is_in $option $CMDLINE_SELECT; then
  2141. $action $option
  2142. else
  2143. die_unknown $opt
  2144. fi
  2145. ;;
  2146. --list-*)
  2147. NAME="${opt#--list-}"
  2148. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  2149. NAME=${NAME%s}
  2150. eval show_list $NAME \$$(toupper $NAME)_LIST
  2151. ;;
  2152. --help|-h) show_help
  2153. ;;
  2154. *)
  2155. optname="${opt%%=*}"
  2156. optname="${optname#--}"
  2157. optname=$(echo "$optname" | sed 's/-/_/g')
  2158. if is_in $optname $CMDLINE_SET; then
  2159. eval $optname='$optval'
  2160. elif is_in $optname $CMDLINE_APPEND; then
  2161. append $optname "$optval"
  2162. else
  2163. die_unknown $opt
  2164. fi
  2165. ;;
  2166. esac
  2167. done
  2168. disabled logging && logfile=/dev/null
  2169. echo "# $0 $LIBAV_CONFIGURATION" > $logfile
  2170. set >> $logfile
  2171. test -n "$cross_prefix" && enable cross_compile
  2172. if enabled cross_compile; then
  2173. test -n "$arch" && test -n "$target_os" ||
  2174. die "Must specify target arch and OS when cross-compiling"
  2175. fi
  2176. ar_default="${cross_prefix}${ar_default}"
  2177. cc_default="${cross_prefix}${cc_default}"
  2178. nm_default="${cross_prefix}${nm_default}"
  2179. pkg_config_default="${cross_prefix}${pkg_config_default}"
  2180. ranlib="${cross_prefix}${ranlib}"
  2181. strip="${cross_prefix}${strip}"
  2182. sysinclude_default="${sysroot}/usr/include"
  2183. case "$toolchain" in
  2184. clang-asan)
  2185. cc_default="clang"
  2186. add_cflags -fsanitize=address
  2187. add_ldflags -fsanitize=address
  2188. ;;
  2189. clang-tsan)
  2190. cc_default="clang"
  2191. add_cflags -fsanitize=thread -pie
  2192. add_ldflags -fsanitize=thread -pie
  2193. ;;
  2194. clang-usan)
  2195. cc_default="clang"
  2196. add_cflags -fsanitize=undefined
  2197. add_ldflags -fsanitize=undefined
  2198. ;;
  2199. gcc-asan)
  2200. cc_default="gcc"
  2201. add_cflags -fsanitize=address
  2202. add_ldflags -fsanitize=address
  2203. ;;
  2204. gcc-tsan)
  2205. cc_default="gcc"
  2206. add_cflags -fsanitize=thread -pie -fPIC
  2207. add_ldflags -fsanitize=thread -pie -fPIC
  2208. ;;
  2209. gcc-usan)
  2210. cc_default="gcc"
  2211. add_cflags -fsanitize=undefined
  2212. add_ldflags -fsanitize=undefined
  2213. ;;
  2214. valgrind-massif)
  2215. target_exec_default="valgrind"
  2216. target_exec_args="--alloc-fn=av_malloc --alloc-fn=av_mallocz"
  2217. ;;
  2218. valgrind-memcheck)
  2219. target_exec_default="valgrind"
  2220. target_exec_args="--track-origins=yes --leak-check=full"
  2221. ;;
  2222. msvc)
  2223. # Check whether the current MSVC version needs the C99 converter.
  2224. # From MSVC 2013 (compiler major version 18) onwards, it does actually
  2225. # support enough of C99 to build libav. Default to the new
  2226. # behaviour if the regexp was unable to match anything, since this
  2227. # successfully parses the version number of existing supported
  2228. # versions that require the converter (MSVC 2010 and 2012).
  2229. cl_major_ver=$(cl 2>&1 | sed -n 's/.*Version \([[:digit:]]\{1,\}\)\..*/\1/p')
  2230. if [ -z "$cl_major_ver" ] || [ $cl_major_ver -ge 18 ]; then
  2231. cc_default="cl"
  2232. else
  2233. cc_default="c99wrap cl"
  2234. fi
  2235. ld_default="link"
  2236. nm_default="dumpbin -symbols"
  2237. ar_default="lib"
  2238. target_os_default="win32"
  2239. # Use a relative path for TMPDIR. This makes sure all the
  2240. # ffconf temp files are written with a relative path, avoiding
  2241. # issues with msys/win32 path conversion for MSVC parameters
  2242. # such as -Fo<file> or -out:<file>.
  2243. TMPDIR=.
  2244. ;;
  2245. icl)
  2246. cc_default="icl"
  2247. ld_default="xilink"
  2248. nm_default="dumpbin -symbols"
  2249. ar_default="xilib"
  2250. target_os_default="win32"
  2251. TMPDIR=.
  2252. ;;
  2253. gcov)
  2254. add_cflags -fprofile-arcs -ftest-coverage
  2255. add_ldflags -fprofile-arcs -ftest-coverage
  2256. ;;
  2257. hardened)
  2258. add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all
  2259. add_ldflags -Wl,-z,relro -Wl,-z,now
  2260. ;;
  2261. ?*)
  2262. die "Unknown toolchain $toolchain"
  2263. ;;
  2264. esac
  2265. set_default arch cc pkg_config sysinclude target_exec target_os
  2266. enabled cross_compile || host_cc_default=$cc
  2267. set_default host_cc
  2268. if ! $pkg_config --version >/dev/null 2>&1; then
  2269. warn "$pkg_config not found, library detection may fail."
  2270. pkg_config=false
  2271. fi
  2272. exesuf() {
  2273. case $1 in
  2274. mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  2275. esac
  2276. }
  2277. EXESUF=$(exesuf $target_os)
  2278. HOSTEXESUF=$(exesuf $host_os)
  2279. # set temporary file name
  2280. : ${TMPDIR:=$TEMPDIR}
  2281. : ${TMPDIR:=$TMP}
  2282. : ${TMPDIR:=/tmp}
  2283. if ! check_cmd mktemp -u XXXXXX; then
  2284. # simple replacement for missing mktemp
  2285. # NOT SAFE FOR GENERAL USE
  2286. mktemp(){
  2287. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  2288. }
  2289. fi
  2290. tmpfile(){
  2291. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  2292. (set -C; exec > $tmp) 2>/dev/null ||
  2293. die "Unable to create temporary file in $TMPDIR."
  2294. append TMPFILES $tmp
  2295. eval $1=$tmp
  2296. }
  2297. trap 'rm -f -- $TMPFILES' EXIT
  2298. tmpfile TMPASM .asm
  2299. tmpfile TMPC .c
  2300. tmpfile TMPE $EXESUF
  2301. tmpfile TMPH .h
  2302. tmpfile TMPO .o
  2303. tmpfile TMPS .S
  2304. tmpfile TMPSH .sh
  2305. tmpfile TMPV .ver
  2306. unset -f mktemp
  2307. chmod +x $TMPE
  2308. # make sure we can execute files in $TMPDIR
  2309. cat > $TMPSH 2>> $logfile <<EOF
  2310. #! /bin/sh
  2311. EOF
  2312. chmod +x $TMPSH >> $logfile 2>&1
  2313. if ! $TMPSH >> $logfile 2>&1; then
  2314. cat <<EOF
  2315. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2316. variable to another directory and make sure that it is not mounted noexec.
  2317. EOF
  2318. die "Sanity test failed."
  2319. fi
  2320. ccc_flags(){
  2321. for flag; do
  2322. case $flag in
  2323. -std=c99) echo -c99 ;;
  2324. -mcpu=*) echo -arch ${flag#*=} ;;
  2325. -mieee) echo -ieee ;;
  2326. -O*|-fast) echo $flag ;;
  2327. -fno-math-errno) echo -assume nomath_errno ;;
  2328. -g) echo -g3 ;;
  2329. -Wall) echo -msg_enable level2 ;;
  2330. -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
  2331. -Wl,*) echo $flag ;;
  2332. -f*|-W*) ;;
  2333. *) echo $flag ;;
  2334. esac
  2335. done
  2336. }
  2337. cparser_flags(){
  2338. for flag; do
  2339. case $flag in
  2340. -Wno-switch) echo -Wno-switch-enum ;;
  2341. -Wno-format-zero-length) ;;
  2342. -Wdisabled-optimization) ;;
  2343. -Wno-pointer-sign) echo -Wno-other ;;
  2344. *) echo $flag ;;
  2345. esac
  2346. done
  2347. }
  2348. msvc_common_flags(){
  2349. for flag; do
  2350. case $flag in
  2351. # In addition to specifying certain flags under the compiler
  2352. # specific filters, they must be specified here as well or else the
  2353. # generic catch all at the bottom will print the original flag.
  2354. -Wall) ;;
  2355. -std=c99) ;;
  2356. # Common flags
  2357. -fomit-frame-pointer) ;;
  2358. -g) echo -Z7 ;;
  2359. -fno-math-errno) ;;
  2360. -fno-common) ;;
  2361. -fno-signed-zeros) ;;
  2362. -fPIC) ;;
  2363. -mthumb) ;;
  2364. -march=*) ;;
  2365. -lz) echo zlib.lib ;;
  2366. -lavifil32) echo vfw32.lib ;;
  2367. -lavicap32) echo vfw32.lib user32.lib ;;
  2368. -l*) echo ${flag#-l}.lib ;;
  2369. *) echo $flag ;;
  2370. esac
  2371. done
  2372. }
  2373. msvc_flags(){
  2374. msvc_common_flags "$@"
  2375. for flag; do
  2376. case $flag in
  2377. -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  2378. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  2379. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  2380. -wd4273 ;;
  2381. esac
  2382. done
  2383. }
  2384. icl_flags(){
  2385. msvc_common_flags "$@"
  2386. for flag; do
  2387. case $flag in
  2388. # Despite what Intel's documentation says -Wall, which is supported
  2389. # on Windows, does enable remarks so disable them here.
  2390. -Wall) echo $flag -Qdiag-disable:remark ;;
  2391. -std=c99) echo -Qstd=c99 ;;
  2392. esac
  2393. done
  2394. }
  2395. pgi_flags(){
  2396. for flag; do
  2397. case $flag in
  2398. -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
  2399. -fomit-frame-pointer) echo -Mnoframe ;;
  2400. -g) echo -gopt ;;
  2401. *) echo $flag ;;
  2402. esac
  2403. done
  2404. }
  2405. suncc_flags(){
  2406. for flag; do
  2407. case $flag in
  2408. -march=*|-mcpu=*)
  2409. case "${flag#*=}" in
  2410. native) echo -xtarget=native ;;
  2411. v9|niagara) echo -xarch=sparc ;;
  2412. ultrasparc) echo -xarch=sparcvis ;;
  2413. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  2414. i586|pentium) echo -xchip=pentium ;;
  2415. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  2416. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  2417. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  2418. pentium4*) echo -xtarget=pentium4 ;;
  2419. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  2420. *-sse3) echo -xarch=sse3 ;;
  2421. core2) echo -xarch=ssse3 -xchip=core2 ;;
  2422. corei7) echo -xarch=sse4_2 -xchip=nehalem ;;
  2423. corei7-avx) echo -xarch=avx -xchip=sandybridge ;;
  2424. amdfam10|barcelona|bdver*) echo -xarch=sse4_1 ;;
  2425. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  2426. k8|opteron|athlon64|athlon-fx)
  2427. echo -xarch=sse2a ;;
  2428. athlon*) echo -xarch=pentium_proa ;;
  2429. esac
  2430. ;;
  2431. -std=c99) echo -xc99 ;;
  2432. -fomit-frame-pointer) echo -xregs=frameptr ;;
  2433. -fPIC) echo -KPIC -xcode=pic32 ;;
  2434. -W*,*) echo $flag ;;
  2435. -f*-*|-W*|-mimpure-text) ;;
  2436. -shared) echo -G ;;
  2437. *) echo $flag ;;
  2438. esac
  2439. done
  2440. }
  2441. tms470_flags(){
  2442. for flag; do
  2443. case $flag in
  2444. -march=*|-mcpu=*)
  2445. case "${flag#*=}" in
  2446. armv7-a|cortex-a*) echo -mv=7a8 ;;
  2447. armv7-r|cortex-r*) echo -mv=7r4 ;;
  2448. armv7-m|cortex-m*) echo -mv=7m3 ;;
  2449. armv6*|arm11*) echo -mv=6 ;;
  2450. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  2451. echo -mv=5e ;;
  2452. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  2453. esac
  2454. ;;
  2455. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  2456. -mfpu=vfp) echo --float_support=vfpv2 ;;
  2457. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  2458. -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
  2459. -msoft-float) echo --float_support=vfplib ;;
  2460. -O[0-3]|-mf=*) echo $flag ;;
  2461. -g) echo -g -mn ;;
  2462. -pds=*) echo $flag ;;
  2463. -D*|-I*) echo $flag ;;
  2464. --gcc|--abi=*) echo $flag ;;
  2465. -me) echo $flag ;;
  2466. esac
  2467. done
  2468. }
  2469. probe_cc(){
  2470. pfx=$1
  2471. _cc=$2
  2472. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  2473. unset _ld_o _ldflags _ld_lib _ld_path
  2474. unset _depflags _DEPCMD _DEPFLAGS
  2475. _flags_filter=echo
  2476. if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  2477. _type=llvm_gcc
  2478. gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
  2479. _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
  2480. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2481. _cflags_speed='-O3'
  2482. _cflags_size='-Os'
  2483. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  2484. _type=gcc
  2485. gcc_version=$($_cc --version | head -n1)
  2486. gcc_basever=$($_cc -dumpversion)
  2487. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  2488. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  2489. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  2490. if ! $_cc -dumpversion | grep -q '^2\.'; then
  2491. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2492. fi
  2493. _cflags_speed='-O3'
  2494. _cflags_size='-Os'
  2495. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  2496. _type=icc
  2497. _ident=$($_cc --version | head -n1)
  2498. _depflags='-MMD'
  2499. _cflags_speed='-O3'
  2500. _cflags_size='-Os'
  2501. _cflags_noopt='-O1'
  2502. elif $_cc -v 2>&1 | grep -q xlc; then
  2503. _type=xlc
  2504. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  2505. _cflags_speed='-O5'
  2506. _cflags_size='-O5 -qcompact'
  2507. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  2508. _type=ccc
  2509. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  2510. _DEPFLAGS='-M'
  2511. _cflags_speed='-fast'
  2512. _cflags_size='-O1'
  2513. _flags_filter=ccc_flags
  2514. elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
  2515. test -d "$sysroot" || die "No valid sysroot specified."
  2516. _type=armcc
  2517. _ident=$($_cc --vsn | head -n1)
  2518. armcc_conf="$PWD/armcc.conf"
  2519. $_cc --arm_linux_configure \
  2520. --arm_linux_config_file="$armcc_conf" \
  2521. --configure_sysroot="$sysroot" \
  2522. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  2523. die "Error creating armcc configuration file."
  2524. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  2525. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  2526. as_default="${cross_prefix}gcc"
  2527. _depflags='-MMD'
  2528. _cflags_speed='-O3'
  2529. _cflags_size='-Os'
  2530. elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
  2531. _type=tms470
  2532. _ident=$($_cc -version | head -n1 | tr -s ' ')
  2533. _flags='--gcc --abi=eabi -me'
  2534. _cc_e='-ppl -fe=$@'
  2535. _cc_o='-fe=$@'
  2536. _depflags='-ppa -ppd=$(@:.o=.d)'
  2537. _cflags_speed='-O3 -mf=5'
  2538. _cflags_size='-O3 -mf=2'
  2539. _flags_filter=tms470_flags
  2540. elif $_cc -v 2>&1 | grep -q clang; then
  2541. _type=clang
  2542. _ident=$($_cc --version | head -n1)
  2543. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2544. _cflags_speed='-O3'
  2545. _cflags_size='-Os'
  2546. elif $_cc -V 2>&1 | grep -q Sun; then
  2547. _type=suncc
  2548. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  2549. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  2550. _DEPFLAGS='-xM1 -xc99'
  2551. _ldflags='-std=c99'
  2552. _cflags_speed='-O5'
  2553. _cflags_size='-O5 -xspace'
  2554. _flags_filter=suncc_flags
  2555. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  2556. _type=pathscale
  2557. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2558. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2559. _cflags_speed='-O2'
  2560. _cflags_size='-Os'
  2561. _flags_filter='filter_out -Wdisabled-optimization'
  2562. elif $_cc -v 2>&1 | grep -q Open64; then
  2563. _type=open64
  2564. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2565. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2566. _cflags_speed='-O2'
  2567. _cflags_size='-Os'
  2568. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  2569. elif $_cc -V 2>&1 | grep -q Portland; then
  2570. _type=pgi
  2571. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  2572. opt_common='-alias=ansi -Mdse -Mlre -Mpre'
  2573. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  2574. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  2575. _cflags_noopt="-O1"
  2576. _flags_filter=pgi_flags
  2577. elif $_cc 2>&1 | grep -q Microsoft; then
  2578. _type=msvc
  2579. _ident=$($cc 2>&1 | head -n1)
  2580. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  2581. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  2582. _cflags_speed="-O2"
  2583. _cflags_size="-O1"
  2584. if $_cc 2>&1 | grep -q Linker; then
  2585. _ld_o='-out:$@'
  2586. else
  2587. _ld_o='-Fe$@'
  2588. fi
  2589. _cc_o='-Fo$@'
  2590. _cc_e='-P -Fi$@'
  2591. _flags_filter=msvc_flags
  2592. _ld_lib='lib%.a'
  2593. _ld_path='-libpath:'
  2594. _flags='-nologo'
  2595. _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
  2596. if [ $pfx = hostcc ]; then
  2597. append _cflags -Dsnprintf=_snprintf
  2598. fi
  2599. elif $_cc 2>&1 | grep -q Intel; then
  2600. _type=icl
  2601. _ident=$($cc 2>&1 | head -n1)
  2602. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  2603. # Not only is O3 broken on 13.x+ but it is slower on all previous
  2604. # versions (tested) as well.
  2605. _cflags_speed="-O2"
  2606. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  2607. if $_cc 2>&1 | grep -q Linker; then
  2608. _ld_o='-out:$@'
  2609. else
  2610. _ld_o='-Fe$@'
  2611. fi
  2612. _cc_o='-Fo$@'
  2613. _cc_e='-P'
  2614. _flags_filter=icl_flags
  2615. _ld_lib='lib%.a'
  2616. _ld_path='-libpath:'
  2617. # -Qdiag-error to make icl error when seeing certain unknown arguments
  2618. _flags='-nologo -Qdiag-error:4044,10157'
  2619. # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency
  2620. # with MSVC which enables it by default.
  2621. _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS'
  2622. if [ $pfx = hostcc ]; then
  2623. append _cflags -Dsnprintf=_snprintf
  2624. fi
  2625. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  2626. _type=cparser
  2627. _ident=$($_cc --version | head -n1)
  2628. _depflags='-MMD'
  2629. _cflags_speed='-O4'
  2630. _cflags_size='-O2'
  2631. _flags_filter=cparser_flags
  2632. fi
  2633. eval ${pfx}_type=\$_type
  2634. eval ${pfx}_ident=\$_ident
  2635. }
  2636. set_ccvars(){
  2637. eval ${1}_C=\${_cc_c-\${${1}_C}}
  2638. eval ${1}_E=\${_cc_e-\${${1}_E}}
  2639. eval ${1}_O=\${_cc_o-\${${1}_O}}
  2640. if [ -n "$_depflags" ]; then
  2641. eval ${1}_DEPFLAGS=\$_depflags
  2642. else
  2643. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  2644. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  2645. eval DEP${1}FLAGS=\$_flags
  2646. fi
  2647. }
  2648. probe_cc cc "$cc"
  2649. cflags_filter=$_flags_filter
  2650. cflags_speed=$_cflags_speed
  2651. cflags_size=$_cflags_size
  2652. cflags_noopt=$_cflags_noopt
  2653. add_cflags $_flags $_cflags
  2654. cc_ldflags=$_ldflags
  2655. set_ccvars CC
  2656. probe_cc hostcc "$host_cc"
  2657. host_cflags_filter=$_flags_filter
  2658. add_host_cflags $_flags $_cflags
  2659. set_ccvars HOSTCC
  2660. test -n "$cc_type" && enable $cc_type ||
  2661. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  2662. : ${as_default:=$cc}
  2663. : ${dep_cc_default:=$cc}
  2664. : ${ld_default:=$cc}
  2665. : ${host_ld_default:=$host_cc}
  2666. set_default ar as dep_cc ld host_ld
  2667. probe_cc as "$as"
  2668. asflags_filter=$_flags_filter
  2669. add_asflags $_flags $_cflags
  2670. set_ccvars AS
  2671. probe_cc ld "$ld"
  2672. ldflags_filter=$_flags_filter
  2673. add_ldflags $_flags $_ldflags
  2674. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  2675. LD_O=${_ld_o-$LD_O}
  2676. LD_LIB=${_ld_lib-$LD_LIB}
  2677. LD_PATH=${_ld_path-$LD_PATH}
  2678. probe_cc hostld "$host_ld"
  2679. host_ldflags_filter=$_flags_filter
  2680. add_host_ldflags $_flags $_ldflags
  2681. HOSTLD_O=${_ld_o-$HOSTLD_O}
  2682. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  2683. probe_cc depcc "$dep_cc"
  2684. CCDEP=${_DEPCMD:-$DEPCMD}
  2685. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  2686. DEPCCFLAGS=$_flags
  2687. fi
  2688. if $ar 2>&1 | grep -q Microsoft; then
  2689. arflags="-nologo"
  2690. ar_o='-out:$@'
  2691. elif $ar 2>&1 | grep -q 'Texas Instruments'; then
  2692. arflags="rq"
  2693. ar_o='$@'
  2694. elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
  2695. arflags='-Xany -r -c'
  2696. ar_o='$@'
  2697. else
  2698. arflags="rc"
  2699. ar_o='$@'
  2700. fi
  2701. add_cflags $extra_cflags
  2702. add_asflags $extra_cflags
  2703. if test -n "$sysroot"; then
  2704. case "$cc_type" in
  2705. gcc|llvm_gcc|clang)
  2706. add_cppflags --sysroot="$sysroot"
  2707. add_ldflags --sysroot="$sysroot"
  2708. ;;
  2709. tms470)
  2710. add_cppflags -I"$sysinclude"
  2711. add_ldflags --sysroot="$sysroot"
  2712. ;;
  2713. esac
  2714. fi
  2715. if test "$cpu" = host; then
  2716. enabled cross_compile &&
  2717. die "--cpu=host makes no sense when cross-compiling."
  2718. case "$cc_type" in
  2719. gcc|llvm_gcc)
  2720. check_native(){
  2721. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  2722. sed -n "/cc1.*$1=/{
  2723. s/.*$1=\\([^ ]*\\).*/\\1/
  2724. p
  2725. q
  2726. }" $TMPE
  2727. }
  2728. cpu=$(check_native -march || check_native -mcpu)
  2729. ;;
  2730. esac
  2731. test "${cpu:-host}" = host &&
  2732. die "--cpu=host not supported with compiler $cc"
  2733. fi
  2734. # Deal with common $arch aliases
  2735. case "$arch" in
  2736. aarch64|arm64)
  2737. arch="aarch64"
  2738. ;;
  2739. arm*)
  2740. arch="arm"
  2741. ;;
  2742. mips*|IP*)
  2743. arch="mips"
  2744. ;;
  2745. parisc*|hppa*)
  2746. arch="parisc"
  2747. ;;
  2748. "Power Macintosh"|ppc*|powerpc*)
  2749. arch="ppc"
  2750. ;;
  2751. s390|s390x)
  2752. arch="s390"
  2753. ;;
  2754. sh4|sh)
  2755. arch="sh4"
  2756. ;;
  2757. sun4u|sparc*)
  2758. arch="sparc"
  2759. ;;
  2760. tilegx|tile-gx)
  2761. arch="tilegx"
  2762. ;;
  2763. i[3-6]86|i86pc|BePC|x86pc|x86_64|amd64)
  2764. arch="x86"
  2765. ;;
  2766. esac
  2767. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  2768. enable $arch
  2769. # Add processor-specific flags
  2770. if enabled aarch64; then
  2771. case $cpu in
  2772. armv*)
  2773. cpuflags="-march=$cpu"
  2774. ;;
  2775. *)
  2776. cpuflags="-mcpu=$cpu"
  2777. ;;
  2778. esac
  2779. elif enabled alpha; then
  2780. cpuflags="-mcpu=$cpu"
  2781. elif enabled arm; then
  2782. check_arm_arch() {
  2783. check_cpp_condition stddef.h \
  2784. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  2785. $cpuflags
  2786. }
  2787. probe_arm_arch() {
  2788. if check_arm_arch 4; then echo armv4;
  2789. elif check_arm_arch 4T; then echo armv4t;
  2790. elif check_arm_arch 5; then echo armv5;
  2791. elif check_arm_arch 5E; then echo armv5e;
  2792. elif check_arm_arch 5T; then echo armv5t;
  2793. elif check_arm_arch 5TE; then echo armv5te;
  2794. elif check_arm_arch 5TEJ; then echo armv5te;
  2795. elif check_arm_arch 6; then echo armv6;
  2796. elif check_arm_arch 6J; then echo armv6j;
  2797. elif check_arm_arch 6K; then echo armv6k;
  2798. elif check_arm_arch 6Z; then echo armv6z;
  2799. elif check_arm_arch 6ZK; then echo armv6zk;
  2800. elif check_arm_arch 6T2; then echo armv6t2;
  2801. elif check_arm_arch 7; then echo armv7;
  2802. elif check_arm_arch 7A 7_A; then echo armv7-a;
  2803. elif check_arm_arch 7R 7_R; then echo armv7-r;
  2804. elif check_arm_arch 7M 7_M; then echo armv7-m;
  2805. elif check_arm_arch 7EM 7E_M; then echo armv7-m;
  2806. elif check_arm_arch 8A 8_A; then echo armv8-a;
  2807. fi
  2808. }
  2809. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  2810. case $cpu in
  2811. armv*)
  2812. cpuflags="-march=$cpu"
  2813. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  2814. ;;
  2815. *)
  2816. cpuflags="-mcpu=$cpu"
  2817. case $cpu in
  2818. cortex-a*) subarch=armv7a ;;
  2819. cortex-r*) subarch=armv7r ;;
  2820. cortex-m*) enable thumb; subarch=armv7m ;;
  2821. arm11*) subarch=armv6 ;;
  2822. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  2823. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  2824. *) subarch=$(probe_arm_arch) ;;
  2825. esac
  2826. ;;
  2827. esac
  2828. case "$subarch" in
  2829. armv5t*) enable fast_clz ;;
  2830. armv[6-8]*) enable fast_clz fast_unaligned ;;
  2831. esac
  2832. elif enabled avr32; then
  2833. case $cpu in
  2834. ap7[02]0[0-2])
  2835. subarch="avr32_ap"
  2836. cpuflags="-mpart=$cpu"
  2837. ;;
  2838. ap)
  2839. subarch="avr32_ap"
  2840. cpuflags="-march=$cpu"
  2841. ;;
  2842. uc3[ab]*)
  2843. subarch="avr32_uc"
  2844. cpuflags="-mcpu=$cpu"
  2845. ;;
  2846. uc)
  2847. subarch="avr32_uc"
  2848. cpuflags="-march=$cpu"
  2849. ;;
  2850. esac
  2851. elif enabled bfin; then
  2852. cpuflags="-mcpu=$cpu"
  2853. elif enabled mips; then
  2854. cpuflags="-march=$cpu"
  2855. elif enabled ppc; then
  2856. disable ldbrx
  2857. case $(tolower $cpu) in
  2858. 601|ppc601|powerpc601)
  2859. cpuflags="-mcpu=601"
  2860. disable altivec
  2861. ;;
  2862. 603*|ppc603*|powerpc603*)
  2863. cpuflags="-mcpu=603"
  2864. disable altivec
  2865. ;;
  2866. 604*|ppc604*|powerpc604*)
  2867. cpuflags="-mcpu=604"
  2868. disable altivec
  2869. ;;
  2870. g3|75*|ppc75*|powerpc75*)
  2871. cpuflags="-mcpu=750"
  2872. disable altivec
  2873. ;;
  2874. g4|745*|ppc745*|powerpc745*)
  2875. cpuflags="-mcpu=7450"
  2876. ;;
  2877. 74*|ppc74*|powerpc74*)
  2878. cpuflags="-mcpu=7400"
  2879. ;;
  2880. g5|970|ppc970|powerpc970)
  2881. cpuflags="-mcpu=970"
  2882. ;;
  2883. power[3-7]*)
  2884. cpuflags="-mcpu=$cpu"
  2885. ;;
  2886. cell)
  2887. cpuflags="-mcpu=cell"
  2888. enable ldbrx
  2889. ;;
  2890. e500mc)
  2891. cpuflags="-mcpu=e500mc"
  2892. disable altivec
  2893. ;;
  2894. e500v2)
  2895. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  2896. disable altivec
  2897. disable dcbzl
  2898. ;;
  2899. e500)
  2900. cpuflags="-mcpu=8540 -mhard-float"
  2901. disable altivec
  2902. disable dcbzl
  2903. ;;
  2904. esac
  2905. elif enabled sparc; then
  2906. case $cpu in
  2907. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  2908. cpuflags="-mcpu=$cpu"
  2909. ;;
  2910. ultrasparc*|niagara[234])
  2911. cpuflags="-mcpu=$cpu"
  2912. ;;
  2913. esac
  2914. elif enabled x86; then
  2915. case $cpu in
  2916. i[345]86|pentium)
  2917. cpuflags="-march=$cpu"
  2918. disable mmx
  2919. ;;
  2920. # targets that do NOT support nopl and conditional mov (cmov)
  2921. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  2922. cpuflags="-march=$cpu"
  2923. disable i686
  2924. ;;
  2925. # targets that do support nopl and conditional mov (cmov)
  2926. 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*)
  2927. cpuflags="-march=$cpu"
  2928. enable i686
  2929. enable fast_cmov
  2930. ;;
  2931. # targets that do support conditional mov but on which it's slow
  2932. pentium4|pentium4m|prescott|nocona)
  2933. cpuflags="-march=$cpu"
  2934. enable i686
  2935. disable fast_cmov
  2936. ;;
  2937. esac
  2938. fi
  2939. if [ "$cpu" != generic ]; then
  2940. add_cflags $cpuflags
  2941. add_asflags $cpuflags
  2942. fi
  2943. # compiler sanity check
  2944. check_exec <<EOF
  2945. int main(void){ return 0; }
  2946. EOF
  2947. if test "$?" != 0; then
  2948. echo "$cc is unable to create an executable file."
  2949. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  2950. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  2951. echo "Only do this if you know what cross compiling means."
  2952. fi
  2953. die "C compiler test failed."
  2954. fi
  2955. add_cppflags -D_ISOC99_SOURCE
  2956. check_cflags -std=c99
  2957. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  2958. #include <stdlib.h>
  2959. EOF
  2960. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  2961. #include <stdlib.h>
  2962. EOF
  2963. add_host_cppflags -D_ISOC99_SOURCE
  2964. check_host_cflags -std=c99
  2965. check_host_cflags -Wall
  2966. check_host_cflags -O3
  2967. check_64bit(){
  2968. arch32=$1
  2969. arch64=$2
  2970. expr=$3
  2971. check_code cc "" "int test[2*($expr) - 1]" &&
  2972. subarch=$arch64 || subarch=$arch32
  2973. }
  2974. case "$arch" in
  2975. aarch64|alpha|ia64)
  2976. spic=$shared
  2977. ;;
  2978. mips)
  2979. check_64bit mips mips64 '_MIPS_SIM > 1'
  2980. spic=$shared
  2981. ;;
  2982. parisc)
  2983. check_64bit parisc parisc64 'sizeof(void *) > 4'
  2984. spic=$shared
  2985. ;;
  2986. ppc)
  2987. check_64bit ppc ppc64 'sizeof(void *) > 4'
  2988. spic=$shared
  2989. ;;
  2990. s390)
  2991. check_64bit s390 s390x 'sizeof(void *) > 4'
  2992. spic=$shared
  2993. ;;
  2994. sparc)
  2995. check_64bit sparc sparc64 'sizeof(void *) > 4'
  2996. spic=$shared
  2997. ;;
  2998. x86)
  2999. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  3000. if test "$subarch" = "x86_64"; then
  3001. spic=$shared
  3002. fi
  3003. ;;
  3004. esac
  3005. enable $subarch
  3006. enabled spic && enable_weak pic
  3007. # OS specific
  3008. case $target_os in
  3009. aix)
  3010. SHFLAGS=-shared
  3011. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  3012. enabled shared && add_ldflags -Wl,-brtl
  3013. ;;
  3014. haiku)
  3015. prefix_default="/boot/common"
  3016. network_extralibs="-lnetwork"
  3017. host_libs=
  3018. ;;
  3019. sunos)
  3020. SHFLAGS='-shared -Wl,-h,$$(@F)'
  3021. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  3022. network_extralibs="-lsocket -lnsl"
  3023. # When using suncc to build, the Solaris linker will mark
  3024. # an executable with each instruction set encountered by
  3025. # the Solaris assembler. As our libraries contain their own
  3026. # guards for processor-specific code, instead suppress
  3027. # generation of the HWCAPS ELF section on Solaris x86 only.
  3028. enabled_all suncc x86 &&
  3029. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  3030. add_ldflags -Wl,-M,mapfile
  3031. nm_default='nm -P -g'
  3032. ;;
  3033. netbsd)
  3034. disable symver
  3035. oss_indev_extralibs="-lossaudio"
  3036. oss_outdev_extralibs="-lossaudio"
  3037. ;;
  3038. openbsd|bitrig)
  3039. disable symver
  3040. SHFLAGS='-shared'
  3041. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  3042. SLIB_INSTALL_LINKS=
  3043. oss_indev_extralibs="-lossaudio"
  3044. oss_outdev_extralibs="-lossaudio"
  3045. ;;
  3046. dragonfly)
  3047. disable symver
  3048. ;;
  3049. freebsd)
  3050. ;;
  3051. bsd/os)
  3052. add_extralibs -lpoll -lgnugetopt
  3053. ;;
  3054. darwin)
  3055. gas="gas-preprocessor.pl $cc"
  3056. enabled ppc && add_asflags -force_cpusubtype_ALL
  3057. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  3058. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  3059. add_ldflags -Wl,-dynamic,-search_paths_first
  3060. SLIBSUF=".dylib"
  3061. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  3062. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  3063. objformat="macho"
  3064. enabled x86_64 && objformat="macho64"
  3065. enabled_any pic shared ||
  3066. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  3067. ;;
  3068. mingw32*)
  3069. if test $target_os = "mingw32ce"; then
  3070. disable network
  3071. else
  3072. target_os=mingw32
  3073. fi
  3074. LIBTARGET=i386
  3075. if enabled x86_64; then
  3076. LIBTARGET="i386:x86-64"
  3077. elif enabled arm; then
  3078. LIBTARGET=arm-wince
  3079. fi
  3080. check_ldflags -Wl,--nxcompat
  3081. check_ldflags -Wl,--dynamicbase
  3082. shlibdir_default="$bindir_default"
  3083. SLIBPREF=""
  3084. SLIBSUF=".dll"
  3085. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3086. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3087. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); $(DLLTOOL) -m $(LIBTARGET) -d $$(@:$(SLIBSUF)=.def) -l $(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib) -D $(SLIBNAME_WITH_MAJOR)'
  3088. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3089. SLIB_INSTALL_LINKS=
  3090. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3091. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3092. SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.orig.def) -Wl,--out-implib,$(SUBDIR)lib$(SLIBNAME:$(SLIBSUF)=.dll.a) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
  3093. objformat="win32"
  3094. dlltool="${cross_prefix}dlltool"
  3095. ranlib=:
  3096. enable dos_paths
  3097. ;;
  3098. win32|win64)
  3099. disable symver
  3100. if enabled shared; then
  3101. # Link to the import library instead of the normal static library
  3102. # for shared libs.
  3103. LD_LIB='%.lib'
  3104. # Cannot build both shared and static libs with MSVC or icl.
  3105. disable static
  3106. fi
  3107. shlibdir_default="$bindir_default"
  3108. SLIBPREF=""
  3109. SLIBSUF=".dll"
  3110. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3111. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3112. SLIB_CREATE_DEF_CMD='$(SRC_PATH)/compat/windows/makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  3113. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3114. SLIB_INSTALL_LINKS=
  3115. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3116. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3117. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3118. objformat="win32"
  3119. ranlib=:
  3120. enable dos_paths
  3121. ;;
  3122. cygwin*)
  3123. target_os=cygwin
  3124. shlibdir_default="$bindir_default"
  3125. SLIBPREF="cyg"
  3126. SLIBSUF=".dll"
  3127. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3128. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3129. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3130. SLIB_INSTALL_LINKS=
  3131. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  3132. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  3133. objformat="win32"
  3134. enable dos_paths
  3135. ;;
  3136. *-dos|freedos|opendos)
  3137. network_extralibs="-lsocket"
  3138. objformat="coff"
  3139. enable dos_paths
  3140. add_cppflags -U__STRICT_ANSI__
  3141. ;;
  3142. linux)
  3143. enable dv1394
  3144. ;;
  3145. irix*)
  3146. target_os=irix
  3147. ranlib="echo ignoring ranlib"
  3148. ;;
  3149. os/2*)
  3150. ln_s="cp -f"
  3151. objformat="aout"
  3152. add_cppflags -D_GNU_SOURCE
  3153. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  3154. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  3155. LIBSUF="_s.a"
  3156. SLIBPREF=""
  3157. SLIBSUF=".dll"
  3158. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3159. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  3160. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  3161. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  3162. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  3163. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  3164. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  3165. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  3166. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  3167. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  3168. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  3169. enable dos_paths
  3170. ;;
  3171. gnu/kfreebsd)
  3172. add_cppflags -D_BSD_SOURCE
  3173. ;;
  3174. gnu)
  3175. ;;
  3176. qnx)
  3177. add_cppflags -D_QNX_SOURCE
  3178. network_extralibs="-lsocket"
  3179. ;;
  3180. symbian)
  3181. SLIBSUF=".dll"
  3182. enable dos_paths
  3183. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  3184. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  3185. add_ldflags -Wl,--target1-abs,--no-undefined \
  3186. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  3187. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  3188. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  3189. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  3190. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  3191. ;;
  3192. osf1)
  3193. add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
  3194. ;;
  3195. minix)
  3196. ;;
  3197. plan9)
  3198. add_cppflags -D_C99_SNPRINTF_EXTENSION \
  3199. -D_REENTRANT_SOURCE \
  3200. -D_RESEARCH_SOURCE \
  3201. -DFD_SETSIZE=96 \
  3202. -DHAVE_SOCK_OPTS
  3203. add_compat strtod.o strtod=avpriv_strtod
  3204. network_extralibs='-lbsd'
  3205. exeobjs=compat/plan9/main.o
  3206. disable avserver
  3207. cp_f='cp'
  3208. ;;
  3209. none)
  3210. ;;
  3211. *)
  3212. die "Unknown OS '$target_os'."
  3213. ;;
  3214. esac
  3215. # determine libc flavour
  3216. probe_libc(){
  3217. pfx=$1
  3218. pfx_no_=${pfx%_}
  3219. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  3220. if check_${pfx}cpp_condition features.h "defined __UCLIBC__"; then
  3221. eval ${pfx}libc_type=uclibc
  3222. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3223. elif check_${pfx}cpp_condition features.h "defined __GLIBC__"; then
  3224. eval ${pfx}libc_type=glibc
  3225. add_${pfx}cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3226. # MinGW headers can be installed on Cygwin, so check for newlib first.
  3227. elif check_${pfx}cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  3228. eval ${pfx}libc_type=newlib
  3229. add_${pfx}cppflags -U__STRICT_ANSI__
  3230. # MinGW64 is backwards compatible with MinGW32, so check for it first.
  3231. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW64_VERSION_MAJOR"; then
  3232. eval ${pfx}libc_type=mingw64
  3233. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  3234. eval test \$${pfx_no_}cc_type = "gcc" &&
  3235. add_${pfx}cppflags -D__printf__=__gnu_printf__
  3236. elif check_${pfx}cpp_condition _mingw.h "defined __MINGW_VERSION" ||
  3237. check_${pfx}cpp_condition _mingw.h "defined __MINGW32_VERSION"; then
  3238. eval ${pfx}libc_type=mingw32
  3239. check_${pfx}cpp_condition _mingw.h "__MINGW32_MAJOR_VERSION > 3 || \
  3240. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  3241. die "ERROR: MinGW32 runtime version must be >= 3.15."
  3242. add_${pfx}cppflags -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1
  3243. eval test \$${pfx_no_}cc_type = "gcc" &&
  3244. add_${pfx}cppflags -D__printf__=__gnu_printf__
  3245. elif check_${pfx}cpp_condition crtversion.h "defined _VC_CRT_MAJOR_VERSION"; then
  3246. eval ${pfx}libc_type=msvcrt
  3247. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  3248. # 0x601 by default unless something else is set by the user.
  3249. # This can easily lead to us detecting functions only present
  3250. # in such new versions and producing binaries requiring windows 7.0.
  3251. # Therefore explicitly set the default to XP unless the user has
  3252. # set something else on the command line.
  3253. check_${pfx}cpp_condition stdlib.h "defined(_WIN32_WINNT)" ||
  3254. add_${pfx}cppflags -D_WIN32_WINNT=0x0502
  3255. elif check_${pfx}cpp_condition stddef.h "defined __KLIBC__"; then
  3256. eval ${pfx}libc_type=klibc
  3257. elif check_${pfx}cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  3258. eval ${pfx}libc_type=bionic
  3259. elif check_${pfx}cpp_condition sys/brand.h "defined LABELED_BRAND_NAME"; then
  3260. eval ${pfx}libc_type=solaris
  3261. add_${pfx}cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  3262. fi
  3263. }
  3264. probe_libc
  3265. test -n "$libc_type" && enable libc_$libc_type
  3266. probe_libc host_
  3267. test -n "$host_libc_type" && enable host_libc_$host_libc_type
  3268. case $libc_type in
  3269. bionic)
  3270. add_compat strtod.o strtod=avpriv_strtod
  3271. ;;
  3272. msvcrt)
  3273. add_compat strtod.o strtod=avpriv_strtod
  3274. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  3275. _snprintf=avpriv_snprintf \
  3276. vsnprintf=avpriv_vsnprintf
  3277. ;;
  3278. esac
  3279. # hacks for compiler/libc/os combinations
  3280. if enabled_all tms470 libc_glibc; then
  3281. CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
  3282. add_cppflags -D__USER_LABEL_PREFIX__=
  3283. add_cppflags -D__builtin_memset=memset
  3284. add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
  3285. add_cflags -pds=48 # incompatible redefinition of macro
  3286. fi
  3287. if enabled_all ccc libc_glibc; then
  3288. add_ldflags -Wl,-z,now # calls to libots crash without this
  3289. fi
  3290. check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" ||
  3291. add_cppflags '-I\$(SRC_PATH)/compat/float'
  3292. esc(){
  3293. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  3294. }
  3295. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $LIBAV_CONFIGURATION)" >config.fate
  3296. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  3297. set_default $PATHS_LIST
  3298. set_default nm
  3299. # we need to build at least one lib type
  3300. if ! enabled_any static shared; then
  3301. cat <<EOF
  3302. At least one library type must be built.
  3303. Specify --enable-static to build the static libraries or --enable-shared to
  3304. build the shared libraries as well. To only build the shared libraries specify
  3305. --disable-static in addition to --enable-shared.
  3306. EOF
  3307. exit 1;
  3308. fi
  3309. die_license_disabled() {
  3310. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  3311. }
  3312. die_license_disabled gpl libcdio
  3313. die_license_disabled gpl libx264
  3314. die_license_disabled gpl libx265
  3315. die_license_disabled gpl libxavs
  3316. die_license_disabled gpl libxvid
  3317. die_license_disabled gpl x11grab
  3318. die_license_disabled nonfree libfaac
  3319. die_license_disabled nonfree libfdk_aac
  3320. die_license_disabled nonfree openssl
  3321. die_license_disabled version3 libopencore_amrnb
  3322. die_license_disabled version3 libopencore_amrwb
  3323. die_license_disabled version3 libvo_aacenc
  3324. die_license_disabled version3 libvo_amrwbenc
  3325. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  3326. disabled optimizations || check_cflags -fomit-frame-pointer
  3327. enable_weak_pic() {
  3328. disabled pic && return
  3329. enable pic
  3330. add_cppflags -DPIC
  3331. case "$target_os" in
  3332. mingw*|cygwin*)
  3333. ;;
  3334. *)
  3335. add_cflags -fPIC
  3336. ;;
  3337. esac
  3338. add_asflags -fPIC
  3339. }
  3340. enabled pic && enable_weak_pic
  3341. check_cc <<EOF || die "Symbol mangling check failed."
  3342. int ff_extern;
  3343. EOF
  3344. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  3345. extern_prefix=${sym%%ff_extern*}
  3346. check_cc <<EOF && enable_weak inline_asm
  3347. void foo(void) { __asm__ volatile ("" ::); }
  3348. EOF
  3349. _restrict=
  3350. for restrict_keyword in restrict __restrict__ __restrict; do
  3351. check_cc <<EOF && _restrict=$restrict_keyword && break
  3352. void foo(char * $restrict_keyword p);
  3353. EOF
  3354. done
  3355. check_cc <<EOF && enable pragma_deprecated
  3356. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  3357. EOF
  3358. check_cc <<EOF && enable attribute_packed
  3359. struct { int x; } __attribute__((packed)) x;
  3360. EOF
  3361. check_cc <<EOF && enable attribute_may_alias
  3362. union { int x; } __attribute__((may_alias)) x;
  3363. EOF
  3364. check_cc <<EOF || die "endian test failed"
  3365. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  3366. EOF
  3367. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  3368. check_inline_asm inline_asm_labels '"1:\n"'
  3369. if enabled aarch64; then
  3370. enabled armv8 && check_insn armv8 'prfm pldl1strm, [x0]'
  3371. # internal assembler in clang 3.3 does not support this instruction
  3372. enabled neon && check_insn neon 'ext v0.8B, v0.8B, v1.8B, #1'
  3373. enabled vfp && check_insn vfp 'fmadd d0, d0, d1, d2'
  3374. map 'enabled_any ${v}_external ${v}_inline || disable $v' $ARCH_EXT_LIST_ARM
  3375. elif enabled alpha; then
  3376. check_cflags -mieee
  3377. elif enabled arm; then
  3378. check_cpp_condition stddef.h "defined __thumb__" && enable_weak thumb
  3379. enabled thumb && check_cflags -mthumb || check_cflags -marm
  3380. nogas=die
  3381. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  3382. enable vfp_args
  3383. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  3384. case "${cross_prefix:-$cc}" in
  3385. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  3386. *) check_ld <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  3387. __asm__ (".eabi_attribute 28, 1");
  3388. int main(void) { return 0; }
  3389. EOF
  3390. esac
  3391. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  3392. fi
  3393. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  3394. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  3395. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  3396. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  3397. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  3398. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  3399. [ $target_os = linux ] ||
  3400. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  3401. $ARCH_EXT_LIST_ARM
  3402. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  3403. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  3404. elif enabled mips; then
  3405. check_inline_asm loongson '"dmult.g $1, $2, $3"'
  3406. elif enabled parisc; then
  3407. if enabled gcc; then
  3408. case $($cc -dumpversion) in
  3409. 4.[3-8].*) check_cflags -fno-optimize-sibling-calls ;;
  3410. esac
  3411. fi
  3412. elif enabled ppc; then
  3413. enable local_aligned_8 local_aligned_16
  3414. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  3415. check_inline_asm ibm_asm '"add 0, 0, 0"'
  3416. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  3417. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  3418. # AltiVec flags: The FSF version of GCC differs from the Apple version
  3419. if enabled altivec; then
  3420. nogas=warn
  3421. check_cflags -maltivec -mabi=altivec &&
  3422. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  3423. check_cflags -faltivec
  3424. # check if our compiler supports Motorola AltiVec C API
  3425. check_cc <<EOF || disable altivec
  3426. $inc_altivec_h
  3427. int main(void) {
  3428. vector signed int v1 = (vector signed int) { 0 };
  3429. vector signed int v2 = (vector signed int) { 1 };
  3430. v1 = vec_add(v1, v2);
  3431. return 0;
  3432. }
  3433. EOF
  3434. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  3435. fi
  3436. elif enabled x86; then
  3437. check_builtin rdtsc intrin.h "__rdtsc()"
  3438. check_builtin mm_empty mmintrin.h "_mm_empty()"
  3439. enable local_aligned_8 local_aligned_16
  3440. # check whether EBP is available on x86
  3441. # As 'i' is stored on the stack, this program will crash
  3442. # if the base pointer is used to access it because the
  3443. # base pointer is cleared in the inline assembly code.
  3444. check_exec_crash <<EOF && enable ebp_available
  3445. volatile int i=0;
  3446. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  3447. return i;
  3448. EOF
  3449. # check whether EBX is available on x86
  3450. check_inline_asm ebx_available '""::"b"(0)' &&
  3451. check_inline_asm ebx_available '"":::"%ebx"'
  3452. # check whether xmm clobbers are supported
  3453. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  3454. # check whether binutils is new enough to compile SSSE3/MMXEXT
  3455. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  3456. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  3457. if ! disabled_any asm mmx yasm; then
  3458. if check_cmd $yasmexe --version; then
  3459. enabled x86_64 && yasm_extra="-m amd64"
  3460. yasm_debug="-g dwarf2"
  3461. elif check_cmd nasm -v; then
  3462. yasmexe=nasm
  3463. yasm_debug="-g -F dwarf"
  3464. enabled x86_64 && test "$objformat" = elf && objformat=elf64
  3465. fi
  3466. YASMFLAGS="-f $objformat $yasm_extra"
  3467. enabled pic && append YASMFLAGS "-DPIC"
  3468. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  3469. case "$objformat" in
  3470. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  3471. esac
  3472. check_yasm "movbe ecx, [5]" && enable yasm ||
  3473. die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
  3474. check_yasm "vpmacsdd xmm0, xmm1, xmm2, xmm3" || disable xop_external
  3475. check_yasm "vfmadd132ps ymm0, ymm1, ymm2" || disable fma3_external
  3476. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  3477. check_yasm "CPU amdnop" || disable cpunop
  3478. fi
  3479. case "$cpu" in
  3480. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  3481. disable fast_clz
  3482. ;;
  3483. esac
  3484. fi
  3485. if enabled asm; then
  3486. as=${gas:=$as}
  3487. check_as <<EOF && enable gnu_as || \
  3488. $nogas "GNU assembler not found, install gas-preprocessor"
  3489. .macro m n
  3490. \n: .int 0
  3491. .endm
  3492. m x
  3493. EOF
  3494. fi
  3495. check_ldflags -Wl,--as-needed
  3496. if check_func dlopen; then
  3497. ldl=
  3498. elif check_func dlopen -ldl; then
  3499. ldl=-ldl
  3500. fi
  3501. if ! disabled network; then
  3502. check_func getaddrinfo $network_extralibs
  3503. check_func getservbyport $network_extralibs
  3504. check_func inet_aton $network_extralibs
  3505. check_type netdb.h "struct addrinfo"
  3506. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  3507. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  3508. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  3509. check_type poll.h "struct pollfd"
  3510. check_type netinet/sctp.h "struct sctp_event_subscribe"
  3511. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  3512. check_type netinet/in.h "struct sockaddr_in6"
  3513. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  3514. check_type "sys/types.h sys/socket.h" socklen_t
  3515. # Prefer arpa/inet.h over winsock2
  3516. if check_header arpa/inet.h ; then
  3517. check_func closesocket
  3518. elif check_header winsock2.h ; then
  3519. check_func_headers winsock2.h closesocket -lws2 &&
  3520. network_extralibs="-lws2" ||
  3521. { check_func_headers winsock2.h closesocket -lws2_32 &&
  3522. network_extralibs="-lws2_32"; } || disable winsock2_h network
  3523. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  3524. check_type ws2tcpip.h socklen_t
  3525. check_type ws2tcpip.h "struct addrinfo"
  3526. check_type ws2tcpip.h "struct group_source_req"
  3527. check_type ws2tcpip.h "struct ip_mreq_source"
  3528. check_type ws2tcpip.h "struct ipv6_mreq"
  3529. check_type winsock2.h "struct pollfd"
  3530. check_struct winsock2.h "struct sockaddr" sa_len
  3531. check_type ws2tcpip.h "struct sockaddr_in6"
  3532. check_type ws2tcpip.h "struct sockaddr_storage"
  3533. else
  3534. disable network
  3535. fi
  3536. fi
  3537. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  3538. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  3539. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  3540. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  3541. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  3542. check_func ${malloc_prefix}memalign && enable memalign
  3543. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  3544. check_func fcntl
  3545. check_func fork
  3546. check_func gethrtime
  3547. check_func getopt
  3548. check_func getrusage
  3549. check_func gettimeofday
  3550. check_func isatty
  3551. check_func localtime_r
  3552. check_func mach_absolute_time
  3553. check_func mkstemp
  3554. check_func mmap
  3555. check_func mprotect
  3556. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  3557. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  3558. check_func sched_getaffinity
  3559. check_func setrlimit
  3560. check_func strerror_r
  3561. check_func strptime
  3562. check_func sysconf
  3563. check_func sysctl
  3564. check_func usleep
  3565. check_func_headers io.h setmode
  3566. check_func_headers stdlib.h getenv
  3567. check_func_headers windows.h GetProcessAffinityMask
  3568. check_func_headers windows.h GetProcessTimes
  3569. check_func_headers windows.h GetSystemTimeAsFileTime
  3570. check_func_headers windows.h MapViewOfFile
  3571. check_func_headers windows.h SetConsoleTextAttribute
  3572. check_func_headers windows.h Sleep
  3573. check_func_headers windows.h VirtualAlloc
  3574. check_header direct.h
  3575. check_header dlfcn.h
  3576. check_header dxva.h
  3577. check_header dxva2api.h
  3578. check_header io.h
  3579. check_header mach/mach_time.h
  3580. check_header malloc.h
  3581. check_header poll.h
  3582. check_header sys/mman.h
  3583. check_header sys/param.h
  3584. check_header sys/resource.h
  3585. check_header sys/select.h
  3586. check_header sys/time.h
  3587. check_header sys/un.h
  3588. check_header unistd.h
  3589. check_header vdpau/vdpau.h
  3590. check_header vdpau/vdpau_x11.h
  3591. check_header VideoDecodeAcceleration/VDADecoder.h
  3592. check_header windows.h
  3593. check_header X11/extensions/XvMClib.h
  3594. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  3595. check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  3596. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  3597. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  3598. if ! disabled w32threads && ! enabled pthreads; then
  3599. check_func_headers "windows.h process.h" _beginthreadex &&
  3600. enable w32threads || disable w32threads
  3601. fi
  3602. # check for some common methods of building with pthread support
  3603. # do this before the optional library checks as some of them require pthreads
  3604. if ! disabled pthreads && ! enabled w32threads; then
  3605. enable pthreads
  3606. if check_func pthread_join -pthread; then
  3607. add_cflags -pthread
  3608. add_extralibs -pthread
  3609. elif check_func pthread_join -pthreads; then
  3610. add_cflags -pthreads
  3611. add_extralibs -pthreads
  3612. elif check_func pthread_join -lpthreadGC2; then
  3613. add_extralibs -lpthreadGC2
  3614. elif check_lib pthread.h pthread_join -lpthread; then
  3615. :
  3616. elif ! check_func pthread_join; then
  3617. disable pthreads
  3618. fi
  3619. fi
  3620. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  3621. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  3622. check_lib math.h sin -lm && LIBM="-lm"
  3623. enabled vaapi && require vaapi va/va.h vaInitialize -lva
  3624. atan2f_args=2
  3625. ldexpf_args=2
  3626. powf_args=2
  3627. for func in $MATH_FUNCS; do
  3628. eval check_mathfunc $func \${${func}_args:-1}
  3629. done
  3630. # these are off by default, so fail if requested and not available
  3631. enabled avisynth && { { check_header "avisynth/avisynth_c.h" && check_lib2 "windows.h" LoadLibrary; } ||
  3632. { check_header "avxsynth/avxsynth_c.h" && check_lib2 "dlfcn.h" dlopen -ldl; } ||
  3633. die "ERROR: LoadLibrary/dlopen not found, or avisynth header not found"; }
  3634. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  3635. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  3636. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  3637. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  3638. enabled libfreetype && require_pkg_config freetype2 "ft2build.h FT_FREETYPE_H" FT_Init_FreeType
  3639. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  3640. check_lib "${gsm_hdr}" gsm_create -lgsm && break;
  3641. done || die "ERROR: libgsm not found"; }
  3642. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  3643. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  3644. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  3645. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  3646. enabled libopencv && require_pkg_config opencv opencv/cv.h cvCreateImageHeader
  3647. enabled libopenjpeg && { { check_header openjpeg.h && check_lib2 openjpeg.h opj_version -lopenjpeg -DOPJ_STATIC; } ||
  3648. { require_pkg_config libopenjpeg1 openjpeg.h opj_version -DOPJ_STATIC; } }
  3649. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  3650. enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
  3651. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  3652. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  3653. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  3654. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  3655. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame
  3656. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  3657. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  3658. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  3659. enabled libvpx && {
  3660. enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  3661. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  3662. enabled libvpx_vp8_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_enc_init_ver VPX_CQ" -lvpx ||
  3663. die "ERROR: libvpx encoder version must be >=0.9.6"; }
  3664. enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
  3665. enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx" -lvpx || disable libvpx_vp9_encoder; } }
  3666. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  3667. enabled libwebp && require_pkg_config libwebp webp/encode.h WebPGetEncoderVersion
  3668. enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
  3669. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  3670. die "ERROR: libx264 version must be >= 0.118."; }
  3671. enabled libx265 && require_pkg_config x265 x265.h x265_encoder_encode &&
  3672. { check_cpp_condition x265.h "X265_BUILD >= 13" ||
  3673. die "ERROR: libx265 version must be >= 13."; }
  3674. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  3675. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  3676. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  3677. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  3678. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  3679. die "ERROR: openssl not found"; }
  3680. if enabled gnutls; then
  3681. { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
  3682. { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
  3683. fi
  3684. # libdc1394 check
  3685. if enabled libdc1394; then
  3686. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  3687. enable libdc1394_2; } ||
  3688. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  3689. enable libdc1394_1; } ||
  3690. die "ERROR: No version of libdc1394 found "
  3691. fi
  3692. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  3693. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3694. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  3695. enable sdl
  3696. fi
  3697. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  3698. texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
  3699. check_header linux/fb.h
  3700. check_header linux/videodev2.h
  3701. check_struct linux/videodev2.h "struct v4l2_frmivalenum" discrete
  3702. check_header sys/videoio.h
  3703. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  3704. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  3705. # w32api 3.12 had it defined wrong
  3706. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  3707. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  3708. { check_header dev/bktr/ioctl_meteor.h &&
  3709. check_header dev/bktr/ioctl_bt848.h; } ||
  3710. { check_header machine/ioctl_meteor.h &&
  3711. check_header machine/ioctl_bt848.h; } ||
  3712. { check_header dev/video/meteor/ioctl_meteor.h &&
  3713. check_header dev/video/bktr/ioctl_bt848.h; } ||
  3714. check_header dev/ic/bt8xx.h
  3715. check_header sndio.h
  3716. check_header sys/soundcard.h
  3717. check_header soundcard.h
  3718. enabled_any alsa_indev alsa_outdev &&
  3719. check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  3720. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack &&
  3721. check_func jack_port_get_latency_range -ljack
  3722. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  3723. if enabled libcdio; then
  3724. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  3725. check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio
  3726. fi
  3727. check_lib X11/Xlib.h XOpenDisplay -lX11 && enable xlib
  3728. enabled x11grab &&
  3729. require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
  3730. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes &&
  3731. { enabled xlib || die "ERROR: Xlib not found"; }
  3732. enabled vdpau &&
  3733. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  3734. disable vdpau
  3735. enabled vdpau && enabled xlib &&
  3736. check_func_headers "vdpau/vdpau.h vdpau/vdpau_x11.h" vdp_device_create_x11 -lvdpau &&
  3737. prepend avconv_libs $($ldflags_filter "-lvdpau") &&
  3738. enable vdpau_x11
  3739. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  3740. # add some useful compiler flags if supported
  3741. check_cflags -Wdeclaration-after-statement
  3742. check_cflags -Wall
  3743. check_cflags -Wdisabled-optimization
  3744. check_cflags -Wpointer-arith
  3745. check_cflags -Wredundant-decls
  3746. check_cflags -Wcast-qual
  3747. check_cflags -Wwrite-strings
  3748. check_cflags -Wtype-limits
  3749. check_cflags -Wundef
  3750. check_cflags -Wmissing-prototypes
  3751. check_cflags -Wstrict-prototypes
  3752. enabled extra_warnings && check_cflags -Winline
  3753. check_disable_warning(){
  3754. warning_flag=-W${1#-Wno-}
  3755. test_cflags $warning_flag && add_cflags $1
  3756. }
  3757. check_disable_warning -Wno-parentheses
  3758. check_disable_warning -Wno-switch
  3759. check_disable_warning -Wno-format-zero-length
  3760. check_disable_warning -Wno-pointer-sign
  3761. # add some linker flags
  3762. check_ldflags -Wl,--warn-common
  3763. check_ldflags -Wl,-rpath-link=libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  3764. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  3765. # add some strip flags
  3766. # -wN '..@*' is more selective than -x, but not available everywhere.
  3767. check_stripflags -wN \'..@*\' || check_stripflags -x || strip='true'
  3768. enabled neon_clobber_test &&
  3769. check_ldflags -Wl,--wrap,avcodec_open2 \
  3770. -Wl,--wrap,avcodec_decode_audio4 \
  3771. -Wl,--wrap,avcodec_decode_video2 \
  3772. -Wl,--wrap,avcodec_decode_subtitle2 \
  3773. -Wl,--wrap,avcodec_encode_audio2 \
  3774. -Wl,--wrap,avcodec_encode_video2 \
  3775. -Wl,--wrap,avcodec_encode_subtitle \
  3776. -Wl,--wrap,avresample_convert ||
  3777. disable neon_clobber_test
  3778. enabled xmm_clobber_test &&
  3779. check_ldflags -Wl,--wrap,avcodec_open2 \
  3780. -Wl,--wrap,avcodec_decode_audio4 \
  3781. -Wl,--wrap,avcodec_decode_video2 \
  3782. -Wl,--wrap,avcodec_decode_subtitle2 \
  3783. -Wl,--wrap,avcodec_encode_audio2 \
  3784. -Wl,--wrap,avcodec_encode_video2 \
  3785. -Wl,--wrap,avcodec_encode_subtitle \
  3786. -Wl,--wrap,avresample_convert \
  3787. -Wl,--wrap,sws_scale ||
  3788. disable xmm_clobber_test
  3789. echo "X{};" > $TMPV
  3790. if test_ldflags -Wl,--version-script,$TMPV; then
  3791. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  3792. check_cc <<EOF && enable symver_asm_label
  3793. void ff_foo(void) __asm__ ("av_foo@VERSION");
  3794. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  3795. EOF
  3796. check_cc <<EOF && enable symver_gnu_asm
  3797. __asm__(".symver ff_foo,av_foo@VERSION");
  3798. void ff_foo(void) {}
  3799. EOF
  3800. fi
  3801. if [ -z "$optflags" ]; then
  3802. if enabled small; then
  3803. optflags=$cflags_size
  3804. elif enabled optimizations; then
  3805. optflags=$cflags_speed
  3806. else
  3807. optflags=$cflags_noopt
  3808. fi
  3809. fi
  3810. check_optflags(){
  3811. check_cflags "$@"
  3812. enabled lto && check_ldflags "$@"
  3813. }
  3814. if enabled lto; then
  3815. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  3816. check_cflags -flto
  3817. check_ldflags -flto $cpuflags
  3818. fi
  3819. check_optflags $optflags
  3820. check_optflags -fno-math-errno
  3821. check_optflags -fno-signed-zeros
  3822. if enabled icc; then
  3823. # Just warnings, no remarks
  3824. check_cflags -w1
  3825. # -wd: Disable following warnings
  3826. # 144, 167, 556: -Wno-pointer-sign
  3827. # 1292: attribute "foo" ignored
  3828. # 1419: external declaration in primary source file
  3829. # 10006: ignoring unknown option -fno-signed-zeros
  3830. # 10148: ignoring unknown option -Wno-parentheses
  3831. # 10156: ignoring option '-W'; no argument required
  3832. check_cflags -wd144,167,556,1292,1419,10006,10148,10156
  3833. # 11030: Warning unknown option --as-needed
  3834. # 10156: ignoring option '-export'; no argument required
  3835. check_ldflags -wd10156,11030
  3836. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  3837. enable ebp_available
  3838. if enabled x86_32; then
  3839. icc_version=$($cc -dumpversion)
  3840. test ${icc_version%%.*} -ge 11 &&
  3841. check_cflags -falign-stack=maintain-16-byte ||
  3842. disable aligned_stack
  3843. fi
  3844. elif enabled ccc; then
  3845. # disable some annoying warnings
  3846. add_cflags -msg_disable bitnotint
  3847. add_cflags -msg_disable mixfuncvoid
  3848. add_cflags -msg_disable nonstandcast
  3849. add_cflags -msg_disable unsupieee
  3850. elif enabled gcc; then
  3851. check_optflags -fno-tree-vectorize
  3852. check_cflags -Werror=implicit-function-declaration
  3853. check_cflags -Werror=missing-prototypes
  3854. check_cflags -Werror=return-type
  3855. check_cflags -Werror=declaration-after-statement
  3856. check_cflags -Werror=vla
  3857. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  3858. elif enabled llvm_gcc; then
  3859. check_cflags -mllvm -stack-alignment=16
  3860. elif enabled clang; then
  3861. check_cflags -mllvm -stack-alignment=16
  3862. check_cflags -Qunused-arguments
  3863. check_cflags -Werror=implicit-function-declaration
  3864. check_cflags -Werror=missing-prototypes
  3865. check_cflags -Werror=return-type
  3866. elif enabled cparser; then
  3867. add_cflags -Wno-missing-variable-declarations
  3868. add_cflags -Wno-empty-statement
  3869. elif enabled armcc; then
  3870. # 2523: use of inline assembler is deprecated
  3871. add_cflags -W${armcc_opt},--diag_suppress=2523
  3872. add_cflags -W${armcc_opt},--diag_suppress=1207
  3873. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  3874. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  3875. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  3876. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  3877. elif enabled tms470; then
  3878. add_cflags -pds=824 -pds=837
  3879. disable inline_asm
  3880. elif enabled pathscale; then
  3881. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  3882. elif enabled_any msvc icl; then
  3883. enabled x86_32 && disable aligned_stack
  3884. enabled_all x86_32 debug && add_cflags -Oy-
  3885. enabled debug && add_ldflags -debug
  3886. enable pragma_deprecated
  3887. if enabled icl; then
  3888. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  3889. # (correctly) on icl 13.x.
  3890. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  3891. add_cflags -Qansi-alias
  3892. # icl will pass the inline asm tests but inline asm is currently
  3893. # not supported (build will fail)
  3894. disable inline_asm
  3895. fi
  3896. fi
  3897. case $as_type in
  3898. clang)
  3899. add_asflags -Qunused-arguments
  3900. ;;
  3901. esac
  3902. case $ld_type in
  3903. clang)
  3904. check_ldflags -Qunused-arguments
  3905. ;;
  3906. esac
  3907. case $target_os in
  3908. osf1)
  3909. enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
  3910. ;;
  3911. plan9)
  3912. add_cppflags -Dmain=plan9_main
  3913. ;;
  3914. esac
  3915. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  3916. check_deps $CONFIG_LIST \
  3917. $CONFIG_EXTRA \
  3918. $HAVE_LIST \
  3919. $ALL_COMPONENTS \
  3920. ! enabled_any memalign posix_memalign aligned_malloc &&
  3921. enabled_any $need_memalign && enable memalign_hack
  3922. for thread in $THREADS_LIST; do
  3923. if enabled $thread; then
  3924. test -n "$thread_type" &&
  3925. die "ERROR: Only one thread type must be selected." ||
  3926. thread_type="$thread"
  3927. fi
  3928. done
  3929. echo "install prefix $prefix"
  3930. echo "source path $source_path"
  3931. echo "C compiler $cc"
  3932. echo "C library $libc_type"
  3933. if test "$host_cc" != "$cc"; then
  3934. echo "host C compiler $host_cc"
  3935. echo "host C library $host_libc_type"
  3936. fi
  3937. echo "ARCH $arch ($cpu)"
  3938. if test "$build_suffix" != ""; then
  3939. echo "build suffix $build_suffix"
  3940. fi
  3941. if test "$extra_version" != ""; then
  3942. echo "version string suffix $extra_version"
  3943. fi
  3944. echo "big-endian ${bigendian-no}"
  3945. echo "runtime cpu detection ${runtime_cpudetect-no}"
  3946. if enabled x86; then
  3947. echo "${yasmexe} ${yasm-no}"
  3948. echo "MMX enabled ${mmx-no}"
  3949. echo "MMXEXT enabled ${mmxext-no}"
  3950. echo "3DNow! enabled ${amd3dnow-no}"
  3951. echo "3DNow! extended enabled ${amd3dnowext-no}"
  3952. echo "SSE enabled ${sse-no}"
  3953. echo "SSSE3 enabled ${ssse3-no}"
  3954. echo "AVX enabled ${avx-no}"
  3955. echo "XOP enabled ${xop-no}"
  3956. echo "FMA3 enabled ${fma3-no}"
  3957. echo "FMA4 enabled ${fma4-no}"
  3958. echo "i686 features enabled ${i686-no}"
  3959. echo "CMOV is fast ${fast_cmov-no}"
  3960. echo "EBX available ${ebx_available-no}"
  3961. echo "EBP available ${ebp_available-no}"
  3962. fi
  3963. if enabled aarch64; then
  3964. echo "NEON enabled ${neon-no}"
  3965. echo "VFP enabled ${vfp-no}"
  3966. fi
  3967. if enabled arm; then
  3968. echo "ARMv5TE enabled ${armv5te-no}"
  3969. echo "ARMv6 enabled ${armv6-no}"
  3970. echo "ARMv6T2 enabled ${armv6t2-no}"
  3971. echo "VFP enabled ${vfp-no}"
  3972. echo "NEON enabled ${neon-no}"
  3973. fi
  3974. if enabled ppc; then
  3975. echo "AltiVec enabled ${altivec-no}"
  3976. echo "PPC 4xx optimizations ${ppc4xx-no}"
  3977. echo "dcbzl available ${dcbzl-no}"
  3978. fi
  3979. echo "debug symbols ${debug-no}"
  3980. echo "optimize for size ${small-no}"
  3981. echo "optimizations ${optimizations-no}"
  3982. echo "static ${static-no}"
  3983. echo "shared ${shared-no}"
  3984. echo "new filter support ${avfilter-no}"
  3985. echo "network support ${network-no}"
  3986. echo "threading support ${thread_type-no}"
  3987. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  3988. echo "SDL support ${sdl-no}"
  3989. test -n "$random_seed" &&
  3990. echo "random seed ${random_seed}"
  3991. echo
  3992. echo "External libraries:"
  3993. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
  3994. echo
  3995. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  3996. echo "Enabled ${type}s:"
  3997. eval list=\$$(toupper $type)_LIST
  3998. print_enabled '_*' $list | print_3_columns
  3999. echo
  4000. done
  4001. license="LGPL version 2.1 or later"
  4002. if enabled nonfree; then
  4003. license="nonfree and unredistributable"
  4004. elif enabled gplv3; then
  4005. license="GPL version 3 or later"
  4006. elif enabled lgplv3; then
  4007. license="LGPL version 3 or later"
  4008. elif enabled gpl; then
  4009. license="GPL version 2 or later"
  4010. fi
  4011. echo "License: $license"
  4012. echo "Creating config.mak and config.h..."
  4013. test -e Makefile || echo "include $source_path/Makefile" > Makefile
  4014. config_files="$TMPH config.mak"
  4015. cat > config.mak <<EOF
  4016. # Automatically generated by configure - do not modify!
  4017. LIBAV_CONFIGURATION=$LIBAV_CONFIGURATION
  4018. prefix=$prefix
  4019. LIBDIR=\$(DESTDIR)$libdir
  4020. SHLIBDIR=\$(DESTDIR)$shlibdir
  4021. INCDIR=\$(DESTDIR)$incdir
  4022. BINDIR=\$(DESTDIR)$bindir
  4023. DATADIR=\$(DESTDIR)$datadir
  4024. DOCDIR=\$(DESTDIR)$docdir
  4025. MANDIR=\$(DESTDIR)$mandir
  4026. SRC_PATH=$source_path
  4027. CC_IDENT=$cc_ident
  4028. ARCH=$arch
  4029. CC=$cc
  4030. AS=$as
  4031. LD=$ld
  4032. DEPCC=$dep_cc
  4033. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  4034. DEPAS=$as
  4035. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  4036. YASM=$yasmexe
  4037. DEPYASM=$yasmexe
  4038. AR=$ar
  4039. ARFLAGS=$arflags
  4040. AR_O=$ar_o
  4041. RANLIB=$ranlib
  4042. STRIP=$strip
  4043. LN_S=$ln_s
  4044. CPPFLAGS=$CPPFLAGS
  4045. CFLAGS=$CFLAGS
  4046. ASFLAGS=$ASFLAGS
  4047. AS_C=$AS_C
  4048. AS_O=$AS_O
  4049. CC_C=$CC_C
  4050. CC_E=$CC_E
  4051. CC_O=$CC_O
  4052. LD_O=$LD_O
  4053. LD_LIB=$LD_LIB
  4054. LD_PATH=$LD_PATH
  4055. DLLTOOL=$dlltool
  4056. LDFLAGS=$LDFLAGS
  4057. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  4058. STRIPFLAGS=$STRIPFLAGS
  4059. YASMFLAGS=$YASMFLAGS
  4060. BUILDSUF=$build_suffix
  4061. FULLNAME=$FULLNAME
  4062. LIBPREF=$LIBPREF
  4063. LIBSUF=$LIBSUF
  4064. LIBNAME=$LIBNAME
  4065. SLIBPREF=$SLIBPREF
  4066. SLIBSUF=$SLIBSUF
  4067. EXESUF=$EXESUF
  4068. EXTRA_VERSION=$extra_version
  4069. CCDEP=$CCDEP
  4070. CCDEP_FLAGS=$CCDEP_FLAGS
  4071. ASDEP=$ASDEP
  4072. ASDEP_FLAGS=$ASDEP_FLAGS
  4073. CC_DEPFLAGS=$CC_DEPFLAGS
  4074. AS_DEPFLAGS=$AS_DEPFLAGS
  4075. HOSTCC=$host_cc
  4076. HOSTLD=$host_ld
  4077. HOSTCFLAGS=$host_cflags
  4078. HOSTCPPFLAGS=$host_cppflags
  4079. HOSTEXESUF=$HOSTEXESUF
  4080. HOSTLDFLAGS=$host_ldflags
  4081. HOSTLIBS=$host_libs
  4082. DEPHOSTCC=$host_cc
  4083. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  4084. HOSTCCDEP=$HOSTCCDEP
  4085. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  4086. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  4087. HOSTCC_C=$HOSTCC_C
  4088. HOSTCC_O=$HOSTCC_O
  4089. HOSTLD_O=$HOSTLD_O
  4090. TARGET_EXEC=$target_exec $target_exec_args
  4091. TARGET_PATH=$target_path
  4092. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  4093. CFLAGS-avplay=$sdl_cflags
  4094. ZLIB=$($ldflags_filter -lz)
  4095. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  4096. EXTRALIBS=$extralibs
  4097. COMPAT_OBJS=$compat_objs
  4098. EXEOBJS=$exeobjs
  4099. INSTALL=install
  4100. LIBTARGET=${LIBTARGET}
  4101. SLIBNAME=${SLIBNAME}
  4102. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  4103. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  4104. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  4105. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  4106. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  4107. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  4108. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  4109. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  4110. SAMPLES:=${samples:-\$(LIBAV_SAMPLES)}
  4111. EOF
  4112. get_version(){
  4113. lcname=lib${1}
  4114. name=$(toupper $lcname)
  4115. file=$source_path/$lcname/version.h
  4116. eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
  4117. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  4118. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  4119. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  4120. eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
  4121. }
  4122. map 'get_version $v' $LIBRARY_LIST
  4123. print_program_libs(){
  4124. eval "program_libs=\$${1}_libs"
  4125. eval echo "LIBS-${1}=${program_libs}" >> config.mak
  4126. }
  4127. map 'print_program_libs $v' $PROGRAM_LIST
  4128. cat > $TMPH <<EOF
  4129. /* Automatically generated by configure - do not modify! */
  4130. #ifndef LIBAV_CONFIG_H
  4131. #define LIBAV_CONFIG_H
  4132. #define LIBAV_CONFIGURATION "$(c_escape $LIBAV_CONFIGURATION)"
  4133. #define LIBAV_LICENSE "$(c_escape $license)"
  4134. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  4135. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  4136. #define restrict $_restrict
  4137. #define EXTERN_PREFIX "${extern_prefix}"
  4138. #define EXTERN_ASM ${extern_prefix}
  4139. #define SLIBSUF "$SLIBSUF"
  4140. EOF
  4141. test -n "$malloc_prefix" &&
  4142. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  4143. if enabled yasm; then
  4144. append config_files $TMPASM
  4145. printf '' >$TMPASM
  4146. fi
  4147. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  4148. print_config ARCH_ "$config_files" $ARCH_LIST
  4149. print_config HAVE_ "$config_files" $HAVE_LIST
  4150. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  4151. $CONFIG_EXTRA \
  4152. $ALL_COMPONENTS \
  4153. echo "#endif /* LIBAV_CONFIG_H */" >> $TMPH
  4154. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  4155. cp_if_changed $TMPH config.h
  4156. touch .config
  4157. enabled yasm && cp_if_changed $TMPASM config.asm
  4158. cat > $TMPH <<EOF
  4159. /* Generated by ffconf */
  4160. #ifndef AVUTIL_AVCONFIG_H
  4161. #define AVUTIL_AVCONFIG_H
  4162. EOF
  4163. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  4164. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  4165. cp_if_changed $TMPH libavutil/avconfig.h
  4166. test -n "$WARNINGS" && printf "\n$WARNINGS"
  4167. # build pkg-config files
  4168. pkgconfig_generate(){
  4169. name=$1
  4170. shortname=${name#lib}${build_suffix}
  4171. comment=$2
  4172. version=$3
  4173. libs=$4
  4174. requires=$5
  4175. enabled ${name#lib} || return 0
  4176. mkdir -p $name
  4177. cat <<EOF > $name/$name.pc
  4178. prefix=$prefix
  4179. exec_prefix=\${prefix}
  4180. libdir=$libdir
  4181. includedir=$incdir
  4182. Name: $name
  4183. Description: $comment
  4184. Version: $version
  4185. Requires: $(enabled shared || echo $requires)
  4186. Requires.private: $(enabled shared && echo $requires)
  4187. Conflicts:
  4188. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  4189. Libs.private: $(enabled shared && echo $libs)
  4190. Cflags: -I\${includedir}
  4191. EOF
  4192. cat <<EOF > $name/$name-uninstalled.pc
  4193. prefix=
  4194. exec_prefix=
  4195. libdir=\${pcfiledir}
  4196. includedir=${source_path}
  4197. Name: $name
  4198. Description: $comment
  4199. Version: $version
  4200. Requires: $requires
  4201. Conflicts:
  4202. Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
  4203. Cflags: -I\${includedir}
  4204. EOF
  4205. }
  4206. lavfi_libs="libavutil = $LIBAVUTIL_VERSION"
  4207. enabled movie_filter && prepend lavfi_libs "libavformat >= $LIBAVFORMAT_VERSION, libavcodec >= $LIBAVCODEC_VERSION,"
  4208. enabled resample_filter && prepend lavfi_libs "libavresample >= $LIBAVRESAMPLE_VERSION,"
  4209. enabled scale_filter && prepend lavfi_libs "libswscale >= $LIBSWSCALE_VERSION,"
  4210. pkgconfig_generate libavutil "Libav utility library" "$LIBAVUTIL_VERSION" "$LIBM"
  4211. pkgconfig_generate libavcodec "Libav codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  4212. pkgconfig_generate libavformat "Libav container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec = $LIBAVCODEC_VERSION"
  4213. pkgconfig_generate libavdevice "Libav device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "libavformat = $LIBAVFORMAT_VERSION"
  4214. pkgconfig_generate libavfilter "Libav video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$lavfi_libs"
  4215. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil = $LIBAVUTIL_VERSION"
  4216. pkgconfig_generate libswscale "Libav image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil = $LIBAVUTIL_VERSION"