Commit 2a096440 authored by Diego Biurrun's avatar Diego Biurrun

configure: Separate package name and version requirements in helper functions

The unadorned package name is needed to derive package-related variable names.
parent ffb9025f
...@@ -1009,11 +1009,12 @@ check_lib(){ ...@@ -1009,11 +1009,12 @@ check_lib(){
check_pkg_config(){ check_pkg_config(){
log check_pkg_config "$@" log check_pkg_config "$@"
pkg="$1" pkg_version="$1"
pkg="${1%% *}"
headers="$2" headers="$2"
funcs="$3" funcs="$3"
shift 3 shift 3
check_cmd $pkg_config --exists --print-errors $pkg || return check_cmd $pkg_config --exists --print-errors $pkg_version || return
pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg) pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg)
pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg) pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg)
check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" &&
...@@ -1098,17 +1099,18 @@ check_compile_assert(){ ...@@ -1098,17 +1099,18 @@ check_compile_assert(){
require(){ require(){
log require "$@" log require "$@"
name="$1" name_version="$1"
headers="$2" headers="$2"
func="$3" func="$3"
shift 3 shift 3
check_lib "$headers" $func "$@" || die "ERROR: $name not found" check_lib "$headers" $func "$@" || die "ERROR: $name_version not found"
} }
require_pkg_config(){ require_pkg_config(){
log require_pkg_config "$@" log require_pkg_config "$@"
pkg="$1" pkg_version="$1"
check_pkg_config "$@" || die "ERROR: $pkg not found" pkg="${1%% *}"
check_pkg_config "$@" || die "ERROR: $pkg_version not found"
add_cflags $(get_safe "${pkg}_cflags") add_cflags $(get_safe "${pkg}_cflags")
add_extralibs $(get_safe "${pkg}_libs") add_extralibs $(get_safe "${pkg}_libs")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment