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