100l: free previous frame, not current one!
[libav.git] / configure
CommitLineData
de6d9b64 1#!/bin/sh
0f3cb305 2#
5cbcf02c 3# ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
0f3cb305 4#
cf9d24ad
DC
5
6if test x"$1" = x"-h" -o x"$1" = x"--help" ; then
7cat << EOF
8
9Usage: configure [options]
10Options: [defaults in brackets after descriptions]
11
12EOF
13echo "Standard options:"
14echo " --help print this message"
15echo " --prefix=PREFIX install in PREFIX [$prefix]"
16echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
17echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
18echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
19echo " --enable-faad enable faad support via libfaad [default=no]"
20echo " --enable-faadbin build faad support with runtime linking [default=no]"
21echo " --enable-faac enable faac support via libfaac [default=no]"
22echo " --enable-mingw32 enable mingw32 native/cross windows compile"
23echo " --enable-a52 enable GPL'ed A52 support [default=no]"
24echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
25echo " --enable-pp enable GPL'ed post processing support [default=no]"
26echo " --enable-shared-pp use libpostproc.so [default=no]"
27echo " --enable-shared build shared libraries [default=no]"
28echo " --enable-amr_nb enable amr_nb float audio codec"
29echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
30echo " --enable-sunmlib use Sun medialib [default=no]"
31echo ""
32echo "Advanced options (experts only):"
33echo " --source-path=PATH path of source code [$source_path]"
34echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
35echo " --cc=CC use C compiler CC [$cc]"
36echo " --make=MAKE use specified make [$make]"
37echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
38echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
39echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
40echo " --cpu=CPU force cpu to CPU [$cpu]"
41echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
42echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
43echo " --disable-mmx disable mmx usage"
44echo " --disable-altivec disable AltiVec usage"
45echo " --disable-audio-oss disable OSS audio support [default=no]"
46echo " --disable-audio-beos disable BeOS audio support [default=no]"
47echo " --disable-v4l disable video4linux grabbing [default=no]"
48echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
49echo " --disable-network disable network support [default=no]"
50echo " --disable-zlib disable zlib [default=no]"
51echo " --disable-simple_idct disable simple IDCT routines [default=no]"
52echo " --disable-vhook disable video hooking support"
53echo " --enable-gprof enable profiling with gprof [$gprof]"
54echo " --disable-debug disable debugging symbols"
55echo " --disable-opts disable compiler optimizations"
56echo " --disable-mpegaudio-hp faster (but less accurate)"
57echo " mpegaudio decoding [default=no]"
58echo " --disable-ffserver disable ffserver build"
59echo " --disable-ffplay disable ffplay build"
60echo " --disable-risky disables patent encumbered codecs"
61echo " --enable-small optimize for size instead of speed"
62echo ""
63echo "NOTE: The object files are build at the place where configure is launched"
64exit 1
65fi
66
0f3cb305 67# set temporary file name
57514323 68if test ! -z "$TMPDIR" ; then
0f3cb305 69 TMPDIR1="${TMPDIR}"
57514323 70elif test ! -z "$TEMPDIR" ; then
0f3cb305 71 TMPDIR1="${TEMPDIR}"
3d204385 72else
0f3cb305 73 TMPDIR1="/tmp"
3d204385
NK
74fi
75
0f3cb305
FB
76TMPC="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
77TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
f3ec2d46 78TMPE="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
0f3cb305
FB
79TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
80TMPH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
81
de6d9b64
FB
82# default parameters
83prefix="/usr/local"
23a65308 84mandir=""
951bf3e6 85bindir=""
0f3cb305 86cross_prefix=""
de6d9b64
FB
87cc="gcc"
88ar="ar"
be7109c1 89ranlib="ranlib"
4a908fbc 90make="make"
0f3cb305 91strip="strip"
de6d9b64 92cpu=`uname -m`
a4adb608 93tune="generic"
e45a2872 94powerpc_perf="no"
0f3cb305 95mmx="default"
ab6c65f6 96altivec="default"
d46aba26 97mmi="default"
de6d9b64 98case "$cpu" in
ef0bc4c9 99 i386|i486|i586|i686|i86pc|BePC)
de6d9b64 100 cpu="x86"
de6d9b64 101 ;;
93caefc7
AB
102 # armv4l is a subset of armv5tel
103 armv4l|armv5tel)
6ed7422a 104 cpu="armv4l"
6ed7422a 105 ;;
91d1f1a4
NK
106 alpha)
107 cpu="alpha"
91d1f1a4 108 ;;
a43bd1d7 109 "Power Macintosh"|ppc)
90cee0c3
MN
110 cpu="powerpc"
111 ;;
d46aba26
LS
112 mips)
113 cpu="mips"
114 ;;
a7beab73
RS
115 sun4u)
116 cpu="sparc64"
117 ;;
bdb2e37c
AB
118 sh4)
119 cpu="sh4"
120 ;;
de6d9b64 121 *)
0f3cb305 122 cpu="unknown"
de6d9b64
FB
123 ;;
124esac
125gprof="no"
5cbcf02c
FB
126v4l="yes"
127audio_oss="yes"
dfdfa47c 128audio_beos="no"
8aa3ee32 129dv1394="yes"
5cbcf02c 130network="yes"
0147f198 131zlib="yes"
a6741398 132mp3lame="no"
81e0d0b4 133vorbis="no"
0fc50e58
ZK
134faad="no"
135faadbin="no"
29d48296 136faac="no"
ba9261e5 137a52="no"
57514323 138a52bin="no"
ba9261e5 139pp="no"
bba9b16c 140shared_pp="no"
732d9245 141mingw32="no"
3f027ca7 142cygwin="no"
f3ec2d46 143os2="no"
83286d2a 144lshared="no"
cddf3f45
GM
145optimize="yes"
146debug="yes"
ef0bc4c9 147extralibs="-lm"
c02dbee1 148simpleidct="yes"
0f3cb305 149bigendian="no"
a8721c09 150vhook="default"
adbc0510
PG
151dlfcn="no"
152dlopen="no"
1eb2212e 153mpegaudio_hp="yes"
e1707f52 154SHFLAGS=-shared
26b35efb 155netserver="no"
4baca069 156need_inet_aton="no"
8154d2e0 157ffserver="yes"
a86b921c 158ffplay="yes"
4baca069
PG
159LDFLAGS=-Wl,--warn-common
160FFSLDFLAGS=-Wl,-E
f3ec2d46
SG
161LIBPREF="lib"
162LIBSUF=".a"
163SLIBPREF="lib"
164SLIBSUF=".so"
951bf3e6 165EXESUF=""
1d0d55da 166risky="yes"
891f64b3 167amr_nb="no"
d663a1fd 168amr_wb="no"
bc634f6f 169amr_nb_fixed="no"
f80f7964 170sunmlib="no"
ef0bc4c9
FR
171
172# OS specific
173targetos=`uname -s`
174case $targetos in
175BeOS)
176prefix="/boot/home/config"
177# helps building libavcodec
cddf3f45 178CFLAGS="-DPIC -fomit-frame-pointer"
31ba0b4d 179# 3 gcc releases known for BeOS, each with ugly bugs
b2924696 180gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
31ba0b4d
FR
181case "$gcc_version" in
1822.9-beos-991026*|2.9-beos-000224*) echo "R5/GG gcc"
183mmx="no"
184;;
185*20010315*) echo "BeBits gcc"
186CFLAGS="$CFLAGS -fno-expensive-optimizations"
187;;
188esac
e1707f52
MN
189SHFLAGS=-nostart
190# disable linux things
191audio_oss="no"
5cbcf02c 192v4l="no"
8aa3ee32 193dv1394="no"
dfdfa47c
FR
194# enable beos things
195audio_beos="yes"
ef0bc4c9
FR
196# no need for libm, but the inet stuff
197# Check for BONE
198if (echo $BEINCLUDES|grep 'headers/be/bone' >/dev/null); then
199extralibs="-lbind -lsocket"
200else
26b35efb 201netserver="yes"
4baca069 202need_inet_aton="yes"
26b35efb 203extralibs="-lnet"
ef0bc4c9 204fi ;;
4baca069
PG
205SunOS)
206v4l="no"
207audio_oss="no"
8aa3ee32 208dv1394="no"
4baca069
PG
209make="gmake"
210LDFLAGS=""
211FFSLDFLAGS=""
212need_inet_aton="yes"
213extralibs="$extralibs -lsocket -lnsl"
214;;
9c938e77
PG
215FreeBSD)
216v4l="no"
217audio_oss="yes"
8aa3ee32 218dv1394="no"
9c938e77 219make="gmake"
4baca069 220LDFLAGS="$LDFLAGS -export-dynamic"
9c938e77 221;;
4a908fbc 222BSD/OS)
5cbcf02c 223v4l="no"
6063bce7 224audio_oss="yes"
8aa3ee32 225dv1394="no"
4a908fbc
AB
226extralibs="-lpoll -lgnugetopt -lm"
227make="gmake"
228;;
90cee0c3 229Darwin)
a43bd1d7 230cc="cc"
90cee0c3
MN
231v4l="no"
232audio_oss="no"
8aa3ee32 233dv1394="no"
d3b15036 234ffserver="no"
a43bd1d7 235SHFLAGS="-dynamiclib"
90cee0c3 236extralibs=""
a43bd1d7 237darwin="yes"
47930f09 238strip="strip -x"
6207ba95 239LDFLAGS="-d"
4baca069 240FFSLDFLAGS=-Wl,-bind_at_load
90cee0c3 241;;
732d9245 242MINGW32*)
951bf3e6
FB
243# Note: the rest of the mingw32 config is done afterwards as mingw32
244# can be forced on command line for linux cross compilation
732d9245
BE
245mingw32="yes"
246;;
3f027ca7
FB
247CYGWIN*)
248v4l="no"
249audio_oss="yes"
8aa3ee32 250dv1394="no"
3f027ca7
FB
251extralibs=""
252cygwin="yes"
253test -f /usr/include/inttypes.h || \
254test -f /usr/local/include/inttypes.h || \
255echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
256 "/usr/include/inttypes.h !!!"
257;;
b55e4ef4 258Linux)
4baca069 259LDFLAGS="$LDFLAGS -rdynamic"
b55e4ef4 260;;
99614dd4
MB
261IRIX*)
262ranlib="echo ignoring ranlib"
263v4l="no"
264audio_oss="no"
265make="gmake"
266;;
f3ec2d46
SG
267OS/2)
268TMPE=$TMPE".exe"
69db4e10
SG
269ar="emxomfar -p64"
270ranlib="echo ignoring ranlib"
271strip="echo ignoring strip"
cddf3f45 272CFLAGS="-Zomf"
69db4e10 273LDFLAGS="-Zomf -Zstack 16384 -s"
f3ec2d46
SG
274SHFLAGS=""
275FFSLDFLAGS=""
276LIBPREF=""
277LIBSUF=".lib"
278SLIBPREF=""
279SLIBSUF=".dll"
951bf3e6 280EXESUF=".exe"
f3ec2d46
SG
281extralibs=""
282v4l="no"
283audio_oss="no"
8aa3ee32 284dv1394="no"
f3ec2d46
SG
285network="no"
286ffserver="no"
287os2="yes"
288;;
ef0bc4c9
FR
289*) ;;
290esac
de6d9b64 291
6852ac95
RD
292# From mplayer configure. We need TARGET_OS available
293# to the Makefile, so it can distinguish between flavors
294# of AltiVec on PowerPC
295TARGET_OS=`( uname -s ) 2>&1`
296 case "$TARGET_OS" in
297 Linux|FreeBSD|NetBSD|BSD/OS|OpenBSD|SunOS|QNX|Darwin|GNU)
298 ;;
299 IRIX*)
300 TARGET_OS=IRIX
301 ;;
302 HP-UX*)
303 TARGET_OS=HP-UX
304 ;;
305 [cC][yY][gG][wW][iI][nN]*)
306 TARGET_OS=CYGWIN
307 ;;
308 *)
309 TARGET_OS="$TARGET_OS-UNKNOWN"
310 ;;
311 esac
312
0f3cb305
FB
313# find source path
314# XXX: we assume an absolute path is given when launching configure,
315# except in './configure' case.
586bc755 316source_path="`echo $0 | sed -e 's#/configure##'`"
0f3cb305
FB
317source_path_used="yes"
318if test -z "$source_path" -o "$source_path" = "." ; then
319 source_path=`pwd`
320 source_path_used="no"
de6d9b64
FB
321fi
322
323for opt do
324 case "$opt" in
325 --prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
326 ;;
23a65308
FB
327 --mandir=*) mandir=`echo $opt | cut -d '=' -f 2`
328 ;;
0f3cb305
FB
329 --source-path=*) source_path=`echo $opt | cut -d '=' -f 2`
330 ;;
331 --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2`
332 ;;
de6d9b64
FB
333 --cc=*) cc=`echo $opt | cut -d '=' -f 2`
334 ;;
4a908fbc
AB
335 --make=*) make=`echo $opt | cut -d '=' -f 2`
336 ;;
0f3cb305
FB
337 --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}"
338 ;;
339 --extra-ldflags=*) LDFLAGS=${opt#--extra-ldflags=}
340 ;;
341 --extra-libs=*) extralibs=${opt#--extra-libs=}
342 ;;
de6d9b64
FB
343 --cpu=*) cpu=`echo $opt | cut -d '=' -f 2`
344 ;;
a4adb608
MN
345 --tune=*) tune=`echo $opt | cut -d '=' -f 2`
346 ;;
e45a2872
RD
347 --powerpc-perf-enable) powerpc_perf="yes"
348 ;;
de6d9b64
FB
349 --disable-mmx) mmx="no"
350 ;;
ab6c65f6
BF
351 --disable-altivec) altivec="no"
352 ;;
de6d9b64
FB
353 --enable-gprof) gprof="yes"
354 ;;
5cbcf02c
FB
355 --disable-v4l) v4l="no"
356 ;;
357 --disable-audio-oss) audio_oss="no"
358 ;;
dfdfa47c
FR
359 --disable-audio-beos) audio_beos="no"
360 ;;
8aa3ee32
MK
361 --disable-dv1394) dv1394="no"
362 ;;
5cbcf02c
FB
363 --disable-network) network="no"
364 ;;
0147f198
FR
365 --disable-zlib) zlib="no"
366 ;;
ba9261e5 367 --enable-a52) a52="yes"
6ed7422a 368 ;;
9c938e77 369 --enable-a52bin) a52bin="yes" ; extralibs="$ldl $extralibs"
57514323 370 ;;
ba9261e5 371 --enable-pp) pp="yes"
bba9b16c
MN
372 ;;
373 --enable-shared-pp) shared_pp="yes"
374 ;;
a6741398
J
375 --enable-mp3lame) mp3lame="yes"
376 ;;
81e0d0b4
MH
377 --enable-vorbis) vorbis="yes"
378 ;;
445ad18d
ZK
379 --enable-faad) faad="yes"
380 ;;
381 --enable-faadbin) faadbin="yes"
382 ;;
29d48296
MN
383 --enable-faac) faac="yes"
384 ;;
68892110
PG
385 --disable-vhook) vhook="no"
386 ;;
c02dbee1 387 --disable-simple_idct) simpleidct="no"
045ed63f 388 ;;
732d9245
BE
389 --enable-mingw32) mingw32="yes"
390 ;;
83286d2a 391 --enable-shared) lshared="yes"
0319c531 392 ;;
cddf3f45
GM
393 --disable-debug) debug="no"
394 ;;
395 --disable-opts) optimize="no"
396 ;;
1eb2212e
FB
397 --disable-mpegaudio-hp) mpegaudio_hp="no"
398 ;;
8154d2e0
FB
399 --disable-ffserver) ffserver="no"
400 ;;
a86b921c
FB
401 --disable-ffplay) ffplay="no"
402 ;;
1d0d55da
MN
403 --disable-risky) risky="no"
404 ;;
cddf3f45 405 --enable-small) optimize="small"
553a6284 406 ;;
891f64b3 407 --enable-amr_nb) amr_nb="yes"
408 ;;
bc634f6f
ZK
409 --enable-amr_nb-fixed) amr_nb_fixed="yes"
410 ;;
f80f7964
RS
411 --enable-sunmlib) sunmlib="yes"
412 ;;
de6d9b64
FB
413 esac
414done
415
0f3cb305
FB
416# compute mmx state
417if test $mmx = "default"; then
418 if test $cpu = "x86"; then
419 mmx="yes"
420 else
421 mmx="no"
422 fi
423fi
424
cf9d24ad
DC
425#Darwin CC versions
426if test $targetos = Darwin; then
b2924696 427 if test -n "`$cc -v 2>&1 | grep xlc`"; then
cf9d24ad
DC
428 CFLAGS="-qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
429 else
b2924696 430 gcc_version="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
cf9d24ad
DC
431 case "$gcc_version" in
432 *2.95*)
433 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer"
434 ;;
f2fae326
MN
435 *3.1*)
436 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
437 ;;
cf9d24ad
DC
438 *3.3*)
439 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic -force_cpusubtype_ALL -Wno-sign-compare"
440 ;;
441 *)
442 CFLAGS="-no-cpp-precomp -pipe -fomit-frame-pointer -mdynamic-no-pic"
443 ;;
444 esac
445 fi
446fi
447
ab6c65f6
BF
448# Can only do AltiVec on PowerPC
449if test $altivec = "default"; then
450 if test $cpu = "powerpc"; then
451 altivec="yes"
452 else
453 altivec="no"
454 fi
455fi
456
a4adb608
MN
457# Add processor-specific flags
458TUNECPU="generic"
459if test $tune != "generic"; then
460 case $tune in
461 601|ppc601|PowerPC601)
462 CFLAGS="$CFLAGS -mcpu=601"
463 if test $altivec = "yes"; then
464 echo "WARNING: tuning for PPC601 but altivec enabled !";
465 fi
466 TUNECPU=ppc601
467 ;;
468 603*|ppc603*|PowerPC603*)
469 CFLAGS="$CFLAGS -mcpu=603"
470 if test $altivec = "yes"; then
471 echo "WARNING: tuning for PPC603 but altivec enabled !";
472 fi
473 TUNECPU=ppc603
474 ;;
475 604*|ppc604*|PowerPC604*)
476 CFLAGS="$CFLAGS -mcpu=604"
477 if test $altivec = "yes"; then
478 echo "WARNING: tuning for PPC604 but altivec enabled !";
479 fi
480 TUNECPU=ppc604
481 ;;
8d6625b6 482 G3|g3|75*|ppc75*|PowerPC75*)
fe0f2a97 483 CFLAGS="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
a4adb608
MN
484 if test $altivec = "yes"; then
485 echo "WARNING: tuning for PPC75x but altivec enabled !";
486 fi
487 TUNECPU=ppc750
488 ;;
8d6625b6 489 G4|g4|745*|ppc745*|PowerPC745*)
fe0f2a97 490 CFLAGS="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
3efd4952
RD
491 if test $altivec = "no"; then
492 echo "WARNING: tuning for PPC745x but altivec disabled !";
493 fi
494 TUNECPU=ppc7450
495 ;;
496 74*|ppc74*|PowerPC74*)
fe0f2a97 497 CFLAGS="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
a4adb608
MN
498 if test $altivec = "no"; then
499 echo "WARNING: tuning for PPC74xx but altivec disabled !";
500 fi
e45a2872 501 TUNECPU=ppc7400
a4adb608 502 ;;
8d6625b6 503 G5|g5|970|ppc970|PowerPC970|power4*|Power4*)
a4adb608
MN
504 CFLAGS="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc64 -force_cpusubtype_ALL "
505 if test $altivec = "no"; then
506 echo "WARNING: tuning for PPC970 but altivec disabled !";
507 fi
508 TUNECPU=ppc970
509 ;;
510 *)
511 echo "WARNING: unknown CPU "$tune", ignored"
512 ;;
513 esac
514fi
515
cf9d24ad 516# AltiVec flags: The FSF version of GCC differs from the Apple version
b6e52719
MD
517if test $cpu = "powerpc"; then
518 if test $altivec = "yes"; then
b2924696 519 if test -n "`$cc -v 2>&1 | grep version | grep Apple`"; then
b6e52719
MD
520 CFLAGS="$CFLAGS -faltivec"
521 else
522 CFLAGS="$CFLAGS -maltivec -mabi=altivec"
523 fi
524 fi
525fi
526
a9a07762
MN
527# See if we have <altivec.h>
528cat > $TMPC << EOF
529#include <altivec.h>
530int main( void ) { return 0; }
531EOF
532
533_altivec_h="no"
b6e52719 534if $cc $CFLAGS -o $TMPE $TMPC 2> /dev/null ; then
a9a07762
MN
535_altivec_h="yes"
536fi
537
ab6c65f6
BF
538# See does our compiler support Motorola AltiVec C API
539if test $altivec = "yes"; then
a9a07762 540if test $_altivec_h = "yes"; then
ab6c65f6 541cat > $TMPC << EOF
a9a07762 542#include <altivec.h>
ab6c65f6
BF
543int main(void) {
544 vector signed int v1, v2, v3;
545 v1 = vec_add(v2,v3);
546 return 0;
547}
548EOF
a9a07762
MN
549else
550cat > $TMPC << EOF
551int main(void) {
552 vector signed int v1, v2, v3;
553 v1 = vec_add(v2,v3);
554 return 0;
555}
556EOF
557fi
b6e52719 558$cc $CFLAGS -o $TMPE $TMPC 2> /dev/null || altivec="no"
ab6c65f6
BF
559fi
560
d46aba26
LS
561# Can only do mmi on mips
562if test $mmi = "default"; then
563 if test $cpu = "mips"; then
564 mmi="yes"
565 else
566 mmi="no"
567 fi
568fi
569
570# See does our compiler support mmi
571if test $mmi = "yes"; then
572cat > $TMPC << EOF
573int main(void) {
574 __asm__ ("lq \$2, 0(\$2)");
575 return 0;
576}
577EOF
f3ec2d46 578$cc -o $TMPE $TMPC 2> /dev/null || mmi="no"
d46aba26
LS
579fi
580
732d9245 581if test "$mingw32" = "yes" ; then
732d9245
BE
582 v4l="no"
583 audio_oss="no"
8aa3ee32 584 dv1394="no"
951bf3e6 585 ffserver="no"
732d9245 586 network="no"
951bf3e6
FB
587 LIBPREF=""
588 LIBSUF=".lib"
589 SLIBPREF=""
590 SLIBSUF=".dll"
591 EXESUF=".exe"
592 prefix="/c/Program Files/FFmpeg"
593 bindir="$prefix"
732d9245
BE
594fi
595
0f3cb305
FB
596cc="${cross_prefix}${cc}"
597ar="${cross_prefix}${ar}"
be7109c1 598ranlib="${cross_prefix}${ranlib}"
0f3cb305
FB
599strip="${cross_prefix}${strip}"
600
487a54d7
FB
601if test -z "$cross_prefix" ; then
602
3d204385 603# ---
a3999908
MN
604# big/little endian test
605cat > $TMPC << EOF
606#include <inttypes.h>
607int main(int argc, char ** argv){
608 volatile uint32_t i=0x01234567;
609 return (*((uint8_t*)(&i))) == 0x67;
610}
611EOF
612
f3ec2d46
SG
613if $cc -o $TMPE $TMPC 2>/dev/null ; then
614$TMPE && bigendian="yes"
a3999908
MN
615else
616echo big/little test failed
617fi
618
487a54d7
FB
619else
620
621# if cross compiling, cannot launch a program, so make a static guess
622if test "$cpu" = "powerpc" -o "$cpu" = "mips" ; then
623 bigendian="yes"
624fi
625
626fi
627
a3999908 628# ---
3d204385
NK
629# check availability of some header files
630
631cat > $TMPC << EOF
632#include <malloc.h>
633int main( void ) { return 0; }
634EOF
635
636_memalign=no
637_malloc_h=no
f3ec2d46 638if $cc -o $TMPE $TMPC 2> /dev/null ; then
3d204385
NK
639_malloc_h=yes
640_memalign=yes
641# check for memalign - atmos
642cat > $TMPC << EOF
643#include <malloc.h>
644int main ( void ) {
645char *string = NULL;
646string = memalign(64, sizeof(char));
647return 0;
648}
649EOF
f3ec2d46 650$cc -o $TMPE $TMPC 2> /dev/null || _memalign=no
3d204385
NK
651fi
652
68892110 653cat > $TMPC << EOF
5e4639e2
GM
654#include <time.h>
655int main( void ) { localtime_r(NULL, NULL); }
656EOF
657
658localtime_r=no
659if $cc -o $TMPE $TMPC 2> /dev/null ; then
660 localtime_r=yes
661fi
662
0147f198
FR
663if test "$zlib" = "yes"; then
664# check for zlib - mmu_man
665cat > $TMPC << EOF
666#include <zlib.h>
667int main ( void ) {
668if (zlibVersion() != ZLIB_VERSION)
669 puts("zlib version differs !!!");
670 return 1;
671return 0;
672}
673EOF
f3ec2d46
SG
674$cc -o $TMPE $TMPC -lz 2> /dev/null || zlib="no"
675# $TMPE 2> /dev/null > /dev/null || zlib="no"
0147f198
FR
676# XXX: more tests needed - runtime test
677fi
678if test "$zlib" = "yes"; then
679extralibs="$extralibs -lz"
680fi
681
95e2ce4a
MN
682# test for lrintf in math.h
683cat > $TMPC << EOF
684#define _ISOC9X_SOURCE 1
685#include <math.h>
686int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
687EOF
688
689have_lrintf="no"
f3ec2d46 690if $cc $extralibs -o $TMPE $TMPC 2> /dev/null ; then
95e2ce4a 691 have_lrintf="yes"
f3ec2d46 692 $TMPE 2> /dev/null > /dev/null || have_lrintf="no"
95e2ce4a
MN
693fi
694
c13e1abd
FH
695_restrict=
696for restrict_keyword in restrict __restrict__ __restrict; do
697 echo "void foo(char * $restrict_keyword p);" > $TMPC
698 if $cc -c -o $TMPO $TMPC 2> /dev/null; then
699 _restrict=$restrict_keyword
700 break;
701 fi
702done
703
52b41d7f
FB
704# test gcc version to see if vector builtins can be used
705# currently only used on i386 for MMX builtins
706cat > $TMPC << EOF
707int main(void) {
708#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
709return 0;
710#else
711#error no vector builtins
712#endif
713}
714EOF
715
716builtin_vector=no
717if $cc -o $TMPO $TMPC 2> /dev/null ; then
718 builtin_vector=yes
a8721c09
FB
719fi
720
721# dlopen/dlfcn.h probing
722
723cat > $TMPC << EOF
724#include <dlfcn.h>
725int main( void ) { return (int) dlopen("foo", 0); }
726EOF
727
728ldl=-ldl
729
cf9d24ad 730if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
731dlfcn=yes
732dlopen=yes
733fi
734
cf9d24ad 735if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
736dlfcn=yes
737dlopen=yes
738ldl=""
739fi
740
741cat > $TMPC << EOF
742int main( void ) { return (int) dlopen("foo", 0); }
743EOF
744
cf9d24ad 745if $cc -o $TMPE $TMPC -ldl > /dev/null 2>&1 ; then
a8721c09
FB
746dlopen=yes
747fi
748
cf9d24ad 749if $cc -o $TMPE $TMPC > /dev/null 2>&1 ; then
a8721c09
FB
750dlopen=yes
751ldl=""
752fi
753
754if test "$vhook" = "default" ; then
755 vhook="$dlopen"
756fi
757
a86b921c
FB
758##########################################
759# imlib probe
760
a8721c09
FB
761cat > $TMPC << EOF
762#include <X11/Xlib.h>
763#include <Imlib2.h>
764int main( void ) { return (int) imlib_load_font("foo"); }
765EOF
766
767imlib2=no
cf9d24ad 768if $cc -o $TMPE $TMPC -lImlib2 > /dev/null 2>&1 ; then
a8721c09 769imlib2=yes
52b41d7f
FB
770fi
771
a86b921c
FB
772##########################################
773# freetype probe
774
04511d53
PG
775cat > $TMPC << EOF
776#include <ft2build.h>
777int main( void ) { return (int) FT_Init_FreeType(0); }
778EOF
779
780freetype2=no
69db4e10 781if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
6e023978 782 if test "`which freetype-config`" != ""; then
cf9d24ad 783 if $cc -o $TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev/null 2>&1 ; then
dee076fc 784 freetype2=yes
04511d53 785 fi
dee076fc 786 fi
04511d53
PG
787fi
788
a86b921c
FB
789##########################################
790# SDL probe
791
792cat > $TMPC << EOF
793#include <SDL.h>
31319a8c 794#undef main /* We don't want SDL to override our main() */
a86b921c
FB
795int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
796EOF
797
798sdl_too_old=no
799sdl=no
cf9d24ad 800if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev/null 2>&1 ; then
a86b921c
FB
801_sdlversion=`sdl-config --version | sed 's/[^0-9]//g'`
802if test "$_sdlversion" -lt 121 ; then
803sdl_too_old=yes
804else
805sdl=yes
806fi
807fi
808
b2924696 809case "`$cc -v 2>&1 | grep version`" in
cf9d24ad
DC
810 *gcc*)
811 CFLAGS="-Wall $CFLAGS"
812 ;;
813 *)
814 ;;
815esac
816
94a3401e
FB
817if test "$sdl" = "no" ; then
818 ffplay=no
819fi
820
cddf3f45
GM
821if test "$debug" = "yes"; then
822 CFLAGS="$CFLAGS -g"
823fi
824
825if test "$optimize" = "small"; then
98ca7790 826# CFLAGS=${CFLAGS//-O3/-Os}
553a6284
MN
827 CFLAGS="$CFLAGS -Os"
828fi
829
cddf3f45 830if test "$optimize" = "yes"; then
b2924696 831 if test -n "`$cc -v 2>&1 | grep xlc`"; then
cf9d24ad
DC
832 CFLAGS="$CFLAGS -O5"
833 LDFLAGS="$LDFLAGS -O5"
834 else
cddf3f45 835 CFLAGS="$CFLAGS -O3"
cf9d24ad 836 fi
cddf3f45
GM
837fi
838
951bf3e6
FB
839if test x"$bindir" = x""; then
840bindir="${prefix}/bin"
841fi
842
23a65308
FB
843if test x"$mandir" = x""; then
844mandir="${prefix}/man"
845fi
846
de6d9b64 847echo "Install prefix $prefix"
0f3cb305 848echo "Source path $source_path"
de6d9b64 849echo "C compiler $cc"
4a908fbc 850echo "make $make"
a4adb608 851echo "CPU $cpu ($tune)"
0f3cb305 852echo "Big Endian $bigendian"
e41e8342 853if test $cpu = "x86"; then
de6d9b64 854echo "MMX enabled $mmx"
52b41d7f 855echo "Vector Builtins $builtin_vector"
e41e8342
FB
856fi
857if test $cpu = "mips"; then
d46aba26 858echo "MMI enabled $mmi"
e41e8342
FB
859fi
860if test $cpu = "powerpc"; then
ab6c65f6 861echo "AltiVec enabled $altivec"
e41e8342 862fi
de6d9b64 863echo "gprof enabled $gprof"
0147f198 864echo "zlib enabled $zlib"
a6741398 865echo "mp3lame enabled $mp3lame"
81e0d0b4 866echo "vorbis enabled $vorbis"
445ad18d
ZK
867echo "faad enabled $faad"
868echo "faadbin enabled $faadbin"
29d48296 869echo "faac enabled $faac"
5cbcf02c 870echo "a52 support $a52"
57514323 871echo "a52 dlopened $a52bin"
bba9b16c 872echo "pp support $pp"
cddf3f45
GM
873echo "debug symbols $debug"
874echo "optimize $optimize"
bba9b16c 875echo "shared pp $shared_pp"
47930f09 876echo "Video hooking $vhook"
a86b921c
FB
877echo "SDL support $sdl"
878if test $sdl_too_old = "yes"; then
879echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
880fi
1d0d55da 881echo "risky / patent encumbered codecs $risky"
68892110
PG
882
883if test "$vhook" = "yes" ; then
47930f09 884echo "Imlib2 support $imlib2"
04511d53 885echo "freetype support $freetype2"
68892110 886fi
f80f7964 887echo "Sun medialib support" $sunmlib
bc634f6f
ZK
888echo "AMR-NB float support" $amr_nb
889echo "AMR-NB fixed support" $amr_nb_fixed
d663a1fd 890echo "AMR-WB float support" $amr_wb
de6d9b64 891
980fc7b8 892echo "Creating config.mak and config.h"
de6d9b64 893
980fc7b8 894echo "# Automatically generated by configure - do not modify" > config.mak
045ed63f 895echo "/* Automatically generated by configure - do not modify */" > $TMPH
de6d9b64 896
980fc7b8 897echo "prefix=$prefix" >> config.mak
951bf3e6 898echo "bindir=$bindir" >> config.mak
23a65308 899echo "mandir=$mandir" >> config.mak
4a908fbc 900echo "MAKE=$make" >> config.mak
980fc7b8
FB
901echo "CC=$cc" >> config.mak
902echo "AR=$ar" >> config.mak
be7109c1 903echo "RANLIB=$ranlib" >> config.mak
0f3cb305 904echo "STRIP=$strip" >> config.mak
a9b3f630 905echo "OPTFLAGS=$CFLAGS" >> config.mak
0f3cb305 906echo "LDFLAGS=$LDFLAGS" >> config.mak
4baca069 907echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
e1707f52 908echo "SHFLAGS=$SHFLAGS" >> config.mak
f3ec2d46
SG
909echo "LIBPREF=$LIBPREF" >> config.mak
910echo "LIBSUF=$LIBSUF" >> config.mak
911echo "SLIBPREF=$SLIBPREF" >> config.mak
912echo "SLIBSUF=$SLIBSUF" >> config.mak
951bf3e6 913echo "EXESUF=$EXESUF" >> config.mak
6852ac95 914echo "TARGET_OS=$TARGET_OS" >> config.mak
57514323 915if test "$cpu" = "x86" ; then
980fc7b8 916 echo "TARGET_ARCH_X86=yes" >> config.mak
045ed63f 917 echo "#define ARCH_X86 1" >> $TMPH
0f3cb305 918elif test "$cpu" = "armv4l" ; then
6ed7422a 919 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
045ed63f 920 echo "#define ARCH_ARMV4L 1" >> $TMPH
0f3cb305 921elif test "$cpu" = "alpha" ; then
91d1f1a4 922 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
045ed63f 923 echo "#define ARCH_ALPHA 1" >> $TMPH
35fedfc3
PG
924elif test "$cpu" = "sparc64" ; then
925 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
926 echo "#define ARCH_SPARC64 1" >> $TMPH
0f3cb305
FB
927elif test "$cpu" = "powerpc" ; then
928 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
929 echo "#define ARCH_POWERPC 1" >> $TMPH
e45a2872
RD
930 if test "$powerpc_perf" = "yes"; then
931 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
932 fi
d46aba26
LS
933elif test "$cpu" = "mips" ; then
934 echo "TARGET_ARCH_MIPS=yes" >> config.mak
935 echo "#define ARCH_MIPS 1" >> $TMPH
bdb2e37c
AB
936elif test "$cpu" = "sh4" ; then
937 echo "TARGET_ARCH_SH4=yes" >> config.mak
938 echo "#define ARCH_SH4 1" >> $TMPH
939fi
a4adb608 940echo "#define TUNECPU $TUNECPU" >> $TMPH
0f3cb305
FB
941if test "$bigendian" = "yes" ; then
942 echo "WORDS_BIGENDIAN=yes" >> config.mak
943 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
91d1f1a4 944fi
57514323 945if test "$mmx" = "yes" ; then
980fc7b8 946 echo "TARGET_MMX=yes" >> config.mak
045ed63f 947 echo "#define HAVE_MMX 1" >> $TMPH
e82c5a8c 948 echo "#define __CPU__ 586" >> $TMPH
de6d9b64 949fi
52b41d7f
FB
950if test "$builtin_vector" = "yes" ; then
951 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
952 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
953fi
d46aba26
LS
954if test "$mmi" = "yes" ; then
955 echo "TARGET_MMI=yes" >> config.mak
956 echo "#define HAVE_MMI 1" >> $TMPH
957fi
ab6c65f6
BF
958if test "$altivec" = "yes" ; then
959 echo "TARGET_ALTIVEC=yes" >> config.mak
960 echo "#define HAVE_ALTIVEC 1" >> $TMPH
db40a39a
MN
961 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
962 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
a9a07762
MN
963 if test "$_altivec_h" = "yes" ; then
964 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
965 else
e67e14d5 966 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
a9a07762 967 fi
ab6c65f6 968fi
57514323 969if test "$gprof" = "yes" ; then
980fc7b8 970 echo "TARGET_GPROF=yes" >> config.mak
045ed63f 971 echo "#define HAVE_GPROF 1" >> $TMPH
de6d9b64 972fi
5e4639e2
GM
973if test "$localtime_r" = "yes" ; then
974 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
5e4639e2 975fi
68892110
PG
976if test "$imlib2" = "yes" ; then
977 echo "HAVE_IMLIB2=yes" >> config.mak
978fi
04511d53
PG
979if test "$freetype2" = "yes" ; then
980 echo "HAVE_FREETYPE2=yes" >> config.mak
981fi
f80f7964
RS
982if test "$sunmlib" = "yes" ; then
983 echo "HAVE_MLIB=yes" >> config.mak
984 echo "#define HAVE_MLIB 1" >> $TMPH
985 extralibs="$extralibs -lmlib"
986fi
a86b921c
FB
987if test "$sdl" = "yes" ; then
988 echo "CONFIG_SDL=yes" >> config.mak
989 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
990 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
991fi
95e2ce4a
MN
992if test "$have_lrintf" = "yes" ; then
993 echo "#define HAVE_LRINTF 1" >> $TMPH
994fi
68892110
PG
995if test "$vhook" = "yes" ; then
996 echo "BUILD_VHOOK=yes" >> config.mak
997 echo "#define HAVE_VHOOK 1" >> $TMPH
9c938e77 998 extralibs="$extralibs $ldl"
68892110 999fi
57514323 1000if test "$lshared" = "yes" ; then
0319c531 1001 echo "BUILD_SHARED=yes" >> config.mak
5cbcf02c 1002 echo "PIC=-fPIC" >> config.mak
0319c531 1003fi
ef0bc4c9 1004echo "EXTRALIBS=$extralibs" >> config.mak
258207b7
FB
1005version=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1006 cut -d '"' -f 2`
1007echo "VERSION=$version" >>config.mak
d771bcae 1008# if you do not want to use encoders, disable that.
045ed63f 1009echo "#define CONFIG_ENCODERS 1" >> $TMPH
d771bcae
FB
1010echo "CONFIG_ENCODERS=yes" >> config.mak
1011
1012# if you do not want to use decoders, disable that.
045ed63f 1013echo "#define CONFIG_DECODERS 1" >> $TMPH
d771bcae
FB
1014echo "CONFIG_DECODERS=yes" >> config.mak
1015
5cbcf02c
FB
1016# AC3
1017if test "$a52" = "yes" ; then
1018 echo "#define CONFIG_AC3 1" >> $TMPH
1019 echo "CONFIG_AC3=yes" >> config.mak
d771bcae 1020
5cbcf02c
FB
1021 if test "$a52bin" = "yes" ; then
1022 echo "#define CONFIG_A52BIN 1" >> $TMPH
1023 echo "CONFIG_A52BIN=yes" >> config.mak
1024 fi
1025fi
1026
bba9b16c
MN
1027# PP
1028if test "$pp" = "yes" ; then
1029 echo "#define CONFIG_PP 1" >> $TMPH
1030 echo "CONFIG_PP=yes" >> config.mak
1031
1032 if test "$shared_pp" = "yes" ; then
1033 echo "#define SHARED_PP 1" >> $TMPH
1034 echo "SHARED_PP=yes" >> config.mak
1035 fi
1036fi
1037
1eb2212e
FB
1038# mpeg audio high precision mode
1039if test "$mpegaudio_hp" = "yes" ; then
1040 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1041fi
1042
5cbcf02c
FB
1043if test "$v4l" = "yes" ; then
1044 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1045 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1046fi
1047
8aa3ee32
MK
1048if test "$dv1394" = "yes" ; then
1049 echo "#define CONFIG_DV1394 1" >> $TMPH
1050 echo "CONFIG_DV1394=yes" >> config.mak
1051fi
1052
adbc0510
PG
1053if test "$dlopen" = "yes" ; then
1054 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1055fi
1056
1057if test "$dlfcn" = "yes" ; then
1058 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1059fi
1060
5cbcf02c
FB
1061if test "$audio_oss" = "yes" ; then
1062 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1063 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
57514323
ZK
1064fi
1065
dfdfa47c
FR
1066if test "$audio_beos" = "yes" ; then
1067 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1068 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1069fi
1070
5cbcf02c
FB
1071if test "$network" = "yes" ; then
1072 echo "#define CONFIG_NETWORK 1" >> $TMPH
1073 echo "CONFIG_NETWORK=yes" >> config.mak
6ed7422a 1074fi
daf8e955 1075
0147f198
FR
1076if test "$zlib" = "yes" ; then
1077 echo "#define CONFIG_ZLIB 1" >> $TMPH
1078 echo "CONFIG_ZLIB=yes" >> config.mak
1079fi
1080
57514323 1081if test "$mp3lame" = "yes" ; then
045ed63f 1082 echo "#define CONFIG_MP3LAME 1" >> $TMPH
a6741398
J
1083 echo "CONFIG_MP3LAME=yes" >> config.mak
1084fi
1085
81e0d0b4
MH
1086if test "$vorbis" = "yes" ; then
1087 echo "#define CONFIG_VORBIS 1" >> $TMPH
1088 echo "CONFIG_VORBIS=yes" >> config.mak
1089fi
1090
0fc50e58
ZK
1091if test "$faad" = "yes" ; then
1092 echo "#define CONFIG_FAAD 1" >> $TMPH
1093 echo "CONFIG_FAAD=yes" >> config.mak
1094fi
1095
1096if test "$faadbin" = "yes" ; then
1097 echo "#define CONFIG_FAADBIN 1" >> $TMPH
445ad18d 1098 echo "CONFIG_FAADBIN=yes" >> config.mak
0fc50e58
ZK
1099fi
1100
29d48296
MN
1101if test "$faac" = "yes" ; then
1102 echo "#define CONFIG_FAAC 1" >> $TMPH
1103 echo "CONFIG_FAAC=yes" >> config.mak
1104fi
1105
732d9245
BE
1106if test "$mingw32" = "yes" ; then
1107 echo "#define CONFIG_WIN32 1" >> $TMPH
1108 echo "CONFIG_WIN32=yes" >> config.mak
7eea5766 1109 echo "#ifndef __MINGW32__" >> $TMPH
732d9245 1110 echo "#define __MINGW32__ 1" >> $TMPH
7eea5766 1111 echo "#endif" >> $TMPH
3f027ca7
FB
1112fi
1113
f3ec2d46
SG
1114if test "$os2" = "yes" ; then
1115 echo "#define CONFIG_OS2 1" >> $TMPH
1116 echo "CONFIG_OS2=yes" >> config.mak
1117fi
1118
6e023978
RS
1119if test "$TARGET_OS" = "SunOS" ; then
1120 echo "#define CONFIG_SUNOS 1" >> $TMPH
1121fi
1122
90cee0c3
MN
1123if test "$darwin" = "yes"; then
1124 echo "#define CONFIG_DARWIN 1" >> $TMPH
1125 echo "CONFIG_DARWIN=yes" >> config.mak
1126fi
1127
57514323 1128if test "$_malloc_h" = "yes" ; then
045ed63f 1129 echo "#define HAVE_MALLOC_H 1" >> $TMPH
3d204385 1130else
045ed63f 1131 echo "#undef HAVE_MALLOC_H" >> $TMPH
3d204385
NK
1132fi
1133
57514323 1134if test "$_memalign" = "yes" ; then
045ed63f
ZK
1135 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1136else
1137 echo "#undef HAVE_MEMALIGN" >> $TMPH
1138fi
1139
26b35efb
FR
1140if test "$netserver" = "yes" ; then
1141 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1142 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1143fi
1144
4baca069
PG
1145if test "$need_inet_aton" = "yes" ; then
1146 echo "NEED_INET_ATON=yes" >> config.mak
1147fi
1148
57514323 1149if test "$simpleidct" = "yes" ; then
045ed63f
ZK
1150 echo "#define SIMPLE_IDCT 1" >> $TMPH
1151fi
1152
8154d2e0
FB
1153if test "$ffserver" = "yes" ; then
1154 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1155 echo "CONFIG_FFSERVER=yes" >> config.mak
1156fi
1157
a86b921c
FB
1158if test "$ffplay" = "yes" ; then
1159 echo "CONFIG_FFPLAY=yes" >> config.mak
1160fi
1161
1d0d55da
MN
1162if test "$risky" = "yes" ; then
1163 echo "#define CONFIG_RISKY 1" >> $TMPH
1164 echo "CONFIG_RISKY=yes" >> config.mak
1165fi
1166
c13e1abd
FH
1167echo "#define restrict $_restrict" >> $TMPH
1168
0f3cb305
FB
1169# build tree in object directory if source path is different from current one
1170if test "$source_path_used" = "yes" ; then
a382b927 1171 DIRS="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
5f6b58de
MR
1172 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1173 FILES="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
0f3cb305
FB
1174 for dir in $DIRS ; do
1175 mkdir -p $dir
1176 done
1177 for f in $FILES ; do
1178 ln -sf $source_path/$f $f
1179 done
1180fi
1181echo "SRC_PATH=$source_path" >> config.mak
1182
d663a1fd
MN
1183if test "$amr_wb" = "yes" ; then
1184 echo "#define AMR_WB 1" >> $TMPH
1185 echo "AMR_WB=yes" >> config.mak
1186 echo
1187 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1188 echo "V5.1.0 from "
1189 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1190 echo "and extracted the source to libavcodec/amrwb_float"
1191 echo
1192fi
1193
891f64b3 1194if test "$amr_nb" = "yes" ; then
1195 echo "#define AMR_NB 1" >> $TMPH
1196 echo "AMR_NB=yes" >> config.mak
1197 echo
bc634f6f
ZK
1198if test "$amr_nb_fixed" = "yes" ; then
1199 echo "AMR_NB_FIXED=yes" >> config.mak
1200 echo "#define AMR_NB_FIXED 1" >> $TMPH
1201 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1202 echo "REL-5 version 5.1.0 from "
891f64b3 1203 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-510.zip"
1204 echo "and extracted src to libavcodec/amr"
bc634f6f
ZK
1205 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1206 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1207 echo
1208else
1209 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1210 echo "REL-5 V5.1.0 from "
1211 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-510.zip"
1212 echo "and extracted the source to libavcodec/amr_float"
891f64b3 1213 echo
1214fi
1215
bc634f6f
ZK
1216fi
1217
a7c02e25 1218diff $TMPH config.h >/dev/null 2>&1
045ed63f
ZK
1219if test $? -ne 0 ; then
1220 mv -f $TMPH config.h
3d204385 1221else
045ed63f 1222 echo "config.h is unchanged"
3d204385
NK
1223fi
1224
f3ec2d46 1225rm -f $TMPO $TMPC $TMPE $TMPS $TMPH