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