In reply to Ted Stern (dod...@gm...):
> This seems very basic but I'm a Tcl newbie and can't see how to do it.
This is our gcc4.0.0 module, I think its a great example of
what your trying to do, its a nice complicated example you should be
able to look at and decide what you want to really do.
Thanks,
Kent Mein
#%Module######################################################################
##
## GNU Module
##
proc ModulesHelp { } {
puts stderr "\tThe EGCS module contains gcc, g++, and f77, popular compilers f
or C, C++, and Fortran.\n"
puts stderr "\tVersion 3.4"
puts stderr "\tWebsite: http://gcc.gnu.org/"
}
set sys [uname sysname]
set os [uname release]
set arch [uname machine]
append-path MANPATH /soft/gcc-4.0.0/man
switch -glob $sys {
SunOS* {
switch -glob $os {
5.7 {
append-path PATH /soft/gcc-4.0.0/SunOS5.7/bin
}
default {
append-path PATH /soft/gcc-4.0.0/SunOS5.8/bin
}
}
}
SunOS {
switch -glob $os {
5.7 {
append-path PATH /soft/gcc-2.95.3/SunOS5.7/bin
}
default {
append-path PATH /soft/gcc-4.0.0/SunOS5.8/bin
}
}
}
Linux* {
if { [string compare $arch "x86_64"] == 0} {
prepend-path PATH /soft/gcc-4.0.0/x86_64/bin
} else {
if { [file isfile /bin/lsb_release] } {
set os [exec /bin/lsb_release -c | /usr/bin/cut -f2]
} else {
set os "unknown"
}
switch -glob $os {
warty {
prepend-path PATH /soft/gcc-4.0.0/ubuntu/bin
}
hoary {
prepend-path PATH /soft/gcc-4.0.0/ubuntu/bin
}
default {
prepend-path PATH /soft/gcc-4.0.0/debian/bin
}
}
}
}
}
|