From a95af766bb526c5a8a4c19d8dcef737ac0faf3f9 Mon Sep 17 00:00:00 2001 From: elliott_c Date: Thu, 28 Oct 2010 11:44:52 +0000 Subject: ChangeLogTag: Thu Oct 28 11:44:02 UTC 2010 Chad Elliott --- mwc.pl | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'mwc.pl') diff --git a/mwc.pl b/mwc.pl index f2d9187e..7b8ce205 100755 --- a/mwc.pl +++ b/mwc.pl @@ -27,7 +27,20 @@ use File::Basename; my $basePath = (defined $FindBin::RealBin && $FindBin::RealBin ne '' ? $FindBin::RealBin : File::Spec->rel2abs(dirname($0))); $basePath = VMS::Filespec::unixify($basePath) if ($^O eq 'VMS'); -unshift(@INC, $basePath . '/modules'); + +## Add the full path to the MPC modules to the Perl include path +my $mpcpath = $basePath; +unshift(@INC, $mpcpath . '/modules'); + +## If the ACE_ROOT environment variable is defined and this version of +## MPC is located inside the directory to which ACE_ROOT points, we will +## assume that the user wanted the ACE specific version of this script. +## We will change the $basePath to what it would have been had the user +## run this script out of $ACE_ROOT/bin. +my $aceroot = $ENV{ACE_ROOT}; +$aceroot =~ s!\\!/!g if (defined $aceroot); +$basePath = $aceroot . '/bin/MakeProjectCreator' + if (defined $aceroot && $aceroot eq dirname($basePath)); require Driver; @@ -36,7 +49,7 @@ require Driver; # ************************************************************ sub getBasePath { - return $basePath; + return $mpcpath; } # ************************************************************ -- cgit v1.2.1