Show
Ignore:
Timestamp:
13.07.2010 13:44:54 (10 years ago)
Author:
davidb
Message:

Renamed setup.pl to video-and-audio-setup.pl, so this file (and the equivalent in other extensions) can be uniquely loaded. Having them all as 'setup.pl' does not work, as after the first file is loaded in with a 'require' then any subsequent attempt to load the next extension's 'setup.pl' file fails, because (in Perl's view of the world) it has already loaded in 'setup.pl'

Files:
1 moved

Legend:

Unmodified
Added
Removed
  • gs2-extensions/video/trunk/video-and-audio-setup.pl

    r18959 r22387  
    1010require util;     
    1111 
    12 if (!defined $ENV{'GEXTVIDEO'}) { 
     12my $env_ext  = "GEXTVIDEO"; 
     13my $ext_desc = "the Video and Audio Extension"; 
     14 
     15if (!defined $ENV{$env_ext}) { 
    1316     
     17    my $ext_home = cwd(); 
     18    my $ext_os = $ENV{'GSDLOS'}; 
    1419 
    15     $ENV{'GEXTVIDEO'} = cwd(); 
    16     print STDERR "**** GEXTVIDEO=$ENV{'GEXTVIDEO'}\n"; 
     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; 
    1728     
    18     $ENV{'GEXTVIDEO_INSTALLED'} 
    19     = &util::filename_cat($ENV{'GEXTVIDEO'},"installed"); 
     29    $ENV{$ext_installed} = &util::filename_cat($ext_home,$ext_os); 
    2030 
    21     my $video_bin 
    22     = &util::filename_cat($ENV{'GEXTVIDEO_INSTALLED'},$ENV{'GSDLOS'},"bin"); 
    23     my $video_lib 
    24     = &util::filename_cat($ENV{'GEXTVIDEO_INSTALLED'},$ENV{'GSDLOS'},"lib"); 
     31    my $ext_bin = &util::filename_cat($ENV{$ext_installed},"bin"); 
     32    my $ext_lib = &util::filename_cat($ENV{$ext_installed},"lib"); 
    2533 
    26     &util::envvar_append("PATH",$video_bin); 
     34    &util::envvar_append("PATH",$ext_bin); 
    2735 
    28     # For Linux (no harm is setting is this for MacOs) 
    29     &util::envvar_append("LD_LIBRARY_PATH",$video_lib); 
    30      
    31     # For MacOs (no harm is setting is this for Linux etc) 
    32     &util::envvar_append("DYLD_LIBRARY_PATH",$video_lib); 
    33  
     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    } 
    3442 
    3543    # GSDLEXTS always uses : as a separator 
    3644    if (defined $ENV{'GSDLEXTS'}) { 
    37     $ENV{'GSDLEXTS'} .= ":video" ; 
     45    $ENV{'GSDLEXTS'} .= ":$ext_dir"; 
    3846    } 
    3947    else { 
    40     $ENV{'GSDLEXTS'} .="video"; 
     48    $ENV{'GSDLEXTS'} = $ext_dir; 
    4149    } 
     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} 
    4256 
     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    } 
    4367} 
     68 
     691;