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.

1973 lines
49KB

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