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.

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