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.

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