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.

5441 lines
163KB

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