mb qp limits
[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"
16TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
17TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
18
de6d9b64
FB
19# default parameters
20prefix="/usr/local"
0f3cb305 21cross_prefix=""
de6d9b64
FB
22cc="gcc"
23ar="ar"
be7109c1 24ranlib="ranlib"
4a908fbc 25make="make"
0f3cb305 26strip="strip"
de6d9b64 27cpu=`uname -m`
0f3cb305 28mmx="default"
ab6c65f6 29altivec="default"
d46aba26 30mmi="default"
de6d9b64 31case "$cpu" in
ef0bc4c9 32 i386|i486|i586|i686|i86pc|BePC)
de6d9b64 33 cpu="x86"
de6d9b64 34 ;;
6ed7422a
FB
35 armv4l)
36 cpu="armv4l"
6ed7422a 37 ;;
91d1f1a4
NK
38 alpha)
39 cpu="alpha"
91d1f1a4 40 ;;
a43bd1d7 41 "Power Macintosh"|ppc)
90cee0c3
MN
42 cpu="powerpc"
43 ;;
d46aba26
LS
44 mips)
45 cpu="mips"
46 ;;
de6d9b64 47 *)
0f3cb305 48 cpu="unknown"
de6d9b64
FB
49 ;;
50esac
51gprof="no"
5cbcf02c
FB
52v4l="yes"
53audio_oss="yes"
dfdfa47c 54audio_beos="no"
5cbcf02c 55network="yes"
0147f198 56zlib="yes"
a6741398 57mp3lame="no"
81e0d0b4 58vorbis="no"
5cbcf02c 59a52="yes"
57514323 60a52bin="no"
daf8e955 61win32="no"
3f027ca7 62cygwin="no"
83286d2a 63lshared="no"
ef0bc4c9 64extralibs="-lm"
c02dbee1 65simpleidct="yes"
0f3cb305 66bigendian="no"
68892110 67vhook="no"
adbc0510
PG
68dlfcn="no"
69dlopen="no"
1eb2212e 70mpegaudio_hp="yes"
e1707f52 71SHFLAGS=-shared
26b35efb 72netserver="no"
4baca069
PG
73need_inet_aton="no"
74LDFLAGS=-Wl,--warn-common
75FFSLDFLAGS=-Wl,-E
ef0bc4c9
FR
76
77# OS specific
78targetos=`uname -s`
79case $targetos in
80BeOS)
81prefix="/boot/home/config"
82# helps building libavcodec
e1707f52 83CFLAGS="-O3 -DPIC -fomit-frame-pointer"
31ba0b4d
FR
84# 3 gcc releases known for BeOS, each with ugly bugs
85gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f3-)"
86case "$gcc_version" in
872.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
88mmx="no"
89;;
90*20010315*) echo "BeBits gcc"
91CFLAGS="$CFLAGS -fno-expensive-optimizations"
92;;
93esac
e1707f52
MN
94SHFLAGS=-nostart
95# disable linux things
96audio_oss="no"
5cbcf02c 97v4l="no"
dfdfa47c
FR
98# enable beos things
99audio_beos="yes"
ef0bc4c9
FR
100# no need for libm, but the inet stuff
101# Check for BONE
102if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
103extralibs="-lbind -lsocket"
104else
26b35efb 105netserver="yes"
4baca069 106need_inet_aton="yes"
26b35efb 107extralibs="-lnet"
ef0bc4c9 108fi ;;
4baca069
PG
109SunOS)
110v4l="no"
111audio_oss="no"
112make="gmake"
113LDFLAGS=""
114FFSLDFLAGS=""
115need_inet_aton="yes"
116extralibs="$extralibs -lsocket -lnsl"
117;;
9c938e77
PG
118FreeBSD)
119v4l="no"
120audio_oss="yes"
121make="gmake"
4baca069 122LDFLAGS="$LDFLAGS -export-dynamic"
9c938e77 123;;
4a908fbc 124BSD/OS)
5cbcf02c 125v4l="no"
6063bce7 126audio_oss="yes"
4a908fbc
AB
127extralibs="-lpoll -lgnugetopt -lm"
128make="gmake"
129;;
90cee0c3 130Darwin)
a43bd1d7 131cc="cc"
90cee0c3
MN
132v4l="no"
133audio_oss="no"
a43bd1d7 134SHFLAGS="-dynamiclib"
90cee0c3 135extralibs=""
a43bd1d7 136darwin="yes"
47930f09 137strip="strip -x"
6207ba95 138LDFLAGS="-d"
4baca069
PG
139FFSLDFLAGS=-Wl,-bind_at_load
140gcc_version="$($cc -v 2>&1 | grep version | cut -d ' ' -f4-)"
141case "$gcc_version" in
142*2.95*)
143CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer"
144;;
145*)
146CFLAGS="-no-cpp-precomp -pipe -O3 -fomit-frame-pointer -mdynamic-no-pic"
147;;
148esac
90cee0c3 149;;
3f027ca7
FB
150CYGWIN*)
151v4l="no"
152audio_oss="yes"
153extralibs=""
154cygwin="yes"
155test -f /usr/include/inttypes.h || \
156test -f /usr/local/include/inttypes.h || \
157echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
158 "/usr/include/inttypes.h !!!"
159;;
b55e4ef4 160Linux)
4baca069 161LDFLAGS="$LDFLAGS -rdynamic"
b55e4ef4 162;;
ef0bc4c9
FR
163*) ;;
164esac
de6d9b64 165
0f3cb305
FB
166# find source path
167# XXX: we assume an absolute path is given when launching configure,
168# except in './configure' case.
169source_path=${0%configure}
170source_path=${source_path%/}
171source_path_used="yes"
172if test -z "$source_path" -o "$source_path" = "." ; then
173 source_path=`pwd`
174 source_path_used="no"
de6d9b64
FB
175fi
176
68892110
PG
177cat > $TMPC << EOF
178#include <dlfcn.h>
179int main( void ) { return (int) dlopen("foo", 0); }
180EOF
181
9c938e77
PG
182ldl=-ldl
183
68892110 184if $cc -o $TMPO $TMPC -ldl 2> /dev/null ; then
47930f09 185vhook=yes
adbc0510
PG
186dlfcn=yes
187dlopen=yes
68892110
PG
188fi
189
9c938e77
PG
190if $cc -o $TMPO $TMPC 2> /dev/null ; then
191vhook=yes
adbc0510
PG
192dlfcn=yes
193dlopen=yes
9c938e77
PG
194ldl=""
195fi
196
68892110 197cat > $TMPC << EOF
adbc0510
PG
198int main( void ) { return (int) dlopen("foo", 0); }
199EOF
200
201if $cc -o $TMPO $TMPC -ldl 2> /dev/null ; then
202vhook=yes
203dlopen=yes
204fi
205
206if $cc -o $TMPO $TMPC 2> /dev/null ; then
207vhook=yes
208dlopen=yes
209ldl=""
210fi
211
212
213cat > $TMPC << EOF
68892110
PG
214#include <X11/Xlib.h>
215#include <Imlib2.h>
216int main( void ) { return (int) imlib_load_font("foo"); }
217EOF
218
219imlib2=no
220if $cc -o $TMPO $TMPC -lImlib2 2> /dev/null ; then
221imlib2=yes
222fi
223
de6d9b64
FB
224for opt do
225 case "$opt" in
226 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
227 ;;
0f3cb305
FB
228 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
229 ;;
230 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
231 ;;
de6d9b64
FB
232 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
233 ;;
4a908fbc
AB
234 --make=*) make=`echo $opt | cut -d '=' -f 2`
235 ;;
0f3cb305
FB
236 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
237 ;;
238 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
239 ;;
240 --extra-libs=*) extralibs=${opt#--extra-libs=}
241 ;;
de6d9b64
FB
242 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
243 ;;
244 --disable-mmx) mmx="no"
245 ;;
ab6c65f6
BF
246 --disable-altivec) altivec="no"
247 ;;
de6d9b64
FB
248 --enable-gprof) gprof="yes"
249 ;;
5cbcf02c
FB
250 --disable-v4l) v4l="no"
251 ;;
252 --disable-audio-oss) audio_oss="no"
253 ;;
dfdfa47c
FR
254 --disable-audio-beos) audio_beos="no"
255 ;;
5cbcf02c
FB
256 --disable-network) network="no"
257 ;;
0147f198
FR
258 --disable-zlib) zlib="no"
259 ;;
5cbcf02c 260 --disable-a52) a52="no"
6ed7422a 261 ;;
9c938e77 262 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
57514323 263 ;;
a6741398
J
264 --enable-mp3lame) mp3lame="yes"
265 ;;
81e0d0b4
MH
266 --enable-vorbis) vorbis="yes"
267 ;;
68892110
PG
268 --disable-vhook) vhook="no"
269 ;;
c02dbee1 270 --disable-simple_idct) simpleidct="no"
045ed63f 271 ;;
daf8e955
FB
272 --enable-win32) win32="yes"
273 ;;
83286d2a 274 --enable-shared) lshared="yes"
0319c531 275 ;;
1eb2212e
FB
276 --disable-mpegaudio-hp) mpegaudio_hp="no"
277 ;;
de6d9b64
FB
278 esac
279done
280
0f3cb305
FB
281# compute mmx state
282if test $mmx = "default"; then
283 if test $cpu = "x86"; then
284 mmx="yes"
285 else
286 mmx="no"
287 fi
288fi
289
ab6c65f6
BF
290# Can only do AltiVec on PowerPC
291if test $altivec = "default"; then
292 if test $cpu = "powerpc"; then
293 altivec="yes"
294 else
295 altivec="no"
296 fi
297fi
298
299# See does our compiler support Motorola AltiVec C API
300if test $altivec = "yes"; then
301cat > $TMPC << EOF
302int main(void) {
303 vector signed int v1, v2, v3;
304 v1 = vec_add(v2,v3);
305 return 0;
306}
307EOF
308$cc -o $TMPO $TMPC -faltivec 2> /dev/null || altivec="no"
309fi
310
d46aba26
LS
311# Can only do mmi on mips
312if test $mmi = "default"; then
313 if test $cpu = "mips"; then
314 mmi="yes"
315 else
316 mmi="no"
317 fi
318fi
319
320# See does our compiler support mmi
321if test $mmi = "yes"; then
322cat > $TMPC << EOF
323int main(void) {
324 __asm__ ("lq \$2, 0(\$2)");
325 return 0;
326}
327EOF
328$cc -o $TMPO $TMPC 2> /dev/null || mmi="no"
329fi
330
daf8e955
FB
331# Checking for CFLAGS
332if test -z "$CFLAGS"; then
29482cb4 333 CFLAGS="-O3"
daf8e955
FB
334fi
335
57514323 336if test "$win32" = "yes" ; then
daf8e955 337 cross_prefix="i386-mingw32msvc-"
5cbcf02c
FB
338 v4l="no"
339 audio_oss="no"
340 network="no"
daf8e955
FB
341fi
342
0f3cb305
FB
343cc="${cross_prefix}${cc}"
344ar="${cross_prefix}${ar}"
be7109c1 345ranlib="${cross_prefix}${ranlib}"
0f3cb305
FB
346strip="${cross_prefix}${strip}"
347
487a54d7
FB
348if test -z "$cross_prefix" ; then
349
3d204385 350# ---
a3999908
MN
351# big/little endian test
352cat > $TMPC << EOF
353#include <inttypes.h>
354int main(int argc, char ** argv){
355 volatile uint32_t i=0x01234567;
356 return (*((uint8_t*)(&i))) == 0x67;
357}
358EOF
359
360if $cc -o $TMPO $TMPC 2>/dev/null ; then
361$TMPO && bigendian="yes"
362else
363echo big/little test failed
364fi
365
487a54d7
FB
366else
367
368# if cross compiling, cannot launch a program, so make a static guess
369if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
370 bigendian="yes"
371fi
372
373fi
374
a3999908 375# ---
3d204385
NK
376# check availability of some header files
377
378cat > $TMPC << EOF
379#include <malloc.h>
380int main( void ) { return 0; }
381EOF
382
383_memalign=no
384_malloc_h=no
385if $cc -o $TMPO $TMPC 2> /dev/null ; then
386_malloc_h=yes
387_memalign=yes
388# check for memalign - atmos
389cat > $TMPC << EOF
390#include <malloc.h>
391int main ( void ) {
392char *string = NULL;
393string = memalign(64, sizeof(char));
394return 0;
395}
396EOF
397$cc -o $TMPO $TMPC 2> /dev/null || _memalign=no
398fi
399
68892110
PG
400cat > $TMPC << EOF
401#define _GNU_SOURCE
402#include <time.h>
403int main( void ) { return *strptime("", "", 0); }
404EOF
405
406strptime=no
407if $cc -o $TMPO $TMPC 2> /dev/null ; then
408 strptime=yes
409fi
410
0147f198
FR
411if test "$zlib" = "yes"; then
412# check for zlib - mmu_man
413cat > $TMPC << EOF
414#include <zlib.h>
415int main ( void ) {
416if (zlibVersion() != ZLIB_VERSION)
417 puts("zlib version differs !!!");
418 return 1;
419return 0;
420}
421EOF
422$cc -o $TMPO $TMPC -lz 2> /dev/null || zlib="no"
423# $TMPO 2> /dev/null > /dev/null || zlib="no"
424# XXX: more tests needed - runtime test
425fi
426if test "$zlib" = "yes"; then
427extralibs="$extralibs -lz"
428fi
429
95e2ce4a
MN
430# test for lrintf in math.h
431cat > $TMPC << EOF
432#define _ISOC9X_SOURCE 1
433#include <math.h>
434int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
435EOF
436
437have_lrintf="no"
438if $cc $extralibs -o $TMPO $TMPC 2> /dev/null ; then
439 have_lrintf="yes"
440 $TMPO 2> /dev/null > /dev/null || have_lrintf="no"
441fi
442
c13e1abd
FH
443_restrict=
444for restrict_keyword in restrict __restrict__ __restrict; do
445 echo "void foo(char * $restrict_keyword p);" > $TMPC
446 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
447 _restrict=$restrict_keyword
448 break;
449 fi
450done
451
6063bce7 452if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
0f3cb305
FB
453cat << EOF
454
455Usage: configure [options]
456Options: [defaults in brackets after descriptions]
457
458EOF
459echo "Standard options:"
460echo " --help print this message"
461echo " --prefix=PREFIX install in PREFIX [$prefix]"
0f3cb305 462echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
81e0d0b4 463echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
0f3cb305 464echo " --enable-win32 enable win32 cross compile"
5cbcf02c 465echo " --disable-a52 disable GPL'ed A52 support [default=no]"
0f3cb305
FB
466echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
467echo " --enable-shared build shared libraries [default=no]"
468echo ""
469echo "Advanced options (experts only):"
470echo " --source-path=PATH path of source code [$source_path]"
471echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
472echo " --cc=CC use C compiler CC [$cc]"
4a908fbc 473echo " --make=MAKE use specified make [$make]"
0f3cb305
FB
474echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
475echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
476echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
477echo " --cpu=CPU force cpu to CPU [$cpu]"
478echo " --disable-mmx disable mmx usage"
ab6c65f6 479echo " --disable-altivec disable AltiVec usage"
5cbcf02c 480echo " --disable-audio-oss disable OSS audio support [default=no]"
dfdfa47c 481echo " --disable-audio-beos disable BeOS audio support [default=no]"
6063bce7 482echo " --disable-v4l disable video4linux grabbing [default=no]"
5cbcf02c 483echo " --disable-network disable network support [default=no]"
0147f198 484echo " --disable-zlib disable zlib [default=no]"
5cbcf02c 485echo " --disable-simple_idct disable simple IDCT routines [default=no]"
47930f09 486echo " --disable-vhook disable video hooking support"
0f3cb305 487echo " --enable-gprof enable profiling with gprof [$gprof]"
1eb2212e
FB
488echo " --disable-mpegaudio-hp faster (but less accurate)"
489echo " mpegaudio decoding [default=no]"
0f3cb305
FB
490echo ""
491echo "NOTE: The object files are build at the place where configure is launched"
492exit 1
493fi
494
de6d9b64 495echo "Install prefix $prefix"
0f3cb305 496echo "Source path $source_path"
de6d9b64 497echo "C compiler $cc"
4a908fbc 498echo "make $make"
de6d9b64 499echo "CPU $cpu"
0f3cb305 500echo "Big Endian $bigendian"
e41e8342 501if test $cpu = "x86"; then
de6d9b64 502echo "MMX enabled $mmx"
e41e8342
FB
503fi
504if test $cpu = "mips"; then
d46aba26 505echo "MMI enabled $mmi"
e41e8342
FB
506fi
507if test $cpu = "powerpc"; then
ab6c65f6 508echo "AltiVec enabled $altivec"
e41e8342 509fi
de6d9b64 510echo "gprof enabled $gprof"
0147f198 511echo "zlib enabled $zlib"
a6741398 512echo "mp3lame enabled $mp3lame"
81e0d0b4 513echo "vorbis enabled $vorbis"
5cbcf02c 514echo "a52 support $a52"
57514323 515echo "a52 dlopened $a52bin"
47930f09 516echo "Video hooking $vhook"
68892110
PG
517
518if test "$vhook" = "yes" ; then
47930f09 519echo "Imlib2 support $imlib2"
68892110 520fi
de6d9b64 521
980fc7b8 522echo "Creating config.mak and config.h"
de6d9b64 523
980fc7b8 524echo "# Automatically generated by configure - do not modify" > config.mak
045ed63f 525echo "/* Automatically generated by configure - do not modify */" > $TMPH
de6d9b64 526
980fc7b8 527echo "prefix=$prefix" >> config.mak
4a908fbc 528echo "MAKE=$make" >> config.mak
980fc7b8
FB
529echo "CC=$cc" >> config.mak
530echo "AR=$ar" >> config.mak
be7109c1 531echo "RANLIB=$ranlib" >> config.mak
0f3cb305 532echo "STRIP=$strip" >> config.mak
a9b3f630 533echo "OPTFLAGS=$CFLAGS" >> config.mak
0f3cb305 534echo "LDFLAGS=$LDFLAGS" >> config.mak
4baca069 535echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 536echo "SHFLAGS=$SHFLAGS" >> config.mak
57514323 537if test "$cpu" = "x86" ; then
980fc7b8 538 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 539 echo "#define ARCH_X86 1" >> $TMPH
0f3cb305 540elif test "$cpu" = "armv4l" ; then
6ed7422a 541 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 542 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 543elif test "$cpu" = "alpha" ; then
91d1f1a4 544 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 545 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
546elif test "$cpu" = "sparc64" ; then
547 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
548 echo "#define ARCH_SPARC64 1" >> $TMPH
0f3cb305
FB
549elif test "$cpu" = "powerpc" ; then
550 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
551 echo "#define ARCH_POWERPC 1" >> $TMPH
d46aba26
LS
552elif test "$cpu" = "mips" ; then
553 echo "TARGET_ARCH_MIPS=yes" >> config.mak
554 echo "#define ARCH_MIPS 1" >> $TMPH
0f3cb305
FB
555fi
556if test "$bigendian" = "yes" ; then
557 echo "WORDS_BIGENDIAN=yes" >> config.mak
558 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 559fi
57514323 560if test "$mmx" = "yes" ; then
980fc7b8 561 echo "TARGET_MMX=yes" >> config.mak
045ed63f 562 echo "#define HAVE_MMX 1" >> $TMPH
de6d9b64 563fi
d46aba26
LS
564if test "$mmi" = "yes" ; then
565 echo "TARGET_MMI=yes" >> config.mak
566 echo "#define HAVE_MMI 1" >> $TMPH
567fi
ab6c65f6
BF
568if test "$altivec" = "yes" ; then
569 echo "TARGET_ALTIVEC=yes" >> config.mak
570 echo "#define HAVE_ALTIVEC 1" >> $TMPH
571fi
57514323 572if test "$gprof" = "yes" ; then
980fc7b8 573 echo "TARGET_GPROF=yes" >> config.mak
045ed63f 574 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 575fi
68892110
PG
576if test "$strptime" = "yes" ; then
577 echo "#define HAVE_STRPTIME 1" >> $TMPH
578else
579 echo "BUILD_STRPTIME=yes" >> config.mak
580fi
581if test "$imlib2" = "yes" ; then
582 echo "HAVE_IMLIB2=yes" >> config.mak
583fi
95e2ce4a
MN
584if test "$have_lrintf" = "yes" ; then
585 echo "#define HAVE_LRINTF 1" >> $TMPH
586fi
68892110
PG
587if test "$vhook" = "yes" ; then
588 echo "BUILD_VHOOK=yes" >> config.mak
589 echo "#define HAVE_VHOOK 1" >> $TMPH
9c938e77 590 extralibs="$extralibs $ldl"
68892110 591fi
57514323 592if test "$lshared" = "yes" ; then
0319c531 593 echo "BUILD_SHARED=yes" >> config.mak
5cbcf02c 594 echo "PIC=-fPIC" >> config.mak
0319c531 595fi
ef0bc4c9 596echo "EXTRALIBS=$extralibs" >> config.mak
0319c531 597echo -n "VERSION=" >>config.mak
0f3cb305 598head $source_path/VERSION >>config.mak
0319c531 599echo "" >>config.mak
d771bcae 600# if you do not want to use encoders, disable that.
045ed63f 601echo "#define CONFIG_ENCODERS 1" >> $TMPH
d771bcae
FB
602echo "CONFIG_ENCODERS=yes" >> config.mak
603
604# if you do not want to use decoders, disable that.
045ed63f 605echo "#define CONFIG_DECODERS 1" >> $TMPH
d771bcae
FB
606echo "CONFIG_DECODERS=yes" >> config.mak
607
5cbcf02c
FB
608# AC3
609if test "$a52" = "yes" ; then
610 echo "#define CONFIG_AC3 1" >> $TMPH
611 echo "CONFIG_AC3=yes" >> config.mak
d771bcae 612
5cbcf02c
FB
613 if test "$a52bin" = "yes" ; then
614 echo "#define CONFIG_A52BIN 1" >> $TMPH
615 echo "CONFIG_A52BIN=yes" >> config.mak
616 fi
617fi
618
1eb2212e
FB
619# mpeg audio high precision mode
620if test "$mpegaudio_hp" = "yes" ; then
621 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
622fi
623
5cbcf02c
FB
624if test "$v4l" = "yes" ; then
625 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
626 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
627fi
628
adbc0510
PG
629if test "$dlopen" = "yes" ; then
630 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
631fi
632
633if test "$dlfcn" = "yes" ; then
634 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
635fi
636
5cbcf02c
FB
637if test "$audio_oss" = "yes" ; then
638 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
639 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
640fi
641
dfdfa47c
FR
642if test "$audio_beos" = "yes" ; then
643 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
644 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
645fi
646
5cbcf02c
FB
647if test "$network" = "yes" ; then
648 echo "#define CONFIG_NETWORK 1" >> $TMPH
649 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 650fi
daf8e955 651
0147f198
FR
652if test "$zlib" = "yes" ; then
653 echo "#define CONFIG_ZLIB 1" >> $TMPH
654 echo "CONFIG_ZLIB=yes" >> config.mak
655fi
656
57514323 657if test "$mp3lame" = "yes" ; then
045ed63f 658 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
659 echo "CONFIG_MP3LAME=yes" >> config.mak
660fi
661
81e0d0b4
MH
662if test "$vorbis" = "yes" ; then
663 echo "#define CONFIG_VORBIS 1" >> $TMPH
664 echo "CONFIG_VORBIS=yes" >> config.mak
665fi
666
57514323 667if test "$win32" = "yes" ; then
045ed63f 668 echo "#define CONFIG_WIN32 1" >> $TMPH
daf8e955
FB
669 echo "CONFIG_WIN32=yes" >> config.mak
670fi
3d204385 671
3f027ca7
FB
672if test "$cygwin" = "yes" ; then
673 # setup correct exesuffix
674 echo "CONFIG_WIN32=yes" >> config.mak
675fi
676
90cee0c3
MN
677if test "$darwin" = "yes"; then
678 echo "#define CONFIG_DARWIN 1" >> $TMPH
679 echo "CONFIG_DARWIN=yes" >> config.mak
680fi
681
57514323 682if test "$_malloc_h" = "yes" ; then
045ed63f 683 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 684else
045ed63f 685 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
686fi
687
57514323 688if test "$_memalign" = "yes" ; then
045ed63f
ZK
689 echo "#define HAVE_MEMALIGN 1" >> $TMPH
690else
691 echo "#undef HAVE_MEMALIGN" >> $TMPH
692fi
693
26b35efb
FR
694if test "$netserver" = "yes" ; then
695 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
696 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
697fi
698
4baca069
PG
699if test "$need_inet_aton" = "yes" ; then
700 echo "NEED_INET_ATON=yes" >> config.mak
701fi
702
57514323 703if test "$simpleidct" = "yes" ; then
045ed63f
ZK
704 echo "#define SIMPLE_IDCT 1" >> $TMPH
705fi
706
c13e1abd
FH
707echo "#define restrict $_restrict" >> $TMPH
708
0f3cb305
FB
709# build tree in object directory if source path is different from current one
710if test "$source_path_used" = "yes" ; then
a382b927
FB
711 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
712 libavcodec/ppc libavcodec/liba52 libavcodec/mlib tests vhook"
713 FILES="Makefile libavformat/Makefile libavcodec/Makefile tests/Makefile vhook/Makefile"
0f3cb305
FB
714 for dir in $DIRS ; do
715 mkdir -p $dir
716 done
717 for f in $FILES ; do
718 ln -sf $source_path/$f $f
719 done
720fi
721echo "SRC_PATH=$source_path" >> config.mak
722
a7c02e25 723diff $TMPH config.h >/dev/null 2>&1
045ed63f
ZK
724if test $? -ne 0 ; then
725 mv -f $TMPH config.h
3d204385 726else
045ed63f 727 echo "config.h is unchanged"
3d204385
NK
728fi
729
045ed63f 730rm -f $TMPO $TMPC $TMPS $TMPH