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.

1935 lines
49KB

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