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.

5410 lines
162KB

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