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.

1929 lines
48KB

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