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.

1902 lines
46KB

  1. #!/bin/sh
  2. #
  3. # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
  4. #
  5. if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
  6. cat << EOF
  7. Usage: configure [options]
  8. Options: [defaults in brackets after descriptions]
  9. EOF
  10. echo "Standard options:"
  11. echo " --help print this message"
  12. echo " --prefix=PREFIX install in PREFIX [$prefix]"
  13. echo " --libdir=DIR install libs in DIR [PREFIX/lib]"
  14. echo " --mandir=DIR install man page in DIR [PREFIX/man]"
  15. echo " --enable-mp3lame enable MP3 encoding via libmp3lame [default=no]"
  16. echo " --enable-libogg enable Ogg support via libogg [default=no]"
  17. echo " --enable-vorbis enable Vorbis support via libvorbis [default=no]"
  18. echo " --enable-theora enable Theora support via libtheora [default=no]"
  19. echo " --enable-faad enable FAAD support via libfaad [default=no]"
  20. echo " --enable-faadbin build FAAD support with runtime linking [default=no]"
  21. echo " --enable-faac enable FAAC support via libfaac [default=no]"
  22. echo " --enable-libgsm enable GSM support via libgsm [default=no]"
  23. echo " --enable-xvid enable XviD support via xvidcore [default=no]"
  24. echo " --enable-x264 enable H.264 encoding via x264 [default=no]"
  25. echo " --enable-mingw32 enable MinGW native/cross Windows compile"
  26. echo " --enable-a52 enable GPLed A52 support [default=no]"
  27. echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
  28. echo " --enable-dts enable GPLed DTS support [default=no]"
  29. echo " --enable-pp enable GPLed postprocessing support [default=no]"
  30. echo " --enable-shared-pp use libpostproc.so [default=no]"
  31. echo " --enable-shared build shared libraries [default=no]"
  32. echo " --enable-amr_nb enable amr_nb float audio codec"
  33. echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
  34. echo " --enable-amr_wb enable amr_wb float audio codec"
  35. echo " --enable-amr_if2 enable amr_wb IF2 audio codec"
  36. echo " --enable-sunmlib use Sun medialib [default=no]"
  37. echo " --enable-pthreads use pthreads [default=no]"
  38. echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394"
  39. echo " and libraw1394 [default=no]"
  40. echo " --enable-gpl allow use of GPL code, the resulting libav*"
  41. echo " and ffmpeg will be under GPL [default=no]"
  42. echo ""
  43. echo "Advanced options (experts only):"
  44. echo " --source-path=PATH path to source code [$source_path]"
  45. echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]"
  46. echo " --cc=CC use C compiler CC [$cc]"
  47. echo " --make=MAKE use specified make [$make]"
  48. echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
  49. echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
  50. echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
  51. echo " --build-suffix=SUFFIX suffix for application specific build []"
  52. echo " --cpu=CPU force cpu to CPU [$cpu]"
  53. echo " --tune=CPU tune code for a particular CPU"
  54. echo " (may fail or perform badly on other CPUs)"
  55. echo " --powerpc-perf-enable enable performance report on PPC"
  56. echo " (requires enabling PMC)"
  57. echo " --disable-mmx disable MMX usage"
  58. echo " --disable-iwmmxt disable iwmmxt usage"
  59. echo " --disable-altivec disable AltiVec usage"
  60. echo " --disable-audio-oss disable OSS audio support [default=no]"
  61. echo " --disable-audio-beos disable BeOS audio support [default=no]"
  62. echo " --disable-v4l disable video4linux grabbing [default=no]"
  63. echo " --disable-bktr disable bktr video grabbing [default=no]"
  64. echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
  65. echo " --disable-network disable network support [default=no]"
  66. echo " --disable-zlib disable zlib [default=no]"
  67. echo " --disable-simple_idct disable simple IDCT routines [default=no]"
  68. echo " --disable-vhook disable video hooking support"
  69. echo " --enable-gprof enable profiling with gprof [$gprof]"
  70. echo " --disable-debug disable debugging symbols"
  71. echo " --disable-opts disable compiler optimizations"
  72. echo " --disable-mpegaudio-hp faster (but less accurate)"
  73. echo " MPEG audio decoding [default=no]"
  74. echo " --disable-ffserver disable ffserver build"
  75. echo " --disable-ffplay disable ffplay build"
  76. echo " --enable-small optimize for size instead of speed"
  77. echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
  78. echo " --disable-strip disable stripping of executables and shared libraries"
  79. echo " --enable-codec=CODEC enables CODEC"
  80. echo " --disable-codec=CODEC disables CODEC"
  81. echo " --disable-encoders disables all encoders"
  82. echo " --disable-decoders disables all decoders"
  83. echo " --disable-muxers disables all muxers"
  84. echo " --disable-demuxers disables all demuxers"
  85. echo ""
  86. echo "NOTE: Object files are built at the place where configure is launched."
  87. exit 1
  88. fi
  89. # set temporary file name
  90. if test ! -z "$TMPDIR" ; then
  91. TMPDIR1="${TMPDIR}"
  92. elif test ! -z "$TEMPDIR" ; then
  93. TMPDIR1="${TEMPDIR}"
  94. else
  95. TMPDIR1="/tmp"
  96. fi
  97. TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
  98. TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
  99. TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
  100. TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
  101. TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
  102. # default parameters
  103. prefix="/usr/local"
  104. libdir=""
  105. mandir=""
  106. bindir=""
  107. cross_prefix=""
  108. cc="gcc"
  109. ar="ar"
  110. ranlib="ranlib"
  111. make="make"
  112. strip="strip"
  113. cpu=`uname -m`
  114. tune="generic"
  115. powerpc_perf="no"
  116. mmx="default"
  117. iwmmxt="default"
  118. altivec="default"
  119. mmi="default"
  120. case "$cpu" in
  121. i386|i486|i586|i686|i86pc|BePC)
  122. cpu="x86"
  123. ;;
  124. x86_64|amd64)
  125. cpu="x86"
  126. canon_arch="`cc -dumpmachine | sed -e 's,\([^-]*\)-.*,\1,'`"
  127. if [ x"$canon_arch" = x"x86_64" -o x"$canon_arch" = x"amd64" ]; then
  128. if [ -z "`echo $CFLAGS | grep -- -m32`" ]; then
  129. cpu="x86_64"
  130. fi
  131. fi
  132. ;;
  133. # armv4l is a subset of armv5tel
  134. armv4l|armv5tel)
  135. cpu="armv4l"
  136. ;;
  137. alpha)
  138. cpu="alpha"
  139. ;;
  140. "Power Macintosh"|ppc)
  141. cpu="powerpc"
  142. ;;
  143. mips|mipsel)
  144. cpu="mips"
  145. ;;
  146. sun4u|sparc64)
  147. cpu="sparc64"
  148. ;;
  149. sparc)
  150. cpu="sparc"
  151. ;;
  152. sh4)
  153. cpu="sh4"
  154. ;;
  155. parisc|parisc64)
  156. cpu="parisc"
  157. ;;
  158. s390|s390x)
  159. cpu="s390"
  160. ;;
  161. m68k)
  162. cpu="m68k"
  163. ;;
  164. ia64)
  165. cpu="ia64"
  166. ;;
  167. *)
  168. cpu="unknown"
  169. ;;
  170. esac
  171. gprof="no"
  172. v4l="yes"
  173. bktr="no"
  174. audio_oss="yes"
  175. audio_beos="no"
  176. dv1394="yes"
  177. dc1394="no"
  178. network="yes"
  179. zlib="yes"
  180. libgsm="no"
  181. mp3lame="no"
  182. libogg="no"
  183. vorbis="no"
  184. theora="no"
  185. faad="no"
  186. faadbin="no"
  187. faac="no"
  188. xvid="no"
  189. x264="no"
  190. a52="no"
  191. a52bin="no"
  192. dts="no"
  193. pp="no"
  194. shared_pp="no"
  195. mingw32="no"
  196. cygwin="no"
  197. os2="no"
  198. lshared="no"
  199. optimize="yes"
  200. debug="yes"
  201. dostrip="yes"
  202. extralibs="-lm"
  203. simpleidct="yes"
  204. bigendian="no"
  205. inttypes="yes"
  206. emu_fast_int="no"
  207. vhook="default"
  208. dlfcn="no"
  209. dlopen="no"
  210. mpegaudio_hp="yes"
  211. SHFLAGS=-shared
  212. netserver="no"
  213. need_inet_aton="no"
  214. ffserver="yes"
  215. ffplay="yes"
  216. LIBOBJFLAGS=""
  217. LDFLAGS=-Wl,--warn-common
  218. FFSLDFLAGS=-Wl,-E
  219. LDCONFIG="ldconfig"
  220. LIBPREF="lib"
  221. LIBSUF=".a"
  222. SLIBPREF="lib"
  223. SLIBSUF=".so"
  224. EXESUF=""
  225. BUILDSUF=""
  226. amr_nb="no"
  227. amr_wb="no"
  228. amr_nb_fixed="no"
  229. amr_if2="no"
  230. sunmlib="no"
  231. pthreads="no"
  232. gpl="no"
  233. memalignhack="no"
  234. muxers="yes"
  235. demuxers="yes"
  236. # OS specific
  237. targetos=`uname -s`
  238. case $targetos in
  239. BeOS)
  240. prefix="/boot/home/config"
  241. # helps building libavcodec
  242. CFLAGS="-DPIC -fomit-frame-pointer"
  243. # 3 gcc releases known for BeOS, each with ugly bugs
  244. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  245. case "$gcc_version" in
  246. 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
  247. mmx="no"
  248. ;;
  249. *20010315*) echo "BeBits gcc"
  250. CFLAGS="$CFLAGS -fno-expensive-optimizations"
  251. ;;
  252. esac
  253. SHFLAGS=-nostart
  254. # disable Linux things
  255. audio_oss="no"
  256. v4l="no"
  257. dv1394="no"
  258. # enable BeOS things
  259. audio_beos="yes"
  260. # no need for libm, but the inet stuff
  261. # Check for BONE
  262. if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
  263. extralibs="-lbind -lsocket"
  264. else
  265. netserver="yes"
  266. need_inet_aton="yes"
  267. extralibs="-lnet"
  268. fi ;;
  269. SunOS)
  270. v4l="no"
  271. audio_oss="no"
  272. dv1394="no"
  273. make="gmake"
  274. LDFLAGS=""
  275. FFSLDFLAGS=""
  276. need_inet_aton="yes"
  277. extralibs="$extralibs -lsocket -lnsl"
  278. ;;
  279. NetBSD)
  280. v4l="no"
  281. bktr="yes"
  282. audio_oss="yes"
  283. dv1394="no"
  284. make="gmake"
  285. LDFLAGS="$LDFLAGS -export-dynamic"
  286. case `uname -r` in
  287. 2.*) extralibs="-lossaudio"
  288. ;;
  289. esac
  290. ;;
  291. OpenBSD)
  292. v4l="no"
  293. bktr="yes"
  294. audio_oss="yes"
  295. dv1394="no"
  296. make="gmake"
  297. LIBOBJFLAGS="\$(PIC)"
  298. LDFLAGS="$LDFLAGS -export-dynamic -pthread"
  299. LDCONFIG="ldconfig -m \$(libdir)"
  300. extralibs="$extralibs -lossaudio"
  301. ;;
  302. FreeBSD)
  303. v4l="no"
  304. bktr="yes"
  305. audio_oss="yes"
  306. dv1394="no"
  307. make="gmake"
  308. CFLAGS="-pthread"
  309. LDFLAGS="$LDFLAGS -export-dynamic -pthread"
  310. ;;
  311. BSD/OS)
  312. v4l="no"
  313. bktr="yes"
  314. audio_oss="yes"
  315. dv1394="no"
  316. extralibs="-lpoll -lgnugetopt -lm"
  317. make="gmake"
  318. ;;
  319. Darwin)
  320. cc="cc"
  321. v4l="no"
  322. audio_oss="no"
  323. dv1394="no"
  324. ffserver="no"
  325. SHFLAGS="-dynamiclib"
  326. extralibs=""
  327. darwin="yes"
  328. strip="strip -x"
  329. LDFLAGS="-Wl,-search_paths_first"
  330. FFSLDFLAGS=-Wl,-bind_at_load
  331. ;;
  332. MINGW32*)
  333. # Note: the rest of the mingw32 config is done afterwards as mingw32
  334. # can be forced on the command line for Linux cross compilation.
  335. mingw32="yes"
  336. ;;
  337. CYGWIN*)
  338. v4l="no"
  339. audio_oss="yes"
  340. dv1394="no"
  341. ffserver="no"
  342. extralibs=""
  343. cygwin="yes"
  344. EXESUF=".exe"
  345. ;;
  346. Linux)
  347. LDFLAGS="$LDFLAGS -rdynamic"
  348. ;;
  349. IRIX*)
  350. ranlib="echo ignoring ranlib"
  351. v4l="no"
  352. audio_oss="no"
  353. make="gmake"
  354. ;;
  355. OS/2)
  356. TMPE=$TMPE".exe"
  357. ar="emxomfar -p128"
  358. ranlib="echo ignoring ranlib"
  359. strip="echo ignoring strip"
  360. CFLAGS="-Zomf"
  361. LDFLAGS="-Zomf -Zstack 16384 -s"
  362. SHFLAGS="-Zdll -Zomf"
  363. FFSLDFLAGS=""
  364. LIBPREF=""
  365. LIBSUF=".lib"
  366. SLIBPREF=""
  367. SLIBSUF=".dll"
  368. EXESUF=".exe"
  369. extralibs=""
  370. v4l="no"
  371. audio_oss="no"
  372. dv1394="no"
  373. network="no"
  374. ffserver="no"
  375. vhook="no"
  376. os2="yes"
  377. ;;
  378. *) ;;
  379. esac
  380. # From MPlayer configure. We need TARGET_OS available
  381. # to the Makefile, so it can distinguish between flavors
  382. # of AltiVec on PowerPC.
  383. TARGET_OS=`( uname -s ) 2>&1`
  384. case "$TARGET_OS" in
  385. Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS)
  386. ;;
  387. IRIX*)
  388. TARGET_OS=IRIX
  389. ;;
  390. HP-UX*)
  391. TARGET_OS=HP-UX
  392. ;;
  393. [cC][yY][gG][wW][iI][nN]*)
  394. TARGET_OS=CYGWIN
  395. ;;
  396. *)
  397. TARGET_OS="$TARGET_OS-UNKNOWN"
  398. ;;
  399. esac
  400. # find source path
  401. source_path="`echo $0 | sed -e 's#/configure##'`"
  402. source_path_used="yes"
  403. if test -z "$source_path" -o "$source_path" = "." ; then
  404. source_path=`pwd`
  405. source_path_used="no"
  406. else
  407. source_path="`cd \"$source_path\"; pwd`"
  408. fi
  409. FFMPEG_CONFIGURATION=" "
  410. for opt do
  411. FFMPEG_CONFIGURATION="$FFMPEG_CONFIGURATION""$opt "
  412. done
  413. CODEC_LIST=`grep 'register_avcodec(&[a-z]' $source_path/libavcodec/allcodecs.c | sed 's/.*&\(.*\)).*/\1/'`
  414. for opt do
  415. case "$opt" in
  416. --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`; force_prefix=yes
  417. ;;
  418. --libdir=*) libdir=`echo $opt | cut -d '=' -f 2`; force_libdir=yes
  419. ;;
  420. --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
  421. ;;
  422. --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
  423. ;;
  424. --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
  425. ;;
  426. --cc=*) cc=`echo $opt | cut -d '=' -f 2-`
  427. ;;
  428. --make=*) make=`echo $opt | cut -d '=' -f 2`
  429. ;;
  430. --extra-cflags=*) CFLAGS="$CFLAGS ${opt#--extra-cflags=}"
  431. ;;
  432. --extra-ldflags=*) LDFLAGS="$LDFLAGS ${opt#--extra-ldflags=}"
  433. ;;
  434. --extra-libs=*) extralibs=${opt#--extra-libs=}
  435. ;;
  436. --build-suffix=*) BUILDSUF=${opt#--build-suffix=}
  437. ;;
  438. --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
  439. ;;
  440. --tune=*) tune=`echo $opt | cut -d '=' -f 2`
  441. ;;
  442. --powerpc-perf-enable) powerpc_perf="yes"
  443. ;;
  444. --disable-mmx) mmx="no"
  445. ;;
  446. --disable-iwmmxt) iwmmxt="no"
  447. ;;
  448. --disable-altivec) altivec="no"
  449. ;;
  450. --enable-gprof) gprof="yes"
  451. ;;
  452. --disable-v4l) v4l="no"
  453. ;;
  454. --disable-bktr) bktr="no"
  455. ;;
  456. --disable-audio-oss) audio_oss="no"
  457. ;;
  458. --disable-audio-beos) audio_beos="no"
  459. ;;
  460. --disable-dv1394) dv1394="no"
  461. ;;
  462. --disable-network) network="no"; ffserver="no"
  463. ;;
  464. --disable-zlib) zlib="no"
  465. ;;
  466. --enable-a52) a52="yes"
  467. ;;
  468. --enable-a52bin) a52bin="yes"
  469. ;;
  470. --enable-dts) dts="yes" ; extralibs="$extralibs -ldts"
  471. ;;
  472. --enable-pp) pp="yes"
  473. ;;
  474. --enable-shared-pp) shared_pp="yes"
  475. ;;
  476. --enable-libgsm) libgsm="yes"
  477. ;;
  478. --enable-mp3lame) mp3lame="yes"
  479. ;;
  480. --enable-libogg) libogg="yes"
  481. ;;
  482. --enable-vorbis) vorbis="yes"
  483. ;;
  484. --enable-theora) theora="yes"
  485. ;;
  486. --enable-faad) faad="yes"
  487. ;;
  488. --enable-faadbin) faadbin="yes"
  489. ;;
  490. --enable-faac) faac="yes"
  491. ;;
  492. --enable-xvid) xvid="yes"
  493. ;;
  494. --enable-x264) x264="yes"; extralibs="$extralibs -lx264"
  495. ;;
  496. --enable-dc1394) dc1394="yes"
  497. ;;
  498. --disable-vhook) vhook="no"
  499. ;;
  500. --disable-simple_idct) simpleidct="no"
  501. ;;
  502. --enable-mingw32) mingw32="yes"
  503. ;;
  504. --enable-shared) lshared="yes"
  505. ;;
  506. --disable-debug) debug="no"
  507. ;;
  508. --disable-opts) optimize="no"
  509. ;;
  510. --disable-mpegaudio-hp) mpegaudio_hp="no"
  511. ;;
  512. --disable-ffserver) ffserver="no"
  513. ;;
  514. --disable-ffplay) ffplay="no"
  515. ;;
  516. --enable-small) optimize="small"
  517. ;;
  518. --enable-amr_nb) amr_nb="yes"
  519. ;;
  520. --enable-amr_nb-fixed) amr_nb_fixed="yes"
  521. ;;
  522. --enable-amr_wb) amr_wb="yes"
  523. ;;
  524. --enable-amr_if2) amr_if2="yes"
  525. ;;
  526. --enable-sunmlib) sunmlib="yes"
  527. ;;
  528. --enable-pthreads) pthreads="yes"
  529. ;;
  530. --enable-gpl) gpl="yes"
  531. ;;
  532. --enable-memalign-hack) memalignhack="yes"
  533. ;;
  534. --disable-strip) dostrip="no"
  535. ;;
  536. --enable-codec=*) CODEC_LIST="$CODEC_LIST ${opt#--enable-codec=}"
  537. ;;
  538. --disable-codec=*) CODEC_LIST="`echo $CODEC_LIST | sed -e \"s#${opt#--disable-codec=}##\"`"
  539. ;;
  540. --disable-encoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*encoder//g'`"
  541. ;;
  542. --disable-decoders) CODEC_LIST="`echo $CODEC_LIST | sed 's/[-_a-zA-Z0-9]*decoder//g'`"
  543. ;;
  544. --disable-muxers) muxers="no"
  545. ;;
  546. --disable-demuxers) demuxers="no"
  547. ;;
  548. *)
  549. echo "Unknown option \"$opt\"."
  550. echo "See $0 --help for available options."
  551. exit 1
  552. ;;
  553. esac
  554. done
  555. if test "$theora" = "yes" ; then
  556. if test "$libogg" = "no"; then
  557. echo "libogg must be enabled to enable Theora."
  558. fail="yes"
  559. theora="no"
  560. fi
  561. fi
  562. if test "$vorbis" = "yes" ; then
  563. if test "$libogg" = "no"; then
  564. echo "libogg must be enabled to enable Vorbis."
  565. fail="yes"
  566. vorbis="no"
  567. fi
  568. fi
  569. if test "$gpl" != "yes"; then
  570. if test "$pp" != "no" -o "$shared_pp" != "no"; then
  571. echo "The Postprocessing code is under GPL and --enable-gpl is not specified."
  572. fail="yes"
  573. fi
  574. if test "$a52" != "no" -o "$a52bin" != "no"; then
  575. echo "liba52 is under GPL and --enable-gpl is not specified."
  576. fail="yes"
  577. fi
  578. if test "$xvid" != "no"; then
  579. echo "libxvidcore is under GPL and --enable-gpl is not specified."
  580. fail="yes"
  581. fi
  582. if test "$x264" != "no"; then
  583. echo "x264 is under GPL and --enable-gpl is not specified."
  584. fail="yes"
  585. fi
  586. if test "$dts" != "no"; then
  587. echo "libdts is under GPL and --enable-gpl is not specified."
  588. fail="yes"
  589. fi
  590. if test "$faad" != "no" -o "$faadbin" != "no"; then
  591. cat > $TMPC << EOF
  592. #include <faad.h>
  593. int main( void ) { return 0; }
  594. EOF
  595. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  596. cat > $TMPC << EOF
  597. #include <faad.h>
  598. #ifndef FAAD2_VERSION
  599. ok faad1
  600. #endif
  601. int main( void ) { return 0; }
  602. EOF
  603. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  604. echo "FAAD2 is under GPL and --enable-gpl is not specified."
  605. fail="yes"
  606. fi
  607. else
  608. faad="no"
  609. faadbin="no"
  610. echo "FAAD test failed."
  611. fi
  612. fi
  613. if test "$fail" = "yes"; then
  614. exit 1
  615. fi
  616. fi
  617. # compute MMX state
  618. if test $mmx = "default"; then
  619. if test $cpu = "x86" -o $cpu = "x86_64"; then
  620. mmx="yes"
  621. else
  622. mmx="no"
  623. fi
  624. fi
  625. # check iwmmxt support
  626. if test $iwmmxt = "default" -a $cpu = "armv4l"; then
  627. cat > $TMPC << EOF
  628. int main(void) {
  629. __asm__ __volatile__ ("wunpckelub wr6, wr4");
  630. }
  631. EOF
  632. iwmmxt=no
  633. if ${cross_prefix}${cc} -o $TMPO $TMPC 2> /dev/null ; then
  634. iwmmxt=yes
  635. fi
  636. fi
  637. #Darwin CC versions
  638. needmdynamicnopic="no"
  639. if test $targetos = Darwin; then
  640. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  641. CFLAGS="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
  642. else
  643. gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
  644. case "$gcc_version" in
  645. *2.95*)
  646. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
  647. ;;
  648. *[34].*)
  649. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
  650. if test "$lshared" = no; then
  651. needmdynamicnopic="yes"
  652. fi
  653. ;;
  654. *)
  655. CFLAGS="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
  656. if test "$lshared" = no; then
  657. needmdynamicnopic="yes"
  658. fi
  659. ;;
  660. esac
  661. fi
  662. fi
  663. # Can only do AltiVec on PowerPC
  664. if test $altivec = "default"; then
  665. if test $cpu = "powerpc"; then
  666. altivec="yes"
  667. else
  668. altivec="no"
  669. fi
  670. fi
  671. # Add processor-specific flags
  672. TUNECPU="generic"
  673. POWERPCMODE="32bits"
  674. if test $tune != "generic"; then
  675. case $tune in
  676. 601|ppc601|PowerPC601)
  677. CFLAGS="$CFLAGS -mcpu=601"
  678. if test $altivec = "yes"; then
  679. echo "WARNING: Tuning for PPC601 but AltiVec enabled!";
  680. fi
  681. TUNECPU=ppc601
  682. ;;
  683. 603*|ppc603*|PowerPC603*)
  684. CFLAGS="$CFLAGS -mcpu=603"
  685. if test $altivec = "yes"; then
  686. echo "WARNING: Tuning for PPC603 but AltiVec enabled!";
  687. fi
  688. TUNECPU=ppc603
  689. ;;
  690. 604*|ppc604*|PowerPC604*)
  691. CFLAGS="$CFLAGS -mcpu=604"
  692. if test $altivec = "yes"; then
  693. echo "WARNING: Tuning for PPC604 but AltiVec enabled!";
  694. fi
  695. TUNECPU=ppc604
  696. ;;
  697. G3|g3|75*|ppc75*|PowerPC75*)
  698. CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
  699. if test $altivec = "yes"; then
  700. echo "WARNING: Tuning for PPC75x but AltiVec enabled!";
  701. fi
  702. TUNECPU=ppc750
  703. ;;
  704. G4|g4|745*|ppc745*|PowerPC745*)
  705. CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
  706. if test $altivec = "no"; then
  707. echo "WARNING: Tuning for PPC745x but AltiVec disabled!";
  708. fi
  709. TUNECPU=ppc7450
  710. ;;
  711. 74*|ppc74*|PowerPC74*)
  712. CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
  713. if test $altivec = "no"; then
  714. echo "WARNING: Tuning for PPC74xx but AltiVec disabled!";
  715. fi
  716. TUNECPU=ppc7400
  717. ;;
  718. G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
  719. CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
  720. if test $altivec = "no"; then
  721. echo "WARNING: Tuning for PPC970 but AltiVec disabled!";
  722. fi
  723. TUNECPU=ppc970
  724. POWERPCMODE="64bits"
  725. ;;
  726. i[3456]86|pentium|pentiumpro|pentium-mmx|pentium[234]|prescott|k6|k6-[23]|athlon|athlon-tbird|athlon-4|athlon-[mx]p|winchip-c6|winchip2|c3|nocona)
  727. CFLAGS="$CFLAGS -march=$tune"
  728. ;;
  729. *)
  730. echo "WARNING: Unknown CPU \"$tune\", ignored."
  731. ;;
  732. esac
  733. fi
  734. # AltiVec flags: The FSF version of GCC differs from the Apple version
  735. if test $cpu = "powerpc"; then
  736. if test $altivec = "yes"; then
  737. if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
  738. CFLAGS="$CFLAGS -faltivec"
  739. else
  740. CFLAGS="$CFLAGS -maltivec -mabi=altivec"
  741. fi
  742. fi
  743. fi
  744. # check if we have <altivec.h>
  745. cat > $TMPC << EOF
  746. #include <altivec.h>
  747. int main( void ) { return 0; }
  748. EOF
  749. _altivec_h="no"
  750. if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
  751. _altivec_h="yes"
  752. fi
  753. # check if our compiler supports Motorola AltiVec C API
  754. if test $altivec = "yes"; then
  755. if test $_altivec_h = "yes"; then
  756. cat > $TMPC << EOF
  757. #include <altivec.h>
  758. int main(void) {
  759. vector signed int v1, v2, v3;
  760. v1 = vec_add(v2,v3);
  761. return 0;
  762. }
  763. EOF
  764. else
  765. cat > $TMPC << EOF
  766. int main(void) {
  767. vector signed int v1, v2, v3;
  768. v1 = vec_add(v2,v3);
  769. return 0;
  770. }
  771. EOF
  772. fi
  773. $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
  774. fi
  775. # mmi only available on mips
  776. if test $mmi = "default"; then
  777. if test $cpu = "mips"; then
  778. mmi="yes"
  779. else
  780. mmi="no"
  781. fi
  782. fi
  783. # check if our compiler supports mmi
  784. if test $mmi = "yes"; then
  785. cat > $TMPC << EOF
  786. int main(void) {
  787. __asm__ ("lq \$2, 0(\$2)");
  788. return 0;
  789. }
  790. EOF
  791. $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
  792. fi
  793. if test "$mingw32" = "yes" ; then
  794. v4l="no"
  795. bktr="no"
  796. audio_oss="no"
  797. dv1394="no"
  798. dc1394="no"
  799. ffserver="no"
  800. network="no"
  801. SLIBPREF=""
  802. SLIBSUF=".dll"
  803. EXESUF=".exe"
  804. if test "$force_prefix" != yes; then prefix="/c/Program Files/FFmpeg"; fi
  805. if test "$force_libdir" != yes; then bindir="$prefix"; fi
  806. fi
  807. cc="${cross_prefix}${cc}"
  808. ar="${cross_prefix}${ar}"
  809. ranlib="${cross_prefix}${ranlib}"
  810. strip="${cross_prefix}${strip}"
  811. if test -z "$cross_prefix" ; then
  812. # ---
  813. # big/little-endian test
  814. cat > $TMPC << EOF
  815. #include <inttypes.h>
  816. int main(int argc, char ** argv){
  817. volatile uint32_t i=0x01234567;
  818. return (*((uint8_t*)(&i))) == 0x67;
  819. }
  820. EOF
  821. if $cc -o $TMPE $TMPC 2>/dev/null ; then
  822. $TMPE && bigendian="yes"
  823. else
  824. echo big/little test failed
  825. fi
  826. else
  827. # programs cannot be launched if cross compiling, so make a static guess
  828. if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
  829. bigendian="yes"
  830. fi
  831. fi
  832. # ---
  833. # *inttypes.h* test
  834. cat > $TMPC << EOF
  835. #include <inttypes.h>
  836. int main(int argc, char ** argv){
  837. return 0;
  838. }
  839. EOF
  840. $cc -o $TMPE $TMPC 2>/dev/null || inttypes="no"
  841. # ---
  842. # *int_fast* test
  843. cat > $TMPC << EOF
  844. #include <inttypes.h>
  845. int main(int argc, char ** argv){
  846. volatile uint_fast64_t i=0x01234567;
  847. return 0;
  848. }
  849. EOF
  850. $cc -o $TMPE $TMPC 2>/dev/null || emu_fast_int="yes"
  851. # ---
  852. # check availability of some header files
  853. cat > $TMPC << EOF
  854. #include <malloc.h>
  855. int main( void ) { return 0; }
  856. EOF
  857. _memalign=no
  858. _malloc_h=no
  859. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  860. _malloc_h=yes
  861. _memalign=yes
  862. # check for memalign - atmos
  863. cat > $TMPC << EOF
  864. #include <stdio.h>
  865. #include <malloc.h>
  866. int main ( void ) {
  867. char *string = NULL;
  868. string = memalign(64, sizeof(char));
  869. return 0;
  870. }
  871. EOF
  872. $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
  873. fi
  874. if test "$_memalign" = "no" -a "$mmx" = "yes" -a "$memalignhack" != "yes"; then
  875. echo "Error, no memalign() but SSE enabled, disable it or use --enable-memalign-hack."
  876. exit 1
  877. fi
  878. cat > $TMPC << EOF
  879. #include <time.h>
  880. int main( void ) { localtime_r(NULL, NULL); }
  881. EOF
  882. localtime_r=no
  883. if $cc -o $TMPE $TMPC 2> /dev/null ; then
  884. localtime_r=yes
  885. fi
  886. if test "$zlib" = "yes"; then
  887. # check for zlib - mmu_man
  888. cat > $TMPC << EOF
  889. #include <zlib.h>
  890. int main ( void ) {
  891. if (zlibVersion() != ZLIB_VERSION)
  892. puts("zlib version differs !!!");
  893. return 1;
  894. return 0;
  895. }
  896. EOF
  897. $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
  898. # $TMPE 2> /dev/null > /dev/null || zlib="no"
  899. # XXX: more tests needed - runtime test
  900. fi
  901. if test "$zlib" = "yes"; then
  902. extralibs="$extralibs -lz"
  903. fi
  904. # test for lrintf in math.h
  905. cat > $TMPC << EOF
  906. #define _ISOC9X_SOURCE 1
  907. #include <math.h>
  908. int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
  909. EOF
  910. have_lrintf="no"
  911. if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
  912. have_lrintf="yes"
  913. # allanc@chickenandporn.com: cannot execute cross-compiled
  914. # code on the host. Only execute if not cross-compiling.
  915. if test -z "$cross_prefix" ; then
  916. $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
  917. fi
  918. fi
  919. _restrict=
  920. for restrict_keyword in restrict __restrict__ __restrict; do
  921. echo "void foo(char * $restrict_keyword p);" > $TMPC
  922. if $cc -c -o $TMPO $TMPC 2> /dev/null; then
  923. _restrict=$restrict_keyword
  924. break;
  925. fi
  926. done
  927. # test gcc version to see if vector builtins can be used
  928. # currently only used on i386 for MMX builtins
  929. cat > $TMPC << EOF
  930. #include <xmmintrin.h>
  931. int main(void) {
  932. #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
  933. return 0;
  934. #else
  935. #error no vector builtins
  936. #endif
  937. }
  938. EOF
  939. builtin_vector=no
  940. if $cc -msse -o $TMPO $TMPC 2> /dev/null ; then
  941. builtin_vector=yes
  942. fi
  943. # dlopen/dlfcn.h probing
  944. cat > $TMPC << EOF
  945. #include <dlfcn.h>
  946. int main( void ) { return (int) dlopen("foo", 0); }
  947. EOF
  948. ldl=-ldl
  949. if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  950. dlfcn=yes
  951. dlopen=yes
  952. fi
  953. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  954. dlfcn=yes
  955. dlopen=yes
  956. ldl=""
  957. fi
  958. cat > $TMPC << EOF
  959. int main( void ) { return (int) dlopen("foo", 0); }
  960. EOF
  961. if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
  962. dlopen=yes
  963. fi
  964. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  965. dlopen=yes
  966. ldl=""
  967. fi
  968. if test "$vhook" = "default" ; then
  969. vhook="$dlopen"
  970. fi
  971. if test "$vhook" = "yes" -o "$a52bin" = "yes" -o "$faadbin" = "yes"; then
  972. extralibs="$extralibs $ldl"
  973. fi
  974. ##########################################
  975. # imlib check
  976. cat > $TMPC << EOF
  977. #include <X11/Xlib.h>
  978. #include <Imlib2.h>
  979. int main( void ) { return (int) imlib_load_font("foo"); }
  980. EOF
  981. imlib2=no
  982. if $cc $CFLAGS $LDFLAGS -o $TMPE $TMPC -lImlib2 -lm > /dev/null 2>&1 ; then
  983. imlib2=yes
  984. fi
  985. ##########################################
  986. # FreeType check
  987. cat > $TMPC << EOF
  988. #include <ft2build.h>
  989. int main( void ) { return (int) FT_Init_FreeType(0); }
  990. EOF
  991. freetype2=no
  992. if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
  993. if (freetype-config --version) >/dev/null 2>&1 ; then
  994. if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
  995. freetype2=yes
  996. fi
  997. fi
  998. fi
  999. ##########################################
  1000. # SDL check
  1001. cat > $TMPC << EOF
  1002. #include <SDL.h>
  1003. #undef main /* We don't want SDL to override our main() */
  1004. int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
  1005. EOF
  1006. sdl_too_old=no
  1007. sdl=no
  1008. if (sdl-config --version) >/dev/null 2>&1 ; then
  1009. if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
  1010. _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
  1011. if test "$_sdlversion" -lt 121 ; then
  1012. sdl_too_old=yes
  1013. else
  1014. sdl=yes
  1015. fi
  1016. fi
  1017. fi
  1018. ##########################################
  1019. # texi2html check
  1020. texi2html=no
  1021. if (texi2html -version) >/dev/null 2>&1; then
  1022. texi2html=yes
  1023. fi
  1024. if test "$network" = "yes" ; then
  1025. ##########################################
  1026. # IPv6 check
  1027. cat > $TMPC << EOF
  1028. #include <sys/types.h>
  1029. #include <sys/socket.h>
  1030. #include <netinet/in.h>
  1031. #include <netdb.h>
  1032. int main( void ) {
  1033. struct sockaddr_storage saddr;
  1034. struct ipv6_mreq mreq6;
  1035. getaddrinfo(0,0,0,0);
  1036. getnameinfo(0,0,0,0,0,0,0);
  1037. IN6_IS_ADDR_MULTICAST(0);
  1038. }
  1039. EOF
  1040. ipv6=no
  1041. if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
  1042. ipv6=yes
  1043. fi
  1044. fi
  1045. case "`$cc -v 2>&1 | grep version`" in
  1046. *gcc*)
  1047. CFLAGS="-Wall -Wno-switch $CFLAGS"
  1048. ;;
  1049. *)
  1050. ;;
  1051. esac
  1052. if test "$sdl" = "no" ; then
  1053. ffplay=no
  1054. fi
  1055. if test "$debug" = "yes"; then
  1056. CFLAGS="-g $CFLAGS"
  1057. fi
  1058. if test "$optimize" = "small"; then
  1059. # CFLAGS=${CFLAGS//-O3/-Os}
  1060. CFLAGS="$CFLAGS -Os"
  1061. fi
  1062. if test "$optimize" = "yes"; then
  1063. if test -n "`$cc -v 2>&1 | grep xlc`"; then
  1064. CFLAGS="$CFLAGS -O5"
  1065. LDFLAGS="$LDFLAGS -O5"
  1066. else
  1067. CFLAGS="-O3 $CFLAGS"
  1068. fi
  1069. fi
  1070. # PIC flags for shared library objects where they are needed
  1071. if test "$lshared" = "yes" ; then
  1072. # LIBOBJFLAGS may have already been set in the OS configuration
  1073. if test -z "$LIBOBJFLAGS" ; then
  1074. if test "$cpu" = "x86_64" -o "$cpu" = "ia64" ; then
  1075. LIBOBJFLAGS="\$(PIC)"
  1076. fi
  1077. fi
  1078. fi
  1079. if test x"$bindir" = x""; then
  1080. bindir="${prefix}/bin"
  1081. fi
  1082. if test x"$libdir" = x""; then
  1083. libdir="${prefix}/lib"
  1084. fi
  1085. if test x"$mandir" = x""; then
  1086. mandir="${prefix}/man"
  1087. fi
  1088. echo "install prefix $prefix"
  1089. echo "source path $source_path"
  1090. echo "C compiler $cc"
  1091. echo "make $make"
  1092. echo "CPU $cpu ($tune)"
  1093. if test "$BUILDSUF" != ""; then
  1094. echo "build suffix $BUILDSUF"
  1095. fi
  1096. echo "big-endian $bigendian"
  1097. echo "inttypes.h $inttypes"
  1098. echo "broken inttypes.h $emu_fast_int"
  1099. if test $cpu = "x86" -o $cpu = "x86_64"; then
  1100. echo "MMX enabled $mmx"
  1101. echo "Vector Builtins $builtin_vector"
  1102. fi
  1103. if test $cpu = "armv4l"; then
  1104. echo "IWMMXT enabled $iwmmxt"
  1105. fi
  1106. if test $cpu = "mips"; then
  1107. echo "MMI enabled $mmi"
  1108. fi
  1109. if test $cpu = "powerpc"; then
  1110. echo "AltiVec enabled $altivec"
  1111. fi
  1112. echo "gprof enabled $gprof"
  1113. echo "zlib enabled $zlib"
  1114. echo "libgsm enabled $libgsm"
  1115. echo "mp3lame enabled $mp3lame"
  1116. echo "libogg enabled $libogg"
  1117. echo "Vorbis enabled $vorbis"
  1118. echo "Theora enabled $theora"
  1119. echo "FAAD enabled $faad"
  1120. echo "faadbin enabled $faadbin"
  1121. echo "FAAC enabled $faac"
  1122. echo "XviD enabled $xvid"
  1123. echo "x264 enabled $x264"
  1124. echo "a52 support $a52"
  1125. echo "a52 dlopened $a52bin"
  1126. echo "DTS support $dts"
  1127. echo "pp support $pp"
  1128. echo "debug symbols $debug"
  1129. echo "strip symbols $dostrip"
  1130. echo "optimize $optimize"
  1131. echo "shared pp $shared_pp"
  1132. echo "video hooking $vhook"
  1133. echo "SDL support $sdl"
  1134. if test $sdl_too_old = "yes"; then
  1135. echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support."
  1136. fi
  1137. if test "$vhook" = "yes" ; then
  1138. echo "Imlib2 support $imlib2"
  1139. echo "FreeType support $freetype2"
  1140. fi
  1141. echo "Sun medialib support" $sunmlib
  1142. echo "pthreads support" $pthreads
  1143. echo "AMR-NB float support" $amr_nb
  1144. echo "AMR-NB fixed support" $amr_nb_fixed
  1145. echo "AMR-WB float support" $amr_wb
  1146. echo "AMR-WB IF2 support" $amr_if2
  1147. echo "network support $network"
  1148. if test "$network" = "yes" ; then
  1149. echo "IPv6 support $ipv6"
  1150. fi
  1151. if test "$gpl" = "no" ; then
  1152. echo "License: LGPL"
  1153. else
  1154. echo "License: GPL"
  1155. fi
  1156. echo "Creating config.mak and config.h..."
  1157. date >> config.log
  1158. echo " $0 $FFMPEG_CONFIGURATION" >> config.log
  1159. echo "# Automatically generated by configure - do not modify!" > config.mak
  1160. echo "/* Automatically generated by configure - do not modify! */" > $TMPH
  1161. echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
  1162. echo "prefix=$prefix" >> config.mak
  1163. echo "libdir=$libdir" >> config.mak
  1164. echo "bindir=$bindir" >> config.mak
  1165. echo "mandir=$mandir" >> config.mak
  1166. echo "MAKE=$make" >> config.mak
  1167. echo "CC=$cc" >> config.mak
  1168. echo "AR=$ar" >> config.mak
  1169. echo "RANLIB=$ranlib" >> config.mak
  1170. if test "$dostrip" = "yes" ; then
  1171. echo "STRIP=$strip" >> config.mak
  1172. echo "INSTALLSTRIP=-s" >> config.mak
  1173. else
  1174. echo "STRIP=echo ignoring strip" >> config.mak
  1175. echo "INSTALLSTRIP=" >> config.mak
  1176. fi
  1177. # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic, used when building
  1178. # shared modules on OS/X (vhook/Makefile).
  1179. SHCFLAGS=$CFLAGS
  1180. if test "$needmdynamicnopic" = yes; then
  1181. CFLAGS="$CFLAGS -mdynamic-no-pic"
  1182. fi
  1183. echo "OPTFLAGS=$CFLAGS" >> config.mak
  1184. echo "SHCFLAGS=$SHCFLAGS">>config.mak
  1185. echo "LDFLAGS=$LDFLAGS" >> config.mak
  1186. echo "LDCONFIG=$LDCONFIG" >> config.mak
  1187. echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
  1188. echo "SHFLAGS=$SHFLAGS" >> config.mak
  1189. echo "LIBOBJFLAGS=$LIBOBJFLAGS" >> config.mak
  1190. echo "BUILDSUF=$BUILDSUF" >> config.mak
  1191. echo "LIBPREF=$LIBPREF" >> config.mak
  1192. echo "LIBSUF=\${BUILDSUF}$LIBSUF" >> config.mak
  1193. echo "SLIBPREF=$SLIBPREF" >> config.mak
  1194. echo "SLIBSUF=\${BUILDSUF}$SLIBSUF" >> config.mak
  1195. echo "EXESUF=\${BUILDSUF}$EXESUF" >> config.mak
  1196. echo "TARGET_OS=$TARGET_OS" >> config.mak
  1197. if test "$cpu" = "x86" ; then
  1198. echo "TARGET_ARCH_X86=yes" >> config.mak
  1199. echo "#define ARCH_X86 1" >> $TMPH
  1200. elif test "$cpu" = "x86_64" ; then
  1201. echo "TARGET_ARCH_X86_64=yes" >> config.mak
  1202. echo "#define ARCH_X86_64 1" >> $TMPH
  1203. elif test "$cpu" = "armv4l" ; then
  1204. echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
  1205. echo "#define ARCH_ARMV4L 1" >> $TMPH
  1206. elif test "$cpu" = "alpha" ; then
  1207. echo "TARGET_ARCH_ALPHA=yes" >> config.mak
  1208. echo "#define ARCH_ALPHA 1" >> $TMPH
  1209. elif test "$cpu" = "sparc64" ; then
  1210. echo "TARGET_ARCH_SPARC64=yes" >> config.mak
  1211. echo "#define ARCH_SPARC64 1" >> $TMPH
  1212. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1213. echo "#define ARCH_SPARC 1" >> $TMPH
  1214. elif test "$cpu" = "sparc" ; then
  1215. echo "TARGET_ARCH_SPARC=yes" >> config.mak
  1216. echo "#define ARCH_SPARC 1" >> $TMPH
  1217. elif test "$cpu" = "powerpc" ; then
  1218. echo "TARGET_ARCH_POWERPC=yes" >> config.mak
  1219. echo "#define ARCH_POWERPC 1" >> $TMPH
  1220. if test $POWERPCMODE = "32bits"; then
  1221. echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
  1222. else
  1223. echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
  1224. fi
  1225. if test "$powerpc_perf" = "yes"; then
  1226. echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
  1227. fi
  1228. elif test "$cpu" = "mips" ; then
  1229. echo "TARGET_ARCH_MIPS=yes" >> config.mak
  1230. echo "#define ARCH_MIPS 1" >> $TMPH
  1231. elif test "$cpu" = "sh4" ; then
  1232. echo "TARGET_ARCH_SH4=yes" >> config.mak
  1233. echo "#define ARCH_SH4 1" >> $TMPH
  1234. elif test "$cpu" = "parisc" ; then
  1235. echo "TARGET_ARCH_PARISC=yes" >> config.mak
  1236. echo "#define ARCH_PARISC 1" >> $TMPH
  1237. elif test "$cpu" = "s390" ; then
  1238. echo "TARGET_ARCH_S390=yes" >> config.mak
  1239. echo "#define ARCH_S390 1" >> $TMPH
  1240. elif test "$cpu" = "m68k" ; then
  1241. echo "TARGET_ARCH_M68K=yes" >> config.mak
  1242. echo "#define ARCH_M68K 1" >> $TMPH
  1243. elif test "$cpu" = "ia64" ; then
  1244. echo "TARGET_ARCH_IA64=yes" >> config.mak
  1245. echo "#define ARCH_IA64 1" >> $TMPH
  1246. fi
  1247. echo "#define TUNECPU $TUNECPU" >> $TMPH
  1248. if test "$bigendian" = "yes" ; then
  1249. echo "WORDS_BIGENDIAN=yes" >> config.mak
  1250. echo "#define WORDS_BIGENDIAN 1" >> $TMPH
  1251. fi
  1252. if test "$inttypes" != "yes" ; then
  1253. echo "#define EMULATE_INTTYPES 1" >> $TMPH
  1254. fi
  1255. if test "$emu_fast_int" = "yes" ; then
  1256. echo "#define EMULATE_FAST_INT 1" >> $TMPH
  1257. fi
  1258. if test "$mmx" = "yes" ; then
  1259. echo "TARGET_MMX=yes" >> config.mak
  1260. echo "#define HAVE_MMX 1" >> $TMPH
  1261. echo "#define __CPU__ 586" >> $TMPH
  1262. fi
  1263. if test "$builtin_vector" = "yes" ; then
  1264. echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
  1265. echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
  1266. fi
  1267. if test "$iwmmxt" = "yes" ; then
  1268. echo "TARGET_IWMMXT=yes" >> config.mak
  1269. echo "#define HAVE_IWMMXT 1" >> $TMPH
  1270. fi
  1271. if test "$mmi" = "yes" ; then
  1272. echo "TARGET_MMI=yes" >> config.mak
  1273. echo "#define HAVE_MMI 1" >> $TMPH
  1274. fi
  1275. if test "$altivec" = "yes" ; then
  1276. echo "TARGET_ALTIVEC=yes" >> config.mak
  1277. echo "#define HAVE_ALTIVEC 1" >> $TMPH
  1278. echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
  1279. echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
  1280. if test "$_altivec_h" = "yes" ; then
  1281. echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
  1282. else
  1283. echo "#undef HAVE_ALTIVEC_H" >> $TMPH
  1284. fi
  1285. fi
  1286. if test "$gprof" = "yes" ; then
  1287. echo "TARGET_GPROF=yes" >> config.mak
  1288. echo "#define HAVE_GPROF 1" >> $TMPH
  1289. fi
  1290. if test "$localtime_r" = "yes" ; then
  1291. echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
  1292. fi
  1293. if test "$imlib2" = "yes" ; then
  1294. echo "HAVE_IMLIB2=yes" >> config.mak
  1295. fi
  1296. if test "$freetype2" = "yes" ; then
  1297. echo "HAVE_FREETYPE2=yes" >> config.mak
  1298. fi
  1299. if test "$sunmlib" = "yes" ; then
  1300. echo "HAVE_MLIB=yes" >> config.mak
  1301. echo "#define HAVE_MLIB 1" >> $TMPH
  1302. extralibs="$extralibs -lmlib"
  1303. fi
  1304. if test "$pthreads" = "yes" ; then
  1305. echo "HAVE_PTHREADS=yes" >> config.mak
  1306. echo "#define HAVE_PTHREADS 1" >> $TMPH
  1307. echo "#define HAVE_THREADS 1" >> $TMPH
  1308. if test $targetos != FreeBSD -a $targetos != OpenBSD ; then
  1309. extralibs="$extralibs -lpthread"
  1310. fi
  1311. fi
  1312. if test "$sdl" = "yes" ; then
  1313. echo "CONFIG_SDL=yes" >> config.mak
  1314. echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
  1315. echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
  1316. fi
  1317. if test "$texi2html" = "yes"; then
  1318. echo "BUILD_DOC=yes" >> config.mak
  1319. fi
  1320. if test "$have_lrintf" = "yes" ; then
  1321. echo "#define HAVE_LRINTF 1" >> $TMPH
  1322. fi
  1323. if test "$vhook" = "yes" ; then
  1324. echo "BUILD_VHOOK=yes" >> config.mak
  1325. echo "#define HAVE_VHOOK 1" >> $TMPH
  1326. fi
  1327. if test "$lshared" = "yes" ; then
  1328. echo "BUILD_SHARED=yes" >> config.mak
  1329. echo "PIC=-fPIC -DPIC" >> config.mak
  1330. fi
  1331. echo "EXTRALIBS=$extralibs" >> config.mak
  1332. version=`grep '#define FFMPEG_VERSION ' "$source_path/libavcodec/avcodec.h" |
  1333. cut -d '"' -f 2`
  1334. echo "VERSION=$version" >>config.mak
  1335. # If you do not want to use encoders, disable them.
  1336. echo "#define CONFIG_ENCODERS 1" >> $TMPH
  1337. echo "CONFIG_ENCODERS=yes" >> config.mak
  1338. # If you do not want to use decoders, disable them.
  1339. echo "#define CONFIG_DECODERS 1" >> $TMPH
  1340. echo "CONFIG_DECODERS=yes" >> config.mak
  1341. # muxers
  1342. if test "$muxers" = "yes" ; then
  1343. echo "#define CONFIG_MUXERS 1" >> $TMPH
  1344. echo "CONFIG_MUXERS=yes" >> config.mak
  1345. fi
  1346. # demuxers
  1347. if test "$demuxers" = "yes" ; then
  1348. echo "#define CONFIG_DEMUXERS 1" >> $TMPH
  1349. echo "CONFIG_DEMUXERS=yes" >> config.mak
  1350. fi
  1351. # AC3
  1352. if test "$a52" = "yes" ; then
  1353. echo "#define CONFIG_AC3 1" >> $TMPH
  1354. echo "CONFIG_AC3=yes" >> config.mak
  1355. if test "$a52bin" = "yes" ; then
  1356. echo "#define CONFIG_A52BIN 1" >> $TMPH
  1357. echo "CONFIG_A52BIN=yes" >> config.mak
  1358. fi
  1359. fi
  1360. # DTS
  1361. if test "$dts" = "yes" ; then
  1362. echo "#define CONFIG_DTS 1" >> $TMPH
  1363. echo "CONFIG_DTS=yes" >> config.mak
  1364. fi
  1365. # PP
  1366. if test "$pp" = "yes" ; then
  1367. echo "#define CONFIG_PP 1" >> $TMPH
  1368. echo "CONFIG_PP=yes" >> config.mak
  1369. if test "$shared_pp" = "yes" ; then
  1370. echo "#define SHARED_PP 1" >> $TMPH
  1371. echo "SHARED_PP=yes" >> config.mak
  1372. fi
  1373. fi
  1374. # MPEG audio high precision mode
  1375. if test "$mpegaudio_hp" = "yes" ; then
  1376. echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
  1377. fi
  1378. if test "$v4l" = "yes" ; then
  1379. echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
  1380. echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
  1381. fi
  1382. if test "$bktr" = "yes" ; then
  1383. echo "#define CONFIG_BKTR 1" >> $TMPH
  1384. echo "CONFIG_BKTR=yes" >> config.mak
  1385. fi
  1386. if test "$dv1394" = "yes" ; then
  1387. echo "#define CONFIG_DV1394 1" >> $TMPH
  1388. echo "CONFIG_DV1394=yes" >> config.mak
  1389. fi
  1390. if test "$dc1394" = "yes" ; then
  1391. echo "#define CONFIG_DC1394 1" >> $TMPH
  1392. echo "CONFIG_DC1394=yes" >> config.mak
  1393. fi
  1394. if test "$dlopen" = "yes" ; then
  1395. echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
  1396. fi
  1397. if test "$dlfcn" = "yes" ; then
  1398. echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
  1399. fi
  1400. if test "$audio_oss" = "yes" ; then
  1401. echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
  1402. echo "CONFIG_AUDIO_OSS=yes" >> config.mak
  1403. fi
  1404. if test "$audio_beos" = "yes" ; then
  1405. echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
  1406. echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
  1407. fi
  1408. if test "$network" = "yes" ; then
  1409. echo "#define CONFIG_NETWORK 1" >> $TMPH
  1410. echo "CONFIG_NETWORK=yes" >> config.mak
  1411. fi
  1412. if test "$ipv6" = "yes" ; then
  1413. echo "#define CONFIG_IPV6 1" >> $TMPH
  1414. fi
  1415. if test "$zlib" = "yes" ; then
  1416. echo "#define CONFIG_ZLIB 1" >> $TMPH
  1417. echo "CONFIG_ZLIB=yes" >> config.mak
  1418. fi
  1419. if test "$libgsm" = "yes" ; then
  1420. echo "#define CONFIG_LIBGSM 1" >> $TMPH
  1421. echo "CONFIG_LIBGSM=yes" >> config.mak
  1422. fi
  1423. if test "$mp3lame" = "yes" ; then
  1424. echo "#define CONFIG_MP3LAME 1" >> $TMPH
  1425. echo "CONFIG_MP3LAME=yes" >> config.mak
  1426. fi
  1427. if test "$libogg" = "yes" ; then
  1428. echo "#define CONFIG_LIBOGG 1" >> $TMPH
  1429. echo "CONFIG_LIBOGG=yes" >> config.mak
  1430. fi
  1431. if test "$vorbis" = "yes" ; then
  1432. echo "#define CONFIG_LIBVORBIS 1" >> $TMPH
  1433. echo "CONFIG_LIBVORBIS=yes" >> config.mak
  1434. fi
  1435. if test "$theora" = "yes" ; then
  1436. echo "#define CONFIG_LIBTHEORA 1" >> $TMPH
  1437. echo "CONFIG_LIBTHEORA=yes" >> config.mak
  1438. fi
  1439. if test "$faad" = "yes" ; then
  1440. echo "#define CONFIG_FAAD 1" >> $TMPH
  1441. echo "CONFIG_FAAD=yes" >> config.mak
  1442. fi
  1443. if test "$faadbin" = "yes" ; then
  1444. echo "#define CONFIG_FAADBIN 1" >> $TMPH
  1445. echo "CONFIG_FAADBIN=yes" >> config.mak
  1446. fi
  1447. if test "$faac" = "yes" ; then
  1448. echo "#define CONFIG_FAAC 1" >> $TMPH
  1449. echo "CONFIG_FAAC=yes" >> config.mak
  1450. fi
  1451. if test "$xvid" = "yes" ; then
  1452. echo "#define CONFIG_XVID 1" >> $TMPH
  1453. echo "CONFIG_XVID=yes" >> config.mak
  1454. fi
  1455. if test "$x264" = "yes" ; then
  1456. echo "#define CONFIG_X264 1" >> $TMPH
  1457. echo "CONFIG_X264=yes" >> config.mak
  1458. fi
  1459. if test "$mingw32" = "yes" ; then
  1460. echo "#define CONFIG_WIN32 1" >> $TMPH
  1461. echo "CONFIG_WIN32=yes" >> config.mak
  1462. echo "HAVE_W32THREADS=yes" >> config.mak
  1463. echo "#define HAVE_W32THREADS 1" >> $TMPH
  1464. echo "#define HAVE_THREADS 1" >> $TMPH
  1465. echo "#ifndef __MINGW32__" >> $TMPH
  1466. echo "#define __MINGW32__ 1" >> $TMPH
  1467. echo "#endif" >> $TMPH
  1468. fi
  1469. if test "$os2" = "yes" ; then
  1470. echo "#define CONFIG_OS2 1" >> $TMPH
  1471. echo "CONFIG_OS2=yes" >> config.mak
  1472. fi
  1473. if test "$TARGET_OS" = "SunOS" ; then
  1474. echo "#define CONFIG_SUNOS 1" >> $TMPH
  1475. fi
  1476. if test "$TARGET_OS" = "BeOS" ; then
  1477. echo "HAVE_BEOSTHREADS=yes" >> config.mak
  1478. echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
  1479. echo "#define HAVE_THREADS 1" >> $TMPH
  1480. fi
  1481. if test "$darwin" = "yes"; then
  1482. echo "#define CONFIG_DARWIN 1" >> $TMPH
  1483. echo "CONFIG_DARWIN=yes" >> config.mak
  1484. fi
  1485. if test "$_malloc_h" = "yes" ; then
  1486. echo "#define HAVE_MALLOC_H 1" >> $TMPH
  1487. else
  1488. echo "#undef HAVE_MALLOC_H" >> $TMPH
  1489. fi
  1490. if test "$_memalign" = "yes" ; then
  1491. echo "#define HAVE_MEMALIGN 1" >> $TMPH
  1492. else
  1493. echo "#undef HAVE_MEMALIGN" >> $TMPH
  1494. fi
  1495. if test "$memalignhack" = "yes" ; then
  1496. echo "#define MEMALIGN_HACK 1" >> $TMPH
  1497. fi
  1498. if test "$netserver" = "yes" ; then
  1499. echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
  1500. echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
  1501. fi
  1502. if test "$need_inet_aton" = "yes" ; then
  1503. echo "NEED_INET_ATON=yes" >> config.mak
  1504. fi
  1505. if test "$simpleidct" = "yes" ; then
  1506. echo "#define SIMPLE_IDCT 1" >> $TMPH
  1507. fi
  1508. if test "$ffserver" = "yes" ; then
  1509. echo "#define CONFIG_FFSERVER 1" >> $TMPH
  1510. echo "CONFIG_FFSERVER=yes" >> config.mak
  1511. fi
  1512. if test "$ffplay" = "yes" ; then
  1513. echo "CONFIG_FFPLAY=yes" >> config.mak
  1514. fi
  1515. if test "$gpl" = "yes" ; then
  1516. echo "#define CONFIG_GPL 1" >> $TMPH
  1517. echo "CONFIG_GPL=yes" >> config.mak
  1518. fi
  1519. echo "#define restrict $_restrict" >> $TMPH
  1520. if test "$optimize" = "small"; then
  1521. echo "#define always_inline" >> $TMPH
  1522. fi
  1523. # build tree in object directory if source path is different from current one
  1524. if test "$source_path_used" = "yes" ; then
  1525. DIRS="\
  1526. doc \
  1527. libavformat \
  1528. libavcodec \
  1529. libavcodec/alpha \
  1530. libavcodec/armv4l \
  1531. libavcodec/i386 \
  1532. libavcodec/sparc \
  1533. libavcodec/mlib \
  1534. libavcodec/ppc \
  1535. libavcodec/liba52 \
  1536. libavcodec/libpostproc \
  1537. libavutil \
  1538. tests \
  1539. vhook \
  1540. "
  1541. FILES="\
  1542. Makefile \
  1543. libavformat/Makefile \
  1544. libavcodec/Makefile \
  1545. libavcodec/libpostproc/Makefile \
  1546. libavutil/Makefile \
  1547. tests/Makefile \
  1548. vhook/Makefile \
  1549. doc/Makefile \
  1550. doc/texi2pod.pl \
  1551. "
  1552. for dir in $DIRS ; do
  1553. mkdir -p $dir
  1554. done
  1555. for f in $FILES ; do
  1556. ln -sf "$source_path/$f" $f
  1557. done
  1558. echo "SRC_PATH=$source_path" >> config.mak
  1559. else
  1560. echo "SRC_PATH='$source_path'" >> config.mak
  1561. fi
  1562. if test "$amr_wb" = "yes" ; then
  1563. echo "#define AMR_WB 1" >> $TMPH
  1564. echo "AMR_WB=yes" >> config.mak
  1565. echo
  1566. echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
  1567. echo "V5.1.0 from "
  1568. echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
  1569. echo "and extracted the source to libavcodec/amrwb_float"
  1570. echo
  1571. fi
  1572. if test "$amr_nb" = "yes" ; then
  1573. echo "#define AMR_NB 1" >> $TMPH
  1574. echo "AMR_NB=yes" >> config.mak
  1575. echo
  1576. if test "$amr_nb_fixed" = "yes" ; then
  1577. echo "AMR_NB_FIXED=yes" >> config.mak
  1578. echo "#define AMR_NB_FIXED 1" >> $TMPH
  1579. echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
  1580. echo "REL-5 version 5.1.0 from "
  1581. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
  1582. echo "and extracted src to libavcodec/amr"
  1583. echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
  1584. echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
  1585. echo
  1586. else
  1587. echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
  1588. echo "REL-5 V5.1.0 from "
  1589. echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
  1590. echo "and extracted the source to libavcodec/amr_float"
  1591. echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
  1592. echo
  1593. fi
  1594. if test "$amr_if2" = "yes" ; then
  1595. echo "AMR_CFLAGS=-DIF2=1" >> config.mak
  1596. fi
  1597. fi
  1598. for codec in $CODEC_LIST ; do
  1599. echo "#define CONFIG_`echo $codec | tr a-z A-Z` 1" >> $TMPH
  1600. echo "CONFIG_`echo $codec | tr a-z A-Z`=yes" >> config.mak
  1601. done
  1602. diff $TMPH config.h >/dev/null 2>&1
  1603. if test $? -ne 0 ; then
  1604. mv -f $TMPH config.h
  1605. else
  1606. echo "config.h is unchanged"
  1607. fi
  1608. rm -f $TMPO $TMPC $TMPE $TMPS $TMPH
  1609. # build pkg-config files libav*.pc and libpostproc.pc
  1610. lavc_version=`grep '#define LIBAVCODEC_VERSION ' "$source_path/libavcodec/avcodec.h" | sed 's/[^0-9\.]//g'`
  1611. lavf_version=`grep '#define LIBAVFORMAT_VERSION ' "$source_path/libavformat/avformat.h" | sed 's/[^0-9\.]//g'`
  1612. lavu_version=`grep '#define LIBAVUTIL_VERSION ' "$source_path/libavutil/avutil.h" | sed 's/[^0-9\.]//g'`
  1613. requires=
  1614. test "$libogg" = "yes" && requires="$requires ogg >= 1.1"
  1615. test "$vorbis" = "yes" && requires="$requires vorbis"
  1616. test "$theora" = "yes" && requires="$requires theora"
  1617. test "$faad" = "yes" && test "$faadbin" = "no" && extralibs="$extralibs -lfaad"
  1618. # libavutil.pc
  1619. cat <<EOF >libavutil.pc
  1620. prefix=$prefix
  1621. exec_prefix=\${prefix}
  1622. libdir=\${exec_prefix}/lib
  1623. includedir=\${prefix}/include
  1624. Name: libavutil
  1625. Description: FFmpeg utility library
  1626. Version: $lavu_version
  1627. Requires:
  1628. Conflicts:
  1629. Libs: -L\${libdir} -lavutil
  1630. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1631. EOF
  1632. cat <<EOF >libavutil-uninstalled.pc
  1633. prefix=
  1634. exec_prefix=
  1635. libdir=\${pcfiledir}/libavutil
  1636. includedir=\${pcfiledir}/libavutil
  1637. Name: libavutil
  1638. Description: FFmpeg utility library
  1639. Version: $lavu_version
  1640. Requires:
  1641. Conflicts:
  1642. Libs: \${libdir}/${LIBPREF}avutil${LIBSUF}
  1643. Cflags: -I\${includedir}
  1644. EOF
  1645. # libavcodec.pc
  1646. cat <<EOF >libavcodec.pc
  1647. prefix=$prefix
  1648. exec_prefix=\${prefix}
  1649. libdir=\${exec_prefix}/lib
  1650. includedir=\${prefix}/include
  1651. Name: libavcodec
  1652. Description: FFmpeg codec library
  1653. Version: $lavc_version
  1654. Requires: $requires libavutil = $lavu_version
  1655. Conflicts:
  1656. Libs: -L\${libdir} -lavcodec $extralibs
  1657. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1658. EOF
  1659. cat <<EOF >libavcodec-uninstalled.pc
  1660. prefix=
  1661. exec_prefix=
  1662. libdir=\${pcfiledir}/libavcodec
  1663. includedir=\${pcfiledir}/libavcodec
  1664. Name: libavcodec
  1665. Description: FFmpeg codec library
  1666. Version: $lavc_version
  1667. Requires: $requires libavutil = $lavu_version
  1668. Conflicts:
  1669. Libs: \${libdir}/${LIBPREF}avcodec${LIBSUF} $extralibs
  1670. Cflags: -I\${includedir}
  1671. EOF
  1672. # libavformat.pc
  1673. cat <<EOF >libavformat.pc
  1674. prefix=$prefix
  1675. exec_prefix=\${prefix}
  1676. libdir=\${exec_prefix}/lib
  1677. includedir=\${prefix}/include
  1678. Name: libavformat
  1679. Description: FFmpeg container format library
  1680. Version: $lavf_version
  1681. Requires: $requires libavcodec = $lavc_version
  1682. Conflicts:
  1683. Libs: -L\${libdir} -lavformat $extralibs
  1684. Cflags: -I\${includedir} -I\${includedir}/ffmpeg
  1685. EOF
  1686. cat <<EOF >libavformat-uninstalled.pc
  1687. prefix=
  1688. exec_prefix=
  1689. libdir=\${pcfiledir}/libavformat
  1690. includedir=\${pcfiledir}/libavformat
  1691. Name: libavformat
  1692. Description: FFmpeg container format library
  1693. Version: $lavf_version
  1694. Requires: $requires libavcodec = $lavc_version
  1695. Conflicts:
  1696. Libs: \${libdir}/${LIBPREF}avformat${LIBSUF} $extralibs
  1697. Cflags: -I\${includedir}
  1698. EOF
  1699. # libpostproc.pc
  1700. cat <<EOF >libpostproc.pc
  1701. prefix=$prefix
  1702. exec_prefix=\${prefix}
  1703. libdir=\${exec_prefix}/lib
  1704. includedir=\${prefix}/include
  1705. Name: libpostproc
  1706. Description: FFmpeg post processing library
  1707. Version: $lavc_version
  1708. Requires:
  1709. Conflicts:
  1710. Libs: -L\${libdir} -lpostproc
  1711. Cflags: -I\${includedir} -I\${includedir}/postproc
  1712. EOF
  1713. cat <<EOF >libpostproc-uninstalled.pc
  1714. prefix=
  1715. exec_prefix=
  1716. libdir=\${pcfiledir}/libavcodec/libpostproc
  1717. includedir=\${pcfiledir}/libavcodec/libpostproc
  1718. Name: libpostproc
  1719. Description: FFmpeg post processing library
  1720. Version: $lavc_version
  1721. Requires:
  1722. Conflicts:
  1723. Libs: \${libdir}/${LIBPREF}postproc${LIBSUF}
  1724. Cflags: -I\${includedir}
  1725. EOF