Skip to content
Permalink
Browse files

Check in of dependency support nearing completion

git-svn-id: https://svn.macports.org/repository/macports/trunk/base@188 d073be05-634f-4543-b044-5fe20cf6d1d6
  • Loading branch information
landonf committed Aug 18, 2002
1 parent 151669f commit f6fd7b24f9aea66469043881ed7e23bb4fda6472
Showing with 67 additions and 1 deletion.
  1. +1 −0 Tcl/port1.0/portextract.tcl
  2. +66 −1 Tcl/port1.0/portutil.tcl
@@ -7,6 +7,7 @@ package provide portextract 1.0
package require portutil 1.0

register com.apple.extract target build extract_main
register com.apple.extract swdep build depend_libs
register com.apple.extract provides extract
register com.apple.extract requires fetch checksum

@@ -55,13 +55,70 @@ proc makeuserproc {name body} {
eval "proc $name {} $body"
}

# XXX - Architecture specific
# XXX - Rely on information from internal defines in cctools/dyld:
# define DEFAULT_FALLBACK_FRAMEWORK_PATH
# /Library/Frameworks:/Library/Frameworks:/Network/Library/Frameworks:/System/Library/Frameworks
# define DEFAULT_FALLBACK_LIBRARY_PATH /lib:/usr/local/lib:/lib:/usr/lib
# Environment variables DYLD_FRAMEWORK_PATH, DYLD_LIBRARY_PATH,
# DYLD_FALLBACK_FRAMEWORK_PATH, and DYLD_FALLBACK_LIBRARY_PATH take precedence

proc swdep_resolve {name chain} {
global $name env
puts "I am resolving dependencies one day at a time!"
puts "Depname: $name"
puts "Chain: $chain"
if {![info exists $name]} {
return 0
}
upvar #0 $name upname
foreach depspec $upname {
if {[regexp {([A-Za-z\./0-9]+):([A-Za-z0-9\.$^\?\+\(\)\|\\]+):([A-Za-z\./0-9]+)} "$depspec" match deppath depregex portname] == 1} {
switch -exact -- $deppath {
lib {
if {[info exists env(DYLD_FRAMEWORK_PATH)]} {
lappend search_path $env(DYLD_FRAMEWORK_PATH)
} else {
lappend search_path /Library/Frameworks /Library/Frameworks /Network/Library/Frameworks /System/Library/Frameworks
}
if {[info exists env(DYLD_FALLBACK_FRAMEWORK_PATH)]} {
lappend search_path $env(DYLD_FALLBACK_FRAMEWORK_PATH)
}
if {[info exists env(DYLD_LIBRARY_PATH)]} {
lappend search_path $env(DYLD_LIBRARY_PATH)
} else {
lappend search_path /lib /usr/local/lib /lib /usr/lib
}
if {[info exists env(DYLD_FALLBACK_LIBRARY_PATH)]} {
lappend search_path $env(DYLD_LIBRARY_PATH)
}
}
bin {
lappend search_path $env(PATH)
}
default {
set search_path $deppath
}
}
}
}
foreach path $search_path {
puts "Now checking: $path"
if {![file isdirectory $path]} {
continue
}
}
return 0
}

########### External Dependancy Manipulation Procedures ###########
# register
# Creates a target in the global target list using the internal dependancy
# functions
# Arguments: <identifier> <mode> <args ...>
# The following modes are supported:
# <identifier> target <chain> <procedure to execute> [run type]
# <identifier> swdep <chain> <dependency option name>
# <identifier> provides <list of target names>
# <identifier> requires <list of target names>
# <identifier> uses <list of target names>
@@ -83,7 +140,15 @@ proc register {name mode args} {
if {[llength $args] == 3} {
dlist_set_key targets $name runtype [lindex $args 2]
}

} elseif {[string equal swdep $mode]} {
set chain [lindex $args 0]
set depname [lindex $args 1]
if {![dlist_has_key targets $depname procedure,$chain]} {
register $depname target $chain swdep_resolve
register $depname provides $depname
options $depname
}
register $name requires $depname
} elseif {[string equal requires $mode] || [string equal uses $mode] || [string equal provides $mode]} {
if {[dlist_has_item targets $name]} {
dlist_append_key targets $name $mode $args

0 comments on commit f6fd7b2

Please sign in to comment.
You can’t perform that action at this time.