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