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.

5051 lines
155KB

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