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