[FFmpeg-devel] [PATCH 3/3] build: make dependency to pkg-config more explicit

Clément Bœsch u at pkh.me
Tue Jun 17 23:05:40 CEST 2014


---
 configure | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 6946133..1358a5a 100755
--- a/configure
+++ b/configure
@@ -1188,8 +1188,16 @@ require_cpp(){
     check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
 }
 
+check_pkg_config_presence(){
+    pkg="$1"
+    if ! $pkg_config --version >/dev/null 2>&1; then
+        die "ERROR: $pkg_config not found but $pkg detection depends on it."
+    fi
+}
+
 require_pkg_config(){
     pkg="$1"
+    check_pkg_config_presence "$pkg"
     check_pkg_config "$@" || die "ERROR: $pkg not found"
     add_cflags    $(get_safe ${pkg}_cflags)
     add_extralibs $(get_safe ${pkg}_libs)
@@ -1198,6 +1206,7 @@ require_pkg_config(){
 require_libfreetype(){
     log require_libfreetype "$@"
     pkg="freetype2"
+    check_pkg_config_presence "$pkg"
     check_cmd $pkg_config --exists --print-errors $pkg \
       || die "ERROR: $pkg not found"
     pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
@@ -2988,11 +2997,6 @@ set_default arch cc cxx pkg_config ranlib strip sysinclude target_exec target_os
 enabled cross_compile || host_cc_default=$cc
 set_default host_cc
 
-if ! $pkg_config --version >/dev/null 2>&1; then
-    warn "$pkg_config not found, library detection may fail."
-    pkg_config=false
-fi
-
 exesuf() {
     case $1 in
         mingw32*|win32|win64|cygwin*|*-dos|freedos|opendos|os/2*|symbian) echo .exe ;;
-- 
2.0.0



More information about the ffmpeg-devel mailing list