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