--enable-libopencore-amrwb enable AMR-WB decoding via libopencore-amrwb [no]
--enable-libopencv enable video filtering via libopencv [no]
--enable-libopenjpeg enable JPEG 2000 de/encoding via OpenJPEG [no]
- --enable-libopus enable Opus decoding via libopus [no]
+ --enable-libopus enable Opus de/encoding via libopus [no]
--enable-libpulse enable Pulseaudio input via libpulse [no]
--enable-libquvi enable quvi input via libquvi [no]
--enable-librtmp enable RTMP[E] support via librtmp [no]
eval "$var=\"$* \$$var\""
}
+unique(){
+ var=$1
+ uniq_list=""
+ for tok in $(eval echo \$$var); do
+ uniq_list="$(filter_out $tok $uniq_list) $tok"
+ done
+ eval "$var=\"${uniq_list}\""
+}
+
add_cppflags(){
append CPPFLAGS "$@"
}
pkg="freetype2"
check_cmd $pkg_config --exists --print-errors $pkg \
|| die "ERROR: $pkg not found"
- pkg_cflags=$($pkg_config --cflags $pkg)
- pkg_libs=$($pkg_config --libs $pkg)
+ pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
+ pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
{
echo "#include <ft2build.h>"
echo "#include FT_FREETYPE_H"
need_memalign="altivec neon sse"
# system capabilities
-log2_deps="!libc_msvcrt"
symver_if_any="symver_asm_label symver_gnu_asm"
nellymoser_encoder_select="audio_frame_queue mdct sinewin"
nuv_decoder_select="dsputil lzo"
on2avc_decoder_select="mdct"
+opus_decoder_deps="swresample"
png_decoder_select="zlib"
png_encoder_select="dsputil zlib"
prores_decoder_select="dsputil"
vp6f_decoder_select="vp6_decoder"
vp7_decoder_select="h264pred videodsp"
vp8_decoder_select="h264pred videodsp"
-vp9_decoder_select="videodsp"
+vp9_decoder_select="videodsp vp9_parser"
webp_decoder_select="vp8_decoder"
wmapro_decoder_select="mdct sinewin"
wmav1_decoder_select="mdct sinewin"
h264_vda_decoder_select="h264_decoder"
h264_vda_hwaccel_deps="vda"
h264_vda_hwaccel_select="h264_decoder"
+h264_vda_old_hwaccel_deps="vda"
+h264_vda_old_hwaccel_select="h264_decoder"
h264_vdpau_decoder_deps="vdpau"
h264_vdpau_decoder_select="h264_decoder"
h264_vdpau_hwaccel_deps="vdpau"
transcode_aac_example_deps="avcodec avformat swresample"
transcoding_example_deps="avfilter avcodec avformat avutil"
-# libraries
+# libraries, in linking order
avcodec_deps="avutil"
-avdevice_deps="avutil avcodec avformat"
+avdevice_deps="avformat avcodec avutil"
avfilter_deps="avutil"
-avformat_deps="avutil avcodec"
+avformat_deps="avcodec avutil"
avresample_deps="avutil"
postproc_deps="avutil gpl"
+swresample_deps="avutil"
swscale_deps="avutil"
# programs
check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test, %eax"' ||
check_inline_asm inline_asm_direct_symbol_refs '"movl '$extern_prefix'test(%rip), %eax"'
- # check whether binutils is new enough to compile SSSE3/MMXEXT
+ # check whether binutils is new enough to compile AVX/SSSE3/MMXEXT
+ enabled avx && check_inline_asm avx_inline '"vextractf128 $1, %ymm0, %xmm1"'
enabled ssse3 && check_inline_asm ssse3_inline '"pabsw %xmm0, %xmm0"'
enabled mmxext && check_inline_asm mmxext_inline '"pmaxub %mm0, %mm1"'
check_ldflags -wd10156,11030
# icc 11.0 and 11.1 work with ebp_available, but don't pass the test
enable ebp_available
+ # The test above does not test linking
+ enabled lto && disable symver_asm_label
if enabled x86_32; then
icc_version=$($cc -dumpversion)
test ${icc_version%%.*} -ge 11 &&
disable ebx_available
fi
fi
+ # msvcrt10 x64 incorrectly enables log2, only msvcrt12 onwards actually has log2.
+ check_cpp_condition crtversion.h "_VC_CRT_MAJOR_VERSION >= 12" || disable log2
fi
case $as_type in
fi
done
+# conditional library dependencies, in linking order
+enabled aconvert_filter && prepend avfilter_deps "swresample"
+enabled amovie_filter && prepend avfilter_deps "avformat avcodec"
+enabled aresample_filter && prepend avfilter_deps "swresample"
+enabled asyncts_filter && prepend avfilter_deps "avresample"
+enabled atempo_filter && prepend avfilter_deps "avcodec"
+enabled decimate_filter && prepend avfilter_deps "avcodec"
+enabled deshake_filter && prepend avfilter_deps "avcodec"
+enabled ebur128_filter && enabled swresample && prepend avfilter_deps "swresample"
+enabled elbg_filter && prepend avfilter_deps "avcodec"
+enabled mcdeint_filter && prepend avfilter_deps "avcodec"
+enabled movie_filter && prepend avfilter_deps "avformat avcodec"
+enabled mp_filter && prepend avfilter_deps "avcodec"
+enabled pan_filter && prepend avfilter_deps "swresample"
+enabled pp_filter && prepend avfilter_deps "postproc"
+enabled removelogo_filter && prepend avfilter_deps "avformat avcodec swscale"
+enabled resample_filter && prepend avfilter_deps "avresample"
+enabled sab_filter && prepend avfilter_deps "swscale"
+enabled scale_filter && prepend avfilter_deps "swscale"
+enabled showspectrum_filter && prepend avfilter_deps "avcodec"
+enabled smartblur_filter && prepend avfilter_deps "swscale"
+enabled subtitles_filter && prepend avfilter_deps "avformat avcodec"
+
+enabled lavfi_indev && prepend avdevice_deps "avfilter"
+
+enabled opus_decoder && prepend avcodec_deps "swresample"
+
+expand_deps(){
+ lib_deps=${1}_deps
+ eval "deps=\$$lib_deps"
+ append $lib_deps $(map 'eval echo \$${v}_deps' $deps)
+ unique $lib_deps
+}
+
+#we have to remove gpl from the deps here as some code assumes all lib deps are libs
+postproc_deps="$(filter_out 'gpl' $postproc_deps)"
+
+map 'expand_deps $v' $LIBRARY_LIST
+
echo "install prefix $prefix"
echo "source path $source_path"
echo "C compiler $cc"
map 'get_version $v' $LIBRARY_LIST
+map 'eval echo "FFLIBS-${v}=\$${v}_deps" >> config.mak' $LIBRARY_LIST
+
print_program_libs(){
eval "program_libs=\$${1}_libs"
eval echo "LIBS-${1}=${program_libs}" >> config.mak
# build pkg-config files
+lib_version(){
+ eval printf "\"lib${1}${build_suffix} >= \$LIB$(toupper ${1})_VERSION, \""
+}
+
pkgconfig_generate(){
name=$1
shortname=${name#lib}${build_suffix}
comment=$2
version=$3
libs=$4
- requires=$5
+ requires=$(map 'lib_version $v' $(eval echo \$${name#lib}_deps))
+ requires=${requires%, }
enabled ${name#lib} || return 0
mkdir -p $name
cat <<EOF > $name/$name${build_suffix}.pc
EOF
}
-lavfi_libs="libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-enabled libavfilter_deps_avcodec && prepend lavfi_libs "libavcodec${build_suffix} = $LIBAVCODEC_VERSION,"
-enabled libavfilter_deps_avformat && prepend lavfi_libs "libavformat${build_suffix} = $LIBAVFORMAT_VERSION,"
-enabled libavfilter_deps_avresample && prepend lavfi_libs "libavresample${build_suffix} = $LIBAVRESAMPLE_VERSION,"
-enabled libavfilter_deps_swscale && prepend lavfi_libs "libswscale${build_suffix} = $LIBSWSCALE_VERSION,"
-enabled libavfilter_deps_swresample && prepend lavfi_libs "libswresample${build_suffix} = $LIBSWRESAMPLE_VERSION,"
-enabled libavfilter_deps_postproc && prepend lavfi_libs "libpostproc${build_suffix} = $LIBPOSTPROC_VERSION,"
-lavfi_libs=${lavfi_libs%, }
-
-lavd_libs="libavformat${build_suffix} = $LIBAVFORMAT_VERSION"
-enabled lavfi_indev && prepend lavd_libs "libavfilter${build_suffix} = $LIBAVFILTER_VERSION,"
-
pkgconfig_generate libavutil "FFmpeg utility library" "$LIBAVUTIL_VERSION" "$LIBM"
-pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs" "libavcodec${build_suffix} = $LIBAVCODEC_VERSION"
-pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs" "$lavd_libs"
-pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs" "$lavfi_libs"
-pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" "" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
-pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM" "libavutil${build_suffix} = $LIBAVUTIL_VERSION"
+pkgconfig_generate libavcodec "FFmpeg codec library" "$LIBAVCODEC_VERSION" "$extralibs"
+pkgconfig_generate libavformat "FFmpeg container format library" "$LIBAVFORMAT_VERSION" "$extralibs"
+pkgconfig_generate libavdevice "FFmpeg device handling library" "$LIBAVDEVICE_VERSION" "$extralibs"
+pkgconfig_generate libavfilter "FFmpeg audio/video filtering library" "$LIBAVFILTER_VERSION" "$extralibs"
+pkgconfig_generate libpostproc "FFmpeg postprocessing library" "$LIBPOSTPROC_VERSION" ""
+pkgconfig_generate libavresample "Libav audio resampling library" "$LIBAVRESAMPLE_VERSION" "$extralibs"
+pkgconfig_generate libswscale "FFmpeg image rescaling library" "$LIBSWSCALE_VERSION" "$LIBM"
+pkgconfig_generate libswresample "FFmpeg audio resampling library" "$LIBSWRESAMPLE_VERSION" "$LIBM"