#!/usr/bin/perl -w
#
# Module to compute TOOLHOME and put in the environment
#
# $Id$
#
require Exporter;
@ISA = qw(Exporter);
@EXPORT = qw(set_toolhome);

use strict;
use File::Basename;

sub set_toolhome {

my $tmp = dirname($PROGRAM_NAME);
#print "$tmp\n";
if ($tmp =~ /^\//) {
        $ENV{'TOOLHOME'} = $tmp;
        }
else {
        $ENV{'TOOLHOME'} = "$ENV{PWD}/$tmp";
        }

die "TOOLHOME doesn't exist" if (not (defined $ENV{'TOOLHOME'}));
}
1;
