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.

2415 lines
63KB

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