source: gs2-extensions/video-and-audio/trunk/src/video-and-audio-setup.pl

Last change on this file was 23195, checked in by davidb, 14 years ago

Removed debugging statement

File size: 1.5 KB
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 my $ext_installed = $env_ext."_INSTALLED";
23
24 $ENV{$env_ext} = $ext_home;
25
26 $ENV{$ext_installed} = &util::filename_cat($ext_home,$ext_os);
27
28 my $ext_bin = &util::filename_cat($ENV{$ext_installed},"bin");
29 my $ext_lib = &util::filename_cat($ENV{$ext_installed},"lib");
30
31 &util::envvar_append("PATH",$ext_bin);
32
33 if ($ext_os =~ m/darwin/i) {
34 &util::envvar_append("DYLD_LIBRARY_PATH",$ext_lib);
35 }
36 else {
37 &util::envvar_append("LD_LIBRARY_PATH",$ext_lib);
38 }
39
40 # GSDLEXTS always uses : as a separator
41 if (defined $ENV{'GSDLEXTS'}) {
42 $ENV{'GSDLEXTS'} .= ":$ext_dir";
43 }
44 else {
45 $ENV{'GSDLEXTS'} = $ext_dir;
46 }
47
48 print STDERR "+Your environment is now setup for $ext_desc\n";
49}
50else {
51 print STDERR "+Your environment is already setup for $ext_desc\n";
52}
53
54if (scalar(@ARGV>0)) {
55
56 print STDERR "\n";
57
58 my $cmd = join(" ",map {$_ = "\"$_\""} @ARGV);
59
60 if (system($cmd)!=0) {
61 print STDERR "\nError: Failed to run '$cmd'\n";
62 print STDERR "$!\n";
63 }
64}
65
661;
Note: See TracBrowser for help on using the repository browser.