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.

1983 lines
50KB

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