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