[FFmpeg-cvslog] configure: allow checking multiple functions in check_func_headers()

Mans Rullgard git at videolan.org
Sat Mar 19 20:22:16 CET 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Mon Mar  7 02:49:55 2011 +0000| [05aa8c4441c74732d411480ab3e477d602dd7695] | committer: Michael Niedermayer

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 at mansr.com>
(cherry picked from commit edaf1ae2763ce1a23dec70e730ba2bb8ee476dfd)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=05aa8c4441c74732d411480ab3e477d602dd7695
---

 configure |   27 ++++++++++++---------------
 1 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/configure b/configure
index 0b6bdb6..e633fb4 100755
--- a/configure
+++ b/configure
@@ -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(){




More information about the ffmpeg-cvslog mailing list