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.

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