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.

5033 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. h264chroma
  1429. h264dsp
  1430. h264pred
  1431. h264qpel
  1432. hpeldsp
  1433. huffman
  1434. lgplv3
  1435. lpc
  1436. mpegaudio
  1437. mpegaudiodsp
  1438. mpegvideo
  1439. mpegvideoenc
  1440. nettle
  1441. rangecoder
  1442. riffdec
  1443. riffenc
  1444. rtpdec
  1445. rtpenc_chain
  1446. sinewin
  1447. videodsp
  1448. vp3dsp
  1449. "
  1450. CMDLINE_SELECT="
  1451. $ARCH_EXT_LIST
  1452. $CONFIG_LIST
  1453. $HAVE_LIST_CMDLINE
  1454. $THREADS_LIST
  1455. asm
  1456. cross_compile
  1457. debug
  1458. extra_warnings
  1459. logging
  1460. lto
  1461. optimizations
  1462. stripping
  1463. "
  1464. PATHS_LIST='
  1465. bindir
  1466. datadir
  1467. docdir
  1468. incdir
  1469. libdir
  1470. mandir
  1471. prefix
  1472. shlibdir
  1473. '
  1474. CMDLINE_SET="
  1475. $PATHS_LIST
  1476. ar
  1477. arch
  1478. as
  1479. assert_level
  1480. build_suffix
  1481. cc
  1482. cpu
  1483. cross_prefix
  1484. cxx
  1485. dep_cc
  1486. extra_version
  1487. host_cc
  1488. host_cflags
  1489. host_ld
  1490. host_ldflags
  1491. host_libs
  1492. host_os
  1493. install
  1494. ld
  1495. logfile
  1496. malloc_prefix
  1497. nm
  1498. optflags
  1499. pkg_config
  1500. progs_suffix
  1501. random_seed
  1502. samples
  1503. strip
  1504. sysinclude
  1505. sysroot
  1506. target_exec
  1507. target_os
  1508. target_path
  1509. target_samples
  1510. tempprefix
  1511. toolchain
  1512. valgrind
  1513. yasmexe
  1514. "
  1515. CMDLINE_APPEND="
  1516. extra_cflags
  1517. extra_cxxflags
  1518. host_cppflags
  1519. "
  1520. # code dependency declarations
  1521. # architecture extensions
  1522. armv5te_deps="arm"
  1523. armv6_deps="arm"
  1524. armv6t2_deps="arm"
  1525. neon_deps="arm"
  1526. vfp_deps="arm"
  1527. vfpv3_deps="vfp"
  1528. map 'eval ${v}_inline_deps=inline_asm' $ARCH_EXT_LIST_ARM
  1529. mipsfpu_deps="mips"
  1530. mips32r2_deps="mips"
  1531. mipsdspr1_deps="mips"
  1532. mipsdspr2_deps="mips"
  1533. altivec_deps="ppc"
  1534. ppc4xx_deps="ppc"
  1535. vis_deps="sparc"
  1536. cpunop_deps="i686"
  1537. x86_64_select="i686"
  1538. x86_64_suggest="fast_cmov"
  1539. amd3dnow_deps="mmx"
  1540. amd3dnowext_deps="amd3dnow"
  1541. mmx_deps="x86"
  1542. mmxext_deps="mmx"
  1543. sse_deps="mmxext"
  1544. sse2_deps="sse"
  1545. sse3_deps="sse2"
  1546. ssse3_deps="sse3"
  1547. sse4_deps="ssse3"
  1548. sse42_deps="sse4"
  1549. avx_deps="sse42"
  1550. fma4_deps="avx"
  1551. avx2_deps="avx"
  1552. mmx_external_deps="yasm"
  1553. mmx_inline_deps="inline_asm"
  1554. mmx_suggest="mmx_external mmx_inline"
  1555. for ext in $(filter_out mmx $ARCH_EXT_LIST_X86); do
  1556. eval dep=\$${ext}_deps
  1557. eval ${ext}_external_deps='"${dep}_external"'
  1558. eval ${ext}_inline_deps='"${dep}_inline"'
  1559. eval ${ext}_suggest='"${ext}_external ${ext}_inline"'
  1560. done
  1561. aligned_stack_if_any="ppc x86"
  1562. fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64"
  1563. fast_clz_if_any="alpha avr32 mips ppc x86"
  1564. fast_unaligned_if_any="ppc x86"
  1565. inline_asm_deps="!tms470"
  1566. need_memalign="altivec neon sse"
  1567. symver_if_any="symver_asm_label symver_gnu_asm"
  1568. log2_deps="!msvcrt"
  1569. # subsystems
  1570. dct_select="rdft"
  1571. error_resilience_select="dsputil"
  1572. frame_thread_encoder_deps="encoders threads"
  1573. lpc_select="dsputil"
  1574. mdct_select="fft"
  1575. rdft_select="fft"
  1576. mpegaudio_select="mpegaudiodsp"
  1577. mpegaudiodsp_select="dct"
  1578. mpegvideo_select="dsputil h264chroma hpeldsp videodsp"
  1579. mpegvideoenc_select="mpegvideo"
  1580. # decoders / encoders
  1581. aac_decoder_select="mdct sinewin"
  1582. aac_encoder_select="audio_frame_queue mdct sinewin"
  1583. aac_latm_decoder_select="aac_decoder aac_latm_parser"
  1584. ac3_decoder_select="mdct ac3dsp ac3_parser dsputil"
  1585. ac3_encoder_select="mdct ac3dsp dsputil"
  1586. ac3_fixed_encoder_select="mdct ac3dsp dsputil"
  1587. aic_decoder_select="dsputil golomb"
  1588. alac_encoder_select="lpc"
  1589. als_decoder_select="dsputil"
  1590. amrnb_decoder_select="lsp"
  1591. amrwb_decoder_select="lsp"
  1592. amv_decoder_select="dsputil hpeldsp exif"
  1593. amv_encoder_select="aandcttables"
  1594. ape_decoder_select="dsputil"
  1595. asv1_decoder_select="dsputil"
  1596. asv1_encoder_select="dsputil"
  1597. asv2_decoder_select="dsputil"
  1598. asv2_encoder_select="dsputil"
  1599. atrac1_decoder_select="mdct sinewin"
  1600. atrac3_decoder_select="mdct"
  1601. avrn_decoder_select="exif"
  1602. bink_decoder_select="dsputil hpeldsp"
  1603. binkaudio_dct_decoder_select="mdct rdft dct sinewin"
  1604. binkaudio_rdft_decoder_select="mdct rdft sinewin"
  1605. cavs_decoder_select="dsputil golomb h264chroma videodsp"
  1606. cllc_decoder_select="dsputil"
  1607. comfortnoise_encoder_select="lpc"
  1608. cook_decoder_select="dsputil mdct sinewin"
  1609. cscd_decoder_select="lzo"
  1610. cscd_decoder_suggest="zlib"
  1611. dca_decoder_select="mdct"
  1612. dirac_decoder_select="dsputil dwt golomb videodsp"
  1613. dnxhd_decoder_select="dsputil"
  1614. dnxhd_encoder_select="aandcttables dsputil mpegvideoenc"
  1615. dvvideo_decoder_select="dsputil"
  1616. dvvideo_encoder_select="dsputil"
  1617. dxa_decoder_select="zlib"
  1618. eac3_decoder_select="ac3_decoder"
  1619. eac3_encoder_select="ac3_encoder"
  1620. eamad_decoder_select="aandcttables dsputil mpegvideo"
  1621. eatgq_decoder_select="aandcttables"
  1622. eatqi_decoder_select="aandcttables error_resilience mpegvideo"
  1623. exr_decoder_select="zlib"
  1624. ffv1_decoder_select="dsputil golomb rangecoder"
  1625. ffv1_encoder_select="dsputil rangecoder"
  1626. ffvhuff_decoder_select="dsputil"
  1627. ffvhuff_encoder_select="dsputil huffman"
  1628. flac_decoder_select="golomb"
  1629. flac_encoder_select="dsputil golomb lpc"
  1630. flashsv_decoder_select="zlib"
  1631. flashsv_encoder_select="zlib"
  1632. flashsv2_encoder_select="zlib"
  1633. flashsv2_decoder_select="zlib"
  1634. flv_decoder_select="h263_decoder"
  1635. flv_encoder_select="h263_encoder"
  1636. fourxm_decoder_select="dsputil"
  1637. fraps_decoder_select="dsputil huffman"
  1638. g2m_decoder_select="dsputil zlib"
  1639. g729_decoder_select="dsputil"
  1640. h261_decoder_select="error_resilience mpegvideo"
  1641. h261_encoder_select="aandcttables mpegvideoenc"
  1642. h263_decoder_select="error_resilience h263_parser mpegvideo"
  1643. h263_encoder_select="aandcttables mpegvideoenc"
  1644. h263i_decoder_select="h263_decoder"
  1645. h263p_encoder_select="h263_encoder"
  1646. h264_decoder_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
  1647. h264_decoder_suggest="error_resilience"
  1648. hevc_decoder_select="dsputil golomb videodsp"
  1649. huffyuv_decoder_select="dsputil"
  1650. huffyuv_encoder_select="dsputil huffman"
  1651. iac_decoder_select="dsputil fft mdct sinewin"
  1652. imc_decoder_select="dsputil fft mdct sinewin"
  1653. indeo3_decoder_select="hpeldsp"
  1654. interplay_video_decoder_select="hpeldsp"
  1655. jpegls_decoder_select="dsputil golomb hpeldsp exif"
  1656. jpegls_encoder_select="golomb"
  1657. jv_decoder_select="dsputil"
  1658. lagarith_decoder_select="dsputil"
  1659. ljpeg_encoder_select="aandcttables mpegvideoenc"
  1660. loco_decoder_select="golomb"
  1661. mdec_decoder_select="dsputil error_resilience mpegvideo"
  1662. metasound_decoder_select="lsp mdct sinewin"
  1663. mimic_decoder_select="dsputil hpeldsp"
  1664. mjpeg_decoder_select="dsputil hpeldsp exif"
  1665. mjpegb_decoder_select="dsputil hpeldsp exif"
  1666. mjpeg_encoder_select="aandcttables dsputil mpegvideoenc"
  1667. mlp_decoder_select="dsputil mlp_parser"
  1668. motionpixels_decoder_select="dsputil"
  1669. mp1_decoder_select="mpegaudio"
  1670. mp1float_decoder_select="mpegaudio"
  1671. mp2_decoder_select="mpegaudio"
  1672. mp2float_decoder_select="mpegaudio"
  1673. mp3_decoder_select="mpegaudio"
  1674. mp3adu_decoder_select="mpegaudio"
  1675. mp3adufloat_decoder_select="mpegaudio"
  1676. mp3float_decoder_select="mpegaudio"
  1677. mp3on4_decoder_select="mpegaudio"
  1678. mp3on4float_decoder_select="mpegaudio"
  1679. mpc7_decoder_select="dsputil mpegaudiodsp"
  1680. mpc8_decoder_select="dsputil mpegaudiodsp"
  1681. mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h"
  1682. mpeg_xvmc_decoder_select="mpeg2video_decoder"
  1683. mpeg1video_decoder_select="error_resilience mpegvideo"
  1684. mpeg1video_encoder_select="aandcttables mpegvideoenc"
  1685. mpeg2video_decoder_select="error_resilience mpegvideo"
  1686. mpeg2video_encoder_select="aandcttables mpegvideoenc"
  1687. mpeg4_decoder_select="h263_decoder mpeg4video_parser"
  1688. mpeg4_encoder_select="h263_encoder"
  1689. msmpeg4v1_decoder_select="h263_decoder"
  1690. msmpeg4v2_decoder_select="h263_decoder"
  1691. msmpeg4v2_encoder_select="h263_encoder"
  1692. msmpeg4v3_decoder_select="h263_decoder"
  1693. msmpeg4v3_encoder_select="h263_encoder"
  1694. mss2_decoder_select="error_resilience vc1_decoder"
  1695. mxpeg_decoder_select="dsputil hpeldsp exif"
  1696. nellymoser_decoder_select="mdct sinewin"
  1697. nellymoser_encoder_select="audio_frame_queue mdct sinewin"
  1698. nuv_decoder_select="dsputil lzo"
  1699. png_decoder_select="zlib"
  1700. png_encoder_select="dsputil zlib"
  1701. prores_decoder_select="dsputil"
  1702. prores_encoder_select="dsputil"
  1703. qcelp_decoder_select="lsp"
  1704. qdm2_decoder_select="mdct rdft mpegaudiodsp"
  1705. ra_144_encoder_select="audio_frame_queue lpc"
  1706. ralf_decoder_select="golomb"
  1707. rtjpeg_decoder_select="dsputil"
  1708. rv10_decoder_select="error_resilience h263_decoder"
  1709. rv10_encoder_select="h263_encoder"
  1710. rv20_decoder_select="error_resilience h263_decoder"
  1711. rv20_encoder_select="h263_encoder"
  1712. rv30_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp"
  1713. rv40_decoder_select="error_resilience golomb h264chroma h264pred h264qpel mpegvideo videodsp"
  1714. shorten_decoder_select="golomb"
  1715. sipr_decoder_select="lsp"
  1716. snow_decoder_select="dsputil dwt h264qpel hpeldsp rangecoder"
  1717. snow_encoder_select="aandcttables dsputil dwt h264qpel hpeldsp mpegvideoenc rangecoder"
  1718. sonic_decoder_select="golomb"
  1719. sonic_encoder_select="golomb"
  1720. sonic_ls_encoder_select="golomb"
  1721. sp5x_decoder_select="dsputil hpeldsp exif"
  1722. svq1_decoder_select="hpeldsp"
  1723. svq1_encoder_select="aandcttables dsputil hpeldsp mpegvideoenc"
  1724. svq3_decoder_select="golomb h264chroma h264dsp h264pred h264qpel hpeldsp mpegvideo videodsp"
  1725. svq3_decoder_suggest="error_resilience zlib"
  1726. tak_decoder_select="dsputil"
  1727. theora_decoder_select="vp3_decoder"
  1728. tiff_decoder_suggest="zlib"
  1729. tiff_encoder_suggest="zlib"
  1730. thp_decoder_select="dsputil hpeldsp exif"
  1731. truehd_decoder_select="mlp_parser"
  1732. truemotion2_decoder_select="dsputil"
  1733. truespeech_decoder_select="dsputil"
  1734. tscc_decoder_select="zlib"
  1735. twinvq_decoder_select="mdct lsp sinewin"
  1736. utvideo_decoder_select="dsputil"
  1737. utvideo_encoder_select="dsputil huffman"
  1738. vble_decoder_select="dsputil"
  1739. vc1_decoder_select="error_resilience h263_decoder h264chroma h264qpel"
  1740. vc1image_decoder_select="vc1_decoder"
  1741. vorbis_decoder_select="mdct"
  1742. vorbis_encoder_select="mdct"
  1743. vp3_decoder_select="hpeldsp vp3dsp videodsp"
  1744. vp5_decoder_select="h264chroma hpeldsp videodsp vp3dsp"
  1745. vp6_decoder_select="h264chroma hpeldsp huffman videodsp vp3dsp"
  1746. vp6a_decoder_select="vp6_decoder"
  1747. vp6f_decoder_select="vp6_decoder"
  1748. vp8_decoder_select="h264pred videodsp"
  1749. vp9_decoder_select="videodsp"
  1750. webp_decoder_select="vp8_decoder"
  1751. wmapro_decoder_select="mdct sinewin"
  1752. wmav1_decoder_select="mdct sinewin"
  1753. wmav1_encoder_select="mdct sinewin"
  1754. wmav2_decoder_select="mdct sinewin"
  1755. wmav2_encoder_select="mdct sinewin"
  1756. wmavoice_decoder_select="lsp rdft dct mdct sinewin"
  1757. wmv1_decoder_select="h263_decoder"
  1758. wmv1_encoder_select="h263_encoder"
  1759. wmv2_decoder_select="h263_decoder videodsp"
  1760. wmv2_encoder_select="h263_encoder"
  1761. wmv3_decoder_select="vc1_decoder"
  1762. wmv3image_decoder_select="wmv3_decoder"
  1763. zerocodec_decoder_select="zlib"
  1764. zlib_decoder_select="zlib"
  1765. zlib_encoder_select="zlib"
  1766. zmbv_decoder_select="zlib"
  1767. zmbv_encoder_select="zlib"
  1768. # hardware accelerators
  1769. crystalhd_deps="libcrystalhd_libcrystalhd_if_h"
  1770. dxva2_deps="dxva2api_h"
  1771. vaapi_deps="va_va_h"
  1772. vda_deps="VideoDecodeAcceleration_VDADecoder_h pthreads"
  1773. vda_extralibs="-framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore"
  1774. vdpau_deps="vdpau_vdpau_h vdpau_vdpau_x11_h"
  1775. h263_vaapi_hwaccel_deps="vaapi"
  1776. h263_vaapi_hwaccel_select="h263_decoder"
  1777. h263_vdpau_hwaccel_deps="vdpau"
  1778. h263_vdpau_hwaccel_select="h263_decoder"
  1779. h264_crystalhd_decoder_select="crystalhd h264_mp4toannexb_bsf h264_parser"
  1780. h264_dxva2_hwaccel_deps="dxva2"
  1781. h264_dxva2_hwaccel_select="h264_decoder"
  1782. h264_vaapi_hwaccel_deps="vaapi"
  1783. h264_vaapi_hwaccel_select="h264_decoder"
  1784. h264_vda_decoder_deps="vda"
  1785. h264_vda_decoder_select="h264_decoder"
  1786. h264_vda_hwaccel_deps="vda"
  1787. h264_vda_hwaccel_select="h264_decoder"
  1788. h264_vdpau_decoder_deps="vdpau"
  1789. h264_vdpau_decoder_select="h264_decoder"
  1790. h264_vdpau_hwaccel_deps="vdpau"
  1791. h264_vdpau_hwaccel_select="h264_decoder"
  1792. mpeg_vdpau_decoder_deps="vdpau"
  1793. mpeg_vdpau_decoder_select="mpeg2video_decoder"
  1794. mpeg1_vdpau_decoder_deps="vdpau"
  1795. mpeg1_vdpau_decoder_select="mpeg1video_decoder"
  1796. mpeg1_vdpau_hwaccel_deps="vdpau"
  1797. mpeg1_vdpau_hwaccel_select="mpeg1video_decoder"
  1798. mpeg2_crystalhd_decoder_select="crystalhd"
  1799. mpeg2_dxva2_hwaccel_deps="dxva2"
  1800. mpeg2_dxva2_hwaccel_select="mpeg2video_decoder"
  1801. mpeg2_vaapi_hwaccel_deps="vaapi"
  1802. mpeg2_vaapi_hwaccel_select="mpeg2video_decoder"
  1803. mpeg2_vdpau_hwaccel_deps="vdpau"
  1804. mpeg2_vdpau_hwaccel_select="mpeg2video_decoder"
  1805. mpeg4_crystalhd_decoder_select="crystalhd"
  1806. mpeg4_vaapi_hwaccel_deps="vaapi"
  1807. mpeg4_vaapi_hwaccel_select="mpeg4_decoder"
  1808. mpeg4_vdpau_decoder_deps="vdpau"
  1809. mpeg4_vdpau_decoder_select="mpeg4_decoder"
  1810. mpeg4_vdpau_hwaccel_deps="vdpau"
  1811. mpeg4_vdpau_hwaccel_select="mpeg4_decoder"
  1812. msmpeg4_crystalhd_decoder_select="crystalhd"
  1813. vc1_crystalhd_decoder_select="crystalhd"
  1814. vc1_dxva2_hwaccel_deps="dxva2"
  1815. vc1_dxva2_hwaccel_select="vc1_decoder"
  1816. vc1_vaapi_hwaccel_deps="vaapi"
  1817. vc1_vaapi_hwaccel_select="vc1_decoder"
  1818. vc1_vdpau_decoder_deps="vdpau"
  1819. vc1_vdpau_decoder_select="vc1_decoder"
  1820. vc1_vdpau_hwaccel_deps="vdpau"
  1821. vc1_vdpau_hwaccel_select="vc1_decoder"
  1822. wmv3_crystalhd_decoder_select="crystalhd"
  1823. wmv3_dxva2_hwaccel_select="vc1_dxva2_hwaccel"
  1824. wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel"
  1825. wmv3_vdpau_decoder_select="vc1_vdpau_decoder"
  1826. wmv3_vdpau_hwaccel_select="vc1_vdpau_hwaccel"
  1827. # parsers
  1828. h264_parser_select="golomb h264chroma h264dsp h264pred h264qpel videodsp"
  1829. mpeg4video_parser_select="error_resilience mpegvideo"
  1830. mpegvideo_parser_select="error_resilience mpegvideo"
  1831. vc1_parser_select="mpegvideo"
  1832. # external libraries
  1833. libaacplus_encoder_deps="libaacplus"
  1834. libcelt_decoder_deps="libcelt"
  1835. libfaac_encoder_deps="libfaac"
  1836. libfaac_encoder_select="audio_frame_queue"
  1837. libfdk_aac_decoder_deps="libfdk_aac"
  1838. libfdk_aac_encoder_deps="libfdk_aac"
  1839. libfdk_aac_encoder_select="audio_frame_queue"
  1840. libgme_demuxer_deps="libgme"
  1841. libgsm_decoder_deps="libgsm"
  1842. libgsm_encoder_deps="libgsm"
  1843. libgsm_ms_decoder_deps="libgsm"
  1844. libgsm_ms_encoder_deps="libgsm"
  1845. libilbc_decoder_deps="libilbc"
  1846. libilbc_encoder_deps="libilbc"
  1847. libmodplug_demuxer_deps="libmodplug"
  1848. libmp3lame_encoder_deps="libmp3lame"
  1849. libmp3lame_encoder_select="audio_frame_queue"
  1850. libopencore_amrnb_decoder_deps="libopencore_amrnb"
  1851. libopencore_amrnb_encoder_deps="libopencore_amrnb"
  1852. libopencore_amrnb_encoder_select="audio_frame_queue"
  1853. libopencore_amrwb_decoder_deps="libopencore_amrwb"
  1854. libopenjpeg_decoder_deps="libopenjpeg"
  1855. libopenjpeg_encoder_deps="libopenjpeg"
  1856. libopus_decoder_deps="libopus"
  1857. libopus_encoder_deps="libopus"
  1858. libopus_encoder_select="audio_frame_queue"
  1859. libquvi_demuxer_deps="libquvi"
  1860. libschroedinger_decoder_deps="libschroedinger"
  1861. libschroedinger_encoder_deps="libschroedinger"
  1862. libshine_encoder_deps="libshine"
  1863. libshine_encoder_select="audio_frame_queue"
  1864. libspeex_decoder_deps="libspeex"
  1865. libspeex_encoder_deps="libspeex"
  1866. libspeex_encoder_select="audio_frame_queue"
  1867. libstagefright_h264_decoder_deps="libstagefright_h264"
  1868. libtheora_encoder_deps="libtheora"
  1869. libtwolame_encoder_deps="libtwolame"
  1870. libvo_aacenc_encoder_deps="libvo_aacenc"
  1871. libvo_aacenc_encoder_select="audio_frame_queue"
  1872. libvo_amrwbenc_encoder_deps="libvo_amrwbenc"
  1873. libvorbis_decoder_deps="libvorbis"
  1874. libvorbis_encoder_deps="libvorbis"
  1875. libvorbis_encoder_select="audio_frame_queue"
  1876. libvpx_vp8_decoder_deps="libvpx"
  1877. libvpx_vp8_encoder_deps="libvpx"
  1878. libvpx_vp9_decoder_deps="libvpx"
  1879. libvpx_vp9_encoder_deps="libvpx"
  1880. libwavpack_encoder_deps="libwavpack"
  1881. libx264_encoder_deps="libx264"
  1882. libx264rgb_encoder_deps="libx264"
  1883. libxavs_encoder_deps="libxavs"
  1884. libxvid_encoder_deps="libxvid"
  1885. libutvideo_decoder_deps="libutvideo"
  1886. libutvideo_encoder_deps="libutvideo"
  1887. libzvbi_teletext_decoder_deps="libzvbi"
  1888. # demuxers / muxers
  1889. ac3_demuxer_select="ac3_parser"
  1890. asf_demuxer_select="riffdec"
  1891. asf_muxer_select="riffenc"
  1892. asf_stream_muxer_select="asf_muxer"
  1893. avi_demuxer_select="riffdec"
  1894. avi_muxer_select="riffenc"
  1895. avisynth_demuxer_deps="avisynth"
  1896. avisynth_demuxer_select="riffdec"
  1897. caf_demuxer_select="riffdec"
  1898. dirac_demuxer_select="dirac_parser"
  1899. dts_demuxer_select="dca_parser"
  1900. dtshd_demuxer_select="dca_parser"
  1901. dxa_demuxer_select="riffdec"
  1902. eac3_demuxer_select="ac3_parser"
  1903. f4v_muxer_select="mov_muxer"
  1904. flac_demuxer_select="flac_parser"
  1905. hds_muxer_select="flv_muxer"
  1906. hls_muxer_select="mpegts_muxer"
  1907. ipod_muxer_select="mov_muxer"
  1908. ismv_muxer_select="mov_muxer"
  1909. libnut_demuxer_deps="libnut"
  1910. libnut_muxer_deps="libnut"
  1911. matroska_audio_muxer_select="matroska_muxer"
  1912. matroska_demuxer_select="riffdec"
  1913. matroska_demuxer_suggest="bzlib lzo zlib"
  1914. matroska_muxer_select="riffenc"
  1915. mmf_muxer_select="riffenc"
  1916. mov_demuxer_select="riffdec"
  1917. mov_demuxer_suggest="zlib"
  1918. mov_muxer_select="riffenc rtpenc_chain"
  1919. mp3_demuxer_select="mpegaudio_parser"
  1920. mp4_muxer_select="mov_muxer"
  1921. mpegts_muxer_select="adts_muxer latm_muxer"
  1922. mpegtsraw_demuxer_select="mpegts_demuxer"
  1923. mxf_d10_muxer_select="mxf_muxer"
  1924. nut_muxer_select="riffenc"
  1925. nuv_demuxer_select="riffdec"
  1926. ogg_demuxer_select="golomb"
  1927. psp_muxer_select="mov_muxer"
  1928. rtp_demuxer_select="sdp_demuxer"
  1929. rtpdec_select="asf_demuxer rm_demuxer rtp_protocol mpegts_demuxer mov_demuxer"
  1930. rtsp_demuxer_select="http_protocol rtpdec"
  1931. rtsp_muxer_select="rtp_muxer http_protocol rtp_protocol rtpenc_chain"
  1932. sap_demuxer_select="sdp_demuxer"
  1933. sap_muxer_select="rtp_muxer rtp_protocol rtpenc_chain"
  1934. sdp_demuxer_select="rtpdec"
  1935. smoothstreaming_muxer_select="ismv_muxer"
  1936. spdif_muxer_select="aac_parser"
  1937. tak_demuxer_select="tak_parser"
  1938. tg2_muxer_select="mov_muxer"
  1939. tgp_muxer_select="mov_muxer"
  1940. vobsub_demuxer_select="mpegps_demuxer"
  1941. w64_demuxer_select="wav_demuxer"
  1942. w64_muxer_select="wav_muxer"
  1943. wav_demuxer_select="riffdec"
  1944. wav_muxer_select="riffenc"
  1945. webm_muxer_select="riffenc"
  1946. wtv_demuxer_select="riffdec"
  1947. xmv_demuxer_select="riffdec"
  1948. xwma_demuxer_select="riffdec"
  1949. # indevs / outdevs
  1950. alsa_indev_deps="alsa_asoundlib_h snd_pcm_htimestamp"
  1951. alsa_outdev_deps="alsa_asoundlib_h"
  1952. bktr_indev_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  1953. caca_outdev_deps="libcaca"
  1954. dshow_indev_deps="IBaseFilter"
  1955. dshow_indev_extralibs="-lpsapi -lole32 -lstrmiids -luuid"
  1956. dv1394_indev_deps="dv1394"
  1957. dv1394_indev_select="dv_demuxer"
  1958. fbdev_indev_deps="linux_fb_h"
  1959. fbdev_outdev_deps="linux_fb_h"
  1960. iec61883_indev_deps="libiec61883"
  1961. jack_indev_deps="jack_jack_h sem_timedwait"
  1962. lavfi_indev_deps="avfilter"
  1963. libcdio_indev_deps="libcdio"
  1964. libdc1394_indev_deps="libdc1394"
  1965. libv4l2_indev_deps="libv4l2"
  1966. openal_indev_deps="openal"
  1967. oss_indev_deps_any="soundcard_h sys_soundcard_h"
  1968. oss_outdev_deps_any="soundcard_h sys_soundcard_h"
  1969. pulse_indev_deps="libpulse"
  1970. pulse_outdev_deps="libpulse"
  1971. sdl_outdev_deps="sdl"
  1972. sndio_indev_deps="sndio_h"
  1973. sndio_outdev_deps="sndio_h"
  1974. v4l_indev_deps="linux_videodev_h"
  1975. v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h"
  1976. v4l2_outdev_deps_any="linux_videodev2_h sys_videoio_h"
  1977. vfwcap_indev_deps="capCreateCaptureWindow vfwcap_defines"
  1978. vfwcap_indev_extralibs="-lavicap32"
  1979. xv_outdev_deps="X11_extensions_Xvlib_h XvGetPortAttribute"
  1980. xv_outdev_extralibs="-lXv -lX11 -lXext"
  1981. x11grab_indev_deps="x11grab"
  1982. # protocols
  1983. bluray_protocol_deps="libbluray"
  1984. ffrtmpcrypt_protocol_deps="!librtmp_protocol"
  1985. ffrtmpcrypt_protocol_deps_any="gcrypt nettle openssl"
  1986. ffrtmpcrypt_protocol_select="tcp_protocol"
  1987. ffrtmphttp_protocol_deps="!librtmp_protocol"
  1988. ffrtmphttp_protocol_select="http_protocol"
  1989. ftp_protocol_select="tcp_protocol"
  1990. gopher_protocol_select="network"
  1991. httpproxy_protocol_select="tcp_protocol"
  1992. http_protocol_select="tcp_protocol"
  1993. https_protocol_select="tls_protocol"
  1994. librtmp_protocol_deps="librtmp"
  1995. librtmpe_protocol_deps="librtmp"
  1996. librtmps_protocol_deps="librtmp"
  1997. librtmpt_protocol_deps="librtmp"
  1998. librtmpte_protocol_deps="librtmp"
  1999. libssh_protocol_deps="libssh"
  2000. mmsh_protocol_select="http_protocol"
  2001. mmst_protocol_select="network"
  2002. rtmp_protocol_deps="!librtmp_protocol"
  2003. rtmp_protocol_select="tcp_protocol"
  2004. rtmpe_protocol_select="ffrtmpcrypt_protocol"
  2005. rtmps_protocol_deps="!librtmp_protocol"
  2006. rtmps_protocol_select="tls_protocol"
  2007. rtmpt_protocol_select="ffrtmphttp_protocol"
  2008. rtmpte_protocol_select="ffrtmpcrypt_protocol ffrtmphttp_protocol"
  2009. rtmpts_protocol_select="ffrtmphttp_protocol https_protocol"
  2010. rtp_protocol_select="udp_protocol"
  2011. sctp_protocol_deps="struct_sctp_event_subscribe"
  2012. sctp_protocol_select="network"
  2013. srtp_protocol_select="rtp_protocol"
  2014. tcp_protocol_select="network"
  2015. tls_protocol_deps_any="openssl gnutls"
  2016. tls_protocol_select="tcp_protocol"
  2017. udp_protocol_select="network"
  2018. unix_protocol_deps="sys_un_h"
  2019. unix_protocol_select="network"
  2020. # filters
  2021. aconvert_filter_deps="swresample"
  2022. amovie_filter_deps="avcodec avformat"
  2023. aresample_filter_deps="swresample"
  2024. ass_filter_deps="libass"
  2025. asyncts_filter_deps="avresample"
  2026. atempo_filter_deps="avcodec"
  2027. atempo_filter_select="rdft"
  2028. azmq_filter_deps="libzmq"
  2029. blackframe_filter_deps="gpl"
  2030. boxblur_filter_deps="gpl"
  2031. colormatrix_filter_deps="gpl"
  2032. cropdetect_filter_deps="gpl"
  2033. dctdnoiz_filter_deps="avcodec"
  2034. dctdnoiz_filter_select="fft"
  2035. delogo_filter_deps="gpl"
  2036. deshake_filter_deps="avcodec"
  2037. deshake_filter_select="dsputil"
  2038. drawtext_filter_deps="libfreetype"
  2039. ebur128_filter_deps="gpl"
  2040. flite_filter_deps="libflite"
  2041. frei0r_filter_deps="frei0r dlopen"
  2042. frei0r_filter_extralibs='$ldl'
  2043. frei0r_src_filter_deps="frei0r dlopen"
  2044. frei0r_src_filter_extralibs='$ldl'
  2045. geq_filter_deps="gpl"
  2046. histeq_filter_deps="gpl"
  2047. hqdn3d_filter_deps="gpl"
  2048. interlace_filter_deps="gpl"
  2049. kerndeint_filter_deps="gpl"
  2050. ladspa_filter_deps="ladspa dlopen"
  2051. mcdeint_filter_deps="avcodec gpl"
  2052. movie_filter_deps="avcodec avformat"
  2053. mp_filter_deps="gpl avcodec swscale inline_asm"
  2054. mpdecimate_filter_deps="gpl avcodec"
  2055. mptestsrc_filter_deps="gpl"
  2056. negate_filter_deps="lut_filter"
  2057. perspective_filter_deps="gpl"
  2058. resample_filter_deps="avresample"
  2059. ocv_filter_deps="libopencv"
  2060. owdenoise_filter_deps="gpl"
  2061. pan_filter_deps="swresample"
  2062. phase_filter_deps="gpl"
  2063. pp_filter_deps="gpl postproc"
  2064. pullup_filter_deps="gpl"
  2065. removelogo_filter_deps="avcodec avformat swscale"
  2066. sab_filter_deps="gpl swscale"
  2067. scale_filter_deps="swscale"
  2068. smartblur_filter_deps="gpl swscale"
  2069. showspectrum_filter_deps="avcodec"
  2070. showspectrum_filter_select="rdft"
  2071. spp_filter_deps="gpl avcodec"
  2072. spp_filter_select="fft"
  2073. stereo3d_filter_deps="gpl"
  2074. subtitles_filter_deps="avformat avcodec libass"
  2075. super2xsai_filter_deps="gpl"
  2076. tinterlace_filter_deps="gpl"
  2077. vidstabdetect_filter_deps="libvidstab"
  2078. vidstabtransform_filter_deps="libvidstab"
  2079. yadif_filter_deps="gpl"
  2080. pixfmts_super2xsai_test_deps="super2xsai_filter"
  2081. tinterlace_merge_test_deps="tinterlace_filter"
  2082. tinterlace_pad_test_deps="tinterlace_filter"
  2083. zmq_filter_deps="libzmq"
  2084. # libraries
  2085. avcodec_deps="avutil"
  2086. avdevice_deps="avutil avcodec avformat"
  2087. avfilter_deps="avutil"
  2088. avformat_deps="avutil avcodec"
  2089. avresample_deps="avutil"
  2090. postproc_deps="avutil gpl"
  2091. swscale_deps="avutil"
  2092. # programs
  2093. ffmpeg_deps="avcodec avfilter avformat swresample"
  2094. ffmpeg_select="aformat_filter anull_filter atrim_filter format_filter
  2095. null_filter
  2096. setpts_filter trim_filter"
  2097. ffplay_deps="avcodec avformat swscale swresample sdl"
  2098. ffplay_select="rdft crop_filter"
  2099. ffprobe_deps="avcodec avformat"
  2100. ffserver_deps="avformat fork sarestart"
  2101. ffserver_select="ffm_muxer rtp_protocol rtsp_demuxer"
  2102. ffserver_extralibs='$ldl'
  2103. # documentation
  2104. podpages_deps="perl"
  2105. manpages_deps="perl pod2man"
  2106. htmlpages_deps="texi2html"
  2107. txtpages_deps="makeinfo"
  2108. doc_deps_any="manpages htmlpages podpages txtpages"
  2109. # default parameters
  2110. logfile="config.log"
  2111. # installation paths
  2112. prefix_default="/usr/local"
  2113. bindir_default='${prefix}/bin'
  2114. datadir_default='${prefix}/share/ffmpeg'
  2115. docdir_default='${prefix}/share/doc/ffmpeg'
  2116. incdir_default='${prefix}/include'
  2117. libdir_default='${prefix}/lib'
  2118. mandir_default='${prefix}/share/man'
  2119. shlibdir_default="$libdir_default"
  2120. # toolchain
  2121. ar_default="ar"
  2122. cc_default="gcc"
  2123. cxx_default="g++"
  2124. host_cc_default="gcc"
  2125. cp_f="cp -f"
  2126. install="install"
  2127. ln_s="ln -s -f"
  2128. nm_default="nm -g"
  2129. objformat="elf"
  2130. pkg_config_default=pkg-config
  2131. ranlib="ranlib"
  2132. strip_default="strip"
  2133. yasmexe_default="yasm"
  2134. nogas=":"
  2135. # machine
  2136. arch_default=$(uname -m)
  2137. cpu="generic"
  2138. # OS
  2139. target_os_default=$(tolower $(uname -s))
  2140. host_os=$target_os_default
  2141. # configurable options
  2142. enable $PROGRAM_LIST
  2143. enable $DOCUMENT_LIST
  2144. enable $(filter_out avresample $LIBRARY_LIST)
  2145. enable stripping
  2146. enable asm
  2147. enable debug
  2148. enable doc
  2149. enable optimizations
  2150. enable runtime_cpudetect
  2151. enable safe_bitstream_reader
  2152. enable static
  2153. enable swscale_alpha
  2154. # Enable hwaccels by default.
  2155. enable dxva2 vaapi vdpau
  2156. # build settings
  2157. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  2158. LIBPREF="lib"
  2159. LIBSUF=".a"
  2160. FULLNAME='$(NAME)$(BUILDSUF)'
  2161. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  2162. SLIBPREF="lib"
  2163. SLIBSUF=".so"
  2164. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  2165. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  2166. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  2167. LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  2168. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
  2169. SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
  2170. asflags_filter=echo
  2171. cflags_filter=echo
  2172. ldflags_filter=echo
  2173. AS_C='-c'
  2174. AS_O='-o $@'
  2175. CC_C='-c'
  2176. CC_E='-E -o $@'
  2177. CC_O='-o $@'
  2178. CXX_C='-c'
  2179. CXX_O='-o $@'
  2180. LD_O='-o $@'
  2181. LD_LIB='-l%'
  2182. LD_PATH='-L'
  2183. HOSTCC_C='-c'
  2184. HOSTCC_O='-o $@'
  2185. HOSTLD_O='-o $@'
  2186. host_cflags='-O3 -g'
  2187. host_cppflags='-D_ISOC99_SOURCE -D_XOPEN_SOURCE=600'
  2188. host_libs='-lm'
  2189. host_cflags_filter=echo
  2190. host_ldflags_filter=echo
  2191. target_path='$(CURDIR)'
  2192. # since the object filename is not given with the -MM flag, the compiler
  2193. # is only able to print the basename, and we must add the path ourselves
  2194. DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," > $(@:.o=.d)'
  2195. DEPFLAGS='-MM'
  2196. # find source path
  2197. if test -f configure; then
  2198. source_path=.
  2199. else
  2200. source_path=$(cd $(dirname "$0"); pwd)
  2201. echo "$source_path" | grep -q '[[:blank:]]' &&
  2202. die "Out of tree builds are impossible with whitespace in source path."
  2203. test -e "$source_path/config.h" &&
  2204. die "Out of tree builds are impossible with config.h in source dir."
  2205. fi
  2206. for v in "$@"; do
  2207. r=${v#*=}
  2208. l=${v%"$r"}
  2209. r=$(sh_quote "$r")
  2210. FFMPEG_CONFIGURATION="${FFMPEG_CONFIGURATION# } ${l}${r}"
  2211. done
  2212. find_things(){
  2213. thing=$1
  2214. pattern=$2
  2215. file=$source_path/$3
  2216. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  2217. }
  2218. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  2219. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  2220. HWACCEL_LIST=$(find_things hwaccel HWACCEL libavcodec/allcodecs.c)
  2221. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  2222. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  2223. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  2224. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  2225. OUTDEV_LIST=$(find_things outdev OUTDEV libavdevice/alldevices.c)
  2226. INDEV_LIST=$(find_things indev _IN libavdevice/alldevices.c)
  2227. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  2228. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  2229. ALL_COMPONENTS="
  2230. $BSF_LIST
  2231. $DECODER_LIST
  2232. $DEMUXER_LIST
  2233. $ENCODER_LIST
  2234. $FILTER_LIST
  2235. $HWACCEL_LIST
  2236. $INDEV_LIST
  2237. $MUXER_LIST
  2238. $OUTDEV_LIST
  2239. $PARSER_LIST
  2240. $PROTOCOL_LIST
  2241. "
  2242. for n in $COMPONENT_LIST; do
  2243. v=$(toupper ${n%s})_LIST
  2244. eval enable \$$v
  2245. eval ${n}_if_any="\$$v"
  2246. done
  2247. enable $ARCH_EXT_LIST
  2248. die_unknown(){
  2249. echo "Unknown option \"$1\"."
  2250. echo "See $0 --help for available options."
  2251. exit 1
  2252. }
  2253. print_3_columns() {
  2254. cat | tr ' ' '\n' | sort | pr -r -3 -t
  2255. }
  2256. show_list() {
  2257. suffix=_$1
  2258. shift
  2259. echo $* | sed s/$suffix//g | print_3_columns
  2260. exit 0
  2261. }
  2262. rand_list(){
  2263. IFS=', '
  2264. set -- $*
  2265. unset IFS
  2266. for thing; do
  2267. comp=${thing%:*}
  2268. prob=${thing#$comp}
  2269. prob=${prob#:}
  2270. is_in ${comp} $COMPONENT_LIST && eval comp=\$$(toupper ${comp%s})_LIST
  2271. echo "prob ${prob:-0.5}"
  2272. printf '%s\n' $comp
  2273. done
  2274. }
  2275. do_random(){
  2276. action=$1
  2277. shift
  2278. random_seed=$(awk "BEGIN { srand($random_seed); print srand() }")
  2279. $action $(rand_list "$@" | awk "BEGIN { srand($random_seed) } \$1 == \"prob\" { prob = \$2; next } rand() < prob { print }")
  2280. }
  2281. for opt do
  2282. optval="${opt#*=}"
  2283. case "$opt" in
  2284. --extra-ldflags=*)
  2285. add_ldflags $optval
  2286. ;;
  2287. --extra-libs=*)
  2288. add_extralibs $optval
  2289. ;;
  2290. --disable-devices)
  2291. disable $INDEV_LIST $OUTDEV_LIST
  2292. ;;
  2293. --enable-debug=*)
  2294. debuglevel="$optval"
  2295. ;;
  2296. --disable-programs)
  2297. disable $PROGRAM_LIST
  2298. ;;
  2299. --disable-everything)
  2300. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2301. ;;
  2302. --disable-all)
  2303. map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
  2304. disable $LIBRARY_LIST $PROGRAM_LIST doc
  2305. ;;
  2306. --enable-random|--disable-random)
  2307. action=${opt%%-random}
  2308. do_random ${action#--} $COMPONENT_LIST
  2309. ;;
  2310. --enable-random=*|--disable-random=*)
  2311. action=${opt%%-random=*}
  2312. do_random ${action#--} $optval
  2313. ;;
  2314. --enable-*=*|--disable-*=*)
  2315. eval $(echo "${opt%%=*}" | sed 's/--/action=/;s/-/ thing=/')
  2316. is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
  2317. eval list=\$$(toupper $thing)_LIST
  2318. name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
  2319. list=$(filter "$name" $list)
  2320. [ "$list" = "" ] && warn "Option $opt did not match anything"
  2321. $action $list
  2322. ;;
  2323. --enable-?*|--disable-?*)
  2324. eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
  2325. if is_in $option $COMPONENT_LIST; then
  2326. test $action = disable && action=unset
  2327. eval $action \$$(toupper ${option%s})_LIST
  2328. elif is_in $option $CMDLINE_SELECT; then
  2329. $action $option
  2330. else
  2331. die_unknown $opt
  2332. fi
  2333. ;;
  2334. --list-*)
  2335. NAME="${opt#--list-}"
  2336. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  2337. NAME=${NAME%s}
  2338. eval show_list $NAME \$$(toupper $NAME)_LIST
  2339. ;;
  2340. --help|-h) show_help
  2341. ;;
  2342. --fatal-warnings) enable fatal_warnings
  2343. ;;
  2344. *)
  2345. optname="${opt%%=*}"
  2346. optname="${optname#--}"
  2347. optname=$(echo "$optname" | sed 's/-/_/g')
  2348. if is_in $optname $CMDLINE_SET; then
  2349. eval $optname='$optval'
  2350. elif is_in $optname $CMDLINE_APPEND; then
  2351. append $optname "$optval"
  2352. else
  2353. die_unknown $opt
  2354. fi
  2355. ;;
  2356. esac
  2357. done
  2358. disabled logging && logfile=/dev/null
  2359. echo "# $0 $FFMPEG_CONFIGURATION" > $logfile
  2360. set >> $logfile
  2361. test -n "$cross_prefix" && enable cross_compile
  2362. if enabled cross_compile; then
  2363. test -n "$arch" && test -n "$target_os" ||
  2364. die "Must specify target arch and OS when cross-compiling"
  2365. fi
  2366. ar_default="${cross_prefix}${ar_default}"
  2367. cc_default="${cross_prefix}${cc_default}"
  2368. cxx_default="${cross_prefix}${cxx_default}"
  2369. nm_default="${cross_prefix}${nm_default}"
  2370. pkg_config_default="${cross_prefix}${pkg_config_default}"
  2371. ranlib="${cross_prefix}${ranlib}"
  2372. strip_default="${cross_prefix}${strip_default}"
  2373. sysinclude_default="${sysroot}/usr/include"
  2374. test -n "$valgrind" && toolchain="valgrind-memcheck"
  2375. case "$toolchain" in
  2376. clang-asan)
  2377. cc_default="clang"
  2378. add_cflags -fsanitize=address
  2379. add_ldflags -fsanitize=address
  2380. ;;
  2381. clang-tsan)
  2382. cc_default="clang"
  2383. add_cflags -fsanitize=thread -pie
  2384. add_ldflags -fsanitize=thread -pie
  2385. ;;
  2386. gcc-asan)
  2387. cc_default="gcc"
  2388. add_cflags -fsanitize=address
  2389. add_ldflags -fsanitize=address
  2390. ;;
  2391. gcc-tsan)
  2392. cc_default="gcc"
  2393. add_cflags -fsanitize=thread -pie -fPIC
  2394. add_ldflags -fsanitize=thread -pie -fPIC
  2395. ;;
  2396. valgrind-massif)
  2397. target_exec_default=${valgrind:-"valgrind"}
  2398. 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"
  2399. ;;
  2400. valgrind-memcheck)
  2401. target_exec_default=${valgrind:-"valgrind"}
  2402. 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"
  2403. ;;
  2404. msvc)
  2405. cc_default="c99wrap cl"
  2406. ld_default="c99wrap link"
  2407. nm_default="dumpbin -symbols"
  2408. ar_default="lib"
  2409. target_os_default="win32"
  2410. ;;
  2411. icl)
  2412. cc_default="c99wrap -noconv icl"
  2413. ld_default="c99wrap xilink"
  2414. nm_default="dumpbin -symbols"
  2415. ar_default="xilib"
  2416. target_os_default="win32"
  2417. ;;
  2418. gcov)
  2419. add_cflags -fprofile-arcs -ftest-coverage
  2420. add_ldflags -fprofile-arcs -ftest-coverage
  2421. ;;
  2422. hardened)
  2423. add_cflags -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fno-strict-overflow -fstack-protector-all
  2424. add_ldflags -Wl,-z,relro -Wl,-z,now
  2425. ;;
  2426. ?*)
  2427. die "Unknown toolchain $toolchain"
  2428. ;;
  2429. esac
  2430. set_default arch cc cxx pkg_config strip sysinclude target_exec target_os yasmexe
  2431. enabled cross_compile || host_cc_default=$cc
  2432. set_default host_cc
  2433. if ! $pkg_config --version >/dev/null 2>&1; then
  2434. warn "$pkg_config not found, library detection may fail."
  2435. pkg_config=false
  2436. fi
  2437. exesuf() {
  2438. case $1 in
  2439. mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
  2440. esac
  2441. }
  2442. EXESUF=$(exesuf $target_os)
  2443. HOSTEXESUF=$(exesuf $host_os)
  2444. # set temporary file name
  2445. : ${TMPDIR:=$TEMPDIR}
  2446. : ${TMPDIR:=$TMP}
  2447. : ${TMPDIR:=/tmp}
  2448. if [ -n "$tempprefix" ] ; then
  2449. mktemp(){
  2450. echo $tempprefix.${HOSTNAME}.${UID}
  2451. }
  2452. elif ! check_cmd mktemp -u XXXXXX; then
  2453. # simple replacement for missing mktemp
  2454. # NOT SAFE FOR GENERAL USE
  2455. mktemp(){
  2456. echo "${2%%XXX*}.${HOSTNAME}.${UID}.$$"
  2457. }
  2458. fi
  2459. tmpfile(){
  2460. tmp=$(mktemp -u "${TMPDIR}/ffconf.XXXXXXXX")$2 &&
  2461. (set -C; exec > $tmp) 2>/dev/null ||
  2462. die "Unable to create temporary file in $TMPDIR."
  2463. append TMPFILES $tmp
  2464. eval $1=$tmp
  2465. }
  2466. trap 'rm -f -- $TMPFILES' EXIT
  2467. tmpfile TMPASM .asm
  2468. tmpfile TMPC .c
  2469. tmpfile TMPCPP .cpp
  2470. tmpfile TMPE $EXESUF
  2471. tmpfile TMPH .h
  2472. tmpfile TMPO .o
  2473. tmpfile TMPS .S
  2474. tmpfile TMPSH .sh
  2475. tmpfile TMPV .ver
  2476. unset -f mktemp
  2477. chmod +x $TMPE
  2478. # make sure we can execute files in $TMPDIR
  2479. cat > $TMPSH 2>> $logfile <<EOF
  2480. #! /bin/sh
  2481. EOF
  2482. chmod +x $TMPSH >> $logfile 2>&1
  2483. if ! $TMPSH >> $logfile 2>&1; then
  2484. cat <<EOF
  2485. Unable to create and execute files in $TMPDIR. Set the TMPDIR environment
  2486. variable to another directory and make sure that it is not mounted noexec.
  2487. EOF
  2488. die "Sanity test failed."
  2489. fi
  2490. ccc_flags(){
  2491. for flag; do
  2492. case $flag in
  2493. -std=c99) echo -c99 ;;
  2494. -mcpu=*) echo -arch ${flag#*=} ;;
  2495. -mieee) echo -ieee ;;
  2496. -O*|-fast) echo $flag ;;
  2497. -fno-math-errno) echo -assume nomath_errno ;;
  2498. -g) echo -g3 ;;
  2499. -Wall) echo -msg_enable level2 ;;
  2500. -Wno-pointer-sign) echo -msg_disable ptrmismatch1 ;;
  2501. -Wl,*) echo $flag ;;
  2502. -f*|-W*) ;;
  2503. *) echo $flag ;;
  2504. esac
  2505. done
  2506. }
  2507. cparser_flags(){
  2508. for flag; do
  2509. case $flag in
  2510. -Wno-switch) echo -Wno-switch-enum ;;
  2511. -Wno-format-zero-length) ;;
  2512. -Wdisabled-optimization) ;;
  2513. -Wno-pointer-sign) echo -Wno-other ;;
  2514. *) echo $flag ;;
  2515. esac
  2516. done
  2517. }
  2518. msvc_common_flags(){
  2519. for flag; do
  2520. case $flag in
  2521. # In addition to specifying certain flags under the compiler
  2522. # specific filters, they must be specified here as well or else the
  2523. # generic catch all at the bottom will print the original flag.
  2524. -Wall) ;;
  2525. -std=c99) ;;
  2526. # Common flags
  2527. -fomit-frame-pointer) ;;
  2528. -g) echo -Z7 ;;
  2529. -fno-math-errno) ;;
  2530. -fno-common) ;;
  2531. -fno-signed-zeros) ;;
  2532. -fPIC) ;;
  2533. -mthumb) ;;
  2534. -march=*) ;;
  2535. -lz) echo zlib.lib ;;
  2536. -lavifil32) echo vfw32.lib ;;
  2537. -lavicap32) echo vfw32.lib user32.lib ;;
  2538. -l*) echo ${flag#-l}.lib ;;
  2539. *) echo $flag ;;
  2540. esac
  2541. done
  2542. }
  2543. msvc_flags(){
  2544. msvc_common_flags "$@"
  2545. for flag; do
  2546. case $flag in
  2547. -Wall) echo -W4 -wd4244 -wd4127 -wd4018 -wd4389 \
  2548. -wd4146 -wd4057 -wd4204 -wd4706 -wd4305 \
  2549. -wd4152 -wd4324 -we4013 -wd4100 -wd4214 \
  2550. -wd4554 \
  2551. -wd4273 ;;
  2552. esac
  2553. done
  2554. }
  2555. icl_flags(){
  2556. msvc_common_flags "$@"
  2557. for flag; do
  2558. case $flag in
  2559. # Despite what Intel's documentation says -Wall, which is supported
  2560. # on Windows, does enable remarks so disable them here.
  2561. -Wall) echo $flag -Qdiag-disable:remark ;;
  2562. -std=c99) echo -Qstd=c99 ;;
  2563. esac
  2564. done
  2565. }
  2566. pgi_flags(){
  2567. for flag; do
  2568. case $flag in
  2569. -flto) echo -Mipa=fast,libopt,libinline,vestigial ;;
  2570. -fomit-frame-pointer) echo -Mnoframe ;;
  2571. -g) echo -gopt ;;
  2572. *) echo $flag ;;
  2573. esac
  2574. done
  2575. }
  2576. suncc_flags(){
  2577. for flag; do
  2578. case $flag in
  2579. -march=*|-mcpu=*)
  2580. case "${flag#*=}" in
  2581. native) echo -xtarget=native ;;
  2582. v9|niagara) echo -xarch=sparc ;;
  2583. ultrasparc) echo -xarch=sparcvis ;;
  2584. ultrasparc3|niagara2) echo -xarch=sparcvis2 ;;
  2585. i586|pentium) echo -xchip=pentium ;;
  2586. i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;;
  2587. pentium3*|c3-2) echo -xtarget=pentium3 ;;
  2588. pentium-m) echo -xarch=sse2 -xchip=pentium3 ;;
  2589. pentium4*) echo -xtarget=pentium4 ;;
  2590. prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;;
  2591. *-sse3) echo -xarch=sse3 ;;
  2592. core2) echo -xarch=ssse3 -xchip=core2 ;;
  2593. corei7) echo -xarch=sse4_2 -xchip=nehalem ;;
  2594. corei7-avx) echo -xarch=avx -xchip=sandybridge ;;
  2595. amdfam10|barcelona) echo -xtarget=barcelona ;;
  2596. bdver*) echo -xarch=avx ;;
  2597. athlon-4|athlon-[mx]p) echo -xarch=ssea ;;
  2598. k8|opteron|athlon64|athlon-fx)
  2599. echo -xarch=sse2a ;;
  2600. athlon*) echo -xarch=pentium_proa ;;
  2601. esac
  2602. ;;
  2603. -std=c99) echo -xc99 ;;
  2604. -fomit-frame-pointer) echo -xregs=frameptr ;;
  2605. -fPIC) echo -KPIC -xcode=pic32 ;;
  2606. -W*,*) echo $flag ;;
  2607. -f*-*|-W*|-mimpure-text) ;;
  2608. -shared) echo -G ;;
  2609. *) echo $flag ;;
  2610. esac
  2611. done
  2612. }
  2613. tms470_flags(){
  2614. for flag; do
  2615. case $flag in
  2616. -march=*|-mcpu=*)
  2617. case "${flag#*=}" in
  2618. armv7-a|cortex-a*) echo -mv=7a8 ;;
  2619. armv7-r|cortex-r*) echo -mv=7r4 ;;
  2620. armv7-m|cortex-m*) echo -mv=7m3 ;;
  2621. armv6*|arm11*) echo -mv=6 ;;
  2622. armv5*e|arm[79]*e*|arm9[24]6*|arm96*|arm102[26])
  2623. echo -mv=5e ;;
  2624. armv4*|arm7*|arm9[24]*) echo -mv=4 ;;
  2625. esac
  2626. ;;
  2627. -mfpu=neon) echo --float_support=vfpv3 --neon ;;
  2628. -mfpu=vfp) echo --float_support=vfpv2 ;;
  2629. -mfpu=vfpv3) echo --float_support=vfpv3 ;;
  2630. -mfpu=vfpv3-d16) echo --float_support=vfpv3d16 ;;
  2631. -msoft-float) echo --float_support=vfplib ;;
  2632. -O[0-3]|-mf=*) echo $flag ;;
  2633. -g) echo -g -mn ;;
  2634. -pds=*) echo $flag ;;
  2635. -D*|-I*) echo $flag ;;
  2636. --gcc|--abi=*) echo $flag ;;
  2637. -me) echo $flag ;;
  2638. esac
  2639. done
  2640. }
  2641. probe_cc(){
  2642. pfx=$1
  2643. _cc=$2
  2644. unset _type _ident _cc_c _cc_e _cc_o _flags _cflags
  2645. unset _ld_o _ldflags _ld_lib _ld_path
  2646. unset _depflags _DEPCMD _DEPFLAGS
  2647. _flags_filter=echo
  2648. if $_cc -v 2>&1 | grep -q '^gcc.*LLVM'; then
  2649. _type=llvm_gcc
  2650. gcc_extra_ver=$(expr "$($_cc --version | head -n1)" : '.*\((.*)\)')
  2651. _ident="llvm-gcc $($_cc -dumpversion) $gcc_extra_ver"
  2652. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2653. _cflags_speed='-O3'
  2654. _cflags_size='-Os'
  2655. elif $_cc -v 2>&1 | grep -qi ^gcc; then
  2656. _type=gcc
  2657. gcc_version=$($_cc --version | head -n1)
  2658. gcc_basever=$($_cc -dumpversion)
  2659. gcc_pkg_ver=$(expr "$gcc_version" : '[^ ]* \(([^)]*)\)')
  2660. gcc_ext_ver=$(expr "$gcc_version" : ".*$gcc_pkg_ver $gcc_basever \\(.*\\)")
  2661. _ident=$(cleanws "gcc $gcc_basever $gcc_pkg_ver $gcc_ext_ver")
  2662. if ! $_cc -dumpversion | grep -q '^2\.'; then
  2663. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2664. fi
  2665. _cflags_speed='-O3'
  2666. _cflags_size='-Os'
  2667. elif $_cc --version 2>/dev/null | grep -q ^icc; then
  2668. _type=icc
  2669. _ident=$($_cc --version | head -n1)
  2670. _depflags='-MMD'
  2671. _cflags_speed='-O3'
  2672. _cflags_size='-Os'
  2673. _cflags_noopt='-O1'
  2674. elif $_cc -v 2>&1 | grep -q xlc; then
  2675. _type=xlc
  2676. _ident=$($_cc -qversion 2>/dev/null | head -n1)
  2677. _cflags_speed='-O5'
  2678. _cflags_size='-O5 -qcompact'
  2679. elif $_cc -V 2>/dev/null | grep -q Compaq; then
  2680. _type=ccc
  2681. _ident=$($_cc -V | head -n1 | cut -d' ' -f1-3)
  2682. _DEPFLAGS='-M'
  2683. _cflags_speed='-fast'
  2684. _cflags_size='-O1'
  2685. _flags_filter=ccc_flags
  2686. elif $_cc --vsn 2>/dev/null | grep -q "ARM C/C++ Compiler"; then
  2687. test -d "$sysroot" || die "No valid sysroot specified."
  2688. _type=armcc
  2689. _ident=$($_cc --vsn | head -n1)
  2690. armcc_conf="$PWD/armcc.conf"
  2691. $_cc --arm_linux_configure \
  2692. --arm_linux_config_file="$armcc_conf" \
  2693. --configure_sysroot="$sysroot" \
  2694. --configure_cpp_headers="$sysinclude" >>$logfile 2>&1 ||
  2695. die "Error creating armcc configuration file."
  2696. $_cc --vsn | grep -q RVCT && armcc_opt=rvct || armcc_opt=armcc
  2697. _flags="--arm_linux_config_file=$armcc_conf --translate_gcc"
  2698. as_default="${cross_prefix}gcc"
  2699. _depflags='-MMD'
  2700. _cflags_speed='-O3'
  2701. _cflags_size='-Os'
  2702. elif $_cc -version 2>/dev/null | grep -Eq 'TMS470|TI ARM'; then
  2703. _type=tms470
  2704. _ident=$($_cc -version | head -n1 | tr -s ' ')
  2705. _flags='--gcc --abi=eabi -me'
  2706. _cc_e='-ppl -fe=$@'
  2707. _cc_o='-fe=$@'
  2708. _depflags='-ppa -ppd=$(@:.o=.d)'
  2709. _cflags_speed='-O3 -mf=5'
  2710. _cflags_size='-O3 -mf=2'
  2711. _flags_filter=tms470_flags
  2712. elif $_cc -v 2>&1 | grep -q clang; then
  2713. _type=clang
  2714. _ident=$($_cc --version | head -n1)
  2715. _depflags='-MMD'
  2716. _cflags_speed='-O3'
  2717. _cflags_size='-Os'
  2718. elif $_cc -V 2>&1 | grep -q Sun; then
  2719. _type=suncc
  2720. _ident=$($_cc -V 2>&1 | head -n1 | cut -d' ' -f 2-)
  2721. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)'
  2722. _DEPFLAGS='-xM1 -xc99'
  2723. _ldflags='-std=c99'
  2724. _cflags_speed='-O5'
  2725. _cflags_size='-O5 -xspace'
  2726. _flags_filter=suncc_flags
  2727. elif $_cc -v 2>&1 | grep -q 'PathScale\|Path64'; then
  2728. _type=pathscale
  2729. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2730. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2731. _cflags_speed='-O2'
  2732. _cflags_size='-Os'
  2733. _flags_filter='filter_out -Wdisabled-optimization'
  2734. elif $_cc -v 2>&1 | grep -q Open64; then
  2735. _type=open64
  2736. _ident=$($_cc -v 2>&1 | head -n1 | tr -d :)
  2737. _depflags='-MMD -MF $(@:.o=.d) -MT $@'
  2738. _cflags_speed='-O2'
  2739. _cflags_size='-Os'
  2740. _flags_filter='filter_out -Wdisabled-optimization|-Wtype-limits|-fno-signed-zeros'
  2741. elif $_cc -V 2>&1 | grep -q Portland; then
  2742. _type=pgi
  2743. _ident="PGI $($_cc -V 2>&1 | awk '/^pgcc/ { print $2; exit }')"
  2744. opt_common='-alias=ansi -Mdse -Mlre -Mpre'
  2745. _cflags_speed="-O3 -Mautoinline -Munroll=c:4 $opt_common"
  2746. _cflags_size="-O2 -Munroll=c:1 $opt_common"
  2747. _cflags_noopt="-O"
  2748. _flags_filter=pgi_flags
  2749. elif $_cc 2>&1 | grep -q Microsoft; then
  2750. _type=msvc
  2751. _ident=$($cc 2>&1 | head -n1)
  2752. _DEPCMD='$(DEP$(1)) $(DEP$(1)FLAGS) $($(1)DEP_FLAGS) $< 2>&1 | awk '\''/including/ { sub(/^.*file: */, ""); gsub(/\\/, "/"); if (!match($$0, / /)) print "$@:", $$0 }'\'' > $(@:.o=.d)'
  2753. _DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -showIncludes -Zs'
  2754. _cflags_speed="-O2"
  2755. _cflags_size="-O1"
  2756. # Nonstandard output options, to avoid msys path conversion issues.
  2757. # Relies on wrapper to remap it.
  2758. if $_cc 2>&1 | grep -q Linker; then
  2759. _ld_o='-out $@'
  2760. else
  2761. _ld_o='-Fe$@'
  2762. fi
  2763. _cc_o='-Fo $@'
  2764. _cc_e='-P -Fi $@'
  2765. _flags_filter=msvc_flags
  2766. _ld_lib='lib%.a'
  2767. _ld_path='-libpath:'
  2768. _flags='-nologo'
  2769. _cflags='-D_USE_MATH_DEFINES -D_CRT_SECURE_NO_WARNINGS -Dinline=__inline -FIstdlib.h -Dstrtoll=_strtoi64'
  2770. if [ $pfx = hostcc ]; then
  2771. append _cflags -Dsnprintf=_snprintf
  2772. fi
  2773. disable stripping
  2774. elif $_cc 2>&1 | grep -q Intel; then
  2775. _type=icl
  2776. _ident=$($cc 2>&1 | head -n1)
  2777. _depflags='-QMMD -QMF$(@:.o=.d) -QMT$@'
  2778. # Not only is O3 broken on 13.x+ but it is slower on all previous
  2779. # versions (tested) as well.
  2780. _cflags_speed="-O2"
  2781. _cflags_size="-O1 -Oi" # -O1 without -Oi miscompiles stuff
  2782. # Nonstandard output options, to avoid msys path conversion issues.
  2783. # Relies on wrapper to remap it.
  2784. if $_cc 2>&1 | grep -q Linker; then
  2785. _ld_o='-out $@'
  2786. else
  2787. _ld_o='-Fe$@'
  2788. fi
  2789. _cc_o='-Fo $@'
  2790. _cc_e='-P'
  2791. _flags_filter=icl_flags
  2792. _ld_lib='lib%.a'
  2793. _ld_path='-libpath:'
  2794. # -Qdiag-error to make icl error when seeing certain unknown arguments
  2795. _flags='-nologo -Qdiag-error:4044,10157'
  2796. # -Qvec- -Qsimd- to prevent miscompilation, -GS for consistency
  2797. # with MSVC which enables it by default.
  2798. _cflags='-D_USE_MATH_DEFINES -FIstdlib.h -Dstrtoll=_strtoi64 -Qms0 -Qvec- -Qsimd- -GS'
  2799. if [ $pfx = hostcc ]; then
  2800. append _cflags -Dsnprintf=_snprintf
  2801. fi
  2802. elif $_cc --version 2>/dev/null | grep -q ^cparser; then
  2803. _type=cparser
  2804. _ident=$($_cc --version | head -n1)
  2805. _depflags='-MMD'
  2806. _cflags_speed='-O4'
  2807. _cflags_size='-O2'
  2808. _flags_filter=cparser_flags
  2809. fi
  2810. eval ${pfx}_type=\$_type
  2811. eval ${pfx}_ident=\$_ident
  2812. }
  2813. set_ccvars(){
  2814. eval ${1}_C=\${_cc_c-\${${1}_C}}
  2815. eval ${1}_E=\${_cc_e-\${${1}_E}}
  2816. eval ${1}_O=\${_cc_o-\${${1}_O}}
  2817. if [ -n "$_depflags" ]; then
  2818. eval ${1}_DEPFLAGS=\$_depflags
  2819. else
  2820. eval ${1}DEP=\${_DEPCMD:-\$DEPCMD}
  2821. eval ${1}DEP_FLAGS=\${_DEPFLAGS:-\$DEPFLAGS}
  2822. eval DEP${1}FLAGS=\$_flags
  2823. fi
  2824. }
  2825. probe_cc cc "$cc"
  2826. cflags_filter=$_flags_filter
  2827. cflags_speed=$_cflags_speed
  2828. cflags_size=$_cflags_size
  2829. cflags_noopt=$_cflags_noopt
  2830. add_cflags $_flags $_cflags
  2831. cc_ldflags=$_ldflags
  2832. set_ccvars CC
  2833. probe_cc hostcc "$host_cc"
  2834. host_cflags_filter=$_flags_filter
  2835. add_host_cflags $_flags $_cflags
  2836. set_ccvars HOSTCC
  2837. test -n "$cc_type" && enable $cc_type ||
  2838. warn "Unknown C compiler $cc, unable to select optimal CFLAGS"
  2839. : ${as_default:=$cc}
  2840. : ${dep_cc_default:=$cc}
  2841. : ${ld_default:=$cc}
  2842. : ${host_ld_default:=$host_cc}
  2843. set_default ar as dep_cc ld host_ld
  2844. probe_cc as "$as"
  2845. asflags_filter=$_flags_filter
  2846. add_asflags $_flags $_cflags
  2847. set_ccvars AS
  2848. probe_cc ld "$ld"
  2849. ldflags_filter=$_flags_filter
  2850. add_ldflags $_flags $_ldflags
  2851. test "$cc_type" != "$ld_type" && add_ldflags $cc_ldflags
  2852. LD_O=${_ld_o-$LD_O}
  2853. LD_LIB=${_ld_lib-$LD_LIB}
  2854. LD_PATH=${_ld_path-$LD_PATH}
  2855. probe_cc hostld "$host_ld"
  2856. host_ldflags_filter=$_flags_filter
  2857. add_host_ldflags $_flags $_ldflags
  2858. HOSTLD_O=${_ld_o-$HOSTLD_O}
  2859. if [ -z "$CC_DEPFLAGS" ] && [ "$dep_cc" != "$cc" ]; then
  2860. probe_cc depcc "$dep_cc"
  2861. CCDEP=${_DEPCMD:-$DEPCMD}
  2862. CCDEP_FLAGS=${_DEPFLAGS:=$DEPFLAGS}
  2863. DEPCCFLAGS=$_flags
  2864. fi
  2865. if $ar 2>&1 | grep -q Microsoft; then
  2866. arflags="-nologo"
  2867. ar_o='-out:$@'
  2868. elif $ar 2>&1 | grep -q 'Texas Instruments'; then
  2869. arflags="rq"
  2870. ar_o='$@'
  2871. elif $ar 2>&1 | grep -q 'Usage: ar.*-X.*any'; then
  2872. arflags='-Xany -r -c'
  2873. ar_o='$@'
  2874. else
  2875. arflags="rc"
  2876. ar_o='$@'
  2877. fi
  2878. add_cflags $extra_cflags
  2879. add_cxxflags $extra_cxxflags
  2880. add_asflags $extra_cflags
  2881. if test -n "$sysroot"; then
  2882. case "$cc_type" in
  2883. gcc|llvm_gcc|clang)
  2884. add_cppflags --sysroot="$sysroot"
  2885. add_ldflags --sysroot="$sysroot"
  2886. ;;
  2887. tms470)
  2888. add_cppflags -I"$sysinclude"
  2889. add_ldflags --sysroot="$sysroot"
  2890. ;;
  2891. esac
  2892. fi
  2893. if test "$cpu" = host; then
  2894. enabled cross_compile &&
  2895. die "--cpu=host makes no sense when cross-compiling."
  2896. case "$cc_type" in
  2897. gcc|llvm_gcc)
  2898. check_native(){
  2899. $cc $1=native -v -c -o $TMPO $TMPC >$TMPE 2>&1 || return
  2900. sed -n "/cc1.*$1=/{
  2901. s/.*$1=\\([^ ]*\\).*/\\1/
  2902. p
  2903. q
  2904. }" $TMPE
  2905. }
  2906. cpu=$(check_native -march || check_native -mcpu)
  2907. ;;
  2908. esac
  2909. test "${cpu:-host}" = host &&
  2910. die "--cpu=host not supported with compiler $cc"
  2911. fi
  2912. # Deal with common $arch aliases
  2913. case "$arch" in
  2914. aarch64|arm64)
  2915. arch="aarch64"
  2916. ;;
  2917. arm*|iPad*|iPhone*)
  2918. arch="arm"
  2919. ;;
  2920. mips*|IP*)
  2921. arch="mips"
  2922. ;;
  2923. parisc*|hppa*)
  2924. arch="parisc"
  2925. ;;
  2926. "Power Macintosh"|ppc*|powerpc*)
  2927. arch="ppc"
  2928. ;;
  2929. s390|s390x)
  2930. arch="s390"
  2931. ;;
  2932. sh4|sh)
  2933. arch="sh4"
  2934. ;;
  2935. sun4u|sparc*)
  2936. arch="sparc"
  2937. ;;
  2938. tilegx|tile-gx)
  2939. arch="tilegx"
  2940. ;;
  2941. i[3-6]86|i86pc|BePC|x86pc|x86_64|x86_32|amd64)
  2942. arch="x86"
  2943. ;;
  2944. esac
  2945. is_in $arch $ARCH_LIST || warn "unknown architecture $arch"
  2946. enable $arch
  2947. # Add processor-specific flags
  2948. if enabled aarch64; then
  2949. case $cpu in
  2950. armv*)
  2951. cpuflags="-march=$cpu"
  2952. ;;
  2953. *)
  2954. cpuflags="-mcpu=$cpu"
  2955. ;;
  2956. esac
  2957. elif enabled alpha; then
  2958. cpuflags="-mcpu=$cpu"
  2959. elif enabled arm; then
  2960. check_arm_arch() {
  2961. check_cpp_condition stddef.h \
  2962. "defined __ARM_ARCH_${1}__ || defined __TARGET_ARCH_${2:-$1}" \
  2963. $cpuflags
  2964. }
  2965. probe_arm_arch() {
  2966. if check_arm_arch 4; then echo armv4;
  2967. elif check_arm_arch 4T; then echo armv4t;
  2968. elif check_arm_arch 5; then echo armv5;
  2969. elif check_arm_arch 5E; then echo armv5e;
  2970. elif check_arm_arch 5T; then echo armv5t;
  2971. elif check_arm_arch 5TE; then echo armv5te;
  2972. elif check_arm_arch 5TEJ; then echo armv5te;
  2973. elif check_arm_arch 6; then echo armv6;
  2974. elif check_arm_arch 6J; then echo armv6j;
  2975. elif check_arm_arch 6K; then echo armv6k;
  2976. elif check_arm_arch 6Z; then echo armv6z;
  2977. elif check_arm_arch 6ZK; then echo armv6zk;
  2978. elif check_arm_arch 6T2; then echo armv6t2;
  2979. elif check_arm_arch 7; then echo armv7;
  2980. elif check_arm_arch 7A 7_A; then echo armv7-a;
  2981. elif check_arm_arch 7R 7_R; then echo armv7-r;
  2982. elif check_arm_arch 7M 7_M; then echo armv7-m;
  2983. elif check_arm_arch 7EM 7E_M; then echo armv7-m;
  2984. elif check_arm_arch 8A 8_A; then echo armv8-a;
  2985. fi
  2986. }
  2987. [ "$cpu" = generic ] && cpu=$(probe_arm_arch)
  2988. case $cpu in
  2989. armv*)
  2990. cpuflags="-march=$cpu"
  2991. subarch=$(echo $cpu | sed 's/[^a-z0-9]//g')
  2992. ;;
  2993. *)
  2994. cpuflags="-mcpu=$cpu"
  2995. case $cpu in
  2996. cortex-a*) subarch=armv7a ;;
  2997. cortex-r*) subarch=armv7r ;;
  2998. cortex-m*) enable thumb; subarch=armv7m ;;
  2999. arm11*) subarch=armv6 ;;
  3000. arm[79]*e*|arm9[24]6*|arm96*|arm102[26]) subarch=armv5te ;;
  3001. armv4*|arm7*|arm9[24]*) subarch=armv4 ;;
  3002. *) subarch=$(probe_arm_arch) ;;
  3003. esac
  3004. ;;
  3005. esac
  3006. case "$subarch" in
  3007. armv5t*) enable fast_clz ;;
  3008. armv[6-8]*) enable fast_clz fast_unaligned ;;
  3009. esac
  3010. elif enabled avr32; then
  3011. case $cpu in
  3012. ap7[02]0[0-2])
  3013. subarch="avr32_ap"
  3014. cpuflags="-mpart=$cpu"
  3015. ;;
  3016. ap)
  3017. subarch="avr32_ap"
  3018. cpuflags="-march=$cpu"
  3019. ;;
  3020. uc3[ab]*)
  3021. subarch="avr32_uc"
  3022. cpuflags="-mcpu=$cpu"
  3023. ;;
  3024. uc)
  3025. subarch="avr32_uc"
  3026. cpuflags="-march=$cpu"
  3027. ;;
  3028. esac
  3029. elif enabled bfin; then
  3030. cpuflags="-mcpu=$cpu"
  3031. elif enabled mips; then
  3032. cpuflags="-march=$cpu"
  3033. case $cpu in
  3034. 24kc)
  3035. disable mipsfpu
  3036. disable mipsdspr1
  3037. disable mipsdspr2
  3038. ;;
  3039. 24kf*)
  3040. disable mipsdspr1
  3041. disable mipsdspr2
  3042. ;;
  3043. 24kec|34kc|1004kc)
  3044. disable mipsfpu
  3045. disable mipsdspr2
  3046. ;;
  3047. 24kef*|34kf*|1004kf*)
  3048. disable mipsdspr2
  3049. ;;
  3050. 74kc)
  3051. disable mipsfpu
  3052. ;;
  3053. esac
  3054. elif enabled ppc; then
  3055. case $(tolower $cpu) in
  3056. 601|ppc601|powerpc601)
  3057. cpuflags="-mcpu=601"
  3058. disable altivec
  3059. ;;
  3060. 603*|ppc603*|powerpc603*)
  3061. cpuflags="-mcpu=603"
  3062. disable altivec
  3063. ;;
  3064. 604*|ppc604*|powerpc604*)
  3065. cpuflags="-mcpu=604"
  3066. disable altivec
  3067. ;;
  3068. g3|75*|ppc75*|powerpc75*)
  3069. cpuflags="-mcpu=750"
  3070. disable altivec
  3071. ;;
  3072. g4|745*|ppc745*|powerpc745*)
  3073. cpuflags="-mcpu=7450"
  3074. ;;
  3075. 74*|ppc74*|powerpc74*)
  3076. cpuflags="-mcpu=7400"
  3077. ;;
  3078. g5|970|ppc970|powerpc970)
  3079. cpuflags="-mcpu=970"
  3080. ;;
  3081. power[3-7]*)
  3082. cpuflags="-mcpu=$cpu"
  3083. ;;
  3084. cell)
  3085. cpuflags="-mcpu=cell"
  3086. enable ldbrx
  3087. ;;
  3088. e500mc)
  3089. cpuflags="-mcpu=e500mc"
  3090. disable altivec
  3091. ;;
  3092. e500v2)
  3093. cpuflags="-mcpu=8548 -mhard-float -mfloat-gprs=double"
  3094. disable altivec
  3095. ;;
  3096. e500)
  3097. cpuflags="-mcpu=8540 -mhard-float"
  3098. disable altivec
  3099. ;;
  3100. esac
  3101. elif enabled sparc; then
  3102. case $cpu in
  3103. cypress|f93[04]|tsc701|sparcl*|supersparc|hypersparc|niagara|v[789])
  3104. cpuflags="-mcpu=$cpu"
  3105. disable vis
  3106. ;;
  3107. ultrasparc*|niagara[234])
  3108. cpuflags="-mcpu=$cpu"
  3109. ;;
  3110. esac
  3111. elif enabled x86; then
  3112. case $cpu in
  3113. i[345]86|pentium)
  3114. cpuflags="-march=$cpu"
  3115. disable mmx
  3116. ;;
  3117. # targets that do NOT support nopl and conditional mov (cmov)
  3118. pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  3119. cpuflags="-march=$cpu"
  3120. disable i686
  3121. ;;
  3122. # targets that do support nopl and conditional mov (cmov)
  3123. 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*)
  3124. cpuflags="-march=$cpu"
  3125. enable i686
  3126. enable fast_cmov
  3127. ;;
  3128. # targets that do support conditional mov but on which it's slow
  3129. pentium4|pentium4m|prescott|nocona)
  3130. cpuflags="-march=$cpu"
  3131. enable i686
  3132. disable fast_cmov
  3133. ;;
  3134. esac
  3135. fi
  3136. if [ "$cpu" != generic ]; then
  3137. add_cflags $cpuflags
  3138. add_asflags $cpuflags
  3139. fi
  3140. # compiler sanity check
  3141. check_exec <<EOF
  3142. int main(void){ return 0; }
  3143. EOF
  3144. if test "$?" != 0; then
  3145. echo "$cc is unable to create an executable file."
  3146. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  3147. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  3148. echo "Only do this if you know what cross compiling means."
  3149. fi
  3150. die "C compiler test failed."
  3151. fi
  3152. add_cppflags -D_ISOC99_SOURCE
  3153. add_cxxflags -D__STDC_CONSTANT_MACROS
  3154. check_cflags -std=c99
  3155. check_cc -D_FILE_OFFSET_BITS=64 <<EOF && add_cppflags -D_FILE_OFFSET_BITS=64
  3156. #include <stdlib.h>
  3157. EOF
  3158. check_cc -D_LARGEFILE_SOURCE <<EOF && add_cppflags -D_LARGEFILE_SOURCE
  3159. #include <stdlib.h>
  3160. EOF
  3161. check_host_cflags -std=c99
  3162. check_host_cflags -Wall
  3163. check_64bit(){
  3164. arch32=$1
  3165. arch64=$2
  3166. expr=$3
  3167. check_code cc "" "int test[2*($expr) - 1]" &&
  3168. subarch=$arch64 || subarch=$arch32
  3169. }
  3170. case "$arch" in
  3171. aarch64|alpha|ia64)
  3172. spic=$shared
  3173. ;;
  3174. mips)
  3175. check_64bit mips mips64 '_MIPS_SIM > 1'
  3176. spic=$shared
  3177. ;;
  3178. parisc)
  3179. check_64bit parisc parisc64 'sizeof(void *) > 4'
  3180. spic=$shared
  3181. ;;
  3182. ppc)
  3183. check_64bit ppc ppc64 'sizeof(void *) > 4'
  3184. spic=$shared
  3185. ;;
  3186. sparc)
  3187. check_64bit sparc sparc64 'sizeof(void *) > 4'
  3188. spic=$shared
  3189. ;;
  3190. x86)
  3191. check_64bit x86_32 x86_64 'sizeof(void *) > 4'
  3192. if test "$subarch" = "x86_64"; then
  3193. spic=$shared
  3194. fi
  3195. ;;
  3196. ppc)
  3197. check_cc <<EOF && subarch="ppc64"
  3198. int test[(int)sizeof(char*) - 7];
  3199. EOF
  3200. ;;
  3201. esac
  3202. enable $subarch
  3203. enabled spic && enable_weak pic
  3204. # OS specific
  3205. case $target_os in
  3206. aix)
  3207. SHFLAGS=-shared
  3208. add_cppflags '-I\$(SRC_PATH)/compat/aix'
  3209. enabled shared && add_ldflags -Wl,-brtl
  3210. ;;
  3211. haiku)
  3212. prefix_default="/boot/common"
  3213. network_extralibs="-lnetwork"
  3214. host_libs=
  3215. ;;
  3216. sunos)
  3217. SHFLAGS='-shared -Wl,-h,$$(@F)'
  3218. enabled x86 && SHFLAGS="-mimpure-text $SHFLAGS"
  3219. network_extralibs="-lsocket -lnsl"
  3220. add_cppflags -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
  3221. # When using suncc to build, the Solaris linker will mark
  3222. # an executable with each instruction set encountered by
  3223. # the Solaris assembler. As our libraries contain their own
  3224. # guards for processor-specific code, instead suppress
  3225. # generation of the HWCAPS ELF section on Solaris x86 only.
  3226. enabled_all suncc x86 &&
  3227. echo "hwcap_1 = OVERRIDE;" > mapfile &&
  3228. add_ldflags -Wl,-M,mapfile
  3229. nm_default='nm -P -g'
  3230. ;;
  3231. netbsd)
  3232. disable symver
  3233. oss_indev_extralibs="-lossaudio"
  3234. oss_outdev_extralibs="-lossaudio"
  3235. enabled gcc || check_ldflags -Wl,-zmuldefs
  3236. ;;
  3237. openbsd|bitrig)
  3238. disable symver
  3239. SHFLAGS='-shared'
  3240. SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)'
  3241. SLIB_INSTALL_LINKS=
  3242. oss_indev_extralibs="-lossaudio"
  3243. oss_outdev_extralibs="-lossaudio"
  3244. ;;
  3245. dragonfly)
  3246. disable symver
  3247. ;;
  3248. freebsd)
  3249. ;;
  3250. bsd/os)
  3251. add_extralibs -lpoll -lgnugetopt
  3252. strip="strip -d"
  3253. ;;
  3254. darwin)
  3255. gas="gas-preprocessor.pl $cc"
  3256. enabled ppc && add_asflags -force_cpusubtype_ALL
  3257. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR)'
  3258. enabled x86_32 && append SHFLAGS -Wl,-read_only_relocs,suppress
  3259. strip="${strip} -x"
  3260. add_ldflags -Wl,-dynamic,-search_paths_first
  3261. SLIBSUF=".dylib"
  3262. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  3263. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  3264. objformat="macho"
  3265. enabled x86_64 && objformat="macho64"
  3266. enabled_any pic shared ||
  3267. { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
  3268. ;;
  3269. mingw32*)
  3270. if test $target_os = "mingw32ce"; then
  3271. disable network
  3272. else
  3273. target_os=mingw32
  3274. fi
  3275. LIBTARGET=i386
  3276. if enabled x86_64; then
  3277. LIBTARGET="i386:x86-64"
  3278. elif enabled arm; then
  3279. LIBTARGET=arm-wince
  3280. fi
  3281. check_ldflags -Wl,--nxcompat
  3282. check_ldflags -Wl,--dynamicbase
  3283. shlibdir_default="$bindir_default"
  3284. SLIBPREF=""
  3285. SLIBSUF=".dll"
  3286. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3287. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3288. dlltool="${cross_prefix}dlltool"
  3289. if check_cmd lib.exe -list; then
  3290. SLIB_EXTRA_CMD=-'sed -e "s/ @[^ ]*//" $$(@:$(SLIBSUF)=.orig.def) > $$(@:$(SLIBSUF)=.def); lib.exe /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3291. if enabled x86_64; then
  3292. LIBTARGET=x64
  3293. fi
  3294. elif check_cmd $dlltool --version; then
  3295. 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)'
  3296. fi
  3297. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3298. SLIB_INSTALL_LINKS=
  3299. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3300. SLIB_INSTALL_EXTRA_LIB='lib$(SLIBNAME:$(SLIBSUF)=.dll.a) $(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3301. 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'
  3302. objformat="win32"
  3303. ranlib=:
  3304. enable dos_paths
  3305. ;;
  3306. win32|win64)
  3307. if enabled shared; then
  3308. # Link to the import library instead of the normal static library
  3309. # for shared libs.
  3310. LD_LIB='%.lib'
  3311. # Cannot build both shared and static libs with MSVC or icl.
  3312. disable static
  3313. fi
  3314. shlibdir_default="$bindir_default"
  3315. SLIBPREF=""
  3316. SLIBSUF=".dll"
  3317. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3318. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3319. SLIB_CREATE_DEF_CMD='makedef $(SUBDIR)lib$(NAME).ver $(OBJS) > $$(@:$(SLIBSUF)=.def)'
  3320. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3321. SLIB_INSTALL_LINKS=
  3322. SLIB_INSTALL_EXTRA_SHLIB='$(SLIBNAME:$(SLIBSUF)=.lib)'
  3323. SLIB_INSTALL_EXTRA_LIB='$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.def)'
  3324. SHFLAGS='-dll -def:$$(@:$(SLIBSUF)=.def) -implib:$(SUBDIR)$(SLIBNAME:$(SLIBSUF)=.lib)'
  3325. objformat="win32"
  3326. ranlib=:
  3327. enable dos_paths
  3328. ;;
  3329. cygwin*)
  3330. target_os=cygwin
  3331. shlibdir_default="$bindir_default"
  3332. SLIBPREF="cyg"
  3333. SLIBSUF=".dll"
  3334. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  3335. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  3336. SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
  3337. SLIB_INSTALL_LINKS=
  3338. SLIB_INSTALL_EXTRA_LIB='lib$(FULLNAME).dll.a'
  3339. SHFLAGS='-shared -Wl,--out-implib,$(SUBDIR)lib$(FULLNAME).dll.a'
  3340. objformat="win32"
  3341. enable dos_paths
  3342. ;;
  3343. *-dos|freedos|opendos)
  3344. network_extralibs="-lsocket"
  3345. objformat="coff"
  3346. enable dos_paths
  3347. add_cppflags -U__STRICT_ANSI__
  3348. ;;
  3349. linux)
  3350. enable dv1394
  3351. ;;
  3352. irix*)
  3353. target_os=irix
  3354. ranlib="echo ignoring ranlib"
  3355. ;;
  3356. os/2*)
  3357. strip="lxlite -CS"
  3358. ln_s="cp -f"
  3359. objformat="aout"
  3360. add_cppflags -D_GNU_SOURCE
  3361. add_ldflags -Zomf -Zbin-files -Zargs-wild -Zmap
  3362. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  3363. LIBSUF="_s.a"
  3364. SLIBPREF=""
  3365. SLIBSUF=".dll"
  3366. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  3367. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  3368. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  3369. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  3370. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  3371. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  3372. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  3373. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  3374. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  3375. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  3376. SLIB_INSTALL_EXTRA_LIB='$(LIBPREF)$(NAME)_dll.a $(LIBPREF)$(NAME)_dll.lib'
  3377. enable dos_paths
  3378. enable_weak os2threads
  3379. ;;
  3380. gnu/kfreebsd)
  3381. add_cppflags -D_BSD_SOURCE
  3382. ;;
  3383. gnu)
  3384. ;;
  3385. qnx)
  3386. add_cppflags -D_QNX_SOURCE
  3387. network_extralibs="-lsocket"
  3388. ;;
  3389. symbian)
  3390. SLIBSUF=".dll"
  3391. enable dos_paths
  3392. add_cflags --include=$sysinclude/gcce/gcce.h -fvisibility=default
  3393. add_cppflags -D__GCCE__ -D__SYMBIAN32__ -DSYMBIAN_OE_POSIX_SIGNALS
  3394. add_ldflags -Wl,--target1-abs,--no-undefined \
  3395. -Wl,-Ttext,0x80000,-Tdata,0x1000000 -shared \
  3396. -Wl,--entry=_E32Startup -Wl,-u,_E32Startup
  3397. add_extralibs -l:eexe.lib -l:usrt2_2.lib -l:dfpaeabi.dso \
  3398. -l:drtaeabi.dso -l:scppnwdl.dso -lsupc++ -lgcc \
  3399. -l:libc.dso -l:libm.dso -l:euser.dso -l:libcrt0.lib
  3400. ;;
  3401. osf1)
  3402. add_cppflags -D_OSF_SOURCE -D_POSIX_PII -D_REENTRANT
  3403. ;;
  3404. minix)
  3405. ;;
  3406. plan9)
  3407. add_cppflags -D_C99_SNPRINTF_EXTENSION \
  3408. -D_REENTRANT_SOURCE \
  3409. -D_RESEARCH_SOURCE \
  3410. -DFD_SETSIZE=96 \
  3411. -DHAVE_SOCK_OPTS
  3412. add_compat strtod.o strtod=avpriv_strtod
  3413. network_extralibs='-lbsd'
  3414. exeobjs=compat/plan9/main.o
  3415. disable ffserver
  3416. cp_f='cp'
  3417. ;;
  3418. none)
  3419. ;;
  3420. *)
  3421. die "Unknown OS '$target_os'."
  3422. ;;
  3423. esac
  3424. # determine libc flavour
  3425. # uclibc defines __GLIBC__, so it needs to be checked before glibc.
  3426. if check_cpp_condition features.h "defined __UCLIBC__"; then
  3427. libc_type=uclibc
  3428. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3429. elif check_cpp_condition features.h "defined __GLIBC__"; then
  3430. libc_type=glibc
  3431. add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600
  3432. # MinGW headers can be installed on Cygwin, so check for newlib first.
  3433. elif check_cpp_condition newlib.h "defined _NEWLIB_VERSION"; then
  3434. libc_type=newlib
  3435. add_cppflags -U__STRICT_ANSI__
  3436. elif check_header _mingw.h; then
  3437. libc_type=mingw
  3438. check_cpp_condition _mingw.h \
  3439. "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \
  3440. (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  3441. die "ERROR: MinGW runtime version must be >= 3.15."
  3442. add_cppflags -U__STRICT_ANSI__
  3443. if check_cpp_condition _mingw.h "defined(__MINGW64_VERSION_MAJOR) && \
  3444. __MINGW64_VERSION_MAJOR < 3"; then
  3445. add_compat msvcrt/snprintf.o
  3446. add_cflags "-include $source_path/compat/msvcrt/snprintf.h"
  3447. else
  3448. add_cppflags -D__USE_MINGW_ANSI_STDIO=1
  3449. fi
  3450. elif check_func_headers stdlib.h _get_doserrno; then
  3451. libc_type=msvcrt
  3452. add_compat strtod.o strtod=avpriv_strtod
  3453. add_compat msvcrt/snprintf.o snprintf=avpriv_snprintf \
  3454. _snprintf=avpriv_snprintf \
  3455. vsnprintf=avpriv_vsnprintf
  3456. # The MSVC 2010 headers (Win 7.0 SDK) set _WIN32_WINNT to
  3457. # 0x601 by default unless something else is set by the user.
  3458. # This can easily lead to us detecting functions only present
  3459. # in such new versions and producing binaries requiring windows 7.0.
  3460. # Therefore explicitly set the default to XP unless the user has
  3461. # set something else on the command line.
  3462. check_cpp_condition stdlib.h "defined(_WIN32_WINNT)" || add_cppflags -D_WIN32_WINNT=0x0502
  3463. elif check_cpp_condition stddef.h "defined __KLIBC__"; then
  3464. libc_type=klibc
  3465. elif check_cpp_condition sys/cdefs.h "defined __BIONIC__"; then
  3466. libc_type=bionic
  3467. add_compat strtod.o strtod=avpriv_strtod
  3468. fi
  3469. test -n "$libc_type" && enable $libc_type
  3470. # hacks for compiler/libc/os combinations
  3471. if enabled_all tms470 glibc; then
  3472. CPPFLAGS="-I${source_path}/compat/tms470 ${CPPFLAGS}"
  3473. add_cppflags -D__USER_LABEL_PREFIX__=
  3474. add_cppflags -D__builtin_memset=memset
  3475. add_cppflags -D__gnuc_va_list=va_list -D_VA_LIST_DEFINED
  3476. add_cflags -pds=48 # incompatible redefinition of macro
  3477. fi
  3478. if enabled_all ccc glibc; then
  3479. add_ldflags -Wl,-z,now # calls to libots crash without this
  3480. fi
  3481. esc(){
  3482. echo "$*" | sed 's/%/%25/g;s/:/%3a/g'
  3483. }
  3484. echo "config:$arch:$subarch:$cpu:$target_os:$(esc $cc_ident):$(esc $FFMPEG_CONFIGURATION)" >config.fate
  3485. check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable_weak pic
  3486. set_default $PATHS_LIST
  3487. set_default nm
  3488. # we need to build at least one lib type
  3489. if ! enabled_any static shared; then
  3490. cat <<EOF
  3491. At least one library type must be built.
  3492. Specify --enable-static to build the static libraries or --enable-shared to
  3493. build the shared libraries as well. To only build the shared libraries specify
  3494. --disable-static in addition to --enable-shared.
  3495. EOF
  3496. exit 1;
  3497. fi
  3498. # backward compatibility layer for incompatible_libav/fork_abi
  3499. enabled incompatible_fork_abi && enable incompatible_libav_abi
  3500. enabled incompatible_libav_abi && enable incompatible_fork_abi
  3501. die_license_disabled() {
  3502. enabled $1 || { enabled $2 && die "$2 is $1 and --enable-$1 is not specified."; }
  3503. }
  3504. die_license_disabled_gpl() {
  3505. enabled $1 || { enabled $2 && die "$2 is incompatible with the gpl and --enable-$1 is not specified."; }
  3506. }
  3507. die_license_disabled gpl frei0r
  3508. die_license_disabled gpl libcdio
  3509. die_license_disabled gpl libutvideo
  3510. die_license_disabled gpl libvidstab
  3511. die_license_disabled gpl libx264
  3512. die_license_disabled gpl libxavs
  3513. die_license_disabled gpl libxvid
  3514. die_license_disabled gpl libzvbi
  3515. die_license_disabled gpl x11grab
  3516. die_license_disabled nonfree libaacplus
  3517. die_license_disabled nonfree libfaac
  3518. enabled gpl && die_license_disabled_gpl nonfree libfdk_aac
  3519. enabled gpl && die_license_disabled_gpl nonfree openssl
  3520. die_license_disabled version3 libopencore_amrnb
  3521. die_license_disabled version3 libopencore_amrwb
  3522. die_license_disabled version3 libvo_aacenc
  3523. die_license_disabled version3 libvo_amrwbenc
  3524. enabled version3 && { enabled gpl && enable gplv3 || enable lgplv3; }
  3525. disabled optimizations || check_cflags -fomit-frame-pointer
  3526. enable_weak_pic() {
  3527. disabled pic && return
  3528. enable pic
  3529. add_cppflags -DPIC
  3530. case "$target_os" in
  3531. mingw*|cygwin*)
  3532. ;;
  3533. *)
  3534. add_cflags -fPIC
  3535. ;;
  3536. esac
  3537. add_asflags -fPIC
  3538. }
  3539. enabled pic && enable_weak_pic
  3540. check_cc <<EOF || die "Symbol mangling check failed."
  3541. int ff_extern;
  3542. EOF
  3543. sym=$($nm $TMPO | awk '/ff_extern/{ print substr($0, match($0, /[^ \t]*ff_extern/)) }')
  3544. extern_prefix=${sym%%ff_extern*}
  3545. check_cc <<EOF && enable_weak inline_asm
  3546. void foo(void) { __asm__ volatile ("" ::); }
  3547. EOF
  3548. _restrict=
  3549. for restrict_keyword in restrict __restrict__ __restrict; do
  3550. check_cc <<EOF && _restrict=$restrict_keyword && break
  3551. void foo(char * $restrict_keyword p);
  3552. EOF
  3553. done
  3554. check_cc <<EOF && enable pragma_deprecated
  3555. void foo(void) { _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") }
  3556. EOF
  3557. check_cc <<EOF && enable attribute_packed
  3558. struct { int x; } __attribute__((packed)) x;
  3559. EOF
  3560. check_cc <<EOF && enable attribute_may_alias
  3561. union { int x; } __attribute__((may_alias)) x;
  3562. EOF
  3563. check_cc <<EOF || die "endian test failed"
  3564. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  3565. EOF
  3566. od -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  3567. check_inline_asm inline_asm_labels '"1:\n"'
  3568. if enabled alpha; then
  3569. check_cflags -mieee
  3570. elif enabled arm; then
  3571. check_cpp_condition stddef.h "defined __thumb__" && check_cc <<EOF && enable_weak thumb
  3572. float func(float a, float b){ return a+b; }
  3573. EOF
  3574. enabled thumb && check_cflags -mthumb || check_cflags -marm
  3575. nogas=die
  3576. if check_cpp_condition stddef.h "defined __ARM_PCS_VFP"; then
  3577. enable vfp_args
  3578. elif ! check_cpp_condition stddef.h "defined __ARM_PCS || defined __SOFTFP__"; then
  3579. case "${cross_prefix:-$cc}" in
  3580. *hardfloat*) enable vfp_args; fpabi=vfp ;;
  3581. *) check_ld "cc" <<EOF && enable vfp_args && fpabi=vfp || fpabi=soft ;;
  3582. __asm__ (".eabi_attribute 28, 1");
  3583. int main(void) { return 0; }
  3584. EOF
  3585. esac
  3586. warn "Compiler does not indicate floating-point ABI, guessing $fpabi."
  3587. fi
  3588. enabled armv5te && check_insn armv5te 'qadd r0, r0, r0'
  3589. enabled armv6 && check_insn armv6 'sadd16 r0, r0, r0'
  3590. enabled armv6t2 && check_insn armv6t2 'movt r0, #0'
  3591. enabled neon && check_insn neon 'vadd.i16 q0, q0, q0'
  3592. enabled vfp && check_insn vfp 'fadds s0, s0, s0'
  3593. enabled vfpv3 && check_insn vfpv3 'vmov.f32 s0, #1.0'
  3594. [ $target_os = linux ] ||
  3595. map 'enabled_any ${v}_external ${v}_inline || disable $v' \
  3596. $ARCH_EXT_LIST_ARM
  3597. check_inline_asm asm_mod_q '"add r0, %Q0, %R0" :: "r"((long long)0)'
  3598. check_inline_asm asm_mod_y '"vmul.i32 d0, d0, %y0" :: "x"(0)'
  3599. [ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
  3600. elif enabled mips; then
  3601. check_inline_asm loongson '"dmult.g $1, $2, $3"'
  3602. enabled mips32r2 && add_cflags "-mips32r2" && add_asflags "-mips32r2" &&
  3603. check_inline_asm mips32r2 '"rotr $t0, $t1, 1"'
  3604. enabled mipsdspr1 && add_cflags "-mdsp" && add_asflags "-mdsp" &&
  3605. check_inline_asm mipsdspr1 '"addu.qb $t0, $t1, $t2"'
  3606. enabled mipsdspr2 && add_cflags "-mdspr2" && add_asflags "-mdspr2" &&
  3607. check_inline_asm mipsdspr2 '"absq_s.qb $t0, $t1"'
  3608. enabled mipsfpu && add_cflags "-mhard-float" && add_asflags "-mhard-float" &&
  3609. check_inline_asm mipsfpu '"madd.d $f0, $f2, $f4, $f6"'
  3610. elif enabled parisc; then
  3611. if enabled gcc; then
  3612. case $($cc -dumpversion) in
  3613. 4.[3-8].*) check_cflags -fno-optimize-sibling-calls ;;
  3614. esac
  3615. fi
  3616. elif enabled ppc; then
  3617. enable local_aligned_8 local_aligned_16
  3618. check_inline_asm dcbzl '"dcbzl 0, %0" :: "r"(0)'
  3619. check_inline_asm ibm_asm '"add 0, 0, 0"'
  3620. check_inline_asm ppc4xx '"maclhw r10, r11, r12"'
  3621. check_inline_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)'
  3622. # AltiVec flags: The FSF version of GCC differs from the Apple version
  3623. if enabled altivec; then
  3624. if ! enabled_any pic ppc64; then
  3625. nogas=warn
  3626. fi
  3627. check_cflags -maltivec -mabi=altivec &&
  3628. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  3629. check_cflags -faltivec
  3630. # check if our compiler supports Motorola AltiVec C API
  3631. check_cc <<EOF || disable altivec
  3632. $inc_altivec_h
  3633. int main(void) {
  3634. vector signed int v1 = (vector signed int) { 0 };
  3635. vector signed int v2 = (vector signed int) { 1 };
  3636. v1 = vec_add(v1, v2);
  3637. return 0;
  3638. }
  3639. EOF
  3640. enabled altivec || warn "Altivec disabled, possibly missing --cpu flag"
  3641. fi
  3642. elif enabled sparc; then
  3643. enabled vis && check_inline_asm vis '"pdist %f0, %f0, %f0"'
  3644. elif enabled x86; then
  3645. check_builtin rdtsc intrin.h "__rdtsc()"
  3646. check_builtin mm_empty mmintrin.h "_mm_empty()"
  3647. enable local_aligned_8 local_aligned_16
  3648. # check whether EBP is available on x86
  3649. # As 'i' is stored on the stack, this program will crash
  3650. # if the base pointer is used to access it because the
  3651. # base pointer is cleared in the inline assembly code.
  3652. check_exec_crash <<EOF && enable ebp_available
  3653. volatile int i=0;
  3654. __asm__ volatile ("xorl %%ebp, %%ebp" ::: "%ebp");
  3655. return i;
  3656. EOF
  3657. # check whether EBX is available on x86
  3658. check_inline_asm ebx_available '""::"b"(0)' &&
  3659. check_inline_asm ebx_available '"":::"%ebx"'
  3660. # check whether xmm clobbers are supported
  3661. check_inline_asm xmm_clobbers '"":::"%xmm0"'
  3662. # check whether binutils is new enough to compile SSSE3/MMXEXT
  3663. enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
  3664. enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
  3665. if ! disabled_any asm mmx yasm; then
  3666. if check_cmd $yasmexe --version; then
  3667. enabled x86_64 && yasm_extra="-m amd64"
  3668. yasm_debug="-g dwarf2"
  3669. elif check_cmd nasm -v; then
  3670. yasmexe=nasm
  3671. yasm_debug="-g -F dwarf"
  3672. enabled x86_64 && test "$objformat" = elf && objformat=elf64
  3673. fi
  3674. YASMFLAGS="-f $objformat $yasm_extra"
  3675. enabled pic && append YASMFLAGS "-DPIC"
  3676. test -n "$extern_prefix" && append YASMFLAGS "-DPREFIX"
  3677. case "$objformat" in
  3678. elf*) enabled debug && append YASMFLAGS $yasm_debug ;;
  3679. esac
  3680. check_yasm "movbe ecx, [5]" && enable yasm ||
  3681. die "yasm/nasm not found or too old. Use --disable-yasm for a crippled build."
  3682. check_yasm "vextractf128 xmm0, ymm0, 0" || disable avx_external avresample
  3683. check_yasm "vfmaddps ymm0, ymm1, ymm2, ymm3" || disable fma4_external
  3684. check_yasm "CPU amdnop" && enable cpunop
  3685. fi
  3686. case "$cpu" in
  3687. athlon*|opteron*|k8*|pentium|pentium-mmx|prescott|nocona|atom|geode)
  3688. disable fast_clz
  3689. ;;
  3690. esac
  3691. fi
  3692. if enabled asm; then
  3693. as=${gas:=$as}
  3694. check_as <<EOF && enable gnu_as || \
  3695. $nogas "GNU assembler not found, install gas-preprocessor"
  3696. .macro m n
  3697. \n: .int 0
  3698. .endm
  3699. m x
  3700. EOF
  3701. fi
  3702. check_ldflags -Wl,--as-needed
  3703. if check_func dlopen; then
  3704. ldl=
  3705. elif check_func dlopen -ldl; then
  3706. ldl=-ldl
  3707. fi
  3708. if ! disabled network; then
  3709. check_type "sys/types.h sys/socket.h" socklen_t
  3710. check_type netdb.h "struct addrinfo"
  3711. check_type netinet/in.h "struct group_source_req" -D_BSD_SOURCE
  3712. check_type netinet/in.h "struct ip_mreq_source" -D_BSD_SOURCE
  3713. check_type netinet/in.h "struct ipv6_mreq" -D_DARWIN_C_SOURCE
  3714. check_type netinet/in.h "struct sockaddr_in6"
  3715. check_type poll.h "struct pollfd"
  3716. check_type "sys/types.h sys/socket.h" "struct sockaddr_storage"
  3717. check_struct "sys/types.h sys/socket.h" "struct sockaddr" sa_len
  3718. check_type netinet/sctp.h "struct sctp_event_subscribe"
  3719. check_func getaddrinfo $network_extralibs
  3720. check_func getservbyport $network_extralibs
  3721. # Prefer arpa/inet.h over winsock2
  3722. if check_header arpa/inet.h ; then
  3723. check_func closesocket
  3724. elif check_header winsock2.h ; then
  3725. check_func_headers winsock2.h closesocket -lws2 &&
  3726. network_extralibs="-lws2" ||
  3727. { check_func_headers winsock2.h closesocket -lws2_32 &&
  3728. network_extralibs="-lws2_32"; }
  3729. check_func_headers ws2tcpip.h getaddrinfo $network_extralibs
  3730. check_type ws2tcpip.h socklen_t
  3731. check_type ws2tcpip.h "struct addrinfo"
  3732. check_type ws2tcpip.h "struct group_source_req"
  3733. check_type ws2tcpip.h "struct ip_mreq_source"
  3734. check_type ws2tcpip.h "struct ipv6_mreq"
  3735. check_type winsock2.h "struct pollfd"
  3736. check_type ws2tcpip.h "struct sockaddr_in6"
  3737. check_type ws2tcpip.h "struct sockaddr_storage"
  3738. check_struct winsock2.h "struct sockaddr" sa_len
  3739. else
  3740. disable network
  3741. fi
  3742. fi
  3743. # Solaris has nanosleep in -lrt, OpenSolaris no longer needs that
  3744. check_func nanosleep || { check_func nanosleep -lrt && add_extralibs -lrt; }
  3745. check_func access
  3746. check_func clock_gettime || { check_func clock_gettime -lrt && add_extralibs -lrt; }
  3747. check_func fcntl
  3748. check_func fork
  3749. check_func_headers stdlib.h getenv
  3750. check_func gethrtime
  3751. check_func getopt
  3752. check_func getrusage
  3753. check_struct "sys/time.h sys/resource.h" "struct rusage" ru_maxrss
  3754. check_func gettimeofday
  3755. check_func inet_aton $network_extralibs
  3756. check_func isatty
  3757. check_func localtime_r
  3758. check_func ${malloc_prefix}memalign && enable memalign
  3759. check_func mkstemp
  3760. check_func mmap
  3761. check_func mprotect
  3762. check_func ${malloc_prefix}posix_memalign && enable posix_memalign
  3763. check_func_headers malloc.h _aligned_malloc && enable aligned_malloc
  3764. check_func setrlimit
  3765. check_struct "sys/stat.h" "struct stat" st_mtim.tv_nsec -D_BSD_SOURCE
  3766. check_func strerror_r
  3767. check_func sched_getaffinity
  3768. check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)"
  3769. check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()"
  3770. check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)"
  3771. check_builtin MemoryBarrier windows.h "MemoryBarrier()"
  3772. check_builtin sarestart signal.h "SA_RESTART"
  3773. check_func sysconf
  3774. check_func sysctl
  3775. check_func usleep
  3776. check_func_headers conio.h kbhit
  3777. check_func_headers windows.h PeekNamedPipe
  3778. check_func_headers io.h setmode
  3779. check_func_headers lzo/lzo1x.h lzo1x_999_compress
  3780. check_lib2 "windows.h shellapi.h" CommandLineToArgvW -lshell32
  3781. check_lib2 "windows.h wincrypt.h" CryptGenRandom -ladvapi32
  3782. check_lib2 "windows.h psapi.h" GetProcessMemoryInfo -lpsapi
  3783. check_func_headers windows.h GetProcessAffinityMask
  3784. check_func_headers windows.h GetProcessTimes
  3785. check_func_headers windows.h GetSystemTimeAsFileTime
  3786. check_func_headers windows.h MapViewOfFile
  3787. check_func_headers windows.h SetConsoleTextAttribute
  3788. check_func_headers windows.h Sleep
  3789. check_func_headers windows.h VirtualAlloc
  3790. check_func_headers glob.h glob
  3791. check_func_headers "X11/Xlib.h X11/extensions/Xvlib.h" XvGetPortAttribute -lXv -lX11 -lXext
  3792. check_header cl/cl.h
  3793. check_header direct.h
  3794. check_header dlfcn.h
  3795. check_header dxva.h
  3796. check_header dxva2api.h -D_WIN32_WINNT=0x0600
  3797. check_header io.h
  3798. check_header libcrystalhd/libcrystalhd_if.h
  3799. check_header malloc.h
  3800. check_header poll.h
  3801. check_header sys/mman.h
  3802. check_header sys/param.h
  3803. check_header sys/resource.h
  3804. check_header sys/select.h
  3805. check_header sys/time.h
  3806. check_header sys/un.h
  3807. check_header termios.h
  3808. check_header unistd.h
  3809. check_header vdpau/vdpau.h
  3810. check_header vdpau/vdpau_x11.h
  3811. check_header VideoDecodeAcceleration/VDADecoder.h
  3812. check_header windows.h
  3813. check_header X11/extensions/XvMClib.h
  3814. check_header asm/types.h
  3815. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  3816. disabled bzlib || check_lib2 bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  3817. if ! disabled w32threads && ! enabled pthreads; then
  3818. check_func_headers "windows.h process.h" _beginthreadex && enable w32threads
  3819. fi
  3820. # check for some common methods of building with pthread support
  3821. # do this before the optional library checks as some of them require pthreads
  3822. if ! disabled pthreads && ! enabled w32threads && ! enabled os2threads; then
  3823. enable pthreads
  3824. if check_func pthread_create; then
  3825. :
  3826. elif check_func pthread_create -pthread; then
  3827. add_cflags -pthread
  3828. add_extralibs -pthread
  3829. elif check_func pthread_create -pthreads; then
  3830. add_cflags -pthreads
  3831. add_extralibs -pthreads
  3832. elif check_func pthread_create -lpthreadGC2; then
  3833. add_extralibs -lpthreadGC2
  3834. elif ! check_lib pthread.h pthread_create -lpthread; then
  3835. disable pthreads
  3836. fi
  3837. fi
  3838. for thread in $THREADS_LIST; do
  3839. if enabled $thread; then
  3840. test -n "$thread_type" &&
  3841. die "ERROR: Only one thread type must be selected." ||
  3842. thread_type="$thread"
  3843. fi
  3844. done
  3845. if enabled pthreads; then
  3846. check_func pthread_cancel
  3847. fi
  3848. enabled sync_val_compare_and_swap && enable atomics_gcc
  3849. enabled_all atomic_cas_ptr machine_rw_barrier && enable atomics_suncc
  3850. enabled MemoryBarrier && enable atomics_win32
  3851. check_lib math.h sin -lm && LIBM="-lm"
  3852. disabled crystalhd || check_lib libcrystalhd/libcrystalhd_if.h DtsCrystalHDVersion -lcrystalhd || disable crystalhd
  3853. atan2f_args=2
  3854. ldexpf_args=2
  3855. powf_args=2
  3856. for func in $MATH_FUNCS; do
  3857. eval check_mathfunc $func \${${func}_args:-1}
  3858. done
  3859. # these are off by default, so fail if requested and not available
  3860. enabled avisynth && { { check_lib2 "windows.h" LoadLibrary; } ||
  3861. { check_lib2 "dlfcn.h" dlopen -ldl; } ||
  3862. die "ERROR: LoadLibrary/dlopen not found for avisynth"; }
  3863. enabled fontconfig && require_pkg_config fontconfig "fontconfig/fontconfig.h" FcInit
  3864. enabled frei0r && { check_header frei0r.h || die "ERROR: frei0r.h header not found"; }
  3865. enabled gnutls && require_pkg_config gnutls gnutls/gnutls.h gnutls_global_init
  3866. enabled ladspa && { check_header ladspa.h || die "ERROR: ladspa.h header not found"; }
  3867. enabled libiec61883 && require libiec61883 libiec61883/iec61883.h iec61883_cmp_connect -lraw1394 -lavc1394 -lrom1394 -liec61883
  3868. enabled libaacplus && require "libaacplus >= 2.0.0" aacplus.h aacplusEncOpen -laacplus
  3869. enabled libass && require_pkg_config libass ass/ass.h ass_library_init
  3870. enabled libbluray && require libbluray libbluray/bluray.h bd_open -lbluray
  3871. enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
  3872. { check_lib celt/celt.h celt_decoder_create_custom -lcelt0 ||
  3873. die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
  3874. enabled libcaca && require_pkg_config caca caca.h caca_create_canvas
  3875. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  3876. enabled libfdk_aac && require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac
  3877. 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"
  3878. enabled libflite && require2 libflite "flite/flite.h" flite_init $flite_libs
  3879. enabled libfreetype && require_pkg_config freetype2 "ft2build.h freetype/freetype.h" FT_Init_FreeType
  3880. enabled libgme && require libgme gme/gme.h gme_new_emu -lgme -lstdc++
  3881. enabled libgsm && { for gsm_hdr in "gsm.h" "gsm/gsm.h"; do
  3882. check_lib "${gsm_hdr}" gsm_create -lgsm && break;
  3883. done || die "ERROR: libgsm not found"; }
  3884. enabled libilbc && require libilbc ilbc.h WebRtcIlbcfix_InitDecode -lilbc
  3885. enabled libmodplug && require libmodplug libmodplug/modplug.h ModPlug_Load -lmodplug
  3886. enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame
  3887. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  3888. enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec.h Decoder_Interface_init -lopencore-amrnb
  3889. enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
  3890. enabled libopencv && require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader
  3891. enabled libopenjpeg && { check_lib openjpeg-1.5/openjpeg.h opj_version -lopenjpeg ||
  3892. check_lib openjpeg.h opj_version -lopenjpeg ||
  3893. die "ERROR: libopenjpeg not found"; }
  3894. enabled libopus && require_pkg_config opus opus_multistream.h opus_multistream_decoder_create
  3895. enabled libpulse && require_pkg_config libpulse-simple pulse/simple.h pa_simple_new
  3896. enabled libquvi && require_pkg_config libquvi quvi/quvi.h quvi_init
  3897. enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h RTMP_Socket
  3898. enabled libschroedinger && require_pkg_config schroedinger-1.0 schroedinger/schro.h schro_init
  3899. enabled libshine && require_pkg_config shine shine/layer3.h shine_encode_buffer
  3900. enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr
  3901. enabled libssh && require_pkg_config libssh libssh/sftp.h sftp_init
  3902. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  3903. enabled libstagefright_h264 && require_cpp libstagefright_h264 "binder/ProcessState.h media/stagefright/MetaData.h
  3904. media/stagefright/MediaBufferGroup.h media/stagefright/MediaDebug.h media/stagefright/MediaDefs.h
  3905. media/stagefright/OMXClient.h media/stagefright/OMXCodec.h" android::OMXClient -lstagefright -lmedia -lutils -lbinder -lgnustl_static
  3906. enabled libtheora && require libtheora theora/theoraenc.h th_info_init -ltheoraenc -ltheoradec -logg
  3907. enabled libtwolame && require libtwolame twolame.h twolame_init -ltwolame &&
  3908. { check_lib twolame.h twolame_encode_buffer_float32_interleaved -ltwolame ||
  3909. die "ERROR: libtwolame must be installed and version must be >= 0.3.10"; }
  3910. enabled libutvideo && require_cpp utvideo "stdint.h stdlib.h utvideo/utvideo.h utvideo/Codec.h" 'CCodec*' -lutvideo -lstdc++
  3911. enabled libv4l2 && require_pkg_config libv4l2 libv4l2.h v4l2_ioctl
  3912. enabled libvidstab && require_pkg_config vidstab vid.stab/libvidstab.h vsMotionDetectInit
  3913. enabled libvo_aacenc && require libvo_aacenc vo-aacenc/voAAC.h voGetAACEncAPI -lvo-aacenc
  3914. enabled libvo_amrwbenc && require libvo_amrwbenc vo-amrwbenc/enc_if.h E_IF_init -lvo-amrwbenc
  3915. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  3916. enabled libvpx && {
  3917. enabled libvpx_vp8_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" vpx_codec_dec_init_ver -lvpx ||
  3918. die "ERROR: libvpx decoder version must be >=0.9.1"; }
  3919. 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 ||
  3920. die "ERROR: libvpx encoder version must be >=0.9.7"; }
  3921. enabled libvpx_vp9_decoder && { check_lib2 "vpx/vpx_decoder.h vpx/vp8dx.h" "vpx_codec_vp9_dx" -lvpx || disable libvpx_vp9_decoder; }
  3922. enabled libvpx_vp9_encoder && { check_lib2 "vpx/vpx_encoder.h vpx/vp8cx.h" "vpx_codec_vp9_cx" -lvpx || disable libvpx_vp9_encoder; } }
  3923. enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack
  3924. enabled libx264 && require libx264 x264.h x264_encoder_encode -lx264 &&
  3925. { check_cpp_condition x264.h "X264_BUILD >= 118" ||
  3926. die "ERROR: libx264 must be installed and version must be >= 0.118."; }
  3927. enabled libxavs && require libxavs xavs.h xavs_encoder_encode -lxavs
  3928. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  3929. enabled libzmq && require_pkg_config libzmq zmq.h zmq_ctx_new
  3930. enabled libzvbi && require libzvbi libzvbi.h vbi_decoder_new -lzvbi
  3931. enabled openal && { { for al_libs in "${OPENAL_LIBS}" "-lopenal" "-lOpenAL32"; do
  3932. check_lib 'AL/al.h' alGetError "${al_libs}" && break; done } ||
  3933. die "ERROR: openal not found"; } &&
  3934. { check_cpp_condition "AL/al.h" "defined(AL_VERSION_1_1)" ||
  3935. die "ERROR: openal must be installed and version must be 1.1 or compatible"; }
  3936. enabled opencl && { check_lib2 OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL ||
  3937. check_lib2 CL/cl.h clEnqueueNDRangeKernel -lOpenCL ||
  3938. die "ERROR: opencl not found"; } &&
  3939. { ! enabled_any w32threads os2threads ||
  3940. die "opencl currently needs --enable-pthreads or --disable-w32threads"; } &&
  3941. { check_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" ||
  3942. check_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" ||
  3943. die "ERROR: opencl must be installed and version must be 1.2 or compatible"; }
  3944. enabled openssl && { check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
  3945. check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
  3946. check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
  3947. die "ERROR: openssl not found"; }
  3948. if enabled gnutls; then
  3949. { check_lib nettle/bignum.h nettle_mpz_get_str_256 -lnettle -lhogweed -lgmp && enable nettle; } ||
  3950. { check_lib gcrypt.h gcry_mpi_new -lgcrypt && enable gcrypt; }
  3951. fi
  3952. # libdc1394 check
  3953. if enabled libdc1394; then
  3954. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  3955. enable libdc1394_2; } ||
  3956. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  3957. enable libdc1394_1; } ||
  3958. die "ERROR: No version of libdc1394 found "
  3959. fi
  3960. SDL_CONFIG="${cross_prefix}sdl-config"
  3961. if check_pkg_config sdl SDL_events.h SDL_PollEvent; then
  3962. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3963. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  3964. enable sdl
  3965. else
  3966. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  3967. sdl_cflags=$("${SDL_CONFIG}" --cflags)
  3968. sdl_libs=$("${SDL_CONFIG}" --libs)
  3969. check_func_headers SDL_version.h SDL_Linked_Version $sdl_cflags $sdl_libs &&
  3970. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags &&
  3971. check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags &&
  3972. enable sdl
  3973. fi
  3974. fi
  3975. enabled sdl && add_cflags $sdl_cflags && add_extralibs $sdl_libs
  3976. texi2html --help 2> /dev/null | grep -q 'init-file' && enable texi2html || disable texi2html
  3977. makeinfo --version > /dev/null 2>&1 && enable makeinfo || disable makeinfo
  3978. perl --version > /dev/null 2>&1 && enable perl || disable perl
  3979. pod2man --help > /dev/null 2>&1 && enable pod2man || disable pod2man
  3980. rsync --help 2> /dev/null | grep -q 'contimeout' && enable rsync_contimeout || disable rsync_contimeout
  3981. check_header linux/fb.h
  3982. check_header linux/videodev.h
  3983. check_header linux/videodev2.h
  3984. check_code cc linux/videodev2.h "struct v4l2_frmsizeenum vfse; vfse.discrete.width = 0;" && enable_safe struct_v4l2_frmivalenum_discrete
  3985. check_header sys/videoio.h
  3986. check_func_headers "windows.h vfw.h" capCreateCaptureWindow "$vfwcap_indev_extralibs"
  3987. # check that WM_CAP_DRIVER_CONNECT is defined to the proper value
  3988. # w32api 3.12 had it defined wrong
  3989. check_cpp_condition vfw.h "WM_CAP_DRIVER_CONNECT > WM_USER" && enable vfwcap_defines
  3990. check_type "dshow.h" IBaseFilter
  3991. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  3992. { check_header dev/bktr/ioctl_meteor.h &&
  3993. check_header dev/bktr/ioctl_bt848.h; } ||
  3994. { check_header machine/ioctl_meteor.h &&
  3995. check_header machine/ioctl_bt848.h; } ||
  3996. { check_header dev/video/meteor/ioctl_meteor.h &&
  3997. check_header dev/video/bktr/ioctl_bt848.h; } ||
  3998. check_header dev/ic/bt8xx.h
  3999. check_header sndio.h
  4000. if check_struct sys/soundcard.h audio_buf_info bytes; then
  4001. enable_safe sys/soundcard.h
  4002. else
  4003. check_cc -D__BSD_VISIBLE -D__XSI_VISIBLE <<EOF && add_cppflags -D__BSD_VISIBLE -D__XSI_VISIBLE && enable_safe sys/soundcard.h
  4004. #include <sys/soundcard.h>
  4005. audio_buf_info abc;
  4006. EOF
  4007. fi
  4008. check_header soundcard.h
  4009. enabled_any alsa_indev alsa_outdev &&
  4010. check_lib2 alsa/asoundlib.h snd_pcm_htimestamp -lasound
  4011. enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack && check_func sem_timedwait &&
  4012. check_func jack_port_get_latency_range -ljack
  4013. enabled_any sndio_indev sndio_outdev && check_lib2 sndio.h sio_open -lsndio
  4014. if enabled libcdio; then
  4015. check_lib2 "cdio/cdda.h cdio/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4016. check_lib2 "cdio/paranoia/cdda.h cdio/paranoia/paranoia.h" cdio_cddap_open -lcdio_paranoia -lcdio_cdda -lcdio ||
  4017. die "ERROR: libcdio-paranoia not found"
  4018. fi
  4019. enabled x11grab &&
  4020. require X11 X11/Xlib.h XOpenDisplay -lX11 &&
  4021. require Xext X11/extensions/XShm.h XShmCreateImage -lXext &&
  4022. require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes
  4023. enabled vaapi &&
  4024. check_lib va/va.h vaInitialize -lva ||
  4025. disable vaapi
  4026. enabled vdpau &&
  4027. check_cpp_condition vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" ||
  4028. disable vdpau
  4029. # Funny iconv installations are not unusual, so check it after all flags have been set
  4030. disabled iconv || check_func_headers iconv.h iconv || check_lib2 iconv.h iconv -liconv || disable iconv
  4031. enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel"
  4032. # add some useful compiler flags if supported
  4033. check_cflags -Wdeclaration-after-statement
  4034. check_cflags -Wall
  4035. check_cflags -Wdisabled-optimization
  4036. check_cflags -Wpointer-arith
  4037. check_cflags -Wredundant-decls
  4038. check_cflags -Wwrite-strings
  4039. check_cflags -Wtype-limits
  4040. check_cflags -Wundef
  4041. check_cflags -Wmissing-prototypes
  4042. check_cflags -Wno-pointer-to-int-cast
  4043. check_cflags -Wstrict-prototypes
  4044. enabled extra_warnings && check_cflags -Winline
  4045. check_disable_warning(){
  4046. warning_flag=-W${1#-Wno-}
  4047. test_cflags $warning_flag && add_cflags $1
  4048. }
  4049. check_disable_warning -Wno-parentheses
  4050. check_disable_warning -Wno-switch
  4051. check_disable_warning -Wno-format-zero-length
  4052. check_disable_warning -Wno-pointer-sign
  4053. enabled extra_warnings || check_disable_warning -Wno-maybe-uninitialized
  4054. # add some linker flags
  4055. check_ldflags -Wl,--warn-common
  4056. check_ldflags -Wl,-rpath-link=libpostproc:libswresample:libswscale:libavfilter:libavdevice:libavformat:libavcodec:libavutil:libavresample
  4057. test_ldflags -Wl,-Bsymbolic && append SHFLAGS -Wl,-Bsymbolic
  4058. enabled xmm_clobber_test &&
  4059. check_ldflags -Wl,--wrap,avcodec_open2 \
  4060. -Wl,--wrap,avcodec_decode_audio4 \
  4061. -Wl,--wrap,avcodec_decode_video2 \
  4062. -Wl,--wrap,avcodec_decode_subtitle2 \
  4063. -Wl,--wrap,avcodec_encode_audio2 \
  4064. -Wl,--wrap,avcodec_encode_video \
  4065. -Wl,--wrap,avcodec_encode_video2 \
  4066. -Wl,--wrap,avcodec_encode_subtitle \
  4067. -Wl,--wrap,sws_scale ||
  4068. disable xmm_clobber_test
  4069. echo "X{};" > $TMPV
  4070. if test_ldflags -Wl,--version-script,$TMPV; then
  4071. append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver'
  4072. check_cc <<EOF && enable symver_asm_label
  4073. void ff_foo(void) __asm__ ("av_foo@VERSION");
  4074. void ff_foo(void) { ${inline_asm+__asm__($quotes);} }
  4075. EOF
  4076. check_cc <<EOF && enable symver_gnu_asm
  4077. __asm__(".symver ff_foo,av_foo@VERSION");
  4078. void ff_foo(void) {}
  4079. EOF
  4080. fi
  4081. if [ -z "$optflags" ]; then
  4082. if enabled small; then
  4083. optflags=$cflags_size
  4084. elif enabled optimizations; then
  4085. optflags=$cflags_speed
  4086. else
  4087. optflags=$cflags_noopt
  4088. fi
  4089. fi
  4090. check_optflags(){
  4091. check_cflags "$@"
  4092. enabled lto && check_ldflags "$@"
  4093. }
  4094. if enabled lto; then
  4095. test "$cc_type" != "$ld_type" && die "LTO requires same compiler and linker"
  4096. check_cflags -flto
  4097. check_ldflags -flto $cpuflags
  4098. fi
  4099. check_optflags $optflags
  4100. check_optflags -fno-math-errno
  4101. check_optflags -fno-signed-zeros
  4102. enabled ftrapv && check_cflags -ftrapv
  4103. check_cc -mno-red-zone <<EOF && noredzone_flags="-mno-red-zone"
  4104. int x;
  4105. EOF
  4106. if enabled icc; then
  4107. # Just warnings, no remarks
  4108. check_cflags -w1
  4109. # -wd: Disable following warnings
  4110. # 144, 167, 556: -Wno-pointer-sign
  4111. # 188: enumerated type mixed with another type
  4112. # 1292: attribute "foo" ignored
  4113. # 1419: external declaration in primary source file
  4114. # 10006: ignoring unknown option -fno-signed-zeros
  4115. # 10148: ignoring unknown option -Wno-parentheses
  4116. # 10156: ignoring option '-W'; no argument required
  4117. check_cflags -wd144,167,188,556,1292,1419,10006,10148,10156
  4118. # 11030: Warning unknown option --as-needed
  4119. # 10156: ignoring option '-export'; no argument required
  4120. check_ldflags -wd10156,11030
  4121. # icc 11.0 and 11.1 work with ebp_available, but don't pass the test
  4122. enable ebp_available
  4123. if enabled x86_32; then
  4124. icc_version=$($cc -dumpversion)
  4125. test ${icc_version%%.*} -ge 11 &&
  4126. check_cflags -falign-stack=maintain-16-byte ||
  4127. disable aligned_stack
  4128. fi
  4129. elif enabled ccc; then
  4130. # disable some annoying warnings
  4131. add_cflags -msg_disable bitnotint
  4132. add_cflags -msg_disable mixfuncvoid
  4133. add_cflags -msg_disable nonstandcast
  4134. add_cflags -msg_disable unsupieee
  4135. elif enabled gcc; then
  4136. check_optflags -fno-tree-vectorize
  4137. check_cflags -Werror=implicit-function-declaration
  4138. check_cflags -Werror=missing-prototypes
  4139. check_cflags -Werror=return-type
  4140. check_cflags -Werror=vla
  4141. elif enabled llvm_gcc; then
  4142. check_cflags -mllvm -stack-alignment=16
  4143. elif enabled clang; then
  4144. check_cflags -mllvm -stack-alignment=16
  4145. check_cflags -Qunused-arguments
  4146. check_cflags -Werror=implicit-function-declaration
  4147. check_cflags -Werror=missing-prototypes
  4148. check_cflags -Werror=return-type
  4149. elif enabled cparser; then
  4150. add_cflags -Wno-missing-variable-declarations
  4151. add_cflags -Wno-empty-statement
  4152. elif enabled armcc; then
  4153. # 2523: use of inline assembler is deprecated
  4154. add_cflags -W${armcc_opt},--diag_suppress=2523
  4155. add_cflags -W${armcc_opt},--diag_suppress=1207
  4156. add_cflags -W${armcc_opt},--diag_suppress=1293 # assignment in condition
  4157. add_cflags -W${armcc_opt},--diag_suppress=3343 # hardfp compat
  4158. add_cflags -W${armcc_opt},--diag_suppress=167 # pointer sign
  4159. add_cflags -W${armcc_opt},--diag_suppress=513 # pointer sign
  4160. elif enabled tms470; then
  4161. add_cflags -pds=824 -pds=837
  4162. elif enabled pathscale; then
  4163. add_cflags -fstrict-overflow -OPT:wrap_around_unsafe_opt=OFF
  4164. elif enabled_any msvc icl; then
  4165. enabled x86_32 && disable aligned_stack
  4166. enabled_all x86_32 debug && add_cflags -Oy-
  4167. enabled debug && add_ldflags -debug
  4168. enable pragma_deprecated
  4169. if enabled icl; then
  4170. # -Qansi-alias is basically -fstrict-aliasing, but does not work
  4171. # (correctly) on icl 13.x.
  4172. check_cpp_condition "windows.h" "__ICL < 1300 || __ICL >= 1400" &&
  4173. add_cflags -Qansi-alias
  4174. # icl will pass the inline asm tests but inline asm is currently
  4175. # not supported (build will fail)
  4176. disabled inline_asm || warn "inline asm disabled due to issues with it in ICL"
  4177. disable inline_asm
  4178. fi
  4179. fi
  4180. case $target_os in
  4181. osf1)
  4182. enabled ccc && add_ldflags '-Wl,-expect_unresolved,*'
  4183. ;;
  4184. plan9)
  4185. add_cppflags -Dmain=plan9_main
  4186. ;;
  4187. esac
  4188. enable frame_thread_encoder
  4189. enabled_any $THREADS_LIST && enable threads
  4190. enabled_any $ATOMICS_LIST && enable atomics_native
  4191. 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"
  4192. enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; }
  4193. check_deps $CONFIG_LIST \
  4194. $CONFIG_EXTRA \
  4195. $HAVE_LIST \
  4196. $ALL_COMPONENTS \
  4197. if test $target_os = "haiku"; then
  4198. disable memalign
  4199. disable posix_memalign
  4200. fi
  4201. ! enabled_any memalign posix_memalign aligned_malloc &&
  4202. enabled_any $need_memalign && enable memalign_hack
  4203. # add_dep lib dep
  4204. # -> enable ${lib}_deps_${dep}
  4205. # -> add $dep to ${lib}_deps only once
  4206. add_dep() {
  4207. lib=$1
  4208. dep=$2
  4209. enabled "${lib}_deps_${dep}" && return 0
  4210. enable "${lib}_deps_${dep}"
  4211. prepend "${lib}_deps" $dep
  4212. }
  4213. # merge deps lib components
  4214. # merge all ${component}_deps into ${lib}_deps and ${lib}_deps_*
  4215. merge_deps() {
  4216. lib=$1
  4217. shift
  4218. for comp in $*; do
  4219. enabled $comp || continue
  4220. eval "dep=\"\$${comp}_deps\""
  4221. for d in $dep; do
  4222. add_dep $lib $d
  4223. done
  4224. done
  4225. }
  4226. merge_deps libavfilter $FILTER_LIST
  4227. echo "install prefix $prefix"
  4228. echo "source path $source_path"
  4229. echo "C compiler $cc"
  4230. echo "ARCH $arch ($cpu)"
  4231. if test "$build_suffix" != ""; then
  4232. echo "build suffix $build_suffix"
  4233. fi
  4234. if test "$progs_suffix" != ""; then
  4235. echo "progs suffix $progs_suffix"
  4236. fi
  4237. if test "$extra_version" != ""; then
  4238. echo "version string suffix $extra_version"
  4239. fi
  4240. echo "big-endian ${bigendian-no}"
  4241. echo "runtime cpu detection ${runtime_cpudetect-no}"
  4242. if enabled x86; then
  4243. echo "${yasmexe} ${yasm-no}"
  4244. echo "MMX enabled ${mmx-no}"
  4245. echo "MMXEXT enabled ${mmxext-no}"
  4246. echo "3DNow! enabled ${amd3dnow-no}"
  4247. echo "3DNow! extended enabled ${amd3dnowext-no}"
  4248. echo "SSE enabled ${sse-no}"
  4249. echo "SSSE3 enabled ${ssse3-no}"
  4250. echo "AVX enabled ${avx-no}"
  4251. echo "FMA4 enabled ${fma4-no}"
  4252. echo "i686 features enabled ${i686-no}"
  4253. echo "CMOV is fast ${fast_cmov-no}"
  4254. echo "EBX available ${ebx_available-no}"
  4255. echo "EBP available ${ebp_available-no}"
  4256. fi
  4257. if enabled arm; then
  4258. echo "ARMv5TE enabled ${armv5te-no}"
  4259. echo "ARMv6 enabled ${armv6-no}"
  4260. echo "ARMv6T2 enabled ${armv6t2-no}"
  4261. echo "VFP enabled ${vfp-no}"
  4262. echo "NEON enabled ${neon-no}"
  4263. echo "THUMB enabled ${thumb-no}"
  4264. fi
  4265. if enabled mips; then
  4266. echo "MIPS FPU enabled ${mipsfpu-no}"
  4267. echo "MIPS32R2 enabled ${mips32r2-no}"
  4268. echo "MIPS DSP R1 enabled ${mipsdspr1-no}"
  4269. echo "MIPS DSP R2 enabled ${mipsdspr2-no}"
  4270. fi
  4271. if enabled ppc; then
  4272. echo "AltiVec enabled ${altivec-no}"
  4273. echo "PPC 4xx optimizations ${ppc4xx-no}"
  4274. echo "dcbzl available ${dcbzl-no}"
  4275. fi
  4276. if enabled sparc; then
  4277. echo "VIS enabled ${vis-no}"
  4278. fi
  4279. echo "debug symbols ${debug-no}"
  4280. echo "strip symbols ${stripping-no}"
  4281. echo "optimize for size ${small-no}"
  4282. echo "optimizations ${optimizations-no}"
  4283. echo "static ${static-no}"
  4284. echo "shared ${shared-no}"
  4285. echo "postprocessing support ${postproc-no}"
  4286. echo "new filter support ${avfilter-no}"
  4287. echo "network support ${network-no}"
  4288. echo "threading support ${thread_type-no}"
  4289. echo "safe bitstream reader ${safe_bitstream_reader-no}"
  4290. echo "SDL support ${sdl-no}"
  4291. echo "opencl enabled ${opencl-no}"
  4292. echo "libzvbi enabled ${libzvbi-no}"
  4293. echo "texi2html enabled ${texi2html-no}"
  4294. echo "perl enabled ${perl-no}"
  4295. echo "pod2man enabled ${pod2man-no}"
  4296. echo "makeinfo enabled ${makeinfo-no}"
  4297. test -n "$random_seed" &&
  4298. echo "random seed ${random_seed}"
  4299. echo
  4300. echo "External libraries:"
  4301. print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns
  4302. echo
  4303. for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do
  4304. echo "Enabled ${type}s:"
  4305. eval list=\$$(toupper $type)_LIST
  4306. print_enabled '_*' $list | print_3_columns
  4307. echo
  4308. done
  4309. license="LGPL version 2.1 or later"
  4310. if enabled nonfree; then
  4311. license="nonfree and unredistributable"
  4312. elif enabled gplv3; then
  4313. license="GPL version 3 or later"
  4314. elif enabled lgplv3; then
  4315. license="LGPL version 3 or later"
  4316. elif enabled gpl; then
  4317. license="GPL version 2 or later"
  4318. fi
  4319. echo "License: $license"
  4320. echo "Creating config.mak, config.h, and doc/config.texi..."
  4321. test -e Makefile || $ln_s "$source_path/Makefile" .
  4322. enabled stripping || strip="echo skipping strip"
  4323. config_files="$TMPH config.mak doc/config.texi"
  4324. cat > config.mak <<EOF
  4325. # Automatically generated by configure - do not modify!
  4326. ifndef FFMPEG_CONFIG_MAK
  4327. FFMPEG_CONFIG_MAK=1
  4328. FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION
  4329. prefix=$prefix
  4330. LIBDIR=\$(DESTDIR)$libdir
  4331. SHLIBDIR=\$(DESTDIR)$shlibdir
  4332. INCDIR=\$(DESTDIR)$incdir
  4333. BINDIR=\$(DESTDIR)$bindir
  4334. DATADIR=\$(DESTDIR)$datadir
  4335. DOCDIR=\$(DESTDIR)$docdir
  4336. MANDIR=\$(DESTDIR)$mandir
  4337. SRC_PATH=$source_path
  4338. ifndef MAIN_MAKEFILE
  4339. SRC_PATH:=\$(SRC_PATH:.%=..%)
  4340. endif
  4341. CC_IDENT=$cc_ident
  4342. ARCH=$arch
  4343. CC=$cc
  4344. CXX=$cxx
  4345. AS=$as
  4346. LD=$ld
  4347. DEPCC=$dep_cc
  4348. DEPCCFLAGS=$DEPCCFLAGS \$(CPPFLAGS)
  4349. DEPAS=$as
  4350. DEPASFLAGS=$DEPASFLAGS \$(CPPFLAGS)
  4351. YASM=$yasmexe
  4352. DEPYASM=$yasmexe
  4353. AR=$ar
  4354. ARFLAGS=$arflags
  4355. AR_O=$ar_o
  4356. RANLIB=$ranlib
  4357. STRIP=$strip
  4358. CP=cp -p
  4359. LN_S=$ln_s
  4360. CPPFLAGS=$CPPFLAGS
  4361. CFLAGS=$CFLAGS
  4362. CXXFLAGS=$CXXFLAGS
  4363. ASFLAGS=$ASFLAGS
  4364. AS_C=$AS_C
  4365. AS_O=$AS_O
  4366. CC_C=$CC_C
  4367. CC_E=$CC_E
  4368. CC_O=$CC_O
  4369. CXX_C=$CXX_C
  4370. CXX_O=$CXX_O
  4371. LD_O=$LD_O
  4372. LD_LIB=$LD_LIB
  4373. LD_PATH=$LD_PATH
  4374. DLLTOOL=$dlltool
  4375. LDFLAGS=$LDFLAGS
  4376. SHFLAGS=$(echo $($ldflags_filter $SHFLAGS))
  4377. YASMFLAGS=$YASMFLAGS
  4378. BUILDSUF=$build_suffix
  4379. PROGSSUF=$progs_suffix
  4380. FULLNAME=$FULLNAME
  4381. LIBPREF=$LIBPREF
  4382. LIBSUF=$LIBSUF
  4383. LIBNAME=$LIBNAME
  4384. SLIBPREF=$SLIBPREF
  4385. SLIBSUF=$SLIBSUF
  4386. EXESUF=$EXESUF
  4387. EXTRA_VERSION=$extra_version
  4388. CCDEP=$CCDEP
  4389. CXXDEP=$CXXDEP
  4390. CCDEP_FLAGS=$CCDEP_FLAGS
  4391. ASDEP=$ASDEP
  4392. ASDEP_FLAGS=$ASDEP_FLAGS
  4393. CC_DEPFLAGS=$CC_DEPFLAGS
  4394. AS_DEPFLAGS=$AS_DEPFLAGS
  4395. HOSTCC=$host_cc
  4396. HOSTLD=$host_ld
  4397. HOSTCFLAGS=$host_cflags
  4398. HOSTCPPFLAGS=$host_cppflags
  4399. HOSTEXESUF=$HOSTEXESUF
  4400. HOSTLDFLAGS=$host_ldflags
  4401. HOSTLIBS=$host_libs
  4402. DEPHOSTCC=$host_cc
  4403. DEPHOSTCCFLAGS=$DEPHOSTCCFLAGS \$(HOSTCCFLAGS)
  4404. HOSTCCDEP=$HOSTCCDEP
  4405. HOSTCCDEP_FLAGS=$HOSTCCDEP_FLAGS
  4406. HOSTCC_DEPFLAGS=$HOSTCC_DEPFLAGS
  4407. HOSTCC_C=$HOSTCC_C
  4408. HOSTCC_O=$HOSTCC_O
  4409. HOSTLD_O=$HOSTLD_O
  4410. TARGET_EXEC=$target_exec $target_exec_args
  4411. TARGET_PATH=$target_path
  4412. TARGET_SAMPLES=${target_samples:-\$(SAMPLES)}
  4413. LIBS-ffplay=$sdl_libs
  4414. CFLAGS-ffplay=$sdl_cflags
  4415. ZLIB=$($ldflags_filter -lz)
  4416. LIB_INSTALL_EXTRA_CMD=$LIB_INSTALL_EXTRA_CMD
  4417. EXTRALIBS=$extralibs
  4418. COMPAT_OBJS=$compat_objs
  4419. EXEOBJS=$exeobjs
  4420. INSTALL=$install
  4421. LIBTARGET=${LIBTARGET}
  4422. SLIBNAME=${SLIBNAME}
  4423. SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}
  4424. SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}
  4425. SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}
  4426. SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}
  4427. SLIB_INSTALL_NAME=${SLIB_INSTALL_NAME}
  4428. SLIB_INSTALL_LINKS=${SLIB_INSTALL_LINKS}
  4429. SLIB_INSTALL_EXTRA_LIB=${SLIB_INSTALL_EXTRA_LIB}
  4430. SLIB_INSTALL_EXTRA_SHLIB=${SLIB_INSTALL_EXTRA_SHLIB}
  4431. SAMPLES:=${samples:-\$(FATE_SAMPLES)}
  4432. NOREDZONE_FLAGS=$noredzone_flags
  4433. EOF
  4434. get_version(){
  4435. lcname=lib${1}
  4436. name=$(toupper $lcname)
  4437. file=$source_path/$lcname/version.h
  4438. eval $(awk "/#define ${name}_VERSION_M/ { print \$2 \"=\" \$3 }" "$file")
  4439. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  4440. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  4441. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  4442. eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak
  4443. }
  4444. map 'get_version $v' $LIBRARY_LIST
  4445. cat > $TMPH <<EOF
  4446. /* Automatically generated by configure - do not modify! */
  4447. #ifndef FFMPEG_CONFIG_H
  4448. #define FFMPEG_CONFIG_H
  4449. #define FFMPEG_CONFIGURATION "$(c_escape $FFMPEG_CONFIGURATION)"
  4450. #define FFMPEG_LICENSE "$(c_escape $license)"
  4451. #define FFMPEG_DATADIR "$(eval c_escape $datadir)"
  4452. #define AVCONV_DATADIR "$(eval c_escape $datadir)"
  4453. #define CC_IDENT "$(c_escape ${cc_ident:-Unknown compiler})"
  4454. #define av_restrict $_restrict
  4455. #define EXTERN_PREFIX "${extern_prefix}"
  4456. #define EXTERN_ASM ${extern_prefix}
  4457. #define SLIBSUF "$SLIBSUF"
  4458. #define HAVE_MMX2 HAVE_MMXEXT
  4459. EOF
  4460. test -n "$assert_level" &&
  4461. echo "#define ASSERT_LEVEL $assert_level" >>$TMPH
  4462. test -n "$malloc_prefix" &&
  4463. echo "#define MALLOC_PREFIX $malloc_prefix" >>$TMPH
  4464. if enabled yasm; then
  4465. append config_files $TMPASM
  4466. printf '' >$TMPASM
  4467. fi
  4468. enabled getenv || echo "#define getenv(x) NULL" >> $TMPH
  4469. mkdir -p doc
  4470. echo "@c auto-generated by configure" > doc/config.texi
  4471. print_config ARCH_ "$config_files" $ARCH_LIST
  4472. print_config HAVE_ "$config_files" $HAVE_LIST
  4473. print_config CONFIG_ "$config_files" $CONFIG_LIST \
  4474. $CONFIG_EXTRA \
  4475. $ALL_COMPONENTS \
  4476. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  4477. echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
  4478. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  4479. cp_if_changed $TMPH config.h
  4480. touch .config
  4481. enabled yasm && cp_if_changed $TMPASM config.asm
  4482. cat > $TMPH <<EOF
  4483. /* Generated by ffconf */
  4484. #ifndef AVUTIL_AVCONFIG_H
  4485. #define AVUTIL_AVCONFIG_H
  4486. EOF
  4487. print_config AV_HAVE_ $TMPH $HAVE_LIST_PUB
  4488. echo "#endif /* AVUTIL_AVCONFIG_H */" >> $TMPH
  4489. cp_if_changed $TMPH libavutil/avconfig.h
  4490. if test -n "$WARNINGS"; then
  4491. printf "\n$WARNINGS"
  4492. enabled fatal_warnings && exit 1
  4493. fi
  4494. # build pkg-config files
  4495. pkgconfig_generate(){
  4496. name=$1
  4497. shortname=${name#lib}${build_suffix}
  4498. comment=$2
  4499. version=$3
  4500. libs=$4
  4501. requires=$5
  4502. enabled ${name#lib} || return 0
  4503. mkdir -p $name
  4504. cat <<EOF > $name/$name${build_suffix}.pc
  4505. prefix=$prefix
  4506. exec_prefix=\${prefix}
  4507. libdir=$libdir
  4508. includedir=$incdir
  4509. Name: $name
  4510. Description: $comment
  4511. Version: $version
  4512. Requires: $(enabled shared || echo $requires)
  4513. Requires.private: $(enabled shared && echo $requires)
  4514. Conflicts:
  4515. Libs: -L\${libdir} -l${shortname} $(enabled shared || echo $libs)
  4516. Libs.private: $(enabled shared && echo $libs)
  4517. Cflags: -I\${includedir}
  4518. EOF
  4519. mkdir -p doc/examples/pc-uninstalled
  4520. includedir=${source_path}
  4521. [ "$includedir" = . ] && includedir="\${pcfiledir}/../../.."
  4522. cat <<EOF > doc/examples/pc-uninstalled/$name.pc
  4523. prefix=
  4524. exec_prefix=
  4525. libdir=\${pcfiledir}/../../../$name
  4526. includedir=${includedir}
  4527. Name: $name
  4528. Description: $comment
  4529. Version: $version
  4530. Requires: $requires
  4531. Conflicts:
  4532. Libs: -L\${libdir} -Wl,-rpath,\${libdir} -l${shortname} $(enabled shared || echo $libs)
  4533. Cflags: -I\${includedir}
  4534. EOF
  4535. }
  4536. lavfi_libs="libavutil${build_suffix} = $LIBAVUTIL_VERSION"
  4537. enabled libavfilter_deps_avcodec && prepend lavfi_libs "libavcodec${build_suffix} = $LIBAVCODEC_VERSION,"
  4538. enabled libavfilter_deps_avformat && prepend lavfi_libs "libavformat${build_suffix} = $LIBAVFORMAT_VERSION,"
  4539. enabled libavfilter_deps_avresample && prepend lavfi_libs "libavresample${build_suffix} = $LIBAVRESAMPLE_VERSION,"
  4540. enabled libavfilter_deps_swscale && prepend lavfi_libs "libswscale${build_suffix} = $LIBSWSCALE_VERSION,"
  4541. enabled libavfilter_deps_swresample && prepend lavfi_libs "libswresample${build_suffix} = $LIBSWRESAMPLE_VERSION,"
  4542. enabled libavfilter_deps_postproc && prepend lavfi_libs "libpostproc${build_suffix} = $LIBPOSTPROC_VERSION,"
  4543. lavfi_libs=${lavfi_libs%, }
  4544. lavd_libs="libavformat${build_suffix} = $LIBAVFORMAT_VERSION"
  4545. enabled lavfi_indev && prepend lavd_libs "libavfilter${build_suffix} = $LIBAVFILTER_VERSION,"
  4546. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
  4547. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
  4548. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec${build_suffix} = $LIBAVCODEC_VERSION"
  4549. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$lavd_libs"
  4550. pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$lavfi_libs"
  4551. pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
  4552. pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
  4553. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
  4554. pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
  4555. fix_ffmpeg_remote(){
  4556. git_remote_from=$1
  4557. git_remote_to=$2
  4558. fixme_remote=$(git --git-dir=$source_path/.git --work-tree=$source_path remote -v | grep $git_remote_from | cut -f 1 | sort | uniq)
  4559. if [ "$fixme_remote" != "" ]; then
  4560. echolog "
  4561. Outdated domain in git config, the official domain for ffmpeg git is since
  4562. November 2011, source.ffmpeg.org, both the old and the new point to the same
  4563. repository and server. To update it enter the following commands:
  4564. "
  4565. for remote in $fixme_remote; do
  4566. echolog "git remote set-url $remote $git_remote_to"
  4567. done
  4568. fi
  4569. }
  4570. if test -f "$source_path/.git/config"; then
  4571. remote_from=git.videolan.org
  4572. remote_to=source.ffmpeg.org
  4573. fix_ffmpeg_remote git@$remote_from:ffmpeg git@$remote_to:ffmpeg
  4574. fix_ffmpeg_remote git://$remote_from/ffmpeg git://$remote_to/ffmpeg
  4575. fi