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