X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=configure;h=032fd5b4a58106feffc6d28fa98cb4d5c091f3a8;hb=9528ce7b996a0d31133b3df5e312760f4d4b825b;hp=94ceb533f253bacc33ccb8ac08dbab02990be75b;hpb=5baaf9adafe839c4ae9e7947c4d6c19329e469a7;p=ffmpeg diff --git a/configure b/configure index 94ceb533f25..032fd5b4a58 100755 --- a/configure +++ b/configure @@ -55,183 +55,188 @@ if test "$E1" != 0 || test "$E2" = 0; then fi show_help(){ - echo "Usage: configure [options]" - echo "Options: [defaults in brackets after descriptions]" - echo - echo "Standard options:" - echo " --help print this message" - echo " --logfile=FILE log tests and output to FILE [config.err]" - echo " --disable-logging do not log configure debug information" - echo " --prefix=PREFIX install in PREFIX [$prefix]" - echo " --bindir=DIR install binaries in DIR [PREFIX/bin]" - echo " --datadir=DIR install data files in DIR [PREFIX/share/ffmpeg]" - echo " --libdir=DIR install libs in DIR [PREFIX/lib]" - echo " --shlibdir=DIR install shared libs in DIR [PREFIX/lib]" - echo " --incdir=DIR install includes in DIR [PREFIX/include]" - echo " --mandir=DIR install man page in DIR [PREFIX/share/man]" - echo - echo "Configuration options:" - echo " --disable-static do not build static libraries [no]" - echo " --enable-shared build shared libraries [no]" - echo " --enable-gpl allow use of GPL code, the resulting libs" - echo " and binaries will be under GPL [no]" - echo " --enable-version3 upgrade (L)GPL to version 3 [no]" - echo " --enable-nonfree allow use of nonfree code, the resulting libs" - echo " and binaries will be unredistributable [no]" - echo " --disable-ffmpeg disable ffmpeg build" - echo " --disable-ffplay disable ffplay build" - echo " --disable-ffserver disable ffserver build" - echo " --enable-postproc enable GPLed postprocessing support [no]" - echo " --enable-avfilter video filter support [no]" - echo " --enable-avfilter-lavf video filters dependent on avformat [no]" - echo " --enable-beosthreads use BeOS threads [no]" - echo " --enable-os2threads use OS/2 threads [no]" - echo " --enable-pthreads use pthreads [no]" - echo " --enable-w32threads use Win32 threads [no]" - echo " --enable-x11grab enable X11 grabbing [no]" - echo " --disable-network disable network support [no]" - echo " --disable-ipv6 disable IPv6 support [no]" - echo " --disable-mpegaudio-hp faster (but less accurate) MPEG audio decoding [no]" - echo " --enable-gray enable full grayscale support (slower color)" - echo " --disable-swscale-alpha disable alpha channel support in swscale" - echo " --disable-fastdiv disable table-based division" - echo " --enable-small optimize for size instead of speed" - echo " --disable-aandct disable AAN DCT code" - echo " --disable-fft disable FFT code" - echo " --disable-golomb disable Golomb code" - echo " --disable-mdct disable MDCT code" - echo " --disable-rdft disable RDFT code" - echo " --disable-vaapi disable VAAPI code" - echo " --disable-vdpau disable VDPAU code" - echo " --enable-runtime-cpudetect detect cpu capabilities at runtime (bigger binary)" - echo " --enable-hardcoded-tables use hardcoded tables instead of runtime generation" - echo " --enable-memalign-hack emulate memalign, interferes with memory debuggers" - echo " --enable-beos-netserver enable BeOS netserver" - echo " --disable-encoder=NAME disable encoder NAME" - echo " --enable-encoder=NAME enable encoder NAME" - echo " --disable-encoders disable all encoders" - echo " --disable-decoder=NAME disable decoder NAME" - echo " --enable-decoder=NAME enable decoder NAME" - echo " --disable-decoders disable all decoders" - echo " --disable-hwaccel=NAME disable hwaccel NAME" - echo " --enable-hwaccel=NAME enable hwaccel NAME" - echo " --disable-hwaccels disable all hwaccels" - echo " --disable-muxer=NAME disable muxer NAME" - echo " --enable-muxer=NAME enable muxer NAME" - echo " --disable-muxers disable all muxers" - echo " --disable-demuxer=NAME disable demuxer NAME" - echo " --enable-demuxer=NAME enable demuxer NAME" - echo " --disable-demuxers disable all demuxers" - echo " --enable-parser=NAME enable parser NAME" - echo " --disable-parser=NAME disable parser NAME" - echo " --disable-parsers disable all parsers" - echo " --enable-bsf=NAME enable bitstream filter NAME" - echo " --disable-bsf=NAME disable bitstream filter NAME" - echo " --disable-bsfs disable all bitstream filters" - echo " --enable-protocol=NAME enable protocol NAME" - echo " --disable-protocol=NAME disable protocol NAME" - echo " --disable-protocols disable all protocols" - echo " --disable-indev=NAME disable input device NAME" - echo " --disable-outdev=NAME disable output device NAME" - echo " --disable-indevs disable input devices" - echo " --disable-outdevs disable output devices" - echo " --disable-devices disable all devices" - echo " --enable-filter=NAME enable filter NAME" - echo " --disable-filter=NAME disable filter NAME" - echo " --disable-filters disable all filters" - echo " --list-decoders show all available decoders" - echo " --list-encoders show all available encoders" - echo " --list-hwaccels show all available hardware accelerators" - echo " --list-muxers show all available muxers" - echo " --list-demuxers show all available demuxers" - echo " --list-parsers show all available parsers" - echo " --list-protocols show all available protocols" - echo " --list-bsfs show all available bitstream filters" - echo " --list-indevs show all available input devices" - echo " --list-outdevs show all available output devices" - echo " --list-filters show all available filters" - echo - echo "External library support:" - echo " --enable-avisynth enable reading of AVISynth script files [no]" - echo " --enable-bzlib enable bzlib [autodetect]" - echo " --enable-libopencore-amrnb enable AMR-NB de/encoding via libopencore-amrnb [no]" - echo " --enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]" - echo " --enable-libdc1394 enable IIDC-1394 grabbing using libdc1394" - echo " and libraw1394 [no]" - echo " --enable-libdirac enable Dirac support via libdirac [no]" - echo " --enable-libfaac enable FAAC support via libfaac [no]" - echo " --enable-libfaad enable FAAD support via libfaad [no]" - echo " --enable-libfaadbin open libfaad.so.0 at runtime [no]" - echo " --enable-libgsm enable GSM support via libgsm [no]" - echo " --enable-libmp3lame enable MP3 encoding via libmp3lame [no]" - echo " --enable-libnut enable NUT (de)muxing via libnut," - echo " native (de)muxer exists [no]" - echo " --enable-libopenjpeg enable JPEG 2000 decoding via OpenJPEG [no]" - echo " --enable-libschroedinger enable Dirac support via libschroedinger [no]" - echo " --enable-libspeex enable Speex decoding via libspeex [no]" - echo " --enable-libtheora enable Theora encoding via libtheora [no]" - echo " --enable-libvorbis enable Vorbis encoding via libvorbis," - echo " native implementation exists [no]" - echo " --enable-libx264 enable H.264 encoding via x264 [no]" - echo " --enable-libxvid enable Xvid encoding via xvidcore," - echo " native MPEG-4/Xvid encoder exists [no]" - echo " --enable-mlib enable Sun medialib [no]" - echo " --enable-zlib enable zlib [autodetect]" - echo "" - echo "Advanced options (experts only):" - echo " --source-path=PATH path to source code [$source_path]" - echo " --cross-prefix=PREFIX use PREFIX for compilation tools [$cross_prefix]" - echo " --enable-cross-compile assume a cross-compiler is used" - echo " --sysroot=PATH root of cross-build tree" - echo " --sysinclude=PATH location of cross-build system headers" - echo " --target-os=OS compiler targets OS [$target_os]" - echo " --target-exec=CMD command to run executables on target" - echo " --target-path=DIR path to view of build directory on target" - echo " --nm=NM use nm tool" - echo " --as=AS use assembler AS [$as_default]" - echo " --cc=CC use C compiler CC [$cc_default]" - echo " --ld=LD use linker LD" - echo " --host-cc=HOSTCC use host C compiler HOSTCC" - echo " --host-cflags=HCFLAGS use HCFLAGS when compiling for host" - echo " --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host" - echo " --host-libs=HLIBS use libs HLIBS when linking for host" - echo " --extra-cflags=ECFLAGS add ECFLAGS to CFLAGS [$CFLAGS]" - echo " --extra-ldflags=ELDFLAGS add ELDFLAGS to LDFLAGS [$LDFLAGS]" - echo " --extra-libs=ELIBS add ELIBS [$ELIBS]" - echo " --extra-version=STRING version string suffix []" - echo " --build-suffix=SUFFIX library name suffix []" - echo " --arch=ARCH select architecture [$arch]" - echo " --cpu=CPU select the minimum required CPU (affects" - echo " instruction selection, may crash on older CPUs)" - echo " --enable-powerpc-perf enable performance report on PPC" - echo " (requires enabling PMC)" - echo " --disable-altivec disable AltiVec optimizations" - echo " --disable-amd3dnow disable 3DNow! optimizations" - echo " --disable-amd3dnowext disable 3DNow! extended optimizations" - echo " --disable-mmx disable MMX optimizations" - echo " --disable-mmx2 disable MMX2 optimizations" - echo " --disable-sse disable SSE optimizations" - echo " --disable-ssse3 disable SSSE3 optimizations" - echo " --disable-armv5te disable armv5te optimizations" - echo " --disable-armv6 disable armv6 optimizations" - echo " --disable-armv6t2 disable armv6t2 optimizations" - echo " --disable-armvfp disable ARM VFP optimizations" - echo " --disable-iwmmxt disable iwmmxt optimizations" - echo " --disable-mmi disable MMI optimizations" - echo " --disable-neon disable neon optimizations" - echo " --disable-vis disable VIS optimizations" - echo " --disable-yasm disable use of yasm assembler" - echo " --enable-pic build position-independent code" - echo - echo "Developer options (useful when working on FFmpeg itself):" - echo " --disable-debug disable debugging symbols" - echo " --enable-debug=LEVEL set the debug level [$debuglevel]" - echo " --enable-gprof enable profiling with gprof [$gprof]" - echo " --disable-optimizations disable compiler optimizations" - echo " --enable-extra-warnings enable more compiler warnings" - echo " --disable-stripping disable stripping of executables and shared libraries" - echo "" - echo "NOTE: Object files are built at the place where configure is launched." +cat <> $makefile else echo "#define ${pfx}${ucname} 0" >> $header + echo "!${pfx}${ucname}=yes" >> $makefile fi done } @@ -570,10 +584,11 @@ check_as(){ check_asm(){ log check_asm "$@" name="$1" - asm="$2" + code="$2" shift 2 - check_as "$@" < #if !($condition) #error "unsatisfied condition: $condition" @@ -689,11 +710,7 @@ check_lib2(){ headers="$1" func="$2" shift 2 - temp_extralibs "$@" - check_func_headers "$headers" $func && add_extralibs "$@" - err=$? - restore_flags - return $err + check_func_headers "$headers" $func "$@" && add_extralibs "$@" } check_exec(){ @@ -731,18 +748,36 @@ check_type(){ headers=$1 type=$2 shift 2 - disable $type + disable_safe "$type" incs="" for hdr in $headers; do incs="$incs #include <$hdr>" done - check_cc "$@" <$member; +EOF +} + require(){ name="$1" header="$2" @@ -776,12 +811,32 @@ check_foo_config(){ return $err } +check_host_cc(){ + log check_host_cc "$@" + cat > $TMPC + log_file $TMPC + check_cmd $host_cc $host_cflags "$@" -c -o $TMPO $TMPC +} + +check_host_cflags(){ + log check_host_cflags "$@" + check_host_cc "$@" < "$file.tmp" && mv "$file.tmp" "$file" || rm "$file.tmp" } +cp_if_changed(){ + cmp -s "$1" "$2" && + echo "$2 is unchanged" || + cp -f "$1" "$2" +} + # CONFIG_LIST contains configurable options, while HAVE_LIST is for # system-dependent things. @@ -807,6 +862,7 @@ CONFIG_LIST=" avisynth beos_netserver bzlib + doc fastdiv ffmpeg ffplay @@ -835,6 +891,7 @@ CONFIG_LIST=" libvorbis libx264 libxvid + lpc mdct memalign_hack mlib @@ -906,14 +963,18 @@ ARCH_EXT_LIST=' vis ' +HAVE_LIST_PUB=' + bigendian +' + HAVE_LIST=" $ARCH_EXT_LIST + $HAVE_LIST_PUB $THREADS_LIST alsa_asoundlib_h altivec_h arpa_inet_h attribute_packed - bigendian bswap closesocket cmov @@ -929,10 +990,14 @@ HAVE_LIST=" dos_paths ebp_available ebx_available + exp2 + exp2f fast_64bit + fast_clz fast_cmov fast_unaligned fork + getaddrinfo gethrtime GetProcessTimes getrusage @@ -944,6 +1009,7 @@ HAVE_LIST=" libdc1394_2 llrint log2 + log2f loongson lrint lrintf @@ -963,6 +1029,8 @@ HAVE_LIST=" socklen_t soundcard_h poll_h + struct_addrinfo + struct_sockaddr_storage sys_mman_h sys_resource_h sys_select_h @@ -989,6 +1057,7 @@ CMDLINE_SELECT=" $ARCH_EXT_LIST $CONFIG_LIST $THREADS_LIST + asm cross_compile debug extra_warnings @@ -1041,30 +1110,41 @@ CMDLINE_APPEND=" # code dependency declarations # architecture extensions -altivec_deps="ppc" -amd3dnow_deps="mmx" -amd3dnowext_deps="amd3dnow" + armv5te_deps="arm" armv6_deps="arm" armv6t2_deps="arm" armvfp_deps="arm" iwmmxt_deps="arm" +neon_deps="arm" + mmi_deps="mips" + +altivec_deps="ppc" +ppc4xx_deps="ppc" + +vis_deps="sparc" + +x86_64_select="cmov fast_cmov" +amd3dnow_deps="mmx" +amd3dnowext_deps="amd3dnow" mmx_deps="x86" mmx2_deps="mmx" -neon_deps="arm" -ppc4xx_deps="ppc" sse_deps="mmx" ssse3_deps="sse" -vis_deps="sparc" + +fast_64bit_if_any="alpha ia64 mips64 parisc64 ppc64 sparc64 x86_64" +fast_clz_if_any="alpha armv5te avr32 mips ppc x86" +fast_unaligned_if_any="armv6 ppc x86" need_memalign="altivec neon sse" inline_asm_deps="!tms470" # decoders / encoders / hardware accelerators -aac_decoder_select="fft mdct" +aac_decoder_select="fft mdct aac_parser" aac_encoder_select="fft mdct" -ac3_decoder_select="fft mdct" +ac3_decoder_select="fft mdct ac3_parser" +alac_encoder_select="lpc" atrac3_decoder_select="fft mdct" cavs_decoder_select="golomb" cook_decoder_select="fft mdct" @@ -1078,14 +1158,17 @@ eatgq_decoder_select="aandct" eatqi_decoder_select="aandct" ffv1_decoder_select="golomb" flac_decoder_select="golomb" -flac_encoder_select="golomb" +flac_encoder_select="golomb lpc" flashsv_decoder_select="zlib" flashsv_encoder_select="zlib" +flv_decoder_select="h263_decoder" flv_encoder_select="h263_encoder" h261_encoder_select="aandct" +h263_decoder_select="h263_parser" h263_encoder_select="aandct" h263_vaapi_hwaccel_deps="va_va_h" h263_vaapi_hwaccel_select="vaapi h263_decoder" +h263i_decoder_select="h263_decoder" h263p_encoder_select="h263_encoder" h264_decoder_select="golomb" h264_vaapi_hwaccel_deps="va_va_h" @@ -1098,8 +1181,10 @@ jpegls_encoder_select="golomb" ljpeg_encoder_select="aandct" loco_decoder_select="golomb" mjpeg_encoder_select="aandct" +mlp_decoder_select="mlp_parser" mpeg1video_encoder_select="aandct" mpeg2video_encoder_select="aandct" +mpeg4_decoder_select="h263_decoder mpeg4video_parser" mpeg4_encoder_select="h263_encoder" mpeg_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h" mpeg_vdpau_decoder_select="vdpau mpegvideo_decoder" @@ -1109,17 +1194,24 @@ mpeg2_vaapi_hwaccel_deps="va_va_h" mpeg2_vaapi_hwaccel_select="vaapi mpeg2video_decoder" mpeg4_vaapi_hwaccel_deps="va_va_h" mpeg4_vaapi_hwaccel_select="vaapi mpeg4_decoder" +mpeg4_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h" +mpeg4_vdpau_decoder_select="vdpau mpeg4_decoder" mpeg_xvmc_decoder_deps="X11_extensions_XvMClib_h" mpeg_xvmc_decoder_select="mpegvideo_decoder" +msmpeg4v1_decoder_select="h263_decoder" msmpeg4v1_encoder_select="h263_encoder" +msmpeg4v2_decoder_select="h263_decoder" msmpeg4v2_encoder_select="h263_encoder" +msmpeg4v3_decoder_select="h263_decoder" msmpeg4v3_encoder_select="h263_encoder" nellymoser_decoder_select="fft mdct" nellymoser_encoder_select="fft mdct" png_decoder_select="zlib" png_encoder_select="zlib" qdm2_decoder_select="fft mdct rdft" +rv10_decoder_select="h263_decoder" rv10_encoder_select="h263_encoder" +rv20_decoder_select="h263_decoder" rv20_encoder_select="h263_encoder" rv30_decoder_select="golomb" rv40_decoder_select="golomb" @@ -1132,7 +1224,9 @@ svq3_decoder_suggest="zlib" theora_decoder_select="vp3_decoder" tiff_decoder_suggest="zlib" tiff_encoder_suggest="zlib" +truehd_decoder_select="mlp_decoder" tscc_decoder_select="zlib" +vc1_decoder_select="h263_decoder" vc1_vaapi_hwaccel_deps="va_va_h" vc1_vaapi_hwaccel_select="vaapi vc1_decoder" vc1_vdpau_decoder_deps="vdpau_vdpau_h vdpau_vdpau_x11_h" @@ -1145,7 +1239,9 @@ wmav1_decoder_select="fft mdct" wmav1_encoder_select="fft mdct" wmav2_decoder_select="fft mdct" wmav2_encoder_select="fft mdct" +wmv1_decoder_select="h263_decoder" wmv1_encoder_select="h263_encoder" +wmv2_decoder_select="h263_decoder" wmv2_encoder_select="h263_encoder" wmv3_decoder_select="vc1_decoder" wmv3_vaapi_hwaccel_select="vc1_vaapi_hwaccel" @@ -1158,6 +1254,9 @@ zmbv_encoder_select="zlib" # parsers h264_parser_select="golomb" +# bitstream_filters +aac_adtstoasc_bsf_select="aac_parser" + # external libraries libdirac_decoder_deps="libdirac !libschroedinger" libdirac_encoder_deps="libdirac" @@ -1186,6 +1285,7 @@ ac3_demuxer_deps="ac3_parser" asf_stream_muxer_select="asf_muxer" avisynth_demuxer_deps="avisynth" dirac_demuxer_deps="dirac_parser" +eac3_demuxer_select="ac3_parser" ipod_muxer_select="mov_muxer" libnut_demuxer_deps="libnut" libnut_muxer_deps="libnut" @@ -1196,11 +1296,11 @@ mp3_demuxer_deps="mpegaudio_parser" mp4_muxer_select="mov_muxer" mpegtsraw_demuxer_select="mpegts_demuxer" mxf_d10_muxer_select="mxf_muxer" +ogg_demuxer_select="golomb" psp_muxer_select="mov_muxer" -redir_demuxer_deps="network" -rtp_muxer_deps="network rtp_protocol" rtsp_demuxer_deps="sdp_demuxer" sdp_demuxer_deps="rtp_protocol mpegts_demuxer" +spdif_muxer_select="aac_parser" tg2_muxer_select="mov_muxer" tgp_muxer_select="mov_muxer" w64_demuxer_deps="wav_demuxer" @@ -1226,7 +1326,7 @@ v4l2_indev_deps_any="linux_videodev2_h sys_videoio_h" vfwcap_indev_deps="capCreateCaptureWindow" vfwcap_indev_extralibs="-lvfw32" x11_grab_device_indev_deps="x11grab XShmCreateImage" -x11_grab_device_indev_extralibs="-lX11 -lXext" +x11_grab_device_indev_extralibs="-lX11 -lXext -lXfixes" # protocols gopher_protocol_deps="network" @@ -1244,6 +1344,7 @@ ffplay_deps="sdl" ffserver_deps="ffm_muxer rtp_protocol rtsp_demuxer" ffserver_extralibs='$ldl' +doc_deps="texi2html" # default parameters @@ -1279,7 +1380,9 @@ target_os=$(tolower $(uname -s)) host_os=$target_os # configurable options +enable asm enable debug +enable doc enable fastdiv enable ffmpeg enable ffplay @@ -1309,7 +1412,7 @@ LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"' CC_O='-o $@' -host_cflags='-O3 -g -Wall' +host_cflags='-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -O3 -g -Wall' host_libs='-lm' target_path='.' @@ -1494,6 +1597,7 @@ tmpfile TMPE $EXESUF tmpfile TMPH .h tmpfile TMPO .o tmpfile TMPS .S +tmpfile TMPV .ver tmpfile TMPSH .sh unset -f mktemp @@ -1586,6 +1690,51 @@ elif $cc -version 2>/dev/null | grep -q TMS470; then esac done } +elif $cc -v 2>&1 | grep -q clang; then + cc_type=clang + cc_version=__VERSION__ + CC_DEPFLAGS='-MMD' + AS_DEPFLAGS='-MMD' +elif $cc -V 2>&1 | grep -q Sun; then + cc_type=suncc + cc_version="AV_STRINGIFY(__SUNPRO_C)" + DEPEND_CMD='$(DEPCC) $(DEPFLAGS) $< | sed -e "1s,^.*: ,$@: ," -e "\$$!s,\$$, \\\," -e "1!s,^.*: , ," > $(@:.o=.d)' + DEPFLAGS='$(CPPFLAGS) $(CFLAGS) -xM1' + filter_cflags=suncc_flags + suncc_flags(){ + for flag; do + case $flag in + -march=*|-mcpu=*) + case "${flag#*=}" in + native) echo -xtarget=native ;; + v9) echo -xarch=sparc ;; + ultrasparc) echo -xarch=sparcvis ;; + ultrasparc3|niagara*) echo -xarch=sparcvis2 ;; + i586|pentium) echo -xchip=pentium ;; + i686|pentiumpro|pentium2) echo -xtarget=pentium_pro ;; + pentium3*|c3-2) echo -xtarget=pentium3 ;; + pentium-m) echo -xarch=sse2 -xchip=pentium3 ;; + pentium4*) echo -xtarget=pentium4 ;; + prescott|nocona) echo -xarch=sse3 -xchip=pentium4 ;; + *-sse3) echo -xarch=sse3 ;; + core2) echo -xarch=ssse3 -xchip=core2 ;; + amdfam10|barcelona) echo -xarch=sse4_1 ;; + athlon-4|athlon-[mx]p) echo -xarch=ssea ;; + k8|opteron|athlon64|athlon-fx) + echo -xarch=sse2a ;; + athlon*) echo -xarch=pentium_proa ;; + esac + ;; + -std=c99) echo -xc99 ;; + -fomit-frame-pointer) echo -xregs=frameptr ;; + -fPIC) echo -KPIC -xcode=pic32 ;; + -Os) echo -O5 -xspace ;; + -W*,*) echo $flag ;; + -f*-*|-W*) ;; + *) echo $flag ;; + esac + done + } fi test -n "$cc_type" && enable $cc_type || echolog "Unknown C compiler $cc" @@ -1611,6 +1760,10 @@ if test -n "$sysroot"; then add_cppflags -I"$sysinclude" add_ldflags --sysroot="$sysroot" ;; + clang) + add_cppflags -isysroot="$sysroot" + add_ldflags -isysroot="$sysroot" + ;; esac fi @@ -1630,99 +1783,163 @@ if test "$cpu" = host; then test "${cpu:-host}" = host && die "--cpu=host not supported with compiler $cc" fi -# Add processor-specific flags -case $cpu in - 601|ppc601|PowerPC601) - cpuflags="-mcpu=601" - ;; - 603*|ppc603*|PowerPC603*) - cpuflags="-mcpu=603" - ;; - 604*|ppc604*|PowerPC604*) - cpuflags="-mcpu=604" - ;; - G3|g3|75*|ppc75*|PowerPC75*) - cpuflags="-mcpu=750 -mpowerpc-gfxopt" - ;; - G4|g4|745*|ppc745*|PowerPC745*) - cpuflags="-mcpu=7450 -mpowerpc-gfxopt" - ;; - 74*|ppc74*|PowerPC74*) - cpuflags="-mcpu=7400 -mpowerpc-gfxopt" - ;; - G5|g5|970|ppc970|PowerPC970|power4*|Power4*) - cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64" - ;; - Cell|CELL|cell) - cpuflags="-mcpu=cell" - enable ldbrx - ;; - # targets that do NOT support conditional mov (cmov) - i[345]86|pentium|pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3) - cpuflags="-march=$cpu" - disable cmov - ;; - # targets that do support conditional mov (cmov) - i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2) - cpuflags="-march=$cpu" - enable cmov - enable fast_cmov - ;; - # targets that do support conditional mov but on which it's slow - pentium4|pentium4m|prescott|nocona) - cpuflags="-march=$cpu" - enable cmov - disable fast_cmov - ;; - sparc64) - cpuflags="-mcpu=v9" - ;; - arm11*|cortex*) - cpuflags="-mcpu=$cpu" - enable fast_unaligned - ;; - armv[67]*) - cpuflags="-march=$cpu" - enable fast_unaligned - ;; - armv*) - cpuflags="-march=$cpu" - ;; +# Deal with common $arch aliases +case "$arch" in arm*) - cpuflags="-mcpu=$cpu" + arch="arm" ;; - ev4|ev45|ev5|ev56|pca56|ev6|ev67) - enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu" + mips|mipsel|IP*) + arch="mips" ;; - bf*) - cpuflags="-mcpu=$cpu" + mips64) + arch="mips" + subarch="mips64" + ;; + parisc|hppa) + arch="parisc" ;; - mips*|[45]k*|[237]4k*|m4k|r*000|loongson2[ef]) - cpuflags="-march=$cpu" + parisc64|hppa64) + arch="parisc" + subarch="parisc64" ;; - ap7[02]0[0-2]) - subarch="avr32_ap" - cpuflags="-mpart=$cpu" + "Power Macintosh"|ppc|powerpc) + arch="ppc" ;; - ap) - subarch="avr32_ap" - cpuflags="-march=$cpu" + ppc64) + arch="ppc" + subarch="ppc64" ;; - uc3[ab]*) - subarch="avr32_uc" - cpuflags="-mcpu=$cpu" + s390|s390x) + arch="s390" ;; - uc) - subarch="avr32_uc" - cpuflags="-march=$cpu" + sh4|sh) + arch="sh4" ;; - generic) + sun4u|sparc64) + arch="sparc" + subarch="sparc64" ;; - *) - echo "WARNING: Unknown CPU \"$cpu\", ignored." + i[3-6]86|i86pc|BePC|x86_64|amd64) + arch="x86" ;; esac +is_in $arch $ARCH_LIST || echo "WARNING: unknown arch $arch" +enable $arch + +# Add processor-specific flags +if test "$cpu" = generic; then + : do nothing +elif enabled ppc; then + + case $cpu in + 601|ppc601|PowerPC601) + cpuflags="-mcpu=601" + ;; + 603*|ppc603*|PowerPC603*) + cpuflags="-mcpu=603" + ;; + 604*|ppc604*|PowerPC604*) + cpuflags="-mcpu=604" + ;; + G3|g3|75*|ppc75*|PowerPC75*) + cpuflags="-mcpu=750 -mpowerpc-gfxopt" + ;; + G4|g4|745*|ppc745*|PowerPC745*) + cpuflags="-mcpu=7450 -mpowerpc-gfxopt" + ;; + 74*|ppc74*|PowerPC74*) + cpuflags="-mcpu=7400 -mpowerpc-gfxopt" + ;; + G5|g5|970|ppc970|PowerPC970|power4*|Power4*) + cpuflags="-mcpu=970 -mpowerpc-gfxopt -mpowerpc64" + ;; + Cell|CELL|cell) + cpuflags="-mcpu=cell" + enable ldbrx + ;; + esac + +elif enabled x86; then + + case $cpu in + i[345]86|pentium) + cpuflags="-march=$cpu" + disable mmx + ;; + # targets that do NOT support conditional mov (cmov) + pentium-mmx|k6|k6-[23]|winchip-c6|winchip2|c3) + cpuflags="-march=$cpu" + disable cmov + ;; + # targets that do support conditional mov (cmov) + i686|pentiumpro|pentium[23]|pentium-m|athlon|athlon-tbird|athlon-4|athlon-[mx]p|athlon64|k8|opteron|athlon-fx|core2|amdfam10) + cpuflags="-march=$cpu" + enable cmov + enable fast_cmov + ;; + # targets that do support conditional mov but on which it's slow + pentium4|pentium4m|prescott|nocona) + cpuflags="-march=$cpu" + enable cmov + disable fast_cmov + ;; + esac + +elif enabled sparc; then + + case $cpu in + sparc64) + cpuflags="-mcpu=v9" + ;; + esac + +elif enabled arm; then + + case $cpu in + armv*) + cpuflags="-march=$cpu" + ;; + *) + cpuflags="-mcpu=$cpu" + ;; + esac + +elif enabled alpha; then + + enabled ccc && cpuflags="-arch $cpu" || cpuflags="-mcpu=$cpu" + +elif enabled bfin; then + + cpuflags="-mcpu=$cpu" + +elif enabled mips; then + + cpuflags="-march=$cpu" + +elif enabled avr32; then + + case $cpu in + ap7[02]0[0-2]) + subarch="avr32_ap" + cpuflags="-mpart=$cpu" + ;; + ap) + subarch="avr32_ap" + cpuflags="-march=$cpu" + ;; + uc3[ab]*) + subarch="avr32_uc" + cpuflags="-mcpu=$cpu" + ;; + uc) + subarch="avr32_uc" + cpuflags="-march=$cpu" + ;; + esac + +fi + add_cflags $cpuflags add_asflags $cpuflags @@ -1748,104 +1965,31 @@ check_cc -D_LARGEFILE_SOURCE < EOF +check_host_cflags -std=c99 + case "$arch" in - alpha) - arch="alpha" - enable fast_64bit - check_cflags -mieee + alpha|ia64|mips|parisc|sparc) spic=$shared ;; - arm|armv[4567]*l) - arch="arm" - ;; - avr32) - ;; - bfin) - arch="bfin" - ;; - ia64) - arch="ia64" - enable fast_64bit - spic=$shared - ;; - m68k) - arch="m68k" - ;; - mips|mipsel|IP*) - arch="mips" - spic=$shared - ;; - mips64) - arch="mips" - subarch="mips64" - enable fast_64bit - spic=$shared - ;; - parisc|hppa) - arch="parisc" - spic=$shared - ;; - parisc64|hppa64) - arch="parisc" - enable fast_64bit - spic=$shared - ;; - "Power Macintosh"|ppc|powerpc) - arch="ppc" - enable fast_unaligned - ;; - ppc64) - arch="ppc" - subarch="ppc64" - enable fast_64bit - enable fast_unaligned - ;; - s390|s390x) - arch="s390" - ;; - sh4|sh) - arch="sh4" - ;; - sparc) - arch="sparc" - spic=$shared - ;; - sun4u|sparc64) - arch="sparc" - subarch="sparc64" - enable fast_64bit - spic=$shared - ;; - i386|i486|i586|i686|i86pc|BePC) - arch="x86" + x86) subarch="x86_32" - enable fast_unaligned - ;; - x86_64|amd64) - arch="x86" - subarch="x86_32" - enable cmov - enable fast_cmov - enable fast_unaligned - check_cc < 4MB and shared libs are built + enabled shared && enable_weak hardcoded_tables + elif enabled mips; then check_asm loongson '"dmult.g $1, $2, $3"' @@ -2117,7 +2285,7 @@ elif enabled ppc; then check_asm dcbzl '"dcbzl 0, 1"' check_asm ppc4xx '"maclhw r10, r11, r12"' - check_asm xform_asm '"lwzx 0, %y0" :: "Z"(*(int*)0)' + check_asm xform_asm '"lwzx %1, %y0" :: "Z"(*(int*)0), "r"(0)' # AltiVec flags: The FSF version of GCC differs from the Apple version if enabled altivec; then @@ -2162,7 +2330,8 @@ elif enabled x86; then EOF # check whether EBX is available on x86 - check_asm ebx_available '""::"b"(0)' + check_asm ebx_available '""::"b"(0)' && + check_asm ebx_available '"":::"%ebx"' # check whether more than 10 operands are supported check_cc <= 76" || - die "ERROR: libx264 version must be >= 0.76."; } + { check_cpp_condition x264.h "X264_BUILD >= 83" || + die "ERROR: libx264 version must be >= 0.83."; } enabled libxvid && require libxvid xvid.h xvid_global -lxvidcore enabled mlib && require mediaLib mlib_types.h mlib_VectorSub_S16_U8_Mod -lmlib @@ -2306,36 +2484,22 @@ if enabled libdc1394; then die "ERROR: No version of libdc1394 found " fi -disable sdl_too_old -disable sdl SDL_CONFIG="${cross_prefix}sdl-config" if "${SDL_CONFIG}" --version > /dev/null 2>&1; then sdl_cflags=$("${SDL_CONFIG}" --cflags) - temp_cflags $sdl_cflags - temp_extralibs $("${SDL_CONFIG}" --libs) - if check_lib2 SDL.h SDL_Init; then - _sdlversion=$("${SDL_CONFIG}" --version | sed 's/[^0-9]//g') - if test "$_sdlversion" -lt 121 ; then - enable sdl_too_old - else - enable sdl - check_cc $sdl_cflags < -int main(int argc, char **argv){ - const SDL_VideoInfo *vi = SDL_GetVideoInfo(); - int w = vi->current_w; - return 0; -} -EOF - fi - fi - restore_flags + sdl_libs=$("${SDL_CONFIG}" --libs) + check_func_headers SDL.h SDL_Init $sdl_cflags $sdl_libs && + check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x010201" $sdl_cflags && + enable sdl && + check_struct SDL.h SDL_VideoInfo current_w $sdl_cflags && enable sdl_video_size fi texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html if enabled network; then check_type "sys/types.h sys/socket.h" socklen_t + check_type netdb.h "struct addrinfo" + check_type "sys/types.h sys/socket.h" "struct sockaddr_storage" # Prefer arpa/inet.h over winsock2 if check_header arpa/inet.h ; then check_func closesocket @@ -2345,6 +2509,8 @@ if enabled network; then { check_func_headers winsock2.h closesocket -lws2_32 && \ network_extralibs="-lws2_32"; } check_type ws2tcpip.h socklen_t + check_type ws2tcpip.h "struct addrinfo" + check_type ws2tcpip.h "struct sockaddr_storage" else disable network fi @@ -2389,8 +2555,17 @@ enabled jack_indev && check_lib2 jack/jack.h jack_client_open -ljack enabled x11grab && check_header X11/Xlib.h && check_header X11/extensions/XShm.h && +check_header X11/extensions/Xfixes.h && check_func XOpenDisplay -lX11 && -check_func XShmCreateImage -lX11 -lXext +check_func XShmCreateImage -lX11 -lXext && +check_func XFixesGetCursorImage -lX11 -lXext -lXfixes + +if ! disabled vdpau && enabled vdpau_vdpau_h; then +check_cpp_condition \ + vdpau/vdpau.h "defined VDP_DECODER_PROFILE_MPEG4_PART2_ASP" || + { echolog "Please upgrade to libvdpau >= 0.2 if you would like vdpau support." && + disable vdpau; } +fi enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" @@ -2414,6 +2589,10 @@ check_ldflags -Wl,--as-needed check_ldflags '-Wl,-rpath-link,\$(BUILD_ROOT)/libpostproc -Wl,-rpath-link,\$(BUILD_ROOT)/libswscale -Wl,-rpath-link,\$(BUILD_ROOT)/libavfilter -Wl,-rpath-link,\$(BUILD_ROOT)/libavdevice -Wl,-rpath-link,\$(BUILD_ROOT)/libavformat -Wl,-rpath-link,\$(BUILD_ROOT)/libavcodec -Wl,-rpath-link,\$(BUILD_ROOT)/libavutil' check_ldflags -Wl,-Bsymbolic +echo "X{};" > $TMPV +test_ldflags -Wl,--version-script,$TMPV && + append SHFLAGS '-Wl,--version-script,\$(SUBDIR)lib\$(NAME).ver' + if enabled small; then check_cflags -Os # not all compilers support -Os optimizations="small" @@ -2421,6 +2600,8 @@ elif enabled optimizations; then if enabled xlc; then add_cflags -O5 add_ldflags -O5 + elif enabled suncc; then + add_cflags -O5 elif enabled ccc; then add_cflags -fast else @@ -2455,6 +2636,8 @@ elif enabled ccc; then add_cflags -msg_disable unreachcode elif enabled gcc; then check_cflags -fno-tree-vectorize +elif enabled clang; then + check_cflags -Qunused-arguments fi if enabled gprof; then @@ -2493,6 +2676,8 @@ check_deps $CONFIG_LIST \ $OUTDEV_LIST \ $PROTOCOL_LIST \ +enabled asm || disable $ARCH_LIST $ARCH_EXT_LIST + echo "install prefix $prefix" echo "source path $source_path" echo "C compiler $cc" @@ -2555,9 +2740,6 @@ if enabled network; then fi echo "threading support ${thread_type-no}" echo "SDL support ${sdl-no}" -if enabled sdl_too_old; then - echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support." -fi echo "Sun medialib support ${mlib-no}" echo "AVISynth enabled ${avisynth-no}" echo "libdc1394 support ${libdc1394-no}" @@ -2605,71 +2787,106 @@ echo "License: $license" echo "Creating config.mak and config.h..." -echo "# Automatically generated by configure - do not modify!" > config.mak -echo "ifndef FFMPEG_CONFIG_MAK" >> config.mak -echo "FFMPEG_CONFIG_MAK=1" >> config.mak - -echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak -echo "prefix=$prefix" >> config.mak -echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak -echo "SHLIBDIR=\$(DESTDIR)$shlibdir" >> config.mak -echo "INCDIR=\$(DESTDIR)$incdir" >> config.mak -echo "BINDIR=\$(DESTDIR)$bindir" >> config.mak -echo "DATADIR=\$(DESTDIR)$datadir" >> config.mak -echo "MANDIR=\$(DESTDIR)$mandir" >> config.mak -echo "SRC_PATH=\"$source_path\"" >> config.mak -echo "SRC_PATH_BARE=$source_path" >> config.mak -echo "BUILD_ROOT=\"$PWD\"" >> config.mak -echo "CC=$cc" >> config.mak -echo "AS=$as" >> config.mak -echo "LD=$ld" >> config.mak -echo "DEPCC=$dep_cc" >> config.mak -echo "YASM=$yasmexe" >> config.mak -echo "AR=$ar" >> config.mak -echo "RANLIB=$ranlib" >> config.mak -echo "LN_S=$ln_s" >> config.mak -enabled stripping && - echo "STRIP=$strip" >> config.mak || - echo "STRIP=echo ignoring strip" >> config.mak - -echo "CPPFLAGS=$CPPFLAGS" >> config.mak -echo "CFLAGS=$CFLAGS" >> config.mak -echo "ASFLAGS=$ASFLAGS" >> config.mak -echo "CC_O=$CC_O" >> config.mak -echo "LDFLAGS=$LDFLAGS" >> config.mak -echo "FFSERVERLDFLAGS=$FFSERVERLDFLAGS" >> config.mak -echo "SHFLAGS=$SHFLAGS" >> config.mak -echo "YASMFLAGS=$YASMFLAGS" >> config.mak -echo "BUILDSUF=$build_suffix" >> config.mak -echo "FULLNAME=$FULLNAME" >> config.mak -echo "LIBPREF=$LIBPREF" >> config.mak -echo "LIBSUF=$LIBSUF" >> config.mak -echo "LIBNAME=$LIBNAME" >> config.mak -echo "SLIBPREF=$SLIBPREF" >> config.mak -echo "SLIBSUF=$SLIBSUF" >> config.mak -echo "EXESUF=$EXESUF" >> config.mak -echo "EXTRA_VERSION=$extra_version" >> config.mak -echo "DEPFLAGS=$DEPFLAGS" >> config.mak -echo "CCDEP=$CCDEP" >> config.mak -echo "ASDEP=$ASDEP" >> config.mak -echo "CC_DEPFLAGS=$CC_DEPFLAGS" >> config.mak -echo "AS_DEPFLAGS=$AS_DEPFLAGS" >> config.mak -echo "HOSTCC=$host_cc" >> config.mak -echo "HOSTCFLAGS=$host_cflags" >> config.mak -echo "HOSTEXESUF=$HOSTEXESUF" >> config.mak -echo "HOSTLDFLAGS=$host_ldflags" >> config.mak -echo "HOSTLIBS=$host_libs" >> config.mak -echo "TARGET_EXEC=$target_exec" >> config.mak -echo "TARGET_PATH=$target_path" >> config.mak - -if enabled sdl; then - echo "SDL_LIBS=$("${SDL_CONFIG}" --libs)" >> config.mak - echo "SDL_CFLAGS=$("${SDL_CONFIG}" --cflags)" >> config.mak -fi -if enabled texi2html; then - echo "BUILD_DOC=yes" >> config.mak +# build tree in object directory if source path is different from current one +if enabled source_path_used; then + DIRS=" + doc + libavcodec + libavcodec/$arch + libavdevice + libavfilter + libavformat + libavutil + libavutil/$arch + libpostproc + libswscale + libswscale/$arch + tests + tools + " + FILES=" + Makefile + common.mak + subdir.mak + doc/texi2pod.pl + libavcodec/Makefile + libavdevice/Makefile + libavfilter/Makefile + libavformat/Makefile + libavutil/Makefile + libpostproc/Makefile + libswscale/Makefile + " + for dir in $DIRS ; do + mkdir -p $dir + done + for f in $FILES ; do + $ln_s "$source_path/$f" $f + done fi +enabled stripping || strip="echo skipping strip" + +cat > config.mak <> config.mak - echo "SLIBNAME=${SLIBNAME}" >> config.mak - echo "SLIBNAME_WITH_VERSION=${SLIBNAME_WITH_VERSION}" >> config.mak - echo "SLIBNAME_WITH_MAJOR=${SLIBNAME_WITH_MAJOR}" >> config.mak - echo "SLIB_CREATE_DEF_CMD=${SLIB_CREATE_DEF_CMD}" >> config.mak - echo "SLIB_EXTRA_CMD=${SLIB_EXTRA_CMD}" >> config.mak - echo "SLIB_INSTALL_EXTRA_CMD=${SLIB_INSTALL_EXTRA_CMD}" >> config.mak - echo "SLIB_UNINSTALL_EXTRA_CMD=${SLIB_UNINSTALL_EXTRA_CMD}" >> config.mak -fi -echo "LIB_INSTALL_EXTRA_CMD=${LIB_INSTALL_EXTRA_CMD}" >> config.mak -echo "EXTRALIBS=$extralibs" >> config.mak - -echo "ARCH=$arch" >> config.mak - - -echo "/* Automatically generated by configure - do not modify! */" > $TMPH -echo "#ifndef FFMPEG_CONFIG_H" >> $TMPH -echo "#define FFMPEG_CONFIG_H" >> $TMPH -echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH -echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH +enabled shared && cat >> config.mak <> $TMPH -echo "#define CC_VERSION $cc_version" >> $TMPH -echo "#define restrict $_restrict" >> $TMPH +enabled asmalign_pot || align_shift="1 <<" + +cat > $TMPH <> $TMPH fi - -# Apparently it's not possible to portably echo a backslash. -enabled asmalign_pot && - printf '#define ASMALIGN(ZEROBITS) ".align " #ZEROBITS "\\n\\t"\n' >> $TMPH || - printf '#define ASMALIGN(ZEROBITS) ".align 1 << " #ZEROBITS "\\n\\t"\n' >> $TMPH - -echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH - print_config ARCH_ $TMPH config.mak $ARCH_LIST print_config HAVE_ $TMPH config.mak $HAVE_LIST print_config CONFIG_ $TMPH config.mak $CONFIG_LIST \ @@ -2746,48 +2957,19 @@ echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH echo "endif # FFMPEG_CONFIG_MAK" >> config.mak # Do not overwrite an unchanged config.h to avoid superfluous rebuilds. -cmp -s $TMPH config.h && - echo "config.h is unchanged" || - mv -f $TMPH config.h +cp_if_changed $TMPH config.h -# build tree in object directory if source path is different from current one -if enabled source_path_used; then - DIRS=" - doc - libavcodec - libavcodec/$arch - libavdevice - libavfilter - libavformat - libavutil - libavutil/$arch - libpostproc - libswscale - libswscale/$arch - tests - tools - " - FILES=" - Makefile - common.mak - subdir.mak - doc/texi2pod.pl - libavcodec/Makefile - libavdevice/Makefile - libavfilter/Makefile - libavformat/Makefile - libavutil/Makefile - libpostproc/Makefile - libswscale/Makefile - " - for dir in $DIRS ; do - mkdir -p $dir - done - for f in $FILES ; do - $ln_s "$source_path/$f" $f - done -fi +cat > $TMPH <> $TMPH +cp_if_changed $TMPH libavutil/avconfig.h # build pkg-config files