root/gs2-extensions/video-and-audio/trunk/src/video-and-audio-setup.pl @ 23036

Revision 23036, 1.5 KB (checked in by sjm84, 9 years ago)

The video extension now uses the new folder layout

RevLine 
[18942]1
2BEGIN {
3    die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
4    die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
5    unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
6    unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
7}
8
9use Cwd;
10require util;   
11
[22387]12my $env_ext  = "GEXTVIDEO";
13my $ext_desc = "the Video and Audio Extension";
[18942]14
[22387]15if (!defined $ENV{$env_ext}) {
[18942]16   
[22387]17    my $ext_home = cwd();
18    my $ext_os = $ENV{'GSDLOS'};
[18942]19
[22387]20    my ($ext_dir,$_prefix_dir) = File::Basename::fileparse($ext_home);
[18942]21
[22387]22    print STDERR "*** ext_dir = $ext_dir\n\n\n";
[18942]23
[22387]24
25    my $ext_installed = $env_ext."_INSTALLED";
26
27    $ENV{$env_ext} = $ext_home;
[18942]28   
[22387]29    $ENV{$ext_installed} = &util::filename_cat($ext_home,$ext_os);
[18942]30
[22387]31    my $ext_bin = &util::filename_cat($ENV{$ext_installed},"bin");
32    my $ext_lib = &util::filename_cat($ENV{$ext_installed},"lib");
[18942]33
[22387]34    &util::envvar_append("PATH",$ext_bin);
35
36    if ($ext_os =~ m/darwin/i) {
37    &util::envvar_append("DYLD_LIBRARY_PATH",$ext_lib);
38    }
39    else {
40    &util::envvar_append("LD_LIBRARY_PATH",$ext_lib);
41    }
42
[18942]43    # GSDLEXTS always uses : as a separator
44    if (defined $ENV{'GSDLEXTS'}) {
[22387]45    $ENV{'GSDLEXTS'} .= ":$ext_dir";
[18942]46    }
47    else {
[22387]48    $ENV{'GSDLEXTS'} = $ext_dir;
[18942]49    }
[22387]50   
51    print STDERR "+Your environment is now setup for $ext_desc\n";
52}
53else {   
54    print STDERR "+Your environment is already setup for $ext_desc\n";
55}
[18942]56
[22387]57if (scalar(@ARGV>0)) {
58
59    print STDERR "\n";
60
61    my $cmd = join(" ",map {$_ = "\"$_\""} @ARGV);
62
63    if (system($cmd)!=0) {
64    print STDERR "\nError: Failed to run '$cmd'\n";
65    print STDERR "$!\n";
66    }
[18942]67}
[22387]68
691;
Note: See TracBrowser for help on using the browser.