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.

5061 lines
156KB

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