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

Line 
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
12my $env_ext  = "GEXTVIDEO";
13my $ext_desc = "the Video and Audio Extension";
14
15if (!defined $ENV{$env_ext}) {
16   
17    my $ext_home = cwd();
18    my $ext_os = $ENV{'GSDLOS'};
19
20    my ($ext_dir,$_prefix_dir) = File::Basename::fileparse($ext_home);
21
22    print STDERR "*** ext_dir = $ext_dir\n\n\n";
23
24
25    my $ext_installed = $env_ext."_INSTALLED";
26
27    $ENV{$env_ext} = $ext_home;
28   
29    $ENV{$ext_installed} = &util::filename_cat($ext_home,$ext_os);
30
31    my $ext_bin = &util::filename_cat($ENV{$ext_installed},"bin");
32    my $ext_lib = &util::filename_cat($ENV{$ext_installed},"lib");
33
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
43    # GSDLEXTS always uses : as a separator
44    if (defined $ENV{'GSDLEXTS'}) {
45    $ENV{'GSDLEXTS'} .= ":$ext_dir";
46    }
47    else {
48    $ENV{'GSDLEXTS'} = $ext_dir;
49    }
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}
56
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    }
67}
68
691;
Note: See TracBrowser for help on using the browser.