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.

2400 lines
69KB

  1. #!/bin/sh
  2. #
  3. # FFmpeg configure script
  4. #
  5. # Copyright (c) 2000-2002 Fabrice Bellard
  6. # Copyright (c) 2005-2008 Diego Biurrun
  7. # Copyright (c) 2005-2008 Mans Rullgard
  8. #
  9. # Prevent locale nonsense from breaking basic text processing.
  10. LC_ALL=C
  11. export LC_ALL
  12. # make sure we are running under a compatible shell
  13. # try to make this part work with most shells
  14. try_exec(){
  15. echo "Trying shell $1"
  16. type "$1" > /dev/null 2>&1 && exec "$@"
  17. }
  18. unset foo
  19. (: ${foo%%bar}) 2> /dev/null
  20. E1="$?"
  21. (: ${foo?}) 2> /dev/null
  22. E2="$?"
  23. if test "$E1" != 0 || test "$E2" = 0; then
  24. echo "Broken shell detected. Trying alternatives."
  25. export FF_CONF_EXEC
  26. if test "0$FF_CONF_EXEC" -lt 1; then
  27. FF_CONF_EXEC=1
  28. try_exec bash "$0" "$@"
  29. fi
  30. if test "0$FF_CONF_EXEC" -lt 2; then
  31. FF_CONF_EXEC=2
  32. try_exec ksh "$0" "$@"
  33. fi
  34. if test "0$FF_CONF_EXEC" -lt 3; then
  35. FF_CONF_EXEC=3
  36. try_exec /usr/xpg4/bin/sh "$0" "$@"
  37. fi
  38. echo "No compatible shell script interpreter found."
  39. echo "This configure script requires a POSIX-compatible shell"
  40. echo "such as bash or ksh."
  41. echo "THIS IS NOT A BUG IN FFMPEG, DO NOT REPORT IT AS SUCH."
  42. echo "Instead, install a working POSIX-compatible shell."
  43. echo "Disabling this configure test will create a broken FFmpeg."
  44. if test "$BASH_VERSION" = '2.04.0(1)-release'; then
  45. echo "This bash version ($BASH_VERSION) is broken on your platform."
  46. echo "Upgrade to a later version if available."
  47. fi
  48. exit 1
  49. fi
  50. show_help(){
  51. echo "Usage: configure [options]"
  52. echo "Options: [defaults in brackets after descriptions]"
  53. echo
  54. echo "Standard options:"
  55. echo " --help print this message"
  56. echo " --logfile=FILE log tests and output to FILE [config.err]"
  57. echo " --disable-logging do not log configure debug information"
  58. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  59. echo " --bindir=DIR install binaries in DIR [PREFIX/bin]"
  60. echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
  61. echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]"
  62. echo " --incdir=DIR install includes in DIR [PREFIX/include]"
  63. echo " --mandir=DIR install man page in DIR [PREFIX/share/man]"
  64. echo " --enable-static build static libraries [yes]"
  65. echo " --disable-static do not build static libraries [no]"
  66. echo " --enable-shared build shared libraries [no]"
  67. echo " --disable-shared do not build shared libraries [yes]"
  68. echo " --enable-gpl allow use of GPL code, the resulting libs"
  69. echo " and binaries will be under GPL [no]"
  70. echo " --enable-nonfree allow use of nonfree code, the resulting libs"
  71. echo " and binaries will be unredistributable [no]"
  72. echo " --enable-postproc enable GPLed postprocessing support [no]"
  73. echo " --enable-swscale enable GPLed software scaler support [no]"
  74. echo " --enable-avfilter video filter support (replaces vhook) [no]"
  75. echo " --enable-avfilter-lavf video filters dependent on avformat [no]"
  76. echo " --enable-beosthreads use BeOS threads [no]"
  77. echo " --enable-os2threads use OS/2 threads [no]"
  78. echo " --enable-pthreads use pthreads [no]"
  79. echo " --enable-w32threads use Win32 threads [no]"
  80. echo " --enable-x11grab enable X11 grabbing [no]"
  81. echo
  82. echo "External library support:"
  83. echo " --enable-mlib enable Sun medialib [no]"
  84. echo " --enable-avisynth enable reading of AVISynth script files [no]"
  85. echo " --enable-libamr-nb enable libamr-nb floating point audio codec"
  86. echo " --enable-libamr-wb enable libamr-wb floating point audio codec"
  87. echo " --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394"
  88. echo " and libraw1394 [no]"
  89. echo " --enable-libdirac enable Dirac support via libdirac [no]"
  90. echo " --enable-libfaac enable FAAC support via libfaac [no]"
  91. echo " --enable-libfaad enable FAAD support via libfaad [no]"
  92. echo " --enable-libfaadbin open libfaad.so.0 at runtime [no]"
  93. echo " --enable-libgsm enable GSM support via libgsm [no]"
  94. echo " --enable-libmp3lame enable MP3 encoding via libmp3lame [no]"
  95. echo " --enable-libnut enable NUT (de)muxing via libnut,"
  96. echo " native (de)muxer exists [no]"
  97. echo " --enable-libschroedinger enable Dirac support via libschroedinger [no]"
  98. echo " --enable-libspeex enable Speex decoding via libspeex [no]"
  99. echo " --enable-libtheora enable Theora encoding via libtheora [no]"
  100. echo " --enable-libvorbis enable Vorbis encoding via libvorbis,"
  101. echo " native implementation exists [no]"
  102. echo " --enable-libx264 enable H.264 encoding via x264 [no]"
  103. echo " --enable-libxvid enable Xvid encoding via xvidcore,"
  104. echo " native MPEG-4/Xvid encoder exists [no]"
  105. echo ""
  106. echo "Advanced options (experts only):"
  107. echo " --source-path=PATH path to source code [$source_path]"
  108. echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
  109. echo " --enable-cross-compile assume a cross-compiler is used"
  110. echo " --target-os=OS compiler targets OS [$target_os]"
  111. echo " --cc=CC use C compiler CC [$cc]"
  112. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  113. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  114. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  115. echo " --extra-version=STRING version string suffix []"
  116. echo " --build-suffix=SUFFIX library name suffix []"
  117. echo " --arch=ARCH select architecture [$arch]"
  118. echo " --cpu=CPU select the minimum required CPU (affects"
  119. echo " instruction selection, may crash on older CPUs)"
  120. echo " --enable-powerpc-perf enable performance report on PPC"
  121. echo " (requires enabling PMC)"
  122. echo " --disable-mmx disable MMX optimizations"
  123. echo " --disable-mmx2 disable MMX2 optimizations"
  124. echo " --disable-ssse3 disable SSSE3 optimizations"
  125. echo " --disable-armv5te disable armv5te optimizations"
  126. echo " --disable-armv6 disable armv6 optimizations"
  127. echo " --disable-armvfp disable ARM VFP optimizations"
  128. echo " --disable-iwmmxt disable iwmmxt optimizations"
  129. echo " --disable-altivec disable AltiVec optimizations"
  130. echo " --disable-network disable network support [no]"
  131. echo " --disable-ipv6 disable IPv6 support [no]"
  132. echo " --disable-zlib disable zlib [no]"
  133. echo " --disable-bzlib disable bzlib [no]"
  134. echo " --disable-vhook disable video hooking support"
  135. echo " --disable-mpegaudio-hp faster (but less accurate)"
  136. echo " MPEG audio decoding [no]"
  137. echo " --enable-gray enable full grayscale support (slower color)"
  138. echo " --disable-ffmpeg disable ffmpeg build"
  139. echo " --disable-ffserver disable ffserver build"
  140. echo " --disable-ffplay disable ffplay build"
  141. echo " --enable-small optimize for size instead of speed"
  142. echo " --enable-hardcoded-tables use hardcoded tables instead of runtime generation"
  143. echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
  144. echo " --disable-encoder=NAME disable encoder NAME"
  145. echo " --enable-encoder=NAME enable encoder NAME"
  146. echo " --disable-decoder=NAME disable decoder NAME"
  147. echo " --enable-decoder=NAME enable decoder NAME"
  148. echo " --disable-encoders disable all encoders"
  149. echo " --disable-decoders disable all decoders"
  150. echo " --disable-muxer=NAME disable muxer NAME"
  151. echo " --enable-muxer=NAME enable muxer NAME"
  152. echo " --disable-muxers disable all muxers"
  153. echo " --disable-demuxer=NAME disable demuxer NAME"
  154. echo " --enable-demuxer=NAME enable demuxer NAME"
  155. echo " --disable-demuxers disable all demuxers"
  156. echo " --enable-parser=NAME enable parser NAME"
  157. echo " --disable-parser=NAME disable parser NAME"
  158. echo " --disable-parsers disable all parsers"
  159. echo " --enable-bsf=NAME enable bitstream filter NAME"
  160. echo " --disable-bsf=NAME disable bitstream filter NAME"
  161. echo " --disable-bsfs disable all bitstream filters"
  162. echo " --enable-protocol=NAME enable protocol NAME"
  163. echo " --disable-protocol=NAME disable protocol NAME"
  164. echo " --disable-protocols disable all protocols"
  165. echo " --disable-devices disable all devices"
  166. echo " --enable-filter=NAME enable filter NAME"
  167. echo " --disable-filter=NAME disable filter NAME"
  168. echo " --disable-filters disable all filters"
  169. echo " --list-decoders show all available decoders"
  170. echo " --list-encoders show all available encoders"
  171. echo " --list-muxers show all available muxers"
  172. echo " --list-demuxers show all available demuxers"
  173. echo " --list-parsers show all available parsers"
  174. echo " --list-protocols show all available protocols"
  175. echo " --list-bsfs show all available bitstream filters"
  176. echo " --list-indevs show all available input devices"
  177. echo " --list-outdevs show all available output devices"
  178. echo " --list-filters show all available filters"
  179. echo
  180. echo "Developer options (useful when working on FFmpeg itself):"
  181. echo " --disable-debug disable debugging symbols"
  182. echo " --enable-debug=LEVEL set the debug level [$debuglevel]"
  183. echo " --enable-gprof enable profiling with gprof [$gprof]"
  184. echo " --disable-optimizations disable compiler optimizations"
  185. echo " --enable-extra-warnings enable more compiler warnings"
  186. echo " --disable-stripping disable stripping of executables and shared libraries"
  187. echo ""
  188. echo "NOTE: Object files are built at the place where configure is launched."
  189. exit 0
  190. }
  191. log(){
  192. echo "$@" >> $logfile
  193. }
  194. log_file(){
  195. log BEGIN $1
  196. pr -n -t $1 >> $logfile
  197. log END $1
  198. }
  199. echolog(){
  200. log "$@"
  201. echo "$@"
  202. }
  203. die(){
  204. echolog "$@"
  205. cat <<EOF
  206. If you think configure made a mistake, make sure you are using the latest
  207. version from SVN. If the latest version fails, report the problem to the
  208. ffmpeg-user@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
  209. EOF
  210. if disabled logging; then
  211. cat <<EOF
  212. Rerun configure with logging enabled (do not use --disable-logging), and
  213. include the log this produces with your report.
  214. EOF
  215. else
  216. cat <<EOF
  217. Include the log file "$logfile" produced by configure as this will help
  218. solving the problem.
  219. EOF
  220. fi
  221. rm -f $TMPC $TMPE $TMPH $TMPO $TMPS $TMPSH
  222. exit 1
  223. }
  224. # Avoid locale weirdness, besides we really just want to translate ASCII.
  225. toupper(){
  226. echo "$@" | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ
  227. }
  228. tolower(){
  229. echo "$@" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz
  230. }
  231. set_all(){
  232. value=$1
  233. shift
  234. for var in $*; do
  235. eval $var=$value
  236. done
  237. }
  238. set_weak(){
  239. value=$1
  240. shift
  241. for var; do
  242. eval : \${$var:=$value}
  243. done
  244. }
  245. pushvar(){
  246. for var in $*; do
  247. eval level=\${${var}_level:=0}
  248. eval ${var}_${level}="\$$var"
  249. eval ${var}_level=$(($level+1))
  250. done
  251. }
  252. popvar(){
  253. for var in $*; do
  254. eval level=\${${var}_level:-0}
  255. test $level = 0 && continue
  256. eval level=$(($level-1))
  257. eval $var="\${${var}_${level}}"
  258. eval ${var}_level=$level
  259. eval unset ${var}_${level}
  260. done
  261. }
  262. enable(){
  263. set_all yes $*
  264. }
  265. disable(){
  266. set_all no $*
  267. }
  268. enable_weak(){
  269. set_weak yes $*
  270. }
  271. disable_weak(){
  272. set_weak no $*
  273. }
  274. do_enable_deep(){
  275. for var; do
  276. enabled $var && continue
  277. eval sel="\$${var}_select"
  278. eval sgs="\$${var}_suggest"
  279. pushvar var sgs
  280. enable_deep $sel
  281. popvar sgs
  282. enable_deep_weak $sgs
  283. popvar var
  284. done
  285. }
  286. enable_deep(){
  287. do_enable_deep $*
  288. enable $*
  289. }
  290. enable_deep_weak(){
  291. do_enable_deep $*
  292. enable_weak $*
  293. }
  294. enabled(){
  295. test "${1#!}" = "$1" && op== || op=!=
  296. eval test "x\$${1#!}" $op "xyes"
  297. }
  298. disabled(){
  299. test "${1#!}" = "$1" && op== || op=!=
  300. eval test "x\$${1#!}" $op "xno"
  301. }
  302. enabled_all(){
  303. for opt; do
  304. enabled $opt || return 1
  305. done
  306. }
  307. disabled_all(){
  308. for opt; do
  309. disabled $opt || return 1
  310. done
  311. }
  312. enabled_any(){
  313. for opt; do
  314. enabled $opt && return 0
  315. done
  316. }
  317. disabled_any(){
  318. for opt; do
  319. disabled $opt && return 0
  320. done
  321. return 1
  322. }
  323. set_default(){
  324. for opt; do
  325. eval test -z "\$$opt" && eval $opt=\$${opt}_default
  326. done
  327. }
  328. is_in(){
  329. value=$1
  330. shift
  331. for var in $*; do
  332. [ $var = $value ] && return 0
  333. done
  334. return 1
  335. }
  336. check_deps(){
  337. for cfg; do
  338. cfg="${cfg#!}"
  339. enabled ${cfg}_checking && die "Circular dependency for $cfg."
  340. disabled ${cfg}_checking && continue
  341. enable ${cfg}_checking
  342. eval dep_all="\$${cfg}_deps"
  343. eval dep_any="\$${cfg}_deps_any"
  344. eval dep_sel="\$${cfg}_select"
  345. eval dep_sgs="\$${cfg}_suggest"
  346. pushvar cfg dep_all dep_any dep_sel dep_sgs
  347. check_deps $dep_all $dep_any $dep_sel $dep_sgs
  348. popvar cfg dep_all dep_any dep_sel dep_sgs
  349. enabled_all $dep_all || disable $cfg
  350. enabled_any $dep_any || disable $cfg
  351. disabled_any $dep_sel && disable $cfg
  352. if enabled $cfg; then
  353. eval dep_extralibs="\$${cfg}_extralibs"
  354. test -n "$dep_extralibs" && add_extralibs $dep_extralibs
  355. enable_deep $dep_sel
  356. enable_deep_weak $dep_sgs
  357. fi
  358. disable ${cfg}_checking
  359. done
  360. }
  361. print_config(){
  362. pfx=$1
  363. header=$2
  364. makefile=$3
  365. shift 3
  366. for cfg; do
  367. ucname="`toupper $cfg`"
  368. if enabled $cfg; then
  369. echo "#define ${pfx}${ucname} 1" >> $header
  370. echo "#define ENABLE_${ucname} 1" >> $header
  371. echo "${pfx}${ucname}=yes" >> $makefile
  372. else
  373. echo "#define ENABLE_${ucname} 0" >> $header
  374. fi
  375. done
  376. }
  377. flags_saved(){
  378. (: ${SAVE_CFLAGS?}) 2> /dev/null
  379. }
  380. save_flags(){
  381. flags_saved && return
  382. SAVE_CFLAGS="$CFLAGS"
  383. SAVE_LDFLAGS="$LDFLAGS"
  384. SAVE_extralibs="$extralibs"
  385. }
  386. restore_flags(){
  387. flags_saved || return
  388. CFLAGS="$SAVE_CFLAGS"
  389. LDFLAGS="$SAVE_LDFLAGS"
  390. extralibs="$SAVE_extralibs"
  391. unset SAVE_CFLAGS
  392. unset SAVE_LDFLAGS
  393. unset SAVE_extralibs
  394. }
  395. temp_cflags(){
  396. save_flags
  397. CFLAGS="$CFLAGS $*"
  398. }
  399. temp_ldflags(){
  400. save_flags
  401. LDFLAGS="$LDFLAGS $*"
  402. }
  403. temp_extralibs(){
  404. save_flags
  405. extralibs="$extralibs $*"
  406. }
  407. append(){
  408. var=$1
  409. shift
  410. flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
  411. eval "$var=\"\$$var $*\""
  412. }
  413. add_cflags(){
  414. append CFLAGS "$@"
  415. }
  416. add_ldflags(){
  417. append LDFLAGS "$@"
  418. }
  419. add_extralibs(){
  420. append extralibs "$@"
  421. }
  422. check_cmd(){
  423. log "$@"
  424. "$@" >> $logfile 2>&1
  425. }
  426. check_cc(){
  427. log check_cc "$@"
  428. cat > $TMPC
  429. log_file $TMPC
  430. check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
  431. }
  432. check_cpp(){
  433. log check_cpp "$@"
  434. cat > $TMPC
  435. log_file $TMPC
  436. check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
  437. }
  438. check_asm(){
  439. log check_asm "$@"
  440. name="$1"
  441. asm="$2"
  442. shift 2
  443. check_cc "$@" <<EOF && enable $name || disable $name
  444. int foo(void){ __asm__ volatile($asm); }
  445. EOF
  446. }
  447. check_yasm(){
  448. log check_yasm "$@"
  449. echo "$1" > $TMPS
  450. log_file $TMPS
  451. shift 1
  452. check_cmd $yasmexe $YASMFLAGS "$@" -o $TMPO $TMPS
  453. }
  454. check_ld(){
  455. log check_ld "$@"
  456. check_cc || return
  457. flags=''
  458. libs=''
  459. for f; do
  460. test "${f}" = "${f#-l}" && flags="$flags $f" || libs="$libs $f"
  461. done
  462. check_cmd $cc $LDFLAGS $flags -o $TMPE $TMPO $extralibs $libs
  463. }
  464. check_cflags(){
  465. log check_cflags "$@"
  466. check_cc "$@" <<EOF && add_cflags "$@"
  467. int x;
  468. EOF
  469. }
  470. check_ldflags(){
  471. log check_ldflags "$@"
  472. check_ld "$@" <<EOF && add_ldflags "$@"
  473. int main(void){ return 0; }
  474. EOF
  475. }
  476. check_header(){
  477. log check_header "$@"
  478. header=$1
  479. shift
  480. var=`echo $header | sed 's/[^A-Za-z0-9_]/_/g'`
  481. disable $var
  482. check_cpp "$@" <<EOF && enable $var
  483. #include <$header>
  484. int x;
  485. EOF
  486. }
  487. check_func(){
  488. log check_func "$@"
  489. func=$1
  490. shift
  491. disable $func
  492. check_ld "$@" <<EOF && enable $func
  493. extern int $func();
  494. int main(void){ $func(); }
  495. EOF
  496. }
  497. check_func_headers(){
  498. log check_func_headers "$@"
  499. headers=$1
  500. func=$2
  501. shift 2
  502. disable $func
  503. incs=""
  504. for hdr in $headers; do
  505. incs="$incs
  506. #include <$hdr>"
  507. done
  508. check_ld "$@" <<EOF && enable $func
  509. $incs
  510. int main(int argc, char **argv){
  511. (void) $func;
  512. return 0;
  513. }
  514. EOF
  515. }
  516. check_cpp_condition(){
  517. log check_cpp_condition "$@"
  518. header=$1
  519. condition=$2
  520. check_cpp <<EOF
  521. #include <$header>
  522. #if !($condition)
  523. #error "unsatisfied condition: $condition"
  524. #endif
  525. EOF
  526. }
  527. check_lib(){
  528. log check_lib "$@"
  529. header="$1"
  530. func="$2"
  531. shift 2
  532. temp_extralibs "$@"
  533. check_header $header && check_func $func && add_extralibs "$@"
  534. err=$?
  535. restore_flags
  536. return $err
  537. }
  538. check_lib2(){
  539. log check_lib2 "$@"
  540. headers="$1"
  541. func="$2"
  542. shift 2
  543. temp_extralibs "$@"
  544. check_func_headers "$headers" $func && add_extralibs "$@"
  545. err=$?
  546. restore_flags
  547. return $err
  548. }
  549. check_exec(){
  550. check_ld "$@" && { enabled cross_compile || $TMPE >> $logfile 2>&1; }
  551. }
  552. check_exec_crash(){
  553. code=`cat`
  554. # exit() is not async signal safe. _Exit (C99) and _exit (POSIX)
  555. # are safe but may not be available everywhere. Thus we use
  556. # raise(SIGTERM) instead. The check is run in a subshell so we
  557. # can redirect the "Terminated" message from the shell. SIGBUS
  558. # is not defined by standard C so it is used conditionally.
  559. (check_exec "$@") >> $logfile 2>&1 <<EOF
  560. #include <signal.h>
  561. static void sighandler(int sig){
  562. raise(SIGTERM);
  563. }
  564. int main(void){
  565. signal(SIGILL, sighandler);
  566. signal(SIGFPE, sighandler);
  567. signal(SIGSEGV, sighandler);
  568. #ifdef SIGBUS
  569. signal(SIGBUS, sighandler);
  570. #endif
  571. { $code }
  572. }
  573. EOF
  574. }
  575. check_type(){
  576. log check_type "$@"
  577. headers=$1
  578. type=$2
  579. shift 2
  580. disable $type
  581. incs=""
  582. for hdr in $headers; do
  583. incs="$incs
  584. #include <$hdr>"
  585. done
  586. check_cc "$@" <<EOF && enable $type
  587. $incs
  588. $type v;
  589. EOF
  590. }
  591. require(){
  592. name="$1"
  593. header="$2"
  594. func="$3"
  595. shift 3
  596. check_lib $header $func "$@" || die "ERROR: $name not found"
  597. }
  598. require2(){
  599. name="$1"
  600. headers="$2"
  601. func="$3"
  602. shift 3
  603. check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  604. }
  605. check_foo_config(){
  606. cfg=$1
  607. pkg=$2
  608. header=$3
  609. func=$4
  610. shift 4
  611. disable $cfg
  612. check_cmd ${pkg}-config --version
  613. err=$?
  614. if test "$err" = 0; then
  615. temp_cflags `${pkg}-config --cflags`
  616. temp_extralibs `${pkg}-config --libs`
  617. check_lib "$@" $header $func && enable $cfg
  618. fi
  619. return $err
  620. }
  621. apply(){
  622. file=$1
  623. shift
  624. "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp"
  625. }
  626. # CONFIG_LIST contains configurable options, while HAVE_LIST is for
  627. # system-dependent things.
  628. COMPONENT_LIST="
  629. bsfs
  630. decoders
  631. demuxers
  632. encoders
  633. filters
  634. indevs
  635. muxers
  636. outdevs
  637. parsers
  638. protocols
  639. "
  640. CONFIG_LIST="
  641. $COMPONENT_LIST
  642. avfilter
  643. avfilter_lavf
  644. avisynth
  645. beos_netserver
  646. bzlib
  647. ffmpeg
  648. ffplay
  649. ffserver
  650. fft
  651. golomb
  652. gpl
  653. gprof
  654. gray
  655. hardcoded_tables
  656. ipv6
  657. libamr_nb
  658. libamr_wb
  659. libdc1394
  660. libdirac
  661. libfaac
  662. libfaad
  663. libfaadbin
  664. libgsm
  665. libmp3lame
  666. libnut
  667. libschroedinger
  668. libspeex
  669. libtheora
  670. libvorbis
  671. libx264
  672. libxvid
  673. mdct
  674. memalign_hack
  675. mlib
  676. mpegaudio_hp
  677. network
  678. nonfree
  679. postproc
  680. powerpc_perf
  681. small
  682. swscale
  683. vhook
  684. x11grab
  685. zlib
  686. "
  687. THREADS_LIST='
  688. beosthreads
  689. os2threads
  690. pthreads
  691. w32threads
  692. '
  693. ARCH_LIST='
  694. alpha
  695. armv4l
  696. bfin
  697. ia64
  698. m68k
  699. mips
  700. parisc
  701. powerpc
  702. s390
  703. sh4
  704. sparc
  705. sparc64
  706. x86
  707. x86_32
  708. x86_64
  709. '
  710. ARCH_EXT_LIST='
  711. altivec
  712. armv5te
  713. armv6
  714. armvfp
  715. iwmmxt
  716. mmi
  717. mmx
  718. mmx2
  719. neon
  720. ssse3
  721. vis
  722. '
  723. HAVE_LIST="
  724. $ARCH_EXT_LIST
  725. $THREADS_LIST
  726. altivec_h
  727. arpa_inet_h
  728. bswap
  729. closesocket
  730. cmov
  731. conio_h
  732. dcbzl
  733. dev_bktr_ioctl_bt848_h
  734. dev_bktr_ioctl_meteor_h
  735. dev_ic_bt8xx_h
  736. dev_video_meteor_ioctl_meteor_h
  737. dev_video_bktr_ioctl_bt848_h
  738. dlfcn_h
  739. dlopen
  740. dos_paths
  741. ebp_available
  742. ebx_available
  743. fast_64bit
  744. fast_cmov
  745. fast_unaligned
  746. fork
  747. freetype2
  748. gethrtime
  749. GetProcessTimes
  750. getrusage
  751. imlib2
  752. inet_aton
  753. inline_asm
  754. libdc1394_1
  755. libdc1394_2
  756. llrint
  757. lrint
  758. lrintf
  759. machine_ioctl_bt848_h
  760. machine_ioctl_meteor_h
  761. malloc_h
  762. memalign
  763. mkstemp
  764. pld
  765. ppc64
  766. round
  767. roundf
  768. sdl
  769. sdl_video_size
  770. socklen_t
  771. soundcard_h
  772. poll_h
  773. sys_mman_h
  774. sys_resource_h
  775. sys_select_h
  776. sys_soundcard_h
  777. sys_videoio_h
  778. termios_h
  779. threads
  780. winsock2_h
  781. yasm
  782. "
  783. # options emitted with CONFIG_ prefix but not available on command line
  784. CONFIG_EXTRA="
  785. fft_mmx
  786. "
  787. CMDLINE_SELECT="
  788. $ARCH_EXT_LIST
  789. $CONFIG_LIST
  790. $THREADS_LIST
  791. cross_compile
  792. debug
  793. extra_warnings
  794. logging
  795. optimizations
  796. shared
  797. static
  798. stripping
  799. "
  800. PATHS_LIST='
  801. bindir
  802. incdir
  803. libdir
  804. mandir
  805. prefix
  806. shlibdir
  807. '
  808. CMDLINE_SET="
  809. $PATHS_LIST
  810. arch
  811. build_suffix
  812. cc
  813. cpu
  814. cross_prefix
  815. extra_version
  816. logfile
  817. source_path
  818. target_os
  819. "
  820. # code dependency declarations
  821. # architecture extensions
  822. altivec_deps="powerpc"
  823. armv5te_deps="armv4l"
  824. armv6_deps="armv4l"
  825. armvfp_deps="armv4l"
  826. iwmmxt_deps="armv4l"
  827. mmi_deps="mips"
  828. mmx_deps="x86"
  829. mmx2_deps="x86 mmx"
  830. neon_deps="armv4l"
  831. ssse3_deps="x86"
  832. vis_deps="sparc"
  833. # common features
  834. fft_suggest="fft_mmx"
  835. fft_mmx_deps="mmx yasm"
  836. # decoders / encoders
  837. aac_decoder_select="fft mdct"
  838. ac3_decoder_deps="gpl"
  839. ac3_decoder_select="fft mdct"
  840. atrac3_decoder_select="fft mdct"
  841. cavs_decoder_select="golomb"
  842. cook_decoder_select="fft mdct"
  843. cscd_decoder_suggest="zlib"
  844. dca_decoder_select="fft mdct"
  845. dxa_decoder_select="zlib"
  846. eac3_decoder_deps="gpl"
  847. eac3_decoder_select="fft mdct"
  848. ffv1_decoder_select="golomb"
  849. flac_decoder_select="golomb"
  850. flac_encoder_select="golomb"
  851. flashsv_decoder_select="zlib"
  852. flashsv_encoder_select="zlib"
  853. h264_decoder_select="golomb"
  854. imc_decoder_select="fft mdct"
  855. jpegls_decoder_select="golomb"
  856. jpegls_encoder_select="golomb"
  857. loco_decoder_select="golomb"
  858. mpeg_xvmc_decoder_deps="xvmc"
  859. nellymoser_decoder_select="fft mdct"
  860. nellymoser_encoder_select="fft mdct"
  861. png_decoder_select="zlib"
  862. png_encoder_select="zlib"
  863. qdm2_decoder_select="fft mdct"
  864. shorten_decoder_select="golomb"
  865. sonic_decoder_select="golomb"
  866. sonic_encoder_select="golomb"
  867. sonic_ls_encoder_select="golomb"
  868. svq3_decoder_select="golomb"
  869. svq3_decoder_suggest="zlib"
  870. tiff_decoder_suggest="zlib"
  871. tiff_encoder_suggest="zlib"
  872. tscc_decoder_select="zlib"
  873. vorbis_decoder_select="fft mdct"
  874. vorbis_encoder_select="fft mdct"
  875. wmav1_decoder_select="fft mdct"
  876. wmav1_encoder_select="fft mdct"
  877. wmav2_decoder_select="fft mdct"
  878. wmav2_encoder_select="fft mdct"
  879. zlib_decoder_select="zlib"
  880. zlib_encoder_select="zlib"
  881. zmbv_decoder_select="zlib"
  882. zmbv_encoder_select="zlib"
  883. # external libraries
  884. libamr_nb_decoder_deps="libamr_nb"
  885. libamr_nb_encoder_deps="libamr_nb"
  886. libamr_wb_decoder_deps="libamr_wb"
  887. libamr_wb_encoder_deps="libamr_wb"
  888. libdirac_decoder_deps="libdirac !libschroedinger"
  889. libdirac_encoder_deps="libdirac"
  890. libfaac_encoder_deps="libfaac"
  891. libfaad_decoder_deps="libfaad"
  892. libfaadbin_decoder_extralibs='$ldl'
  893. libgsm_decoder_deps="libgsm"
  894. libgsm_encoder_deps="libgsm"
  895. libgsm_ms_decoder_deps="libgsm"
  896. libgsm_ms_encoder_deps="libgsm"
  897. libmp3lame_encoder_deps="libmp3lame"
  898. libschroedinger_decoder_deps="libschroedinger"
  899. libschroedinger_encoder_deps="libschroedinger"
  900. libspeex_decoder_deps="libspeex"
  901. libtheora_encoder_deps="libtheora"
  902. libvorbis_encoder_deps="libvorbis"
  903. libx264_encoder_deps="libx264"
  904. libxvid_encoder_deps="libxvid"
  905. mpeg4aac_decoder_deps="libfaad"
  906. # demuxers / muxers
  907. ac3_demuxer_deps="ac3_parser"
  908. audio_beos_demuxer_deps="audio_beos"
  909. audio_beos_demuxer_extralibs="-lmedia -lbe"
  910. audio_beos_muxer_deps="audio_beos"
  911. audio_beos_muxer_extralibs="-lmedia -lbe"
  912. avisynth_demuxer_deps="avisynth"
  913. bktr_demuxer_deps_any="dev_bktr_ioctl_bt848_h machine_ioctl_bt848_h dev_video_bktr_ioctl_bt848_h dev_ic_bt8xx_h"
  914. dirac_demuxer_deps="dirac_parser"
  915. dv1394_demuxer_deps="dv1394 dv_demuxer"
  916. libdc1394_demuxer_deps="libdc1394"
  917. libnut_demuxer_deps="libnut"
  918. libnut_muxer_deps="libnut"
  919. matroska_demuxer_suggest="zlib bzlib"
  920. mov_demuxer_suggest="zlib"
  921. mp3_demuxer_deps="mpegaudio_parser"
  922. oss_demuxer_deps_any="soundcard_h sys_soundcard_h"
  923. oss_muxer_deps_any="soundcard_h sys_soundcard_h"
  924. redir_demuxer_deps="network"
  925. rtp_muxer_deps="network rtp_protocol"
  926. rtsp_demuxer_deps="sdp_demuxer"
  927. sdp_demuxer_deps="rtp_protocol mpegts_demuxer"
  928. v4l_demuxer_deps="linux_videodev_h"
  929. v4l2_demuxer_deps_any="linux_videodev2_h sys_videoio_h"
  930. vfwcap_demuxer_deps="capCreateCaptureWindow"
  931. vfwcap_demuxer_extralibs="-lvfw32"
  932. x11_grab_device_demuxer_deps="x11grab XShmCreateImage"
  933. x11_grab_device_demuxer_extralibs="-lX11 -lXext"
  934. # protocols
  935. http_protocol_deps="network"
  936. rtp_protocol_deps="udp_protocol"
  937. tcp_protocol_deps="network"
  938. udp_protocol_deps="network"
  939. # filters
  940. movie_filter_deps="avfilter_lavf"
  941. # programs
  942. ffplay_deps="sdl"
  943. ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer"
  944. ffserver_extralibs='$ldl'
  945. vhook_extralibs='$ldl'
  946. # default parameters
  947. logfile="config.err"
  948. # installation paths
  949. prefix_default="/usr/local"
  950. bindir_default='${prefix}/bin'
  951. incdir_default='${prefix}/include'
  952. libdir_default='${prefix}/lib'
  953. mandir_default='${prefix}/share/man'
  954. shlibdir_default="$libdir_default"
  955. # toolchain
  956. cc_default="gcc"
  957. yasmexe="yasm"
  958. ar="ar"
  959. nm="nm"
  960. ranlib="ranlib"
  961. strip="strip"
  962. asmalign_pot="unknown"
  963. ln_s="ln -sf"
  964. objformat="elf"
  965. # machine
  966. arch=`uname -m`
  967. cpu="generic"
  968. # OS
  969. target_os=$(tolower $(uname -s))
  970. # configurable options
  971. enable debug
  972. enable ffmpeg
  973. enable ffplay
  974. enable ffserver
  975. enable ipv6
  976. enable mpegaudio_hp
  977. enable network
  978. enable optimizations
  979. enable protocols
  980. enable static
  981. enable stripping
  982. vhook="default"
  983. # build settings
  984. add_cflags -D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112
  985. SHFLAGS='-shared -Wl,-soname,$$(@F)'
  986. VHOOKSHFLAGS='$(SHFLAGS)'
  987. FFSERVERLDFLAGS=-Wl,-E
  988. LIBPREF="lib"
  989. LIBSUF=".a"
  990. FULLNAME='$(NAME)$(BUILDSUF)'
  991. LIBNAME='$(LIBPREF)$(FULLNAME)$(LIBSUF)'
  992. SLIBPREF="lib"
  993. SLIBSUF=".so"
  994. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF)'
  995. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  996. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  997. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
  998. # gcc stupidly only outputs the basename of targets with -MM, but we need the
  999. # full relative path for objects in subdirectories for non-recursive Make.
  1000. DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
  1001. # find source path
  1002. source_path="`dirname \"$0\"`"
  1003. enable source_path_used
  1004. if test -z "$source_path" -o "$source_path" = "." ; then
  1005. source_path="`pwd`"
  1006. disable source_path_used
  1007. else
  1008. source_path="`cd \"$source_path\"; pwd`"
  1009. echo "$source_path" | grep -q '[[:blank:]]' &&
  1010. die "Out of tree builds are impossible with whitespace in source path."
  1011. fi
  1012. FFMPEG_CONFIGURATION="$@"
  1013. find_things(){
  1014. thing=$1
  1015. pattern=$2
  1016. file=$source_path/$3
  1017. sed -n "s/^[^#]*$pattern.*([^,]*, *\([^,]*\)\(,.*\)*).*/\1_$thing/p" "$file"
  1018. }
  1019. ENCODER_LIST=$(find_things encoder ENC libavcodec/allcodecs.c)
  1020. DECODER_LIST=$(find_things decoder DEC libavcodec/allcodecs.c)
  1021. PARSER_LIST=$(find_things parser PARSER libavcodec/allcodecs.c)
  1022. BSF_LIST=$(find_things bsf BSF libavcodec/allcodecs.c)
  1023. MUXER_LIST=$(find_things muxer _MUX libavformat/allformats.c)
  1024. DEMUXER_LIST=$(find_things demuxer DEMUX libavformat/allformats.c)
  1025. OUTDEV_LIST=$(find_things muxer _MUX libavdevice/alldevices.c)
  1026. INDEV_LIST=$(find_things demuxer DEMUX libavdevice/alldevices.c)
  1027. PROTOCOL_LIST=$(find_things protocol PROTOCOL libavformat/allformats.c)
  1028. FILTER_LIST=$(find_things filter FILTER libavfilter/allfilters.c)
  1029. enable $ARCH_EXT_LIST \
  1030. $DECODER_LIST \
  1031. $ENCODER_LIST \
  1032. $PARSER_LIST \
  1033. $BSF_LIST \
  1034. $DEMUXER_LIST \
  1035. $MUXER_LIST \
  1036. $FILTER_LIST \
  1037. $PROTOCOL_LIST \
  1038. $INDEV_LIST \
  1039. $OUTDEV_LIST \
  1040. die_unknown(){
  1041. echo "Unknown option \"$1\"."
  1042. echo "See $0 --help for available options."
  1043. exit 1
  1044. }
  1045. show_list() {
  1046. suffix=_$1
  1047. shift
  1048. echo $* | sed s/$suffix//g | tr ' ' '\n' | sort
  1049. exit 0
  1050. }
  1051. for opt do
  1052. optval="${opt#*=}"
  1053. case "$opt" in
  1054. --extra-cflags=*) add_cflags "$optval"
  1055. ;;
  1056. --extra-ldflags=*) add_ldflags "$optval"
  1057. ;;
  1058. --extra-libs=*) add_extralibs "$optval"
  1059. ;;
  1060. --disable-devices) disable $INDEV_LIST $OUTDEV_LIST
  1061. ;;
  1062. --enable-debug=*) debuglevel="$optval"
  1063. ;;
  1064. --enable-*=*|--disable-*=*)
  1065. eval `echo "$opt" | sed 's/=/-/;s/--/action=/;s/-/ thing=/;s/-/ name=/'`
  1066. case "$thing" in
  1067. encoder|decoder|muxer|demuxer|parser|bsf|protocol|filter) $action ${optval}_${thing} ;;
  1068. *) die_unknown "$opt" ;;
  1069. esac
  1070. ;;
  1071. --enable-?*|--disable-?*)
  1072. eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
  1073. if is_in $option $COMPONENT_LIST; then
  1074. eval $action \$$(toupper ${option%s})_LIST
  1075. elif is_in $option $CMDLINE_SELECT; then
  1076. $action $option
  1077. else
  1078. die_unknown $opt
  1079. fi
  1080. ;;
  1081. --list-*)
  1082. NAME="${opt#--list-}"
  1083. is_in $NAME $COMPONENT_LIST || die_unknown $opt
  1084. NAME=${NAME%s}
  1085. eval show_list $NAME \$$(toupper $NAME)_LIST
  1086. ;;
  1087. --help|-h) show_help
  1088. ;;
  1089. *)
  1090. optname="${opt%%=*}"
  1091. optname="${optname#--}"
  1092. optname=$(echo "$optname" | sed 's/-/_/g')
  1093. is_in $optname $CMDLINE_SET || die_unknown $opt
  1094. eval $optname='$optval'
  1095. ;;
  1096. esac
  1097. done
  1098. disabled logging && logfile=/dev/null
  1099. echo "# $0 $@" > $logfile
  1100. set >> $logfile
  1101. cc_default="${cross_prefix}${cc_default}"
  1102. yasmexe="${cross_prefix}${yasmexe}"
  1103. ar="${cross_prefix}${ar}"
  1104. nm="${cross_prefix}${nm}"
  1105. ranlib="${cross_prefix}${ranlib}"
  1106. strip="${cross_prefix}${strip}"
  1107. set_default cc
  1108. # set temporary file name
  1109. if test ! -z "$TMPDIR" ; then
  1110. TMPDIR1="${TMPDIR}"
  1111. elif test ! -z "$TEMPDIR" ; then
  1112. TMPDIR1="${TEMPDIR}"
  1113. else
  1114. TMPDIR1="/tmp"
  1115. fi
  1116. TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
  1117. TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}${EXESUF}"
  1118. TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
  1119. TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
  1120. TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
  1121. TMPSH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.sh"
  1122. check_cflags -std=c99
  1123. case "$arch" in
  1124. i386|i486|i586|i686|i86pc|BePC)
  1125. arch="x86_32"
  1126. enable fast_unaligned
  1127. ;;
  1128. x86_64|amd64)
  1129. arch="x86_32"
  1130. enable cmov
  1131. enable fast_cmov
  1132. enable fast_unaligned
  1133. check_cc <<EOF && enable fast_64bit && arch="x86_64"
  1134. int test[sizeof(char*) - 7];
  1135. EOF
  1136. ;;
  1137. # armv4l is a subset of armv[567]*l
  1138. arm|armv[4567]*l)
  1139. arch="armv4l"
  1140. ;;
  1141. alpha)
  1142. arch="alpha"
  1143. enable fast_64bit
  1144. ;;
  1145. "Power Macintosh"|ppc|powerpc)
  1146. arch="powerpc"
  1147. enable fast_unaligned
  1148. ;;
  1149. ppc64)
  1150. arch="powerpc"
  1151. enable fast_64bit
  1152. enable fast_unaligned
  1153. ;;
  1154. mips|mipsel|IP*)
  1155. arch="mips"
  1156. ;;
  1157. sun4u|sparc64)
  1158. arch="sparc64"
  1159. enable fast_64bit
  1160. ;;
  1161. sparc)
  1162. arch="sparc"
  1163. ;;
  1164. sh4)
  1165. arch="sh4"
  1166. ;;
  1167. parisc)
  1168. arch="parisc"
  1169. ;;
  1170. parisc64)
  1171. arch="parisc"
  1172. enable fast_64bit
  1173. ;;
  1174. s390|s390x)
  1175. arch="s390"
  1176. ;;
  1177. m68k)
  1178. arch="m68k"
  1179. ;;
  1180. ia64)
  1181. arch="ia64"
  1182. enable fast_64bit
  1183. ;;
  1184. bfin)
  1185. arch="bfin"
  1186. ;;
  1187. *)
  1188. arch="unknown"
  1189. ;;
  1190. esac
  1191. enable $arch
  1192. enabled_any x86_32 x86_64 && enable x86
  1193. enabled sparc64 && enable sparc
  1194. # OS specific
  1195. case $target_os in
  1196. beos|haiku|zeta)
  1197. prefix_default="$HOME/config"
  1198. # helps building libavcodec
  1199. add_cflags "-DPIC -fomit-frame-pointer"
  1200. # 3 gcc releases known for BeOS, each with ugly bugs
  1201. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  1202. case "$gcc_version" in
  1203. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  1204. disable mmx
  1205. ;;
  1206. *20010315*) echo "BeBits gcc"
  1207. add_cflags "-fno-expensive-optimizations"
  1208. ;;
  1209. esac
  1210. SHFLAGS=-nostart
  1211. # enable BeOS things
  1212. enable audio_beos
  1213. # no need for libm, but the inet stuff
  1214. # Check for BONE
  1215. # XXX: actually should check for NOT net_server
  1216. if echo $BEINCLUDES | grep -q 'headers/be/bone'; then
  1217. network_extralibs="-lbind -lsocket"
  1218. else
  1219. enable beos_netserver
  1220. network_extralibs="-lnet"
  1221. fi ;;
  1222. sunos)
  1223. FFSERVERLDFLAGS=""
  1224. SHFLAGS='-shared -Wl,-h,$$(@F)'
  1225. network_extralibs="-lsocket -lnsl"
  1226. ;;
  1227. netbsd)
  1228. oss_demuxer_extralibs="-lossaudio"
  1229. oss_muxer_extralibs="-lossaudio"
  1230. ;;
  1231. openbsd)
  1232. disable need_memalign
  1233. LIBOBJFLAGS='$(PIC)'
  1234. SHFLAGS='-shared'
  1235. SLIBNAME='$(SLIBPREF)$(FULLNAME)$(SLIBSUF).$(LIBVERSION)'
  1236. SLIBNAME_WITH_VERSION='$(SLIBNAME)'
  1237. SLIBNAME_WITH_MAJOR='$(SLIBNAME)'
  1238. oss_demuxer_extralibs="-lossaudio"
  1239. oss_muxer_extralibs="-lossaudio"
  1240. ;;
  1241. freebsd)
  1242. disable need_memalign
  1243. ;;
  1244. bsd/os)
  1245. osextralibs="-lpoll -lgnugetopt"
  1246. strip="strip -d"
  1247. ;;
  1248. darwin)
  1249. disable need_memalign
  1250. SHFLAGS='-dynamiclib -Wl,-single_module -Wl,-install_name,$(SHLIBDIR)/$(SLIBNAME),-current_version,$(LIBVERSION),-compatibility_version,$(LIBMAJOR) -Wl,-read_only_relocs,suppress'
  1251. VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(SHLIBDIR)/vhook/$$(@F)'
  1252. strip="strip -x"
  1253. FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
  1254. SLIBSUF=".dylib"
  1255. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME).$(LIBVERSION)$(SLIBSUF)'
  1256. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME).$(LIBMAJOR)$(SLIBSUF)'
  1257. FFSERVERLDFLAGS=-Wl,-bind_at_load
  1258. objformat="macho"
  1259. enabled x86_64 && objformat="macho64"
  1260. ;;
  1261. mingw32*)
  1262. target_os=mingw32
  1263. LIBTARGET=i386
  1264. if test $arch = x86_64; then
  1265. disable need_memalign
  1266. LIBTARGET=x64
  1267. fi
  1268. shlibdir_default="$bindir_default"
  1269. VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
  1270. VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
  1271. if enabled swscale; then
  1272. VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
  1273. VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
  1274. fi
  1275. disable ffserver
  1276. SLIBPREF=""
  1277. SLIBSUF=".dll"
  1278. EXESUF=".exe"
  1279. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  1280. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  1281. SLIB_EXTRA_CMD='-lib /machine:$(LIBTARGET) /def:$$(@:$(SLIBSUF)=.def) /out:$(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)'
  1282. SLIB_INSTALL_EXTRA_CMD='-install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"; \
  1283. install -m 644 $(SUBDIR)$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib) "$(SHLIBDIR)/$(SLIBNAME_WITH_MAJOR:$(SLIBSUF)=.lib)"'
  1284. SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(SHLIBDIR)/$(SLIBNAME:$(SLIBSUF)=.lib)"'
  1285. SHFLAGS='-shared -Wl,--output-def,$$(@:$(SLIBSUF)=.def) -Wl,--enable-runtime-pseudo-reloc -Wl,--enable-auto-image-base'
  1286. objformat="win32"
  1287. enable dos_paths
  1288. check_cpp_condition _mingw.h "(__MINGW32_MAJOR_VERSION > 3) || (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" ||
  1289. die "ERROR: MinGW runtime version must be >= 3.15."
  1290. enabled_any avisynth vfwcap_demuxer &&
  1291. { check_cpp_condition w32api.h "(__W32API_MAJOR_VERSION > 3) || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION >= 12)" ||
  1292. die "ERROR: avisynth and vfwcap_demuxer require w32api version 3.12 or later."; }
  1293. ;;
  1294. cygwin*)
  1295. target_os=cygwin
  1296. shlibdir_default="$bindir_default"
  1297. VHOOKSHFLAGS='-shared -L$(BUILD_ROOT)/libavformat -L$(BUILD_ROOT)/libavcodec -L$(BUILD_ROOT)/libavutil'
  1298. VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
  1299. if enabled swscale; then
  1300. VHOOKSHFLAGS="$VHOOKSHFLAGS -L\$(BUILD_ROOT)/libswscale"
  1301. VHOOKLIBS="$VHOOKLIBS -lswscale\$(BUILDSUF)"
  1302. fi
  1303. EXESUF=".exe"
  1304. SLIBPREF="cyg"
  1305. SLIBSUF=".dll"
  1306. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
  1307. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
  1308. SHFLAGS='-shared -Wl,--enable-auto-image-base'
  1309. objformat="win32"
  1310. enable dos_paths
  1311. ;;
  1312. *-dos|freedos|opendos)
  1313. disable ffplay ffserver vhook
  1314. disable $INDEV_LIST $OUTDEV_LIST
  1315. network_extralibs="-lsocket"
  1316. EXESUF=".exe"
  1317. objformat="win32"
  1318. enable dos_paths
  1319. ;;
  1320. linux)
  1321. enable dv1394
  1322. ;;
  1323. irix*)
  1324. target_os=irix
  1325. ranlib="echo ignoring ranlib"
  1326. ;;
  1327. os/2*)
  1328. strip="lxlite"
  1329. ln_s="cp -f"
  1330. EXESUF=".exe"
  1331. FFLDFLAGS="-Zomf -Zbin-files -Zargs-wild -Zmap"
  1332. SHFLAGS='$(SUBDIR)$(NAME).def -Zdll -Zomf'
  1333. FFSERVERLDFLAGS=""
  1334. LIBSUF="_s.a"
  1335. SLIBPREF=""
  1336. SLIBSUF=".dll"
  1337. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  1338. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(shell echo $(NAME) | cut -c1-6)$(LIBMAJOR)$(SLIBSUF)'
  1339. SLIB_CREATE_DEF_CMD='echo LIBRARY $(SLIBNAME_WITH_MAJOR) INITINSTANCE TERMINSTANCE > $(SUBDIR)$(NAME).def; \
  1340. echo PROTMODE >> $(SUBDIR)$(NAME).def; \
  1341. echo CODE PRELOAD MOVEABLE DISCARDABLE >> $(SUBDIR)$(NAME).def; \
  1342. echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $(SUBDIR)$(NAME).def; \
  1343. echo EXPORTS >> $(SUBDIR)$(NAME).def; \
  1344. emxexp -o $(OBJS) >> $(SUBDIR)$(NAME).def'
  1345. SLIB_EXTRA_CMD='emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(NAME).def; \
  1346. emximp -o $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib $(SUBDIR)$(NAME).def;'
  1347. SLIB_INSTALL_EXTRA_CMD='install -m 644 $(SUBDIR)$(LIBPREF)$(NAME)_dll.a $(SUBDIR)$(LIBPREF)$(NAME)_dll.lib "$(LIBDIR)"'
  1348. SLIB_UNINSTALL_EXTRA_CMD='rm -f "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.a "$(LIBDIR)"/$(LIBPREF)$(NAME)_dll.lib'
  1349. disable vhook
  1350. enable dos_paths
  1351. ;;
  1352. interix)
  1353. disable vhook
  1354. ;;
  1355. *)
  1356. target_os="${target_os}-UNKNOWN"
  1357. ;;
  1358. esac
  1359. set_default $PATHS_LIST
  1360. add_extralibs $osextralibs
  1361. # Combine FFLDFLAGS and the LDFLAGS environment variable.
  1362. LDFLAGS="$FFLDFLAGS $LDFLAGS"
  1363. test -n "$cross_prefix" && enable cross_compile
  1364. # we need to build at least one lib type
  1365. if ! enabled_any static shared; then
  1366. cat <<EOF
  1367. At least one library type must be built.
  1368. Specify --enable-static to build the static libraries or --enable-shared to
  1369. build the shared libraries as well. To only build the shared libraries specify
  1370. --disable-static in addition to --enable-shared.
  1371. EOF
  1372. exit 1;
  1373. fi
  1374. disabled static && LIBNAME=""
  1375. if enabled_any libfaad libfaadbin ; then
  1376. if check_header faad.h; then
  1377. check_cc <<EOF
  1378. #include <faad.h>
  1379. #ifndef FAAD2_VERSION
  1380. ok faad1
  1381. #endif
  1382. int main(void) { return 0; }
  1383. EOF
  1384. test $? = 0 && enable libfaad2
  1385. else
  1386. die "FAAD test failed."
  1387. fi
  1388. fi
  1389. if ! enabled gpl; then
  1390. die_gpl_disabled(){
  1391. name=$1
  1392. shift
  1393. enabled_any $@ && die "$name is under GPL and --enable-gpl is not specified."
  1394. }
  1395. die_gpl_disabled "The Postprocessing code" postproc
  1396. die_gpl_disabled "libx264" libx264
  1397. die_gpl_disabled "libxvidcore" libxvid
  1398. die_gpl_disabled "FAAD2" libfaad2
  1399. die_gpl_disabled "The X11 grabber" x11grab
  1400. die_gpl_disabled "The software scaler" swscale
  1401. fi
  1402. if ! enabled nonfree && enabled_any libamr_nb libamr_wb; then
  1403. die "libamr is nonfree and --enable-nonfree is not specified."
  1404. fi
  1405. check_deps $ARCH_EXT_LIST
  1406. test -z "$need_memalign" && need_memalign="$mmx"
  1407. #Darwin CC versions
  1408. if test $target_os = darwin; then
  1409. if $cc -v 2>&1 | grep -q xlc; then
  1410. add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
  1411. else
  1412. add_cflags "-pipe"
  1413. check_cflags "-force_cpusubtype_ALL"
  1414. check_cflags "-Wno-sign-compare"
  1415. enabled shared || check_cflags -mdynamic-no-pic
  1416. fi
  1417. fi
  1418. disabled optimizations || check_cflags -fomit-frame-pointer
  1419. # Add processor-specific flags
  1420. if test $cpu != "generic"; then
  1421. warn_altivec(){
  1422. $1 altivec && echo "WARNING: Tuning for $2 but AltiVec $1.";
  1423. }
  1424. case $cpu in
  1425. 601|ppc601|PowerPC601)
  1426. add_cflags "-mcpu=601"
  1427. warn_altivec enabled PPC601
  1428. ;;
  1429. 603*|ppc603*|PowerPC603*)
  1430. add_cflags "-mcpu=603"
  1431. warn_altivec enabled PPC603
  1432. ;;
  1433. 604*|ppc604*|PowerPC604*)
  1434. add_cflags "-mcpu=604"
  1435. warn_altivec enabled PPC604
  1436. ;;
  1437. G3|g3|75*|ppc75*|PowerPC75*)
  1438. add_cflags "-mcpu=750 -mpowerpc-gfxopt"
  1439. warn_altivec enabled PPC75x
  1440. ;;
  1441. G4|g4|745*|ppc745*|PowerPC745*)
  1442. add_cflags "-mcpu=7450 -mpowerpc-gfxopt"
  1443. warn_altivec disabled PPC745x
  1444. ;;
  1445. 74*|ppc74*|PowerPC74*)
  1446. add_cflags "-mcpu=7400 -mpowerpc-gfxopt"
  1447. warn_altivec disabled PPC74xx
  1448. ;;
  1449. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  1450. add_cflags "-mcpu=970 -mpowerpc-gfxopt -mpowerpc64"
  1451. warn_altivec disabled PPC970
  1452. enable ppc64
  1453. ;;
  1454. Cell|CELL|cell)
  1455. add_cflags "-mcpu=cell"
  1456. warn_altivec disabled Cell
  1457. enable ppc64
  1458. ;;
  1459. # targets that do NOT support conditional mov (cmov)
  1460. i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3)
  1461. add_cflags "-march=$cpu"
  1462. disable cmov
  1463. ;;
  1464. # targets that do support conditional mov (cmov)
  1465. i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2)
  1466. add_cflags "-march=$cpu"
  1467. enable cmov
  1468. enable fast_cmov
  1469. ;;
  1470. # targets that do support conditional mov but on which it's slow
  1471. pentium4|pentium4m|prescott|nocona)
  1472. add_cflags "-march=$cpu"
  1473. enable cmov
  1474. disable fast_cmov
  1475. ;;
  1476. sparc64)
  1477. add_cflags "-mcpu=v9"
  1478. ;;
  1479. arm11*|cortex*)
  1480. add_cflags "-mcpu=$cpu"
  1481. enable fast_unaligned
  1482. ;;
  1483. armv*)
  1484. add_cflags "-march=$cpu"
  1485. ;;
  1486. arm*)
  1487. add_cflags "-mcpu=$cpu"
  1488. ;;
  1489. *)
  1490. echo "WARNING: Unknown CPU \"$cpu\", ignored."
  1491. ;;
  1492. esac
  1493. fi
  1494. # make sure we can execute files in $TMPDIR
  1495. cat > $TMPSH 2>> $logfile <<EOF
  1496. #! /bin/sh
  1497. EOF
  1498. chmod +x $TMPSH >> $logfile 2>&1
  1499. if ! $TMPSH >> $logfile 2>&1; then
  1500. cat <<EOF
  1501. Unable to create and execute files in $TMPDIR1. Set the TMPDIR environment
  1502. variable to another directory and make sure that $TMPDIR1 is not mounted
  1503. noexec.
  1504. EOF
  1505. die "Sanity test failed."
  1506. fi
  1507. rm $TMPSH
  1508. # compiler sanity check
  1509. check_exec <<EOF
  1510. int main(void){ return 0; }
  1511. EOF
  1512. if test "$?" != 0; then
  1513. echo "$cc is unable to create an executable file."
  1514. if test -z "$cross_prefix" && ! enabled cross_compile ; then
  1515. echo "If $cc is a cross-compiler, use the --enable-cross-compile option."
  1516. echo "Only do this if you know what cross compiling means."
  1517. fi
  1518. die "C compiler test failed."
  1519. fi
  1520. check_cc <<EOF || die "Symbol mangling check failed."
  1521. int ff_extern;
  1522. EOF
  1523. sym=$($nm -P -g $TMPO | grep ff_extern)
  1524. extern_prefix=${sym%%ff_extern*}
  1525. check_asm inline_asm '""'
  1526. if enabled x86; then
  1527. # check whether EBP is available on x86
  1528. # As 'i' is stored on the stack, this program will crash
  1529. # if the base pointer is used to access it because the
  1530. # base pointer is cleared in the inline assembly code.
  1531. check_exec_crash <<EOF && enable ebp_available
  1532. volatile int i=0;
  1533. __asm__ volatile (
  1534. "xorl %%ebp, %%ebp"
  1535. ::: "%ebp");
  1536. return i;
  1537. EOF
  1538. # check wether EBX is available on x86
  1539. check_asm ebx_available '"":::"%ebx"'
  1540. # check whether binutils is new enough to compile SSSE3/MMX2
  1541. enabled ssse3 && check_asm ssse3 '"pabsw %xmm0, %xmm0"'
  1542. enabled mmx2 && check_asm mmx2 '"movss %xmm0, %xmm0"'
  1543. check_asm bswap '"bswap %%eax" ::: "%eax"'
  1544. YASMFLAGS="-f $objformat -DARCH_$(toupper $arch)"
  1545. enabled x86_64 && append YASMFLAGS "-m amd64"
  1546. enabled_all x86_64 shared && append YASMFLAGS "-DPIC"
  1547. case "$objformat" in
  1548. elf) enabled debug && append YASMFLAGS "-g dwarf2" ;;
  1549. macho64) append YASMFLAGS "-DPIC -DPREFIX" ;;
  1550. *) append YASMFLAGS "-DPREFIX" ;;
  1551. esac
  1552. check_yasm "pabsw xmm0, xmm0" && enable yasm
  1553. fi
  1554. # check for assembler specific support
  1555. if test $arch = "powerpc"; then
  1556. check_asm dcbzl '"dcbzl 0, 1"'
  1557. fi
  1558. # check for SIMD availability
  1559. # AltiVec flags: The FSF version of GCC differs from the Apple version
  1560. if enabled altivec; then
  1561. check_cflags -maltivec -mabi=altivec &&
  1562. { check_header altivec.h && inc_altivec_h="#include <altivec.h>" ; } ||
  1563. check_cflags -faltivec
  1564. # check if our compiler supports Motorola AltiVec C API
  1565. check_cc <<EOF || disable altivec
  1566. $inc_altivec_h
  1567. int main(void) {
  1568. vector signed int v1, v2, v3;
  1569. v1 = vec_add(v2,v3);
  1570. return 0;
  1571. }
  1572. EOF
  1573. # check if our compiler supports braces for vector declarations
  1574. check_cc <<EOF || die "You need a compiler that supports {} in AltiVec vector declarations."
  1575. $inc_altivec_h
  1576. int main (void) { (vector int) {1}; return 0; }
  1577. EOF
  1578. fi
  1579. # We have to check if pld is a nop and disable it.
  1580. enabled armv4l && check_asm pld '"pld [r0]"'
  1581. enabled armv5te && check_asm armv5te '"qadd r0, r0, r0"'
  1582. enabled armv6 && check_asm armv6 '"sadd16 r0, r0, r0"'
  1583. enabled armvfp && check_asm armvfp '"fadds s0, s0, s0"'
  1584. enabled iwmmxt && check_asm iwmmxt '"wunpckelub wr6, wr4"'
  1585. enabled mmi && check_asm mmi '"lq $2, 0($2)"'
  1586. enabled neon && check_asm neon '"vadd.i16 q0, q0, q0"'
  1587. enabled vis && check_asm vis '"pdist %f0, %f0, %f0"' -mcpu=ultrasparc
  1588. enabled vis && add_cflags "-mcpu=ultrasparc -mtune=ultrasparc"
  1589. # ---
  1590. # big/little-endian test
  1591. check_cc <<EOF || die "endian test failed"
  1592. unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  1593. EOF
  1594. od -A n -t x1 $TMPO | grep -q '42 *49 *47 *45' && enable bigendian
  1595. # ---
  1596. # check availability of some header files
  1597. if check_func dlopen; then
  1598. ldl=
  1599. elif check_func dlopen -ldl; then
  1600. ldl=-ldl
  1601. fi
  1602. check_func fork
  1603. check_func gethrtime
  1604. check_func getrusage
  1605. check_func inet_aton $network_extralibs
  1606. check_func memalign
  1607. check_func mkstemp
  1608. check_func_headers windows.h GetProcessTimes
  1609. check_header conio.h
  1610. check_header dlfcn.h
  1611. check_header malloc.h
  1612. check_header poll.h
  1613. check_header sys/mman.h
  1614. check_header sys/resource.h
  1615. check_header sys/select.h
  1616. check_header termios.h
  1617. if ! enabled_any memalign memalign_hack && enabled need_memalign ; then
  1618. die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
  1619. fi
  1620. disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib
  1621. disabled bzlib || check_lib bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib
  1622. # check for some common methods of building with pthread support
  1623. # do this before the optional library checks as some of them require pthreads
  1624. if enabled pthreads; then
  1625. if check_func pthread_create; then
  1626. :
  1627. elif check_func pthread_create -pthread; then
  1628. add_cflags -pthread
  1629. add_extralibs -pthread
  1630. elif check_func pthread_create -pthreads; then
  1631. add_cflags -pthreads
  1632. add_extralibs -pthreads
  1633. elif check_func pthread_create -lpthreadGC2; then
  1634. add_extralibs -lpthreadGC2
  1635. elif ! check_lib pthread.h pthread_create -lpthread; then
  1636. die "ERROR: can't find pthreads library"
  1637. fi
  1638. fi
  1639. for thread in $THREADS_LIST; do
  1640. if enabled $thread; then
  1641. test -n "$thread_type" &&
  1642. die "ERROR: Only one thread type must be selected." ||
  1643. thread_type="$thread"
  1644. fi
  1645. done
  1646. check_lib math.h sin -lm
  1647. # test for C99 functions in math.h
  1648. for func in llrint lrint lrintf round roundf; do
  1649. check_exec <<EOF && enable $func || disable $func
  1650. #include <math.h>
  1651. int main(void) { return ($func(3.999f) > 0)?0:1; }
  1652. EOF
  1653. done
  1654. # these are off by default, so fail if requested and not available
  1655. enabled avisynth && require2 vfw32 "windows.h vfw.h" AVIFileInit -lvfw32
  1656. enabled libamr_nb && require libamrnb amrnb/interf_dec.h Speech_Decode_Frame_init -lamrnb -lm
  1657. enabled libamr_wb && require libamrwb amrwb/dec_if.h D_IF_init -lamrwb -lm
  1658. enabled libdirac && add_cflags $(pkg-config --cflags dirac) &&
  1659. require libdirac libdirac_decoder/dirac_parser.h dirac_decoder_init -ldirac_decoder &&
  1660. require libdirac libdirac_encoder/dirac_encoder.h dirac_encoder_init -ldirac_encoder
  1661. enabled libfaac && require2 libfaac "stdint.h faac.h" faacEncGetVersion -lfaac
  1662. enabled libfaad && require2 libfaad faad.h faacDecOpen -lfaad
  1663. enabled libgsm && require libgsm gsm.h gsm_create -lgsm
  1664. enabled libmp3lame && require libmp3lame lame/lame.h lame_init -lmp3lame -lm
  1665. enabled libnut && require libnut libnut.h nut_demuxer_init -lnut
  1666. enabled libschroedinger && add_cflags $(pkg-config --cflags schroedinger-1.0) &&
  1667. require libschroedinger schroedinger/schro.h schro_init $(pkg-config --libs schroedinger-1.0)
  1668. enabled libspeex && require libspeex speex/speex.h speex_decoder_init -lspeex
  1669. enabled libtheora && require libtheora theora/theora.h theora_info_init -ltheora -logg
  1670. enabled libvorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbisenc -lvorbis -logg
  1671. enabled libx264 && require libx264 x264.h x264_encoder_open -lx264 -lm &&
  1672. { check_cpp_condition x264.h "X264_BUILD >= 65" ||
  1673. die "ERROR: libx264 version must be >= 0.65."; }
  1674. enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore
  1675. enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
  1676. # libdc1394 check
  1677. if enabled libdc1394; then
  1678. { check_lib dc1394/dc1394.h dc1394_new -ldc1394 -lraw1394 &&
  1679. enable libdc1394_2; } ||
  1680. { check_lib libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394 &&
  1681. enable libdc1394_1; } ||
  1682. die "ERROR: No version of libdc1394 found "
  1683. fi
  1684. _restrict=
  1685. for restrict_keyword in restrict __restrict__ __restrict; do
  1686. check_cc <<EOF && _restrict=$restrict_keyword && break
  1687. void foo(char * $restrict_keyword p);
  1688. EOF
  1689. done
  1690. test "$vhook" = "default" && vhook="$dlopen"
  1691. if test "$target_os" = cygwin -o "$target_os" = mingw32 && enabled_all static vhook ; then
  1692. disable vhook
  1693. echo
  1694. echo "At the moment vhooks don't work on Cygwin or MinGW static builds."
  1695. echo "Patches welcome."
  1696. echo
  1697. fi
  1698. if enabled vhook; then
  1699. check_ldflags -rdynamic
  1700. check_ldflags -export-dynamic
  1701. fi
  1702. check_foo_config imlib2 imlib2 Imlib2.h imlib_load_font
  1703. check_foo_config freetype2 freetype ft2build.h FT_Init_FreeType
  1704. ##########################################
  1705. # SDL check
  1706. disable sdl_too_old
  1707. disable sdl
  1708. SDL_CONFIG="${cross_prefix}sdl-config"
  1709. if "${SDL_CONFIG}" --version > /dev/null 2>&1; then
  1710. sdl_cflags=`"${SDL_CONFIG}" --cflags`
  1711. temp_cflags $sdl_cflags
  1712. temp_extralibs `"${SDL_CONFIG}" --libs`
  1713. if check_lib2 SDL.h SDL_Init; then
  1714. _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
  1715. if test "$_sdlversion" -lt 121 ; then
  1716. enable sdl_too_old
  1717. else
  1718. enable sdl
  1719. check_cc $sdl_cflags <<EOF && enable sdl_video_size
  1720. #include <SDL.h>
  1721. int main(int argc, char **argv){
  1722. const SDL_VideoInfo *vi = SDL_GetVideoInfo();
  1723. int w = vi->current_w;
  1724. return 0;
  1725. }
  1726. EOF
  1727. fi
  1728. fi
  1729. restore_flags
  1730. fi
  1731. texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html
  1732. ##########################################
  1733. # Network check
  1734. if enabled network; then
  1735. check_type sys/socket.h socklen_t
  1736. # Prefer arpa/inet.h over winsock2
  1737. if check_header arpa/inet.h ; then
  1738. check_func closesocket
  1739. elif check_header winsock2.h ; then
  1740. network_extralibs="-lws2_32"
  1741. check_type ws2tcpip.h socklen_t
  1742. check_func_headers winsock2.h closesocket
  1743. fi
  1744. fi
  1745. ##########################################
  1746. # IPv6 check
  1747. enabled network && enabled ipv6 && check_ld <<EOF && enable ipv6 || disable ipv6
  1748. #include <sys/types.h>
  1749. #include <sys/socket.h>
  1750. #include <netinet/in.h>
  1751. #include <netdb.h>
  1752. int main(void) {
  1753. struct sockaddr_storage saddr;
  1754. struct ipv6_mreq mreq6;
  1755. getaddrinfo(0,0,0,0);
  1756. getnameinfo(0,0,0,0,0,0,0);
  1757. IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
  1758. }
  1759. EOF
  1760. check_header linux/videodev.h
  1761. check_header linux/videodev2.h
  1762. check_header sys/videoio.h
  1763. check_func_headers "windows.h vfw.h" capCreateCaptureWindow -lvfw32
  1764. # check for ioctl_meteor.h, ioctl_bt848.h and alternatives
  1765. { check_header dev/bktr/ioctl_meteor.h &&
  1766. check_header dev/bktr/ioctl_bt848.h; } ||
  1767. { check_header machine/ioctl_meteor.h &&
  1768. check_header machine/ioctl_bt848.h; } ||
  1769. { check_header dev/video/meteor/ioctl_meteor.h &&
  1770. check_header dev/video/bktr/ioctl_bt848.h; } ||
  1771. check_header dev/ic/bt8xx.h
  1772. check_header sys/soundcard.h
  1773. check_header soundcard.h
  1774. # deal with the X11 frame grabber
  1775. enabled x11grab &&
  1776. check_header X11/Xlib.h &&
  1777. check_header X11/extensions/XShm.h &&
  1778. check_func XOpenDisplay -lX11 &&
  1779. check_func XShmCreateImage -lX11 -lXext
  1780. enabled debug && add_cflags -g"$debuglevel"
  1781. # add some useful compiler flags if supported
  1782. check_cflags -Wdeclaration-after-statement
  1783. check_cflags -Wall
  1784. check_cflags -Wno-switch
  1785. check_cflags -Wdisabled-optimization
  1786. check_cflags -Wpointer-arith
  1787. check_cflags -Wredundant-decls
  1788. check_cflags -Wno-pointer-sign
  1789. check_cflags -Wcast-qual
  1790. check_cflags -Wwrite-strings
  1791. check_cflags -Wtype-limits
  1792. enabled extra_warnings && check_cflags -Winline
  1793. # add some linker flags
  1794. check_ldflags -Wl,--warn-common
  1795. check_ldflags -Wl,--as-needed
  1796. check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
  1797. check_ldflags -Wl,-Bsymbolic
  1798. if enabled small; then
  1799. check_cflags -Os # not all compilers support -Os
  1800. optimizations="small"
  1801. elif enabled optimizations; then
  1802. if $cc -v 2>&1 | grep -q xlc; then
  1803. add_cflags "-O5"
  1804. add_ldflags "-O5"
  1805. else
  1806. add_cflags "-O3"
  1807. fi
  1808. fi
  1809. check_cflags -fno-math-errno
  1810. check_cflags -fno-signed-zeros
  1811. # add some flags for Intel C Compiler
  1812. if $cc --version 2> /dev/null | grep -q Intel; then
  1813. # Just warnings, no remarks
  1814. check_cflags -w1
  1815. # -wd: Disable following warnings
  1816. # 144, 167, 556: -Wno-pointer-sign
  1817. # 10006: ignoring unknown option -fno-signed-zeros
  1818. # 10156: ignoring option '-W'; no argument required
  1819. check_cflags -wd144,167,556,10006,10156
  1820. # 11030: Warning unknown option --as-needed
  1821. # 10156: ignoring option '-export'; no argument required
  1822. check_ldflags -wd10156,11030
  1823. # Allow to compile with optimizations
  1824. check_ldflags -march=$cpu
  1825. fi
  1826. # PIC flags for shared library objects where they are needed
  1827. if enabled shared; then
  1828. # LIBOBJFLAGS may have already been set in the OS configuration
  1829. if test -z "$LIBOBJFLAGS" ; then
  1830. case "$arch" in
  1831. x86_64|ia64|alpha|sparc*|power*|parisc*|mips*) LIBOBJFLAGS='$(PIC)' ;;
  1832. esac
  1833. fi
  1834. fi
  1835. if enabled gprof; then
  1836. add_cflags "-p"
  1837. add_ldflags "-p"
  1838. fi
  1839. VHOOKCFLAGS="-fPIC"
  1840. # Find out if the .align argument is a power of two or not.
  1841. if test $asmalign_pot = "unknown"; then
  1842. disable asmalign_pot
  1843. echo '__asm__ (".align 3");' | check_cc && enable asmalign_pot
  1844. fi
  1845. enabled_any $DECODER_LIST && enable decoders
  1846. enabled_any $ENCODER_LIST && enable encoders
  1847. enabled_any $BSF_LIST && enable bsfs
  1848. enabled_any $DEMUXER_LIST && enable demuxers
  1849. enabled_any $MUXER_LIST && enable muxers
  1850. enabled_any $FILTER_LIST && enable filters
  1851. enabled_any $INDEV_LIST && enable demuxers
  1852. enabled_any $OUTDEV_LIST && enable muxers
  1853. enabled_any $PROTOCOL_LIST && enable protocols
  1854. enabled_any $THREADS_LIST && enable threads
  1855. check_deps $CONFIG_LIST \
  1856. $CONFIG_EXTRA \
  1857. $HAVE_LIST \
  1858. $DECODER_LIST \
  1859. $ENCODER_LIST \
  1860. $PARSER_LIST \
  1861. $BSF_LIST \
  1862. $DEMUXER_LIST \
  1863. $MUXER_LIST \
  1864. $FILTER_LIST \
  1865. $INDEV_LIST \
  1866. $OUTDEV_LIST \
  1867. $PROTOCOL_LIST \
  1868. enabled libdc1394 && append pkg_requires "libraw1394"
  1869. enabled libdirac && append pkg_requires "dirac"
  1870. enabled libtheora && append pkg_requires "theora"
  1871. enabled libvorbis && append pkg_requires "vorbisenc"
  1872. echo "install prefix $prefix"
  1873. echo "source path $source_path"
  1874. echo "C compiler $cc"
  1875. echo ".align is power-of-two $asmalign_pot"
  1876. echo "ARCH $arch ($cpu)"
  1877. if test "$build_suffix" != ""; then
  1878. echo "build suffix $build_suffix"
  1879. fi
  1880. if test "$extra_version" != ""; then
  1881. echo "version string suffix $extra_version"
  1882. fi
  1883. echo "big-endian ${bigendian-no}"
  1884. if test $arch = "x86_32" -o $arch = "x86_64"; then
  1885. echo "yasm ${yasm-no}"
  1886. echo "MMX enabled ${mmx-no}"
  1887. echo "CMOV enabled ${cmov-no}"
  1888. echo "CMOV is fast ${fast_cmov-no}"
  1889. echo "EBX available ${ebx_available-no}"
  1890. echo "EBP available ${ebp_available-no}"
  1891. fi
  1892. if test $arch = "armv4l"; then
  1893. echo "ARMv5TE enabled ${armv5te-no}"
  1894. echo "ARMv6 enabled ${armv6-no}"
  1895. echo "ARM VFP enabled ${armvfp-no}"
  1896. echo "IWMMXT enabled ${iwmmxt-no}"
  1897. echo "NEON enabled ${neon-no}"
  1898. fi
  1899. if test $arch = "mips"; then
  1900. echo "MMI enabled ${mmi-no}"
  1901. fi
  1902. if test $arch = "powerpc"; then
  1903. echo "AltiVec enabled ${altivec-no}"
  1904. echo "dcbzl available ${dcbzl-no}"
  1905. fi
  1906. echo "gprof enabled ${gprof-no}"
  1907. echo "debug symbols ${debug-no}"
  1908. echo "strip symbols ${stripping-no}"
  1909. echo "optimizations ${optimizations-no}"
  1910. echo "static ${static-no}"
  1911. echo "shared ${shared-no}"
  1912. echo "postprocessing support ${postproc-no}"
  1913. echo "software scaler enabled ${swscale-no}"
  1914. echo "new filter support ${avfilter-no}"
  1915. echo "filters using lavformat ${avfilter_lavf-no}"
  1916. echo "video hooking ${vhook-no}"
  1917. if enabled vhook; then
  1918. echo "Imlib2 support ${imlib2-no}"
  1919. echo "FreeType support ${freetype2-no}"
  1920. fi
  1921. echo "network support ${network-no}"
  1922. if enabled network; then
  1923. echo "IPv6 support ${ipv6-no}"
  1924. fi
  1925. echo "threading support ${thread_type-no}"
  1926. echo "SDL support ${sdl-no}"
  1927. if enabled sdl_too_old; then
  1928. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  1929. fi
  1930. echo "Sun medialib support ${mlib-no}"
  1931. echo "AVISynth enabled ${avisynth-no}"
  1932. echo "libamr-nb support ${libamr_nb-no}"
  1933. echo "libamr-wb support ${libamr_wb-no}"
  1934. echo "libdc1394 support ${libdc1394-no}"
  1935. echo "libdirac enabled ${libdirac-no}"
  1936. echo "libfaac enabled ${libfaac-no}"
  1937. echo "libfaad enabled ${libfaad-no}"
  1938. echo "libfaad dlopened ${libfaadbin-no}"
  1939. echo "libgsm enabled ${libgsm-no}"
  1940. echo "libmp3lame enabled ${libmp3lame-no}"
  1941. echo "libnut enabled ${libnut-no}"
  1942. echo "libschroedinger enabled ${libschroedinger-no}"
  1943. echo "libspeex enabled ${libspeex-no}"
  1944. echo "libtheora enabled ${libtheora-no}"
  1945. echo "libvorbis enabled ${libvorbis-no}"
  1946. echo "libx264 enabled ${libx264-no}"
  1947. echo "libxvid enabled ${libxvid-no}"
  1948. echo "zlib enabled ${zlib-no}"
  1949. echo "bzlib enabled ${bzlib-no}"
  1950. echo
  1951. for type in decoder encoder parser demuxer muxer protocol filter bsf indev outdev; do
  1952. echo "Enabled ${type}s:"
  1953. eval list=\$$(toupper $type)_LIST
  1954. for part in $list; do
  1955. enabled $part && echo ${part%_*}
  1956. done | sort | pr -3 -t
  1957. echo
  1958. done
  1959. license="LGPL"
  1960. if enabled nonfree; then
  1961. license="unredistributable"
  1962. elif enabled gpl; then
  1963. license="GPL"
  1964. fi
  1965. echo "License: $license"
  1966. echo "Creating config.mak and config.h..."
  1967. echo "# Automatically generated by configure - do not modify!" > config.mak
  1968. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  1969. echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH
  1970. echo "#define FFMPEG_CONFIG_H" >> $TMPH
  1971. echo "#define FFMPEG_CONFIGURATION \"$FFMPEG_CONFIGURATION\"" >> $TMPH
  1972. echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak
  1973. echo "prefix=$prefix" >> config.mak
  1974. echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
  1975. echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak
  1976. echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak
  1977. echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak
  1978. echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak
  1979. echo "CC=$cc" >> config.mak
  1980. echo "YASM=$yasmexe" >> config.mak
  1981. echo "AR=$ar" >> config.mak
  1982. echo "RANLIB=$ranlib" >> config.mak
  1983. echo "LN_S=$ln_s" >> config.mak
  1984. enabled stripping &&
  1985. echo "STRIP=$strip" >> config.mak ||
  1986. echo "STRIP=echo ignoring strip" >> config.mak
  1987. echo "OPTFLAGS=$CFLAGS" >> config.mak
  1988. echo "VHOOKCFLAGS=$VHOOKCFLAGS" >> config.mak
  1989. echo "LDFLAGS=$LDFLAGS" >> config.mak
  1990. echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
  1991. echo "SHFLAGS=$SHFLAGS" >> config.mak
  1992. echo "YASMFLAGS=$YASMFLAGS" >> config.mak
  1993. echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
  1994. echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
  1995. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  1996. echo "BUILD_STATIC=$static" >> config.mak
  1997. echo "BUILDSUF=$build_suffix" >> config.mak
  1998. echo "FULLNAME=$FULLNAME" >> config.mak
  1999. echo "LIBPREF=$LIBPREF" >> config.mak
  2000. echo "LIBSUF=$LIBSUF" >> config.mak
  2001. echo "LIBNAME=$LIBNAME" >> config.mak
  2002. echo "SLIBPREF=$SLIBPREF" >> config.mak
  2003. echo "SLIBSUF=$SLIBSUF" >> config.mak
  2004. echo "EXESUF=$EXESUF" >> config.mak
  2005. echo "EXTRA_VERSION=$extra_version" >> config.mak
  2006. echo "DEPEND_CMD=$DEPEND_CMD" >> config.mak
  2007. if enabled bigendian; then
  2008. echo "WORDS_BIGENDIAN=yes" >> config.mak
  2009. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  2010. fi
  2011. if enabled sdl; then
  2012. echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
  2013. echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
  2014. fi
  2015. if enabled texi2html; then
  2016. echo "BUILD_DOC=yes" >> config.mak
  2017. fi
  2018. get_version(){
  2019. name=$1
  2020. file=$source_path/$2
  2021. eval $(grep "#define ${name}_VERSION_M" "$file" | awk '{ print $2"="$3 }')
  2022. eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO
  2023. lcname=$(tolower $name)
  2024. eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak
  2025. eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak
  2026. }
  2027. get_version LIBSWSCALE libswscale/swscale.h
  2028. get_version LIBPOSTPROC libpostproc/postprocess.h
  2029. get_version LIBAVCODEC libavcodec/avcodec.h
  2030. get_version LIBAVDEVICE libavdevice/avdevice.h
  2031. get_version LIBAVFORMAT libavformat/avformat.h
  2032. get_version LIBAVUTIL libavutil/avutil.h
  2033. get_version LIBAVFILTER libavfilter/avfilter.h
  2034. if enabled shared; then
  2035. echo "BUILD_SHARED=yes" >> config.mak
  2036. echo "PIC=-fPIC -DPIC" >> config.mak
  2037. echo "LIBTARGET=${LIBTARGET}" >> config.mak
  2038. echo "SLIBNAME=${SLIBNAME}" >> config.mak
  2039. echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
  2040. echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
  2041. echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak
  2042. echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
  2043. echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak
  2044. echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak
  2045. fi
  2046. echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
  2047. echo "EXTRALIBS=$extralibs" >> config.mak
  2048. print_config ARCH_ $TMPH config.mak $ARCH_LIST
  2049. print_config HAVE_ $TMPH config.mak $HAVE_LIST
  2050. print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \
  2051. $CONFIG_EXTRA \
  2052. $DECODER_LIST \
  2053. $ENCODER_LIST \
  2054. $PARSER_LIST \
  2055. $BSF_LIST \
  2056. $DEMUXER_LIST \
  2057. $MUXER_LIST \
  2058. $FILTER_LIST \
  2059. $PROTOCOL_LIST \
  2060. $INDEV_LIST \
  2061. $OUTDEV_LIST \
  2062. echo "#define restrict $_restrict" >> $TMPH
  2063. if enabled small; then
  2064. echo "#define av_always_inline" >> $TMPH
  2065. fi
  2066. echo "SRC_PATH=\"$source_path\"" >> config.mak
  2067. echo "SRC_PATH_BARE=$source_path" >> config.mak
  2068. echo "BUILD_ROOT=\"$PWD\"" >> config.mak
  2069. # Apparently it's not possible to portably echo a backslash.
  2070. enabled asmalign_pot &&
  2071. printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH ||
  2072. printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH
  2073. echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
  2074. echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
  2075. # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
  2076. cmp -s $TMPH config.h &&
  2077. echo "config.h is unchanged" ||
  2078. mv -f $TMPH config.h
  2079. rm -f $TMPC $TMPE $TMPH $TMPO $TMPS $TMPSH
  2080. # build tree in object directory if source path is different from current one
  2081. if enabled source_path_used; then
  2082. DIRS="\
  2083. doc \
  2084. libavcodec \
  2085. libavcodec/alpha \
  2086. libavcodec/armv4l \
  2087. libavcodec/bfin \
  2088. libavcodec/i386 \
  2089. libavcodec/mlib \
  2090. libavcodec/ppc \
  2091. libavcodec/sh4 \
  2092. libavcodec/sparc \
  2093. libavdevice \
  2094. libavfilter \
  2095. libavformat \
  2096. libavutil \
  2097. libpostproc \
  2098. libswscale \
  2099. tests \
  2100. tools \
  2101. vhook \
  2102. "
  2103. FILES="\
  2104. Makefile \
  2105. common.mak \
  2106. subdir.mak \
  2107. doc/texi2pod.pl \
  2108. libavcodec/Makefile \
  2109. libavdevice/Makefile \
  2110. libavfilter/Makefile \
  2111. libavformat/Makefile \
  2112. libavutil/Makefile \
  2113. libpostproc/Makefile \
  2114. libswscale/Makefile \
  2115. "
  2116. for dir in $DIRS ; do
  2117. mkdir -p $dir
  2118. done
  2119. for f in $FILES ; do
  2120. $ln_s "$source_path/$f" $f
  2121. done
  2122. fi
  2123. # build pkg-config files
  2124. pkgconfig_generate(){
  2125. name=$1
  2126. shortname=${name#lib}${build_suffix}
  2127. comment=$2
  2128. version=$3
  2129. libs=$4
  2130. requires=$5
  2131. cat <<EOF > $name/$name.pc
  2132. prefix=$prefix
  2133. exec_prefix=\${prefix}
  2134. libdir=$libdir
  2135. includedir=$incdir
  2136. Name: $name
  2137. Description: $comment
  2138. Version: $version
  2139. Requires: $(disabled shared && echo $requires)
  2140. Requires.private: $(enabled shared && echo $requires)
  2141. Conflicts:
  2142. Libs: -L\${libdir} -l${shortname} $(disabled shared && echo $libs)
  2143. Libs.private: $(enabled shared && echo $libs)
  2144. Cflags: -I\${includedir}
  2145. EOF
  2146. cat <<EOF > $name/$name-uninstalled.pc
  2147. prefix=
  2148. exec_prefix=
  2149. libdir=\${pcfiledir}
  2150. includedir=${source_path}
  2151. Name: $name
  2152. Description: $comment
  2153. Version: $version
  2154. Requires: $requires
  2155. Conflicts:
  2156. Libs: \${libdir}/${LIBPREF}${shortname}${LIBSUF} $libs
  2157. Cflags: -I\${includedir}
  2158. EOF
  2159. }
  2160. pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION"
  2161. pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "$pkg_requires libavutil = $LIBAVUTIL_VERSION"
  2162. pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "$pkg_requires libavcodec = $LIBAVCODEC_VERSION"
  2163. pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$pkg_requires libavformat = $LIBAVFORMAT_VERSION"
  2164. enabled avfilter &&
  2165. pkgconfig_generate libavfilter "FFmpeg video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$pkg_requires libavutil = $LIBAVUTIL_VERSION"
  2166. enabled postproc &&
  2167. pkgconfig_generate libpostproc "FFmpeg post processing library" "$LIBPOSTPROC_VERSION"
  2168. if enabled swscale; then
  2169. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "libavutil = $LIBAVUTIL_VERSION"
  2170. else
  2171. pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "" "$pkg_requires libavcodec = $LIBAVCODEC_VERSION"
  2172. apply libswscale/libswscale.pc sed s/^Libs:.*$/Libs:/
  2173. fi