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.

4618 lines
139KB

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