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