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.

2058 lines
53KB

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