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