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