
BEGIN {
    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
}

use Cwd;
require util;    

if (!defined $ENV{'GEXTVIDEO'}) {
    

    $ENV{'GEXTVIDEO'} = cwd();
    print STDERR "**** GEXTVIDEO=$ENV{'GEXTVIDEO'}\n";
    
    $ENV{'GEXTVIDEO_INSTALLED'}
    = &util::filename_cat($ENV{'GEXTVIDEO'},"installed");

    my $video_bin
	= &util::filename_cat($ENV{'GEXTVIDEO_INSTALLED'},$ENV{'GSDLOS'},"bin");
    my $video_lib
	= &util::filename_cat($ENV{'GEXTVIDEO_INSTALLED'},$ENV{'GSDLOS'},"lib");

    &util::envvar_append("PATH",$video_bin);

    # For Linux (no harm is setting is this for MacOs)
    &util::envvar_append("LD_LIBRARY_PATH",$video_lib);
    
    # For MacOs (no harm is setting is this for Linux etc)
    &util::envvar_append("DYLD_LIBRARY_PATH",$video_lib);


    # GSDLEXTS always uses : as a separator
    if (defined $ENV{'GSDLEXTS'}) {
	$ENV{'GSDLEXTS'} .= ":video" ;
    }
    else {
	$ENV{'GSDLEXTS'} .="video";
    }

}
