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