ffmpeg | branch: master | James Almer <jamr...@gmail.com> | Sun Apr 9 13:11:08 2017 -0300| [adf9f0416fab5c870adaad00712273576b20017c] | committer: James Almer
Merge commit '2a096440768b1086bb437939f827b8b7a5716bf7' * commit '2a096440768b1086bb437939f827b8b7a5716bf7': configure: Separate package name and version requirements in helper functions Merged-by: James Almer <jamr...@gmail.com> > http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=adf9f0416fab5c870adaad00712273576b20017c --- configure | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 4880bfc9ef..c09e319f6e 100755 --- a/configure +++ b/configure @@ -1233,12 +1233,12 @@ check_lib_cpp(){ check_pkg_config(){ log check_pkg_config "$@" - pkgandversion="$1" + pkg_version="$1" pkg="${1%% *}" headers="$2" funcs="$3" shift 3 - check_cmd $pkg_config --exists --print-errors $pkgandversion || return + check_cmd $pkg_config --exists --print-errors $pkg_version || return pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg) pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg) check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && @@ -1323,11 +1323,11 @@ check_compile_assert(){ require(){ log require "$@" - name="$1" + name_version="$1" headers="$2" func="$3" shift 3 - check_lib "$headers" $func "$@" || die "ERROR: $name not found" + check_lib "$headers" $func "$@" || die "ERROR: $name_version not found" } require_cpp(){ ====================================================================== diff --cc configure index 4880bfc9ef,37482cf1ef..c09e319f6e --- a/configure +++ b/configure @@@ -1223,17 -1007,9 +1223,17 @@@ check_lib() check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@" } +check_lib_cpp(){ + log check_lib_cpp "$@" + headers="$1" + classes="$2" + shift 2 + check_class_headers_cpp "$headers" "$classes" "$@" && add_extralibs "$@" +} + check_pkg_config(){ log check_pkg_config "$@" - pkgandversion="$1" + pkg_version="$1" pkg="${1%% *}" headers="$2" funcs="$3" @@@ -1327,45 -1103,14 +1327,45 @@@ require() headers="$2" func="$3" shift 3 - check_lib "$headers" $func "$@" || die "ERROR: $name not found" + check_lib "$headers" $func "$@" || die "ERROR: $name_version not found" } +require_cpp(){ + name="$1" + headers="$2" + classes="$3" + shift 3 + check_lib_cpp "$headers" "$classes" "$@" || die "ERROR: $name not found" +} + +use_pkg_config(){ + log use_pkg_config "$@" + pkg="$1" + check_pkg_config "$@" || return 1 + add_cflags $(get_safe "${pkg}_cflags") + add_extralibs $(get_safe "${pkg}_libs") +} + require_pkg_config(){ - log require_pkg_config "$@" - pkg_version="$1" - pkg="${1%% *}" - check_pkg_config "$@" || die "ERROR: $pkg_version not found" + 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 \ + || die "ERROR: $pkg not found" add_cflags $(get_safe "${pkg}_cflags") add_extralibs $(get_safe "${pkg}_libs") } _______________________________________________ ffmpeg-cvslog mailing list ffmpeg-cvslog@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog