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