libavresample_package="libavresample"
libavresample_version="1.0.1"
libx264_package="x264"
+libav_package="libav"
+exists_libav="no"
+exists_x264="no"
check_libav() {
- yes=0
- no=1
- enabled="yes"
- disabled="no"
- exists_libav=$no
- exists_x264=$no
- if $pkg_config --exists "$libavcodec_package >= $libavcodec_version" ; then
- if $pkg_config --exists "$libavformat_package >= $libavformat_version" ; then
- if $pkg_config --exists "$libavutil_package >= $libavutil_version" ; then
- if $pkg_config --exists "$libavresample_package >= $libavresample_version" ; then
- exists_libav=$yes
- if $pkg_config --exists "$libx264_package" ; then
- exists_x264=$yes
- libav_cflags=`$pkg_config --cflags $libavcodec_package` #Header files are in same place.
- libav_libs=`$pkg_config --libs $libavcodec_package $libavformat_package $libavutil_package $libavresample_package $libx264_package`
- fi
- fi
- fi
- fi
+
+ if ! $pkg_config --exists "$libavcodec_package >= $libavcodec_version" ; then
+ return
+ fi
+ if ! $pkg_config --exists "$libavformat_package >= $libavformat_version" ; then
+ return
+ fi
+ if ! $pkg_config --exists "$libavutil_package >= $libavutil_version" ; then
+ return
+ fi
+ if ! $pkg_config --exists "$libavresample_package >= $libavresample_version" ; then
+ return
+ fi
+ exists_libav="yes"
+
+ if $pkg_config --exists "$libx264_package" ; then
+ exists_x264="yes"
fi
+}
+
+set_libav_config() {
- if [ "$libav" = "$enabled" ]; then
- if [ "$exists_libav" -eq "$no" ]; then
+ if [ "$libav" = "yes" ]; then
+ if [ "$exists_libav" = "no" ]; then
feature_not_found "$libav_package"
- elif [ "$exists_x264" -eq "$no" ]; then
+ elif [ "$exists_x264" = "no" ]; then
feature_not_found "$libx264_package"
fi
- elif [ "$exists_libav" -eq "$yes" ] && [ "$exists_x264" -eq "$yes" ]; then
- libav="$enabled"
+ fi
+
+ if [ "$exists_libav" = "yes" ] && [ "$exists_x264" = "yes" ]; then
+ libav="yes"
+ libav_cflags=`$pkg_config --cflags $libavcodec_package` #Header files are in same place.
+ libav_libs=`$pkg_config --libs $libavcodec_package $libavformat_package $libavutil_package $libavresample_package $libx264_package`
else
- libav="$disabled"
+ libav="no"
fi
}
-check_libav
+if [ "$libav" != "no" ]; then
+ check_libav
+ set_libav_config
+fi
##########################################
# libpng probe