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.

5063 lines
156KB

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