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