build: modified libav configuration script.
authorPark Kyoung Won <kw0712.park@samsung.com>
Thu, 10 Sep 2015 06:06:42 +0000 (15:06 +0900)
committerPark Kyoung Won <kw0712.park@samsung.com>
Thu, 10 Sep 2015 06:55:13 +0000 (15:55 +0900)
- added disable-libav configure option

Change-Id: I629ee3efb7aeaff42848788952a4940a4a050229
Signed-off-by: Park Kyoung Won <kw0712.park@samsung.com>
configure

index 71182eb..132efdf 100755 (executable)
--- a/configure
+++ b/configure
@@ -4328,43 +4328,54 @@ libavformat_version="54.20.3"
 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