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