Merge commit '06db45523c1068c24f049ef2b20fcdead3bf36d8'
authorMichael Niedermayer <michaelni@gmx.at>
Tue, 2 Jun 2015 16:54:57 +0000 (18:54 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 2 Jun 2015 16:54:57 +0000 (18:54 +0200)
* commit '06db45523c1068c24f049ef2b20fcdead3bf36d8':
  configure: Support the extended pkgconf syntax

Conflicts:
configure

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
configure

diff --cc configure
+++ b/configure
@@@ -1214,43 -1054,11 +1214,43 @@@ require2()
      check_lib2 "$headers" $func "$@" || die "ERROR: $name not found"
  }
  
 -require_pkg_config(){
 +require_cpp(){
 +    name="$1"
 +    headers="$2"
 +    classes="$3"
 +    shift 3
 +    check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found"
 +}
 +
 +use_pkg_config(){
      pkg="$1"
 -    check_pkg_config "$@" || die "ERROR: $pkg not found"
 +    check_pkg_config "$@" || return 1
-     add_cflags    $(get_safe ${pkg}_cflags)
-     add_extralibs $(get_safe ${pkg}_libs)
++    add_cflags    $(get_safe "${pkg}_cflags")
++    add_extralibs $(get_safe "${pkg}_libs")
 +}
 +
 +require_pkg_config(){
 +    use_pkg_config "$@" || die "ERROR: $pkg not found using pkg-config$pkg_config_fail_message"
 +}
 +
 +require_libfreetype(){
 +    log require_libfreetype "$@"
 +    pkg="freetype2"
 +    check_cmd $pkg_config --exists --print-errors $pkg \
 +      || die "ERROR: $pkg not found"
 +    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"
 +        echo "long check_func(void) { return (long) FT_Init_FreeType; }"
 +        echo "int main(void) { return 0; }"
 +    } | check_ld "cc" $pkg_cflags $pkg_libs \
-       && set_safe ${pkg}_cflags $pkg_cflags \
-       && set_safe ${pkg}_libs   $pkg_libs \
++      && set_safe "${pkg}_cflags" $pkg_cflags \
++      && set_safe "${pkg}_libs"   $pkg_libs \
 +      || die "ERROR: $pkg not found"
-     add_cflags    $(get_safe ${pkg}_cflags)
-     add_extralibs $(get_safe ${pkg}_libs)
+     add_cflags    $(get_safe "${pkg}_cflags")
+     add_extralibs $(get_safe "${pkg}_libs")
  }
  
  hostcc_e(){