[wcf3] I've been working on my new AMD 64-bit system (with SuSE 9.2) and learned very quickly that the existing platform specific package loading I was using didn't handle 64-bit stuff at all well. That combined with my desire for a easier way of building platform specific [Starpack]s that didn't contain the extensions for the platforms not needed by the wrapped runtime...I worked out the following. ''Observation: Some extensions (e.g. tile) depend on the windowing system in use (I'm assuming...). For example, tile might be compiled against X11 or against Aqua on MacOSX. The following code places all extensions for an architecture in one place which makes it impossible to support both Aqua and X11. Admittedly this is a bit of an edge case, but it might be good to append [tk windowingsystem] to the computed library name'' Simply place the following '''[pkgIndex.tcl]''' file in your '''xxx.vfs/lib''' directory and place all platform specific extensions in directories such as '''xxx.vfs/lib/_platform_Darwin-ppc''' or '''xxx.vfs/lib/_platform_Linux-x86_64''' # Extend the auto_path variable to include a platform specific directory. # This provides the means for multi-platform Starkits easily. When # wrapping a starkit with a runtime binary, you can exclude unneeded # platform specific extensions by add the -ignore option to the wrap # command as such: # # tclkit sdx.kit wrap myapp.freebsd5 -runtime tclkit-freebsd5-x86 \ # -ignore _platform_Darwin-ppc -ignore _platform_Linux-x86 \ # -ignore _platform_Linux-x86_64 -ignore _platform_Windows-x86 # # Platform specific directories are located in the lib directory of the # .vfs and are named like: # _platform_Darwin-ppc # _platform_FreeBSD-x86 # _platform_FreeBSD-x86_64 # _platform_Linux-x86_32 # _platform_Linux-x86_64 # _platform_SunOS-sparc # _platform_SunOS-x86_32 # _platform_Windows-x86_32 # # The platform directory will be picked by selecting a name based # on the platform os, machine, and word size. The word size is # optional and will be selected if the directory exists, otherwise it # will fall back to the directory without the word size. # # Created by Chuck Ferril 04/2005 # proc ::auto_path4platform { dir } { rename ::auto_path4platform {} switch -glob -- $::tcl_platform(machine) { sun4* { set platformBinary "[lindex $::tcl_platform(os) 0]-sparc" } intel - x86* - i*86* { set platformBinary "[lindex $::tcl_platform(os) 0]-x86" } "Power*" { set platformBinary "[lindex $::tcl_platform(os) 0]-ppc" } default { set platformBinary "[lindex $::tcl_platform(os) 0]-$::tcl_platform(machine)" } } set platformDir [file join $dir "_platform_$platformBinary"] if { [info exists ::tcl_platform(wordSize)] } { set testDir "${platformDir}_[expr {$::tcl_platform(wordSize) * 8}]" # if a wordsize specific directory exists, use it instead if { [file exists $testDir] } { set platformDir $testDir } } if { [file exists $platformDir] && [lsearch -exact $::auto_path $platformDir] == -1 } { lappend ::auto_path $platformDir } } ::auto_path4platform $dir ---- [LV] Just curious, why prefix the directory with _platform_ ? Note, however, I'd love to see something like this added to [sdx]'s default directory layout, generated with the qwrap/unwrap combination. [wcf3] So you can easily exclude it from other packages. My goal was to reverse the -ignore option, and make a '-platform FreeBSD-x86' option that would exclude anything except the _platform_FreeBSD-x86 directory. The _platform_ makes it really clear that it is a platform specific directory tree so that in the future it would just work when a _platform_MrCoffee-z80 shows up. ---- See also [auto_path], [starkit], ---- [Category Command]