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