diff options
author | elliott_c <ocielliottc@users.noreply.github.com> | 2007-01-25 20:00:14 +0000 |
---|---|---|
committer | elliott_c <ocielliottc@users.noreply.github.com> | 2007-01-25 20:00:14 +0000 |
commit | 6213071bf483fcc189bac6c537d6521518755686 (patch) | |
tree | 83e516e95d5ac0a2b16c560845dbdbff4119b1e4 /ACE | |
parent | 7fccfcc1fde5aa0ea1cf28d8f552e066472741e5 (diff) | |
download | ATCD-6213071bf483fcc189bac6c537d6521518755686.tar.gz |
ChangeLogTag: Thu Jan 25 19:59:23 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'ACE')
-rw-r--r-- | ACE/ChangeLog | 23 | ||||
-rw-r--r-- | ACE/bin/MakeProjectCreator/templates/gnu.mpd | 6 | ||||
-rwxr-xr-x | ACE/bin/auto_run_tests.pl | 11 | ||||
-rwxr-xr-x | ACE/bin/clean_sems.sh | 16 | ||||
-rwxr-xr-x | ACE/bin/rm_exception_macros.pl | 292 |
5 files changed, 335 insertions, 13 deletions
diff --git a/ACE/ChangeLog b/ACE/ChangeLog index 40566874743..4a2943cbbb3 100644 --- a/ACE/ChangeLog +++ b/ACE/ChangeLog @@ -1,3 +1,26 @@ +Thu Jan 25 19:59:23 UTC 2007 Chad Elliott <elliott_c@ociweb.com> + + * bin/MakeProjectCreator/templates/gnu.mpd: + + The include of rules.cia.GNU must come before the include of + rules.tao.GNU in order for CIAO libraries to have the correct + version numbers. + + * bin/auto_run_tests.pl: + + Fixed the -l option to use the correct variable name and corrected + a bug where the script changed to the wrong directory if the -l + option was used. + + * bin/clean_sems.sh: + + Support the ngvipc command to clean up semaphores on MacOS X. + + * bin/rm_exception_macros.pl: + + A new script to assist users in the removal of all ACE related + exception macros. + Thu Jan 25 19:24:12 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> * etc/*.doxygen: diff --git a/ACE/bin/MakeProjectCreator/templates/gnu.mpd b/ACE/bin/MakeProjectCreator/templates/gnu.mpd index 477f9671069..75f07eadbf5 100644 --- a/ACE/bin/MakeProjectCreator/templates/gnu.mpd +++ b/ACE/bin/MakeProjectCreator/templates/gnu.mpd @@ -148,13 +148,13 @@ VSHDIR = <%targetoutdir%>.shobj/ include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU ## We don't need the ACELIB setting from wrapper_macros.GNU ACELIB = +<%if(ciao)%> +include $(CIAO_ROOT)/rules.ciao.GNU +<%endif%> <%if(tao)%> tao_dont_use_idl_make_rule = 1 include $(TAO_ROOT)/rules.tao.GNU <%endif%> -<%if(ciao)%> -include $(CIAO_ROOT)/rules.ciao.GNU -<%endif%> <%if(version)%> ifeq ($(versioned_so),1) diff --git a/ACE/bin/auto_run_tests.pl b/ACE/bin/auto_run_tests.pl index 6c7a98aae67..4f23f6f8bd1 100755 --- a/ACE/bin/auto_run_tests.pl +++ b/ACE/bin/auto_run_tests.pl @@ -89,7 +89,7 @@ foreach my $test_lst (@file_list) { $config_list->load ($ACE_ROOT.$test_lst); } elsif (-r "$startdir/$test_list") { - $config_list->load ("$stardir/$test_lst"); + $config_list->load ("$startdir/$test_lst"); } else { $config_list->load ($test_list); @@ -118,21 +118,20 @@ foreach my $test_lst (@file_list) { print "auto_run_tests: $test\n"; } + my($orig_dir) = $directory; if ($directory =~ m:^TAO/(.*):) { $directory = $1; } $status = undef; foreach my $path ($ACE_ROOT."/$directory", + $TAO_ROOT."/$directory", $startdir."/$directory", - $TAO_ROOT."/$directory" ) - { - if (-d $path) { - $status = chdir ($path); + $startdir."/$orig_dir") { + if (-d $path && ($status = chdir ($path))) { last; } } - $status = chdir ($directory) if (! defined($status)); if (!$status) { print STDERR "ERROR: Cannot chdir to $ACE_ROOT/$directory\n"; diff --git a/ACE/bin/clean_sems.sh b/ACE/bin/clean_sems.sh index 57fbf3e9c06..0409ce83960 100755 --- a/ACE/bin/clean_sems.sh +++ b/ACE/bin/clean_sems.sh @@ -1,18 +1,26 @@ #!/bin/sh -if [ -z "$USER" ]; then +SYSTEM=`uname -s` +IPCS="ipcs" +IPCRM="ipcrm -s" + +if [ "$SYSTEM" = "Darwin" ]; then + USER=`id | sed 's/(.*//; s/uid=//'` + IPCS="ngvipc -s" + IPCRM="ngvipc -s -R" +elif [ -z "$USER" ]; then USER=`id | sed 's/).*//; s/.*(//'` fi -SYSTEM=`uname -s` + case "$SYSTEM" in "Linux" ) ipcs -a | grep $USER | awk '{ print ($2) }' | xargs ipcrm sem; ;; * ) - semids=`ipcs | grep "^s" | grep $USER | awk '{ print ($2) }'` + semids=`$IPCS | grep "^s" | grep $USER | awk '{ print ($2) }'` for p in $semids - do ipcrm -s $p + do $IPCRM $p done ;; esac diff --git a/ACE/bin/rm_exception_macros.pl b/ACE/bin/rm_exception_macros.pl new file mode 100755 index 00000000000..1f671cf154f --- /dev/null +++ b/ACE/bin/rm_exception_macros.pl @@ -0,0 +1,292 @@ +eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' + & eval 'exec perl -w -S $0 $argv:q' + if 0; + +# ****************************************************************** +# Author: Chad Elliott +# Date: 1/24/2007 +# $Id$ +# Description: This script attempts to remove the ACE related exception +# macros from source code provided on the comand line. It +# is not perfect, but does handle a large number of cases. +# You may need to hand edit files after running this +# script. +# ****************************************************************** + +# ****************************************************************** +# Pragma Section +# ****************************************************************** + +use strict; +use FileHandle; +use File::Basename; + +# ****************************************************************** +# Data Section +# ****************************************************************** + +my(%macros) = ('ACE_ENV_TYPE' => 'CORBA::Environment', + 'ACE_TRY_ENV' => '_ACE_CORBA_Environment_variable', + 'ACE_EXCEPTION_TYPE' => 'CORBA::Exception', + 'ACE_DEFAULT_GET_ENV_METHOD' => 'TAO_default_environment', + 'ACE_DECLARE_NEW_ENV' => '', + 'ACE_DECLARE_NEW_CORBA_ENV' => '', + 'ACE_CHECK *\(.*\)' => '', + 'ACE_CHECK' => '', + 'ACE_CHECK_RETURN *\(.*\)' => '', + 'ACE_THROW_INT *\((.*)\)' => 'throw $1', + 'ACE_THROW *\((.*)\)' => 'throw $1', +# 'ACE_THROW_RETURN *\((.*),.+\)' => 'throw $1', + 'ACE_TRY' => 'try', + 'ACE_TRY_NEW_ENV' => 'try', + 'ACE_TRY_EX *\([^\)]+\)' => 'try', + 'ACE_TRY_CHECK' => '', + 'ACE_TRY_CHECK_EX *\([^\)]+\)' => '', + 'ACE_TRY_THROW *\((.*)\)' => 'throw $1', + 'ACE_TRY_THROW_EX *\((.*),.+\)' => 'throw $1', + 'ACE_CATCH *\((.*),(.+)\)' => 'catch (const $1& $2)', + 'ACE_CATCHANY' => 'catch (const CORBA::Exception& ex)', + 'ACE_CATCHALL' => 'catch (...)', + 'ACE_RETHROW' => 'throw', + 'ACE_RE_THROW' => 'throw', + 'ACE_RE_THROW_EX *\(.+\)' => 'throw', + 'ACE_ENDTRY' => '', + 'ACE_ENV_RAISE *\((.+)\)' => '$1->_raise ()', + 'ACE_PRINT_TAO_EXCEPTION *\(([^,]+),(.+)\)' => '$1._tao_print_exception ($2)', + 'ACE_PRINT_EXCEPTION *\(([^,]+),(.+)\)' => '$1._tao_print_exception ($2)', + 'TAO_INTERCEPTOR_CHECK_RETURN *\(.*\)' => '', + 'TAO_INTERCEPTOR_CHECK' => '', + ); +my(@keys) = sort { length($b) <=> length($a) } keys %macros; + +# ****************************************************************** +# Subroutine Section +# ****************************************************************** + +sub process_file { + my($file) = shift; + my($fh) = new FileHandle(); + my($status) = 0; + + if (open($fh, $file)) { + my(@lines) = (); + my($mod) = undef; + my($line) = ''; + my($cont_until_semicolon) = undef; + while(<$fh>) { + my($part) = $_; + $part =~ s/\s+$//; + + if ($cont_until_semicolon) { + if ($part =~ s/^\s+// && $line =~ /[,\)]$/) { + $part = ' ' . $part; + } + $line .= $part; + if (index($part, ';') >= 0) { + $cont_until_semicolon = undef; + } + else { + next; + } + } + else { + $line = $part; + } + + my($skip_blank) = undef; + foreach my $key (@keys) { + my($base) = undef; + if ($key =~ /^([^\s]+\s\*\\\()/) { + $base = $1; + } + if ($line =~ /^(\s*)?($key\s*[;]?)/) { + my($space) = $1; + my($rest) = $2; + my($first) = $3 || ''; + my($second) = $4 || ''; + my($val) = $macros{$key}; + while($val =~ /\$(\d+)/) { + my($num) = $1; + if ($num == 1) { + $first =~ s/^\s+//; + $first =~ s/\s+$//; + $val =~ s/\$1/$first/; + } + elsif ($num == 2) { + $second =~ s/^\s+//; + $second =~ s/\s+$//; + $val =~ s/\$2/$second/; + } + else { + $val =~ s/\$\d+//; + } + } + + $line =~ s/^(\s*)?($key\s*[;]?)//; + $val .= ';' if ($val ne '' && $rest =~ /;$/); + $line = $space . $val . $line; + $line =~ s/^\s+$//; + + ## Fix up problems where ACE_TRY_THROW is used + ## on a line by itself with the parenthesis following + ## on the second line. The parser gets confused and + ## thinks it needs to replace the ACE_TRY + if ($key eq 'ACE_TRY') { + $line =~ s/try_THROW/throw/g; + } + + my($len) = length($line); + if ($len > 78 || $line =~ /""/) { + my($level) = 0; + my($indouble) = 0; + my($pch) = ''; + my($fix_ace_text) = undef; + for(my $i = 0; $i < $len; $i++) { + my($ch) = substr($line, $i, 1); + if ($ch eq '"' && $pch ne '\\') { + $indouble ^= 1; + } + if (!$indouble) { + my($nch) = substr($line, $i + 1, 1); + if ($ch eq ',' || ($ch eq '"' && $nch eq '"') || $ch eq '(') { + $level++ if ($ch eq '('); + $fix_ace_text = (substr($line, 0, $i) =~ /ACE_TEXT\s*$/); + if ($nch ne ')' && !$fix_ace_text) { + my($add) = "\n" . $space . (' ' x $level); + my($start) = 0; + while(substr($line, $i + 1 + $start, 1) =~ /\s/) { + $start++; + } + substr($line, $i + 1, $start) = $add; + $i += length($add) - $start; + $len += length($add) - $start; + } + } + elsif ($ch eq ')') { + $level--; + if ($fix_ace_text) { + if (substr($line, $i) =~ /ACE_TEXT/) { + my($add) = "\n" . $space . (' ' x $level); + my($start) = 0; + while(substr($line, $i + 1 + $start, 1) =~ /\s/) { + $start++; + } + substr($line, $i + 1, $start) = $add; + $i += length($add) - $start; + $len += length($add) - $start; + } + $fix_ace_text = undef; + } + } + } + $pch = $ch; + } + } + + $mod = 1; + $skip_blank = 1; + last; + } + elsif (defined $base && + index($line, ';') == -1 && $line =~ /^(\s*)?$base/) { + $cont_until_semicolon = 1; + last; + } + } + + if ($line =~ s/ACE_ANY_EXCEPTION/ex/g) { + $mod = 1; + } + if (!$cont_until_semicolon) { + if ($line =~ s/(\s*)ACE_ENV(_SINGLE)?_ARG_DECL_WITH_DEFAULTS// || + $line =~ s/(\s*)ACE_ENV(_SINGLE)?_ARG_DECL_NOT_USED// || + $line =~ s/(\s*)ACE_ENV(_SINGLE)?_ARG_DECL// || + $line =~ s/(\s*)ACE_ENV(_SINGLE)?_ARG_(PARAMETER|NOT_USED)//) { + my($sp) = $1; + if ($line =~ /^\)/) { + if ($lines[$#lines] =~ /\/\/.*$/ || + $lines[$#lines] =~ /\/\*.*\*\/$/) { + $line = $sp . $line; + } + else { + $lines[$#lines] .= $line; + $line = ''; + } + } + $mod = 1; + $skip_blank = 1; + } + push(@lines, $line) if ($line ne '' || !$skip_blank); + } + } + close($fh); + + if ($mod) { + if (open($fh, ">$file")) { + foreach my $line (@lines) { + print $fh $line, "\n"; + } + close($fh); + } + else { + print "ERROR: Unable to write to $file\n"; + $status++; + } + } + } + else { + print "ERROR: Unable to open $file\n"; + $status++; + } + + return $status; +} + +sub process { + my($arg) = shift; + my($status) = 0; + + if (-d $arg) { + my($fh) = new FileHandle(); + if (opendir($fh, $arg)) { + foreach my $file (grep(!/^\.\.?$/, readdir($fh))) { + if ($file ne '.svn') { + $status += process($arg . '/' . $file); + } + } + closedir($fh); + } + } + elsif ($arg =~ /\.(h|hh|hpp|hxx|hh|cpp|cxx|cc|c|C|i|ipp|inl)$/) { + $status += process_file($arg); + } + + return $status; +} + +sub usageAndExit { + print "Usage: ", basename($0), " [directories or files]\n\n", + "Removes all exception related ACE macros.\n"; + exit(0); +} + +# ****************************************************************** +# Main Section +# ****************************************************************** + +my($status) = 0; + +if ($#ARGV == -1) { + usageAndExit(); +} + +foreach my $arg (@ARGV) { + if (index($arg, '-') == 0) { + usageAndExit(); + } + else { + $status += process($arg); + } +} + +exit($status); |