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