Changeset 188


Ignore:
Timestamp:
Aug 18, 2002, 12:17:35 AM (18 years ago)
Author:
landonf (Landon Fuller)
Message:

Check in of dependency support nearing completion

Location:
trunk/base/Tcl/port1.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/Tcl/port1.0/portextract.tcl

    r181 r188  
    88
    99register com.apple.extract target build extract_main
     10register com.apple.extract swdep build depend_libs
    1011register com.apple.extract provides extract
    1112register com.apple.extract requires fetch checksum
  • trunk/base/Tcl/port1.0/portutil.tcl

    r182 r188  
    5656}
    5757
     58# XXX - Architecture specific
     59# XXX - Rely on information from internal defines in cctools/dyld:
     60# define DEFAULT_FALLBACK_FRAMEWORK_PATH
     61# /Library/Frameworks:/Library/Frameworks:/Network/Library/Frameworks:/System/Library/Frameworks
     62# define DEFAULT_FALLBACK_LIBRARY_PATH /lib:/usr/local/lib:/lib:/usr/lib
     63# Environment variables DYLD_FRAMEWORK_PATH, DYLD_LIBRARY_PATH,
     64# DYLD_FALLBACK_FRAMEWORK_PATH, and DYLD_FALLBACK_LIBRARY_PATH take precedence
     65
     66proc swdep_resolve {name chain} {
     67    global $name env
     68    puts "I am resolving dependencies one day at a time!"
     69    puts "Depname: $name"
     70    puts "Chain: $chain"
     71    if {![info exists $name]} {
     72        return 0
     73    }
     74    upvar #0 $name upname
     75    foreach depspec $upname {
     76        if {[regexp {([A-Za-z\./0-9]+):([A-Za-z0-9\.$^\?\+\(\)\|\\]+):([A-Za-z\./0-9]+)} "$depspec" match deppath depregex portname] == 1} {
     77            switch -exact -- $deppath {
     78                lib {
     79                    if {[info exists env(DYLD_FRAMEWORK_PATH)]} {
     80                        lappend search_path $env(DYLD_FRAMEWORK_PATH)
     81                    } else {
     82                        lappend search_path /Library/Frameworks /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks
     83                    }
     84                    if {[info exists env(DYLD_FALLBACK_FRAMEWORK_PATH)]} {
     85                        lappend search_path $env(DYLD_FALLBACK_FRAMEWORK_PATH)
     86                    }
     87                    if {[info exists env(DYLD_LIBRARY_PATH)]} {
     88                        lappend search_path $env(DYLD_LIBRARY_PATH)
     89                    } else {
     90                        lappend search_path /lib /usr/local/lib /lib /usr/lib
     91                    }
     92                    if {[info exists env(DYLD_FALLBACK_LIBRARY_PATH)]} {
     93                        lappend search_path $env(DYLD_LIBRARY_PATH)
     94                    }
     95                }
     96                bin {
     97                    lappend search_path $env(PATH)
     98                }
     99                default {
     100                    set search_path $deppath
     101                }
     102            }
     103        }
     104    }
     105    foreach path $search_path {
     106        puts "Now checking: $path"
     107        if {![file isdirectory $path]} {
     108            continue
     109        }
     110    }
     111    return 0
     112}
     113
    58114########### External Dependancy Manipulation Procedures ###########
    59115# register
     
    63119# The following modes are supported:
    64120#       <identifier> target <chain> <procedure to execute> [run type]
     121#       <identifier> swdep <chain> <dependency option name>
    65122#       <identifier> provides <list of target names>
    66123#       <identifier> requires <list of target names>
     
    84141            dlist_set_key targets $name runtype [lindex $args 2]
    85142        }
    86        
     143    } elseif {[string equal swdep $mode]} {
     144        set chain [lindex $args 0]
     145        set depname [lindex $args 1]
     146        if {![dlist_has_key targets $depname procedure,$chain]} {
     147            register $depname target $chain swdep_resolve
     148            register $depname provides $depname
     149            options $depname
     150        }
     151        register $name requires $depname
    87152    } elseif {[string equal requires $mode] || [string equal uses $mode] || [string equal provides $mode]} {
    88153        if {[dlist_has_item targets $name]} {
Note: See TracChangeset for help on using the changeset viewer.