
set self    [file normalize [info script]]
set selfdir [file dirname $self]
set topdir  [file dirname $selfdir]

# Cases
# self = FOO/apps/dtplite => FOO/modules has tcllib modules.
#      | FOO/bin/dtplite  => FOO/lib     has tcllib (not modules).
# => topdir = FOO

if {[file exists [file join $topdir modules]]} {
    lappend auto_path [file join $topdir modules]
} elseif {[file exists [file join $topdir lib]]} {
    [file join $topdir lib]
}
