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.

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