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