configure: allow checking multiple functions in check_func_headers()
This makes it possible to pass a space-separated list of functions to check_func_headers and check_lib2. If any function is missing, none are enabled as available, so this should only be used for all-or-nothing sets, i.e. groups in which none will be used if any one is missing. Signed-off-by: Mans Rullgard <mans@mansr.com> (cherry picked from commit edaf1ae2763ce1a23dec70e730ba2bb8ee476dfd) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
8ea36711b0
commit
05aa8c4441
27
configure
vendored
27
configure
vendored
@ -700,20 +700,17 @@ EOF
|
|||||||
check_func_headers(){
|
check_func_headers(){
|
||||||
log check_func_headers "$@"
|
log check_func_headers "$@"
|
||||||
headers=$1
|
headers=$1
|
||||||
func=$2
|
funcs=$2
|
||||||
shift 2
|
shift 2
|
||||||
disable $func
|
{
|
||||||
incs=""
|
for hdr in $headers; do
|
||||||
for hdr in $headers; do
|
echo "#include <$hdr>"
|
||||||
incs="$incs
|
done
|
||||||
#include <$hdr>"
|
for func in $funcs; do
|
||||||
done
|
echo "long check_$func(void) { return (long) $func; }"
|
||||||
check_ld "$@" <<EOF && enable $func && enable_safe $headers
|
done
|
||||||
$incs
|
echo "int main(void) { return 0; }"
|
||||||
int main(int argc, char **argv){
|
} | check_ld "$@" && enable $funcs && enable_safe $headers
|
||||||
return (long) $func;
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_cpp_condition(){
|
check_cpp_condition(){
|
||||||
@ -740,9 +737,9 @@ check_lib(){
|
|||||||
check_lib2(){
|
check_lib2(){
|
||||||
log check_lib2 "$@"
|
log check_lib2 "$@"
|
||||||
headers="$1"
|
headers="$1"
|
||||||
func="$2"
|
funcs="$2"
|
||||||
shift 2
|
shift 2
|
||||||
check_func_headers "$headers" $func "$@" && add_extralibs "$@"
|
check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
check_exec(){
|
check_exec(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user