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.

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