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.

2034 lines
52KB

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