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