Before this patch trying to enable only https by issuing

    --disable-protocols --enable-protocol=https --enable-gnutls

does not enable https, and

    --disable-all --enable-protocols

does not enable libavformat and the protocols component.

Now a `select_any` keyword is provided to describe alternate
dependencies and only the options that had not been explicitly
altered are defaulted to enabled.
---

Next step is making so that if a dependency explicitly enabled does
not have its dependencies satisfied configure issues an error.

 configure | 40 +++++++++++++++++++++++++++-------------
 1 file changed, 27 insertions(+), 13 deletions(-)

diff --git a/configure b/configure
index 2f0d677..42d18e9 100755
--- a/configure
+++ b/configure
@@ -515,9 +515,10 @@ do_enable_deep(){
     for var; do
         enabled $var && continue
         eval sel="\$${var}_select"
+        eval sla="\$${var}_select_any"
         eval sgs="\$${var}_suggest"
         pushvar var sgs
-        enable_deep $sel
+        enable_deep $sel $sla
         popvar sgs
         enable_deep_weak $sgs
         popvar var
@@ -600,6 +601,7 @@ do_check_deps(){
         eval dep_all="\$${cfg}_deps"
         eval dep_any="\$${cfg}_deps_any"
         eval dep_sel="\$${cfg}_select"
+        eval dep_sla="\$${cfg}_select_any"
         eval dep_sgs="\$${cfg}_suggest"
         eval dep_ifa="\$${cfg}_if"
         eval dep_ifn="\$${cfg}_if_any"
@@ -613,9 +615,10 @@ do_check_deps(){
         enabled_all  $dep_all || disable $cfg
         enabled_any  $dep_any || disable $cfg
         disabled_any $dep_sel && disable $cfg
+        [ -n "$dep_sla" ] && { disabled_all $dep_sla && disable $cfg; }

         if enabled $cfg; then
-            enable_deep $dep_sel
+            enable_deep $dep_sel $dep_sla
             enable_deep_weak $dep_sgs
         fi

@@ -2328,7 +2331,7 @@ tls_gnutls_protocol_deps="gnutls"
 tls_gnutls_protocol_select="tcp_protocol"
 tls_openssl_protocol_deps="openssl !tls_gnutls_protocol"
 tls_openssl_protocol_select="tcp_protocol"
-tls_protocol_deps_any="tls_gnutls_protocol tls_openssl_protocol"
+tls_protocol_select_any="tls_gnutls_protocol tls_openssl_protocol"
 udp_protocol_select="network"
 unix_protocol_deps="sys_un_h"
 unix_protocol_select="network"
@@ -2529,12 +2532,6 @@ ALL_COMPONENTS="
     $PROTOCOL_LIST
 "

-for n in $COMPONENT_LIST; do
-    v=$(toupper ${n%s})_LIST
-    eval enable \$$v
-    eval ${n}_if_any="\$$v"
-done
-
 enable $ARCH_EXT_LIST

 die_unknown(){
@@ -2597,10 +2594,10 @@ for opt do
             disable $PROGRAM_LIST
         ;;
         --disable-everything)
-            map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
+            map 'eval disable \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
         ;;
         --disable-all)
-            map 'eval unset \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
+            map 'eval disable \${$(toupper ${v%s})_LIST}' $COMPONENT_LIST
             disable $LIBRARY_LIST $PROGRAM_LIST doc
         ;;
         --enable-random|--disable-random)
@@ -2616,6 +2613,7 @@ for opt do
             is_in "${thing}s" $COMPONENT_LIST || die_unknown "$opt"
             eval list=\$$(toupper $thing)_LIST
             name=$(echo "${optval}" | sed "s/,/_${thing}|/g")_${thing}
+            test $action = enable && action="enable_deep"
             $action $(filter "$name" $list)
         ;;
         --enable-avserver|--disable-avserver*)
@@ -2625,7 +2623,6 @@ for opt do
         --enable-?*|--disable-?*)
             eval $(echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g')
             if is_in $option $COMPONENT_LIST; then
-                test $action = disable && action=unset
                 eval $action \$$(toupper ${option%s})_LIST
             elif is_in $option $CMDLINE_SELECT; then
                 $action $option
@@ -2666,7 +2663,7 @@ disabled logging && logfile=/dev/null
 # is disabled, see AVCODEC_LIST and following _LIST variables.

 disable_components(){
-    disabled ${1} && disable $(
+    disabled ${1} && disable_weak $(
         eval components="\$$(toupper ${1})_COMPONENTS"
         map 'eval echo \${$(toupper ${v%s})_LIST}' $components
     )
@@ -2674,6 +2671,23 @@ disable_components(){

 map 'disable_components $v' $LIBRARY_LIST

+# Mark components that had not been enabled/disabled explicitly
+# as enabled
+
+for n in $COMPONENT_LIST; do
+    v=$(toupper ${n%s})_LIST
+    eval enable_weak \$$v
+    eval ${n}_if_any="\$$v"
+done
+
+# Make so that disabled libraries are enabled if a component
+# of them is requested
+
+for n in $LIBRARY_LIST; do
+    v=$(toupper ${n})_COMPONENTS
+    eval ${n}_if_any="\$$v"
+done
+
 echo "# $0 $LIBAV_CONFIGURATION" > $logfile
 set >> $logfile

--
2.6.1

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to