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