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.

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