Ticket #17809: patch-macports-use_autoconf-deps.tcl

File patch-macports-use_autoconf-deps.tcl, 2.8 KB (added by raimue (Rainer Müller), 15 years ago)

Missed automake.cmd

Line 
1Index: port1.0/portconfigure.tcl
2===================================================================
3--- port1.0/portconfigure.tcl   (revision 44441)
4+++ port1.0/portconfigure.tcl   (working copy)
5@@ -59,20 +59,70 @@
6 option_proc use_autoconf    set_configure_type
7 option_proc use_xmkmf       set_configure_type
8 
9+option_proc autoreconf.cmd  set_configure_type
10+option_proc automake.cmd    set_configure_type
11+option_proc autoconf.cmd    set_configure_type
12+option_proc xmkmf.cmd       set_configure_type
13+
14+##
15+# Local helper proc
16+proc add_build_dep { type dep } {
17+    global ${type}.cmd
18+
19+    if {![info exists ${type}.cmd] || (
20+        ([info exists option_defaults(${type}.cmd)] && [set ${type}.cmd] == $option_defaults(${type}.cmd)) ||
21+        (![info exists option_defaults(${type}.cmd)] && [set ${type}.cmd] == "${type}")
22+        )} {
23+            depends_build-append $dep
24+    }
25+}
26+
27+##
28+# Adds dependencies for the binaries which will be called, but only if it is
29+# the default. If .cmd was overwritten the port has to care for deps itself.
30 proc set_configure_type {option action args} {
31-    if {[string equal ${action} "set"] && [tbool args]} {
32+    global option_defaults
33+    global autoreconf.cmd automake.cmd autoconf.cmd xmkmf.cmd
34+
35+    array set configure_map {
36+        autoreconf  bin:autoreconf:autoconf
37+        automake    bin:automake:automake
38+        autoconf    bin:autoconf:autoconf
39+        xmkmf       bin:xmkmf:imake
40+    }
41+
42+    if {[string equal ${action} "set"]} {
43+        set item ""
44+        set act 0
45         switch $option {
46             use_autoreconf {
47-                depends_build-append bin:autoreconf:autoconf
48+                if {[tbool args]} {
49+                    add_build_dep automake $configure_map(autoreconf)
50+                }
51+            }
52+            autoreconf.cmd {
53+                depends_build-delete $configure_map(autoreconf)
54             }
55             use_automake {
56-                depends_build-append bin:automake:automake
57+                if {[tbool args]} {
58+                    add_build_dep automake $configure_map(automake)
59+                }
60+            }
61+            automake.cmd {
62+                depends_build-delete $configure_map(automake)
63             }
64             use_autoconf {
65-                depends_build-append bin:autoconf:autoconf
66+                if {[tbool args]} {
67+                    add_build_dep autoconf $configure_map(autoconf)
68+                }
69+            }
70+            autoconf.cmd {
71+                depends_build-delete $configure_map(autoconf)
72             }
73             use_xmkmf {
74-                depends_build-append bin:xmkmf:imake
75+                if {[tbool args]} {
76+                    depends_build-append $configure_map(xmkmf)
77+                }
78             }
79         }
80     }