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.

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