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.

5036 lines
154KB

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