3 # ffmpeg configure script (c) 2000, 2001, 2002 Fabrice Bellard
6 if test x
"$1" = x
"-h" -o x
"$1" = x
"--help" ; then
9 Usage: configure [options]
10 Options: [defaults in brackets after descriptions]
13 echo "Standard options:"
14 echo " --help print this message"
15 echo " --prefix=PREFIX install in PREFIX [$prefix]"
16 echo " --mandir=DIR man documentation in DIR [PREFIX/man]"
17 echo " --enable-mp3lame enable mp3 encoding via libmp3lame [default=no]"
18 echo " --enable-vorbis enable vorbis support via libvorbisenc [default=no]"
19 echo " --enable-faad enable faad support via libfaad [default=no]"
20 echo " --enable-faadbin build faad support with runtime linking [default=no]"
21 echo " --enable-faac enable faac support via libfaac [default=no]"
22 echo " --enable-xvid enable xvid support via xvidcore [default=no]"
23 echo " --enable-mingw32 enable mingw32 native/cross windows compile"
24 echo " --enable-a52 enable GPL'ed A52 support [default=no]"
25 echo " --enable-a52bin open liba52.so.0 at runtime [default=no]"
26 echo " --enable-dts enable GPL'ed DTS support [default=no]"
27 echo " --enable-pp enable GPL'ed post processing support [default=no]"
28 echo " --enable-shared-pp use libpostproc.so [default=no]"
29 echo " --enable-shared build shared libraries [default=no]"
30 echo " --enable-amr_nb enable amr_nb float audio codec"
31 echo " --enable-amr_nb-fixed use fixed point for amr-nb codec"
32 echo " --enable-amr_wb enable amr_wb float audio codec"
33 echo " --enable-sunmlib use Sun medialib [default=no]"
34 echo " --enable-pthreads use pthreads [default=no]"
35 echo " --enable-dc1394 enable IIDC-1394 grabbing using libdc1394 and libraw1394 [default=no]"
36 echo " --enable-gpl allow use of gpl code, the resulting libav* and ffmpeg will be under gpl [default=no]"
38 echo "Advanced options (experts only):"
39 echo " --source-path=PATH path of source code [$source_path]"
40 echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]"
41 echo " --cc=CC use C compiler CC [$cc]"
42 echo " --make=MAKE use specified make [$make]"
43 echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]"
44 echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]"
45 echo " --extra-libs=ELIBS add ELIBS [$ELIBS]"
46 echo " --cpu=CPU force cpu to CPU [$cpu]"
47 echo " --tune=PROCESSOR tune code for a particular CPU (may fails or misperforms on other CPUs)"
48 echo " --powerpc-perf-enable enable performance report on PPC (requires enabling PMC)"
49 echo " --disable-mmx disable mmx usage"
50 echo " --disable-altivec disable AltiVec usage"
51 echo " --disable-audio-oss disable OSS audio support [default=no]"
52 echo " --disable-audio-beos disable BeOS audio support [default=no]"
53 echo " --disable-v4l disable video4linux grabbing [default=no]"
54 echo " --disable-dv1394 disable DV1394 grabbing [default=no]"
55 echo " --disable-network disable network support [default=no]"
56 echo " --disable-zlib disable zlib [default=no]"
57 echo " --disable-simple_idct disable simple IDCT routines [default=no]"
58 echo " --disable-vhook disable video hooking support"
59 echo " --enable-gprof enable profiling with gprof [$gprof]"
60 echo " --disable-debug disable debugging symbols"
61 echo " --disable-opts disable compiler optimizations"
62 echo " --disable-mpegaudio-hp faster (but less accurate)"
63 echo " mpegaudio decoding [default=no]"
64 echo " --disable-ffserver disable ffserver build"
65 echo " --disable-ffplay disable ffplay build"
66 echo " --disable-risky disables patent encumbered codecs"
67 echo " --enable-small optimize for size instead of speed"
68 echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers"
69 echo " --disable-strip disable stripping of executables and shared libraries"
71 echo "NOTE: The object files are build at the place where configure is launched"
75 # set temporary file name
76 if test ! -z
"$TMPDIR" ; then
78 elif test ! -z
"$TEMPDIR" ; then
84 TMPC
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.c"
85 TMPO
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
86 TMPE
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}"
87 TMPS
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
88 TMPH
="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.h"
107 i386|i486|i586|i686|i86pc|BePC
)
111 if [ "`$cc -dumpmachine | grep x86_64 | cut -d- -f1`" = "x86_64" -a \
112 -z
"`echo $CFLAGS | grep -- -m32`" ]; then
118 # armv4l is a subset of armv5tel
125 "Power Macintosh"|ppc
)
184 LDFLAGS
=-Wl
,--warn-common
204 prefix
="/boot/home/config"
205 # helps building libavcodec
206 CFLAGS
="-DPIC -fomit-frame-pointer"
207 # 3 gcc releases known for BeOS, each with ugly bugs
208 gcc_version
="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
209 case "$gcc_version" in
210 2.9-beos-991026
*|
2.9-beos-000224
*) echo "R5/GG gcc"
213 *20010315*) echo "BeBits gcc"
214 CFLAGS
="$CFLAGS -fno-expensive-optimizations"
218 # disable linux things
224 # no need for libm, but the inet stuff
226 if (echo $BEINCLUDES|
grep 'headers/be/bone' >/dev
/null
); then
227 extralibs
="-lbind -lsocket"
241 extralibs
="$extralibs -lsocket -lnsl"
249 LDFLAGS
="$LDFLAGS -export-dynamic -pthread"
255 extralibs
="-lpoll -lgnugetopt -lm"
264 SHFLAGS
="-dynamiclib"
269 FFSLDFLAGS
=-Wl
,-bind_at_load
272 # Note: the rest of the mingw32 config is done afterwards as mingw32
273 # can be forced on command line for linux cross compilation
284 test -f
/usr
/include
/inttypes.h || \
285 test -f
/usr
/local/include
/inttypes.h || \
286 echo "Missing inttypes.h, please copy cygwin_inttypes.h to" \
287 "/usr/local/include/inttypes.h !!!"
290 LDFLAGS
="$LDFLAGS -rdynamic"
293 ranlib
="echo ignoring ranlib"
301 ranlib
="echo ignoring ranlib"
302 strip
="echo ignoring strip"
304 LDFLAGS
="-Zomf -Zstack 16384 -s"
323 # From mplayer configure. We need TARGET_OS available
324 # to the Makefile, so it can distinguish between flavors
325 # of AltiVec on PowerPC
326 TARGET_OS
=`( uname -s ) 2>&1`
328 Linux|FreeBSD|NetBSD|BSD
/OS|OpenBSD|SunOS|QNX|Darwin|GNU|BeOS
)
336 [cC
][yY
][gG
][wW
][iI
][nN
]*)
340 TARGET_OS
="$TARGET_OS-UNKNOWN"
345 # XXX: we assume an absolute path is given when launching configure,
346 # except in './configure' case.
347 source_path
="`echo $0 | sed -e 's#/configure##'`"
348 source_path_used
="yes"
349 if test -z
"$source_path" -o
"$source_path" = "." ; then
351 source_path_used
="no"
354 FFMPEG_CONFIGURATION
=" "
356 FFMPEG_CONFIGURATION
="$FFMPEG_CONFIGURATION""$opt "
361 --prefix
=*) prefix
=`echo $opt | cut -d '=' -f 2`
363 --mandir
=*) mandir
=`echo $opt | cut -d '=' -f 2`
365 --source-path
=*) source_path
=`echo $opt | cut -d '=' -f 2`
367 --cross-prefix
=*) cross_prefix
=`echo $opt | cut -d '=' -f 2`
369 --cc
=*) cc
=`echo $opt | cut -d '=' -f 2`
371 --make=*) make=`echo $opt | cut -d '=' -f 2`
373 --extra-cflags
=*) CFLAGS
="${opt#--extra-cflags=}"
375 --extra-ldflags
=*) LDFLAGS
=${opt#--extra-ldflags=}
377 --extra-libs
=*) extralibs
=${opt#--extra-libs=}
379 --cpu
=*) cpu
=`echo $opt | cut -d '=' -f 2`
381 --tune
=*) tune
=`echo $opt | cut -d '=' -f 2`
383 --powerpc-perf-enable
) powerpc_perf
="yes"
385 --disable-mmx
) mmx
="no"
387 --disable-altivec
) altivec
="no"
389 --enable-gprof
) gprof
="yes"
391 --disable-v4l
) v4l
="no"
393 --disable-audio-oss
) audio_oss
="no"
395 --disable-audio-beos
) audio_beos
="no"
397 --disable-dv1394
) dv1394
="no"
399 --disable-network
) network
="no"; ffserver
="no"
401 --disable-zlib
) zlib
="no"
403 --enable-a52
) a52
="yes"
405 --enable-a52bin
) a52bin
="yes" ; extralibs
="$ldl $extralibs"
407 --enable-dts
) dts
="yes" ; extralibs
="$extralibs -ldts"
409 --enable-pp
) pp
="yes"
411 --enable-shared-pp
) shared_pp
="yes"
413 --enable-mp3lame
) mp3lame
="yes"
415 --enable-vorbis
) vorbis
="yes"
417 --enable-faad
) faad
="yes"
419 --enable-faadbin
) faadbin
="yes"
421 --enable-faac
) faac
="yes"
423 --enable-xvid
) xvid
="yes"
425 --enable-dc1394
) dc1394
="yes"
427 --disable-vhook
) vhook
="no"
429 --disable-simple_idct
) simpleidct
="no"
431 --enable-mingw32
) mingw32
="yes"
433 --enable-shared
) lshared
="yes"
435 --disable-debug
) debug
="no"
437 --disable-opts
) optimize
="no"
439 --disable-mpegaudio-hp
) mpegaudio_hp
="no"
441 --disable-ffserver
) ffserver
="no"
443 --disable-ffplay
) ffplay
="no"
445 --disable-risky
) risky
="no"
447 --enable-small
) optimize
="small"
449 --enable-amr_nb
) amr_nb
="yes"
451 --enable-amr_nb-fixed
) amr_nb_fixed
="yes"
453 --enable-amr_wb
) amr_wb
="yes"
455 --enable-sunmlib
) sunmlib
="yes"
457 --enable-pthreads
) pthreads
="yes"
459 --enable-gpl
) gpl
="yes"
461 --enable-memalign-hack
) memalignhack
="yes"
463 --disable-strip
) dostrip
="no"
468 if test "$gpl" != "yes"; then
469 if test "$pp" != "no" -o
"$shared_pp" != "no"; then
470 echo "The Postprocessing code is under GPL and --enable-gpl is not specified"
474 if test "$a52" != "no" -o
"$a52bin" != "no"; then
475 echo "liba52 is under GPL and --enable-gpl is not specified"
479 if test "$xvid" != "no"; then
480 echo "libxvidcore is under GPL and --enable-gpl is not specified"
484 if test "$dts" != "no"; then
485 echo "libdts is under GPL and --enable-gpl is not specified"
489 if test "$faad" != "no" -o
"$faadbin" != "no"; then
492 int main( void ) { return 0; }
495 if $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null
; then
498 #ifndef FAAD2_VERSION
501 int main( void ) { return 0; }
503 if $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null
; then
504 echo "faad2 is under GPL and --enable-gpl is not specified"
510 echo "faad test failed"
515 if test "$fail" = "yes"; then
521 if test $mmx = "default"; then
522 if test $cpu = "x86" -o
$cpu = "x86_64"; then
530 needmdynamicnopic
="no"
531 if test $targetos = Darwin
; then
532 if test -n
"`$cc -v 2>&1 | grep xlc`"; then
533 CFLAGS
="$CFLAGS -qpdf2 -qlanglvl=extc99 -qmaxmem=-1 -qarch=auto -qtune=auto"
535 gcc_version
="`$cc -v 2>&1 | grep version | cut -d ' ' -f3-`"
536 case "$gcc_version" in
538 CFLAGS
="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
541 CFLAGS
="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer -force_cpusubtype_ALL -Wno-sign-compare"
542 if test "$lshared" = no
; then
543 needmdynamicnopic
="yes"
547 CFLAGS
="$CFLAGS -no-cpp-precomp -pipe -fomit-frame-pointer"
548 if test "$lshared" = no
; then
549 needmdynamicnopic
="yes"
556 # Can only do AltiVec on PowerPC
557 if test $altivec = "default"; then
558 if test $cpu = "powerpc"; then
565 # Add processor-specific flags
568 if test $tune != "generic"; then
570 601|ppc601|PowerPC601
)
571 CFLAGS
="$CFLAGS -mcpu=601"
572 if test $altivec = "yes"; then
573 echo "WARNING: tuning for PPC601 but altivec enabled !";
577 603*|ppc603
*|PowerPC603
*)
578 CFLAGS
="$CFLAGS -mcpu=603"
579 if test $altivec = "yes"; then
580 echo "WARNING: tuning for PPC603 but altivec enabled !";
584 604*|ppc604
*|PowerPC604
*)
585 CFLAGS
="$CFLAGS -mcpu=604"
586 if test $altivec = "yes"; then
587 echo "WARNING: tuning for PPC604 but altivec enabled !";
591 G3|g3|
75*|ppc75
*|PowerPC75
*)
592 CFLAGS
="$CFLAGS -mcpu=750 -mtune=750 -mpowerpc-gfxopt"
593 if test $altivec = "yes"; then
594 echo "WARNING: tuning for PPC75x but altivec enabled !";
598 G4|g4|
745*|ppc745
*|PowerPC745
*)
599 CFLAGS
="$CFLAGS -mcpu=7450 -mtune=7450 -mpowerpc-gfxopt"
600 if test $altivec = "no"; then
601 echo "WARNING: tuning for PPC745x but altivec disabled !";
605 74*|ppc74
*|PowerPC74
*)
606 CFLAGS
="$CFLAGS -mcpu=7400 -mtune=7400 -mpowerpc-gfxopt"
607 if test $altivec = "no"; then
608 echo "WARNING: tuning for PPC74xx but altivec disabled !";
612 G5|g5|
970|ppc970|PowerPC970|power4
*|Power4
*)
613 CFLAGS
="$CFLAGS -mcpu=970 -mtune=970 -mpowerpc-gfxopt -mpowerpc64"
614 if test $altivec = "no"; then
615 echo "WARNING: tuning for PPC970 but altivec disabled !";
621 echo "WARNING: unknown CPU "$tune", ignored"
626 # AltiVec flags: The FSF version of GCC differs from the Apple version
627 if test $cpu = "powerpc"; then
628 if test $altivec = "yes"; then
629 if test -n
"`$cc -v 2>&1 | grep version | grep Apple`"; then
630 CFLAGS
="$CFLAGS -faltivec"
632 CFLAGS
="$CFLAGS -maltivec -mabi=altivec"
637 # See if we have <altivec.h>
640 int main( void ) { return 0; }
644 if $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null
; then
648 # See does our compiler support Motorola AltiVec C API
649 if test $altivec = "yes"; then
650 if test $_altivec_h = "yes"; then
654 vector signed int v1, v2, v3;
662 vector signed int v1, v2, v3;
668 $cc $CFLAGS -o
$TMPE $TMPC 2> /dev
/null || altivec
="no"
671 # Can only do mmi on mips
672 if test $mmi = "default"; then
673 if test $cpu = "mips"; then
680 # See does our compiler support mmi
681 if test $mmi = "yes"; then
684 __asm__ ("lq \$2, 0(\$2)");
688 $cc -o
$TMPE $TMPC 2> /dev
/null || mmi
="no"
691 if test "$mingw32" = "yes" ; then
703 prefix
="/c/Program Files/FFmpeg"
707 cc
="${cross_prefix}${cc}"
708 ar="${cross_prefix}${ar}"
709 ranlib
="${cross_prefix}${ranlib}"
710 strip
="${cross_prefix}${strip}"
712 if test -z
"$cross_prefix" ; then
715 # big/little endian test
717 #include <inttypes.h>
718 int main(int argc, char ** argv){
719 volatile uint32_t i=0x01234567;
720 return (*((uint8_t*)(&i))) == 0x67;
724 if $cc -o
$TMPE $TMPC 2>/dev
/null
; then
725 $TMPE && bigendian
="yes"
727 echo big
/little
test failed
732 # if cross compiling, cannot launch a program, so make a static guess
733 if test "$cpu" = "powerpc" -o
"$cpu" = "mips" ; then
742 #include <inttypes.h>
743 int main(int argc, char ** argv){
748 $cc -o
$TMPE $TMPC 2>/dev
/null || inttypes
="no"
753 #include <inttypes.h>
754 int main(int argc, char ** argv){
755 volatile uint_fast64_t i=0x01234567;
760 $cc -o
$TMPE $TMPC 2>/dev
/null || emu_fast_int
="yes"
763 # check availability of some header files
767 int main( void ) { return 0; }
772 if $cc -o
$TMPE $TMPC 2> /dev
/null
; then
775 # check for memalign - atmos
781 string = memalign(64, sizeof(char));
785 $cc -o
$TMPE $TMPC 2> /dev
/null || _memalign
=no
788 if test "$_memalign" = "no" -a
"$mmx" = "yes" -a
"$memalignhack" != "yes"; then
789 echo "error, no memalign() but sse enabled, either disable it or use --enable-memalign-hack"
795 int main( void ) { localtime_r(NULL, NULL); }
799 if $cc -o
$TMPE $TMPC 2> /dev
/null
; then
803 if test "$zlib" = "yes"; then
804 # check for zlib - mmu_man
808 if (zlibVersion() != ZLIB_VERSION)
809 puts("zlib version differs !!!");
814 $cc $CFLAGS -o
$TMPE $TMPC -lz
2> /dev
/null || zlib
="no"
815 # $TMPE 2> /dev/null > /dev/null || zlib="no"
816 # XXX: more tests needed - runtime test
818 if test "$zlib" = "yes"; then
819 extralibs
="$extralibs -lz"
822 # test for lrintf in math.h
824 #define _ISOC9X_SOURCE 1
826 int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
830 if $cc $extralibs -o
$TMPE $TMPC 2> /dev
/null
; then
832 # allanc@chickenandporn.com: cannot execute cross-compiled
833 # code on the host. Only execute if not cross-compiling.
834 if test -z
"$cross_prefix" ; then
835 $TMPE 2> /dev
/null
> /dev
/null || have_lrintf
="no"
840 for restrict_keyword
in restrict __restrict__ __restrict
; do
841 echo "void foo(char * $restrict_keyword p);" > $TMPC
842 if $cc -c
-o
$TMPO $TMPC 2> /dev
/null
; then
843 _restrict
=$restrict_keyword
848 # test gcc version to see if vector builtins can be used
849 # currently only used on i386 for MMX builtins
851 #include <xmmintrin.h>
853 #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)
856 #error no vector builtins
862 if $cc -o
$TMPO $TMPC 2> /dev
/null
; then
866 # dlopen/dlfcn.h probing
870 int main( void ) { return (int) dlopen("foo", 0); }
875 if $cc -o
$TMPE $TMPC -ldl
> /dev
/null
2>&1 ; then
880 if $cc -o
$TMPE $TMPC > /dev
/null
2>&1 ; then
887 int main( void ) { return (int) dlopen("foo", 0); }
890 if $cc -o
$TMPE $TMPC -ldl
> /dev
/null
2>&1 ; then
894 if $cc -o
$TMPE $TMPC > /dev
/null
2>&1 ; then
899 if test "$vhook" = "default" ; then
903 ##########################################
907 #include <X11/Xlib.h>
909 int main( void ) { return (int) imlib_load_font("foo"); }
913 if $cc -o
$TMPE $TMPC -lImlib2
-lm
> /dev
/null
2>&1 ; then
917 ##########################################
921 #include <ft2build.h>
922 int main( void ) { return (int) FT_Init_FreeType(0); }
926 if test "x$targetos" != "xBeOS" && test "$os2" != "yes"; then
927 if (freetype-config
--version
) >/dev
/null
2>&1 ; then
928 if $cc -o
$TMPE $TMPC `freetype-config --cflags` `freetype-config --libs` > /dev
/null
2>&1 ; then
934 ##########################################
939 #undef main /* We don't want SDL to override our main() */
940 int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
945 if (sdl-config
--version
) >/dev
/null
2>&1 ; then
946 if $cc -o
$TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` > /dev
/null
2>&1 ; then
947 _sdlversion
=`sdl-config --version | sed 's/[^0-9]//g'`
948 if test "$_sdlversion" -lt
121 ; then
956 ##########################################
960 if (texi2html
-version
) >/dev
/null
2>&1; then
964 if test "$network" = "yes" ; then
965 ##########################################
969 #include <sys/types.h>
970 #include <sys/socket.h>
971 #include <netinet/in.h>
974 struct sockaddr_storage saddr;
975 struct ipv6_mreq mreq6;
976 getaddrinfo(0,0,0,0);
977 getnameinfo(0,0,0,0,0,0,0);
978 IN6_IS_ADDR_MULTICAST(0);
983 if $cc -o
$TMPE $TMPC > /dev
/null
2>&1 ; then
988 case "`$cc -v 2>&1 | grep version`" in
990 CFLAGS
="-Wall $CFLAGS"
996 if test "$sdl" = "no" ; then
1000 if test "$debug" = "yes"; then
1004 if test "$optimize" = "small"; then
1005 # CFLAGS=${CFLAGS//-O3/-Os}
1006 CFLAGS
="$CFLAGS -Os"
1009 if test "$optimize" = "yes"; then
1010 if test -n
"`$cc -v 2>&1 | grep xlc`"; then
1011 CFLAGS
="$CFLAGS -O5"
1012 LDFLAGS
="$LDFLAGS -O5"
1014 CFLAGS
="-O3 $CFLAGS"
1018 if test x
"$bindir" = x
""; then
1019 bindir
="${prefix}/bin"
1022 if test x
"$mandir" = x
""; then
1023 mandir
="${prefix}/man"
1026 echo "Install prefix $prefix"
1027 echo "Source path $source_path"
1028 echo "C compiler $cc"
1030 echo "CPU $cpu ($tune)"
1031 echo "Big Endian $bigendian"
1032 echo "inttypes.h $inttypes"
1033 echo "broken inttypes.h $emu_fast_int"
1034 if test $cpu = "x86" -o
$cpu = "x86_64"; then
1035 echo "MMX enabled $mmx"
1036 echo "Vector Builtins $builtin_vector"
1038 if test $cpu = "mips"; then
1039 echo "MMI enabled $mmi"
1041 if test $cpu = "powerpc"; then
1042 echo "AltiVec enabled $altivec"
1044 echo "gprof enabled $gprof"
1045 echo "zlib enabled $zlib"
1046 echo "mp3lame enabled $mp3lame"
1047 echo "vorbis enabled $vorbis"
1048 echo "faad enabled $faad"
1049 echo "faadbin enabled $faadbin"
1050 echo "faac enabled $faac"
1051 echo "xvid enabled $xvid"
1052 echo "a52 support $a52"
1053 echo "a52 dlopened $a52bin"
1054 echo "dts support $dts"
1055 echo "pp support $pp"
1056 echo "debug symbols $debug"
1057 echo "strip symbols $dostrip"
1058 echo "optimize $optimize"
1059 echo "shared pp $shared_pp"
1060 echo "Video hooking $vhook"
1061 echo "SDL support $sdl"
1062 if test $sdl_too_old = "yes"; then
1063 echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support"
1065 echo "risky / patent encumbered codecs $risky"
1067 if test "$vhook" = "yes" ; then
1068 echo "Imlib2 support $imlib2"
1069 echo "freetype support $freetype2"
1071 echo "Sun medialib support" $sunmlib
1072 echo "pthreads support" $pthreads
1073 echo "AMR-NB float support" $amr_nb
1074 echo "AMR-NB fixed support" $amr_nb_fixed
1075 echo "AMR-WB float support" $amr_wb
1076 echo "network support $network"
1077 if test "$network" = "yes" ; then
1078 echo "IPv6 support $ipv6"
1080 if test "$gpl" = "no" ; then
1081 echo "License: LGPL"
1086 echo "Creating config.mak and config.h"
1089 echo " $0 $FFMPEG_CONFIGURATION" >> config.log
1090 echo "# Automatically generated by configure - do not modify" > config.mak
1091 echo "/* Automatically generated by configure - do not modify */" > $TMPH
1092 echo "#define FFMPEG_CONFIGURATION "'"'"$FFMPEG_CONFIGURATION"'"' >> $TMPH
1094 echo "prefix=$prefix" >> config.mak
1095 echo "bindir=$bindir" >> config.mak
1096 echo "mandir=$mandir" >> config.mak
1097 echo "MAKE=$make" >> config.mak
1098 echo "CC=$cc" >> config.mak
1099 echo "AR=$ar" >> config.mak
1100 echo "RANLIB=$ranlib" >> config.mak
1101 if test "$dostrip" = "yes" ; then
1102 echo "STRIP=$strip" >> config.mak
1103 echo "INSTALLSTRIP=-s" >> config.mak
1105 echo "STRIP=echo ignoring strip" >> config.mak
1106 echo "INSTALLSTRIP=" >> config.mak
1109 # SHCFLAGS is a copy of CFLAGS without -mdynamic-no-pic. Used when building
1110 # shared modules on OS/X (vhook/Makefile).
1112 if test "$needmdynamicnopic" = yes; then
1113 CFLAGS
="$CFLAGS -mdynamic-no-pic"
1116 echo "OPTFLAGS=$CFLAGS" >> config.mak
1117 echo "SHCFLAGS=$SHCFLAGS">>config.mak
1118 echo "LDFLAGS=$LDFLAGS" >> config.mak
1119 echo "FFSLDFLAGS=$FFSLDFLAGS" >> config.mak
1120 echo "SHFLAGS=$SHFLAGS" >> config.mak
1121 echo "LIBPREF=$LIBPREF" >> config.mak
1122 echo "LIBSUF=$LIBSUF" >> config.mak
1123 echo "SLIBPREF=$SLIBPREF" >> config.mak
1124 echo "SLIBSUF=$SLIBSUF" >> config.mak
1125 echo "EXESUF=$EXESUF" >> config.mak
1126 echo "TARGET_OS=$TARGET_OS" >> config.mak
1127 if test "$cpu" = "x86" ; then
1128 echo "TARGET_ARCH_X86=yes" >> config.mak
1129 echo "#define ARCH_X86 1" >> $TMPH
1130 elif test "$cpu" = "x86_64" ; then
1131 echo "TARGET_ARCH_X86_64=yes" >> config.mak
1132 echo "#define ARCH_X86_64 1" >> $TMPH
1133 elif test "$cpu" = "armv4l" ; then
1134 echo "TARGET_ARCH_ARMV4L=yes" >> config.mak
1135 echo "#define ARCH_ARMV4L 1" >> $TMPH
1136 elif test "$cpu" = "alpha" ; then
1137 echo "TARGET_ARCH_ALPHA=yes" >> config.mak
1138 echo "#define ARCH_ALPHA 1" >> $TMPH
1139 elif test "$cpu" = "sparc64" ; then
1140 echo "TARGET_ARCH_SPARC64=yes" >> config.mak
1141 echo "#define ARCH_SPARC64 1" >> $TMPH
1142 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1143 echo "#define ARCH_SPARC 1" >> $TMPH
1144 elif test "$cpu" = "sparc" ; then
1145 echo "TARGET_ARCH_SPARC=yes" >> config.mak
1146 echo "#define ARCH_SPARC 1" >> $TMPH
1147 elif test "$cpu" = "powerpc" ; then
1148 echo "TARGET_ARCH_POWERPC=yes" >> config.mak
1149 echo "#define ARCH_POWERPC 1" >> $TMPH
1150 if test $POWERPCMODE = "32bits"; then
1151 echo "#define POWERPC_MODE_32BITS 1" >> $TMPH
1153 echo "#define POWERPC_MODE_64BITS 1" >> $TMPH
1155 if test "$powerpc_perf" = "yes"; then
1156 echo "#define POWERPC_PERFORMANCE_REPORT 1" >> $TMPH
1158 elif test "$cpu" = "mips" ; then
1159 echo "TARGET_ARCH_MIPS=yes" >> config.mak
1160 echo "#define ARCH_MIPS 1" >> $TMPH
1161 elif test "$cpu" = "sh4" ; then
1162 echo "TARGET_ARCH_SH4=yes" >> config.mak
1163 echo "#define ARCH_SH4 1" >> $TMPH
1165 echo "#define TUNECPU $TUNECPU" >> $TMPH
1166 if test "$bigendian" = "yes" ; then
1167 echo "WORDS_BIGENDIAN=yes" >> config.mak
1168 echo "#define WORDS_BIGENDIAN 1" >> $TMPH
1170 if test "$inttypes" != "yes" ; then
1171 echo "#define EMULATE_INTTYPES 1" >> $TMPH
1173 if test "$emu_fast_int" = "yes" ; then
1174 echo "#define EMULATE_FAST_INT 1" >> $TMPH
1176 if test "$mmx" = "yes" ; then
1177 echo "TARGET_MMX=yes" >> config.mak
1178 echo "#define HAVE_MMX 1" >> $TMPH
1179 echo "#define __CPU__ 586" >> $TMPH
1181 if test "$builtin_vector" = "yes" ; then
1182 echo "TARGET_BUILTIN_VECTOR=yes" >> config.mak
1183 echo "#define HAVE_BUILTIN_VECTOR 1" >> $TMPH
1185 if test "$mmi" = "yes" ; then
1186 echo "TARGET_MMI=yes" >> config.mak
1187 echo "#define HAVE_MMI 1" >> $TMPH
1189 if test "$altivec" = "yes" ; then
1190 echo "TARGET_ALTIVEC=yes" >> config.mak
1191 echo "#define HAVE_ALTIVEC 1" >> $TMPH
1192 echo "// Enable the next line to use the reference C code instead of AltiVec" >> $TMPH
1193 echo "// #define ALTIVEC_USE_REFERENCE_C_CODE 1" >> $TMPH
1194 if test "$_altivec_h" = "yes" ; then
1195 echo "#define HAVE_ALTIVEC_H 1" >> $TMPH
1197 echo "#undef HAVE_ALTIVEC_H" >> $TMPH
1200 if test "$gprof" = "yes" ; then
1201 echo "TARGET_GPROF=yes" >> config.mak
1202 echo "#define HAVE_GPROF 1" >> $TMPH
1204 if test "$localtime_r" = "yes" ; then
1205 echo "#define HAVE_LOCALTIME_R 1" >> $TMPH
1207 if test "$imlib2" = "yes" ; then
1208 echo "HAVE_IMLIB2=yes" >> config.mak
1210 if test "$freetype2" = "yes" ; then
1211 echo "HAVE_FREETYPE2=yes" >> config.mak
1213 if test "$sunmlib" = "yes" ; then
1214 echo "HAVE_MLIB=yes" >> config.mak
1215 echo "#define HAVE_MLIB 1" >> $TMPH
1216 extralibs
="$extralibs -lmlib"
1218 if test "$pthreads" = "yes" ; then
1219 echo "HAVE_PTHREADS=yes" >> config.mak
1220 echo "#define HAVE_PTHREADS 1" >> $TMPH
1221 echo "#define HAVE_THREADS 1" >> $TMPH
1222 if test $targetos != FreeBSD
; then
1223 extralibs
="$extralibs -lpthread"
1226 if test "$sdl" = "yes" ; then
1227 echo "CONFIG_SDL=yes" >> config.mak
1228 echo "SDL_LIBS=`sdl-config --libs`" >> config.mak
1229 echo "SDL_CFLAGS=`sdl-config --cflags`" >> config.mak
1231 if test "$texi2html" = "yes"; then
1232 echo "BUILD_DOC=yes" >> config.mak
1234 if test "$have_lrintf" = "yes" ; then
1235 echo "#define HAVE_LRINTF 1" >> $TMPH
1237 if test "$vhook" = "yes" ; then
1238 echo "BUILD_VHOOK=yes" >> config.mak
1239 echo "#define HAVE_VHOOK 1" >> $TMPH
1240 extralibs
="$extralibs $ldl"
1242 if test "$lshared" = "yes" ; then
1243 echo "BUILD_SHARED=yes" >> config.mak
1244 echo "PIC=-fPIC" >> config.mak
1246 echo "EXTRALIBS=$extralibs" >> config.mak
1247 version
=`grep '#define FFMPEG_VERSION ' $source_path/libavcodec/avcodec.h |
1249 echo "VERSION=$version" >>config.mak
1250 # if you do not want to use encoders, disable that.
1251 echo "#define CONFIG_ENCODERS 1" >> $TMPH
1252 echo "CONFIG_ENCODERS=yes" >> config.mak
1254 # if you do not want to use decoders, disable that.
1255 echo "#define CONFIG_DECODERS 1" >> $TMPH
1256 echo "CONFIG_DECODERS=yes" >> config.mak
1259 if test "$a52" = "yes" ; then
1260 echo "#define CONFIG_AC3 1" >> $TMPH
1261 echo "CONFIG_AC3=yes" >> config.mak
1263 if test "$a52bin" = "yes" ; then
1264 echo "#define CONFIG_A52BIN 1" >> $TMPH
1265 echo "CONFIG_A52BIN=yes" >> config.mak
1270 if test "$dts" = "yes" ; then
1271 echo "#define CONFIG_DTS 1" >> $TMPH
1272 echo "CONFIG_DTS=yes" >> config.mak
1276 if test "$pp" = "yes" ; then
1277 echo "#define CONFIG_PP 1" >> $TMPH
1278 echo "CONFIG_PP=yes" >> config.mak
1280 if test "$shared_pp" = "yes" ; then
1281 echo "#define SHARED_PP 1" >> $TMPH
1282 echo "SHARED_PP=yes" >> config.mak
1286 # mpeg audio high precision mode
1287 if test "$mpegaudio_hp" = "yes" ; then
1288 echo "#define CONFIG_MPEGAUDIO_HP 1" >> $TMPH
1291 if test "$v4l" = "yes" ; then
1292 echo "#define CONFIG_VIDEO4LINUX 1" >> $TMPH
1293 echo "CONFIG_VIDEO4LINUX=yes" >> config.mak
1296 if test "$dv1394" = "yes" ; then
1297 echo "#define CONFIG_DV1394 1" >> $TMPH
1298 echo "CONFIG_DV1394=yes" >> config.mak
1301 if test "$dc1394" = "yes" ; then
1302 echo "#define CONFIG_DC1394 1" >> $TMPH
1303 echo "CONFIG_DC1394=yes" >> config.mak
1306 if test "$dlopen" = "yes" ; then
1307 echo "#define CONFIG_HAVE_DLOPEN 1" >> $TMPH
1310 if test "$dlfcn" = "yes" ; then
1311 echo "#define CONFIG_HAVE_DLFCN 1" >> $TMPH
1314 if test "$audio_oss" = "yes" ; then
1315 echo "#define CONFIG_AUDIO_OSS 1" >> $TMPH
1316 echo "CONFIG_AUDIO_OSS=yes" >> config.mak
1319 if test "$audio_beos" = "yes" ; then
1320 echo "#define CONFIG_AUDIO_BEOS 1" >> $TMPH
1321 echo "CONFIG_AUDIO_BEOS=yes" >> config.mak
1324 if test "$network" = "yes" ; then
1325 echo "#define CONFIG_NETWORK 1" >> $TMPH
1326 echo "CONFIG_NETWORK=yes" >> config.mak
1329 if test "$ipv6" = "yes" ; then
1330 echo "#define CONFIG_IPV6 1" >> $TMPH
1333 if test "$zlib" = "yes" ; then
1334 echo "#define CONFIG_ZLIB 1" >> $TMPH
1335 echo "CONFIG_ZLIB=yes" >> config.mak
1338 if test "$mp3lame" = "yes" ; then
1339 echo "#define CONFIG_MP3LAME 1" >> $TMPH
1340 echo "CONFIG_MP3LAME=yes" >> config.mak
1343 if test "$vorbis" = "yes" ; then
1344 echo "#define CONFIG_VORBIS 1" >> $TMPH
1345 echo "CONFIG_VORBIS=yes" >> config.mak
1348 if test "$faad" = "yes" ; then
1349 echo "#define CONFIG_FAAD 1" >> $TMPH
1350 echo "CONFIG_FAAD=yes" >> config.mak
1353 if test "$faadbin" = "yes" ; then
1354 echo "#define CONFIG_FAADBIN 1" >> $TMPH
1355 echo "CONFIG_FAADBIN=yes" >> config.mak
1358 if test "$faac" = "yes" ; then
1359 echo "#define CONFIG_FAAC 1" >> $TMPH
1360 echo "CONFIG_FAAC=yes" >> config.mak
1363 if test "$xvid" = "yes" ; then
1364 echo "#define CONFIG_XVID 1" >> $TMPH
1365 echo "CONFIG_XVID=yes" >> config.mak
1368 if test "$mingw32" = "yes" ; then
1369 echo "#define CONFIG_WIN32 1" >> $TMPH
1370 echo "CONFIG_WIN32=yes" >> config.mak
1371 echo "HAVE_W32THREADS=yes" >> config.mak
1372 echo "#define HAVE_W32THREADS 1" >> $TMPH
1373 echo "#define HAVE_THREADS 1" >> $TMPH
1374 echo "#ifndef __MINGW32__" >> $TMPH
1375 echo "#define __MINGW32__ 1" >> $TMPH
1376 echo "#endif" >> $TMPH
1379 if test "$os2" = "yes" ; then
1380 echo "#define CONFIG_OS2 1" >> $TMPH
1381 echo "CONFIG_OS2=yes" >> config.mak
1384 if test "$TARGET_OS" = "SunOS" ; then
1385 echo "#define CONFIG_SUNOS 1" >> $TMPH
1388 if test "$TARGET_OS" = "BeOS" ; then
1389 echo "HAVE_BEOSTHREADS=yes" >> config.mak
1390 echo "#define HAVE_BEOSTHREADS 1" >> $TMPH
1391 echo "#define HAVE_THREADS 1" >> $TMPH
1394 if test "$darwin" = "yes"; then
1395 echo "#define CONFIG_DARWIN 1" >> $TMPH
1396 echo "CONFIG_DARWIN=yes" >> config.mak
1399 if test "$_malloc_h" = "yes" ; then
1400 echo "#define HAVE_MALLOC_H 1" >> $TMPH
1402 echo "#undef HAVE_MALLOC_H" >> $TMPH
1405 if test "$_memalign" = "yes" ; then
1406 echo "#define HAVE_MEMALIGN 1" >> $TMPH
1408 echo "#undef HAVE_MEMALIGN" >> $TMPH
1411 if test "$memalignhack" = "yes" ; then
1412 echo "#define MEMALIGN_HACK 1" >> $TMPH
1416 if test "$netserver" = "yes" ; then
1417 echo "#define CONFIG_BEOS_NETSERVER 1" >> $TMPH
1418 echo "CONFIG_BEOS_NETSERVER=yes" >> config.mak
1421 if test "$need_inet_aton" = "yes" ; then
1422 echo "NEED_INET_ATON=yes" >> config.mak
1425 if test "$simpleidct" = "yes" ; then
1426 echo "#define SIMPLE_IDCT 1" >> $TMPH
1429 if test "$ffserver" = "yes" ; then
1430 echo "#define CONFIG_FFSERVER 1" >> $TMPH
1431 echo "CONFIG_FFSERVER=yes" >> config.mak
1434 if test "$ffplay" = "yes" ; then
1435 echo "CONFIG_FFPLAY=yes" >> config.mak
1438 if test "$risky" = "yes" ; then
1439 echo "#define CONFIG_RISKY 1" >> $TMPH
1440 echo "CONFIG_RISKY=yes" >> config.mak
1443 if test "$gpl" = "yes" ; then
1444 echo "#define CONFIG_GPL 1" >> $TMPH
1445 echo "CONFIG_GPL=yes" >> config.mak
1448 echo "#define restrict $_restrict" >> $TMPH
1450 if test "$optimize" = "small"; then
1451 echo "#define always_inline" >> $TMPH
1454 # build tree in object directory if source path is different from current one
1455 if test "$source_path_used" = "yes" ; then
1456 DIRS
="libavformat libavcodec libavcodec/alpha libavcodec/armv4l libavcodec/i386 \
1457 libavcodec/ppc libavcodec/liba52 libavcodec/mlib libavcodec/libpostproc tests vhook"
1458 FILES
="Makefile libavformat/Makefile libavcodec/Makefile libavcodec/libpostproc/Makefile tests/Makefile vhook/Makefile"
1459 for dir
in $DIRS ; do
1462 for f
in $FILES ; do
1463 ln -sf
$source_path/$f $f
1466 echo "SRC_PATH=$source_path" >> config.mak
1468 if test "$amr_wb" = "yes" ; then
1469 echo "#define AMR_WB 1" >> $TMPH
1470 echo "AMR_WB=yes" >> config.mak
1472 echo "AMR WB FLOAT NOTICE ! Make sure you have downloaded TS26.204"
1474 echo "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-510.zip"
1475 echo "and extracted the source to libavcodec/amrwb_float"
1479 if test "$amr_nb" = "yes" ; then
1480 echo "#define AMR_NB 1" >> $TMPH
1481 echo "AMR_NB=yes" >> config.mak
1483 if test "$amr_nb_fixed" = "yes" ; then
1484 echo "AMR_NB_FIXED=yes" >> config.mak
1485 echo "#define AMR_NB_FIXED 1" >> $TMPH
1486 echo "AMR NB FIXED POINT NOTICE! Make sure you have downloaded TS26.073 "
1487 echo "REL-5 version 5.1.0 from "
1488 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26073-5??.zip"
1489 echo "and extracted src to libavcodec/amr"
1490 echo "You must also add -DMMS_IO and remove -pedantic-errors to/from CFLAGS in libavcodec/amr/makefile."
1491 echo "i.e. CFLAGS = -Wall -I. \$(CFLAGS_\$(MODE)) -D\$(VAD) -DMMS_IO"
1494 echo "AMR NB FLOAT NOTICE ! Make sure you have downloaded TS26.104"
1495 echo "REL-5 V5.1.0 from "
1496 echo "http://www.3gpp.org/ftp/Specs/latest/Rel-5/26_series/26104-5??.zip"
1497 echo "and extracted the source to libavcodec/amr_float"
1498 echo "and if u try this on an alpha, u may need to change Word32 to int in amr/typedef.h"
1504 diff $TMPH config.h
>/dev
/null
2>&1
1505 if test $?
-ne
0 ; then
1506 mv -f
$TMPH config.h
1508 echo "config.h is unchanged"
1511 rm -f
$TMPO $TMPC $TMPE $TMPS $TMPH