Get all the stride stuff right so that we actually get the colours
[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>
630int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
631EOF
632
633sdl_too_old=no
634sdl=no
635if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then
636_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
637if test "$_sdlversion" -lt 121 ; then
638sdl_too_old=yes
639else
640sdl=yes
641fi
642fi
643
c9f97d82 644if test "$small" = "yes"; then
98ca7790 645# CFLAGS=${CFLAGS//-O3/-Os}
553a6284
MN
646 CFLAGS="$CFLAGS -Os"
647fi
648
6063bce7 649if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
0f3cb305
FB
650cat << EOF
651
652Usage: configure [options]
653Options: [defaults in brackets after descriptions]
654
655EOF
656echo "Standard options:"
657echo " --help print this message"
658echo " --prefix=PREFIX install in PREFIX [$prefix]"
0f3cb305 659echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
81e0d0b4 660echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
0fc50e58
ZK
661echo " --enable-faad enable faad support via libfaad [default=no]"
662echo " --enable-faadbin build faad support with runtime linking [default=no]"
0f3cb305 663echo " --enable-win32 enable win32 cross compile"
732d9245 664echo " --enable-mingw32 enable mingw32 native windows compile"
5cbcf02c 665echo " --disable-a52 disable GPL'ed A52 support [default=no]"
0f3cb305 666echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
bba9b16c
MN
667echo " --disable-pp disable GPL'ed post processing support [default=no]"
668echo " --enable-shared-pp use libpostproc.so [default=no]"
0f3cb305 669echo " --enable-shared build shared libraries [default=no]"
bc634f6f
ZK
670echo " --enable-amr_nb enable amr_nb float audio codec"
671echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
0f3cb305
FB
672echo ""
673echo "Advanced options (experts only):"
674echo " --source-path=PATH path of source code [$source_path]"
675echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
676echo " --cc=CC use C compiler CC [$cc]"
4a908fbc 677echo " --make=MAKE use specified make [$make]"
0f3cb305
FB
678echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
679echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
680echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
681echo " --cpu=CPU force cpu to CPU [$cpu]"
682echo " --disable-mmx disable mmx usage"
ab6c65f6 683echo " --disable-altivec disable AltiVec usage"
5cbcf02c 684echo " --disable-audio-oss disable OSS audio support [default=no]"
dfdfa47c 685echo " --disable-audio-beos disable BeOS audio support [default=no]"
6063bce7 686echo " --disable-v4l disable video4linux grabbing [default=no]"
8aa3ee32 687echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
5cbcf02c 688echo " --disable-network disable network support [default=no]"
0147f198 689echo " --disable-zlib disable zlib [default=no]"
5cbcf02c 690echo " --disable-simple_idct disable simple IDCT routines [default=no]"
47930f09 691echo " --disable-vhook disable video hooking support"
0f3cb305 692echo " --enable-gprof enable profiling with gprof [$gprof]"
1eb2212e
FB
693echo " --disable-mpegaudio-hp faster (but less accurate)"
694echo " mpegaudio decoding [default=no]"
8154d2e0 695echo " --disable-ffserver disable ffserver build"
a86b921c 696echo " --disable-ffplay disable ffplay build"
1d0d55da 697echo " --disable-risky disables patent encumbered codecs"
553a6284 698echo " --enable-small optimize for size instead of speed"
0f3cb305
FB
699echo ""
700echo "NOTE: The object files are build at the place where configure is launched"
701exit 1
702fi
703
de6d9b64 704echo "Install prefix $prefix"
0f3cb305 705echo "Source path $source_path"
de6d9b64 706echo "C compiler $cc"
4a908fbc 707echo "make $make"
de6d9b64 708echo "CPU $cpu"
0f3cb305 709echo "Big Endian $bigendian"
e41e8342 710if test $cpu = "x86"; then
de6d9b64 711echo "MMX enabled $mmx"
52b41d7f 712echo "Vector Builtins $builtin_vector"
e41e8342
FB
713fi
714if test $cpu = "mips"; then
d46aba26 715echo "MMI enabled $mmi"
e41e8342
FB
716fi
717if test $cpu = "powerpc"; then
ab6c65f6 718echo "AltiVec enabled $altivec"
e41e8342 719fi
de6d9b64 720echo "gprof enabled $gprof"
0147f198 721echo "zlib enabled $zlib"
a6741398 722echo "mp3lame enabled $mp3lame"
81e0d0b4 723echo "vorbis enabled $vorbis"
445ad18d
ZK
724echo "faad enabled $faad"
725echo "faadbin enabled $faadbin"
5cbcf02c 726echo "a52 support $a52"
57514323 727echo "a52 dlopened $a52bin"
bba9b16c
MN
728echo "pp support $pp"
729echo "shared pp $shared_pp"
47930f09 730echo "Video hooking $vhook"
a86b921c
FB
731echo "SDL support $sdl"
732if test $sdl_too_old = "yes"; then
733echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
734fi
1d0d55da 735echo "risky / patent encumbered codecs $risky"
553a6284 736echo "optimize for size $small"
68892110
PG
737
738if test "$vhook" = "yes" ; then
47930f09 739echo "Imlib2 support $imlib2"
04511d53 740echo "freetype support $freetype2"
68892110 741fi
bc634f6f
ZK
742echo "AMR-NB float support" $amr_nb
743echo "AMR-NB fixed support" $amr_nb_fixed
de6d9b64 744
980fc7b8 745echo "Creating config.mak and config.h"
de6d9b64 746
980fc7b8 747echo "# Automatically generated by configure - do not modify" > config.mak
045ed63f 748echo "/* Automatically generated by configure - do not modify */" > $TMPH
de6d9b64 749
980fc7b8 750echo "prefix=$prefix" >> config.mak
4a908fbc 751echo "MAKE=$make" >> config.mak
980fc7b8
FB
752echo "CC=$cc" >> config.mak
753echo "AR=$ar" >> config.mak
be7109c1 754echo "RANLIB=$ranlib" >> config.mak
0f3cb305 755echo "STRIP=$strip" >> config.mak
a9b3f630 756echo "OPTFLAGS=$CFLAGS" >> config.mak
0f3cb305 757echo "LDFLAGS=$LDFLAGS" >> config.mak
4baca069 758echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 759echo "SHFLAGS=$SHFLAGS" >> config.mak
f3ec2d46
SG
760echo "LIBPREF=$LIBPREF" >> config.mak
761echo "LIBSUF=$LIBSUF" >> config.mak
762echo "SLIBPREF=$SLIBPREF" >> config.mak
763echo "SLIBSUF=$SLIBSUF" >> config.mak
6852ac95 764echo "TARGET_OS=$TARGET_OS" >> config.mak
57514323 765if test "$cpu" = "x86" ; then
980fc7b8 766 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 767 echo "#define ARCH_X86 1" >> $TMPH
0f3cb305 768elif test "$cpu" = "armv4l" ; then
6ed7422a 769 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 770 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 771elif test "$cpu" = "alpha" ; then
91d1f1a4 772 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 773 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
774elif test "$cpu" = "sparc64" ; then
775 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
776 echo "#define ARCH_SPARC64 1" >> $TMPH
0f3cb305
FB
777elif test "$cpu" = "powerpc" ; then
778 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
779 echo "#define ARCH_POWERPC 1" >> $TMPH
35e5fb06
RD
780 echo "// Enable the next line to get PowerPC performance report" >> $TMPH
781 echo "// #define POWERPC_TBL_PERFORMANCE_REPORT 1" >> $TMPH
782 echo "// Enable the next line to use PMC registers instead of TBL" >> $TMPH
783 echo "// #define POWERPC_PERF_USE_PMC 1" >> $TMPH
d46aba26
LS
784elif test "$cpu" = "mips" ; then
785 echo "TARGET_ARCH_MIPS=yes" >> config.mak
786 echo "#define ARCH_MIPS 1" >> $TMPH
0f3cb305
FB
787fi
788if test "$bigendian" = "yes" ; then
789 echo "WORDS_BIGENDIAN=yes" >> config.mak
790 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 791fi
57514323 792if test "$mmx" = "yes" ; then
980fc7b8 793 echo "TARGET_MMX=yes" >> config.mak
045ed63f 794 echo "#define HAVE_MMX 1" >> $TMPH
e82c5a8c 795 echo "#define __CPU__ 586" >> $TMPH
de6d9b64 796fi
52b41d7f
FB
797if test "$builtin_vector" = "yes" ; then
798 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
799 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
800fi
d46aba26
LS
801if test "$mmi" = "yes" ; then
802 echo "TARGET_MMI=yes" >> config.mak
803 echo "#define HAVE_MMI 1" >> $TMPH
804fi
ab6c65f6
BF
805if test "$altivec" = "yes" ; then
806 echo "TARGET_ALTIVEC=yes" >> config.mak
807 echo "#define HAVE_ALTIVEC 1" >> $TMPH
db40a39a
MN
808 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
809 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
a9a07762
MN
810 if test "$_altivec_h" = "yes" ; then
811 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
812 else
e67e14d5 813 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
a9a07762 814 fi
ab6c65f6 815fi
57514323 816if test "$gprof" = "yes" ; then
980fc7b8 817 echo "TARGET_GPROF=yes" >> config.mak
045ed63f 818 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 819fi
68892110
PG
820if test "$strptime" = "yes" ; then
821 echo "#define HAVE_STRPTIME 1" >> $TMPH
822else
823 echo "BUILD_STRPTIME=yes" >> config.mak
824fi
825if test "$imlib2" = "yes" ; then
826 echo "HAVE_IMLIB2=yes" >> config.mak
827fi
04511d53
PG
828if test "$freetype2" = "yes" ; then
829 echo "HAVE_FREETYPE2=yes" >> config.mak
830fi
a86b921c
FB
831if test "$sdl" = "yes" ; then
832 echo "CONFIG_SDL=yes" >> config.mak
833 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
834 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
835fi
95e2ce4a
MN
836if test "$have_lrintf" = "yes" ; then
837 echo "#define HAVE_LRINTF 1" >> $TMPH
838fi
68892110
PG
839if test "$vhook" = "yes" ; then
840 echo "BUILD_VHOOK=yes" >> config.mak
841 echo "#define HAVE_VHOOK 1" >> $TMPH
9c938e77 842 extralibs="$extralibs $ldl"
68892110 843fi
57514323 844if test "$lshared" = "yes" ; then
0319c531 845 echo "BUILD_SHARED=yes" >> config.mak
5cbcf02c 846 echo "PIC=-fPIC" >> config.mak
0319c531 847fi
ef0bc4c9 848echo "EXTRALIBS=$extralibs" >> config.mak
586bc755 849echo "VERSION=`head $source_path/VERSION`" >>config.mak
0319c531 850echo "" >>config.mak
d771bcae 851# if you do not want to use encoders, disable that.
045ed63f 852echo "#define CONFIG_ENCODERS 1" >> $TMPH
d771bcae
FB
853echo "CONFIG_ENCODERS=yes" >> config.mak
854
855# if you do not want to use decoders, disable that.
045ed63f 856echo "#define CONFIG_DECODERS 1" >> $TMPH
d771bcae
FB
857echo "CONFIG_DECODERS=yes" >> config.mak
858
5cbcf02c
FB
859# AC3
860if test "$a52" = "yes" ; then
861 echo "#define CONFIG_AC3 1" >> $TMPH
862 echo "CONFIG_AC3=yes" >> config.mak
d771bcae 863
5cbcf02c
FB
864 if test "$a52bin" = "yes" ; then
865 echo "#define CONFIG_A52BIN 1" >> $TMPH
866 echo "CONFIG_A52BIN=yes" >> config.mak
867 fi
868fi
869
bba9b16c
MN
870# PP
871if test "$pp" = "yes" ; then
872 echo "#define CONFIG_PP 1" >> $TMPH
873 echo "CONFIG_PP=yes" >> config.mak
874
875 if test "$shared_pp" = "yes" ; then
876 echo "#define SHARED_PP 1" >> $TMPH
877 echo "SHARED_PP=yes" >> config.mak
878 fi
879fi
880
1eb2212e
FB
881# mpeg audio high precision mode
882if test "$mpegaudio_hp" = "yes" ; then
883 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
884fi
885
5cbcf02c
FB
886if test "$v4l" = "yes" ; then
887 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
888 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
889fi
890
8aa3ee32
MK
891if test "$dv1394" = "yes" ; then
892 echo "#define CONFIG_DV1394 1" >> $TMPH
893 echo "CONFIG_DV1394=yes" >> config.mak
894fi
895
adbc0510
PG
896if test "$dlopen" = "yes" ; then
897 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
898fi
899
900if test "$dlfcn" = "yes" ; then
901 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
902fi
903
5cbcf02c
FB
904if test "$audio_oss" = "yes" ; then
905 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
906 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
907fi
908
dfdfa47c
FR
909if test "$audio_beos" = "yes" ; then
910 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
911 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
912fi
913
5cbcf02c
FB
914if test "$network" = "yes" ; then
915 echo "#define CONFIG_NETWORK 1" >> $TMPH
916 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 917fi
daf8e955 918
0147f198
FR
919if test "$zlib" = "yes" ; then
920 echo "#define CONFIG_ZLIB 1" >> $TMPH
921 echo "CONFIG_ZLIB=yes" >> config.mak
922fi
923
57514323 924if test "$mp3lame" = "yes" ; then
045ed63f 925 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
926 echo "CONFIG_MP3LAME=yes" >> config.mak
927fi
928
81e0d0b4
MH
929if test "$vorbis" = "yes" ; then
930 echo "#define CONFIG_VORBIS 1" >> $TMPH
931 echo "CONFIG_VORBIS=yes" >> config.mak
932fi
933
0fc50e58
ZK
934if test "$faad" = "yes" ; then
935 echo "#define CONFIG_FAAD 1" >> $TMPH
936 echo "CONFIG_FAAD=yes" >> config.mak
937fi
938
939if test "$faadbin" = "yes" ; then
940 echo "#define CONFIG_FAADBIN 1" >> $TMPH
445ad18d 941 echo "CONFIG_FAADBIN=yes" >> config.mak
0fc50e58
ZK
942fi
943
57514323 944if test "$win32" = "yes" ; then
045ed63f 945 echo "#define CONFIG_WIN32 1" >> $TMPH
daf8e955
FB
946 echo "CONFIG_WIN32=yes" >> config.mak
947fi
3d204385 948
732d9245
BE
949if test "$mingw32" = "yes" ; then
950 echo "#define CONFIG_WIN32 1" >> $TMPH
951 echo "CONFIG_WIN32=yes" >> config.mak
952 echo "#define __MINGW32__ 1" >> $TMPH
953 echo "__MINGW32__=1" >> config.mak
954fi
955
3f027ca7
FB
956if test "$cygwin" = "yes" ; then
957 # setup correct exesuffix
958 echo "CONFIG_WIN32=yes" >> config.mak
959fi
960
f3ec2d46
SG
961if test "$os2" = "yes" ; then
962 echo "#define CONFIG_OS2 1" >> $TMPH
963 echo "CONFIG_OS2=yes" >> config.mak
964fi
965
6e023978
RS
966if test "$TARGET_OS" = "SunOS" ; then
967 echo "#define CONFIG_SUNOS 1" >> $TMPH
968fi
969
90cee0c3
MN
970if test "$darwin" = "yes"; then
971 echo "#define CONFIG_DARWIN 1" >> $TMPH
972 echo "CONFIG_DARWIN=yes" >> config.mak
973fi
974
57514323 975if test "$_malloc_h" = "yes" ; then
045ed63f 976 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 977else
045ed63f 978 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
979fi
980
57514323 981if test "$_memalign" = "yes" ; then
045ed63f
ZK
982 echo "#define HAVE_MEMALIGN 1" >> $TMPH
983else
984 echo "#undef HAVE_MEMALIGN" >> $TMPH
985fi
986
26b35efb
FR
987if test "$netserver" = "yes" ; then
988 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
989 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
990fi
991
4baca069
PG
992if test "$need_inet_aton" = "yes" ; then
993 echo "NEED_INET_ATON=yes" >> config.mak
994fi
995
57514323 996if test "$simpleidct" = "yes" ; then
045ed63f
ZK
997 echo "#define SIMPLE_IDCT 1" >> $TMPH
998fi
999
8154d2e0
FB
1000if test "$ffserver" = "yes" ; then
1001 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1002 echo "CONFIG_FFSERVER=yes" >> config.mak
1003fi
1004
a86b921c
FB
1005if test "$ffplay" = "yes" ; then
1006 echo "CONFIG_FFPLAY=yes" >> config.mak
1007fi
1008
1d0d55da
MN
1009if test "$risky" = "yes" ; then
1010 echo "#define CONFIG_RISKY 1" >> $TMPH
1011 echo "CONFIG_RISKY=yes" >> config.mak
1012fi
1013
c13e1abd
FH
1014echo "#define restrict $_restrict" >> $TMPH
1015
0f3cb305
FB
1016# build tree in object directory if source path is different from current one
1017if test "$source_path_used" = "yes" ; then
a382b927 1018 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
5f6b58de
MR
1019 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1020 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
0f3cb305
FB
1021 for dir in $DIRS ; do
1022 mkdir -p $dir
1023 done
1024 for f in $FILES ; do
1025 ln -sf $source_path/$f $f
1026 done
1027fi
1028echo "SRC_PATH=$source_path" >> config.mak
1029
891f64b3 1030if test "$amr_nb" = "yes" ; then
1031 echo "#define AMR_NB 1" >> $TMPH
1032 echo "AMR_NB=yes" >> config.mak
1033 echo
bc634f6f
ZK
1034if test "$amr_nb_fixed" = "yes" ; then
1035 echo "AMR_NB_FIXED=yes" >> config.mak
1036 echo "#define AMR_NB_FIXED 1" >> $TMPH
1037 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1038 echo "REL-5 version 5.1.0 from "
891f64b3 1039 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1040 echo "and extracted src to libavcodec/amr"
bc634f6f
ZK
1041 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1042 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1043 echo
1044else
1045 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1046 echo "REL-5 V5.1.0 from "
1047 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1048 echo "and extracted the source to libavcodec/amr_float"
891f64b3 1049 echo
1050fi
1051
bc634f6f
ZK
1052fi
1053
a7c02e25 1054diff $TMPH config.h >/dev/null 2>&1
045ed63f
ZK
1055if test $? -ne 0 ; then
1056 mv -f $TMPH config.h
3d204385 1057else
045ed63f 1058 echo "config.h is unchanged"
3d204385
NK
1059fi
1060
f3ec2d46 1061rm -f $TMPO $TMPC $TMPE $TMPS $TMPH