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.

2395 lines
62KB

  1. #!/bin/sh
  2. #
  3. # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
  4. #
  5. # make sure we are running under a compatible shell
  6. unset foo
  7. (: ${foo%%bar}) 2>/dev/null && ! (: ${foo?}) 2>/dev/null
  8. if test "$?" != 0; then
  9. if test "x$FFMPEG_CONFIGURE_EXEC" = x; then
  10. FFMPEG_CONFIGURE_EXEC=1
  11. export FFMPEG_CONFIGURE_EXEC
  12. exec bash "$0" "$@"
  13. exec ksh "$0" "$@"
  14. exec /usr/xpg4/bin/sh "$0" "$@"
  15. fi
  16. echo "No compatible shell script interpreter found."
  17. exit 1
  18. fi
  19. show_help(){
  20. echo "Usage: configure [options]"
  21. echo "Options: [defaults in brackets after descriptions]"
  22. echo
  23. echo "Standard options:"
  24. echo " --help print this message"
  25. echo " --log[=FILE|yes|no] log tests and output to FILE [config.err]"
  26. echo " --prefix=PREFIX install in PREFIX [$PREFIX]"
  27. echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
  28. echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]"
  29. echo " --incdir=DIR install includes in DIR [PREFIX/include/ffmpeg]"
  30. echo " --mandir=DIR install man page in DIR [PREFIX/man]"
  31. echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]"
  32. echo " --enable-libogg enable Ogg support via libogg [default=no]"
  33. echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]"
  34. echo " --enable-faad enable FAAD support via libfaad [default=no]"
  35. echo " --enable-faadbin build FAAD support with runtime linking [default=no]"
  36. echo " --enable-faac enable FAAC support via libfaac [default=no]"
  37. echo " --enable-libgsm enable GSM support via libgsm [default=no]"
  38. echo " --enable-xvid enable XviD support via xvidcore [default=no]"
  39. echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
  40. echo " --enable-mingw32 enable MinGW native/cross Windows compile"
  41. echo " --enable-mingwce enable MinGW native/cross WinCE compile"
  42. echo " --enable-a52 enable GPLed A52 support [default=no]"
  43. echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
  44. echo " --enable-dts enable GPLed DTS support [default=no]"
  45. echo " --enable-pp enable GPLed postprocessing support [default=no]"
  46. echo " --enable-static build static libraries [default=yes]"
  47. echo " --disable-static do not build static libraries [default=no]"
  48. echo " --enable-shared build shared libraries [default=no]"
  49. echo " --disable-shared do not build shared libraries [default=yes]"
  50. echo " --enable-amr_nb enable amr_nb float audio codec"
  51. echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
  52. echo " --enable-amr_wb enable amr_wb float audio codec"
  53. echo " --enable-amr_if2 enable amr_wb IF2 audio codec"
  54. echo " --enable-sunmlib use Sun medialib [default=no]"
  55. echo " --enable-pthreads use pthreads [default=no]"
  56. echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
  57. echo " and libraw1394 [default=no]"
  58. echo " --enable-swscaler software scaler support [default=no]"
  59. echo " --enable-avisynth allow reading AVISynth script files [default=no]"
  60. echo " --enable-gpl allow use of GPL code, the resulting libav*"
  61. echo " and ffmpeg will be under GPL [default=no]"
  62. echo ""
  63. echo "Advanced options (experts only):"
  64. echo " --source-path=PATH path to source code [$source_path]"
  65. echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
  66. echo " --cross-compile assume a cross-compiler is used"
  67. echo " --cc=CC use C compiler CC [$cc]"
  68. echo " --make=MAKE use specified make [$make]"
  69. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  70. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  71. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  72. echo " --build-suffix=SUFFIX suffix for application specific build []"
  73. echo " --cpu=CPU force cpu to CPU [$cpu]"
  74. echo " --tune=CPU tune code for a particular CPU"
  75. echo " (may fail or perform badly on other CPUs)"
  76. echo " --powerpc-perf-enable enable performance report on PPC"
  77. echo " (requires enabling PMC)"
  78. echo " --disable-mmx disable MMX usage"
  79. echo " --disable-armv5te disable armv5te usage"
  80. echo " --disable-iwmmxt disable iwmmxt usage"
  81. echo " --disable-altivec disable AltiVec usage"
  82. echo " --disable-audio-oss disable OSS audio support [default=no]"
  83. echo " --disable-audio-beos disable BeOS audio support [default=no]"
  84. echo " --disable-v4l disable video4linux grabbing [default=no]"
  85. echo " --disable-v4l2 disable video4linux2 grabbing [default=no]"
  86. echo " --disable-bktr disable bktr video grabbing [default=no]"
  87. echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
  88. echo " --disable-network disable network support [default=no]"
  89. echo " --disable-ipv6 disable ipv6 support [default=no]"
  90. echo " --disable-zlib disable zlib [default=no]"
  91. echo " --disable-simple_idct disable simple IDCT routines [default=no]"
  92. echo " --disable-vhook disable video hooking support"
  93. echo " --enable-gprof enable profiling with gprof [$gprof]"
  94. echo " --disable-debug disable debugging symbols"
  95. echo " --disable-opts disable compiler optimizations"
  96. echo " --disable-mpegaudio-hp faster (but less accurate)"
  97. echo " MPEG audio decoding [default=no]"
  98. echo " --disable-protocols disable I/O protocols support [default=no]"
  99. echo " --disable-ffserver disable ffserver build"
  100. echo " --disable-ffplay disable ffplay build"
  101. echo " --enable-small optimize for size instead of speed"
  102. echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
  103. echo " --disable-strip disable stripping of executables and shared libraries"
  104. echo " --disable-encoder=NAME disables encoder NAME"
  105. echo " --enable-encoder=NAME enables encoder NAME"
  106. echo " --disable-decoder=NAME disables decoder NAME"
  107. echo " --enable-decoder=NAME enables decoder NAME"
  108. echo " --disable-encoders disables all encoders"
  109. echo " --disable-decoders disables all decoders"
  110. echo " --disable-muxer=NAME disables muxer NAME"
  111. echo " --enable-muxer=NAME enables muxer NAME"
  112. echo " --disable-muxers disables all muxers"
  113. echo " --disable-demuxer=NAME disables demuxer NAME"
  114. echo " --enable-demuxer=NAME enables demuxer NAME"
  115. echo " --disable-demuxers disables all demuxers"
  116. echo " --enable-parser=NAME enables parser NAME"
  117. echo " --disable-parser=NAME disables parser NAME"
  118. echo " --disable-parsers disables all parsers"
  119. echo ""
  120. echo "NOTE: Object files are built at the place where configure is launched."
  121. exit 1
  122. }
  123. log(){
  124. echo "$@" >>$logfile
  125. }
  126. log_file(){
  127. log BEGIN $1
  128. cat -n $1 >>$logfile
  129. log END $1
  130. }
  131. echolog(){
  132. log "$@"
  133. echo "$@"
  134. }
  135. die(){
  136. echolog "$@"
  137. cat <<EOF
  138. If you think configure made a mistake, make sure you are using the latest
  139. version from SVN. If the latest version fails, report the problem to the
  140. ffmpeg-devel@mplayerhq.hu mailing list or IRC #ffmpeg on irc.freenode.net.
  141. EOF
  142. if enabled logging; then
  143. cat <<EOF
  144. Include the log file "$logfile" produced by configure as this will help
  145. solving the problem.
  146. EOF
  147. else
  148. cat <<EOF
  149. Rerun configure with logging enabled (do not use --log=no), and include the
  150. log this produces with your report.
  151. EOF
  152. fi
  153. rm -f $TMPC $TMPO $TMPE $TMPS $TMPH
  154. exit 1
  155. }
  156. enabled(){
  157. eval test "\$$1" = "yes"
  158. }
  159. flags_saved(){
  160. (: ${SAVE_CFLAGS?}) 2>/dev/null
  161. }
  162. save_flags(){
  163. flags_saved && return
  164. SAVE_CFLAGS="$CFLAGS"
  165. SAVE_LDFLAGS="$LDFLAGS"
  166. SAVE_extralibs="$extralibs"
  167. }
  168. restore_flags(){
  169. CFLAGS="$SAVE_CFLAGS"
  170. LDFLAGS="$SAVE_LDFLAGS"
  171. extralibs="$SAVE_extralibs"
  172. unset SAVE_CFLAGS
  173. unset SAVE_LDFLAGS
  174. unset SAVE_extralibs
  175. }
  176. temp_cflags(){
  177. save_flags
  178. CFLAGS="$CFLAGS $*"
  179. }
  180. temp_ldflags(){
  181. save_flags
  182. LDFLAGS="$LDFLAGS $*"
  183. }
  184. temp_extralibs(){
  185. save_flags
  186. extralibs="$extralibs $*"
  187. }
  188. append(){
  189. var=$1
  190. shift
  191. flags_saved && eval "SAVE_$var=\"\$SAVE_$var $*\""
  192. eval "$var=\"\$$var $*\""
  193. }
  194. add_cflags(){
  195. append CFLAGS "$@"
  196. }
  197. add_ldflags(){
  198. append LDFLAGS "$@"
  199. }
  200. add_extralibs(){
  201. append extralibs "$@"
  202. }
  203. check_cmd(){
  204. log "$@"
  205. "$@" >>$logfile 2>&1
  206. }
  207. check_cc(){
  208. log check_cc "$@"
  209. cat >$TMPC
  210. log_file $TMPC
  211. check_cmd $cc $CFLAGS "$@" -c -o $TMPO $TMPC
  212. }
  213. check_cpp(){
  214. log check_cpp "$@"
  215. cat >$TMPC
  216. log_file $TMPC
  217. check_cmd $cc $CFLAGS "$@" -E -o $TMPO $TMPC
  218. }
  219. check_ld(){
  220. log check_ld "$@"
  221. check_cc || return
  222. check_cmd $cc $LDFLAGS "$@" -o $TMPE $TMPO $extralibs
  223. }
  224. check_cflags(){
  225. log check_cflags "$@"
  226. check_cc "$@" <<EOF && add_cflags "$@"
  227. int x;
  228. EOF
  229. }
  230. check_ldflags(){
  231. log check_ldflags "$@"
  232. check_ld "$@" <<EOF && add_ldflags "$@"
  233. int main(){
  234. return 0;
  235. }
  236. EOF
  237. }
  238. check_header(){
  239. log check_header "$@"
  240. header=$1
  241. shift
  242. check_cpp "$@" <<EOF
  243. #include <$header>
  244. int x;
  245. EOF
  246. }
  247. check_func(){
  248. log check_func "$@"
  249. func=$1
  250. shift
  251. check_ld "$@" <<EOF
  252. extern int $func();
  253. int main(){
  254. $func();
  255. }
  256. EOF
  257. }
  258. check_lib(){
  259. log check_lib "$@"
  260. header="$1"
  261. func="$2"
  262. shift 2
  263. temp_extralibs "$@"
  264. check_header $header && check_func $func && add_extralibs "$@"
  265. err=$?
  266. restore_flags
  267. return $err
  268. }
  269. check_exec(){
  270. check_ld "$@" && { test "$cross_compile" = yes || $TMPE >>$logfile 2>&1; }
  271. }
  272. require(){
  273. name="$1"
  274. header="$2"
  275. func="$3"
  276. shift 3
  277. check_lib $header $func "$@" || die "ERROR: $name not found"
  278. }
  279. filter_out(){
  280. pattern="$1"
  281. shift
  282. echo "$@" | sed "s%\\<$pattern\\>%%g"
  283. }
  284. # set temporary file name
  285. if test ! -z "$TMPDIR" ; then
  286. TMPDIR1="${TMPDIR}"
  287. elif test ! -z "$TEMPDIR" ; then
  288. TMPDIR1="${TEMPDIR}"
  289. else
  290. TMPDIR1="/tmp"
  291. fi
  292. TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
  293. TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
  294. TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
  295. TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
  296. TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
  297. # default parameters
  298. logging="yes"
  299. logfile="config.err"
  300. PREFIX="/usr/local"
  301. libdir='${PREFIX}/lib'
  302. shlibdir="$libdir"
  303. incdir='${PREFIX}/include/ffmpeg'
  304. mandir='${PREFIX}/man'
  305. bindir='${PREFIX}/bin'
  306. cross_prefix=""
  307. cross_compile="no"
  308. cc="gcc"
  309. ar="ar"
  310. ranlib="ranlib"
  311. make="make"
  312. strip="strip"
  313. cpu=`uname -m`
  314. tune="generic"
  315. powerpc_perf="no"
  316. mmx="default"
  317. armv5te="default"
  318. iwmmxt="default"
  319. altivec="default"
  320. dcbzl="no"
  321. mmi="default"
  322. case "$cpu" in
  323. i386|i486|i586|i686|i86pc|BePC)
  324. cpu="x86"
  325. ;;
  326. x86_64|amd64)
  327. cpu="x86"
  328. canon_arch="`$cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
  329. if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
  330. if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
  331. cpu="x86_64"
  332. fi
  333. fi
  334. ;;
  335. # armv4l is a subset of armv5tel
  336. arm|armv4l|armv5tel)
  337. cpu="armv4l"
  338. ;;
  339. alpha)
  340. cpu="alpha"
  341. ;;
  342. "Power Macintosh"|ppc|ppc64|powerpc)
  343. cpu="powerpc"
  344. ;;
  345. mips|mipsel|IP*)
  346. cpu="mips"
  347. ;;
  348. sun4u|sparc64)
  349. cpu="sparc64"
  350. ;;
  351. sparc)
  352. cpu="sparc"
  353. ;;
  354. sh4)
  355. cpu="sh4"
  356. ;;
  357. parisc|parisc64)
  358. cpu="parisc"
  359. ;;
  360. s390|s390x)
  361. cpu="s390"
  362. ;;
  363. m68k)
  364. cpu="m68k"
  365. ;;
  366. ia64)
  367. cpu="ia64"
  368. ;;
  369. bfin)
  370. cpu="bfin"
  371. ;;
  372. *)
  373. cpu="unknown"
  374. ;;
  375. esac
  376. gprof="no"
  377. v4l="yes"
  378. v4l2="yes"
  379. bktr="no"
  380. audio_oss="yes"
  381. audio_beos="no"
  382. dv1394="yes"
  383. dc1394="no"
  384. network="yes"
  385. ipv6="yes"
  386. zlib="yes"
  387. libgsm="no"
  388. mp3lame="no"
  389. libogg="no"
  390. vorbis="no"
  391. faad="no"
  392. faadbin="no"
  393. faac="no"
  394. xvid="no"
  395. x264="no"
  396. a52="no"
  397. a52bin="no"
  398. dts="no"
  399. pp="no"
  400. mingw32="no"
  401. mingwce="no"
  402. os2="no"
  403. lstatic="yes"
  404. lshared="no"
  405. optimize="yes"
  406. debug="yes"
  407. dostrip="yes"
  408. installstrip="-s"
  409. extralibs="-lm"
  410. simpleidct="yes"
  411. bigendian="no"
  412. inttypes="yes"
  413. emu_fast_int="no"
  414. vhook="default"
  415. avisynth="no"
  416. dlfcn="no"
  417. dlopen="no"
  418. mpegaudio_hp="yes"
  419. SHFLAGS='-shared -Wl,-soname,$@'
  420. VHOOKSHFLAGS='$(SHFLAGS)'
  421. netserver="no"
  422. need_inet_aton="no"
  423. protocols="yes"
  424. ffserver="yes"
  425. ffplay="yes"
  426. LIBOBJFLAGS=""
  427. FFLDFLAGS=-Wl,--warn-common
  428. FFSERVERLDFLAGS=-Wl,-E
  429. LDCONFIG="ldconfig"
  430. LIBPREF="lib"
  431. LIBSUF=".a"
  432. LIB='$(LIBPREF)$(NAME)$(LIBSUF)'
  433. SLIBPREF="lib"
  434. SLIBSUF=".so"
  435. SLIBNAME='$(SLIBPREF)$(NAME)$(SLIBSUF)'
  436. SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
  437. SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
  438. EXESUF=""
  439. BUILDSUF=""
  440. amr_nb="no"
  441. amr_wb="no"
  442. amr_nb_fixed="no"
  443. amr_if2="no"
  444. sunmlib="no"
  445. pthreads="no"
  446. swscaler="no"
  447. gpl="no"
  448. memalignhack="no"
  449. asmalign_pot="unknown"
  450. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
  451. # OS specific
  452. targetos=`uname -s`
  453. case $targetos in
  454. BeOS)
  455. PREFIX="/boot/home/config"
  456. # helps building libavcodec
  457. add_cflags "-DPIC -fomit-frame-pointer"
  458. # 3 gcc releases known for BeOS, each with ugly bugs
  459. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  460. case "$gcc_version" in
  461. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  462. mmx="no"
  463. ;;
  464. *20010315*) echo "BeBits gcc"
  465. add_cflags "-fno-expensive-optimizations"
  466. ;;
  467. esac
  468. SHFLAGS=-nostart
  469. # disable Linux things
  470. audio_oss="no"
  471. v4l="no"
  472. v4l2="no"
  473. dv1394="no"
  474. # enable BeOS things
  475. audio_beos="yes"
  476. # no need for libm, but the inet stuff
  477. # Check for BONE
  478. if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
  479. extralibs="-lbind -lsocket"
  480. else
  481. netserver="yes"
  482. need_inet_aton="yes"
  483. extralibs="-lnet"
  484. fi ;;
  485. SunOS)
  486. v4l="no"
  487. v4l2="no"
  488. audio_oss="no"
  489. dv1394="no"
  490. make="gmake"
  491. FFLDFLAGS=""
  492. FFSERVERLDFLAGS=""
  493. SHFLAGS="-shared -Wl,-h,\$@"
  494. need_inet_aton="yes"
  495. add_extralibs "-lsocket -lnsl"
  496. ;;
  497. NetBSD)
  498. v4l="no"
  499. v4l2="no"
  500. bktr="yes"
  501. audio_oss="yes"
  502. dv1394="no"
  503. make="gmake"
  504. add_extralibs "-lossaudio"
  505. ;;
  506. OpenBSD)
  507. v4l="no"
  508. v4l2="no"
  509. bktr="yes"
  510. audio_oss="yes"
  511. dv1394="no"
  512. make="gmake"
  513. LIBOBJFLAGS="\$(PIC)"
  514. LDCONFIG="ldconfig -m \$(shlibdir)"
  515. add_extralibs "-lossaudio"
  516. ;;
  517. FreeBSD)
  518. v4l="no"
  519. v4l2="no"
  520. bktr="yes"
  521. audio_oss="yes"
  522. dv1394="no"
  523. make="gmake"
  524. add_cflags "-pthread"
  525. ;;
  526. GNU/kFreeBSD)
  527. v4l="no"
  528. v4l2="no"
  529. bktr="yes"
  530. audio_oss="yes"
  531. dv1394="no"
  532. add_cflags "-pthread"
  533. ;;
  534. BSD/OS)
  535. v4l="no"
  536. v4l2="no"
  537. bktr="yes"
  538. audio_oss="yes"
  539. dv1394="no"
  540. extralibs="-lpoll -lgnugetopt -lm"
  541. make="gmake"
  542. strip="strip -d"
  543. installstrip=""
  544. ;;
  545. Darwin)
  546. cc="cc"
  547. v4l="no"
  548. v4l2="no"
  549. audio_oss="no"
  550. dv1394="no"
  551. SHFLAGS="-dynamiclib -Wl,-single_module -Wl,-install_name,\$(shlibdir)/\$(SLIBNAME),-current_version,\$(SPPVERSION),-compatibility_version,\$(SPPVERSION)"
  552. VHOOKSHFLAGS='-dynamiclib -Wl,-single_module -flat_namespace -undefined suppress -Wl,-install_name,$(shlibdir)/vhook/$@'
  553. extralibs=""
  554. strip="strip -x"
  555. installstrip=""
  556. FFLDFLAGS="-Wl,-dynamic,-search_paths_first"
  557. SLIBSUF=".dylib"
  558. SLIBNAME_WITH_FULLVERSION='$(SLIBPREF)$(NAME).$(LIBVERSION)$(SLIBSUF)'
  559. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME).$(LIBMAJOR)$(SLIBSUF)'
  560. FFSERVERLDFLAGS=-Wl,-bind_at_load
  561. LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(libdir)/$(LIB)"'
  562. ;;
  563. MINGW32*)
  564. # Note: the rest of the mingw32 config is done afterwards as mingw32
  565. # can be forced on the command line for Linux cross compilation.
  566. mingw32="yes"
  567. ;;
  568. CYGWIN*)
  569. targetos=CYGWIN
  570. shlibdir='${PREFIX}/bin'
  571. v4l="no"
  572. v4l2="no"
  573. audio_oss="yes"
  574. dv1394="no"
  575. VHOOKSHFLAGS="-shared -L../libavformat -L../libavcodec -L../libavutil"
  576. VHOOKLIBS='-lavformat$(BUILDSUF) -lavcodec$(BUILDSUF) -lavutil$(BUILDSUF) $(EXTRALIBS)'
  577. extralibs=""
  578. EXESUF=".exe"
  579. SLIBPREF="cyg"
  580. SLIBSUF=".dll"
  581. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  582. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  583. SHFLAGS='-shared -Wl,--out-implib=lib$(NAME).dll.a'
  584. ;;
  585. Linux)
  586. ;;
  587. IRIX*)
  588. targetos=IRIX
  589. ranlib="echo ignoring ranlib"
  590. v4l="no"
  591. v4l2="no"
  592. audio_oss="no"
  593. make="gmake"
  594. ;;
  595. OS/2)
  596. TMPE=$TMPE".exe"
  597. ar="emxomfar -p128"
  598. ranlib="echo ignoring ranlib"
  599. strip="echo ignoring strip"
  600. add_cflags "-Zomf"
  601. FFLDFLAGS="-Zomf -Zstack 16384 -s"
  602. SHFLAGS="-Zdll -Zomf"
  603. FFSERVERLDFLAGS=""
  604. LIBPREF=""
  605. LIBSUF=".lib"
  606. SLIBPREF=""
  607. SLIBSUF=".dll"
  608. EXESUF=".exe"
  609. extralibs=""
  610. pkg_requires=""
  611. v4l="no"
  612. v4l2="no"
  613. audio_oss="no"
  614. dv1394="no"
  615. ffserver="no"
  616. vhook="no"
  617. os2="yes"
  618. ;;
  619. *)
  620. targetos="${targetos}-UNKNOWN"
  621. ;;
  622. esac
  623. # find source path
  624. source_path="`dirname $0`"
  625. source_path_used="yes"
  626. if test -z "$source_path" -o "$source_path" = "." ; then
  627. source_path=`pwd`
  628. source_path_used="no"
  629. else
  630. source_path="`cd \"$source_path\"; pwd`"
  631. fi
  632. if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
  633. show_help
  634. fi
  635. FFMPEG_CONFIGURATION=" "
  636. for opt do
  637. FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
  638. done
  639. ENCODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_encoder)' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
  640. DECODER_LIST=`grep 'register_avcodec(&[a-z0-9_]*_decoder)' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
  641. PARSER_LIST=`grep 'av_register_codec_parser(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
  642. MUXER_LIST=`grep 'av_register_output_format(&[a-z]' $source_path/libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
  643. DEMUXER_LIST=`grep 'av_register_input_format(&[a-z]' $source_path/libavformat/allformats.c | sed 's/.*&\(.*\)).*/\1/'`
  644. for opt do
  645. optval="${opt#*=}"
  646. case "$opt" in
  647. --log)
  648. ;;
  649. --log=*) logging="$optval"
  650. ;;
  651. --prefix=*) PREFIX="$optval"; force_prefix=yes
  652. ;;
  653. --libdir=*) libdir="$optval"; force_libdir=yes
  654. ;;
  655. --shlibdir=*) shlibdir="$optval"
  656. ;;
  657. --incdir=*) incdir="$optval"
  658. ;;
  659. --mandir=*) mandir="$optval"
  660. ;;
  661. --source-path=*) source_path="$optval"
  662. ;;
  663. --cross-prefix=*) cross_prefix="$optval"
  664. ;;
  665. --cross-compile) cross_compile=yes
  666. ;;
  667. --cc=*) cc="$optval"
  668. ;;
  669. --make=*) make="$optval"
  670. ;;
  671. --extra-cflags=*) add_cflags "$optval"
  672. ;;
  673. --extra-ldflags=*) EXTRALDFLAGS="$optval"
  674. ;;
  675. --extra-libs=*) extralibs="$optval"
  676. ;;
  677. --build-suffix=*) BUILDSUF="$optval"
  678. ;;
  679. --cpu=*) cpu="$optval"
  680. ;;
  681. --tune=*) tune="$optval"
  682. ;;
  683. --powerpc-perf-enable) powerpc_perf="yes"
  684. ;;
  685. --disable-mmx) mmx="no"
  686. ;;
  687. --disable-armv5te) armv5te="no"
  688. ;;
  689. --disable-iwmmxt) iwmmxt="no"
  690. ;;
  691. --disable-altivec) altivec="no"
  692. ;;
  693. --enable-gprof) gprof="yes"
  694. ;;
  695. --disable-v4l) v4l="no"
  696. ;;
  697. --disable-v4l2) v4l2="no"
  698. ;;
  699. --disable-bktr) bktr="no"
  700. ;;
  701. --disable-audio-oss) audio_oss="no"
  702. ;;
  703. --disable-audio-beos) audio_beos="no"
  704. ;;
  705. --disable-dv1394) dv1394="no"
  706. ;;
  707. --disable-network) network="no"; ffserver="no"
  708. ;;
  709. --disable-ipv6) ipv6="no";
  710. ;;
  711. --disable-zlib) zlib="no"
  712. ;;
  713. --enable-a52) a52="yes"
  714. ;;
  715. --enable-a52bin) a52bin="yes"
  716. ;;
  717. --enable-dts) dts="yes"
  718. ;;
  719. --enable-pp) pp="yes"
  720. ;;
  721. --enable-libgsm) libgsm="yes"
  722. ;;
  723. --enable-mp3lame) mp3lame="yes"
  724. ;;
  725. --enable-libogg) libogg="yes"
  726. pkg_requires="$pkg_requires ogg >= 1.1"
  727. ;;
  728. --enable-vorbis) vorbis="yes"
  729. pkg_requires="$pkg_requires vorbis vorbisenc"
  730. ;;
  731. --enable-faad) faad="yes"
  732. ;;
  733. --enable-faadbin) faadbin="yes"
  734. ;;
  735. --enable-faac) faac="yes"
  736. ;;
  737. --enable-xvid) xvid="yes"
  738. ;;
  739. --enable-x264) x264="yes"
  740. ;;
  741. --enable-avisynth) avisynth="yes";
  742. ;;
  743. --enable-dc1394) dc1394="yes"
  744. pkg_requires="$pkg_requires libraw1394"
  745. ;;
  746. --disable-vhook) vhook="no"
  747. ;;
  748. --disable-simple_idct) simpleidct="no"
  749. ;;
  750. --enable-mingw32) mingw32="yes"
  751. ;;
  752. --enable-mingwce) mingwce="yes"
  753. ;;
  754. --enable-static) lstatic="yes"
  755. ;;
  756. --disable-static) lstatic="no"
  757. ;;
  758. --enable-shared) lshared="yes"
  759. ;;
  760. --disable-shared) lshared="no"
  761. ;;
  762. --disable-debug) debug="no"
  763. ;;
  764. --disable-opts) optimize="no"
  765. ;;
  766. --disable-mpegaudio-hp) mpegaudio_hp="no"
  767. ;;
  768. --disable-protocols) protocols="no"; network="no"; ffserver="no"
  769. ;;
  770. --disable-ffserver) ffserver="no"
  771. ;;
  772. --disable-ffplay) ffplay="no"
  773. ;;
  774. --enable-small) optimize="small"
  775. ;;
  776. --enable-amr_nb) amr="yes"; amr_nb="yes"; amr_nb_fixed="no"
  777. ;;
  778. --enable-amr_nb-fixed) amr="yes"; amr_nb_fixed="yes"; amr_nb="no"
  779. ;;
  780. --enable-amr_wb) amr="yes"; amr_wb="yes"
  781. ;;
  782. --enable-amr_if2) amr="yes"; amr_if2="yes"
  783. ;;
  784. --enable-sunmlib) sunmlib="yes"
  785. ;;
  786. --enable-pthreads) pthreads="yes"
  787. ;;
  788. --enable-swscaler) swscaler="yes"
  789. ;;
  790. --enable-gpl) gpl="yes"
  791. ;;
  792. --enable-memalign-hack) memalignhack="yes"
  793. ;;
  794. --disable-strip) dostrip="no"
  795. ;;
  796. --enable-encoder=*) ENCODER_LIST="$ENCODER_LIST ${optval}_encoder"
  797. ;;
  798. --enable-decoder=*) DECODER_LIST="$DECODER_LIST ${optval}_decoder"
  799. ;;
  800. --disable-encoder=*) ENCODER_LIST="`filter_out ${optval}_encoder $ENCODER_LIST`"
  801. ;;
  802. --disable-decoder=*) DECODER_LIST="`filter_out ${optval}_decoder $DECODER_LIST`"
  803. ;;
  804. --disable-encoders) ENCODER_LIST=""
  805. ;;
  806. --disable-decoders) DECODER_LIST=""
  807. ;;
  808. --enable-muxer=*) MUXER_LIST="$MUXER_LIST ${optval}_muxer"
  809. ;;
  810. --disable-muxer=*) MUXER_LIST="`filter_out ${optval}_muxer $MUXER_LIST`"
  811. ;;
  812. --disable-muxers) MUXER_LIST=""; ffserver="no"
  813. ;;
  814. --enable-demuxer=*) DEMUXER_LIST="$DEMUXER_LIST ${optval}_demuxer"
  815. ;;
  816. --disable-demuxer=*) DEMUXER_LIST="`filter_out ${optval}_demuxer $DEMUXER_LIST`"
  817. ;;
  818. --disable-demuxers) DEMUXER_LIST=""
  819. ;;
  820. --enable-parser=*) PARSER_LIST="$PARSER_LIST ${optval}_parser"
  821. ;;
  822. --disable-parser=*) PARSER_LIST="`filter_out ${optval}_parser $PARSER_LIST`"
  823. ;;
  824. --disable-parsers) PARSER_LIST=""
  825. ;;
  826. --help) show_help
  827. ;;
  828. *)
  829. echo "Unknown option \"$opt\"."
  830. echo "See $0 --help for available options."
  831. exit 1
  832. ;;
  833. esac
  834. done
  835. if test "$logging" != no; then
  836. test "$logging" = yes || logfile="$logging"
  837. echo "# $0 $@" >$logfile
  838. set >>$logfile
  839. else
  840. logfile=/dev/null
  841. fi
  842. if test "$mingw32" = "yes" -o "$mingwce" = "yes"; then
  843. if test "$lshared" = "yes" && test "$lstatic" = "yes" ; then
  844. cat <<EOF
  845. You can only build one library type at once on MinGW.
  846. Specify --disable-static --enable-shared to only build
  847. the shared libraries. To build only the static libraries
  848. you do not need to pass additional options.
  849. EOF
  850. exit 1
  851. fi
  852. v4l="no"
  853. v4l2="no"
  854. bktr="no"
  855. audio_oss="no"
  856. dv1394="no"
  857. dc1394="no"
  858. ffserver="no"
  859. network="no"
  860. if test "$mingwce" = "yes"; then
  861. protocols="no"
  862. fi
  863. SLIBPREF=""
  864. SLIBSUF=".dll"
  865. EXESUF=".exe"
  866. SLIBNAME_WITH_VERSION='$(SLIBPREF)$(NAME)-$(LIBVERSION)$(SLIBSUF)'
  867. SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(NAME)-$(LIBMAJOR)$(SLIBSUF)'
  868. SLIB_EXTRA_CMD="-lib /machine:i386 /def:\$(@:${SLIBSUF}=.def)"
  869. SHFLAGS="-shared -Wl,--output-def,\$(@:${SLIBSUF}=.def),--out-implib,lib\$(SLIBNAME:\$(SLIBSUF)=.dll.a)"
  870. if test "$force_prefix" != yes; then PREFIX="$PROGRAMFILES/FFmpeg"; fi
  871. if test "$force_libdir" != yes; then bindir='${PREFIX}'; fi
  872. shlibdir='${PREFIX}'
  873. fi
  874. # Combine FFLDFLAGS, EXTRALDFLAGS and the LDFLAGS environment variable.
  875. LDFLAGS="$FFLDFLAGS $EXTRALDFLAGS $LDFLAGS"
  876. test -n "$cross_prefix" && cross_compile=yes
  877. cc="${cross_prefix}${cc}"
  878. ar="${cross_prefix}${ar}"
  879. ranlib="${cross_prefix}${ranlib}"
  880. strip="${cross_prefix}${strip}"
  881. # we need to build at least one lib type
  882. if test "$lstatic" = "no" && test "$lshared" = "no" ; then
  883. cat <<EOF
  884. At least one library type must be built.
  885. Specify --enable-static to build the static libraries or --enable-shared to
  886. build the shared libraries as well. To only build the shared libraries specify
  887. --disable-static in addition to --enable-shared.
  888. EOF
  889. exit 1;
  890. fi
  891. if test "$vorbis" = "yes" ; then
  892. if test "$libogg" = "no"; then
  893. echo "libogg must be enabled to enable Vorbis."
  894. fail="yes"
  895. fi
  896. fi
  897. if test "$gpl" != "yes"; then
  898. if test "$pp" != "no"; then
  899. echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
  900. fail="yes"
  901. fi
  902. if test "$a52" != "no" -o "$a52bin" != "no"; then
  903. echo "liba52 is under GPL and --enable-gpl is not specified."
  904. fail="yes"
  905. fi
  906. if test "$xvid" != "no"; then
  907. echo "libxvidcore is under GPL and --enable-gpl is not specified."
  908. fail="yes"
  909. fi
  910. if test "$x264" != "no"; then
  911. echo "x264 is under GPL and --enable-gpl is not specified."
  912. fail="yes"
  913. fi
  914. if test "$dts" != "no"; then
  915. echo "libdts is under GPL and --enable-gpl is not specified."
  916. fail="yes"
  917. fi
  918. if test "$faad" != "no" -o "$faadbin" != "no"; then
  919. if check_header faad.h; then
  920. check_cc << EOF
  921. #include <faad.h>
  922. #ifndef FAAD2_VERSION
  923. ok faad1
  924. #endif
  925. int main( void ) { return 0; }
  926. EOF
  927. if test $? = 0 ; then
  928. echo "FAAD2 is under GPL and --enable-gpl is not specified."
  929. fail="yes"
  930. fi
  931. else
  932. faad="no"
  933. faadbin="no"
  934. echo "FAAD test failed."
  935. fi
  936. fi
  937. if test "$swscaler" != "no"; then
  938. echo "The software scaler is under GPL and --enable-gpl is not specified."
  939. fail="yes"
  940. fi
  941. fi
  942. if test "$fail" = "yes"; then
  943. exit 1
  944. fi
  945. # compute MMX state
  946. if test $mmx = "default"; then
  947. if test $cpu = "x86" -o $cpu = "x86_64"; then
  948. mmx="yes"
  949. else
  950. mmx="no"
  951. fi
  952. fi
  953. #Darwin CC versions
  954. needmdynamicnopic="no"
  955. if test $targetos = Darwin; then
  956. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  957. add_cflags "-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
  958. else
  959. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  960. case "$gcc_version" in
  961. *2.95*)
  962. add_cflags "-no-cpp-precomp -pipe"
  963. ;;
  964. *[34].*)
  965. add_cflags "-no-cpp-precomp -pipe -force_cpusubtype_ALL -Wno-sign-compare"
  966. if test "$lshared" = no; then
  967. needmdynamicnopic="yes"
  968. fi
  969. ;;
  970. *)
  971. add_cflags "-no-cpp-precomp -pipe"
  972. if test "$lshared" = no; then
  973. needmdynamicnopic="yes"
  974. fi
  975. ;;
  976. esac
  977. fi
  978. fi
  979. if test $optimize != "no"; then
  980. add_cflags "-fomit-frame-pointer"
  981. fi
  982. # Can only do AltiVec on PowerPC
  983. if test $altivec = "default"; then
  984. if test $cpu = "powerpc"; then
  985. altivec="yes"
  986. else
  987. altivec="no"
  988. fi
  989. fi
  990. # Add processor-specific flags
  991. TUNECPU="generic"
  992. POWERPCMODE="32bits"
  993. if test $tune != "generic"; then
  994. case $tune in
  995. 601|ppc601|PowerPC601)
  996. add_cflags "-mcpu=601"
  997. if test $altivec = "yes"; then
  998. echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
  999. fi
  1000. TUNECPU=ppc601
  1001. ;;
  1002. 603*|ppc603*|PowerPC603*)
  1003. add_cflags "-mcpu=603"
  1004. if test $altivec = "yes"; then
  1005. echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
  1006. fi
  1007. TUNECPU=ppc603
  1008. ;;
  1009. 604*|ppc604*|PowerPC604*)
  1010. add_cflags "-mcpu=604"
  1011. if test $altivec = "yes"; then
  1012. echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
  1013. fi
  1014. TUNECPU=ppc604
  1015. ;;
  1016. G3|g3|75*|ppc75*|PowerPC75*)
  1017. add_cflags "-mcpu=750 -mtune=750 -mpowerpc-gfxopt"
  1018. if test $altivec = "yes"; then
  1019. echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
  1020. fi
  1021. TUNECPU=ppc750
  1022. ;;
  1023. G4|g4|745*|ppc745*|PowerPC745*)
  1024. add_cflags "-mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
  1025. if test $altivec = "no"; then
  1026. echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
  1027. fi
  1028. TUNECPU=ppc7450
  1029. ;;
  1030. 74*|ppc74*|PowerPC74*)
  1031. add_cflags "-mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
  1032. if test $altivec = "no"; then
  1033. echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
  1034. fi
  1035. TUNECPU=ppc7400
  1036. ;;
  1037. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  1038. add_cflags "-mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
  1039. if test $altivec = "no"; then
  1040. echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
  1041. fi
  1042. TUNECPU=ppc970
  1043. POWERPCMODE="64bits"
  1044. ;;
  1045. i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|pentium-m|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona|athlon64|k8|opteron|athlon-fx)
  1046. add_cflags "-march=$tune"
  1047. ;;
  1048. sparc64)
  1049. add_cflags "-mcpu=v9 -mtune=v9"
  1050. ;;
  1051. *)
  1052. echo "WARNING: Unknown CPU \"$tune\", ignored."
  1053. ;;
  1054. esac
  1055. fi
  1056. # make sure we can execute files in $TMPDIR
  1057. cat >$TMPE 2>>$logfile <<EOF
  1058. #! /bin/sh
  1059. EOF
  1060. chmod +x $TMPE >>$logfile 2>&1
  1061. if ! $TMPE >>$logfile 2>&1; then
  1062. cat <<EOF
  1063. Unable to create and execute files in $TMPDIR1. Set the TMPDIR environment
  1064. variable to another directory.
  1065. EOF
  1066. die "Sanity test failed."
  1067. fi
  1068. rm $TMPE
  1069. # compiler sanity check
  1070. check_exec <<EOF
  1071. int main(){
  1072. return 0;
  1073. }
  1074. EOF
  1075. if test "$?" != 0; then
  1076. echo "$cc is unable to create an executable file."
  1077. if test -z "$cross_prefix" -a "$cross_compile" = no; then
  1078. echo "If $cc is a cross-compiler, use the --cross-compile option."
  1079. echo "Only do this if you know what cross compiling means."
  1080. fi
  1081. die "C compiler test failed."
  1082. fi
  1083. # check for assembler specific support
  1084. if test $cpu = "powerpc"; then
  1085. check_cc <<EOF && dcbzl=yes
  1086. int main(void) {
  1087. register long zero = 0;
  1088. char data[1024];
  1089. asm volatile("dcbzl %0, %1" : : "b" (data), "r" (zero));
  1090. return 0;
  1091. }
  1092. EOF
  1093. fi
  1094. # check for SIMD availability
  1095. # AltiVec flags: The FSF version of GCC differs from the Apple version
  1096. if test $cpu = "powerpc"; then
  1097. if test $altivec = "yes"; then
  1098. if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
  1099. add_cflags "-faltivec"
  1100. else
  1101. add_cflags "-maltivec -mabi=altivec"
  1102. fi
  1103. fi
  1104. fi
  1105. check_header altivec.h && _altivec_h=yes || _altivec_h=no
  1106. # check if our compiler supports Motorola AltiVec C API
  1107. if test $altivec = "yes"; then
  1108. if test $_altivec_h = "yes"; then
  1109. inc_altivec_h="#include <altivec.h>"
  1110. else
  1111. inc_altivec_h=
  1112. fi
  1113. check_cc <<EOF || altivec=no
  1114. $inc_altivec_h
  1115. int main(void) {
  1116. vector signed int v1, v2, v3;
  1117. v1 = vec_add(v2,v3);
  1118. return 0;
  1119. }
  1120. EOF
  1121. fi
  1122. # check armv5te instructions support
  1123. if test $armv5te = "default" -a $cpu = "armv4l"; then
  1124. armv5te=no
  1125. check_cc <<EOF && armv5te=yes
  1126. int main(void) {
  1127. __asm__ __volatile__ ("qadd r0, r0, r0");
  1128. }
  1129. EOF
  1130. fi
  1131. # check iwmmxt support
  1132. if test $iwmmxt = "default" -a $cpu = "armv4l"; then
  1133. iwmmxt=no
  1134. check_cc <<EOF && iwmmxt=yes
  1135. int main(void) {
  1136. __asm__ __volatile__ ("wunpckelub wr6, wr4");
  1137. }
  1138. EOF
  1139. fi
  1140. # mmi only available on mips
  1141. if test $mmi = "default"; then
  1142. if test $cpu = "mips"; then
  1143. mmi="yes"
  1144. else
  1145. mmi="no"
  1146. fi
  1147. fi
  1148. # check if our compiler supports mmi
  1149. enabled mmi && check_cc <<EOF || mmi="no"
  1150. int main(void) {
  1151. __asm__ ("lq \$2, 0(\$2)");
  1152. return 0;
  1153. }
  1154. EOF
  1155. # test gcc version to see if vector builtins can be used
  1156. # currently only used on i386 for MMX builtins
  1157. check_cc -msse <<EOF && builtin_vector=yes || builtin_vector=no
  1158. #include <xmmintrin.h>
  1159. int main(void) {
  1160. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
  1161. return 0;
  1162. #else
  1163. #error no vector builtins
  1164. #endif
  1165. }
  1166. EOF
  1167. # test for mm3dnow.h
  1168. test "$cpu" = "x86_64" && march=k8 || march=athlon
  1169. check_cc -march=$march <<EOF && mm3dnow=yes || mm3dnow=no
  1170. #include <mm3dnow.h>
  1171. int main(void) {
  1172. __m64 b1;
  1173. b1 = _m_pswapd(b1);
  1174. _m_femms();
  1175. return 0;
  1176. }
  1177. EOF
  1178. # ---
  1179. # big/little-endian test
  1180. if test "$cross_compile" = "no"; then
  1181. check_ld <<EOF || die "endian test failed" && $TMPE && bigendian="yes"
  1182. #include <inttypes.h>
  1183. int main(int argc, char ** argv){
  1184. volatile uint32_t i=0x01234567;
  1185. return (*((uint8_t*)(&i))) == 0x67;
  1186. }
  1187. EOF
  1188. else
  1189. # programs cannot be launched if cross compiling, so make a static guess
  1190. if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
  1191. bigendian="yes"
  1192. fi
  1193. fi
  1194. # ---
  1195. # *inttypes.h* test
  1196. check_header inttypes.h || inttypes=no
  1197. # ---
  1198. # *int_fast* test
  1199. check_cc <<EOF || emu_fast_int=yes
  1200. #include <inttypes.h>
  1201. int main(int argc, char ** argv){
  1202. volatile uint_fast64_t i=0x01234567;
  1203. return 0;
  1204. }
  1205. EOF
  1206. # ---
  1207. # check availability of some header files
  1208. _memalign=no
  1209. _malloc_h=no
  1210. if check_header malloc.h; then
  1211. _malloc_h=yes
  1212. _memalign=yes
  1213. check_func memalign || _memalign="no"
  1214. fi
  1215. if test "$_memalign" = "no" -a "$mmx" = "yes" -a \
  1216. "$memalignhack" != "yes" -a "$targetos" != "Darwin" -a \
  1217. "$targetos" != "FreeBSD" ; then
  1218. die "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
  1219. fi
  1220. check_func localtime_r && localtime_r=yes || localtime_r=no
  1221. enabled zlib && check_lib zlib.h zlibVersion -lz || zlib="no"
  1222. # check for some common methods of building with pthread support
  1223. # do this before the optional library checks as some of them require pthreads
  1224. if enabled pthreads; then
  1225. { check_cflags -pthread && check_ldflags -pthread; } ||
  1226. { check_cflags -pthreads && check_ldflags -pthreads; } ||
  1227. check_lib pthread.h pthread_create -lpthread ||
  1228. check_func pthread_create ||
  1229. die "ERROR: can't find pthreads library"
  1230. fi
  1231. # these are off by default, so fail if requested and not available
  1232. enabled dts && require libdts dts.h dts_init -ldts
  1233. enabled libgsm && require libgsm gsm.h gsm_create -lgsm
  1234. enabled mp3lame && require LAME lame/lame.h lame_init -lmp3lame
  1235. enabled vorbis && require libvorbis vorbis/vorbisenc.h vorbis_info_init -lvorbis -lvorbisenc -logg
  1236. enabled libogg && require libogg ogg/ogg.h ogg_sync_init -logg
  1237. enabled xvid && require XviD xvid.h xvid_global -lxvidcore
  1238. enabled x264 && require x264 x264.h x264_encoder_open -lx264
  1239. enabled dc1394 && require libdc1394 libdc1394/dc1394_control.h dc1394_create_handle -ldc1394_control -lraw1394
  1240. enabled sunmlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib
  1241. # Ugh, faac uses stdcall calling convention on win32 so we can't use
  1242. # the generic test functions
  1243. if enabled faac; then
  1244. save_flags
  1245. temp_extralibs -lfaac
  1246. check_ld <<EOF && add_extralibs -lfaac || die "ERROR: libfaac not found"
  1247. #include <stdint.h>
  1248. #include <faac.h>
  1249. int main(){
  1250. char *id, *cpr;
  1251. faacEncGetVersion(&id, &cpr);
  1252. return 0;
  1253. }
  1254. EOF
  1255. restore_flags
  1256. fi
  1257. # Ugh, recent faad2 versions have renamed all functions and #define the
  1258. # old names in faad.h. Generic tests won't work.
  1259. if enabled faad; then
  1260. save_flags
  1261. temp_extralibs -lfaad
  1262. check_ld <<EOF && add_extralibs -lfaad || die "ERROR: libfaad not found"
  1263. #include <faad.h>
  1264. int main(){
  1265. faacDecOpen();
  1266. return 0;
  1267. }
  1268. EOF
  1269. restore_flags
  1270. fi
  1271. # Ugh, avisynth uses WINAPI calls. Generic tests won't work.
  1272. if enabled avisynth; then
  1273. save_flags
  1274. temp_extralibs -lvfw32
  1275. check_ld <<EOF && add_extralibs -lvfw32 || die "ERROR: vfw32 not found"
  1276. #include <windows.h>
  1277. #include <vfw.h>
  1278. int main(){
  1279. AVIFileInit();
  1280. return 0;
  1281. }
  1282. EOF
  1283. restore_flags
  1284. fi
  1285. # test for lrintf in math.h
  1286. check_exec <<EOF && have_lrintf=yes || have_lrintf=no
  1287. #define _ISOC9X_SOURCE 1
  1288. #include <math.h>
  1289. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  1290. EOF
  1291. _restrict=
  1292. for restrict_keyword in restrict __restrict__ __restrict; do
  1293. check_cc <<EOF && _restrict=$restrict_keyword && break
  1294. void foo(char * $restrict_keyword p);
  1295. EOF
  1296. done
  1297. # dlopen/dlfcn.h probing
  1298. check_header dlfcn.h && dlfcn=yes
  1299. temp_extralibs -ldl
  1300. if check_func dlopen; then
  1301. dlopen=yes
  1302. ldl=-ldl
  1303. fi
  1304. restore_flags
  1305. if check_func dlopen; then
  1306. dlopen=yes
  1307. ldl=
  1308. fi
  1309. if test "$vhook" = "default"; then
  1310. vhook="$dlopen"
  1311. fi
  1312. if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
  1313. add_extralibs $ldl
  1314. fi
  1315. if test "$targetos" = "CYGWIN" -a "$lstatic" = "yes" ; then
  1316. vhook="no"
  1317. echo
  1318. echo "At the moment vhooks don't work on Cygwin static builds."
  1319. echo "Patches welcome."
  1320. echo
  1321. fi
  1322. if enabled vhook; then
  1323. check_ldflags -rdynamic
  1324. check_ldflags -export-dynamic
  1325. fi
  1326. ##########################################
  1327. # imlib check
  1328. temp_extralibs -lImlib2
  1329. check_ld <<EOF && imlib2=yes || imlib2=no
  1330. #include <X11/Xlib.h>
  1331. #include <Imlib2.h>
  1332. int main( void ) { return (int) imlib_load_font("foo"); }
  1333. EOF
  1334. restore_flags
  1335. ##########################################
  1336. # FreeType check
  1337. freetype2=no
  1338. if test "x$targetos" != "xBeOS"; then
  1339. if (freetype-config --version) >/dev/null 2>&1 ; then
  1340. temp_cflags `freetype-config --cflags`
  1341. temp_extralibs `freetype-config --libs`
  1342. check_ld <<EOF && freetype2=yes
  1343. #include <ft2build.h>
  1344. int main( void ) { return (int) FT_Init_FreeType(0); }
  1345. EOF
  1346. restore_flags
  1347. fi
  1348. fi
  1349. ##########################################
  1350. # SDL check
  1351. sdl_too_old=no
  1352. sdl=no
  1353. SDL_CONFIG="${cross_prefix}sdl-config"
  1354. if ("${SDL_CONFIG}" --version) >/dev/null 2>&1 ; then
  1355. temp_cflags `"${SDL_CONFIG}" --cflags`
  1356. temp_extralibs `"${SDL_CONFIG}" --libs`
  1357. check_ld <<EOF
  1358. #include <SDL.h>
  1359. #undef main /* We don't want SDL to override our main() */
  1360. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  1361. EOF
  1362. if test $? = 0; then
  1363. _sdlversion=`"${SDL_CONFIG}" --version | sed 's/[^0-9]//g'`
  1364. if test "$_sdlversion" -lt 121 ; then
  1365. sdl_too_old=yes
  1366. else
  1367. sdl=yes
  1368. check_cc <<EOF && sdl_video_size=yes || sdl_video_size=no
  1369. #include <SDL.h>
  1370. int main(void){
  1371. const SDL_VideoInfo *vi = SDL_GetVideoInfo();
  1372. int w = vi->current_w;
  1373. return 0;
  1374. }
  1375. EOF
  1376. fi
  1377. fi
  1378. restore_flags
  1379. fi
  1380. enabled sdl || ffplay=no
  1381. ##########################################
  1382. # texi2html check
  1383. texi2html=no
  1384. if (texi2html -version) >/dev/null 2>&1; then
  1385. texi2html=yes
  1386. fi
  1387. ##########################################
  1388. # IPv6 check
  1389. enabled network && enabled ipv6 && check_ld <<EOF && ipv6=yes || ipv6=no
  1390. #include <sys/types.h>
  1391. #include <sys/socket.h>
  1392. #include <netinet/in.h>
  1393. #include <netdb.h>
  1394. int main( void ) {
  1395. struct sockaddr_storage saddr;
  1396. struct ipv6_mreq mreq6;
  1397. getaddrinfo(0,0,0,0);
  1398. getnameinfo(0,0,0,0,0,0,0);
  1399. IN6_IS_ADDR_MULTICAST((const struct in6_addr *)0);
  1400. }
  1401. EOF
  1402. # check for video4linux2 --- V4L2_PIX_FMT_YUV420
  1403. enabled v4l2 && check_cc <<EOF || v4l2="no"
  1404. #include <sys/time.h>
  1405. #include <asm/types.h>
  1406. #include <linux/videodev2.h>
  1407. int dummy = V4L2_PIX_FMT_YUV420;
  1408. struct v4l2_buffer dummy1;
  1409. EOF
  1410. enabled debug && add_cflags -g
  1411. # add some useful compiler flags if supported
  1412. check_cflags -Wdeclaration-after-statement
  1413. check_cflags -Wall
  1414. check_cflags -Wno-switch
  1415. check_cflags -Wdisabled-optimization
  1416. check_cflags -Wpointer-arith
  1417. check_cflags -Wredundant-decls
  1418. check_cflags -Winline
  1419. # add some linker flags
  1420. check_ldflags '-Wl,--as-needed' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavformat' '-Wl,-rpath-link,\$(BUILD_ROOT)/libavutil'
  1421. # not all compilers support -Os
  1422. test "$optimize" = "small" && check_cflags -Os
  1423. if enabled optimize; then
  1424. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  1425. add_cflags "-O5"
  1426. add_ldflags "-O5"
  1427. else
  1428. add_cflags "-O3"
  1429. fi
  1430. fi
  1431. # PIC flags for shared library objects where they are needed
  1432. if test "$lshared" = "yes" ; then
  1433. # LIBOBJFLAGS may have already been set in the OS configuration
  1434. if test -z "$LIBOBJFLAGS" ; then
  1435. case "$cpu" in
  1436. x86_64|ia64|alpha|sparc*) LIBOBJFLAGS="\$(PIC)" ;;
  1437. esac
  1438. fi
  1439. fi
  1440. if test "$gprof" = "yes" ; then
  1441. add_cflags "-p"
  1442. add_ldflags "-p"
  1443. fi
  1444. # find if .align arg is power-of-two or not
  1445. if test $asmalign_pot = "unknown"; then
  1446. asmalign_pot="no"
  1447. echo 'asm (".align 3");' | check_cc && asmalign_pot="yes"
  1448. fi
  1449. echo "install prefix $PREFIX"
  1450. echo "source path $source_path"
  1451. echo "C compiler $cc"
  1452. echo "make $make"
  1453. echo "CPU $cpu ($tune)"
  1454. if test "$BUILDSUF" != ""; then
  1455. echo "build suffix $BUILDSUF"
  1456. fi
  1457. echo "big-endian $bigendian"
  1458. echo "inttypes.h $inttypes"
  1459. echo "broken inttypes.h $emu_fast_int"
  1460. if test $cpu = "x86" -o $cpu = "x86_64"; then
  1461. echo "MMX enabled $mmx"
  1462. echo "Vector Builtins $builtin_vector"
  1463. echo "3DNow! Builtins $mm3dnow"
  1464. fi
  1465. if test $cpu = "armv4l"; then
  1466. echo "ARMv5TE enabled $armv5te"
  1467. echo "IWMMXT enabled $iwmmxt"
  1468. fi
  1469. if test $cpu = "mips"; then
  1470. echo "MMI enabled $mmi"
  1471. fi
  1472. if test $cpu = "powerpc"; then
  1473. echo "AltiVec enabled $altivec"
  1474. echo "dcbzl available $dcbzl"
  1475. fi
  1476. echo "gprof enabled $gprof"
  1477. echo "zlib enabled $zlib"
  1478. echo "libgsm enabled $libgsm"
  1479. echo "mp3lame enabled $mp3lame"
  1480. echo "libogg enabled $libogg"
  1481. echo "Vorbis enabled $vorbis"
  1482. echo "FAAD enabled $faad"
  1483. echo "faadbin enabled $faadbin"
  1484. echo "FAAC enabled $faac"
  1485. echo "XviD enabled $xvid"
  1486. echo "x264 enabled $x264"
  1487. echo "a52 support $a52"
  1488. echo "a52 dlopened $a52bin"
  1489. echo "DTS support $dts"
  1490. echo "pp support $pp"
  1491. echo "Software Scaler enabled $swscaler"
  1492. echo "AVISynth enabled $avisynth"
  1493. echo "debug symbols $debug"
  1494. echo "strip symbols $dostrip"
  1495. echo "optimize $optimize"
  1496. echo "static $lstatic"
  1497. echo "shared $lshared"
  1498. echo "video hooking $vhook"
  1499. echo "SDL support $sdl"
  1500. if test $sdl_too_old = "yes"; then
  1501. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  1502. fi
  1503. if test "$vhook" = "yes"; then
  1504. echo "Imlib2 support $imlib2"
  1505. echo "FreeType support $freetype2"
  1506. fi
  1507. echo "Sun medialib support" $sunmlib
  1508. echo "pthreads support" $pthreads
  1509. echo "AMR-NB float support" $amr_nb
  1510. echo "AMR-NB fixed support" $amr_nb_fixed
  1511. echo "AMR-WB float support" $amr_wb
  1512. echo "AMR-WB IF2 support" $amr_if2
  1513. echo "network support $network"
  1514. if test "$network" = "yes" ; then
  1515. echo "IPv6 support $ipv6"
  1516. fi
  1517. echo ".align is power-of-two" $asmalign_pot
  1518. if test "$gpl" = "no" ; then
  1519. echo "License: LGPL"
  1520. else
  1521. echo "License: GPL"
  1522. fi
  1523. echo "Creating config.mak and config.h..."
  1524. date >> config.log
  1525. echo " $0 $FFMPEG_CONFIGURATION" >> config.log
  1526. echo "# Automatically generated by configure - do not modify!" > config.mak
  1527. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  1528. echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
  1529. echo "PREFIX=$PREFIX" >> config.mak
  1530. echo "prefix=\$(DESTDIR)\${PREFIX}" >> config.mak
  1531. echo "libdir=\$(DESTDIR)$libdir" >> config.mak
  1532. echo "shlibdir=\$(DESTDIR)$shlibdir" >> config.mak
  1533. echo "incdir=\$(DESTDIR)$incdir" >> config.mak
  1534. echo "bindir=\$(DESTDIR)$bindir" >> config.mak
  1535. echo "mandir=\$(DESTDIR)$mandir" >> config.mak
  1536. echo "MAKE=$make" >> config.mak
  1537. echo "CC=$cc" >> config.mak
  1538. echo "AR=$ar" >> config.mak
  1539. echo "RANLIB=$ranlib" >> config.mak
  1540. if test "$dostrip" = "yes" ; then
  1541. echo "STRIP=$strip" >> config.mak
  1542. echo "INSTALLSTRIP=$installstrip" >> config.mak
  1543. else
  1544. echo "STRIP=echo ignoring strip" >> config.mak
  1545. echo "INSTALLSTRIP=" >> config.mak
  1546. fi
  1547. VHOOKCFLAGS="-fPIC $CFLAGS"
  1548. test "$needmdynamicnopic" = yes && add_cflags -mdynamic-no-pic
  1549. echo "OPTFLAGS=$CFLAGS" >> config.mak
  1550. echo "VHOOKCFLAGS=$VHOOKCFLAGS">>config.mak
  1551. echo "LDFLAGS=$LDFLAGS" >> config.mak
  1552. echo "LDCONFIG=$LDCONFIG" >> config.mak
  1553. echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak
  1554. echo "SHFLAGS=$SHFLAGS" >> config.mak
  1555. echo "VHOOKSHFLAGS=$VHOOKSHFLAGS" >> config.mak
  1556. echo "VHOOKLIBS=$VHOOKLIBS" >> config.mak
  1557. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  1558. echo "BUILD_STATIC=$lstatic" >> config.mak
  1559. echo "BUILDSUF=$BUILDSUF" >> config.mak
  1560. echo "LIBPREF=$LIBPREF" >> config.mak
  1561. echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
  1562. if test "$lstatic" = "yes" ; then
  1563. echo "LIB=$LIB" >> config.mak
  1564. else # Some Make complain if this variable does not exist.
  1565. echo "LIB=" >> config.mak
  1566. fi
  1567. echo "SLIBPREF=$SLIBPREF" >> config.mak
  1568. echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
  1569. echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
  1570. echo "TARGET_OS=$targetos" >> config.mak
  1571. if test "$cpu" = "x86" ; then
  1572. echo "TARGET_ARCH_X86=yes" >> config.mak
  1573. echo "#define ARCH_X86 1" >> $TMPH
  1574. elif test "$cpu" = "x86_64" ; then
  1575. echo "TARGET_ARCH_X86_64=yes" >> config.mak
  1576. echo "#define ARCH_X86_64 1" >> $TMPH
  1577. elif test "$cpu" = "armv4l" ; then
  1578. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  1579. echo "#define ARCH_ARMV4L 1" >> $TMPH
  1580. elif test "$cpu" = "alpha" ; then
  1581. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  1582. echo "#define ARCH_ALPHA 1" >> $TMPH
  1583. elif test "$cpu" = "sparc64" ; then
  1584. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  1585. echo "#define ARCH_SPARC64 1" >> $TMPH
  1586. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1587. echo "#define ARCH_SPARC 1" >> $TMPH
  1588. elif test "$cpu" = "sparc" ; then
  1589. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1590. echo "#define ARCH_SPARC 1" >> $TMPH
  1591. elif test "$cpu" = "powerpc" ; then
  1592. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  1593. echo "#define ARCH_POWERPC 1" >> $TMPH
  1594. if test $POWERPCMODE = "32bits"; then
  1595. echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
  1596. else
  1597. echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
  1598. fi
  1599. if test "$powerpc_perf" = "yes"; then
  1600. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  1601. fi
  1602. elif test "$cpu" = "mips" ; then
  1603. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  1604. echo "#define ARCH_MIPS 1" >> $TMPH
  1605. elif test "$cpu" = "sh4" ; then
  1606. echo "TARGET_ARCH_SH4=yes" >> config.mak
  1607. echo "#define ARCH_SH4 1" >> $TMPH
  1608. elif test "$cpu" = "parisc" ; then
  1609. echo "TARGET_ARCH_PARISC=yes" >> config.mak
  1610. echo "#define ARCH_PARISC 1" >> $TMPH
  1611. elif test "$cpu" = "s390" ; then
  1612. echo "TARGET_ARCH_S390=yes" >> config.mak
  1613. echo "#define ARCH_S390 1" >> $TMPH
  1614. elif test "$cpu" = "m68k" ; then
  1615. echo "TARGET_ARCH_M68K=yes" >> config.mak
  1616. echo "#define ARCH_M68K 1" >> $TMPH
  1617. elif test "$cpu" = "ia64" ; then
  1618. echo "TARGET_ARCH_IA64=yes" >> config.mak
  1619. echo "#define ARCH_IA64 1" >> $TMPH
  1620. elif test "$cpu" = "bfin" ; then
  1621. echo "TARGET_ARCH_BFIN=yes" >> config.mak
  1622. echo "#define ARCH_BFIN 1" >> $TMPH
  1623. fi
  1624. echo "#define TUNECPU $TUNECPU" >> $TMPH
  1625. if test "$bigendian" = "yes" ; then
  1626. echo "WORDS_BIGENDIAN=yes" >> config.mak
  1627. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  1628. fi
  1629. if test "$inttypes" != "yes" ; then
  1630. echo "#define EMULATE_INTTYPES 1" >> $TMPH
  1631. fi
  1632. if test "$emu_fast_int" = "yes" ; then
  1633. echo "#define EMULATE_FAST_INT 1" >> $TMPH
  1634. fi
  1635. if test "$mmx" = "yes" ; then
  1636. echo "TARGET_MMX=yes" >> config.mak
  1637. echo "#define HAVE_MMX 1" >> $TMPH
  1638. echo "#define __CPU__ 586" >> $TMPH
  1639. fi
  1640. if test "$builtin_vector" = "yes" ; then
  1641. echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
  1642. echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
  1643. fi
  1644. if test "$mm3dnow" = "yes" ; then
  1645. echo "TARGET_BUILTIN_3DNOW=yes" >> config.mak
  1646. echo "#define HAVE_MM3DNOW 1" >> $TMPH
  1647. fi
  1648. if test "$armv5te" = "yes" ; then
  1649. echo "TARGET_ARMV5TE=yes" >> config.mak
  1650. echo "#define HAVE_ARMV5TE 1" >> $TMPH
  1651. fi
  1652. if test "$iwmmxt" = "yes" ; then
  1653. echo "TARGET_IWMMXT=yes" >> config.mak
  1654. echo "#define HAVE_IWMMXT 1" >> $TMPH
  1655. fi
  1656. if test "$mmi" = "yes" ; then
  1657. echo "TARGET_MMI=yes" >> config.mak
  1658. echo "#define HAVE_MMI 1" >> $TMPH
  1659. fi
  1660. if test "$dcbzl" = "yes" ; then
  1661. echo "#define HAVE_DCBZL 1" >> $TMPH
  1662. else
  1663. echo "#undef HAVE_DCBZL" >> $TMPH
  1664. fi
  1665. if test "$altivec" = "yes" ; then
  1666. echo "TARGET_ALTIVEC=yes" >> config.mak
  1667. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  1668. if test "$_altivec_h" = "yes" ; then
  1669. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  1670. else
  1671. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  1672. fi
  1673. fi
  1674. if test "$gprof" = "yes" ; then
  1675. echo "#define HAVE_GPROF 1" >> $TMPH
  1676. fi
  1677. if test "$localtime_r" = "yes" ; then
  1678. echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
  1679. fi
  1680. if test "$imlib2" = "yes" ; then
  1681. echo "HAVE_IMLIB2=yes" >> config.mak
  1682. fi
  1683. if test "$freetype2" = "yes" ; then
  1684. echo "HAVE_FREETYPE2=yes" >> config.mak
  1685. fi
  1686. if test "$sunmlib" = "yes" ; then
  1687. echo "HAVE_MLIB=yes" >> config.mak
  1688. echo "#define HAVE_MLIB 1" >> $TMPH
  1689. fi
  1690. if test "$pthreads" = "yes" ; then
  1691. echo "HAVE_PTHREADS=yes" >> config.mak
  1692. echo "#define HAVE_PTHREADS 1" >> $TMPH
  1693. echo "#define HAVE_THREADS 1" >> $TMPH
  1694. fi
  1695. if test "$sdl" = "yes" ; then
  1696. echo "CONFIG_SDL=yes" >> config.mak
  1697. echo "SDL_LIBS=`"${SDL_CONFIG}" --libs`" >> config.mak
  1698. echo "SDL_CFLAGS=`"${SDL_CONFIG}" --cflags`" >> config.mak
  1699. if test "$sdl_video_size" = "yes"; then
  1700. echo "#define HAVE_SDL_VIDEO_SIZE 1" >> $TMPH
  1701. fi
  1702. fi
  1703. if test "$texi2html" = "yes"; then
  1704. echo "BUILD_DOC=yes" >> config.mak
  1705. fi
  1706. if test "$have_lrintf" = "yes" ; then
  1707. echo "#define HAVE_LRINTF 1" >> $TMPH
  1708. fi
  1709. if test "$vhook" = "yes" ; then
  1710. echo "BUILD_VHOOK=yes" >> config.mak
  1711. echo "#define HAVE_VHOOK 1" >> $TMPH
  1712. fi
  1713. sws_version=`grep '#define LIBSWSCALE_VERSION ' "$source_path/libswscale/swscale.h" | sed 's/[^0-9\.]//g'`
  1714. pp_version=`grep '#define LIBPOSTPROC_VERSION ' "$source_path/libpostproc/postprocess.h" | sed 's/[^0-9\.]//g'`
  1715. lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
  1716. lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
  1717. lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
  1718. if test "$lshared" = "yes" ; then
  1719. echo "#define BUILD_SHARED_AV 1" >> $TMPH
  1720. echo "BUILD_SHARED=yes" >> config.mak
  1721. echo "PIC=-fPIC -DPIC" >> config.mak
  1722. echo "SPPMAJOR=${lavc_version%%.*}" >> config.mak
  1723. echo "SPPVERSION=$lavc_version" >> config.mak
  1724. echo "LAVCMAJOR=${lavc_version%%.*}" >> config.mak
  1725. echo "LAVCVERSION=$lavc_version" >> config.mak
  1726. echo "LAVFMAJOR=${lavf_version%%.*}" >> config.mak
  1727. echo "LAVFVERSION=$lavf_version" >> config.mak
  1728. echo "LAVUMAJOR=${lavu_version%%.*}" >> config.mak
  1729. echo "LAVUVERSION=$lavu_version" >> config.mak
  1730. echo "SWSMAJOR=${sws_version%%.*}" >> config.mak
  1731. echo "SWSVERSION=$sws_version" >> config.mak
  1732. echo "SLIBNAME=${SLIBNAME}" >> config.mak
  1733. echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak
  1734. echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak
  1735. echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak
  1736. fi
  1737. echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak
  1738. echo "EXTRALIBS=$extralibs" >> config.mak
  1739. # If you do not want to use encoders, disable them.
  1740. if echo "$ENCODER_LIST" | grep -q encoder; then
  1741. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  1742. echo "CONFIG_ENCODERS=yes" >> config.mak
  1743. fi
  1744. # If you do not want to use decoders, disable them.
  1745. if echo "$DECODER_LIST" | grep -q decoder; then
  1746. echo "#define CONFIG_DECODERS 1" >> $TMPH
  1747. echo "CONFIG_DECODERS=yes" >> config.mak
  1748. fi
  1749. # muxers
  1750. if echo "$MUXER_LIST" | grep -q muxer; then
  1751. echo "#define CONFIG_MUXERS 1" >> $TMPH
  1752. echo "CONFIG_MUXERS=yes" >> config.mak
  1753. fi
  1754. # demuxers
  1755. if echo "$DEMUXER_LIST" | grep -q demuxer; then
  1756. echo "#define CONFIG_DEMUXERS 1" >> $TMPH
  1757. echo "CONFIG_DEMUXERS=yes" >> config.mak
  1758. fi
  1759. # AC3
  1760. if test "$a52" = "yes" ; then
  1761. echo "#define CONFIG_AC3 1" >> $TMPH
  1762. echo "CONFIG_AC3=yes" >> config.mak
  1763. if test "$a52bin" = "yes" ; then
  1764. echo "#define CONFIG_A52BIN 1" >> $TMPH
  1765. echo "CONFIG_A52BIN=yes" >> config.mak
  1766. fi
  1767. fi
  1768. # DTS
  1769. if test "$dts" = "yes" ; then
  1770. echo "#define CONFIG_DTS 1" >> $TMPH
  1771. echo "CONFIG_DTS=yes" >> config.mak
  1772. fi
  1773. # PP
  1774. if test "$pp" = "yes" ; then
  1775. echo "#define CONFIG_PP 1" >> $TMPH
  1776. echo "CONFIG_PP=yes" >> config.mak
  1777. fi
  1778. if test "$swscaler" = "yes" ; then
  1779. echo "#define CONFIG_SWSCALER 1" >> $TMPH
  1780. echo "CONFIG_SWSCALER=yes" >> config.mak
  1781. fi
  1782. # MPEG audio high precision mode
  1783. if test "$mpegaudio_hp" = "yes" ; then
  1784. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  1785. fi
  1786. if test "$v4l" = "yes" ; then
  1787. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  1788. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  1789. fi
  1790. if test "$v4l2" = "yes" ; then
  1791. echo "#define CONFIG_VIDEO4LINUX2 1" >> $TMPH
  1792. echo "CONFIG_VIDEO4LINUX2=yes" >> config.mak
  1793. fi
  1794. if test "$bktr" = "yes" ; then
  1795. echo "#define CONFIG_BKTR 1" >> $TMPH
  1796. echo "CONFIG_BKTR=yes" >> config.mak
  1797. fi
  1798. if test "$dv1394" = "yes" ; then
  1799. echo "#define CONFIG_DV1394 1" >> $TMPH
  1800. echo "CONFIG_DV1394=yes" >> config.mak
  1801. fi
  1802. if test "$dc1394" = "yes" ; then
  1803. echo "#define CONFIG_DC1394 1" >> $TMPH
  1804. echo "CONFIG_DC1394=yes" >> config.mak
  1805. fi
  1806. if test "$dlopen" = "yes" ; then
  1807. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  1808. fi
  1809. if test "$dlfcn" = "yes" ; then
  1810. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  1811. fi
  1812. if test "$audio_oss" = "yes" ; then
  1813. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  1814. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  1815. fi
  1816. if test "$audio_beos" = "yes" ; then
  1817. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  1818. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  1819. fi
  1820. if test "$network" = "yes" ; then
  1821. echo "#define CONFIG_NETWORK 1" >> $TMPH
  1822. echo "CONFIG_NETWORK=yes" >> config.mak
  1823. fi
  1824. if test "$ipv6" = "yes" ; then
  1825. echo "#define CONFIG_IPV6 1" >> $TMPH
  1826. fi
  1827. if test "$zlib" = "yes" ; then
  1828. echo "#define CONFIG_ZLIB 1" >> $TMPH
  1829. echo "CONFIG_ZLIB=yes" >> config.mak
  1830. fi
  1831. if test "$libgsm" = "yes" ; then
  1832. echo "#define CONFIG_LIBGSM 1" >> $TMPH
  1833. echo "CONFIG_LIBGSM=yes" >> config.mak
  1834. fi
  1835. if test "$mp3lame" = "yes" ; then
  1836. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  1837. echo "CONFIG_MP3LAME=yes" >> config.mak
  1838. fi
  1839. if test "$libogg" = "yes" ; then
  1840. echo "#define CONFIG_LIBOGG 1" >> $TMPH
  1841. echo "CONFIG_LIBOGG=yes" >> config.mak
  1842. fi
  1843. if test "$vorbis" = "yes" ; then
  1844. echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
  1845. echo "CONFIG_LIBVORBIS=yes" >> config.mak
  1846. fi
  1847. if test "$faad" = "yes" ; then
  1848. echo "#define CONFIG_FAAD 1" >> $TMPH
  1849. echo "CONFIG_FAAD=yes" >> config.mak
  1850. fi
  1851. if test "$faadbin" = "yes" ; then
  1852. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  1853. echo "CONFIG_FAADBIN=yes" >> config.mak
  1854. fi
  1855. if test "$faac" = "yes" ; then
  1856. echo "#define CONFIG_FAAC 1" >> $TMPH
  1857. echo "CONFIG_FAAC=yes" >> config.mak
  1858. fi
  1859. if test "$xvid" = "yes" ; then
  1860. echo "#define CONFIG_XVID 1" >> $TMPH
  1861. echo "CONFIG_XVID=yes" >> config.mak
  1862. fi
  1863. if test "$x264" = "yes" ; then
  1864. echo "#define CONFIG_X264 1" >> $TMPH
  1865. echo "CONFIG_X264=yes" >> config.mak
  1866. fi
  1867. if test "$avisynth" = "yes" ; then
  1868. echo "#define CONFIG_AVISYNTH 1" >> $TMPH
  1869. echo "CONFIG_AVISYNTH=yes" >> config.mak
  1870. fi
  1871. if test "$mingw32" = "yes" ; then
  1872. echo "CONFIG_MINGW=yes" >> config.mak
  1873. echo "HAVE_W32THREADS=yes" >> config.mak
  1874. echo "#define HAVE_W32THREADS 1" >> $TMPH
  1875. echo "#define HAVE_THREADS 1" >> $TMPH
  1876. echo "#ifndef __MINGW32__" >> $TMPH
  1877. echo "#define __MINGW32__ 1" >> $TMPH
  1878. echo "#endif" >> $TMPH
  1879. fi
  1880. if test "$mingwce" = "yes" ; then
  1881. echo "CONFIG_MINGW=yes" >> config.mak
  1882. echo "#define CONFIG_WINCE 1" >> $TMPH
  1883. echo "CONFIG_WINCE=yes" >> config.mak
  1884. echo "#ifndef __MINGW32__" >> $TMPH
  1885. echo "#define __MINGW32__ 1" >> $TMPH
  1886. echo "#endif" >> $TMPH
  1887. fi
  1888. if test "$os2" = "yes" ; then
  1889. echo "#define CONFIG_OS2 1" >> $TMPH
  1890. echo "CONFIG_OS2=yes" >> config.mak
  1891. echo "HAVE_OS2THREADS=yes" >> config.mak
  1892. echo "#define HAVE_OS2THREADS 1" >> $TMPH
  1893. echo "#define HAVE_THREADS 1" >> $TMPH
  1894. fi
  1895. if test "$targetos" = "SunOS" ; then
  1896. echo "#define CONFIG_SUNOS 1" >> $TMPH
  1897. fi
  1898. if test "$targetos" = "BeOS" ; then
  1899. echo "HAVE_BEOSTHREADS=yes" >> config.mak
  1900. echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
  1901. echo "#define HAVE_THREADS 1" >> $TMPH
  1902. fi
  1903. if test "$targetos" = "Darwin"; then
  1904. echo "#define CONFIG_DARWIN 1" >> $TMPH
  1905. echo "CONFIG_DARWIN=yes" >> config.mak
  1906. fi
  1907. if test "$_malloc_h" = "yes" ; then
  1908. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  1909. else
  1910. echo "#undef HAVE_MALLOC_H" >> $TMPH
  1911. fi
  1912. if test "$_memalign" = "yes" ; then
  1913. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  1914. else
  1915. echo "#undef HAVE_MEMALIGN" >> $TMPH
  1916. fi
  1917. if test "$memalignhack" = "yes" ; then
  1918. echo "#define MEMALIGN_HACK 1" >> $TMPH
  1919. fi
  1920. if test "$netserver" = "yes" ; then
  1921. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  1922. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  1923. fi
  1924. if test "$need_inet_aton" = "yes" ; then
  1925. echo "NEED_INET_ATON=yes" >> config.mak
  1926. fi
  1927. if test "$simpleidct" = "yes" ; then
  1928. echo "#define SIMPLE_IDCT 1" >> $TMPH
  1929. fi
  1930. if test "$protocols" = "yes" ; then
  1931. echo "#define CONFIG_PROTOCOLS 1" >> $TMPH
  1932. echo "CONFIG_PROTOCOLS=yes" >> config.mak
  1933. fi
  1934. if test "$ffserver" = "yes" ; then
  1935. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  1936. echo "CONFIG_FFSERVER=yes" >> config.mak
  1937. fi
  1938. if test "$ffplay" = "yes" ; then
  1939. echo "CONFIG_FFPLAY=yes" >> config.mak
  1940. fi
  1941. if test "$gpl" = "yes" ; then
  1942. echo "#define CONFIG_GPL 1" >> $TMPH
  1943. echo "CONFIG_GPL=yes" >> config.mak
  1944. fi
  1945. echo "#define restrict $_restrict" >> $TMPH
  1946. if test "$optimize" = "small"; then
  1947. echo "#define always_inline" >> $TMPH
  1948. echo "#define CONFIG_SMALL 1" >> $TMPH
  1949. fi
  1950. # build tree in object directory if source path is different from current one
  1951. if test "$source_path_used" = "yes" ; then
  1952. DIRS="\
  1953. doc \
  1954. libavformat \
  1955. libavcodec \
  1956. libavcodec/alpha \
  1957. libavcodec/armv4l \
  1958. libavcodec/bfin \
  1959. libavcodec/i386 \
  1960. libavcodec/sparc \
  1961. libavcodec/mlib \
  1962. libavcodec/ppc \
  1963. libavcodec/liba52 \
  1964. libpostproc \
  1965. libavutil \
  1966. libswscale \
  1967. tests \
  1968. vhook \
  1969. "
  1970. FILES="\
  1971. Makefile \
  1972. libavformat/Makefile \
  1973. libavcodec/Makefile \
  1974. libpostproc/Makefile \
  1975. libavutil/Makefile \
  1976. libswscale/Makefile \
  1977. tests/Makefile \
  1978. vhook/Makefile \
  1979. doc/Makefile \
  1980. doc/texi2pod.pl \
  1981. "
  1982. for dir in $DIRS ; do
  1983. mkdir -p $dir
  1984. done
  1985. for f in $FILES ; do
  1986. ln -sf "$source_path/$f" $f
  1987. done
  1988. fi
  1989. echo "SRC_PATH=$source_path" >> config.mak
  1990. echo "BUILD_ROOT=$PWD" >> config.mak
  1991. if test "$amr" = "yes" ; then
  1992. echo "#define CONFIG_AMR 1" >> $TMPH
  1993. echo "CONFIG_AMR=yes" >> config.mak
  1994. fi
  1995. if test "$amr_wb" = "yes" ; then
  1996. echo "#define CONFIG_AMR_WB 1" >> $TMPH
  1997. echo "CONFIG_AMR_WB=yes" >> config.mak
  1998. echo
  1999. echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
  2000. echo "V5.1.0 from "
  2001. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
  2002. echo "and extracted the source to libavcodec/amrwb_float"
  2003. fi
  2004. if test "$amr_nb" = "yes" ; then
  2005. echo "#define CONFIG_AMR_NB 1" >> $TMPH
  2006. echo "CONFIG_AMR_NB=yes" >> config.mak
  2007. echo
  2008. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  2009. echo "REL-5 V5.1.0 from "
  2010. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.104/26104-510.zip"
  2011. echo "and extracted the source to libavcodec/amr_float"
  2012. echo "If you try this on alpha, you may need to change Word32 to int in amr/typedef.h"
  2013. fi
  2014. if test "$amr_nb_fixed" = "yes" ; then
  2015. echo "#define CONFIG_AMR_NB_FIXED 1" >> $TMPH
  2016. echo "CONFIG_AMR_NB_FIXED=yes" >> config.mak
  2017. echo
  2018. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  2019. echo "REL-5 version 5.1.0 from "
  2020. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.073/26073-510.zip"
  2021. echo "and extracted src to libavcodec/amr"
  2022. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  2023. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  2024. fi
  2025. if test "$amr_if2" = "yes" ; then
  2026. echo "AMR_CFLAGS=-DIF2=1" >> config.mak
  2027. fi
  2028. # Apparently it's not possible to portably echo a backslash.
  2029. if test "$asmalign_pot" = "yes" ; then
  2030. printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH
  2031. else
  2032. printf '#define ASMALIGN(ZEROBITS) ".align 1<<" #ZEROBITS "\\n\\t"\n' >> $TMPH
  2033. fi
  2034. # "tr '[a-z]' '[A-Z]'" is a workaround for Solaris tr not grokking "tr a-z A-Z"
  2035. for codec in $DECODER_LIST $ENCODER_LIST $PARSER_LIST $DEMUXER_LIST $MUXER_LIST; do
  2036. echo "#define CONFIG_`echo $codec | tr '[a-z]' '[A-Z]'` 1" >> $TMPH
  2037. echo "CONFIG_`echo $codec | tr '[a-z]' '[A-Z]'`=yes" >> config.mak
  2038. done
  2039. # Do not overwrite config.h if unchanged to avoid superfluous rebuilds.
  2040. diff $TMPH config.h >/dev/null 2>&1
  2041. if test "$?" != "0" ; then
  2042. mv -f $TMPH config.h
  2043. else
  2044. echo "config.h is unchanged"
  2045. fi
  2046. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
  2047. # build pkg-config files libav*.pc and libpostproc.pc
  2048. # libavutil.pc
  2049. cat <<EOF >libavutil.pc
  2050. prefix=$PREFIX
  2051. exec_prefix=\${prefix}
  2052. libdir=\${exec_prefix}/lib
  2053. includedir=\${prefix}/include
  2054. Name: libavutil
  2055. Description: FFmpeg utility library
  2056. Version: $lavu_version
  2057. Requires:
  2058. Conflicts:
  2059. Libs: -L\${libdir} -lavutil
  2060. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  2061. EOF
  2062. cat <<EOF >libavutil-uninstalled.pc
  2063. prefix=
  2064. exec_prefix=
  2065. libdir=\${pcfiledir}/libavutil
  2066. includedir=\${pcfiledir}/libavutil
  2067. Name: libavutil
  2068. Description: FFmpeg utility library
  2069. Version: $lavu_version
  2070. Requires:
  2071. Conflicts:
  2072. Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
  2073. Cflags: -I\${includedir}
  2074. EOF
  2075. # libavcodec.pc
  2076. cat <<EOF >libavcodec.pc
  2077. prefix=$PREFIX
  2078. exec_prefix=\${prefix}
  2079. libdir=\${exec_prefix}/lib
  2080. includedir=\${prefix}/include
  2081. Name: libavcodec
  2082. Description: FFmpeg codec library
  2083. Version: $lavc_version
  2084. Requires: $pkg_requires libavutil = $lavu_version
  2085. Conflicts:
  2086. Libs: -L\${libdir} -lavcodec $extralibs
  2087. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  2088. EOF
  2089. cat <<EOF >libavcodec-uninstalled.pc
  2090. prefix=
  2091. exec_prefix=
  2092. libdir=\${pcfiledir}/libavcodec
  2093. includedir=\${pcfiledir}/libavcodec
  2094. Name: libavcodec
  2095. Description: FFmpeg codec library
  2096. Version: $lavc_version
  2097. Requires: $pkg_requires libavutil = $lavu_version
  2098. Conflicts:
  2099. Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
  2100. Cflags: -I\${includedir}
  2101. EOF
  2102. # libavformat.pc
  2103. cat <<EOF >libavformat.pc
  2104. prefix=$PREFIX
  2105. exec_prefix=\${prefix}
  2106. libdir=\${exec_prefix}/lib
  2107. includedir=\${prefix}/include
  2108. Name: libavformat
  2109. Description: FFmpeg container format library
  2110. Version: $lavf_version
  2111. Requires: $pkg_requires libavcodec = $lavc_version
  2112. Conflicts:
  2113. Libs: -L\${libdir} -lavformat $extralibs
  2114. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  2115. EOF
  2116. cat <<EOF >libavformat-uninstalled.pc
  2117. prefix=
  2118. exec_prefix=
  2119. libdir=\${pcfiledir}/libavformat
  2120. includedir=\${pcfiledir}/libavformat
  2121. Name: libavformat
  2122. Description: FFmpeg container format library
  2123. Version: $lavf_version
  2124. Requires: $pkg_requires libavcodec = $lavc_version
  2125. Conflicts:
  2126. Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
  2127. Cflags: -I\${includedir}
  2128. EOF
  2129. # libpostproc.pc
  2130. cat <<EOF >libpostproc.pc
  2131. prefix=$PREFIX
  2132. exec_prefix=\${prefix}
  2133. libdir=\${exec_prefix}/lib
  2134. includedir=\${prefix}/include
  2135. Name: libpostproc
  2136. Description: FFmpeg post processing library
  2137. Version: $lavc_version
  2138. Requires:
  2139. Conflicts:
  2140. Libs: -L\${libdir} -lpostproc
  2141. Cflags: -I\${includedir} -I\${includedir}/postproc
  2142. EOF
  2143. cat <<EOF >libpostproc-uninstalled.pc
  2144. prefix=
  2145. exec_prefix=
  2146. libdir=\${pcfiledir}/libpostproc
  2147. includedir=\${pcfiledir}/libpostproc
  2148. Name: libpostproc
  2149. Description: FFmpeg post processing library
  2150. Version: $lavc_version
  2151. Requires:
  2152. Conflicts:
  2153. Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
  2154. Cflags: -I\${includedir}
  2155. EOF
  2156. # libswscale.pc
  2157. cat <<EOF >libswscale.pc
  2158. prefix=$PREFIX
  2159. exec_prefix=\${prefix}
  2160. libdir=\${exec_prefix}/lib
  2161. includedir=\${prefix}/include
  2162. Name: libswscale
  2163. Description: FFmpeg image rescaling library
  2164. Version: $sws_version
  2165. Requires: $pkg_requires libavutil = $lavu_version
  2166. Conflicts:
  2167. Libs: -L\${libdir} -lswscale
  2168. Cflags: -I\${includedir} -I\${includedir}/swscale
  2169. EOF
  2170. cat <<EOF >libswscale-uninstalled.pc
  2171. prefix=
  2172. exec_prefix=
  2173. libdir=\${pcfiledir}/libswscale
  2174. includedir=\${pcfiledir}/libswscale
  2175. Name: libswscale
  2176. Description: FFmpeg image rescaling library
  2177. Version: $sws_version
  2178. Requires: $pkg_requires libavutil = $lavu_version
  2179. Conflicts:
  2180. Libs: \${libdir}/${LIBPREF}swscale${LIBSUF}
  2181. Cflags: -I\${includedir}
  2182. EOF