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

5412 lines
162KB

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