Ticket #32542: auto-compiler-deps.4.diff
File auto-compiler-deps.4.diff, 3.2 KB (added by neverpanic (Clemens Lang), 12 years ago) |
---|
-
macports1.0/macports.tcl
1617 1617 error "Error evaluating variants" 1618 1618 } 1619 1619 1620 $workername eval port::run_callbacks 1621 1620 1622 ditem_key $mport provides [$workername eval return \$subport] 1621 1623 1622 1624 return $mport -
port1.0/port.tcl
32 32 # standard package load 33 33 package provide port 1.0 34 34 35 # Provide a callback registration mechanism for port subpackages. This needs to 36 # be done _before_ loading the subpackages. 37 namespace eval port {} 38 set port::_callback_list [list] 39 40 # Append a new procedure to a list of callbacks to be called when 41 # port::run_callbacks is called from macports1.0 after evaluating a Portfile 42 proc port::register_callback {callback} { 43 global port::_callback_list 44 45 lappend _callback_list ${callback} 46 } 47 48 # Run the callbacks registered in the callback list. Called from macports1.0 in 49 # the child interpreter after evaluating the Portfile and the variants. Clears 50 # the list of callbacks. 51 proc port::run_callbacks {} { 52 global port::_callback_list 53 54 ui_debug "Running callbacks..." 55 56 foreach callback ${_callback_list} { 57 ui_debug "Running callback ${callback}" 58 ${callback} 59 ui_debug "Finished running callback ${callback}" 60 } 61 set _callback_list [list] 62 } 63 35 64 package require mp_package 1.0 36 65 package require portmain 1.0 37 66 package require portdepends 1.0 -
port1.0/portconfigure.tcl
757 757 return $ret 758 758 } 759 759 760 # Automatically called from macports1.0 after evaluating the Portfile 761 # Some of the compilers we use are provided by MacPorts itself; ensure we 762 # automatically add a dependency when needed 763 proc portconfigure::add_automatic_compiler_dependencies {} { 764 global configure.compiler portconfigure::compiler_name_map 765 766 # The default value requires substitution before use. 767 set compiler [subst ${configure.compiler}] 768 if {![compiler_is_port $compiler]} { 769 return 770 } 771 772 ui_debug "Chosen compiler ${compiler} is provided by a port, adding dependency" 773 774 set compiler_port $compiler_name_map($compiler) 775 if {[string first "macports-gcc-" $compiler] == 0} { 776 ui_debug " Adding depends_lib port:$compiler_port" 777 depends_lib-append port:$compiler_port 778 } else { 779 ui_debug " Adding depends_build port:$compiler_port" 780 depends_build-append port:$compiler_port 781 } 782 783 if {[arch_flag_supported $compiler]} { 784 ui_debug " Adding depends_skip_archcheck port:$compiler_port" 785 depends_skip_archcheck-append $compiler_port 786 } 787 } 788 # Register the above procedure as a callback after Portfile evaluation 789 port::register_callback portconfigure::add_automatic_compiler_dependencies 790 760 791 proc portconfigure::configure_main {args} { 761 792 global [info globals] 762 793 global worksrcpath use_configure use_autoreconf use_autoconf use_automake use_xmkmf