diff options
author | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-27 20:28:46 +0000 |
---|---|---|
committer | brunsch <brunsch@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2000-04-27 20:28:46 +0000 |
commit | 25c85b5160c3e65ac330b832a2b9a21401d6a53c (patch) | |
tree | efee574f3244e4598708cb5539951d997d6aae85 /bin/msvc_auto_compile.pl | |
parent | fbb9ede84749a568a02ca0dc6a21b59ef650550a (diff) | |
download | ATCD-25c85b5160c3e65ac330b832a2b9a21401d6a53c.tar.gz |
Thu Apr 27 13:08:00 2000 Darrell Brunsch <brunsch@uci.edu>
Diffstat (limited to 'bin/msvc_auto_compile.pl')
-rwxr-xr-x | bin/msvc_auto_compile.pl | 304 |
1 files changed, 161 insertions, 143 deletions
diff --git a/bin/msvc_auto_compile.pl b/bin/msvc_auto_compile.pl index fc950b5a448..c1cdbe55166 100755 --- a/bin/msvc_auto_compile.pl +++ b/bin/msvc_auto_compile.pl @@ -5,15 +5,16 @@ use File::Find; use Cwd; if (!$ENV{ACE_ROOT}) { - $ACE_ROOT = "."; + warn "ACE_ROOT not defined, defaulting to ACE_ROOT=."; + $ACE_ROOT = "."; } else { - $ACE_ROOT = $ENV{ACE_ROOT}; + $ACE_ROOT = $ENV{ACE_ROOT}; } @directories = ($ACE_ROOT); -$Verbose = 0; +$verbose = 0; $Ignore_errors = 0; # By default, bail out if an error occurs. $Build_DLL = 0; $Build_LIB = 0; @@ -28,51 +29,52 @@ $use_custom_dir = 0; # of strings that include the project name and the configuration sub Find_dsp (@) { - my (@dir) = @_; - @array = (); - my @config_array = (); - - # wanted is only used for the File::Find - sub wanted - { - $array[++$#array] = $File::Find::name if ($File::Find::name =~ /\.dsp/i); - } - - # get_config grabs the configurations out of a dsp file. - sub get_config ($) - { - my ($file) = @_; - my @configs = (); - - print "Looking at $file\n" if ($Verbose); - - open (DSP, "<$file"); + my (@dir) = @_; + @array = (); + my @config_array = (); - while (<DSP>) + # wanted is only used for the File::Find + sub wanted { - push @configs, $1 if (/# Name \"([^\"]+)\"/); + $array[++$#array] = $File::Find::name if ($File::Find::name =~ /\.dsp/i); } + + # get_config grabs the configurations out of a dsp file. + sub get_config ($) + { + my ($file) = @_; + my @configs = (); + + print "Looking at $file\n" if ($verbose); + + open (DSP, "<$file"); + + while (<DSP>) + { + push @configs, $1 if (/# Name \"([^\"]+)\"/); + } - close (DSP); - return @configs; - } + close (DSP); + return @configs; + } - unshift @dir, (\&wanted); + unshift @dir, (\&wanted); - find @dir; + find @dir; - for ($i = 0; $i <= $#array; ++$i) { - my $filename = "$array[$i]"; - $filename =~ s@/./@/@g; - $filename =~ s@/@\\@g; - my @dsp_configs = get_config ($array[$i]); + for ($i = 0; $i <= $#array; ++$i) { + my $filename = "$array[$i]"; + + $filename =~ s@/./@/@g; + $filename =~ s@/@\\@g; + my @dsp_configs = get_config ($array[$i]); - for ($j = 0; $j <= $#dsp_configs; ++$j) { - push @config_array, "$filename--$dsp_configs[$j]"; + for ($j = 0; $j <= $#dsp_configs; ++$j) { + push @config_array, "$filename--$dsp_configs[$j]"; + } } - } - return @config_array; + return @config_array; } @@ -80,154 +82,173 @@ sub Find_dsp (@) # runs msdev to build it. sub Build_Config ($) { - my ($arg) = @_; - my ($project, $config) = split /--/, $arg; + my ($arg) = @_; + my ($project, $config) = split /--/, $arg; + + print "Auto_compiling $project : $config\n"; + return Build ($project, $config); +} + +# Build +sub Build ($$) +{ + my ($project, $config) = @_; + + print "Building $project $config\n" if $verbose; - print "Auto_compiling $project : $config\n"; return system ("msdev.com $project /MAKE \"$config\" $Build_Cmd"); } -# Only builds the TAOACE core. +# Only builds the core libraries. sub Build_Core () { - print "Building Core of ACE/TAO\n" if ($Verbose == 1); - - print "Build \n" if ($Verbose); - print "Debug " if ($Verbose) && ($Build_Debug); - print "Release " if ($Verbose) && ($Build_Release); - print "DLL " if ($Verbose) && ($Build_DLL); - print "LIB " if ($Verbose) && ($Build_LIB); - print "\n" if ($Verbose); - - if ($Build_DLL) - { - if ($Build_Debug) - { - $Status = Build_Config ($ACE_ROOT."\\TAO\\TAOACE.dsw--Naming_Service - Win32 Debug"); - return if $Status != 0 && !$Ignore_errors; + print "Building Core of ACE/TAO\n" if ($verbose == 1); + + print "Build \n" if ($verbose); + print "Debug " if ($verbose) && ($Build_Debug); + print "Release " if ($verbose) && ($Build_Release); + print "DLL " if ($verbose) && ($Build_DLL); + print "LIB " if ($verbose) && ($Build_LIB); + print "\n" if ($verbose); + + my @core_list = (); + + if ($Build_DLL) { + push @core_list, ($ACE_ROOT."\\ace\\ace_dll.dsp", + $ACE_ROOT."\\apps\\gperf\\src\\gperf_lib.dsp", + $ACE_ROOT."\\apps\\gperf\\src\\gperf.dsp", + $ACE_ROOT."\\TAO\\TAO_IDL\\tao_idl.dsp", + $ACE_ROOT."\\TAO\\tao\\TAO.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\orbsvcs.dsw"); } - if ($Build_Release) - { - $Status = Build_Config ($ACE_ROOT."\\TAO\\TAOACE.dsw--Naming_Service - Win32 Release"); - return if $Status != 0 && !$Ignore_errors; + if ($Build_LIB) { + push @core_list, ($ACE_ROOT."\\ace\\ace_lib.dsp", + $ACE_ROOT."\\apps\\gperf\\src\\gperf_lib.dsp", + $ACE_ROOT."\\apps\\gperf\\src\\gperf.dsp", + $ACE_ROOT."\\TAO\\TAO_IDL\\tao_idl_static.dsp", + $ACE_ROOT."\\TAO\\tao\\TAO_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\Svc_Utils_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\CosNaming_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\CosProperty_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\CosTrading_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\AV_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\RTSched_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\RTEvent_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\CosEvent_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\CosConcurrency_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\CosLifeCycle_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\CosTime_Static.dsp", + $ACE_ROOT."\\TAO\\orbsvcs\\orbsvcs\\DsLogAdmin_Static.dsp"); } - } - if ($Build_LIB) - { - if ($Build_Debug) - { - $Status = Build_Config ("$ACE_ROOT\\TAO\\TAOACE_static.dsw--Naming_Service Static - Win32 Static Debug"); - return if $Status != 0 && !$Ignore_errors; - } - if ($Build_Release) - { - $Status = Build_Config ("$ACE_ROOT\\TAO\\TAOACE_static.dsw--Naming_Service Static - Win32 Static Release"); - return if $Status != 0 && !$Ignore_errors; + foreach $c (@core_list) { + if ($Build_DLL && $Build_Debug) { + $Status = Build ($c, "ALL - Win32 Debug"); + return if $Status != 0 && !$Ignore_errors; + } + elsif ($Build_DLL && $Build_Release) { + $Status = Build ($c, "ALL - Win32 Release"); + return if $Status != 0 && !$Ignore_errors; + } + elsif ($Build_LIB && $Build_Debug) { + $Status = Build ($c, "ALL - Win32 Static Debug"); + return if $Status != 0 && !$Ignore_errors; + } + elsif ($Build_LIB && $Build_Release) { + $Status = Build ($c, "ALL - Win32 Static Release"); + return if $Status != 0 && !$Ignore_errors; + } } - } } sub Build_All () { - my @configurations = Find_dsp (@directories); + my @configurations = Find_dsp (@directories); - print "\nmsvc_auto_compile: First Pass (libraries)\n"; + print "\nmsvc_auto_compile: First Pass (libraries)\n"; - foreach $c (@configurations) - { - if ($Build_All - || ($Build_DLL && $Build_Debug && $c =~ /Win32 Debug/) - || ($Build_DLL && $Build_Release && $c =~ /Win32 Release/) - || ($Build_LIB && $Build_Debug && $c =~ /Win32 Static Debug/) - || ($Build_LIB && $Build_Release && $c =~ /Win32 Static Release/)) - { - Build_Config ($c) if (($c =~ /Library/) || ($c =~ /DLL/) || ($c =~ /LIB/)); + foreach $c (@configurations) { + if ($Build_All + || ($Build_DLL && $Build_Debug && $c =~ /Win32 Debug/) + || ($Build_DLL && $Build_Release && $c =~ /Win32 Release/) + || ($Build_LIB && $Build_Debug && $c =~ /Win32 Static Debug/) + || ($Build_LIB && $Build_Release && $c =~ /Win32 Static Release/)) + { + $Status = Build_Config ($c) + if (($c =~ /Library/) || ($c =~ /DLL/) || ($c =~ /LIB/)); + return if $Status !=0 && !$Ignore_errors; + } } - } - print "\nmsvc_auto_compile: Second Pass\n"; + print "\nmsvc_auto_compile: Second Pass\n"; - foreach $c (@configurations) - { - Build_Config ($c) - if ($Build_All - || ($Build_DLL && $Build_Debug && $c =~ /Win32 Debug/) - || ($Build_DLL && $Build_Release && $c =~ /Win32 Release/) - || ($Build_LIB && $Build_Debug && $c =~ /Win32 Static Debug/) - || ($Build_LIB && $Build_Release && $c =~ /Win32 Static Release/)); - } + foreach $c (@configurations) { + Build_Config ($c) + if ($Build_All + || ($Build_DLL && $Build_Debug && $c =~ /Win32 Debug/) + || ($Build_DLL && $Build_Release && $c =~ /Win32 Release/) + || ($Build_LIB && $Build_Debug && $c =~ /Win32 Static Debug/) + || ($Build_LIB && $Build_Release && $c =~ /Win32 Static Release/)); + } } ## Parse command line argument while ( $#ARGV >= 0 && $ARGV[0] =~ /^(-|\/)/ ) { - if ( $ARGV[0] =~ '(-|\/)k' ) # Ignore error. Compile the whole thing - { - print "Ignore errors\n" if ( $Verbose ); - $Ignore_errors = 1; # in the same configuration. + if ($ARGV[0] =~ '-k') { # Ignore errors + print "Ignore errors\n" if ( $verbose ); + $Ignore_errors = 1; } - elsif ( $ARGV[0] =~ '(-|\/)v' ) # Verbose mode - { - $Verbose = 1; + elsif ($ARGV[0] =~ '-v') { # verbose mode + $verbose = 1; } - elsif ( $ARGV[0] =~ '(-|\/)core' ) # Build only the core of ace/tao - { - print "Building Core only\n" if ( $Verbose ); + elsif ($ARGV[0] =~ '-core') { # Build only the core of ace/tao + print "Building Core only\n" if ( $verbose ); $build_core_only = 1; } - elsif ( $ARGV[0] =~ '(-|\/)dir' ) - { + elsif ($ARGV[0] =~ '-dir') { # Compile only a specific directory shift; - print "Adding directory $ARGV[0]\n" if ( $Verbose ); - if (!$use_custom_dir) - { + print "Adding directory $ARGV[0]\n" if ( $verbose ); + if (!$use_custom_dir) { $use_custom_dir = 1; @directories = (); } push @directories, $ARGV[0]; } - elsif ( $ARGV[0] =~ '(-|\/)rebuild' ) # Rebuild all - { - print "Rebuild all\n" if ( $Verbose ); + elsif ($ARGV[0] =~ '-rebuild') { # Rebuild all + print "Rebuild all\n" if ( $verbose ); $Build_Cmd = "/REBUILD"; } - elsif ( $ARGV[0] =~ '(-|\/)clean' ) # Clean - { - print "Cleaning all\n" if ( $Verbose ); + elsif ($ARGV[0] =~ '-clean') { # Clean + print "Cleaning all\n" if ( $verbose ); $Build_Cmd = "/CLEAN"; } - elsif ( $ARGV[0] =~ '(-|\/)Debug' ) # Debug versions - { - print "Building Debug Version\n" if ( $Verbose ); + elsif ($ARGV[0] =~ '-Debug') { # Debug versions + print "Building Debug Version\n" if ( $verbose ); $Build_Debug = 1; $Build_All = 0; } - elsif ( $ARGV[0] =~ '(-|\/)Release' ) # Release versions - { - print "Building Release Version\n" if ( $Verbose ); + elsif ($ARGV[0] =~ '-Release') { # Release versions + print "Building Release Version\n" if ( $verbose ); $Build_Release = 1; $Build_All = 0; } - elsif ( $ARGV[0] =~ '(-|\/)DLL' ) # Build DLL only - { - print "Build DLL only\n" if ( $Verbose ); + elsif ($ARGV[0] =~ '-DLL') { # Build DLL only + print "Build DLL only\n" if ( $verbose ); $Build_DLL = 1; $Build_All = 0; } - elsif ( $ARGV[0] =~ '(-|\/)LIB' ) # Build LIB only - { - print "Build LIB only\n" if ( $Verbose ); + elsif ($ARGV[0] =~ '-LIB') { # Build LIB only + print "Build LIB only\n" if ( $verbose ); $Build_LIB = 1; $Build_All = 0; } - elsif ( $ARGV[0] =~ '(-|\/)(\?|h)') - { + elsif ($ARGV[0] =~ '-(\?|h)') { # Help information print "Options\n"; print "-k = Ignore Errors\n"; - print "-v = Script Verbose Mode\n"; + print "-v = Script verbose Mode\n"; print "-core = Build the Core\n"; print "-dir <dir> = Compile custom directories\n"; print "-rebuild = Rebuild All\n"; @@ -238,24 +259,21 @@ while ( $#ARGV >= 0 && $ARGV[0] =~ /^(-|\/)/ ) print "-LIB = Comple LIB Configurations\n"; exit; } - else - { + else { warn "$0: unknown option $ARGV[0]\n"; - die -1 + die -1; } shift; } -if (!$Build_DLL && !$Build_LIB) -{ - $Build_DLL = 1; - $Build_LIB = 1; +if (!$Build_DLL && !$Build_LIB) { + $Build_DLL = 1; + $Build_LIB = 1; } -if (!$Build_Debug && !$Build_Release) -{ - $Build_Debug = 1; - $Build_Release = 1; +if (!$Build_Debug && !$Build_Release) { + $Build_Debug = 1; + $Build_Release = 1; } print "msvc_auto_compile: Begin\n"; |