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.

1905 lines
47KB

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