diff options
author | Mans Rullgard <mans@mansr.com> | 2011-03-07 02:49:55 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-03-19 20:06:09 +0100 |
commit | 05aa8c4441c74732d411480ab3e477d602dd7695 (patch) | |
tree | da124ca4bcdecb7b0517085c6e2e33d81d1821e2 /configure | |
parent | 8ea36711b0a85e24a77e1c76b1cb24aa63df217f (diff) | |
download | ffmpeg-05aa8c4441c74732d411480ab3e477d602dd7695.tar.gz |
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>
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 27 |
1 files changed, 12 insertions, 15 deletions
@@ -700,20 +700,17 @@ EOF check_func_headers(){ log check_func_headers "$@" headers=$1 - func=$2 + funcs=$2 shift 2 - disable $func - incs="" - for hdr in $headers; do - incs="$incs -#include <$hdr>" - done - check_ld "$@" <<EOF && enable $func && enable_safe $headers -$incs -int main(int argc, char **argv){ - return (long) $func; -} -EOF + { + for hdr in $headers; do + echo "#include <$hdr>" + done + for func in $funcs; do + echo "long check_$func(void) { return (long) $func; }" + done + echo "int main(void) { return 0; }" + } | check_ld "$@" && enable $funcs && enable_safe $headers } check_cpp_condition(){ @@ -740,9 +737,9 @@ check_lib(){ check_lib2(){ log check_lib2 "$@" headers="$1" - func="$2" + funcs="$2" shift 2 - check_func_headers "$headers" $func "$@" && add_extralibs "$@" + check_func_headers "$headers" "$funcs" "$@" && add_extralibs "$@" } check_exec(){ |