ChangeLogTag: Thu Jul 10 14:17:10 UTC 2014 Chad Elliott <elliott_c@ociweb.com>
[MPC.git] / mwc.pl
blobf5b090f8a4ecf2ddcfbb21986fd878cbcafbe108
1 #! /usr/bin/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 # $Id$
10 # ******************************************************************
12 # ******************************************************************
13 # Pragma Section
14 # ******************************************************************
16 require 5.006;
18 use strict;
19 use FindBin;
20 use File::Spec;
21 use File::Basename;
23 ## Sometimes $FindBin::RealBin will end up undefined. If it is, we need
24 ## to use the directory of the built-in script name. And, for VMS, we
25 ## have to convert that into a UNIX path so that Perl can use it
26 ## internally.
27 my $basePath = (defined $FindBin::RealBin && $FindBin::RealBin ne '' ?
28 $FindBin::RealBin : File::Spec->rel2abs(dirname($0)));
29 $basePath = VMS::Filespec::unixify($basePath) if ($^O eq 'VMS');
31 ## Add the full path to the MPC modules to the Perl include path
32 my $mpcpath = $basePath;
33 unshift(@INC, $mpcpath . '/modules');
35 # Has to be a require because it's in the modules directory.
36 require mpc_debug;
38 ## If the ACE_ROOT environment variable is defined and this version of
39 ## MPC is located inside the directory to which ACE_ROOT points, we will
40 ## assume that the user wanted the ACE specific version of this script.
41 ## We will change the $basePath to what it would have been had the user
42 ## run this script out of $ACE_ROOT/bin.
43 my $aceroot = $ENV{ACE_ROOT};
44 $aceroot =~ s!\\!/!g if (defined $aceroot);
45 $basePath = $aceroot . '/bin/MakeProjectCreator'
46 if (defined $aceroot && $aceroot eq dirname($basePath));
48 require Driver;
50 # ************************************************************
51 # Subroutine Section
52 # ************************************************************
54 sub getBasePath {
55 return $mpcpath;
58 # ************************************************************
59 # Main Section
60 # ************************************************************
62 my $driver = new Driver($basePath, Driver::workspaces());
63 exit($driver->run(@ARGV));