X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=configure;h=10246e527ff21e201bc8ffb2f8074298a3bf6fa6;hb=ae35d91d44c5e676af3d146bf8d05b241c467675;hp=ebeea83edf687fdc41bdeea998bbb4ee0cb974c9;hpb=197252f1c58b1d53f97c10201990a471dd46d31c;p=ffmpeg diff --git a/configure b/configure index ebeea83edf6..10246e527ff 100755 --- a/configure +++ b/configure @@ -120,14 +120,16 @@ Component options: --disable-avresample disable libavresample build [no] --disable-pthreads disable pthreads [auto] --disable-w32threads disable Win32 threads [auto] - --enable-x11grab enable X11 grabbing [no] --disable-network disable network support [no] --disable-dct disable DCT code + --disable-error-resilience disable error resilience code --disable-lsp disable LSP code --disable-lzo disable LZO decoder code --disable-mdct disable MDCT code --disable-rdft disable RDFT code --disable-fft disable FFT code + +Hardware accelerators: --enable-dxva2 enable DXVA2 code --enable-vaapi enable VAAPI code --enable-vda enable VDA code @@ -203,6 +205,7 @@ External library support: --enable-libxvid enable Xvid encoding via xvidcore, native MPEG-4/Xvid encoder exists [no] --enable-openssl enable openssl [no] + --enable-x11grab enable X11 grabbing [no] --enable-zlib enable zlib [autodetect] Advanced options (experts only): @@ -222,6 +225,7 @@ Advanced options (experts only): --ld=LD use linker LD --host-cc=HOSTCC use host C compiler HOSTCC --host-cflags=HCFLAGS use HCFLAGS when compiling for host + --host-cppflags=HCPPFLAGS use HCPPFLAGS when compiling for host --host-ld=HOSTLD use host linker HOSTLD --host-ldflags=HLDFLAGS use HLDFLAGS when linking for host --host-libs=HLIBS use libs HLIBS when linking for host @@ -405,14 +409,18 @@ set_weak(){ done } +sanitize_var_name(){ + echo $@ | sed 's/[^A-Za-z0-9_]/_/g' +} + set_safe(){ var=$1 shift - eval $(echo "$var" | sed 's/[^A-Za-z0-9_]/_/g')='$*' + eval $(sanitize_var_name "$var")='$*' } get_safe(){ - eval echo \$$(echo "$1" | sed 's/[^A-Za-z0-9_]/_/g') + eval echo \$$(sanitize_var_name "$1") } pushvar(){ @@ -646,6 +654,10 @@ add_extralibs(){ prepend extralibs $($ldflags_filter "$@") } +add_host_cppflags(){ + append host_cppflags "$@" +} + add_host_cflags(){ append host_cflags $($host_cflags_filter "$@") } @@ -916,7 +928,7 @@ check_type(){ } check_struct(){ - log check_type "$@" + log check_struct "$@" headers=$1 struct=$2 member=$3 @@ -926,6 +938,16 @@ check_struct(){ enable_safe "${struct}_${member}" } +check_builtin(){ + log check_builtin "$@" + name=$1 + headers=$2 + builtin=$3 + shift 3 + disable "$name" + check_code ld "$headers" "$builtin" "$@" && enable "$name" +} + require(){ name="$1" header="$2" @@ -960,6 +982,13 @@ check_host_cc(){ check_cmd $host_cc $host_cflags "$@" $HOSTCC_C $(hostcc_o $TMPO) $TMPC } +check_host_cppflags(){ + log check_host_cppflags "$@" + check_host_cc "$@" </dev/null | grep -q Intel; then + elif $_cc --version 2>/dev/null | grep -q ^icc; then _type=icc _ident=$($_cc --version | head -n1) _depflags='-MMD' @@ -2855,7 +2937,7 @@ case $target_os in openbsd|bitrig) disable symver SHFLAGS='-shared' - SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBVERSION)' + SLIB_INSTALL_NAME='$(SLIBNAME).$(LIBMAJOR).$(LIBMINOR)' SLIB_INSTALL_LINKS= oss_indev_extralibs="-lossaudio" oss_outdev_extralibs="-lossaudio" @@ -2910,7 +2992,6 @@ case $target_os in dlltool="${cross_prefix}dlltool" ranlib=: enable dos_paths - add_cppflags -U__STRICT_ANSI__ ;; win32|win64) if enabled shared; then @@ -3023,7 +3104,6 @@ case $target_os in network_extralibs='-lbsd' exeobjs=compat/plan9/main.o disable avserver - ln_s='ln -s -f' cp_f='cp' ;; none) @@ -3052,6 +3132,7 @@ elif check_header _mingw.h; then "defined (__MINGW64_VERSION_MAJOR) || (__MINGW32_MAJOR_VERSION > 3) || \ (__MINGW32_MAJOR_VERSION == 3 && __MINGW32_MINOR_VERSION >= 15)" || die "ERROR: MinGW runtime version must be >= 3.15." + add_cppflags -U__STRICT_ANSI__ elif check_func_headers stdlib.h _get_doserrno; then libc_type=msvcrt add_compat strtod.o strtod=avpriv_strtod @@ -3249,9 +3330,8 @@ elif enabled sparc; then elif enabled x86; then - check_code ld intrin.h "__rdtsc()" && enable rdtsc - - check_code ld mmintrin.h "_mm_empty()" && enable mm_empty + check_builtin rdtsc intrin.h "__rdtsc()" + check_builtin mm_empty mmintrin.h "_mm_empty()" enable local_aligned_8 local_aligned_16 @@ -3386,6 +3466,10 @@ check_func strerror_r check_func strptime check_func strtok_r check_func sched_getaffinity +check_builtin sync_val_compare_and_swap "" "int *ptr; int oldval, newval; __sync_val_compare_and_swap(ptr, oldval, newval)" +check_builtin machine_rw_barrier mbarrier.h "__machine_rw_barrier()" +check_builtin atomic_cas_ptr atomic.h "void **ptr; void *oldval, *newval; atomic_cas_ptr(ptr, oldval, newval)" +check_builtin MemoryBarrier windows.h "MemoryBarrier()" check_func sysconf check_func sysctl check_func usleep @@ -3416,6 +3500,7 @@ check_header sys/time.h check_header unistd.h check_header vdpau/vdpau.h check_header vdpau/vdpau_x11.h +check_header VideoDecodeAcceleration/VDADecoder.h check_header windows.h check_header X11/extensions/XvMClib.h @@ -3453,6 +3538,10 @@ for thread in $THREADS_LIST; do fi done +enabled sync_val_compare_and_swap && enable atomics_gcc +enabled machine_rw_barrier && enabled atomic_cas_ptr && enable atomics_suncc +enabled MemoryBarrier && enable atomics_win32 + check_lib math.h sin -lm && LIBM="-lm" enabled vaapi && require vaapi va/va.h vaInitialize -lva @@ -3522,8 +3611,8 @@ fi if check_pkg_config sdl SDL_events.h SDL_PollEvent; then 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 + check_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x010300" $sdl_cflags && + enable sdl fi texi2html -version > /dev/null 2>&1 && enable texi2html || disable texi2html @@ -3568,15 +3657,9 @@ require X11 X11/Xlib.h XOpenDisplay -lX11 && require Xext X11/extensions/XShm.h XShmCreateImage -lXext && require Xfixes X11/extensions/Xfixes.h XFixesGetCursorImage -lXfixes -# check for VDA header -if ! disabled vda && check_header VideoDecodeAcceleration/VDADecoder.h; then - enable vda && add_extralibs -framework CoreFoundation -framework VideoDecodeAcceleration -framework QuartzCore -fi - -if ! disabled vdpau && enabled vdpau_vdpau_h; then +enabled vdpau && 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 + disable vdpau enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" @@ -3667,8 +3750,6 @@ if enabled icc; then # 11030: Warning unknown option --as-needed # 10156: ignoring option '-export'; no argument required check_ldflags -wd10156,11030 - # Allow to compile with optimizations - check_ldflags -march=$cpu # icc 11.0 and 11.1 work with ebp_available, but don't pass the test enable ebp_available if enabled x86_32; then @@ -3724,6 +3805,7 @@ case $target_os in esac enabled_any $THREADS_LIST && enable threads +enabled_any $ATOMICS_LIST && enable atomics_native enabled asm || { arch=c; disable $ARCH_LIST $ARCH_EXT_LIST; } @@ -3787,47 +3869,18 @@ echo "network support ${network-no}" echo "threading support ${thread_type-no}" echo "safe bitstream reader ${safe_bitstream_reader-no}" echo "SDL support ${sdl-no}" -echo "libdxva2 enabled ${dxva2-no}" -echo "libva enabled ${vaapi-no}" -echo "libvdpau enabled ${vdpau-no}" -echo "AVISynth enabled ${avisynth-no}" -echo "frei0r enabled ${frei0r-no}" -echo "gnutls enabled ${gnutls-no}" -echo "libcdio support ${libcdio-no}" -echo "libdc1394 support ${libdc1394-no}" -echo "libfaac enabled ${libfaac-no}" -echo "libfdk-aac enabled ${libfdk_aac-no}" -echo "libgsm enabled ${libgsm-no}" -echo "libilbc enabled ${libilbc-no}" -echo "libmp3lame enabled ${libmp3lame-no}" -echo "libopencore-amrnb support ${libopencore_amrnb-no}" -echo "libopencore-amrwb support ${libopencore_amrwb-no}" -echo "libopencv support ${libopencv-no}" -echo "libopenjpeg enabled ${libopenjpeg-no}" -echo "libopus enabled ${libopus-no}" -echo "libpulse enabled ${libpulse-no}" -echo "librtmp enabled ${librtmp-no}" -echo "libschroedinger enabled ${libschroedinger-no}" -echo "libspeex enabled ${libspeex-no}" -echo "libtheora enabled ${libtheora-no}" -echo "libvo-aacenc support ${libvo_aacenc-no}" -echo "libvo-amrwbenc support ${libvo_amrwbenc-no}" -echo "libvorbis enabled ${libvorbis-no}" -echo "libvpx enabled ${libvpx-no}" -echo "libx264 enabled ${libx264-no}" -echo "libxavs enabled ${libxavs-no}" -echo "libxvid enabled ${libxvid-no}" -echo "openssl enabled ${openssl-no}" -echo "zlib enabled ${zlib-no}" -echo "bzlib enabled ${bzlib-no}" test -n "$random_seed" && echo "random seed ${random_seed}" echo +echo "External libraries:" +print_enabled '' $EXTERNAL_LIBRARY_LIST | print_3_columns +echo + for type in decoder encoder hwaccel parser demuxer muxer protocol filter bsf indev outdev; do echo "Enabled ${type}s:" eval list=\$$(toupper $type)_LIST - print_enabled '_*' $list | sort | pr -r -3 -t + print_enabled '_*' $list | print_3_columns echo done @@ -3911,6 +3964,7 @@ AS_DEPFLAGS=$AS_DEPFLAGS HOSTCC=$host_cc HOSTLD=$host_ld HOSTCFLAGS=$host_cflags +HOSTCPPFLAGS=$host_cppflags HOSTEXESUF=$HOSTEXESUF HOSTLDFLAGS=$host_ldflags HOSTLIBS=$host_libs @@ -3953,6 +4007,7 @@ get_version(){ eval ${name}_VERSION=\$${name}_VERSION_MAJOR.\$${name}_VERSION_MINOR.\$${name}_VERSION_MICRO eval echo "${lcname}_VERSION=\$${name}_VERSION" >> config.mak eval echo "${lcname}_VERSION_MAJOR=\$${name}_VERSION_MAJOR" >> config.mak + eval echo "${lcname}_VERSION_MINOR=\$${name}_VERSION_MINOR" >> config.mak } map 'get_version $v' $LIBRARY_LIST