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