update
[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 506 network="no"
258207b7 507 prefix="/c/Progra~1/FFmpeg"
732d9245
BE
508fi
509
0f3cb305
FB
510cc="${cross_prefix}${cc}"
511ar="${cross_prefix}${ar}"
be7109c1 512ranlib="${cross_prefix}${ranlib}"
0f3cb305
FB
513strip="${cross_prefix}${strip}"
514
487a54d7
FB
515if test -z "$cross_prefix" ; then
516
3d204385 517# ---
a3999908
MN
518# big/little endian test
519cat > $TMPC << EOF
520#include <inttypes.h>
521int main(int argc, char ** argv){
522 volatile uint32_t i=0x01234567;
523 return (*((uint8_t*)(&i))) == 0x67;
524}
525EOF
526
f3ec2d46
SG
527if $cc -o $TMPE $TMPC 2>/dev/null ; then
528$TMPE && bigendian="yes"
a3999908
MN
529else
530echo big/little test failed
531fi
532
487a54d7
FB
533else
534
535# if cross compiling, cannot launch a program, so make a static guess
536if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
537 bigendian="yes"
538fi
539
540fi
541
a3999908 542# ---
3d204385
NK
543# check availability of some header files
544
545cat > $TMPC << EOF
546#include <malloc.h>
547int main( void ) { return 0; }
548EOF
549
550_memalign=no
551_malloc_h=no
f3ec2d46 552if $cc -o $TMPE $TMPC 2> /dev/null ; then
3d204385
NK
553_malloc_h=yes
554_memalign=yes
555# check for memalign - atmos
556cat > $TMPC << EOF
557#include <malloc.h>
558int main ( void ) {
559char *string = NULL;
560string = memalign(64, sizeof(char));
561return 0;
562}
563EOF
f3ec2d46 564$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
3d204385
NK
565fi
566
68892110 567cat > $TMPC << EOF
5e4639e2
GM
568#include <time.h>
569int main( void ) { localtime_r(NULL, NULL); }
570EOF
571
572localtime_r=no
573if $cc -o $TMPE $TMPC 2> /dev/null ; then
574 localtime_r=yes
575fi
576
0147f198
FR
577if test "$zlib" = "yes"; then
578# check for zlib - mmu_man
579cat > $TMPC << EOF
580#include <zlib.h>
581int main ( void ) {
582if (zlibVersion() != ZLIB_VERSION)
583 puts("zlib version differs !!!");
584 return 1;
585return 0;
586}
587EOF
f3ec2d46
SG
588$cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
589# $TMPE 2> /dev/null > /dev/null || zlib="no"
0147f198
FR
590# XXX: more tests needed - runtime test
591fi
592if test "$zlib" = "yes"; then
593extralibs="$extralibs -lz"
594fi
595
95e2ce4a
MN
596# test for lrintf in math.h
597cat > $TMPC << EOF
598#define _ISOC9X_SOURCE 1
599#include <math.h>
600int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
601EOF
602
603have_lrintf="no"
f3ec2d46 604if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
95e2ce4a 605 have_lrintf="yes"
f3ec2d46 606 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
95e2ce4a
MN
607fi
608
c13e1abd
FH
609_restrict=
610for restrict_keyword in restrict __restrict__ __restrict; do
611 echo "void foo(char * $restrict_keyword p);" > $TMPC
612 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
613 _restrict=$restrict_keyword
614 break;
615 fi
616done
617
52b41d7f
FB
618# test gcc version to see if vector builtins can be used
619# currently only used on i386 for MMX builtins
620cat > $TMPC << EOF
621int main(void) {
622#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
623return 0;
624#else
625#error no vector builtins
626#endif
627}
628EOF
629
630builtin_vector=no
631if $cc -o $TMPO $TMPC 2> /dev/null ; then
632 builtin_vector=yes
a8721c09
FB
633fi
634
635# dlopen/dlfcn.h probing
636
637cat > $TMPC << EOF
638#include <dlfcn.h>
639int main( void ) { return (int) dlopen("foo", 0); }
640EOF
641
642ldl=-ldl
643
644if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
645dlfcn=yes
646dlopen=yes
647fi
648
649if $cc -o $TMPE $TMPC 2> /dev/null ; then
650dlfcn=yes
651dlopen=yes
652ldl=""
653fi
654
655cat > $TMPC << EOF
656int main( void ) { return (int) dlopen("foo", 0); }
657EOF
658
659if $cc -o $TMPE $TMPC -ldl 2> /dev/null ; then
660dlopen=yes
661fi
662
663if $cc -o $TMPE $TMPC 2> /dev/null ; then
664dlopen=yes
665ldl=""
666fi
667
668if test "$vhook" = "default" ; then
669 vhook="$dlopen"
670fi
671
a86b921c
FB
672##########################################
673# imlib probe
674
a8721c09
FB
675cat > $TMPC << EOF
676#include <X11/Xlib.h>
677#include <Imlib2.h>
678int main( void ) { return (int) imlib_load_font("foo"); }
679EOF
680
681imlib2=no
682if $cc -o $TMPE $TMPC -lImlib2 2> /dev/null ; then
683imlib2=yes
52b41d7f
FB
684fi
685
a86b921c
FB
686##########################################
687# freetype probe
688
04511d53
PG
689cat > $TMPC << EOF
690#include <ft2build.h>
691int main( void ) { return (int) FT_Init_FreeType(0); }
692EOF
693
694freetype2=no
69db4e10 695if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
6e023978 696 if test "`which freetype-config`" != ""; then
04511d53 697 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` 2> /dev/null ; then
dee076fc 698 freetype2=yes
04511d53 699 fi
dee076fc 700 fi
04511d53
PG
701fi
702
a86b921c
FB
703##########################################
704# SDL probe
705
706cat > $TMPC << EOF
707#include <SDL.h>
31319a8c 708#undef main /* We don't want SDL to override our main() */
a86b921c
FB
709int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
710EOF
711
712sdl_too_old=no
713sdl=no
714if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then
715_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
716if test "$_sdlversion" -lt 121 ; then
717sdl_too_old=yes
718else
719sdl=yes
720fi
721fi
722
94a3401e
FB
723if test "$sdl" = "no" ; then
724 ffplay=no
725fi
726
cddf3f45
GM
727if test "$debug" = "yes"; then
728 CFLAGS="$CFLAGS -g"
729fi
730
731if test "$optimize" = "small"; then
98ca7790 732# CFLAGS=${CFLAGS//-O3/-Os}
553a6284
MN
733 CFLAGS="$CFLAGS -Os"
734fi
735
cddf3f45
GM
736if test "$optimize" = "yes"; then
737 CFLAGS="$CFLAGS -O3"
738fi
739
23a65308
FB
740if test x"$mandir" = x""; then
741mandir="${prefix}/man"
742fi
743
6063bce7 744if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
0f3cb305
FB
745cat << EOF
746
747Usage: configure [options]
748Options: [defaults in brackets after descriptions]
749
750EOF
751echo "Standard options:"
752echo " --help print this message"
753echo " --prefix=PREFIX install in PREFIX [$prefix]"
23a65308 754echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
0f3cb305 755echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
81e0d0b4 756echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
0fc50e58
ZK
757echo " --enable-faad enable faad support via libfaad [default=no]"
758echo " --enable-faadbin build faad support with runtime linking [default=no]"
7eea5766 759echo " --enable-mingw32 enable mingw32 native/cross windows compile"
ba9261e5 760echo " --enable-a52 enable GPL'ed A52 support [default=no]"
0f3cb305 761echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
ba9261e5 762echo " --enable-pp enable GPL'ed post processing support [default=no]"
bba9b16c 763echo " --enable-shared-pp use libpostproc.so [default=no]"
0f3cb305 764echo " --enable-shared build shared libraries [default=no]"
bc634f6f
ZK
765echo " --enable-amr_nb enable amr_nb float audio codec"
766echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
f80f7964 767echo " --enable-sunmlib use Sun medialib [default=no]"
0f3cb305
FB
768echo ""
769echo "Advanced options (experts only):"
770echo " --source-path=PATH path of source code [$source_path]"
771echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
772echo " --cc=CC use C compiler CC [$cc]"
4a908fbc 773echo " --make=MAKE use specified make [$make]"
0f3cb305
FB
774echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
775echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
776echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
777echo " --cpu=CPU force cpu to CPU [$cpu]"
a4adb608 778echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
e45a2872 779echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
0f3cb305 780echo " --disable-mmx disable mmx usage"
ab6c65f6 781echo " --disable-altivec disable AltiVec usage"
5cbcf02c 782echo " --disable-audio-oss disable OSS audio support [default=no]"
dfdfa47c 783echo " --disable-audio-beos disable BeOS audio support [default=no]"
6063bce7 784echo " --disable-v4l disable video4linux grabbing [default=no]"
8aa3ee32 785echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
5cbcf02c 786echo " --disable-network disable network support [default=no]"
0147f198 787echo " --disable-zlib disable zlib [default=no]"
5cbcf02c 788echo " --disable-simple_idct disable simple IDCT routines [default=no]"
47930f09 789echo " --disable-vhook disable video hooking support"
0f3cb305 790echo " --enable-gprof enable profiling with gprof [$gprof]"
cddf3f45
GM
791echo " --disable-debug disable debugging symbols"
792echo " --disable-opts disable compiler optimizations"
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 828echo "pp support $pp"
cddf3f45
GM
829echo "debug symbols $debug"
830echo "optimize $optimize"
bba9b16c 831echo "shared pp $shared_pp"
47930f09 832echo "Video hooking $vhook"
a86b921c
FB
833echo "SDL support $sdl"
834if test $sdl_too_old = "yes"; then
835echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
836fi
1d0d55da 837echo "risky / patent encumbered codecs $risky"
68892110
PG
838
839if test "$vhook" = "yes" ; then
47930f09 840echo "Imlib2 support $imlib2"
04511d53 841echo "freetype support $freetype2"
68892110 842fi
f80f7964 843echo "Sun medialib support" $sunmlib
bc634f6f
ZK
844echo "AMR-NB float support" $amr_nb
845echo "AMR-NB fixed support" $amr_nb_fixed
de6d9b64 846
980fc7b8 847echo "Creating config.mak and config.h"
de6d9b64 848
980fc7b8 849echo "# Automatically generated by configure - do not modify" > config.mak
045ed63f 850echo "/* Automatically generated by configure - do not modify */" > $TMPH
de6d9b64 851
980fc7b8 852echo "prefix=$prefix" >> config.mak
23a65308 853echo "mandir=$mandir" >> config.mak
4a908fbc 854echo "MAKE=$make" >> config.mak
980fc7b8
FB
855echo "CC=$cc" >> config.mak
856echo "AR=$ar" >> config.mak
be7109c1 857echo "RANLIB=$ranlib" >> config.mak
0f3cb305 858echo "STRIP=$strip" >> config.mak
a9b3f630 859echo "OPTFLAGS=$CFLAGS" >> config.mak
0f3cb305 860echo "LDFLAGS=$LDFLAGS" >> config.mak
4baca069 861echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 862echo "SHFLAGS=$SHFLAGS" >> config.mak
f3ec2d46
SG
863echo "LIBPREF=$LIBPREF" >> config.mak
864echo "LIBSUF=$LIBSUF" >> config.mak
865echo "SLIBPREF=$SLIBPREF" >> config.mak
866echo "SLIBSUF=$SLIBSUF" >> config.mak
6852ac95 867echo "TARGET_OS=$TARGET_OS" >> config.mak
57514323 868if test "$cpu" = "x86" ; then
980fc7b8 869 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 870 echo "#define ARCH_X86 1" >> $TMPH
0f3cb305 871elif test "$cpu" = "armv4l" ; then
6ed7422a 872 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 873 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 874elif test "$cpu" = "alpha" ; then
91d1f1a4 875 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 876 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
877elif test "$cpu" = "sparc64" ; then
878 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
879 echo "#define ARCH_SPARC64 1" >> $TMPH
0f3cb305
FB
880elif test "$cpu" = "powerpc" ; then
881 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
882 echo "#define ARCH_POWERPC 1" >> $TMPH
e45a2872
RD
883 if test "$powerpc_perf" = "yes"; then
884 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
885 fi
d46aba26
LS
886elif test "$cpu" = "mips" ; then
887 echo "TARGET_ARCH_MIPS=yes" >> config.mak
888 echo "#define ARCH_MIPS 1" >> $TMPH
bdb2e37c
AB
889elif test "$cpu" = "sh4" ; then
890 echo "TARGET_ARCH_SH4=yes" >> config.mak
891 echo "#define ARCH_SH4 1" >> $TMPH
892fi
a4adb608 893echo "#define TUNECPU $TUNECPU" >> $TMPH
0f3cb305
FB
894if test "$bigendian" = "yes" ; then
895 echo "WORDS_BIGENDIAN=yes" >> config.mak
896 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 897fi
57514323 898if test "$mmx" = "yes" ; then
980fc7b8 899 echo "TARGET_MMX=yes" >> config.mak
045ed63f 900 echo "#define HAVE_MMX 1" >> $TMPH
e82c5a8c 901 echo "#define __CPU__ 586" >> $TMPH
de6d9b64 902fi
a17236c5
MN
903if test "$mingw32" = "yes" ; then
904 echo "TARGET_MINGW32=yes" >> config.mak
905fi
52b41d7f
FB
906if test "$builtin_vector" = "yes" ; then
907 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
908 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
909fi
d46aba26
LS
910if test "$mmi" = "yes" ; then
911 echo "TARGET_MMI=yes" >> config.mak
912 echo "#define HAVE_MMI 1" >> $TMPH
913fi
ab6c65f6
BF
914if test "$altivec" = "yes" ; then
915 echo "TARGET_ALTIVEC=yes" >> config.mak
916 echo "#define HAVE_ALTIVEC 1" >> $TMPH
db40a39a
MN
917 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
918 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
a9a07762
MN
919 if test "$_altivec_h" = "yes" ; then
920 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
921 else
e67e14d5 922 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
a9a07762 923 fi
ab6c65f6 924fi
57514323 925if test "$gprof" = "yes" ; then
980fc7b8 926 echo "TARGET_GPROF=yes" >> config.mak
045ed63f 927 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 928fi
5e4639e2
GM
929if test "$localtime_r" = "yes" ; then
930 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
5e4639e2 931fi
68892110
PG
932if test "$imlib2" = "yes" ; then
933 echo "HAVE_IMLIB2=yes" >> config.mak
934fi
04511d53
PG
935if test "$freetype2" = "yes" ; then
936 echo "HAVE_FREETYPE2=yes" >> config.mak
937fi
f80f7964
RS
938if test "$sunmlib" = "yes" ; then
939 echo "HAVE_MLIB=yes" >> config.mak
940 echo "#define HAVE_MLIB 1" >> $TMPH
941 extralibs="$extralibs -lmlib"
942fi
a86b921c
FB
943if test "$sdl" = "yes" ; then
944 echo "CONFIG_SDL=yes" >> config.mak
945 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
946 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
947fi
95e2ce4a
MN
948if test "$have_lrintf" = "yes" ; then
949 echo "#define HAVE_LRINTF 1" >> $TMPH
950fi
68892110
PG
951if test "$vhook" = "yes" ; then
952 echo "BUILD_VHOOK=yes" >> config.mak
953 echo "#define HAVE_VHOOK 1" >> $TMPH
9c938e77 954 extralibs="$extralibs $ldl"
68892110 955fi
57514323 956if test "$lshared" = "yes" ; then
0319c531 957 echo "BUILD_SHARED=yes" >> config.mak
5cbcf02c 958 echo "PIC=-fPIC" >> config.mak
0319c531 959fi
ef0bc4c9 960echo "EXTRALIBS=$extralibs" >> config.mak
258207b7
FB
961version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
962 cut -d '"' -f 2`
963echo "VERSION=$version" >>config.mak
d771bcae 964# if you do not want to use encoders, disable that.
045ed63f 965echo "#define CONFIG_ENCODERS 1" >> $TMPH
d771bcae
FB
966echo "CONFIG_ENCODERS=yes" >> config.mak
967
968# if you do not want to use decoders, disable that.
045ed63f 969echo "#define CONFIG_DECODERS 1" >> $TMPH
d771bcae
FB
970echo "CONFIG_DECODERS=yes" >> config.mak
971
5cbcf02c
FB
972# AC3
973if test "$a52" = "yes" ; then
974 echo "#define CONFIG_AC3 1" >> $TMPH
975 echo "CONFIG_AC3=yes" >> config.mak
d771bcae 976
5cbcf02c
FB
977 if test "$a52bin" = "yes" ; then
978 echo "#define CONFIG_A52BIN 1" >> $TMPH
979 echo "CONFIG_A52BIN=yes" >> config.mak
980 fi
981fi
982
bba9b16c
MN
983# PP
984if test "$pp" = "yes" ; then
985 echo "#define CONFIG_PP 1" >> $TMPH
986 echo "CONFIG_PP=yes" >> config.mak
987
988 if test "$shared_pp" = "yes" ; then
989 echo "#define SHARED_PP 1" >> $TMPH
990 echo "SHARED_PP=yes" >> config.mak
991 fi
992fi
993
1eb2212e
FB
994# mpeg audio high precision mode
995if test "$mpegaudio_hp" = "yes" ; then
996 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
997fi
998
5cbcf02c
FB
999if test "$v4l" = "yes" ; then
1000 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1001 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1002fi
1003
8aa3ee32
MK
1004if test "$dv1394" = "yes" ; then
1005 echo "#define CONFIG_DV1394 1" >> $TMPH
1006 echo "CONFIG_DV1394=yes" >> config.mak
1007fi
1008
adbc0510
PG
1009if test "$dlopen" = "yes" ; then
1010 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1011fi
1012
1013if test "$dlfcn" = "yes" ; then
1014 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1015fi
1016
5cbcf02c
FB
1017if test "$audio_oss" = "yes" ; then
1018 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1019 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
1020fi
1021
dfdfa47c
FR
1022if test "$audio_beos" = "yes" ; then
1023 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1024 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1025fi
1026
5cbcf02c
FB
1027if test "$network" = "yes" ; then
1028 echo "#define CONFIG_NETWORK 1" >> $TMPH
1029 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 1030fi
daf8e955 1031
0147f198
FR
1032if test "$zlib" = "yes" ; then
1033 echo "#define CONFIG_ZLIB 1" >> $TMPH
1034 echo "CONFIG_ZLIB=yes" >> config.mak
1035fi
1036
57514323 1037if test "$mp3lame" = "yes" ; then
045ed63f 1038 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
1039 echo "CONFIG_MP3LAME=yes" >> config.mak
1040fi
1041
81e0d0b4
MH
1042if test "$vorbis" = "yes" ; then
1043 echo "#define CONFIG_VORBIS 1" >> $TMPH
1044 echo "CONFIG_VORBIS=yes" >> config.mak
1045fi
1046
0fc50e58
ZK
1047if test "$faad" = "yes" ; then
1048 echo "#define CONFIG_FAAD 1" >> $TMPH
1049 echo "CONFIG_FAAD=yes" >> config.mak
1050fi
1051
1052if test "$faadbin" = "yes" ; then
1053 echo "#define CONFIG_FAADBIN 1" >> $TMPH
445ad18d 1054 echo "CONFIG_FAADBIN=yes" >> config.mak
0fc50e58
ZK
1055fi
1056
732d9245
BE
1057if test "$mingw32" = "yes" ; then
1058 echo "#define CONFIG_WIN32 1" >> $TMPH
1059 echo "CONFIG_WIN32=yes" >> config.mak
7eea5766 1060 echo "#ifndef __MINGW32__" >> $TMPH
732d9245 1061 echo "#define __MINGW32__ 1" >> $TMPH
7eea5766 1062 echo "#endif" >> $TMPH
732d9245
BE
1063 echo "__MINGW32__=1" >> config.mak
1064fi
1065
3f027ca7
FB
1066if test "$cygwin" = "yes" ; then
1067 # setup correct exesuffix
1068 echo "CONFIG_WIN32=yes" >> config.mak
1069fi
1070
f3ec2d46
SG
1071if test "$os2" = "yes" ; then
1072 echo "#define CONFIG_OS2 1" >> $TMPH
1073 echo "CONFIG_OS2=yes" >> config.mak
1074fi
1075
6e023978
RS
1076if test "$TARGET_OS" = "SunOS" ; then
1077 echo "#define CONFIG_SUNOS 1" >> $TMPH
1078fi
1079
90cee0c3
MN
1080if test "$darwin" = "yes"; then
1081 echo "#define CONFIG_DARWIN 1" >> $TMPH
1082 echo "CONFIG_DARWIN=yes" >> config.mak
1083fi
1084
57514323 1085if test "$_malloc_h" = "yes" ; then
045ed63f 1086 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 1087else
045ed63f 1088 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
1089fi
1090
57514323 1091if test "$_memalign" = "yes" ; then
045ed63f
ZK
1092 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1093else
1094 echo "#undef HAVE_MEMALIGN" >> $TMPH
1095fi
1096
26b35efb
FR
1097if test "$netserver" = "yes" ; then
1098 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1099 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1100fi
1101
4baca069
PG
1102if test "$need_inet_aton" = "yes" ; then
1103 echo "NEED_INET_ATON=yes" >> config.mak
1104fi
1105
57514323 1106if test "$simpleidct" = "yes" ; then
045ed63f
ZK
1107 echo "#define SIMPLE_IDCT 1" >> $TMPH
1108fi
1109
8154d2e0
FB
1110if test "$ffserver" = "yes" ; then
1111 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1112 echo "CONFIG_FFSERVER=yes" >> config.mak
1113fi
1114
a86b921c
FB
1115if test "$ffplay" = "yes" ; then
1116 echo "CONFIG_FFPLAY=yes" >> config.mak
1117fi
1118
1d0d55da
MN
1119if test "$risky" = "yes" ; then
1120 echo "#define CONFIG_RISKY 1" >> $TMPH
1121 echo "CONFIG_RISKY=yes" >> config.mak
1122fi
1123
c13e1abd
FH
1124echo "#define restrict $_restrict" >> $TMPH
1125
0f3cb305
FB
1126# build tree in object directory if source path is different from current one
1127if test "$source_path_used" = "yes" ; then
a382b927 1128 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
5f6b58de
MR
1129 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1130 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
0f3cb305
FB
1131 for dir in $DIRS ; do
1132 mkdir -p $dir
1133 done
1134 for f in $FILES ; do
1135 ln -sf $source_path/$f $f
1136 done
1137fi
1138echo "SRC_PATH=$source_path" >> config.mak
1139
891f64b3 1140if test "$amr_nb" = "yes" ; then
1141 echo "#define AMR_NB 1" >> $TMPH
1142 echo "AMR_NB=yes" >> config.mak
1143 echo
bc634f6f
ZK
1144if test "$amr_nb_fixed" = "yes" ; then
1145 echo "AMR_NB_FIXED=yes" >> config.mak
1146 echo "#define AMR_NB_FIXED 1" >> $TMPH
1147 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1148 echo "REL-5 version 5.1.0 from "
891f64b3 1149 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1150 echo "and extracted src to libavcodec/amr"
bc634f6f
ZK
1151 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1152 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1153 echo
1154else
1155 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1156 echo "REL-5 V5.1.0 from "
1157 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1158 echo "and extracted the source to libavcodec/amr_float"
891f64b3 1159 echo
1160fi
1161
bc634f6f
ZK
1162fi
1163
a7c02e25 1164diff $TMPH config.h >/dev/null 2>&1
045ed63f
ZK
1165if test $? -ne 0 ; then
1166 mv -f $TMPH config.h
3d204385 1167else
045ed63f 1168 echo "config.h is unchanged"
3d204385
NK
1169fi
1170
f3ec2d46 1171rm -f $TMPO $TMPC $TMPE $TMPS $TMPH