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