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.

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