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