aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMåns Rullgård <mans@mansr.com>2007-02-11 15:49:37 +0000
committerMåns Rullgård <mans@mansr.com>2007-02-11 15:49:37 +0000
commit799c9e9bcbacd96e37513720b54bc519ac4ad825 (patch)
tree67b76c554457abf33556bfe0a9c89f1d5c9554dd
parentfa859b4d8a1d752dad848eea844a6894bbc3c808 (diff)
downloadffmpeg-799c9e9bcbacd96e37513720b54bc519ac4ad825.tar.gz
recursive feature dependency checking
Originally committed as revision 7930 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rwxr-xr-xconfigure30
1 files changed, 30 insertions, 0 deletions
diff --git a/configure b/configure
index 66ace8cba9..359caf69ef 100755
--- a/configure
+++ b/configure
@@ -216,6 +216,25 @@ set_all(){
done
}
+pushvar(){
+ for var in $*; do
+ eval level=\${${var}_level:=0}
+ eval ${var}_${level}="\$$var"
+ eval ${var}_level=$(($level+1))
+ done
+}
+
+popvar(){
+ for var in $*; do
+ eval level=\${${var}_level:-0}
+ test $level = 0 && continue
+ eval level=$(($level-1))
+ eval $var="\${${var}_${level}}"
+ eval ${var}_level=$level
+ eval unset ${var}_${level}
+ done
+}
+
enable(){
set_all yes $*
}
@@ -258,10 +277,21 @@ disabled_any(){
check_deps(){
for cfg; do
+ enabled ${cfg}_checking && die "Circular dependency for $cfg."
+ disabled ${cfg}_checking && continue
+ enable ${cfg}_checking
+
eval dep_all="\$${cfg}_deps"
eval dep_any="\$${cfg}_deps_any"
+
+ pushvar cfg dep_all dep_any
+ check_deps $dep_all $dep_any
+ popvar cfg dep_all dep_any
+
enabled_all $dep_all || disable $cfg
enabled_any $dep_any || disable $cfg
+
+ disable ${cfg}_checking
done
}