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.

5116 lines
157KB

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