dv patch by Max Krasnyansky (maxk at qualcomm dot com)
[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 *)
49 cpu="unknown"
50 ;;
51 esac
52 gprof="no"
53 v4l="yes"
54 audio_oss="yes"
55 audio_beos="no"
56 dv1394="yes"
57 network="yes"
58 zlib="yes"
59 mp3lame="no"
60 vorbis="no"
61 a52="yes"
62 a52bin="no"
63 win32="no"
64 mingw32="no"
65 cygwin="no"
66 os2="no"
67 lshared="no"
68 extralibs="-lm"
69 simpleidct="yes"
70 bigendian="no"
71 vhook="no"
72 dlfcn="no"
73 dlopen="no"
74 mpegaudio_hp="yes"
75 SHFLAGS=-shared
76 netserver="no"
77 need_inet_aton="no"
78 ffserver="yes"
79 LDFLAGS=-Wl,--warn-common
80 FFSLDFLAGS=-Wl,-E
81 LIBPREF="lib"
82 LIBSUF=".a"
83 SLIBPREF="lib"
84 SLIBSUF=".so"
85
86 # OS specific
87 targetos=`uname -s`
88 case $targetos in
89 BeOS)
90 prefix="/boot/home/config"
91 # helps building libavcodec
92 CFLAGS="-O3 -DPIC -fomit-frame-pointer"
93 # 3 gcc releases known for BeOS, each with ugly bugs
94 gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
95 case "$gcc_version" in
96 2.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
97 mmx="no"
98 ;;
99 *20010315*) echo "BeBits gcc"
100 CFLAGS="$CFLAGS -fno-expensive-optimizations"
101 ;;
102 esac
103 SHFLAGS=-nostart
104 # disable linux things
105 audio_oss="no"
106 v4l="no"
107 dv1394="no"
108 # enable beos things
109 audio_beos="yes"
110 # no need for libm, but the inet stuff
111 # Check for BONE
112 if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
113 extralibs="-lbind -lsocket"
114 else
115 netserver="yes"
116 need_inet_aton="yes"
117 extralibs="-lnet"
118 fi ;;
119 SunOS)
120 v4l="no"
121 audio_oss="no"
122 dv1394="no"
123 make="gmake"
124 LDFLAGS=""
125 FFSLDFLAGS=""
126 need_inet_aton="yes"
127 extralibs="$extralibs -lsocket -lnsl"
128 ;;
129 FreeBSD)
130 v4l="no"
131 audio_oss="yes"
132 dv1394="no"
133 make="gmake"
134 LDFLAGS="$LDFLAGS -export-dynamic"
135 ;;
136 BSD/OS)
137 v4l="no"
138 audio_oss="yes"
139 dv1394="no"
140 extralibs="-lpoll -lgnugetopt -lm"
141 make="gmake"
142 ;;
143 Darwin)
144 cc="cc"
145 v4l="no"
146 audio_oss="no"
147 dv1394="no"
148 SHFLAGS="-dynamiclib"
149 extralibs=""
150 darwin="yes"
151 strip="strip -x"
152 LDFLAGS="-d"
153 FFSLDFLAGS=-Wl,-bind_at_load
154 gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f4-)"
155 case "$gcc_version" in
156 *2.95*)
157 CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer"
158 ;;
159 *)
160 CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic"
161 ;;
162 esac
163 ;;
164 MINGW32*)
165 v4l="no"
166 audio_oss="no"
167 dv1394="no"
168 ffserver="no"
169 network="no"
170 mingw32="yes"
171 ;;
172 CYGWIN*)
173 v4l="no"
174 audio_oss="yes"
175 dv1394="no"
176 extralibs=""
177 cygwin="yes"
178 test -f /usr/include/inttypes.h || \
179 test -f /usr/local/include/inttypes.h || \
180 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
181 "/usr/include/inttypes.h !!!"
182 ;;
183 Linux)
184 LDFLAGS="$LDFLAGS -rdynamic"
185 ;;
186 OS/2)
187 TMPE=$TMPE".exe"
188 ar="emxomfar -p32"
189 strip="echo ignore strip"
190 CFLAGS="-Zomf"
191 LDFLAGS="-Zomf -Zstack 16384"
192 SHFLAGS=""
193 FFSLDFLAGS=""
194 LIBPREF=""
195 LIBSUF=".lib"
196 SLIBPREF=""
197 SLIBSUF=".dll"
198 extralibs=""
199 v4l="no"
200 audio_oss="no"
201 dv1394="no"
202 network="no"
203 ffserver="no"
204 os2="yes"
205 ;;
206 *) ;;
207 esac
208
209 # find source path
210 # XXX: we assume an absolute path is given when launching configure,
211 # except in './configure' case.
212 source_path=${0%configure}
213 source_path=${source_path%/}
214 source_path_used="yes"
215 if test -z "$source_path" -o "$source_path" = "." ; then
216 source_path=`pwd`
217 source_path_used="no"
218 fi
219
220 cat > $TMPC << EOF
221 #include <dlfcn.h>
222 int main( void ) { return (int) dlopen("foo", 0); }
223 EOF
224
225 ldl=-ldl
226
227 if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
228 vhook=yes
229 dlfcn=yes
230 dlopen=yes
231 fi
232
233 if $cc -o $TMPE $TMPC 2> /dev/null ; then
234 vhook=yes
235 dlfcn=yes
236 dlopen=yes
237 ldl=""
238 fi
239
240 cat > $TMPC << EOF
241 int main( void ) { return (int) dlopen("foo", 0); }
242 EOF
243
244 if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
245 vhook=yes
246 dlopen=yes
247 fi
248
249 if $cc -o $TMPE $TMPC 2> /dev/null ; then
250 vhook=yes
251 dlopen=yes
252 ldl=""
253 fi
254
255
256 cat > $TMPC << EOF
257 #include <X11/Xlib.h>
258 #include <Imlib2.h>
259 int main( void ) { return (int) imlib_load_font("foo"); }
260 EOF
261
262 imlib2=no
263 if $cc -o $TMPE $TMPC -lImlib2 2> /dev/null ; then
264 imlib2=yes
265 fi
266
267 for opt do
268 case "$opt" in
269 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
270 ;;
271 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
272 ;;
273 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
274 ;;
275 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
276 ;;
277 --make=*) make=`echo $opt | cut -d '=' -f 2`
278 ;;
279 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
280 ;;
281 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
282 ;;
283 --extra-libs=*) extralibs=${opt#--extra-libs=}
284 ;;
285 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
286 ;;
287 --disable-mmx) mmx="no"
288 ;;
289 --disable-altivec) altivec="no"
290 ;;
291 --enable-gprof) gprof="yes"
292 ;;
293 --disable-v4l) v4l="no"
294 ;;
295 --disable-audio-oss) audio_oss="no"
296 ;;
297 --disable-audio-beos) audio_beos="no"
298 ;;
299 --disable-dv1394) dv1394="no"
300 ;;
301 --disable-network) network="no"
302 ;;
303 --disable-zlib) zlib="no"
304 ;;
305 --disable-a52) a52="no"
306 ;;
307 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
308 ;;
309 --enable-mp3lame) mp3lame="yes"
310 ;;
311 --enable-vorbis) vorbis="yes"
312 ;;
313 --disable-vhook) vhook="no"
314 ;;
315 --disable-simple_idct) simpleidct="no"
316 ;;
317 --enable-win32) win32="yes"
318 ;;
319 --enable-mingw32) mingw32="yes"
320 ;;
321 --enable-shared) lshared="yes"
322 ;;
323 --disable-mpegaudio-hp) mpegaudio_hp="no"
324 ;;
325 --disable-ffserver) ffserver="no"
326 ;;
327 esac
328 done
329
330 # compute mmx state
331 if test $mmx = "default"; then
332 if test $cpu = "x86"; then
333 mmx="yes"
334 else
335 mmx="no"
336 fi
337 fi
338
339 # Can only do AltiVec on PowerPC
340 if test $altivec = "default"; then
341 if test $cpu = "powerpc"; then
342 altivec="yes"
343 else
344 altivec="no"
345 fi
346 fi
347
348 # See does our compiler support Motorola AltiVec C API
349 if test $altivec = "yes"; then
350 cat > $TMPC << EOF
351 int main(void) {
352 vector signed int v1, v2, v3;
353 v1 = vec_add(v2,v3);
354 return 0;
355 }
356 EOF
357 $cc -o $TMPE $TMPC -faltivec 2> /dev/null || altivec="no"
358 fi
359
360 # Can only do mmi on mips
361 if test $mmi = "default"; then
362 if test $cpu = "mips"; then
363 mmi="yes"
364 else
365 mmi="no"
366 fi
367 fi
368
369 # See does our compiler support mmi
370 if test $mmi = "yes"; then
371 cat > $TMPC << EOF
372 int main(void) {
373 __asm__ ("lq \$2, 0(\$2)");
374 return 0;
375 }
376 EOF
377 $cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
378 fi
379
380 # Checking for CFLAGS
381 if test -z "$CFLAGS"; then
382 CFLAGS="-O3"
383 fi
384
385 if test "$win32" = "yes" ; then
386 cross_prefix="i386-mingw32msvc-"
387 v4l="no"
388 audio_oss="no"
389 dv1394="no"
390 network="no"
391 fi
392
393 if test "$mingw32" = "yes" ; then
394 cross_prefix=""
395 v4l="no"
396 audio_oss="no"
397 dv1394="no"
398 network="no"
399 fi
400
401 cc="${cross_prefix}${cc}"
402 ar="${cross_prefix}${ar}"
403 ranlib="${cross_prefix}${ranlib}"
404 strip="${cross_prefix}${strip}"
405
406 if test -z "$cross_prefix" ; then
407
408 # ---
409 # big/little endian test
410 cat > $TMPC << EOF
411 #include <inttypes.h>
412 int main(int argc, char ** argv){
413 volatile uint32_t i=0x01234567;
414 return (*((uint8_t*)(&i))) == 0x67;
415 }
416 EOF
417
418 if $cc -o $TMPE $TMPC 2>/dev/null ; then
419 $TMPE && bigendian="yes"
420 else
421 echo big/little test failed
422 fi
423
424 else
425
426 # if cross compiling, cannot launch a program, so make a static guess
427 if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
428 bigendian="yes"
429 fi
430
431 fi
432
433 # ---
434 # check availability of some header files
435
436 cat > $TMPC << EOF
437 #include <malloc.h>
438 int main( void ) { return 0; }
439 EOF
440
441 _memalign=no
442 _malloc_h=no
443 if $cc -o $TMPE $TMPC 2> /dev/null ; then
444 _malloc_h=yes
445 _memalign=yes
446 # check for memalign - atmos
447 cat > $TMPC << EOF
448 #include <malloc.h>
449 int main ( void ) {
450 char *string = NULL;
451 string = memalign(64, sizeof(char));
452 return 0;
453 }
454 EOF
455 $cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
456 fi
457
458 cat > $TMPC << EOF
459 #define _GNU_SOURCE
460 #include <time.h>
461 int main( void ) { return *strptime("", "", 0); }
462 EOF
463
464 strptime=no
465 if $cc -o $TMPE $TMPC 2> /dev/null ; then
466 strptime=yes
467 fi
468
469 if test "$zlib" = "yes"; then
470 # check for zlib - mmu_man
471 cat > $TMPC << EOF
472 #include <zlib.h>
473 int main ( void ) {
474 if (zlibVersion() != ZLIB_VERSION)
475 puts("zlib version differs !!!");
476 return 1;
477 return 0;
478 }
479 EOF
480 $cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
481 # $TMPE 2> /dev/null > /dev/null || zlib="no"
482 # XXX: more tests needed - runtime test
483 fi
484 if test "$zlib" = "yes"; then
485 extralibs="$extralibs -lz"
486 fi
487
488 # test for lrintf in math.h
489 cat > $TMPC << EOF
490 #define _ISOC9X_SOURCE 1
491 #include <math.h>
492 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
493 EOF
494
495 have_lrintf="no"
496 if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
497 have_lrintf="yes"
498 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
499 fi
500
501 _restrict=
502 for restrict_keyword in restrict __restrict__ __restrict; do
503 echo "void foo(char * $restrict_keyword p);" > $TMPC
504 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
505 _restrict=$restrict_keyword
506 break;
507 fi
508 done
509
510 # test gcc version to see if vector builtins can be used
511 # currently only used on i386 for MMX builtins
512 cat > $TMPC << EOF
513 int main(void) {
514 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
515 return 0;
516 #else
517 #error no vector builtins
518 #endif
519 }
520 EOF
521
522 builtin_vector=no
523 if $cc -o $TMPO $TMPC 2> /dev/null ; then
524 builtin_vector=yes
525 fi
526
527 if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
528 cat << EOF
529
530 Usage: configure [options]
531 Options: [defaults in brackets after descriptions]
532
533 EOF
534 echo "Standard options:"
535 echo " --help print this message"
536 echo " --prefix=PREFIX install in PREFIX [$prefix]"
537 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
538 echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
539 echo " --enable-win32 enable win32 cross compile"
540 echo " --enable-mingw32 enable mingw32 native windows compile"
541 echo " --disable-a52 disable GPL'ed A52 support [default=no]"
542 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
543 echo " --enable-shared build shared libraries [default=no]"
544 echo ""
545 echo "Advanced options (experts only):"
546 echo " --source-path=PATH path of source code [$source_path]"
547 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
548 echo " --cc=CC use C compiler CC [$cc]"
549 echo " --make=MAKE use specified make [$make]"
550 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
551 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
552 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
553 echo " --cpu=CPU force cpu to CPU [$cpu]"
554 echo " --disable-mmx disable mmx usage"
555 echo " --disable-altivec disable AltiVec usage"
556 echo " --disable-audio-oss disable OSS audio support [default=no]"
557 echo " --disable-audio-beos disable BeOS audio support [default=no]"
558 echo " --disable-v4l disable video4linux grabbing [default=no]"
559 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
560 echo " --disable-network disable network support [default=no]"
561 echo " --disable-zlib disable zlib [default=no]"
562 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
563 echo " --disable-vhook disable video hooking support"
564 echo " --enable-gprof enable profiling with gprof [$gprof]"
565 echo " --disable-mpegaudio-hp faster (but less accurate)"
566 echo " mpegaudio decoding [default=no]"
567 echo " --disable-ffserver disable ffserver build"
568 echo ""
569 echo "NOTE: The object files are build at the place where configure is launched"
570 exit 1
571 fi
572
573 echo "Install prefix $prefix"
574 echo "Source path $source_path"
575 echo "C compiler $cc"
576 echo "make $make"
577 echo "CPU $cpu"
578 echo "Big Endian $bigendian"
579 if test $cpu = "x86"; then
580 echo "MMX enabled $mmx"
581 echo "Vector Builtins $builtin_vector"
582 fi
583 if test $cpu = "mips"; then
584 echo "MMI enabled $mmi"
585 fi
586 if test $cpu = "powerpc"; then
587 echo "AltiVec enabled $altivec"
588 fi
589 echo "gprof enabled $gprof"
590 echo "zlib enabled $zlib"
591 echo "mp3lame enabled $mp3lame"
592 echo "vorbis enabled $vorbis"
593 echo "a52 support $a52"
594 echo "a52 dlopened $a52bin"
595 echo "Video hooking $vhook"
596
597 if test "$vhook" = "yes" ; then
598 echo "Imlib2 support $imlib2"
599 fi
600
601 echo "Creating config.mak and config.h"
602
603 echo "# Automatically generated by configure - do not modify" > config.mak
604 echo "/* Automatically generated by configure - do not modify */" > $TMPH
605
606 echo "prefix=$prefix" >> config.mak
607 echo "MAKE=$make" >> config.mak
608 echo "CC=$cc" >> config.mak
609 echo "AR=$ar" >> config.mak
610 echo "RANLIB=$ranlib" >> config.mak
611 echo "STRIP=$strip" >> config.mak
612 echo "OPTFLAGS=$CFLAGS" >> config.mak
613 echo "LDFLAGS=$LDFLAGS" >> config.mak
614 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
615 echo "SHFLAGS=$SHFLAGS" >> config.mak
616 echo "LIBPREF=$LIBPREF" >> config.mak
617 echo "LIBSUF=$LIBSUF" >> config.mak
618 echo "SLIBPREF=$SLIBPREF" >> config.mak
619 echo "SLIBSUF=$SLIBSUF" >> config.mak
620 if test "$cpu" = "x86" ; then
621 echo "TARGET_ARCH_X86=yes" >> config.mak
622 echo "#define ARCH_X86 1" >> $TMPH
623 elif test "$cpu" = "armv4l" ; then
624 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
625 echo "#define ARCH_ARMV4L 1" >> $TMPH
626 elif test "$cpu" = "alpha" ; then
627 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
628 echo "#define ARCH_ALPHA 1" >> $TMPH
629 elif test "$cpu" = "sparc64" ; then
630 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
631 echo "#define ARCH_SPARC64 1" >> $TMPH
632 elif test "$cpu" = "powerpc" ; then
633 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
634 echo "#define ARCH_POWERPC 1" >> $TMPH
635 echo "// Enable the next line to get PowerPC performance report" >> $TMPH
636 echo "// #define POWERPC_TBL_PERFORMANCE_REPORT 1" >> $TMPH
637 echo "// Enable the next line to use PMC registers instead of TBL" >> $TMPH
638 echo "// #define POWERPC_PERF_USE_PMC 1" >> $TMPH
639 elif test "$cpu" = "mips" ; then
640 echo "TARGET_ARCH_MIPS=yes" >> config.mak
641 echo "#define ARCH_MIPS 1" >> $TMPH
642 fi
643 if test "$bigendian" = "yes" ; then
644 echo "WORDS_BIGENDIAN=yes" >> config.mak
645 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
646 fi
647 if test "$mmx" = "yes" ; then
648 echo "TARGET_MMX=yes" >> config.mak
649 echo "#define HAVE_MMX 1" >> $TMPH
650 fi
651 if test "$builtin_vector" = "yes" ; then
652 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
653 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
654 fi
655 if test "$mmi" = "yes" ; then
656 echo "TARGET_MMI=yes" >> config.mak
657 echo "#define HAVE_MMI 1" >> $TMPH
658 fi
659 if test "$altivec" = "yes" ; then
660 echo "TARGET_ALTIVEC=yes" >> config.mak
661 echo "#define HAVE_ALTIVEC 1" >> $TMPH
662 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
663 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
664 fi
665 if test "$gprof" = "yes" ; then
666 echo "TARGET_GPROF=yes" >> config.mak
667 echo "#define HAVE_GPROF 1" >> $TMPH
668 fi
669 if test "$strptime" = "yes" ; then
670 echo "#define HAVE_STRPTIME 1" >> $TMPH
671 else
672 echo "BUILD_STRPTIME=yes" >> config.mak
673 fi
674 if test "$imlib2" = "yes" ; then
675 echo "HAVE_IMLIB2=yes" >> config.mak
676 fi
677 if test "$have_lrintf" = "yes" ; then
678 echo "#define HAVE_LRINTF 1" >> $TMPH
679 fi
680 if test "$vhook" = "yes" ; then
681 echo "BUILD_VHOOK=yes" >> config.mak
682 echo "#define HAVE_VHOOK 1" >> $TMPH
683 extralibs="$extralibs $ldl"
684 fi
685 if test "$lshared" = "yes" ; then
686 echo "BUILD_SHARED=yes" >> config.mak
687 echo "PIC=-fPIC" >> config.mak
688 fi
689 echo "EXTRALIBS=$extralibs" >> config.mak
690 echo -n "VERSION=" >>config.mak
691 head $source_path/VERSION >>config.mak
692 echo "" >>config.mak
693 # if you do not want to use encoders, disable that.
694 echo "#define CONFIG_ENCODERS 1" >> $TMPH
695 echo "CONFIG_ENCODERS=yes" >> config.mak
696
697 # if you do not want to use decoders, disable that.
698 echo "#define CONFIG_DECODERS 1" >> $TMPH
699 echo "CONFIG_DECODERS=yes" >> config.mak
700
701 # AC3
702 if test "$a52" = "yes" ; then
703 echo "#define CONFIG_AC3 1" >> $TMPH
704 echo "CONFIG_AC3=yes" >> config.mak
705
706 if test "$a52bin" = "yes" ; then
707 echo "#define CONFIG_A52BIN 1" >> $TMPH
708 echo "CONFIG_A52BIN=yes" >> config.mak
709 fi
710 fi
711
712 # mpeg audio high precision mode
713 if test "$mpegaudio_hp" = "yes" ; then
714 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
715 fi
716
717 if test "$v4l" = "yes" ; then
718 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
719 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
720 fi
721
722 if test "$dv1394" = "yes" ; then
723 echo "#define CONFIG_DV1394 1" >> $TMPH
724 echo "CONFIG_DV1394=yes" >> config.mak
725 fi
726
727 if test "$dlopen" = "yes" ; then
728 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
729 fi
730
731 if test "$dlfcn" = "yes" ; then
732 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
733 fi
734
735 if test "$audio_oss" = "yes" ; then
736 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
737 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
738 fi
739
740 if test "$audio_beos" = "yes" ; then
741 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
742 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
743 fi
744
745 if test "$network" = "yes" ; then
746 echo "#define CONFIG_NETWORK 1" >> $TMPH
747 echo "CONFIG_NETWORK=yes" >> config.mak
748 fi
749
750 if test "$zlib" = "yes" ; then
751 echo "#define CONFIG_ZLIB 1" >> $TMPH
752 echo "CONFIG_ZLIB=yes" >> config.mak
753 fi
754
755 if test "$mp3lame" = "yes" ; then
756 echo "#define CONFIG_MP3LAME 1" >> $TMPH
757 echo "CONFIG_MP3LAME=yes" >> config.mak
758 fi
759
760 if test "$vorbis" = "yes" ; then
761 echo "#define CONFIG_VORBIS 1" >> $TMPH
762 echo "CONFIG_VORBIS=yes" >> config.mak
763 fi
764
765 if test "$win32" = "yes" ; then
766 echo "#define CONFIG_WIN32 1" >> $TMPH
767 echo "CONFIG_WIN32=yes" >> config.mak
768 fi
769
770 if test "$mingw32" = "yes" ; then
771 echo "#define CONFIG_WIN32 1" >> $TMPH
772 echo "CONFIG_WIN32=yes" >> config.mak
773 echo "#define __MINGW32__ 1" >> $TMPH
774 echo "__MINGW32__=1" >> config.mak
775 fi
776
777 if test "$cygwin" = "yes" ; then
778 # setup correct exesuffix
779 echo "CONFIG_WIN32=yes" >> config.mak
780 fi
781
782 if test "$os2" = "yes" ; then
783 echo "#define CONFIG_OS2 1" >> $TMPH
784 echo "CONFIG_OS2=yes" >> config.mak
785 fi
786
787 if test "$darwin" = "yes"; then
788 echo "#define CONFIG_DARWIN 1" >> $TMPH
789 echo "CONFIG_DARWIN=yes" >> config.mak
790 fi
791
792 if test "$_malloc_h" = "yes" ; then
793 echo "#define HAVE_MALLOC_H 1" >> $TMPH
794 else
795 echo "#undef HAVE_MALLOC_H" >> $TMPH
796 fi
797
798 if test "$_memalign" = "yes" ; then
799 echo "#define HAVE_MEMALIGN 1" >> $TMPH
800 else
801 echo "#undef HAVE_MEMALIGN" >> $TMPH
802 fi
803
804 if test "$netserver" = "yes" ; then
805 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
806 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
807 fi
808
809 if test "$need_inet_aton" = "yes" ; then
810 echo "NEED_INET_ATON=yes" >> config.mak
811 fi
812
813 if test "$simpleidct" = "yes" ; then
814 echo "#define SIMPLE_IDCT 1" >> $TMPH
815 fi
816
817 if test "$ffserver" = "yes" ; then
818 echo "#define CONFIG_FFSERVER 1" >> $TMPH
819 echo "CONFIG_FFSERVER=yes" >> config.mak
820 fi
821
822 echo "#define restrict $_restrict" >> $TMPH
823
824 # build tree in object directory if source path is different from current one
825 if test "$source_path_used" = "yes" ; then
826 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
827 libavcodec/ppc libavcodec/liba52 libavcodec/mlib tests vhook"
828 FILES="Makefile libavformat/Makefile libavcodec/Makefile tests/Makefile vhook/Makefile"
829 for dir in $DIRS ; do
830 mkdir -p $dir
831 done
832 for f in $FILES ; do
833 ln -sf $source_path/$f $f
834 done
835 fi
836 echo "SRC_PATH=$source_path" >> config.mak
837
838 diff $TMPH config.h >/dev/null 2>&1
839 if test $? -ne 0 ; then
840 mv -f $TMPH config.h
841 else
842 echo "config.h is unchanged"
843 fi
844
845 rm -f $TMPO $TMPC $TMPE $TMPS $TMPH