enabling Sun medialib support via --enable-sunmlib, the default
[libav.git] / configure
1 #!/bin/sh
2 #
3 # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
4 #
5 # set temporary file name
6 if test ! -z "$TMPDIR" ; then
7 TMPDIR1="${TMPDIR}"
8 elif test ! -z "$TEMPDIR" ; then
9 TMPDIR1="${TEMPDIR}"
10 else
11 TMPDIR1="/tmp"
12 fi
13
14 TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
15 TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
16 TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
17 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
18 TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
19
20 # default parameters
21 prefix="/usr/local"
22 cross_prefix=""
23 cc="gcc"
24 ar="ar"
25 ranlib="ranlib"
26 make="make"
27 strip="strip"
28 cpu=`uname -m`
29 tune="generic"
30 powerpc_perf="no"
31 mmx="default"
32 altivec="default"
33 mmi="default"
34 case "$cpu" in
35 i386|i486|i586|i686|i86pc|BePC)
36 cpu="x86"
37 ;;
38 # armv4l is a subset of armv5tel
39 armv4l|armv5tel)
40 cpu="armv4l"
41 ;;
42 alpha)
43 cpu="alpha"
44 ;;
45 "Power Macintosh"|ppc)
46 cpu="powerpc"
47 ;;
48 mips)
49 cpu="mips"
50 ;;
51 sun4u)
52 cpu="sparc64"
53 ;;
54 sh4)
55 cpu="sh4"
56 ;;
57 *)
58 cpu="unknown"
59 ;;
60 esac
61 gprof="no"
62 v4l="yes"
63 audio_oss="yes"
64 audio_beos="no"
65 dv1394="yes"
66 network="yes"
67 zlib="yes"
68 mp3lame="no"
69 vorbis="no"
70 faad="no"
71 faadbin="no"
72 a52="yes"
73 a52bin="no"
74 pp="yes"
75 shared_pp="no"
76 win32="no"
77 mingw32="no"
78 cygwin="no"
79 os2="no"
80 lshared="no"
81 extralibs="-lm"
82 simpleidct="yes"
83 bigendian="no"
84 vhook="default"
85 dlfcn="no"
86 dlopen="no"
87 mpegaudio_hp="yes"
88 SHFLAGS=-shared
89 netserver="no"
90 need_inet_aton="no"
91 ffserver="yes"
92 ffplay="yes"
93 LDFLAGS=-Wl,--warn-common
94 FFSLDFLAGS=-Wl,-E
95 LIBPREF="lib"
96 LIBSUF=".a"
97 SLIBPREF="lib"
98 SLIBSUF=".so"
99 risky="yes"
100 small="no"
101 amr_nb="no"
102 amr_nb_fixed="no"
103 sunmlib="no"
104
105 # OS specific
106 targetos=`uname -s`
107 case $targetos in
108 BeOS)
109 prefix="/boot/home/config"
110 # helps building libavcodec
111 CFLAGS="-O3 -DPIC -fomit-frame-pointer"
112 # 3 gcc releases known for BeOS, each with ugly bugs
113 gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
114 case "$gcc_version" in
115 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
116 mmx="no"
117 ;;
118 *20010315*) echo "BeBits gcc"
119 CFLAGS="$CFLAGS -fno-expensive-optimizations"
120 ;;
121 esac
122 SHFLAGS=-nostart
123 # disable linux things
124 audio_oss="no"
125 v4l="no"
126 dv1394="no"
127 # enable beos things
128 audio_beos="yes"
129 # no need for libm, but the inet stuff
130 # Check for BONE
131 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
132 extralibs="-lbind -lsocket"
133 else
134 netserver="yes"
135 need_inet_aton="yes"
136 extralibs="-lnet"
137 fi ;;
138 SunOS)
139 v4l="no"
140 audio_oss="no"
141 dv1394="no"
142 make="gmake"
143 LDFLAGS=""
144 FFSLDFLAGS=""
145 need_inet_aton="yes"
146 extralibs="$extralibs -lsocket -lnsl"
147 ;;
148 FreeBSD)
149 v4l="no"
150 audio_oss="yes"
151 dv1394="no"
152 make="gmake"
153 LDFLAGS="$LDFLAGS -export-dynamic"
154 ;;
155 BSD/OS)
156 v4l="no"
157 audio_oss="yes"
158 dv1394="no"
159 extralibs="-lpoll -lgnugetopt -lm"
160 make="gmake"
161 ;;
162 Darwin)
163 cc="cc"
164 v4l="no"
165 audio_oss="no"
166 dv1394="no"
167 ffserver="no"
168 SHFLAGS="-dynamiclib"
169 extralibs=""
170 darwin="yes"
171 strip="strip -x"
172 LDFLAGS="-d"
173 FFSLDFLAGS=-Wl,-bind_at_load
174 gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
175 case "$gcc_version" in
176 *2.95*)
177 CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer"
178 ;;
179 *3.3*)
180 CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL"
181 ;;
182 *)
183 CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic"
184 ;;
185 esac
186 ;;
187 MINGW32*)
188 v4l="no"
189 audio_oss="no"
190 dv1394="no"
191 ffserver="no"
192 network="no"
193 mingw32="yes"
194 ;;
195 CYGWIN*)
196 v4l="no"
197 audio_oss="yes"
198 dv1394="no"
199 extralibs=""
200 cygwin="yes"
201 test -f /usr/include/inttypes.h || \
202 test -f /usr/local/include/inttypes.h || \
203 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
204 "/usr/include/inttypes.h !!!"
205 ;;
206 Linux)
207 LDFLAGS="$LDFLAGS -rdynamic"
208 ;;
209 OS/2)
210 TMPE=$TMPE".exe"
211 ar="emxomfar -p64"
212 ranlib="echo ignoring ranlib"
213 strip="echo ignoring strip"
214 CFLAGS="-Zomf -O3"
215 LDFLAGS="-Zomf -Zstack 16384 -s"
216 SHFLAGS=""
217 FFSLDFLAGS=""
218 LIBPREF=""
219 LIBSUF=".lib"
220 SLIBPREF=""
221 SLIBSUF=".dll"
222 extralibs=""
223 v4l="no"
224 audio_oss="no"
225 dv1394="no"
226 network="no"
227 ffserver="no"
228 os2="yes"
229 ;;
230 *) ;;
231 esac
232
233 # From mplayer configure. We need TARGET_OS available
234 # to the Makefile, so it can distinguish between flavors
235 # of AltiVec on PowerPC
236 TARGET_OS=`( uname -s ) 2>&1`
237 case "$TARGET_OS" in
238 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
239 ;;
240 IRIX*)
241 TARGET_OS=IRIX
242 ;;
243 HP-UX*)
244 TARGET_OS=HP-UX
245 ;;
246 [cC][yY][gG][wW][iI][nN]*)
247 TARGET_OS=CYGWIN
248 ;;
249 *)
250 TARGET_OS="$TARGET_OS-UNKNOWN"
251 ;;
252 esac
253
254 # find source path
255 # XXX: we assume an absolute path is given when launching configure,
256 # except in './configure' case.
257 source_path="`echo $0 | sed -e 's#/configure##'`"
258 source_path_used="yes"
259 if test -z "$source_path" -o "$source_path" = "." ; then
260 source_path=`pwd`
261 source_path_used="no"
262 fi
263
264 for opt do
265 case "$opt" in
266 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
267 ;;
268 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
269 ;;
270 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
271 ;;
272 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
273 ;;
274 --make=*) make=`echo $opt | cut -d '=' -f 2`
275 ;;
276 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
277 ;;
278 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
279 ;;
280 --extra-libs=*) extralibs=${opt#--extra-libs=}
281 ;;
282 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
283 ;;
284 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
285 ;;
286 --powerpc-perf-enable) powerpc_perf="yes"
287 ;;
288 --disable-mmx) mmx="no"
289 ;;
290 --disable-altivec) altivec="no"
291 ;;
292 --enable-gprof) gprof="yes"
293 ;;
294 --disable-v4l) v4l="no"
295 ;;
296 --disable-audio-oss) audio_oss="no"
297 ;;
298 --disable-audio-beos) audio_beos="no"
299 ;;
300 --disable-dv1394) dv1394="no"
301 ;;
302 --disable-network) network="no"
303 ;;
304 --disable-zlib) zlib="no"
305 ;;
306 --disable-a52) a52="no"
307 ;;
308 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
309 ;;
310 --disable-pp) pp="no"
311 ;;
312 --enable-shared-pp) shared_pp="yes"
313 ;;
314 --enable-mp3lame) mp3lame="yes"
315 ;;
316 --enable-vorbis) vorbis="yes"
317 ;;
318 --enable-faad) faad="yes"
319 ;;
320 --enable-faadbin) faadbin="yes"
321 ;;
322 --disable-vhook) vhook="no"
323 ;;
324 --disable-simple_idct) simpleidct="no"
325 ;;
326 --enable-win32) win32="yes"
327 ;;
328 --enable-mingw32) mingw32="yes"
329 ;;
330 --enable-shared) lshared="yes"
331 ;;
332 --disable-mpegaudio-hp) mpegaudio_hp="no"
333 ;;
334 --disable-ffserver) ffserver="no"
335 ;;
336 --disable-ffplay) ffplay="no"
337 ;;
338 --disable-risky) risky="no"
339 ;;
340 --enable-small) small="yes"
341 ;;
342 --enable-amr_nb) amr_nb="yes"
343 ;;
344 --enable-amr_nb-fixed) amr_nb_fixed="yes"
345 ;;
346 --enable-sunmlib) sunmlib="yes"
347 ;;
348 esac
349 done
350
351 # compute mmx state
352 if test $mmx = "default"; then
353 if test $cpu = "x86"; then
354 mmx="yes"
355 else
356 mmx="no"
357 fi
358 fi
359
360 # Can only do AltiVec on PowerPC
361 if test $altivec = "default"; then
362 if test $cpu = "powerpc"; then
363 altivec="yes"
364 else
365 altivec="no"
366 fi
367 fi
368
369 # Add processor-specific flags
370 TUNECPU="generic"
371 if test $tune != "generic"; then
372 case $tune in
373 601|ppc601|PowerPC601)
374 CFLAGS="$CFLAGS -mcpu=601"
375 if test $altivec = "yes"; then
376 echo "WARNING: tuning for PPC601 but altivec enabled !";
377 fi
378 TUNECPU=ppc601
379 ;;
380 603*|ppc603*|PowerPC603*)
381 CFLAGS="$CFLAGS -mcpu=603"
382 if test $altivec = "yes"; then
383 echo "WARNING: tuning for PPC603 but altivec enabled !";
384 fi
385 TUNECPU=ppc603
386 ;;
387 604*|ppc604*|PowerPC604*)
388 CFLAGS="$CFLAGS -mcpu=604"
389 if test $altivec = "yes"; then
390 echo "WARNING: tuning for PPC604 but altivec enabled !";
391 fi
392 TUNECPU=ppc604
393 ;;
394 G3|g3|75*|ppc75*|PowerPC75*)
395 CFLAGS="$CFLAGS -mcpu=750 -mtune=750"
396 if test $altivec = "yes"; then
397 echo "WARNING: tuning for PPC75x but altivec enabled !";
398 fi
399 TUNECPU=ppc750
400 ;;
401 G4|g4|745*|ppc745*|PowerPC745*)
402 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450"
403 if test $altivec = "no"; then
404 echo "WARNING: tuning for PPC745x but altivec disabled !";
405 fi
406 TUNECPU=ppc7450
407 ;;
408 74*|ppc74*|PowerPC74*)
409 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400"
410 if test $altivec = "no"; then
411 echo "WARNING: tuning for PPC74xx but altivec disabled !";
412 fi
413 TUNECPU=ppc7400
414 ;;
415 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
416 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
417 if test $altivec = "no"; then
418 echo "WARNING: tuning for PPC970 but altivec disabled !";
419 fi
420 TUNECPU=ppc970
421 ;;
422 *)
423 echo "WARNING: unknown CPU "$tune", ignored"
424 ;;
425 esac
426 fi
427
428 # AltiVec flags: The FSF version of GCC differs from the Darwin version
429 if test $cpu = "powerpc"; then
430 if test $altivec = "yes"; then
431 if test "$darwin" = "yes"; then
432 CFLAGS="$CFLAGS -faltivec"
433 else
434 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
435 fi
436 fi
437 fi
438
439 # See if we have <altivec.h>
440 cat > $TMPC << EOF
441 #include <altivec.h>
442 int main( void ) { return 0; }
443 EOF
444
445 _altivec_h="no"
446 if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
447 _altivec_h="yes"
448 fi
449
450 # See does our compiler support Motorola AltiVec C API
451 if test $altivec = "yes"; then
452 if test $_altivec_h = "yes"; then
453 cat > $TMPC << EOF
454 #include <altivec.h>
455 int main(void) {
456 vector signed int v1, v2, v3;
457 v1 = vec_add(v2,v3);
458 return 0;
459 }
460 EOF
461 else
462 cat > $TMPC << EOF
463 int main(void) {
464 vector signed int v1, v2, v3;
465 v1 = vec_add(v2,v3);
466 return 0;
467 }
468 EOF
469 fi
470 $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
471 fi
472
473 # Can only do mmi on mips
474 if test $mmi = "default"; then
475 if test $cpu = "mips"; then
476 mmi="yes"
477 else
478 mmi="no"
479 fi
480 fi
481
482 # See does our compiler support mmi
483 if test $mmi = "yes"; then
484 cat > $TMPC << EOF
485 int main(void) {
486 __asm__ ("lq \$2, 0(\$2)");
487 return 0;
488 }
489 EOF
490 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
491 fi
492
493 # Checking for CFLAGS
494 if test -z "$CFLAGS"; then
495 CFLAGS="-O3"
496 fi
497
498 if test "$win32" = "yes" ; then
499 cross_prefix="i386-mingw32msvc-"
500 v4l="no"
501 audio_oss="no"
502 dv1394="no"
503 network="no"
504 fi
505
506 if test "$mingw32" = "yes" ; then
507 cross_prefix=""
508 v4l="no"
509 audio_oss="no"
510 dv1394="no"
511 network="no"
512 fi
513
514 cc="${cross_prefix}${cc}"
515 ar="${cross_prefix}${ar}"
516 ranlib="${cross_prefix}${ranlib}"
517 strip="${cross_prefix}${strip}"
518
519 if test -z "$cross_prefix" ; then
520
521 # ---
522 # big/little endian test
523 cat > $TMPC << EOF
524 #include <inttypes.h>
525 int main(int argc, char ** argv){
526 volatile uint32_t i=0x01234567;
527 return (*((uint8_t*)(&i))) == 0x67;
528 }
529 EOF
530
531 if $cc -o $TMPE $TMPC 2>/dev/null ; then
532 $TMPE && bigendian="yes"
533 else
534 echo big/little test failed
535 fi
536
537 else
538
539 # if cross compiling, cannot launch a program, so make a static guess
540 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
541 bigendian="yes"
542 fi
543
544 fi
545
546 # ---
547 # check availability of some header files
548
549 cat > $TMPC << EOF
550 #include <malloc.h>
551 int main( void ) { return 0; }
552 EOF
553
554 _memalign=no
555 _malloc_h=no
556 if $cc -o $TMPE $TMPC 2> /dev/null ; then
557 _malloc_h=yes
558 _memalign=yes
559 # check for memalign - atmos
560 cat > $TMPC << EOF
561 #include <malloc.h>
562 int main ( void ) {
563 char *string = NULL;
564 string = memalign(64, sizeof(char));
565 return 0;
566 }
567 EOF
568 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
569 fi
570
571 cat > $TMPC << EOF
572 #define _GNU_SOURCE
573 #include <time.h>
574 int main( void ) { return *strptime("", "", 0); }
575 EOF
576
577 strptime=no
578 if $cc -o $TMPE $TMPC 2> /dev/null ; then
579 strptime=yes
580 fi
581
582 if test "$zlib" = "yes"; then
583 # check for zlib - mmu_man
584 cat > $TMPC << EOF
585 #include <zlib.h>
586 int main ( void ) {
587 if (zlibVersion() != ZLIB_VERSION)
588 puts("zlib version differs !!!");
589 return 1;
590 return 0;
591 }
592 EOF
593 $cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
594 # $TMPE 2> /dev/null > /dev/null || zlib="no"
595 # XXX: more tests needed - runtime test
596 fi
597 if test "$zlib" = "yes"; then
598 extralibs="$extralibs -lz"
599 fi
600
601 # test for lrintf in math.h
602 cat > $TMPC << EOF
603 #define _ISOC9X_SOURCE 1
604 #include <math.h>
605 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
606 EOF
607
608 have_lrintf="no"
609 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
610 have_lrintf="yes"
611 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
612 fi
613
614 _restrict=
615 for restrict_keyword in restrict __restrict__ __restrict; do
616 echo "void foo(char * $restrict_keyword p);" > $TMPC
617 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
618 _restrict=$restrict_keyword
619 break;
620 fi
621 done
622
623 # test gcc version to see if vector builtins can be used
624 # currently only used on i386 for MMX builtins
625 cat > $TMPC << EOF
626 int main(void) {
627 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
628 return 0;
629 #else
630 #error no vector builtins
631 #endif
632 }
633 EOF
634
635 builtin_vector=no
636 if $cc -o $TMPO $TMPC 2> /dev/null ; then
637 builtin_vector=yes
638 fi
639
640 # dlopen/dlfcn.h probing
641
642 cat > $TMPC << EOF
643 #include <dlfcn.h>
644 int main( void ) { return (int) dlopen("foo", 0); }
645 EOF
646
647 ldl=-ldl
648
649 if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
650 dlfcn=yes
651 dlopen=yes
652 fi
653
654 if $cc -o $TMPE $TMPC 2> /dev/null ; then
655 dlfcn=yes
656 dlopen=yes
657 ldl=""
658 fi
659
660 cat > $TMPC << EOF
661 int main( void ) { return (int) dlopen("foo", 0); }
662 EOF
663
664 if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
665 dlopen=yes
666 fi
667
668 if $cc -o $TMPE $TMPC 2> /dev/null ; then
669 dlopen=yes
670 ldl=""
671 fi
672
673 if test "$vhook" = "default" ; then
674 vhook="$dlopen"
675 fi
676
677 ##########################################
678 # imlib probe
679
680 cat > $TMPC << EOF
681 #include <X11/Xlib.h>
682 #include <Imlib2.h>
683 int main( void ) { return (int) imlib_load_font("foo"); }
684 EOF
685
686 imlib2=no
687 if $cc -o $TMPE $TMPC -lImlib2 2> /dev/null ; then
688 imlib2=yes
689 fi
690
691 ##########################################
692 # freetype probe
693
694 cat > $TMPC << EOF
695 #include <ft2build.h>
696 int main( void ) { return (int) FT_Init_FreeType(0); }
697 EOF
698
699 freetype2=no
700 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
701 if test "`which freetype-config`" != ""; then
702 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` 2> /dev/null ; then
703 freetype2=yes
704 fi
705 fi
706 fi
707
708 ##########################################
709 # SDL probe
710
711 cat > $TMPC << EOF
712 #include <SDL.h>
713 #undef main /* We don't want SDL to override our main() */
714 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
715 EOF
716
717 sdl_too_old=no
718 sdl=no
719 if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then
720 _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
721 if test "$_sdlversion" -lt 121 ; then
722 sdl_too_old=yes
723 else
724 sdl=yes
725 fi
726 fi
727
728 if test "$sdl" = "no" ; then
729 ffplay=no
730 fi
731
732 if test "$small" = "yes"; then
733 # CFLAGS=${CFLAGS//-O3/-Os}
734 CFLAGS="$CFLAGS -Os"
735 fi
736
737 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
738 cat << EOF
739
740 Usage: configure [options]
741 Options: [defaults in brackets after descriptions]
742
743 EOF
744 echo "Standard options:"
745 echo " --help print this message"
746 echo " --prefix=PREFIX install in PREFIX [$prefix]"
747 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
748 echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
749 echo " --enable-faad enable faad support via libfaad [default=no]"
750 echo " --enable-faadbin build faad support with runtime linking [default=no]"
751 echo " --enable-win32 enable win32 cross compile"
752 echo " --enable-mingw32 enable mingw32 native windows compile"
753 echo " --disable-a52 disable GPL'ed A52 support [default=no]"
754 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
755 echo " --disable-pp disable GPL'ed post processing support [default=no]"
756 echo " --enable-shared-pp use libpostproc.so [default=no]"
757 echo " --enable-shared build shared libraries [default=no]"
758 echo " --enable-amr_nb enable amr_nb float audio codec"
759 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
760 echo " --enable-sunmlib use Sun medialib [default=no]"
761 echo ""
762 echo "Advanced options (experts only):"
763 echo " --source-path=PATH path of source code [$source_path]"
764 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
765 echo " --cc=CC use C compiler CC [$cc]"
766 echo " --make=MAKE use specified make [$make]"
767 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
768 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
769 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
770 echo " --cpu=CPU force cpu to CPU [$cpu]"
771 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
772 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
773 echo " --disable-mmx disable mmx usage"
774 echo " --disable-altivec disable AltiVec usage"
775 echo " --disable-audio-oss disable OSS audio support [default=no]"
776 echo " --disable-audio-beos disable BeOS audio support [default=no]"
777 echo " --disable-v4l disable video4linux grabbing [default=no]"
778 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
779 echo " --disable-network disable network support [default=no]"
780 echo " --disable-zlib disable zlib [default=no]"
781 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
782 echo " --disable-vhook disable video hooking support"
783 echo " --enable-gprof enable profiling with gprof [$gprof]"
784 echo " --disable-mpegaudio-hp faster (but less accurate)"
785 echo " mpegaudio decoding [default=no]"
786 echo " --disable-ffserver disable ffserver build"
787 echo " --disable-ffplay disable ffplay build"
788 echo " --disable-risky disables patent encumbered codecs"
789 echo " --enable-small optimize for size instead of speed"
790 echo ""
791 echo "NOTE: The object files are build at the place where configure is launched"
792 exit 1
793 fi
794
795 echo "Install prefix $prefix"
796 echo "Source path $source_path"
797 echo "C compiler $cc"
798 echo "make $make"
799 echo "CPU $cpu ($tune)"
800 echo "Big Endian $bigendian"
801 if test $cpu = "x86"; then
802 echo "MMX enabled $mmx"
803 echo "Vector Builtins $builtin_vector"
804 fi
805 if test $cpu = "mips"; then
806 echo "MMI enabled $mmi"
807 fi
808 if test $cpu = "powerpc"; then
809 echo "AltiVec enabled $altivec"
810 fi
811 echo "gprof enabled $gprof"
812 echo "zlib enabled $zlib"
813 echo "mp3lame enabled $mp3lame"
814 echo "vorbis enabled $vorbis"
815 echo "faad enabled $faad"
816 echo "faadbin enabled $faadbin"
817 echo "a52 support $a52"
818 echo "a52 dlopened $a52bin"
819 echo "pp support $pp"
820 echo "shared pp $shared_pp"
821 echo "Video hooking $vhook"
822 echo "SDL support $sdl"
823 if test $sdl_too_old = "yes"; then
824 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
825 fi
826 echo "risky / patent encumbered codecs $risky"
827 echo "optimize for size $small"
828
829 if test "$vhook" = "yes" ; then
830 echo "Imlib2 support $imlib2"
831 echo "freetype support $freetype2"
832 fi
833 echo "Sun medialib support" $sunmlib
834 echo "AMR-NB float support" $amr_nb
835 echo "AMR-NB fixed support" $amr_nb_fixed
836
837 echo "Creating config.mak and config.h"
838
839 echo "# Automatically generated by configure - do not modify" > config.mak
840 echo "/* Automatically generated by configure - do not modify */" > $TMPH
841
842 echo "prefix=$prefix" >> config.mak
843 echo "MAKE=$make" >> config.mak
844 echo "CC=$cc" >> config.mak
845 echo "AR=$ar" >> config.mak
846 echo "RANLIB=$ranlib" >> config.mak
847 echo "STRIP=$strip" >> config.mak
848 echo "OPTFLAGS=$CFLAGS" >> config.mak
849 echo "LDFLAGS=$LDFLAGS" >> config.mak
850 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
851 echo "SHFLAGS=$SHFLAGS" >> config.mak
852 echo "LIBPREF=$LIBPREF" >> config.mak
853 echo "LIBSUF=$LIBSUF" >> config.mak
854 echo "SLIBPREF=$SLIBPREF" >> config.mak
855 echo "SLIBSUF=$SLIBSUF" >> config.mak
856 echo "TARGET_OS=$TARGET_OS" >> config.mak
857 if test "$cpu" = "x86" ; then
858 echo "TARGET_ARCH_X86=yes" >> config.mak
859 echo "#define ARCH_X86 1" >> $TMPH
860 elif test "$cpu" = "armv4l" ; then
861 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
862 echo "#define ARCH_ARMV4L 1" >> $TMPH
863 elif test "$cpu" = "alpha" ; then
864 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
865 echo "#define ARCH_ALPHA 1" >> $TMPH
866 elif test "$cpu" = "sparc64" ; then
867 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
868 echo "#define ARCH_SPARC64 1" >> $TMPH
869 elif test "$cpu" = "powerpc" ; then
870 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
871 echo "#define ARCH_POWERPC 1" >> $TMPH
872 if test "$powerpc_perf" = "yes"; then
873 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
874 fi
875 elif test "$cpu" = "mips" ; then
876 echo "TARGET_ARCH_MIPS=yes" >> config.mak
877 echo "#define ARCH_MIPS 1" >> $TMPH
878 elif test "$cpu" = "sh4" ; then
879 echo "TARGET_ARCH_SH4=yes" >> config.mak
880 echo "#define ARCH_SH4 1" >> $TMPH
881 fi
882 echo "#define TUNECPU $TUNECPU" >> $TMPH
883 if test "$bigendian" = "yes" ; then
884 echo "WORDS_BIGENDIAN=yes" >> config.mak
885 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
886 fi
887 if test "$mmx" = "yes" ; then
888 echo "TARGET_MMX=yes" >> config.mak
889 echo "#define HAVE_MMX 1" >> $TMPH
890 echo "#define __CPU__ 586" >> $TMPH
891 fi
892 if test "$builtin_vector" = "yes" ; then
893 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
894 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
895 fi
896 if test "$mmi" = "yes" ; then
897 echo "TARGET_MMI=yes" >> config.mak
898 echo "#define HAVE_MMI 1" >> $TMPH
899 fi
900 if test "$altivec" = "yes" ; then
901 echo "TARGET_ALTIVEC=yes" >> config.mak
902 echo "#define HAVE_ALTIVEC 1" >> $TMPH
903 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
904 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
905 if test "$_altivec_h" = "yes" ; then
906 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
907 else
908 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
909 fi
910 fi
911 if test "$gprof" = "yes" ; then
912 echo "TARGET_GPROF=yes" >> config.mak
913 echo "#define HAVE_GPROF 1" >> $TMPH
914 fi
915 if test "$strptime" = "yes" ; then
916 echo "#define HAVE_STRPTIME 1" >> $TMPH
917 else
918 echo "BUILD_STRPTIME=yes" >> config.mak
919 fi
920 if test "$imlib2" = "yes" ; then
921 echo "HAVE_IMLIB2=yes" >> config.mak
922 fi
923 if test "$freetype2" = "yes" ; then
924 echo "HAVE_FREETYPE2=yes" >> config.mak
925 fi
926 if test "$sunmlib" = "yes" ; then
927 echo "HAVE_MLIB=yes" >> config.mak
928 echo "#define HAVE_MLIB 1" >> $TMPH
929 extralibs="$extralibs -lmlib"
930 fi
931 if test "$sdl" = "yes" ; then
932 echo "CONFIG_SDL=yes" >> config.mak
933 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
934 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
935 fi
936 if test "$have_lrintf" = "yes" ; then
937 echo "#define HAVE_LRINTF 1" >> $TMPH
938 fi
939 if test "$vhook" = "yes" ; then
940 echo "BUILD_VHOOK=yes" >> config.mak
941 echo "#define HAVE_VHOOK 1" >> $TMPH
942 extralibs="$extralibs $ldl"
943 fi
944 if test "$lshared" = "yes" ; then
945 echo "BUILD_SHARED=yes" >> config.mak
946 echo "PIC=-fPIC" >> config.mak
947 fi
948 echo "EXTRALIBS=$extralibs" >> config.mak
949 echo "VERSION=`head $source_path/VERSION`" >>config.mak
950 echo "" >>config.mak
951 # if you do not want to use encoders, disable that.
952 echo "#define CONFIG_ENCODERS 1" >> $TMPH
953 echo "CONFIG_ENCODERS=yes" >> config.mak
954
955 # if you do not want to use decoders, disable that.
956 echo "#define CONFIG_DECODERS 1" >> $TMPH
957 echo "CONFIG_DECODERS=yes" >> config.mak
958
959 # AC3
960 if test "$a52" = "yes" ; then
961 echo "#define CONFIG_AC3 1" >> $TMPH
962 echo "CONFIG_AC3=yes" >> config.mak
963
964 if test "$a52bin" = "yes" ; then
965 echo "#define CONFIG_A52BIN 1" >> $TMPH
966 echo "CONFIG_A52BIN=yes" >> config.mak
967 fi
968 fi
969
970 # PP
971 if test "$pp" = "yes" ; then
972 echo "#define CONFIG_PP 1" >> $TMPH
973 echo "CONFIG_PP=yes" >> config.mak
974
975 if test "$shared_pp" = "yes" ; then
976 echo "#define SHARED_PP 1" >> $TMPH
977 echo "SHARED_PP=yes" >> config.mak
978 fi
979 fi
980
981 # mpeg audio high precision mode
982 if test "$mpegaudio_hp" = "yes" ; then
983 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
984 fi
985
986 if test "$v4l" = "yes" ; then
987 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
988 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
989 fi
990
991 if test "$dv1394" = "yes" ; then
992 echo "#define CONFIG_DV1394 1" >> $TMPH
993 echo "CONFIG_DV1394=yes" >> config.mak
994 fi
995
996 if test "$dlopen" = "yes" ; then
997 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
998 fi
999
1000 if test "$dlfcn" = "yes" ; then
1001 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1002 fi
1003
1004 if test "$audio_oss" = "yes" ; then
1005 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1006 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1007 fi
1008
1009 if test "$audio_beos" = "yes" ; then
1010 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1011 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1012 fi
1013
1014 if test "$network" = "yes" ; then
1015 echo "#define CONFIG_NETWORK 1" >> $TMPH
1016 echo "CONFIG_NETWORK=yes" >> config.mak
1017 fi
1018
1019 if test "$zlib" = "yes" ; then
1020 echo "#define CONFIG_ZLIB 1" >> $TMPH
1021 echo "CONFIG_ZLIB=yes" >> config.mak
1022 fi
1023
1024 if test "$mp3lame" = "yes" ; then
1025 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1026 echo "CONFIG_MP3LAME=yes" >> config.mak
1027 fi
1028
1029 if test "$vorbis" = "yes" ; then
1030 echo "#define CONFIG_VORBIS 1" >> $TMPH
1031 echo "CONFIG_VORBIS=yes" >> config.mak
1032 fi
1033
1034 if test "$faad" = "yes" ; then
1035 echo "#define CONFIG_FAAD 1" >> $TMPH
1036 echo "CONFIG_FAAD=yes" >> config.mak
1037 fi
1038
1039 if test "$faadbin" = "yes" ; then
1040 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1041 echo "CONFIG_FAADBIN=yes" >> config.mak
1042 fi
1043
1044 if test "$win32" = "yes" ; then
1045 echo "#define CONFIG_WIN32 1" >> $TMPH
1046 echo "CONFIG_WIN32=yes" >> config.mak
1047 fi
1048
1049 if test "$mingw32" = "yes" ; then
1050 echo "#define CONFIG_WIN32 1" >> $TMPH
1051 echo "CONFIG_WIN32=yes" >> config.mak
1052 echo "#define __MINGW32__ 1" >> $TMPH
1053 echo "__MINGW32__=1" >> config.mak
1054 fi
1055
1056 if test "$cygwin" = "yes" ; then
1057 # setup correct exesuffix
1058 echo "CONFIG_WIN32=yes" >> config.mak
1059 fi
1060
1061 if test "$os2" = "yes" ; then
1062 echo "#define CONFIG_OS2 1" >> $TMPH
1063 echo "CONFIG_OS2=yes" >> config.mak
1064 fi
1065
1066 if test "$TARGET_OS" = "SunOS" ; then
1067 echo "#define CONFIG_SUNOS 1" >> $TMPH
1068 fi
1069
1070 if test "$darwin" = "yes"; then
1071 echo "#define CONFIG_DARWIN 1" >> $TMPH
1072 echo "CONFIG_DARWIN=yes" >> config.mak
1073 fi
1074
1075 if test "$_malloc_h" = "yes" ; then
1076 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1077 else
1078 echo "#undef HAVE_MALLOC_H" >> $TMPH
1079 fi
1080
1081 if test "$_memalign" = "yes" ; then
1082 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1083 else
1084 echo "#undef HAVE_MEMALIGN" >> $TMPH
1085 fi
1086
1087 if test "$netserver" = "yes" ; then
1088 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1089 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1090 fi
1091
1092 if test "$need_inet_aton" = "yes" ; then
1093 echo "NEED_INET_ATON=yes" >> config.mak
1094 fi
1095
1096 if test "$simpleidct" = "yes" ; then
1097 echo "#define SIMPLE_IDCT 1" >> $TMPH
1098 fi
1099
1100 if test "$ffserver" = "yes" ; then
1101 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1102 echo "CONFIG_FFSERVER=yes" >> config.mak
1103 fi
1104
1105 if test "$ffplay" = "yes" ; then
1106 echo "CONFIG_FFPLAY=yes" >> config.mak
1107 fi
1108
1109 if test "$risky" = "yes" ; then
1110 echo "#define CONFIG_RISKY 1" >> $TMPH
1111 echo "CONFIG_RISKY=yes" >> config.mak
1112 fi
1113
1114 echo "#define restrict $_restrict" >> $TMPH
1115
1116 # build tree in object directory if source path is different from current one
1117 if test "$source_path_used" = "yes" ; then
1118 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1119 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1120 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1121 for dir in $DIRS ; do
1122 mkdir -p $dir
1123 done
1124 for f in $FILES ; do
1125 ln -sf $source_path/$f $f
1126 done
1127 fi
1128 echo "SRC_PATH=$source_path" >> config.mak
1129
1130 if test "$amr_nb" = "yes" ; then
1131 echo "#define AMR_NB 1" >> $TMPH
1132 echo "AMR_NB=yes" >> config.mak
1133 echo
1134 if test "$amr_nb_fixed" = "yes" ; then
1135 echo "AMR_NB_FIXED=yes" >> config.mak
1136 echo "#define AMR_NB_FIXED 1" >> $TMPH
1137 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1138 echo "REL-5 version 5.1.0 from "
1139 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1140 echo "and extracted src to libavcodec/amr"
1141 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1142 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1143 echo
1144 else
1145 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1146 echo "REL-5 V5.1.0 from "
1147 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1148 echo "and extracted the source to libavcodec/amr_float"
1149 echo
1150 fi
1151
1152 fi
1153
1154 diff $TMPH config.h >/dev/null 2>&1
1155 if test $? -ne 0 ; then
1156 mv -f $TMPH config.h
1157 else
1158 echo "config.h is unchanged"
1159 fi
1160
1161 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH