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.

4119 lines
120KB

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