Merge pull request #228 from DOCGroup/jwillemsen-patch-1
[MPC.git] / mwc.pl
blob5805d8b2815e9dca8afef729535f8e47a616305b
1 #!/usr/bin/env perl
2 eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}'
3 & eval 'exec perl -w -S $0 $argv:q'
4 if 0;
6 # ******************************************************************
7 # Author: Chad Elliott
8 # Date: 6/17/2002
9 # ******************************************************************
11 # ******************************************************************
12 # Pragma Section
13 # ******************************************************************
15 require 5.006;
17 use strict;
18 use FindBin;
19 use File::Spec;
20 use File::Basename;
22 ## Sometimes $FindBin::RealBin will end up undefined. If it is, we need
23 ## to use the directory of the built-in script name. And, for VMS, we
24 ## have to convert that into a UNIX path so that Perl can use it
25 ## internally.
26 my $basePath = (defined $FindBin::RealBin && $FindBin::RealBin ne '' ?
27 $FindBin::RealBin : File::Spec->rel2abs(dirname($0)));
28 $basePath = VMS::Filespec::unixify($basePath) if ($^O eq 'VMS');
30 ## Add the full path to the MPC modules to the Perl include path
31 my $mpcpath = $basePath;
32 unshift(@INC, $mpcpath . '/modules');
34 # Has to be a require because it's in the modules directory.
35 require mpc_debug;
37 ## If the ACE_ROOT environment variable is defined and this version of
38 ## MPC is located inside the directory to which ACE_ROOT points, we will
39 ## assume that the user wanted the ACE specific version of this script.
40 ## We will change the $basePath to what it would have been had the user
41 ## run this script out of $ACE_ROOT/bin.
42 my $aceroot = $ENV{ACE_ROOT};
43 $aceroot =~ s!\\!/!g if (defined $aceroot);
44 $basePath = $aceroot . '/bin/MakeProjectCreator'
45 if (defined $aceroot && $aceroot eq dirname($basePath));
47 require Driver;
49 # ************************************************************
50 # Subroutine Section
51 # ************************************************************
53 sub getBasePath {
54 return $mpcpath;
57 # ************************************************************
58 # Main Section
59 # ************************************************************
61 my $driver = new Driver($basePath, Driver::workspaces());
62 exit($driver->run(@ARGV));