Permalink
Browse files

attempted to make ENV modification platform independent

  • Loading branch information...
1 parent db70571 commit 835daa13182cd6707242508c9785ffcdb3bee1fb @jberger jberger committed Mar 15, 2012
Showing with 13 additions and 9 deletions.
  1. +13 −9 lib/Alien/Base.pm
View
@@ -8,6 +8,8 @@ use Carp;
use File::chdir;
use File::ShareDir ();
use Scalar::Util qw/blessed/;
+use Perl::OSType qw/is_os_type/;
+use Config;
our $VERSION = 0.01;
$VERSION = eval $VERSION;
@@ -18,15 +20,17 @@ sub import {
my $libs = $class->libs;
my @L = $libs =~ /-L(\S+)/g;
- for my $var ( qw/LD_RUN_PATH/ ) {
- my @LL = @L;
- unshift @LL, $ENV{$var} if $ENV{$var};
-
- no strict 'refs';
- $ENV{$var} = join( ':', @LL )
- unless ${ $class . "::AlienEnv" }{$var}++;
- # %Alien::MyLib::AlienEnv has keys like ENV_VAR => int
- }
+
+ #TODO investigate using Env module for this (VMS problems?)
+ my $var = is_os_type('Windows') ? 'PATH' : 'LD_RUN_PATH';
+ my @LL = @L;
+ unshift @LL, $ENV{$var} if $ENV{$var};
+
+ no strict 'refs';
+ $ENV{$var} = join( $Config::Config{path_sep}, @LL )
+ unless ${ $class . "::AlienEnv" }{$var}++;
+ # %Alien::MyLib::AlienEnv has keys like ENV_VAR => int (true if loaded)
+
}
sub dist_dir {

0 comments on commit 835daa1

Please sign in to comment.