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