diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2008-03-04 14:51:23 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2008-03-04 14:51:23 +0000 |
commit | 99aa8c60282c7b8072eb35eb9ac815702f5bf586 (patch) | |
tree | bda96bf8c3a4c2875a083d7b16720533c8ffeaf4 /ACE/bin | |
parent | c4078c377d74290ebe4e66da0b4975da91732376 (diff) | |
download | ATCD-99aa8c60282c7b8072eb35eb9ac815702f5bf586.tar.gz |
undoing accidental deletion
Diffstat (limited to 'ACE/bin')
246 files changed, 30017 insertions, 0 deletions
diff --git a/ACE/bin/ACE-casts-convert b/ACE/bin/ACE-casts-convert new file mode 100755 index 00000000000..0b158ea1afa --- /dev/null +++ b/ACE/bin/ACE-casts-convert @@ -0,0 +1,50 @@ +#! /bin/sh + +# ============================================================================= +# +# @file ACE-casts-convert +# +# $Id$ +# +# Script to convert all ACE cast macro calls (e.g. +# ACE_static_cast (foo, bar)) to their standard C++ counterparts (e.g. +# static_cast<foo> (bar)). +# +# Use this script at your own risk. It appears to work correctly for +# most cases, but verify the results "just in case". +# +# @note Wildcards may be supplied as the "FILE" arguments to this +# script since the shell should expand the wildcards before +# executing the script. +# +# @bug The sed program used in this script may loop indefinitely on +# ACE casts with arguments split across multiple lines +# containing patterns it doesn't recognize. +# +# @author Ossama Othman +# +# ============================================================================= + + +if test "$#" -eq 0; then + echo "Usage: $0 FILE [FILE2] ..." + echo "" + exit 1 +fi + +echo "" +echo "Converting ACE cast macro calls to standard C++ syntax in:" + +while test "$#" -gt 0 +do + arg="$1" + shift + + if grep "ACE_\(static\|dynamic\|const\|reinterpret\)_cast" $arg > /dev/null 2>&1; then + echo " $arg" + sed -e :a -e 's/ACE_\(const\|static\|reinterpret\|dynamic\)_cast[ \t]*([ \t]*\([^,]*\)[ \t]*,[ \t]*\([^ \t].*\)/\1_cast<\2> (\3/g; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast[ \t]*([ \t]*\([^,]*\)[ \t]*,[ \t]*$/{N;s/\n//;ba;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast[ \t]*([ \t]*$/{N;s/\n//;ba;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast[ \t]*$/{N;s/\n//;ba;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast[ \t]*(/ba' \ + -e :aa -e 's/ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ref[ \t]*([ \t]*\([^,]*\)[ \t]*,\(.*\),[ \t]*\([^,]*\)/\1_cast<\2<\3> \&> (\4/g; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ref[ \t]*([ \t]*\([^,]*\)[ \t]*,[ \t]*$/{N;s/\n//;baa;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ref[ \t]*([ \t]*$/{N;s/\n//;baa;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ref[ \t]*$/{N;s/\n//;baa;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ref[ \t]*(/baa' \ + -e :aaa -e 's/ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ptr[ \t]*([ \t]*\([^,]*\)[ \t]*,\(.*\),[ \t]*\([^,]*\)/\1_cast<\2<\3> \*> (\4/g; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ptr[ \t]*([ \t]*\([^,]*\)[ \t]*,[ \t]*$/{N;s/\n//;baaa;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ptr[ \t]*([ \t]*$/{N;s/\n//;baaa;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ptr[ \t]*$/{N;s/\n//;baaa;}; /ACE_\(const\|static\|reinterpret\|dynamic\)_cast_[1-5]_ptr[ \t]*(/baaa' $arg > ${arg}.new + mv ${arg}.new $arg + fi +done diff --git a/ACE/bin/ACETAOCIAO.style b/ACE/bin/ACETAOCIAO.style new file mode 100644 index 00000000000..dc14c929b83 --- /dev/null +++ b/ACE/bin/ACETAOCIAO.style @@ -0,0 +1,304 @@ +<?xml version="1.0" encoding="utf-8"?> +<style> +<name>ACETAOCIAO</name> +<description>This style is used for ACE/TAO/CIAO</description> +<sample></sample> +<flags /> +<rule name="align-global"> +<presetreference>Global_Align Global Variables_false</presetreference> +</rule> +<rule name="brace-space"> +<presetreference>Global_Space Before Brace_True</presetreference> +</rule> +<rule name="case-statement-indent"> +<presetreference>Switch_Case Statement Indentation_True</presetreference> +</rule> +<rule name="catch-bracing-style"> +<presetreference>Try_Catch Brace Position_Indented</presetreference> +</rule> +<rule name="chevron-alignment"> +<presetreference>Templates_Chevron Alignment_AlignAtBracket</presetreference> +</rule> +<rule name="class-access-specifier-indent"> +<presetreference>Classes and Structs_Access Specifier Indentation_False</presetreference> +</rule> +<rule name="class-access-specifier-newline"> +<presetreference>Classes and Structs_Access Specifier New Line_True</presetreference> +</rule> +<rule name="class-bracing-style"> +<presetreference>Classes and Structs_Brace Position_Aligned</presetreference> +</rule> +<rule name="class-indent"> +<presetreference>Classes and Structs_Indentation_True</presetreference> +</rule> +<rule name="class-inheritance-list"> +<presetreference>Classes and Structs_Inheritance List_SameLine</presetreference> +</rule> +<rule name="class-member-align"> +<presetreference>Classes and Structs_Member Alignment_False</presetreference> +</rule> +<rule name="constructor-initialiser-packing"> +<presetreference>Constructor_Member Initializers_One Per Line</presetreference> +</rule> +<rule name="constructor-initialiser-style"> +<presetreference>Constructor_Initializer Alignment_True</presetreference> +</rule> +<rule name="declaration-newline"> +<presetreference>Declarations_Start On New Line_True</presetreference> +</rule> +<rule name="declarations-keyword-spacing"> +<presetreference>Declarations_Keyword Spacing_True</presetreference> +</rule> +<rule name="do-bracing-style"> +<presetreference>Do_Brace Position_Aligned</presetreference> +</rule> +<rule name="do-indented-style"> +<presetreference>Do_Indentation_True</presetreference> +</rule> +<rule name="do-while-style"> +<presetreference>Do_While Position_SameLine</presetreference> +</rule> +<rule name="enum-align-initialisers"> +<presetreference>Enums_Align Initializers_False</presetreference> +</rule> +<rule name="enum-bracing-style"> +<presetreference>Enums_Brace Position_Aligned</presetreference> +</rule> +<rule name="enum-indent"> +<presetreference>Enums_Indentation_True</presetreference> +</rule> +<rule name="enum-items"> +<presetreference>Enums_Items_OnePerLine</presetreference> +</rule> +<rule name="enum-single-entry"> +<presetreference>Enums_Single Entry_Normal</presetreference> +</rule> +<rule name="exceptions-exc-pos"> +<presetreference>Exceptions_Exception Position_Packed</presetreference> +</rule> +<rule name="exceptions-throw-pos"> +<presetreference>Exceptions_Throw Position_Same Line</presetreference> +</rule> +<rule name="expression-casts"> +<presetreference>Expressions_C Style Casts_No space after</presetreference> +</rule> +<rule name="expression-wrapping"> +<presetreference>Expressions_Binary Operator Wrapping_After</presetreference> +</rule> +<rule name="expressions-binary-spacing"> +<presetreference>Expressions_Binary Operators_Spaced</presetreference> +</rule> +<rule name="expressions-functioncall-spacing"> +<presetreference>Functions_Calls_Spaced</presetreference> +</rule> +<rule name="expressions-member-spacing"> +<presetreference>Expressions_Member Operators_Not Spaced</presetreference> +</rule> +<rule name="expressions-pointer-spacing"> +<presetreference>Expressions_Pointer Operators_Not Spaced</presetreference> +</rule> +<rule name="expressions-unary-spacing"> +<presetreference>Expressions_Logical and Bitwise Unary Operators_Not Spaced</presetreference> +</rule> +<rule name="extern-braces"> +<presetreference>Declarations_Extern Brace Position_Aligned</presetreference> +</rule> +<rule name="extern-indentation"> +<presetreference>Declarations_Extern Indentation_True</presetreference> +</rule> +<rule name="for-bracing-indent"> +<presetreference>For_Indentation_True</presetreference> +</rule> +<rule name="for-bracing-style"> +<presetreference>For_Brace Position_Indented</presetreference> +</rule> +<rule name="for-semicolon-spacing"> +<presetreference>For_Semicolon Spacing_SpaceAfter</presetreference> +</rule> +<rule name="function-align-params"> +<presetreference>Functions_Parameter Name Alignment_False</presetreference> +</rule> +<rule name="function-bracing-style"> +<presetreference>Functions_Brace Position_Aligned</presetreference> +</rule> +<rule name="function-call-lines"> +<presetreference>Functions_Call Parameter Lines_SingleLine</presetreference> +</rule> +<rule name="function-call-spacing"> +<presetreference>Functions_Call Spacing_AfterComma</presetreference> +</rule> +<rule name="function-declaration-alignment"> +<presetreference>Functions_Declaration Alignment_False</presetreference> +</rule> +<rule name="function-indent"> +<presetreference>Functions_Indentation_True</presetreference> +</rule> +<rule name="function-name-style"> +<presetreference>Functions_Definitions_True</presetreference> +</rule> +<rule name="function-parameter-alignment"> +<presetreference>Functions_Parameter Alignment_Bracket</presetreference> +</rule> +<rule name="function-parameter-lines"> +<presetreference>Functions_Parameter Lines_False</presetreference> +</rule> +<rule name="function-parameter-spacing"> +<presetreference>Functions_Parameter Spacing_AfterComma</presetreference> +</rule> +<rule name="function-parenthesis-spacing"> +<presetreference>Functions_Bracket Spacing_False</presetreference> +</rule> +<rule name="function-type-style"> +<presetreference>Functions_Return Type_OwnLine</presetreference> +</rule> +<rule name="global-alignment-space"> +<presetreference>Global_Alignment ensures at least one space_False</presetreference> +</rule> +<rule name="global-bracing-style"> +<presetreference>Global_Default Block Brace Position_Aligned</presetreference> +</rule> +<rule name="global-bracket-alignment"> +<presetreference>Expressions_Bracket Alignment_AlignAtBracket</presetreference> +</rule> +<rule name="global-bracket-spacing"> +<presetreference>Expressions_Bracket Spacing_NoSpace</presetreference> +</rule> +<rule name="global-comma-spacing"> +<presetreference>Expressions_Comma Spacing_AfterComma</presetreference> +</rule> +<rule name="global-function-bracket-alignment"> +<presetreference>Functions_Bracket Alignment_AlignAtBracket</presetreference> +</rule> +<rule name="global-function-empty-brackets"> +<presetreference>Functions_Empty Brackets_NoSpace</presetreference> +</rule> +<rule name="global-function-empty-chevron"> +<presetreference>Templates_Empty Chevrons_NoSpace</presetreference> +</rule> +<rule name="global-function-single-line"> +<presetreference>Functions_Empty Functions_Formatted</presetreference> +</rule> +<rule name="global-indentation"> +<presetreference>Global_Default Block Indentation_Yes</presetreference> +</rule> +<rule name="global-initialiser-comma-spacing"> +<presetreference>Declarations_Comma Spacing_AfterComma</presetreference> +</rule> +<rule name="global-semicolon-spacing"> +<presetreference>Global_Semicolon Spacing_False</presetreference> +</rule> +<rule name="global-statement-newline"> +<presetreference>Global_Statements On New Line_False</presetreference> +</rule> +<rule name="global-statement-spacing"> +<presetreference>Global_Statement Spacing_True</presetreference> +</rule> +<rule name="identifier-spacing"> +<presetreference>Declarations_Spacing Before Identifier_Space</presetreference> +</rule> +<rule name="if-bracing-style"> +<presetreference>If_Brace Position_Indented</presetreference> +</rule> +<rule name="if-else-style"> +<presetreference>If_Else Position_OwnLine</presetreference> +</rule> +<rule name="if-indented-style"> +<presetreference>If_Indentation_True</presetreference> +</rule> +<rule name="indent-amount"> +<presetreference>Global_Indentation Amount_2</presetreference> +</rule> +<rule name="indent-continuation"> +<presetreference>Global_Indent Continuation Lines_true</presetreference> +</rule> +<rule name="initialiser-braces"> +<presetreference>Declarations_Initializer Brace Position_Aligned</presetreference> +</rule> +<rule name="initialiser-indentation"> +<presetreference>Declarations_Initializer Indentation_True</presetreference> +</rule> +<rule name="initialiser-list"> +<presetreference>Declarations_Initializer List Entries_Pack</presetreference> +</rule> +<rule name="initialiser-spacing"> +<presetreference>Declarations_Initializer Spacing_True</presetreference> +</rule> +<rule name="label-indentation"> +<presetreference>Global_Label Indentation_None</presetreference> +</rule> +<rule name="line-wrap-width"> +<presetreference>Global_Line Wrapping_80</presetreference> +</rule> +<rule name="member-initialiser-position"> +<presetreference>Constructor_Member Initializer Position_Below Indented</presetreference> +</rule> +<rule name="namespace-bracing-style"> +<presetreference>Namespaces_Brace Position_Aligned</presetreference> +</rule> +<rule name="namespace-indent"> +<presetreference>Namespaces_Indentation_True</presetreference> +</rule> +<rule name="pointer-hangleft"> +<presetreference>Pointers and References_Hang Left on Alignment_False</presetreference> +</rule> +<rule name="pointer-position"> +<presetreference>Pointers and References_Positioning_Var</presetreference> +</rule> +<rule name="pointer-qualifier"> +<presetreference>Pointers and References_Qualifiers_True</presetreference> +</rule> +<rule name="pointer-spacing"> +<presetreference>Pointers and References_Spacing_False</presetreference> +</rule> +<rule name="preprocessor-indent"> +<presetreference>Global_Preprocessor Indentation_False</presetreference> +</rule> +<rule name="statement-force"> +<presetreference>Global_Force Statements To Start On New Line_True</presetreference> +</rule> +<rule name="strict-whitespace"> +<presetreference>Global_Trim Excess Newlines_False</presetreference> +</rule> +<rule name="switch-bracing-style"> +<presetreference>Switch_Brace Position_Indented</presetreference> +</rule> +<rule name="switch-indentation-style"> +<presetreference>Switch_Statement Indentation_True</presetreference> +</rule> +<rule name="template-dec-comma"> +<presetreference>Templates_Comma Spacing_AfterComma</presetreference> +</rule> +<rule name="template-declaration-chevron"> +<presetreference>Templates_Chevron Spacing_False</presetreference> +</rule> +<rule name="template-declaration-id"> +<presetreference>Templates_Identifier Spacing_True</presetreference> +</rule> +<rule name="template-newline"> +<presetreference>Templates_Declaration On New Line_True</presetreference> +</rule> +<rule name="template-parameter-lines"> +<presetreference>Templates_Parameter Lines_False</presetreference> +</rule> +<rule name="trim-trailing-whitespace"> +<presetreference>Global_Trim Trailing Whitespace_True</presetreference> +</rule> +<rule name="try-bracing-style"> +<presetreference>Try_Try Brace Position_Indented</presetreference> +</rule> +<rule name="try-catch-style"> +<presetreference>Try_Catch Position_NewLine</presetreference> +</rule> +<rule name="try-indented-style"> +<presetreference>Try_Indentation_True</presetreference> +</rule> +<rule name="use-tabs"> +<presetreference>Global_Indentation Type_Spaces</presetreference> +</rule> +<rule name="while-bracing-style"> +<presetreference>While_Brace Position_Indented</presetreference> +</rule> +<rule name="while-indent-style"> +<presetreference>While_Indentation_True</presetreference> +</rule> +</style> diff --git a/ACE/bin/ACEutils.pm b/ACE/bin/ACEutils.pm new file mode 100644 index 00000000000..b7e5a24217c --- /dev/null +++ b/ACE/bin/ACEutils.pm @@ -0,0 +1,117 @@ +# $Id$ + +require Process; +$EXEPREFIX = ".".$DIR_SEPARATOR; +$TARGETHOSTNAME = "localhost"; + +package ACE; + +sub CheckForExeDir +{ + for($i = 0; $i <= $#ARGV; $i++) { + if ($ARGV[$i] eq '-ExeSubDir') { + if (defined $ARGV[$i + 1]) { + $::EXEPREFIX = $ARGV[$i + 1].$::DIR_SEPARATOR; + } + else { + print STDERR "You must pass a directory with ExeSubDir\n"; + exit(1); + } + splice(@ARGV, $i, 2); + } + } +} + + +### Check and remove, but don't actually use +sub CheckForConfig +{ + for($i = 0; $i <= $#ARGV;) { + if ($ARGV[$i] eq '-Config') { + if (!defined $ARGV[$i + 1]) { + print STDERR "You must pass a configuration with Config\n"; + exit(1); + } + splice(@ARGV, $i, 2); + } else { + $i++; + } + } +} + +sub checkForTarget +{ + my($cwd) = shift; + + for($i = 0; $i <= $#ARGV; $i++) { + if ($ARGV[$i] eq '-chorus') { + if (defined $ARGV[$i + 1]) { + $::TARGETHOSTNAME = $ARGV[$i + 1]; + $::EXEPREFIX = "rsh $::TARGETHOSTNAME arun $cwd$::DIR_SEPARATOR"; + } + else { + print STDERR "The -chorus option requires " . + "the hostname of the target\n"; + exit(1); + } + splice(@ARGV, $i, 2); + # Don't break from the loop just in case there + # is an accidental duplication of the -chorus option + } + } +} + + +# Returns a unique id, uid for unix, last digit of IP for NT +sub uniqueid +{ + if ($^O eq "MSWin32") + { + my $uid = 1; + + open (IPNUM, "ipconfig|") || die "Can't run ipconfig: $!\n"; + + while (<IPNUM>) + { + if (/Address/) + { + $uid = (split (/: (\d+)\.(\d+)\.(\d+)\.(\d+)/))[4]; + } + } + + close IPNUM; + + return $uid; + } + else + { + return getpwnam (getlogin ()); + } +} + +# Waits until a file exists +sub waitforfile +{ + local($file) = @_; + sleep 1 while (!(-e $file && -s $file)); +} + +sub waitforfile_timed +{ + my $file = shift; + my $maxtime = shift; + while ($maxtime-- != 0) { + if (-e $file && -s $file) { + return 0; + } + sleep 1; + } + return -1; +} + +$sleeptime = 5; + +CheckForExeDir (); +CheckForConfig (); + +1; diff --git a/ACE/bin/Array.pl b/ACE/bin/Array.pl new file mode 100755 index 00000000000..7f9bf393e15 --- /dev/null +++ b/ACE/bin/Array.pl @@ -0,0 +1,31 @@ +#!/bin/sh -- # -*- perl -*- +eval 'exec perl -pi.Array.$$ -S $0 ${1+"$@"}' + if 0; + +# $Id$ + +# +# After the 4.6.10 release the template instantiations for ACE_Array +# have changed, the class is implemented in terms of ACE_Array_Base; +# this script fixes the template instantiations if needed. +# +# It changes instantiations of: +# +# ACE_Array<T> +# +# into: +# +# ACE_Array<T> +# ACE_Array_Base<T> +# + +# Notice the use of the -pi options: the while(<>) loop is implicit, +# printing the current line is also implicit as well as fixing the +# file in place. + +if (m/template class\s+ACE_Array\s*<(.*)>\s*;\s*/) { + print "template class ACE_Array_Base<", $1, ">;\n"; +} elsif (m/#pragma instantiate\s+ACE_Array\s*<(.*)>\s*$/) { + print "#pragma instantiate ACE_Array_Base<", $1, ">\n"; +} + diff --git a/ACE/bin/Array_Helper b/ACE/bin/Array_Helper new file mode 100755 index 00000000000..6ffce3b799e --- /dev/null +++ b/ACE/bin/Array_Helper @@ -0,0 +1,16 @@ +#! /bin/sh +# +# $Id$ +# + +# Finds all files that instantiate ACE_Array and runs the Array.pl +# perl script on them, please check $ACE_ROOT/bin/Array.pl for more +# details. + +find $* -type f -a \( -name '*.h' \ + -o -name '*.i' \ + -o -name '*.cpp' \) | + xargs egrep -l 'template[ \t]*class[ \t]*ACE_Array[ \t]*\<' | + xargs perl -pi $ACE_ROOT/bin/Hash_Map_Manager.pl + + diff --git a/ACE/bin/ChangeLogEditor/CVSFileLocator.pm b/ACE/bin/ChangeLogEditor/CVSFileLocator.pm new file mode 100644 index 00000000000..8e478509f01 --- /dev/null +++ b/ACE/bin/ChangeLogEditor/CVSFileLocator.pm @@ -0,0 +1,125 @@ +package CVSFileLocator; + +# ************************************************************ +# Description : Use CVS to determine the list of modified files. +# Author : Chad Elliott +# Create Date : 11/29/2005 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use FileHandle; + +use FileLocator; + +use vars qw(@ISA); +@ISA = qw(FileLocator); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub locate { + my($self) = shift; + my(@dirs) = @_; + my($fh) = new FileHandle(); + my(@modified) = (); + my(@removed) = (); + my(@conflicts) = (); + my(@unknown) = (); + my($error) = undef; + my($cvsroot) = $self->obtainCVSROOT(); + my($err) = $self->tmpnam('cle_cvs.err'); + + if (open($fh, 'cvs -f -q ' . ($^O eq 'MSWin32' ? '-N ' : '') . + (defined $cvsroot ? "-d $cvsroot " : '') . + "-n update @dirs 2> $err |")) { + while(<$fh>) { + my($line) = $_; + if ($line =~ /^[AM]\s+(.*)/) { + push(@modified, $1); + } + elsif ($line =~ /^[R]\s+(.*)/) { + push(@removed, $1); + } + elsif ($line =~ /^[C]\s+(.*)/) { + push(@conflicts, $1); + } + elsif ($line =~ /^[\?]\s+(.*)/ && index($line, $err) == -1) { + push(@unknown, $1); + } + } + close($fh); + + $error = $self->process_errors($err); + } + else { + $error = "Unable to run cvs with error redirection."; + } + + return \@modified, \@removed, \@conflicts, \@unknown, $error; +} + + +sub obtainCVSROOT { + my($self) = shift; + my($fh) = new FileHandle(); + my($croot) = undef; + + if (open($fh, 'CVS/Root')) { + while(<$fh>) { + my($line) = $_; + $line =~ s/\s+$//; + if ($line =~ /^:pserver/ || $line =~ /^:ext/) { + if (defined $ENV{CVSROOT} && $line eq $ENV{CVSROOT}) { + last; + } + else { + my($check) = $line; + $check =~ s/:\w+\@/:\@/; + $check =~ s/\.\w+\.\w+:/:/; + my($clen) = length($check); + foreach my $key (keys %ENV) { + my($echeck) = $ENV{$key}; + $echeck =~ s/:\w+\@/:\@/; + $echeck =~ s/\.\w+\.\w+:/:/; + if ($check eq $echeck) { + $croot = $ENV{$key}; + last; + } + else { + my($len) = length($echeck); + if ($len > 0 && + substr($check, $clen - $len, $len) eq $echeck) { + $croot = $ENV{$key}; + last; + } + } + } + if (defined $croot) { + last; + } + } + if (!defined $croot) { + $croot = $line; + } + } + else { + $croot = $line; + last; + } + } + close($fh); + } + else { + $croot = $ENV{CVSROOT}; + } + + return $croot; +} + + +1; diff --git a/ACE/bin/ChangeLogEditor/ChangeLogEdit.pm b/ACE/bin/ChangeLogEditor/ChangeLogEdit.pm new file mode 100644 index 00000000000..1bbfee507b1 --- /dev/null +++ b/ACE/bin/ChangeLogEditor/ChangeLogEdit.pm @@ -0,0 +1,122 @@ +package ChangeLogEdit; + +# ************************************************************ +# Description : Edit the existing ChangeLog. +# Author : Chad Elliott +# Create Date : 9/10/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use FileHandle; +use File::Copy; + +use ChangeLogEntry; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub new { + my($class) = shift; + my($name) = shift; + my($email) = shift; + my($self) = bless {'name' => $name, + 'email' => $email, + }, $class; + return $self; +} + + +sub edit { + my($self) = shift; + my($ofile) = shift; + my(@dirs) = @_; + my($tfile) = "$ofile.$<.$$"; + my($status) = 0; + my($error) = ''; + my($rh) = new FileHandle(); + my($unknown) = undef; + + if (open($rh, $ofile)) { + my($creator) = new ChangeLogEntry($self->{'name'}, + $self->{'email'}); + my($entry) = ''; + ($entry, $unknown, $error) = $creator->create(@dirs); + if (defined $entry) { + if ($entry =~ /^ERROR:/) { + $error = $entry; + } + else { + my($oh) = new FileHandle(); + if (open($oh, ">$tfile")) { + $status = print $oh $entry; + if ($status) { + while(<$rh>) { + my($line) = $_; + $line =~ s/\s+$//; + if ($line =~ /\t/) { + $line = $self->convertTabs($line); + } + $status = print $oh "$line\n"; + if ($status == 0) { + $error = "Unable to copy $ofile"; + last; + } + } + } + else { + $error = 'Unable to print the first entry'; + } + close($oh); + } + else { + $error = "Unable to open $tfile for writing"; + } + close($rh); + + if ($status) { + $status = 0; + if (unlink($ofile)) { + if (rename($tfile, $ofile)) { + $status = 1; + } + else { + $error = "Unable to rename $tfile to $ofile"; + } + } + else { + $error = "Unable to remove $ofile"; + } + } + } + } + else { + $error = (defined $error ? "There is a revision control system " . + "problem:\n$error" : + 'There are no modified/removed files.'); + } + } + else { + $error = "Unable to open $ofile for reading"; + } + + return $status, $error, $unknown; +} + + +sub convertTabs { + my($self) = shift; + my($line) = shift; + while($line =~ /\t/) { + my($spaces) = 8 - (index($line, "\t") % 8); + $line =~ s/\t/sprintf("%${spaces}s", ' ')/e; + } + return $line; +} + + +1; diff --git a/ACE/bin/ChangeLogEditor/ChangeLogEntry.pm b/ACE/bin/ChangeLogEditor/ChangeLogEntry.pm new file mode 100644 index 00000000000..1fdcf9d3da3 --- /dev/null +++ b/ACE/bin/ChangeLogEditor/ChangeLogEntry.pm @@ -0,0 +1,145 @@ +package ChangeLogEntry; + +# ************************************************************ +# Description : Create a ChangeLog entry based on modified files. +# Author : Chad Elliott +# Create Date : 6/18/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use File::Basename; + +use FileLocatorFactory; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub new { + my($class) = shift; + my($name) = shift; + my($email) = shift; + my($self) = bless {'name' => $name, + 'email' => $email, + }, $class; + return $self; +} + + +sub escape_regex_special { + my($self) = shift; + my($name) = shift; + + $name =~ s/([\+\-\\\$\[\]\(\)\.])/\\$1/g; + return $name; +} + + +sub sortFileList { + my($self) = shift; + return sort { + if ($a =~ /\.h$/) { + my($base) = $a; + $base =~ s/\.h//; + $base = $self->escape_regex_special($base); + if ($b =~ /^$base\./) { + return -1; + } + else { + return $a cmp $b; + } + } + elsif ($a =~ /\.i(nl)?$/) { + my($base) = $a; + $base =~ s/\.i(nl)?$//; + $base = $self->escape_regex_special($base); + if ($b =~ /^$base\.cpp/) { + return -1; + } + else { + return $a cmp $b; + } + } + elsif ($a =~ /\.cpp?$/) { + my($base) = $a; + $base =~ s/\.cpp?$//; + $base = $self->escape_regex_special($base); + if ($b =~ /^$base\./) { + return 1; + } + else { + return $a cmp $b; + } + } + return $a cmp $b; + } @_; +} + + +sub create { + my($self) = shift; + my(@dirs) = @_; + my($fl) = FileLocatorFactory::create(); + my($modif, + $remov, + $confl, + $unknown, + $error) = $fl->locate(@dirs); + my($entry) = scalar(gmtime()); + + if (defined $$confl[0]) { + $entry = "ERROR: The following files have conflicts:\n"; + foreach my $file (@$confl) { + $entry .= "$file\n"; + } + } + else { + my($prefix) = ' * '; + + ## Correct the timezone (if there is any) + my($tz) = 'UTC'; + $entry =~ s/(:\d\d\s+)(.*)(\d\d\d\d)$/$1$tz $3/; + + ## Add the name and email address + $entry .= " $self->{'name'} <$self->{'email'}>\n\n"; + + my($previous) = undef; + foreach my $file ($self->sortFileList(@$modif)) { + my($directory) = dirname($file); + if (defined $previous && $previous ne $directory) { + $entry .= "\n"; + } + $entry .= "$prefix$file:\n"; + $previous = $directory; + } + $previous = ''; + my($removed) = 0; + foreach my $file ($self->sortFileList(@$remov)) { + my($directory) = dirname($file); + if (defined $previous && $previous ne $directory) { + $entry .= "\n"; + } + $entry .= "$prefix$file:\n"; + $previous = $directory; + $removed++; + } + if ($removed) { + $entry .= "\n Removed " . + ($removed > 1 ? 'these files' : 'this file') . ".\n"; + } + $entry .= "\n"; + } + + if (!defined $$modif[0] && !defined $$remov[0]) { + $entry = undef; + } + + return $entry, $unknown, $error; +} + + +1; diff --git a/ACE/bin/ChangeLogEditor/EmailTranslator.pm b/ACE/bin/ChangeLogEditor/EmailTranslator.pm new file mode 100644 index 00000000000..eacbff22497 --- /dev/null +++ b/ACE/bin/ChangeLogEditor/EmailTranslator.pm @@ -0,0 +1,52 @@ +package EmailTranslator; + +# ************************************************************ +# Description : Translate the given user name and domain into +# an email address. +# Author : Chad Elliott +# Create Date : 6/18/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use FileHandle; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub new { + my($class) = shift; + my($domain) = shift; + my($self) = bless {'domain' => "\@$domain", + }, $class; + return $self; +} + + +sub translate { + my($self) = shift; + my($name) = shift; + my($domain) = $self->{'domain'}; + my($email) = "$name$domain"; + my(%special) = (); + + if (defined $ENV{REPLYTO}) { + $email = $ENV{REPLYTO}; + } + elsif (defined $special{$name}) { + $email = $special{$name} . $domain; + } + elsif ($name =~ /([^\s]+)\s+([^\s]+)/) { + ## Last name underscore first initial + $email = lc($2 . '_' . substr($1, 0, 1)) . $domain; + } + + return $email; +} + + +1; diff --git a/ACE/bin/ChangeLogEditor/FileLocator.pm b/ACE/bin/ChangeLogEditor/FileLocator.pm new file mode 100644 index 00000000000..5707a84c345 --- /dev/null +++ b/ACE/bin/ChangeLogEditor/FileLocator.pm @@ -0,0 +1,77 @@ +package FileLocator; + +# ************************************************************ +# Description : Base class for file locators. +# Author : Chad Elliott +# Create Date : 6/18/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use FileHandle; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub new { + my($class) = shift; + my($self) = bless { + }, $class; + return $self; +} + + +sub tmpnam { + my($self) = shift; + my($file) = shift; + my(@def) = ("/tmp", "."); + + foreach my $possible ($ENV{TMPDIR}, $ENV{TEMP}, $ENV{TMP}, @def) { + if (defined $possible && -d $possible && -w $possible) { + $possible =~ s!\\!/!g; + return $possible . '/' . $$ . '_' . $> . '_' . $file;; + } + } + + return $file; +} + + +sub process_errors { + my($self) = shift; + my($file) = shift; + my($error) = undef; + + if (-s $file != 0) { + my($fh) = new FileHandle(); + if (open($fh, $file)) { + $error = ''; + while(<$fh>) { + $error .= $_; + } + close($fh); + $error =~ s/\s+$//; + } + } + unlink($file); + + return $error; +} + + +sub locate { + my($self) = shift; + my(@dirs) = @_; + my(@modified) = (); + my(@removed) = (); + my(@conflicts) = (); + my(@unknown) = (); + return \@modified, \@removed, \@conflicts, \@unknown; +} + + +1; diff --git a/ACE/bin/ChangeLogEditor/FileLocatorFactory.pm b/ACE/bin/ChangeLogEditor/FileLocatorFactory.pm new file mode 100644 index 00000000000..7b9ba382ebd --- /dev/null +++ b/ACE/bin/ChangeLogEditor/FileLocatorFactory.pm @@ -0,0 +1,34 @@ +package FileLocatorFactory; + +# ************************************************************ +# Description : Create FileLocator objects. +# Author : Chad Elliott +# Create Date : 11/29/2005 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use CVSFileLocator; +use SVNFileLocator; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub create { + switch: { + -d 'CVS' && do { return new CVSFileLocator(); }; + ((defined $ENV{SVN_ASP_DOT_NET_HACK} && -d '_svn') || -d '.svn') + && do { return new SVNFileLocator(); }; + print STDERR "WARNING: Unsupported revision control protocol\n"; + } + + return new FileLocator(); +} + + +1; diff --git a/ACE/bin/ChangeLogEditor/SVNFileLocator.pm b/ACE/bin/ChangeLogEditor/SVNFileLocator.pm new file mode 100644 index 00000000000..55a8674af81 --- /dev/null +++ b/ACE/bin/ChangeLogEditor/SVNFileLocator.pm @@ -0,0 +1,75 @@ +package SVNFileLocator; + +# ************************************************************ +# Description : Use SVN to determine the list of modified files. +# Author : Chad Elliott +# Create Date : 11/29/2005 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use FileHandle; + +use FileLocator; + +use vars qw(@ISA); +@ISA = qw(FileLocator); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub locate { + my($self) = shift; + my(@dirs) = @_; + my($fh) = new FileHandle(); + my(@modified) = (); + my(@removed) = (); + my(@conflicts) = (); + my(@unknown) = (); + my($error) = undef; + my($err) = $self->tmpnam('cle_svn.err'); + + if (open($fh, "svn status @dirs 2> $err |")) { + while(<$fh>) { + my($line) = $_; + if ($line =~ /^([A-Z\s\?])([A-Z\s])[A-Z\s][\+\*\s][A-Z\s][A-Z\s]\s+(.*)$/) { + my($content) = $1; + my($property) = $2; + my($file) = $3; + + ## Subversion differs from CVS in that it will print paths with + ## windows style back-slashes instead of forward slashes. + $file =~ s!\\!/!g if ($^O eq 'MSWin32'); + + if ($property eq 'M' || + $content eq 'M' || $content eq 'A' || $content eq 'R') { + push(@modified, $file); + } + elsif ($content eq 'D') { + push(@removed, $file); + } + elsif ($content eq 'C' || $property eq 'C') { + push(@conflicts, $file); + } + elsif ($content eq '?' && index($line, $err) == -1) { + push(@unknown, $file); + } + } + } + close($fh); + + $error = $self->process_errors($err); + } + else { + $error = "Unable to run svn with error redirection."; + } + + return \@modified, \@removed, \@conflicts, \@unknown, $error; +} + + +1; diff --git a/ACE/bin/DependencyGenerator/GNUDependencyWriter.pm b/ACE/bin/DependencyGenerator/GNUDependencyWriter.pm new file mode 100644 index 00000000000..dd59ce6b803 --- /dev/null +++ b/ACE/bin/DependencyGenerator/GNUDependencyWriter.pm @@ -0,0 +1,33 @@ +package GNUDependencyWriter; + +# ************************************************************ +# Description : Generates GNU Makefile dependencies. +# Author : Chad Elliott +# Create Date : 2/10/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use DependencyWriter; + +use vars qw(@ISA); +@ISA = qw(DependencyWriter); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub process { + my($objects) = $_[1]; + my($files) = $_[2]; + + ## Sort the dependencies to make them reproducible + return '$(sort ' . join(' ', @$objects). "): \\\n " + . join(" \\\n ", sort @$files) . "\n"; +} + + +1; diff --git a/ACE/bin/DependencyGenerator/GNUObjectGenerator.pm b/ACE/bin/DependencyGenerator/GNUObjectGenerator.pm new file mode 100644 index 00000000000..e94ebc929fc --- /dev/null +++ b/ACE/bin/DependencyGenerator/GNUObjectGenerator.pm @@ -0,0 +1,34 @@ +package GNUObjectGenerator; + +# ************************************************************ +# Description : Generates object files for GNU Makefiles. +# Author : Chad Elliott +# Create Date : 5/23/2003 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use ObjectGenerator; + +use vars qw(@ISA); +@ISA = qw(ObjectGenerator); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub process { + my($noext) = $_[1]; + $noext =~ s/\.[^\.]+$//o; + return ["\$(VDIR)$noext.\$(SOEXT)", + "\$(VDIR)$noext.\$(OBJEXT)", + "\$(VSHDIR)$noext.\$(SOEXT)", + "\$(VSHDIR)$noext.\$(OBJEXT)", + ]; +} + + +1; diff --git a/ACE/bin/FOCUS/ChangeLog b/ACE/bin/FOCUS/ChangeLog new file mode 100644 index 00000000000..dd8fc234092 --- /dev/null +++ b/ACE/bin/FOCUS/ChangeLog @@ -0,0 +1,290 @@ +Fri Sep 21 09:44:15 UTC 2007 Johnny Willemsen <jwillemsen@remedy.nl> + + * FOCUS.pl: + Removed support for messaging specialization, this abstraction + has been removed from TAO + + * specializations/Messaging_Strategy: + * specializations/Messaging_Strategy/GIOP.spl: + Removed from the repo + +Wed Dec 20 10:00:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> + + * specializations/Reactor_Family/TP_Reactor.spl: + Removed specialization of Reactor.inl, the added include + is not necessary and causes a circular include problem + +Tue Nov 14 12:57:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> + + * specializations/Wait_Strategy/Wait_On_Leader_Follower.spl: + * FOCUS.pl: + Added new lf specialization + + * specializations/Wait_Strategy/Wait_On_Read.spl: + Updated to work with head + +Tue Nov 14 12:17:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> + + * specializations/Messaging_Strategy/GIOP.spl: + Updated to work with current svn head + +Tue Nov 14 11:30:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> + + * specializations/Reactor_Family/TP_Reactor.spl: + Updated to work with current svn head + +Fri Nov 10 09:38:12 UTC 2006 Johnny Willemsen <jwillemsen@remedy.nl> + + * docs/FOCUS.html: + Added tp-reactor reference + +Fri Nov 18 17:05:49 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * specializations/Reactor_Family/Select_Reactor_ST.spl: + * specializations/Reactor_Family/Select_Reactor_MT.spl: + + Reverted the include file in ace/Select_Reactor_T.inl as g++ 4.0 + seems to balk when this is not there. This does not seem to + happen with g++ 3.2 or later versions + +Thu Oct 27 09:47:32 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * specializations/iiop.spl: + + Updated specializations file based on changes made to ACE+TAO + +Thu Sep 29 15:57:36 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * FOCUS.pl: + Changed the script to use $ACE_ROOT enviornment variable to + compute the paths to the specialization files. + + * Parser/Parser.pm: + Modified the parser comments and return values. + + * NEWS: Added news file that discusses the current and planned + features. + + * README: Readme file + * INSTALL: Removed install file and moved contents to README + + * docs/FOCUS.html: Documenting the different features of FOCUS and + usage. + +Thu Sep 29 11:15:52 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * specializations/Protocol_Family/IIOP/iiop.spl: + * specializations/Context-Specific-Optimizations/Request-Creation-Optimizations.spl: + Changes required to the rules based on code level changes. + +Wed Sep 7 09:20:30 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * VERSION: + * specializations/Wait_Strategy/Wait_On_Read.spl: + * specializations/Protocol_Family/iiop.spl: + * specializations/Messaging_Strategy/GIOP.spl: + * Parser/Parser.pm: + + Added version file for the first internal release of + FOCUS. Updated the specializations based on recent updates. + +Tue Sep 6 09:07:04 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * specializations/Protocol_Family/iiop.spl: + + Added specialization rules for specializing the pluggable + protocols implementation in TAO with the IIOP protocol + implementation. + +Mon Aug 29 11:55:32 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * specializations/Reactor_Family/Select_Reactor_ST.spl: + * specializations/Reactor_Family/Select_Reactor_MT.spl: + * specializations/Reactor_Family/TP_Reactor.spl: + + Updated the specializations rules for the Reactor specialization + after the commit by Steve Huston. These have been tested and + validated with the code in ACE+TAO. + +Mon Aug 22 13:28:39 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * FOCUS.pl: + * Parser/Parser.pm: + * specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimitzation.spl: + + Added the specialization that resolves the request processor + only once and uses the cached request processor to service + requests on a specific connection for all other requests. + +Wed Aug 17 14:59:44 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * FOCUS.pl: + + Added new option for specializing the wait strategy at the + client side in ACE+TAO + + * Parser/Parser.pm: + + Added support of <copy-from-source> tag that copies source code + from a source file and inserts it into the destination file + at a particular hook location. + + * specializations/Reactor_Family/Select_Reactor_MT.spl: + * specializations/Reactor_Family/Select_Reactor_ST.spl: + * specializations/Wait_Strategy/Wait_On_Read.spl: + * specializations/Flushing_Strategy/Leader_Follower_Flushing_Strategy.spl: + + Updated the Reactor specializations, after eliminating the + Reactor_Timer_Interface from the Reactor implementation. Added + two specializations for the Wait strategy and the + Leader_Follower_Flushing strategies. Updated the Messaging + specialization based on hooks left in the source code. + +Mon Aug 15 14:59:28 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * Parser/Parser.pm: + + Updated the parser to include the attribute match-line in a + substitute tag. This matches the entire line as opposed to a + word which substitutes default behavior is. + + * specializations/Reactor_Family/Select_Reactor_MT.spl: + * specializations/Reactor_Family/Select_Reactor_ST.spl: + + Updated the rules to include the match-line attribute to match + the entire line as opposed to the a single word. + +Mon Aug 15 09:07:54 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * specializations/Select_Reactor_ST.spl: + * specializations/Select_Reactor_MT.spl: + * specializations/TP_Reactor.spl: + + Updated the specialization rules. In particular, the + specialization rules have been updated as two separate ST rules + and MT rules for select reactor ST and select reactor MT. + + * FOCUS.pl: + + Updated the main script to work with these two rules. + +Thu Aug 11 16:33:47 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * FOCUS.pl: + * Parser/Parser.pm: + + Added option to specify the output path where the specialization + file should be put. + + * specializations/Reactor_Family/TP_Reactor.spl: + Updated the thread-pool reactor specialization file tags based + on the generated code. + +Thu Aug 11 10:54:06 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * FOCUS.pl: + + Updated specialization entry for Thread Pool reactor. + + * Parser/Parser.pm: + + Updated the Visit_Substitute method with the requirement that it + match whole words and not parts of a word. For example, this + problem manifests when one is trying to substitute + Msg_WFMO_Reactor and WFM_Reactor. Both the strings match for + WFMO_Reactor, when only the latter should be matching. Corrected + this issue. + + * specializations/Select_Reactor.spl: + * specializations/TP_Reactor.spl: + + Updated the tags to be consistent and corrected several typos + and made sure that the rules in the specializations are actually + executed. + + * PROBLEM-REPORT-FORM: + + Most important thing added :-) + +Wed Aug 10 15:38:17 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * FOCUS.pl: + Moved the perl script from the Parser module to the top level + directory for convenience. + + * specializations/Reactor_Family/TP_Reactor.spl: + + Added a specialization file for specializing TP_Reactor + implementation. + + * specializations/Reactor_Family/Select_Reactor.spl: + + Updated the specialization file to be in sync with the code + level comment hooks in the ACE+TAO implementation. + +Sun Aug 7 16:15:29 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * Parser/Parser.pm: + + Added Visit_Comment visitor to parse and execute <comment> + tags. Each comment tag contains a start-hook and an end-hook + which can be used to comment blocks of region within the source + code. + + * specializations/Protocol_Family/Pluggable_Messaging.spl: + + A specialization file that completely removes the Pluggable + messaging interface and replaces that with the concrete type + used. + +Thu Aug 4 14:33:42 2005 Arvind Krishna <arvindkr@arvindkr.qualcomm.com> + + * Parser/Parser.pm: + + Added diagnostic messages and updated FOCUS perl script to use + Getopt command line parsing perl module. + +Thu Aug 4 10:57:08 2005 Arvind Krishna <arvindkr@arvindkr.qualcomm.com> + + * Parser/Parser.pm: + * Parser/FOCUS.pl: + Updated the parser module to include a <module> tag, this is + necessary when the specializations have to work across different + directories such as ACE and TAO. + +Wed Jul 27 15:54:02 PDT 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * specializations/Reactor_Family/Select_Reactor.spl: + Added a couple of specialization tags for reactor specialization. + + * Parser/xml-spl-parser.pm: + Parser now capable of executing search, replace, add and comment + functionality for specializations. + +Tue Jul 26 12:38:00 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * specializations/README: + + Added a evolving README file that describes the rules for + integrating different specializations into FOCUS. + +Tue Jul 26 11:23:51 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * Parser/Parser.pm: + * specializations/Reactor_Family/Select_Reactor.spl: + + A simple perl based parser to parse the XML specializations + defined within the various specialization + files. Select_Reactor.spl defines the specialization rules for + effecting the transformations for specializing the Reactor + framework within ACE. + +Tue Jul 26 11:21:44 2005 Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + + * FOCUS: + Birth of "Feature Oriented Customization of Systems" is a + research project that aims at customizing semi complete + applications or frameworks based on features (e.g., type of + protocol, type of reactor) used in an application. FOCUS was + born out of research efforts described in the following paper: + http://www.cs.wustl.edu/~schmidt/PDF/MW-Spl.pdf diff --git a/ACE/bin/FOCUS/FOCUS.pl b/ACE/bin/FOCUS/FOCUS.pl new file mode 100755 index 00000000000..b037b928b20 --- /dev/null +++ b/ACE/bin/FOCUS/FOCUS.pl @@ -0,0 +1,186 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; +######################################################################### +# FOCUS: A Feature Oriented Customization tool for ACE+TAO. +# +# Usage: +# ====== +# --prefix-path - gives the prefix to the place where ACE+TAO is installed +# --reactor-spl - provide the component that needs to be specialized +# --protocol-spl - provide the concrete protocol to specialize +# --output-prefix-path - +# (Optional) if specified, copies all the files to the +# output prefix. The directory structure is maintained. +# That is if foo/bar.h file was specialized. Then the +# output will be <prefix_output>/foo/bar.h +# +# Adding New Specializations +# =========================== +# (1) Add a new command line option if the specialization belongs to a +# new family of components. For example, Concurrency strategy +# (1.b) If not, then enhance exisiting option with a new value +# (2) Associate a specialization file for the concrete component being +# specialized. +# (3) Update the specializations directory appropriately to add the +# specializations file. +# +# @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> +# +# $Id$ +# +######################################################################## +use Getopt::Long; + +# This script can be invoked from anywhere. We need to add this to the +# path +use lib "$ENV{ACE_ROOT}/bin"; + +use FOCUS::Parser::FOCUSParser; + +sub usage +{ + + # How to use FOCUS + # Currently FOCUS supports the specialization of reactor and protocol + # families + my $usage = "usage: \n ./FOCUS " + . " \n --prefix-path=<path to module root>" + . " [\n --reactor-spl=<select-mt, select-st, tp-reactor>" + . " \n --protocol-spl=<iiop>" + . " \n --wait-strategy-spl=<rw, lf>" + . " \n --output-prefix=<output path>" + . " \n --context-specific-optimizations=<dispatch>" + . " \n ]" + . "\n"; + print "$usage \n"; +} + +# Global Table that maps the specialization name to the file +# select => "../specializations/Reactor_Family/Select_Reactor.spl +# For each component that one needs to specialize add an entry in +# this simple global table to execute the specializations. + +# Get the ACE_ROOT ENV variable. Then the specializations +# can be accessed via $ACE_ROOT/bin/FOCUS/..... +my $spl_prefix_path = ""; +if (defined $ENV{"ACE_ROOT"}) +{ + $spl_prefix_path = $ENV{"ACE_ROOT"}; + + # Check if the prefix path ends with a / or not + # if it does not then manually add the / to it + my $last = substr ($spl_prefix_path, -1); + if ($last ne "/") + { + $spl_prefix_path = $spl_prefix_path . "/"; + } + + # Add the bin/FOCUS directory to the prefix path + $spl_prefix_path = $spl_prefix_path . "bin/FOCUS/"; + +} +else +{ + print "FOCUS: ACE_ROOT environment variable not defined. Exiting... \n"; + exit 1; +} + +my %specialization_table = ( + "select-mt", $spl_prefix_path . "specializations/Reactor_Family/Select_Reactor_MT.spl", + "select-st", $spl_prefix_path . "specializations/Reactor_Family/Select_Reactor_ST.spl", + "tp-reactor",$spl_prefix_path . "specializations/Reactor_Family/TP_Reactor.spl", + "iiop", $spl_prefix_path . "specializations/Protocol_Family/IIOP/iiop.spl", + "rw", $spl_prefix_path . "specializations/Wait_Strategy/Wait_On_Read.spl", + "lf", $spl_prefix_path . "specializations/Wait_Strategy/Wait_On_Leader_Follower.spl", + "dispatch", $spl_prefix_path . "specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimization.spl"); + +# Get the command line options +my $ret = GetOptions ("prefix-path=s" => \$prefix_path, + "reactor-spl=s" => \$reactor_type, + "protocol-spl=s" => \$protocol_type, + "wait-strategy-spl=s" => \$wait_strat_type, + "output-prefix:s" => \$output_prefix, + "context-specific-optimizations=s" => \$context_opt); + +# Check if the prefix path is specified +if (!$prefix_path) +{ + usage; + exit 1; +} + +# +# Check if the optional outputpath is specified +# if it not specified then the output_prefix will +# be same as the prefix_path. +# So if the prefix is something like: +# /build/arvindk/ACE_wrappers, then the output_prefix +# will be the same. +# +# Upshot: The source files will be directly replaced. +# +if (! $output_prefix) +{ + $output_prefix = $prefix_path; +} + +# Check if the type of each component specialized is valid! +if ($reactor_type) +{ + my $spl_file = $specialization_table {$reactor_type}; + if (! length ($spl_file)) + { + print "Invalid reactor type specified \n"; + usage; + exit 1; + } + + # specialize the Reactor component + FOCUSParser::Specialize_Components ($prefix_path, $spl_file, $output_prefix); +} + +# protocol specialization +if ($protocol_type) +{ + my $spl_file = $specialization_table {$protocol_type}; + if (! spl_file) + { + print "Invalid reactor type specified \n"; + usage; + exit 1; + } + + # specialize the Protocol component + FOCUSParser::Specialize_Components ($prefix_path, $spl_file, $output_prefix); +} + +# Wait Strategy specialization +if ($wait_strat_type) +{ + my $spl_file = $specialization_table {$wait_strat_type}; + if (! spl_file) + { + print "Invalid specialization for the Wait strategy \n"; + usage; + exit 1; + } + + # specialize the wait strategy + FOCUSParser::Specialize_Components ($prefix_path, $spl_file, $output_prefix); +} + +# Context specific optimizations present +if ($context_opt) +{ + my $spl_file = $specialization_table {$context_opt}; + if (! spl_file) + { + print "Invalid Context specialization optimization specified\n"; + usage; + exit 1; + } + + # specialize the wait strategy + FOCUSParser::Specialize_Components ($prefix_path, $spl_file, $output_prefix); +} diff --git a/ACE/bin/FOCUS/NEWS b/ACE/bin/FOCUS/NEWS new file mode 100644 index 00000000000..29dd15e6a3d --- /dev/null +++ b/ACE/bin/FOCUS/NEWS @@ -0,0 +1,35 @@ +USER VISIBLE CHANGES AND CAPABILITIES ADDED TO FOCUS: +===================================================== + +. Support for specialization of ACE Reactor Framework + -- Specialization of ACE_Select_Reactor both st and mt + -- Specialization of ACE_TP_Reactor + +. Support for specialization of Pluggable Messaging in TAO + -- Specialization of Pluggable Messaging Interface based on GIOP + +. Support for specializing the Pluggable Protocol framework in TAO + -- Specialization for IIOP protocol implementation in TAO + +FUTURE CAPABILITIES and PLANNED CHANGES +======================================== +ACE+TAO component specialization related capabilities +----------------------------------------------------- +. Support for specialization of the Messaging Framework based on GIOP_Lite +. Support for specialization of Wait Strategy including Leader_Follower wait strategy +. Support for specialization of Flushing Strategy components + +FOCUS Specialization Language Enhancements +------------------------------------------ +. Support for multi line search and replace capabilities +. Support for ensuring source files are not corrupted when multiple + specializations are grouped together when the specializations are + added. + +FOCUS Transformation Related Enhancements +---------------------------------------- +. Support for undo feature for the transformations. This is going to be + really hard. I am not sure if this is doable +. Specifying dependencies between the different specializations. If one + is incompatible with the other, then this needs to be detected before + the specializations are executed. diff --git a/ACE/bin/FOCUS/PROBLEM-REPORT-FORM b/ACE/bin/FOCUS/PROBLEM-REPORT-FORM new file mode 100644 index 00000000000..9538e1d58df --- /dev/null +++ b/ACE/bin/FOCUS/PROBLEM-REPORT-FORM @@ -0,0 +1,45 @@ +To: arvindk@dre.vanderbilt.edu +Subject: [area]: [synopsis] + + TAO VERSION: + ACE VERSION: + + HOST MACHINE and OPERATING SYSTEM: + + + TARGET MACHINE and OPERATING SYSTEM, if different from HOST: + COMPILER NAME AND VERSION (AND PATCHLEVEL): + + FOCUS COMMAND LINE OPTION + [What command line option did you use for FOCUS?] + + AREA/CLASS/EXAMPLE AFFECTED: +[What example failed? What module failed to compile?] + + DOES THE PROBLEM AFFECT: + COMPILATION? + [ What compiler are you using? Please cut n paste the + compilation error.] + + LINKING? + [ On Unix systems, did you run make realclean first?] + EXECUTION? + OTHER (please specify)? + +[Please indicate whether ACE/TAO, your application, or both are affected.] + + SYNOPSIS: +[Brief description of the problem] + + DESCRIPTION: +[Detailed description of problem. Don't just say "<blah> +doesn't work, here's a fix," explain what your program does +to get to the <blah> state. ] + + SAMPLE FIX/WORKAROUND: +[If available ] + + ACE+TAO INSTRUMENTED FILES: + Please if possible attach the ACE+TAO instrumented files (source + files) that affected your application. (Please use a compression + utility for sending the attachments) diff --git a/ACE/bin/FOCUS/Parser/FOCUSParser.pm b/ACE/bin/FOCUS/Parser/FOCUSParser.pm new file mode 100644 index 00000000000..b2061a660a4 --- /dev/null +++ b/ACE/bin/FOCUS/Parser/FOCUSParser.pm @@ -0,0 +1,726 @@ +######################################################################### +# A Simple Parser for automating the specializations crated in FOCUS. +# +# @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> +# +# $Id$ +# +# This parser, parses the specialization file given as an input argument +# and *individually* visits the tags in a pre-determined order to weave +# in the specializations. +# NOTE: This parser will make N passes over the file, where N equals +# to the number of tags defined in the specialization file. This +# approach is intentional as it servers current needs. Future versions +# may enhance this parser and Visit methods to be more intelligent. +########################################################################### +package FOCUSParser; + +# for MY own preferences! +use strict; + +# XML related operations +use XML::DOM; + +# Generic file operations +use FileHandle; + +# Creating files and renaming them +use File::Copy; + +# Creating directories +use File::Path; + +############################################ +# GLOBAL CONSTANTS +########################################### +my $FOCUS_PREPEND_TAG = "\/\/@@ "; + +#################################################################### +# banner: A function that returns the FOCUS banner transformation +# for just clarity purpose only. +################################################################### +sub FOCUS_banner_start +{ + my $banner_str = "// Code woven by FOCUS:\n"; + return $banner_str; +} + +sub FOCUS_banner_end +{ + my $banner_str = "// END Code woven by FOCUS\n"; + return $banner_str; +} + +######################################################################### +# Visit_ADD: Visit a add element defined in the transform. +# In particular look for the hook defined: search it in the source file +# and add the data in the <data> tags into the file starting from the +# hook, but not including the hook. +########################################################################## +sub Visit_Add +{ + my ($add, $copy_file_name) = @_; + + # Open the copy and transform it + open (IN, "+<". $copy_file_name) || + die "cannot open file: " . $copy_file_name; + + # To update a file in place, we use the temporary + # file idiom. Perl says this is the best way to + # do this! + my $copy_file_tmp = $copy_file_name . "tmp"; + open (OUT, ">". $copy_file_tmp) || + die "cannot open temporary file for modying file:" . $copy_file_name; + + # get the hook element defined in the add element + my $hook = $add->getElementsByTagName ('hook'); + + # ensure length of hook == 1; + if ($hook->getLength != 1) + { + print "Assertion Error: An <add> element can have only \ + one <hook> definition"; + + # clean up + close (IN); + close (OUT); + + # Diagnostic comment + print " [failure]... Reverting changes \n"; + + unlink ($copy_file_name); + unlink ($copy_file_name . "tmp"); + exit (1); + } + + # Check if the hook is present in the file at all + my $hook_str = $hook->item(0)->getFirstChild->getNodeValue; + chomp ($hook_str); + + #//@@ For now, due to problem with the hook string + my $search_str = $hook_str; + + while (<IN>) + { + if (/$search_str/) + { + # Do not remove the hook! It needs to be present + print OUT $_; + + # FOCUS banner start + print OUT FOCUS_banner_start; + + # parse <data> ... </data> elements for this add tag + my @data_list = $add->getElementsByTagName ('data'); + foreach my $data (@data_list) + { + my $data_item = $data->getFirstChild->getNodeValue; + chomp ($data_item); + + # Insert the item + print OUT "$data_item \n"; + } + + # FOCUS banner end + print OUT FOCUS_banner_end; + } + else + { print OUT $_; } + } + + # Everything went well! + close (IN); + close (OUT); + + # replace in place the old file with the new one + rename ($copy_file_tmp, $copy_file_name); +} + +########################################################################### +# Visit_Remove: Visit a <remove> element defined in the transform. +# In particular look for the hook defined: search it in the source file +# and remove the element's value from the source file being searched. +############################################################################ +sub Visit_Remove +{ + my ($remove, $copy_file_name) = @_; + + # obtain the data to be removed + my $search = $remove->getFirstChild->getNodeValue; + chomp ($search); + + # Open the copy and transform it + open (IN, "+<" . $copy_file_name) || + die "cannot open file: " . $copy_file_name; + + # Update the file in place + my $copy_file_name_tmp = $copy_file_name . "tmp"; + open (OUT, ">". $copy_file_name_tmp) || + die "cannot open temporary file for modying file:" . $copy_file_name;; + + # Removing something is same as search and replace. Replace with "" + my $replace = ""; + + foreach my $line (<IN>) + { + if ($line =~/$search/) + { + # We do not print the banner information + # as we have removed something and + # print the banner will be redundant! + + # replace <search> with <replace> + $line =~ s/$search/$replace/; + + print OUT $line; + } + else { print OUT $line; } + } + + # Everything went well! + close (IN); + close (OUT); + + # replace in place the old file with the new one + rename ($copy_file_name_tmp, $copy_file_name); +} + +######################################################################### +# Visit_Substitute: Visit a <substitute> element defined in the transform. +# In particular look for the <search> element and replace it with the +# <replace> element. +######################################################################### +sub Visit_Substitute +{ + my ($substitute, $copy_file_name) = @_; + + # Open the copy and transform it + open (IN, "+<". $copy_file_name) || + die "cannot open file: " . $copy_file_name; + + # To update a file in place, we use the temporary + # file idiom. Perl says this is the best way to + # do this! + my $copy_file_name_tmp = $copy_file_name . "tmp"; + open (OUT, ">". $copy_file_name . "tmp") || + die "cannot open temporary file for modying file:" . $copy_file_name;; + + # check if the match-line keyword is set or not + my $match_line = $substitute->getAttribute('match-line'); + + # <search> .... </search> + my $search_list = $substitute->getElementsByTagName ('search'); + + # ensure length of search == 1; + if ($search_list->getLength != 1 || + $search_list->getLength == 0) + { + print "Assertion Error: A <substitute> element can have only \ + one <search> element"; + close (IN); + close (OUT); + + # Dianostic comment + print " [failure] reverting changes \n"; + + unlink ($copy_file_name); + unlink ($copy_file_name_tmp); + exit (1); + } + + # <replace> .... </replace> + my $replace_list = $substitute->getElementsByTagName ('replace'); + if ($replace_list->getLength != 1 || + $replace_list->getLength == 0) + { + print "Assertion Error: A <substitute> element can have only \ + one <replace> element"; + close (IN); + close (OUT); + unlink ($copy_file_name); + unlink ($copy_file_name_tmp); + exit (1); + } + + # <search> and <replace> element values + my $search = $search_list->item(0)->getFirstChild->getNodeValue; + my $replace = $replace_list->item(0)->getFirstChild->getNodeValue; + + # remove spaces + chomp ($search); + chomp ($replace); + + # Search and replace string in the file + foreach my $line (<IN>) + { + # Check if the match line attribute is set. If so then + # ignore word boundaries. If not, honor word boundaries. + my $line_matched = 0; + if (! $match_line) + { + if ($line =~/\b$search\b/) + { + $line_matched = 1; + } + } + else + { + if ($line =~ /$search/) + { + $line_matched = 1; + } + } + + # Check if the line matched + if ($line_matched) + { + # FOCUS banner start + print OUT FOCUS_banner_start; + + # replace <search> with <replace> + # Caveat: What if <search> occures multiple + # times in the line? Here is how we handle + # it + $line =~ s/$search/$replace/g; + + print OUT $line; + + # FOCUS banner end + print OUT FOCUS_banner_end; + } + else { print OUT $line; } + } + + # everything went well! + close (IN); + close (OUT); + + # replace in place the old file with the new one + rename ($copy_file_name_tmp, $copy_file_name); +} + +######################################################################### +# Visit_Comment: Visit the comment-region hooks defined in the +# source code and comment out all code between start and finish of that +# region +######################################################################### +sub Visit_Comment +{ + my ($comment, $copy_file_name) = @_; + + # check for the comment region tags and + # comment out the region + my $start_hook_tag = $comment->getElementsByTagName ('start-hook'); + my $end_hook_tag = $comment->getElementsByTagName ('end-hook'); + + if ($start_hook_tag->getLength != 1 || + $end_hook_tag->getLength != 1) + { + print "Assertion Error: A <comment> element can have only \ + one pair of <start-hook> and <end-hook> tags"; + unlink ($copy_file_name); + exit (1); + } + + my $start = $start_hook_tag->item(0)->getFirstChild->getNodeValue; + my $end = $end_hook_tag->item(0)->getFirstChild->getNodeValue; + + # What are we looking for: + # We need to start from "//" . FOCUS_PREPEND_TAG . $hook + # i.e. //[[@ <blah blah> + # This will be the format for both start and end + # //@@ Problems with the hook string + my $start_hook = $FOCUS_PREPEND_TAG . $start; + my $end_hook = $FOCUS_PREPEND_TAG . $end; + + # Open the copy and transform it + open (IN, "+<". $copy_file_name) || + die "cannot open file: " . $copy_file_name; + + my $copy_file_name_tmp = $copy_file_name . "tmp"; + open (OUT, ">". $copy_file_name_tmp) || + die "cannot open temporary file for modying file:" . $copy_file_name; + + my $start_commenting = 0; + while (<IN>) + { + if (! /$start_hook/ && + ! /$end_hook/) + { + if ($start_commenting) + { print OUT "// " . $_; } + else + { print OUT $_; } + } + else + { + if (/$start_hook/) + { + $start_commenting = 1; + print OUT $_; # print start hook! + } + else + { + $start_commenting = 0; + print OUT $_; # print end hook! + } + } + } + + # everything went well! + close (IN); + close (OUT); + + rename ($copy_file_name_tmp, $copy_file_name); +} + +############################################################### +# Visit_Copy: visit the <copy> tags and weave the code into the +# source file. In particular, open the source file specified +# in the file-source tag. Search for the start hook and +# copy until the end hook is reached. +############################################################### +sub Visit_Copy +{ + my ($copy_tag, $copy_file_name, $default_module_name, $prefix_path) = @_; + + # Check if a file name has been specified + my $dest_file_tag = $copy_tag->getElementsByTagName ('source'); + + if (! $dest_file_tag) + { + print "Error: <copy-from-source> does not have the <file> tag.."; + print "aborting \n"; + exit 1; + } + + if ($dest_file_tag->getLength != 1) + { + print "Assertion Error: A <copy-from-source> element can have only \ + one <source> tag from which to copy elements"; + exit (1); + } + + my $dest_file_name = $dest_file_tag->item(0)->getFirstChild->getNodeValue; + + #Check if the file exists and one is able to access it + $dest_file_name = $prefix_path . "/" . $default_module_name . "/" . $dest_file_name; + + open (DEST, "<". $dest_file_name) || + die "cannot open $dest_file_name \n Wrong <file> tag within <copy-from-source> exiting" ; + + # check for the start and end tags within the target file where + # one needs to start copying from + my $start_tag = $copy_tag->getElementsByTagName ('copy-hook-start'); + my $end_tag = $copy_tag->getElementsByTagName ('copy-hook-end'); + + if (! $start_tag || ! $end_tag) + { + print "Assertion Error: A <copy> element should have a \ + <copy-hook-start> tag and <copy-hook-end> tag \n"; + exit (1); + } + + # Get the <dest-hook> tag that indicates the destination where the + # code between the start and end tags will be placed. + my $dest_hook_tag = $copy_tag->getElementsByTagName ('dest-hook'); + if (! $dest_hook_tag) + { + print "Assertion Error: <copy-from-source> should have a <dest-hook> \ + tag that dictates where in the source file the code should be \ + placed. \n"; + exit (1); + } + + # Remove any starting and trailing white spaces + chomp ($dest_hook_tag); + + # We have everything we need! Do the copy + my $start_tag_name = $start_tag->item(0)->getFirstChild->getNodeValue; + my $end_tag_name = $end_tag->item(0)->getFirstChild->getNodeValue; + my $dest_tag_name = $dest_hook_tag->item(0)->getFirstChild->getNodeValue; + + # First we add the FOCUS prepend tags + $start_tag_name = $FOCUS_PREPEND_TAG . $start_tag_name; + $end_tag_name = $FOCUS_PREPEND_TAG . $end_tag_name; + $dest_tag_name = $FOCUS_PREPEND_TAG . $dest_tag_name; + + # Step 1: Iterate over the target file till the + # dest-hook is found in that file + my $copy_file_name_tmp = $copy_file_name . "tmp"; + open (OUT, ">". $copy_file_name_tmp) || + die "cannot open temporary file for modying file:" . $copy_file_name; + open (IN, "<" . $copy_file_name) || + die "cannot open file $copy_file_name specified in the <file> tag \n"; + + my $dest_tag_found = 0; #check if tag matched + foreach my $line (<IN>) + { + if ($line =~ /$dest_tag_name/) + { $dest_tag_found = 1; print OUT $line; last; } + + print OUT $line; + } + close (IN); + + # If we reached the end of file before finding the tag! + if (! $dest_tag_found) + { + print "\n Error: <dest-hook> tag missing in file .. aborting \n"; + close (DEST); + close (IN); + close (OUT); + unlink ($copy_file_name_tmp); + exit (1); + } + + # Step 2: Now look in the destination file and look for the hooks + # where one needs to copy. There could be multiple places where the + # hook can be present. E.g. + # ....... + # //@@ COPY_START_HOOK + # .... + # .... + # //@@ COPY_END_HOOK + # .... + # .... + # //@@ COPY_START_HOOK + # .... + # .... + # //@@ COPY_END_HOOK + # Handle this case + + my $line_matched = 0; + my $start_copying = 0; # initially do not copy + foreach my $line (<DEST>) + { + # Check if the line matches the start tag + if ($line =~/$start_tag_name/) + { + $line_matched += 1; + $start_copying = 1; + } + else + { + # Check if the line matches the end tag + if ($line =~/$end_tag_name/) + { + # check if the start tag matched! + if (! $line_matched) + { + print "Assertion error: <copy-hook-end> tag misplaced with \ + the <copy-hoook-source> \n"; + close (DEST); + close (IN); + close (OUT); + unlink ($copy_file_name_tmp); + exit (1); + } + + # decrement the count for nested tags + $line_matched -= 1; + if (! $line_matched ) + { $start_copying = 0; } + } + else + { + # Print out the line + if ($start_copying) + { print OUT $line; } + } + } + } + + # At the end of this loop line_matched should be 0 + if ($line_matched) + { + print "Error: in $dest_file_name, number of <copy-hook-source> tags \ + did not match the number of <copy-hook-end> tags. Reverting \ + changes. \n"; + close (DEST); + close (IN); + close (OUT); + unlink ($copy_file_name_tmp); + exit (1); + } + + # Step 3: Now copy data after the tag in the original file onto the destination + # file. + open (IN, "<" . $copy_file_name) || + die "cannot open file $copy_file_name specified in the <file> tag \n"; + $dest_tag_found = 0; #used as a flag + foreach my $line (<IN>) + { + if ($dest_tag_found) + { print OUT $line; } + + # If the hook is found, then don't write the hook onto OUT + # as it would have been written earlier + if (! $dest_tag_found && + $line =~ /$dest_tag_name/) + { $dest_tag_found = 1; } + } + + # Normal exit path + close (IN); + close (OUT); + close (DEST); + + # Rename the tmp file to the file modified + rename ($copy_file_name_tmp, $copy_file_name); +} + +################################################################# +# commit_files: A procedure to commit all the copy files that +# were specialized back to the orginal files. +################################################################# +sub commit_files +{ + my ($path_name, $output_path_name, @files) = @_; + + # iterate over the file_name_list + foreach my $file (@files) + { + # <file name="...."> + my $file_name = $file->getAttribute('name'); + + # output_path == input_path then do an in place + # substitution. + if ($output_path_name eq $path_name) + { + rename ($path_name . "/" . $file_name . "copy", + $path_name . "/" . $file_name); + } + else + { + # Check if the path_name exists. The path name + # corresponds to a directory. So create it if it does + # not exist. + if (! -d $output_path_name) + { + #@@? Need to revert the *copy files? + mkpath ($output_path_name, 0, 0744) || + die "cannot create $output_path_name: commit files failed! \n"; + } + + # move the specialized file to the output directory + rename ($path_name . "/" . $file_name . "copy", + $output_path_name . "/" . $file_name); + } + } +} + +#### Main ######################################################## +# Specialize_Component +# procedure to execute the transformations specified in the +# specialization file +################################################################## +sub Specialize_Components +{ + # Get the command line arguments + my ($prefix_path, $spl_file, $output_prefix) = @_; + + my $parser = XML::DOM::Parser->new(); + my $doc = $parser->parsefile($spl_file); + + # Check if the prefix path ends with a / or not + # if it does not then manually add the / to it + my $last = substr ($prefix_path, -1); + if ($last ne "/") + { $prefix_path = $prefix_path . "/"; } + + # Entry Point: <transform> element + foreach my $transform ($doc->getElementsByTagName('transform')) + { + # <module tags> + foreach my $module ($transform->getElementsByTagName('module')) + { + # Complete path name to the module + my $module_name = $module->getAttribute('name'); + my $path_name = $prefix_path . $module_name; + + # <file tags> + my @files = $module->getElementsByTagName('file'); + foreach my $file (@files) + { + # <file name="...."> + my $file_name = $file->getAttribute('name'); + + # Rather than modifying the files directly, make a local + # copy of the files and then transform them and commit + # if there is a file called foo we make a file foo_copy + my $file_path_copy = $path_name . "/" . $file_name . "copy"; + my $file_path_name = $path_name . "/" . $file_name; + + copy ($file_path_name, $file_path_copy); + + # Diagnostic comment + print "Instrumenting $file_name .........."; + + # <comment> ... </comment> + my @comment_list = $file->getElementsByTagName ('comment'); + foreach my $comment (@comment_list) + { Visit_Comment ($comment, $file_path_copy); } + + # <copy-from-source> ... </copy-from-source> + my @copy_from_source_files = + $file->getElementsByTagName ('copy-from-source'); + foreach my $copy_from_source (@copy_from_source_files) + { + Visit_Copy ($copy_from_source, + $file_path_copy, + $module_name, + $prefix_path); + } + + # <remove> ... </remove> + my @remove_list = $file->getElementsByTagName ('remove'); + foreach my $remove (@remove_list) + { Visit_Remove ($remove, $file_path_copy); } + + # <substitute ... </substitute> + my @substitute_list = $file->getElementsByTagName ('substitute'); + foreach my $substitute (@substitute_list) + { Visit_Substitute ($substitute, $file_path_copy); } + + # <add> <hook> ...... </hook> <add> + my @add_list = $file->getElementsByTagName ('add'); + foreach my $add (@add_list) + { Visit_Add ($add, $file_path_copy); } + + # Everything went well.. Print success + print " [done] \n"; + } + } + + # At this point all the specializations in all the modules have + # succeeded. It is at this point that we need to commit the + # specializations in each of the modules. That is move the temporary + # file that we created to the main file that was specialized. + # This also means that we need another loop and do the same thing + # as above.... + # <module tags> + foreach my $module ($transform->getElementsByTagName('module')) + { + # Complete path name to the module + my $module_name = $module->getAttribute('name'); + my $path_name = $prefix_path . $module_name; + + # Output path name: append output_prefix to the + # current module name. Append "/" to create a + # directory like /foo/bar/baz/ + my $output_path = $output_prefix . "/" . $module_name; + + # <file tags> + my @files = $module->getElementsByTagName('file'); + + # commit the files + commit_files ($path_name, $output_path, @files); + } + } +} + +#### +# Requiured for a module +#### +1; diff --git a/ACE/bin/FOCUS/README b/ACE/bin/FOCUS/README new file mode 100644 index 00000000000..871299833f6 --- /dev/null +++ b/ACE/bin/FOCUS/README @@ -0,0 +1,76 @@ + + FOCUS README + ============ + +Motivation: +---------- +Middleware is often developed as a set of frameworks that can be +extended and configured with alternative implementations of key +components, such as different types of transport protocols e.g., +TCP/IP, VME, or shared memory), event demultiplexing mechanisms +e.g., reactive-, proactive-, or thread-based), request +demultiplexing strategies (e.g., dynamic hashing, perfect +hashing, or active demuxing), and concurrency models (e.g., +thread-per-connection, thread pool, or thread-pre-request). A +particular DRE application, however, may only use a small subset +of the potential framework alternatives. As a result, general-purpose +middleware may be overly extensible, i.e., contain +unnecessary overhead for indirection and dynamic dispatching that is +not needed for use cases in a particular context. +A challenge is to develop middleware specialization +techniques that can eliminate unnecessary overhead associated with +overly extensible middleware framework implementations for certain +product variants or application-specific contexts. + +Example and Approach: +-------------------- +The reactor framework in ACE allows plug and play of different +reactors such as Select, TP, Devpoll etc. The TAO middleware +implementation and applications that run atop TAO typically use +one particular implementation of the Reactor. For example, a +single-threaded application might use select_* reactors. The +Reactor framework uses the bridge pattern to transparently +invoke operations on the right reactors. When the concrete +Reactor is known, it should be possible to specialize the +framework to use the concrete reactor directly rather than use +the bridge. + +As a part of the Feature Oriented Customizer (FOCUS) tool being +,we are trying to specialize frameworks +when the concrete implementation type is known a priori. FOCUS +provides an XML based transformation engine, where the +specialization transformations are captured in XML file and a +weaver specializes the code. + +To help in this transformation process, FOCUS applies markers +within the source code. These markers are added as special +comments. For example, //@@ REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK +represents a hook where forward declarations and include files are +added by the weaver. As these markers are comments therefore should not +affect normal applications in *any* manner. Additionally, applications +that use multiple reactor implementations not be affected/do not need any +change. Currently, these specializations are targeted for TAO middleware, +where applications know the target reactor a priori and want to +leverage the specialization to improve performance. + +FOCUS Installation +------------------ +. FOCUS is written using Perl and does not require any compilation. Additionally + FOCUS does not depend on any external tools. + +Requirements +------------ +. FOCUS has been tested on Perl version 5.8.0 and uses the following Perl + packages: + -- XML::DOM package --> Perl package for processing XML DTDs + +Sample Usage: +------------- +FOCUS can be invoked from the command line in the following manner: +cmd>$ACE_ROOT/bin/FOCUS/FOCUS.pl --reactor-spl=select-st + --prefix-path=/build/arvindk/ACE_wrappers + --output-prefix=/build/arvindk/spl-files + +More Information: +----------------- +More information about FOCUS should be available from the docs directory. diff --git a/ACE/bin/FOCUS/VERSION b/ACE/bin/FOCUS/VERSION new file mode 100644 index 00000000000..b41df4e4c7b --- /dev/null +++ b/ACE/bin/FOCUS/VERSION @@ -0,0 +1 @@ +This is FOCUS version 0.0.1 alpha diff --git a/ACE/bin/FOCUS/docs/FOCUS.html b/ACE/bin/FOCUS/docs/FOCUS.html new file mode 100644 index 00000000000..ca0c85a0a28 --- /dev/null +++ b/ACE/bin/FOCUS/docs/FOCUS.html @@ -0,0 +1,165 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<html> +<head> +<!-- $Id$ --> + <title>FOCUS</title> +</head> +<body bgcolor="#ffffff" link="#000fff" vlink="#ff0f0f" text="#000000"> +<hr> +<p></p> +<h2 align="center">Feature Oriented Customizer for Middleware (FOCUS)</h2> +<h3>Table of Contents</h3> +<ul> + <li><a href="#MOT">Introduction</a> </li> + <li><a href="#FCS-OVR">FOCUS Options overview</a> </li> + <li><a href="#FCS-USAGE">FOCUS Sample Usage</a> </li> + <li><a href="#FCS-ORG">FOCUS Structure & Organization</a> </li> + <li><a href="#FCS-ORG">Extending FOCUS</a> </li> +</ul> + +<hr> +<h3><b><a name="MOT">Introduction</a></b></h3> +TAO is a highly flexible ORB that contains a wide range of ORB +configuration options. One or more of these options can be combined +to meet various application requirements, such as low-latency, +predictable real-time behavior, or small memory footprint. TAO's ORB +configuration options are managed by an object-oriented framework +within the ORB Core. TAO ORB internally uses several objects called +<b>Resources</b>, such +as a <em>reactor</em> framework that demultiplexes new connection and +data requests from a client or <em>pluggable protocol</em> framework +to seamlessly work across different protocols. <b>Strategies</b>, are +objects that use the <b>Resource</b> entities to perform various ORB tasks, +such as connection management, concurrency, and demultiplexing. +The <b>Service Configurator</b> is a framework that can be used +to statically and dynamically configure components into middleware and +applications. + +Most often, applications that run on top of TAO use only one concrete type +of each resource. For example, predominantly TAO applications use the IIOP +protocol for communication. In this case, the underlying framework that +realizes the feature can be specialized to remove dynamic dispatching +overheads. The Feature Oriented Customizer (FOCUS) tool provides a +generic approach to enable middleware developers to specialize middleware +Frameworks when the concrete resource type is known a priori. +FOCUS provides an XML based transformation engine, where the +specialization transformations are captured in XML file and a +weaver specializes the code. Some important points to note about FOCUS +and specialization: +<ul> + <li>It does not modify an interface. So no application level changes are + necessary. + </li> + <li>Once a framework has been customized using FOCUS for a concrete component, + other components do not work. For example, specializing the protocol + framework with IIOP, precludes the ability to plug-in other protocol + implementations. + </li> + <li>It provides a source-to-source transformations that require re-compiling + the source. + </li> +</ul> + +<hr> +<h3><b><a name="FCS-OVR">FOCUS Options Usage</a></b></h3> +<table border="2" cellpadding="0" cellspacing="2"> + <tbody> + <tr> + <th>Option</th> + <th>Description</th> + </tr> + <tr> + <td>--prefix-path</td> + <td>prefix-path to the ACE+TAO source distribution location. For example, + in most situations this path is same as the ACE_ROOT environment + variable. + </td> + </tr> + <tr> + <td>--reactor-spl <em>select-st</em>, <em>select-mt</em>, <em>tp-reactor</em></td> + <td>Option to specialize the reactor framework with the + concrete reactor type. + <p>select-st: select reactor which no locking. Single threaded case.</p> + <p>select-mt: select reactor with locking enabled, multi-threaded case. + </p> + <p>tp-reactor: Thread-pool reactor</p> + </td> + </tr> + <tr> + <td>--protocol-spl <em>iiop</em></td> + <td>Option to specialize the pluggable protocol framework in TAO for the + IIOP protocol. + </tr> + <tr> + <td>--messaging-spl <em>giop</em></td> + <td>Option to specialize the messaging strategy in TAO with GIOP + messaging protocol. + </td> + </tr> + <tr> + <td>--wait-strategy <em>rw</em></td> + <td>Specialize the Wait Strategy with the concrete Wait Strategy in TAO. + This specialization corresponds to the <em>-ORBWaitStrategy</em> + option in TAO. + </td> + </tr> + <td>--output-prefix</td> + <td>Option to copy over the specialized files to an output directory. This + option works only when a single specialization is chose. If multiple + specializations are chosen, then this copies the files corresponding + to the last specialization. + </td> + </tbody> +</table> + +<hr> +<h3><b><a name="FCS-USAGE">FOCUS Sample Usage</a></b></h3> +cmd>$ACE_ROOT/bin/FOCUS/FOCUS.pl --reactor-spl=select-st \ + --prefix-path=/build/arvindk/ACE_wrappers + --output-prefix=/build/arvindk/spl-files + +<hr> +<h3><b><a name="FCS-ORG">FOCUS Tool Organization</a></b></h3> +FOCUS tool structure is organized as follows: +<ul> + <li>Parser directory has all parser related modules</li> + <li>specializations: Rules data base that has the XML files required for + performing the individual specialization transformations. For each + specialization we have the following sub directories: + <ul> + <li>Reactor_Family: Specializations for ACE_Reactor family</li> + <li>Protocol_Family: Specializations for TAO's protocol family</li> + <li>Messaging_Strategy: Specializations for TAO's Messaging Strategy</li> + <li>Wait_Strategy: Specializations for TAO's Wait strategies</li> + </ul> + </li> +</ul> + +A detailed overview of the FOCUS specialization language, that specifies the +different types for specialization transformations supported in FOCUS is +discussed here: {To be updated shortly!} + +<hr> +<h3><b><a name="FCS-ORG">Extending FOCUS</a></b></h3> +To add a new specializations, to FOCUS, one needs to do the following: +<ol> + <li>Use the FOCUS specification language to model the different specialization + Transformations required. Add this to the repository under + FOCUS/specializations. Current convention is to use a directory for each + family or specific type of specialization and add specialization files + for each type in the family. + </li> + <li>Annotate the middleware source code where ever applicable to perform the + transformations. + </li> + <li>Modify the FOCUS.pl script to add a specific option similar to --reactor-spl + option for executing the specializations. Also update the specialization + table that maps the command-line option to the appropriate specialization + file within the repository. + </li> +</ol> + +<hr> + +</body> +</html> diff --git a/ACE/bin/FOCUS/specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimization.spl b/ACE/bin/FOCUS/specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimization.spl new file mode 100644 index 00000000000..c56543cf54f --- /dev/null +++ b/ACE/bin/FOCUS/specializations/Context-Specific-Optimizations/Dispatch-Resolution-Optimization.spl @@ -0,0 +1,172 @@ +<?xml version="1.0"?> + +<!-- Dispatch Resolution Optimization + * ================================ + * This optimization should be applied with the requests + * from a client are delivered to the same operation in + * an IDL interface. In general this optimization applies + * to IDL interfaces that have a single operation defined + * on them + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<module name="TAO/tao"> + +<file name="Connection_Handler.h"> + +<!-- Include file to be added for this specialization --> +<add> + <hook>CONNECTION_HANDLER_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> + class TAO_Servant_Base; + #include "tao/Abstract_Servant_Base.h" + </data> +</add> + +<!-- Add get and set operations to hold operation signature --> +<add> + <hook>CONNECTION_HANDLER_SPL_PRIVATE_DATA_ADD_HOOK</hook> + <data> +TAO_Skeleton op_signature_; +TAO_Servant_Base *servant_; + </data> +</add> + +<!-- Add get and set public operations for the data --> +<add> + <hook>CONNECTION_HANDLER_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> +void set_op_signature (TAO_Skeleton &skeleton, + TAO_Servant_Base *&servant); +void get_op_signature (TAO_Skeleton &operation_ptr, + TAO_Servant_Base *&servant); + </data> +</add> + +</file> + +<file name="Connection_Handler.inl"> + +<!-- Add operations to get and set the operation signature --> +<add> + <hook>CONNECTION_HANDLER_SPL_METHODS_ADD_HOOK</hook> + <data> + ACE_INLINE void + TAO_Connection_Handler::set_op_signature (TAO_Skeleton &skeleton, + TAO_Servant_Base *&servant) +{ + this->op_signature_ = skeleton; + this->servant_ = servant; +} + +ACE_INLINE void +TAO_Connection_Handler::get_op_signature (TAO_Skeleton &operation_ptr, + TAO_Servant_Base *&servant) +{ + operation_ptr = this->op_signature_; + servant = this->servant_; +} + + </data> +</add> +</file> + +<file name="GIOP_Message_Base.h"> + +<add> +<hook>GIOP_MESSAGE_BASE_DATA_MEMBER_ADD_HOOK</hook> +<data>bool once__;</data> +</add> +</file> + +<file name="GIOP_Message_Base.cpp"> + +<add> + <hook>GIOP_MESSAGE_BASE_INCLUDE_ADD_HOOK</hook> + <data>#include "tao/Connection_Handler.h"</data> +</add> + +<!-- Add a once__ data member to the class that will + only resolve the dispatch once --> +<substitute match-line="yes"> + <search>TAO_DEF_GIOP_MINOR\)</search> + <replace>TAO_DEF_GIOP_MINOR) + , once__ (1) + </replace> +</substitute> + +<!-- Comment code that resolves dispatch normally --> +<comment> + <start-hook>TAO_DISPATCH_RESOLUTION_OPT_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_DISPATCH_RESOLUTION_OPT_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add the optimized path code --> +<add> + <hook>TAO_DISPATCH_RESOLUTION_OPT_COMMENT_HOOK_END</hook> + <data> + if (once__) + { + once__ = false; + + // Normal path the first time + this->orb_core_->request_dispatcher ()->dispatch ( + this->orb_core_, + request, + forward_to + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + else + { + // Dispatch directly to the skeleton + TAO_Connection_Handler *handler = + transport->connection_handler (); + TAO_Skeleton skel; + TAO_Servant_Base *skeleton_ptr; + handler->get_op_signature (skel, skeleton_ptr); + + // Convert references to void * + void *upcall_ptr = 0; + skel (request, + upcall_ptr, + (void *)skeleton_ptr + ACE_ENV_ARG_PARAMETER); + if (response_required) + request.tao_send_reply (); + } + </data> +</add> +</file> +</module> + +<module name="TAO/tao/PortableServer"> +<file name="Servant_Base.cpp"> + +<!-- Add necessary include files --> +<add> + <hook>TAO_SERVANT_BASE_INCLUDE_ADD_HOOK</hook> + <data>#include "tao/Transport.h"</data> + <data>#include "tao/Connection_Handler.h"</data> +</add> + +<!-- After processing the first request, set the operation signature on + the connection handler for subsequent request processing --> +<add> + <hook>TAO_DISPATCH_RESOLUTION_OPT_ADD_HOOK</hook> + <data> + TAO_Connection_Handler *handler = + req.transport ()->connection_handler (); + handler->set_op_signature (skel, + static_cast<TAO_Servant_Base *> (derived_this)); + </data> +</add> +</file> + +</module> + +</transform> diff --git a/ACE/bin/FOCUS/specializations/Flushing_Strategy/Leader_Follower_Flushing_Strategy.spl b/ACE/bin/FOCUS/specializations/Flushing_Strategy/Leader_Follower_Flushing_Strategy.spl new file mode 100644 index 00000000000..a33b90ba255 --- /dev/null +++ b/ACE/bin/FOCUS/specializations/Flushing_Strategy/Leader_Follower_Flushing_Strategy.spl @@ -0,0 +1,211 @@ +<?xml version="1.0"?> + +<!-- Leader Follower Flushing Strategy Specializations + * ================================================= + * Details all the specialization transformations necessary + * to specialize the Flushing Strategy with the concrete + * Leader_Follower flushing strategy. + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<module name="TAO/tao"> + +<!-- Transformations to L/F Flushing Strategy --> +<file name="Leader_Follower_Flushing_Strategy.h"> + +<!-- Comment out Flushing_Strategy include --> +<remove>#include "Flushing_Strategy.h"</remove> + +<!-- Add the forward declarations --> +<add> + <hook>FLUSHING_STRATEGY_SPL_INCLUDE_ADD_HOOK</hook> + <data> +class TAO_Transport; +class TAO_Queued_Message; +class ACE_Time_Value; + +#include "TAO_Export.h" + </data> +</add> + +<!-- Remove all virtual key words --> +<remove>virtual</remove> + +<!-- Remove inheritance from Flushing strategy --> +<remove>: public TAO_Flushing_Strategy</remove> + +</file> + +<!-- Do not build other Flushing Strategies --> +<file name="tao.mpc"> + + <substitute> + <search>Flushing_Strategy.h</search> + <replace>// Flushing_Strategy.h</replace> + </substitute> + <substitute> + <search>Flushing_Strategy.cpp</search> + <replace>// Flushing_Strategy.cpp</replace> + </substitute> + + <substitute> + <search>Block_Flushing_Strategy.h</search> + <replace>// Block_Flushing_Strategy.h</replace> + </substitute> + <substitute> + <search>Block_Flushing_Strategy.cpp</search> + <replace>// Block_Flushing_Strategy.cpp</replace> + </substitute> + + <substitute> + <search>Reactive_Flushing_Strategy.h</search> + <replace>// Reactive_Flushing_Strategy.h</replace> + </substitute> + <substitute> + <search>Reactive_Flushing_Strategy.cpp</search> + <replace>// Reactive_Flushing_Strategy.cpp</replace> + </substitute> + +</file> + +<file name="default_resource.cpp"> + +<substitute match-line="yes"> + <search>#include "tao/Reactive_Flushing_Strategy.h"</search> + <replace> // #include "tao/Reactive_Flushing_Strategy.h"</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "tao/Block_Flushing_Strategy.h"</search> + <replace>// #include "tao/Block_Flushing_Strategy.h"</replace> +</substitute> + +<!-- Replace all occurences of Flushing_Strategy with + L/F Flushing Strategy --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +<!-- Comment out region specified by comment hooks --> +<comment> + <start-hook>FLUSHING_STRATEGY_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>FLUSHING_STRATEGY_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add the L/F specialization after the hook --> +<add> + <hook>FLUSHING_STRATEGY_SPL_COMMENT_HOOK_END</end-hook> + <data>this->flushing_strategy_type_ = TAO_LEADER_FOLLOWER_FLUSHING; + </data> +</add> + +<!-- Comment out creation of all other flushing strategies --> +<comment> + <start-hook>FLUSHING_STRATEGY_CREATION_SPL_HOOK_START</start-hook> + <end-hook>FLUSHING_STRATEGY_CREATION_SPL_HOOK_END</end-hook> +</comment> + +<!-- Create the L/F flushing strategy directly --> +<add> + <hook>FLUSHING_STRATEGY_CREATION_SPL_HOOK_END</hook> + <data>ACE_NEW_RETURN (strategy, + TAO_Leader_Follower_Flushing_Strategy, + 0); + </data> +</add> + +</file> + +<file name="default_resource.h"> + +<!-- Replace all occurences of Flushing_Strategy with L/F strategy --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +<file name="ORB_Core.h"> + +<!-- Replace all occurences of base strategy with most + derived strategy --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +<file name="ORB_Core.cpp"> + +<!-- Replace the Flushing Strategy inclue with L/F + flushing include --> +<substitute match-line="yes"> + <search>#include "Flushing_Strategy.h"</search> + <replace>#include "Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +<file name="ORB_Core.i"> + +<!-- Replace all occurences of base strategy with most + derived strategy --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +<file name="Transport.h"> + +<!-- Remove the friend declaration of Reactive_Flushing --> +<substitute match-line="yes"> + <search>friend class TAO_Reactive_Flushing_Strategy;</search> + <replace>// friend class TAO_Reactive_Flushing_Strategy;</replace> +</substitute> + +<!-- Remove friend declaration of Block Flushing --> +<substitute match-line="yes"> + <search>friend class TAO_Block_Flushing_Strategy;</search> + <replace>// friend class TAO_Block_Flushing_Strategy;</replace> +</substitute> + +</file> + +<file name="Transport.cpp"> + +<substitute match-line="yes"> + <search>#include "Flushing_Strategy.h"</search> + <replace>#include "Leader_Follower_Flushing_Strategy.h</replace> +</substitute> + +<!-- Replace all occurences of TAO_Flushing_Strategy with + TAO_Leader_Follower_Flushing --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_strategy</replace> +</substitute> + +</file> + +<file name="Resource_Factor.h"> + +<!-- Replace TAO_Flushing_Strategy with L/F version --> +<substitute> + <search>TAO_Flushing_Strategy</search> + <replace>TAO_Leader_Follower_Flushing_Strategy</replace> +</substitute> + +</file> + +</module> + +</transform> diff --git a/ACE/bin/FOCUS/specializations/Protocol_Family/IIOP/iiop.spl b/ACE/bin/FOCUS/specializations/Protocol_Family/IIOP/iiop.spl new file mode 100644 index 00000000000..d0da22a42f9 --- /dev/null +++ b/ACE/bin/FOCUS/specializations/Protocol_Family/IIOP/iiop.spl @@ -0,0 +1,995 @@ +<?xml version="1.0"?> + +<!-- IIOP Pluggable Protocol specialization + * ====================================== + * This specializes the pluggable protocol framework within + * TAO for the IIOP concrete protocol implementation. This + * specialization encompasses specializations, such as + * specializations for the Transport, Profile, end-point, + * Acceptor and Connector implementations within ACE+TAO. + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> +<transform> + +<module name="TAO/tao"> + +<!-- Transformations to Transport implementation in TAO --> +<file name="Transport.h"> + +<!-- Search for TAO_Connection_Handler --> +<substitute match-line="yes"> + <search>class TAO_Connection_Handler;</search> + <replace>#include "tao/Connection_Handler.h"</replace> +</substitute> + +<!-- Add forward declarations and includes specific to + IIOP --> +<add> + <hook>TAO_TRANSPORT_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +namespace IIOP +{ + class ListenPointList; +} + +class TAO_Acceptor; +class TAO_Adapter; + </data> +</add> + +<!-- Remove all virtual and pure virtual methods in this + class --> +<remove>virtual</remove> + +<substitute match-line="yes"> + <search>= 0;</search> + <replace>;</replace> +</substitute> + +<!-- Replace the base class constructor with the derive + classes's constructor --> +<substitute match-line="yes"> + <search>TAO_Transport \(CORBA::ULong tag,</search> + <replace>TAO_Transport (TAO_IIOP_Connection_Handler *, CORBA::ULong tag, + </replace> +</substitute> + +<!-- Add public methods defined in IIOP_Transport --> +<add> + <hook>TAO_TRANSPORT_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> + + /// Bridge method to call a similar method on the connection handler + void update_protocol_properties (int send_buffer_size, + int recv_buffer_size, + int no_delay, + int enable_network_priority); + + /// Generate the request header + int generate_request_header (TAO_Operation_Details &opd, + TAO_Target_Specification &spec, + TAO_OutputCDR &msg); + </data> +</add> + +<!-- Add private methods from IIOP_Transport --> +<add> + <hook>TAO_TRANSPORT_SPL_PRIVATE_METHODS_ADD_HOOK</hook> + <data> + void set_bidir_context_info (TAO_Operation_Details &opdetails); + int get_listen_point (IIOP::ListenPointList &listen_point_list, + TAO_Acceptor *acceptor); + </data> +</add> + +<!-- Add private data from IIOP_Transport --> +<add> + <hook>TAO_TRANSPORT_SPL_DATA_MEMBERS_ADD_HOOK</hook> + <data> + /// The connection service handler used for accessing lower layer + /// communication protocols. + TAO_IIOP_Connection_Handler *connection_handler_; + + /// Our messaging object. + TAO_Pluggable_Messaging *messaging_object_; + </data> +</add> + +<!-- Typedef the TAO_Transport as IIOP_Transport --> +<add> + <hook>TAO_TRANSPORT_SPL_EXTERN_ADD_HOOK</hook> + <data>typedef TAO_Transport TAO_IIOP_Transport;</data> +</add> + +<!-- This method is overridden in the derived class --> +<substitute> + <search>generate_request_header</search> + <replace>generate_request_header_base__</replace> +</substitute> + +</file> + +<file name="Transport.cpp"> + +<!-- Add necessary includes --> +<add> + <hook>TAO_TRANSPORT_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +#include "Transport_Acceptor.h" +#include "IIOPC.h" +#include "Acceptor_Registry.h" +#include "operation_details.h" +#include "GIOP_Message_Base.h" +#include "Protocols_Hooks.h" + </data> +</add> + +<!-- Modify the TAO constructor adding the IIOP Transport's data --> +<substitute match-line="yes"> + <search>TAO_Transport::TAO_Transport \(CORBA::ULong tag,</search> + <replace>TAO_Transport::TAO_Transport (TAO_IIOP_Connection_Handler *handler, + CORBA::ULong tag, + </replace> +</substitute> + +<substitute match-line="yes"> + <search>, partial_message_ \(0\)</search> + <replace> , partial_message_ (0) + , connection_handler_ (handler) + , messaging_object_ (0) + </replace> +</substitute> + +<!-- Within the constructor create/initialize the messaging object --> +<add> + <hook>TAO_TRANSPORT_SPL_CONSTRUCTOR_ADD_HOOK</hook> + <data> + // Use the normal GIOP object + ACE_NEW (this->messaging_object_, + TAO_GIOP_Message_Base (orb_core)); + </data> +</add> + +<add> + <hook>TAO_TRANSPORT_SPL_DESTRUCTOR_ADD_HOOK</hook> + <data>delete this->messaging_object_;</data> +</add> + +<!-- comment out unimplemented base class methods --> +<comment> + <start-hook>TAO_TRANSPORT_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_TRANSPORT_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add the concrete methods from IIOP_Transport implementation --> +<copy-from-source> + <source>IIOP_Transport.cpp</source> + + <copy-hook-start>TAO_TRANSPORT_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_TRANSPORT_SPL_COPY_HOOK_END</copy-hook-end> + + <dest-hook>TAO_TRANSPORT_SPL_METHODS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- The derived class calls this method. Override this --> +<substitute> + <search>TAO_Transport::generate_request_header</search> + <replace>TAO_Transport::generate_request_header_base__</replace> +</substitute> + +</file> + +<!-- Transformations to specialize Connection_Handler class --> +<file name="Connection_Handler.h"> + +<!-- Remove the default constructor, NOTE: we use regular expressions + to match the constructor but not the destructor --> +<remove>\s+TAO_Connection_Handler\s*\(void\);</remove> + +<!-- Make sure that Connection_Handler inherits from SVC_HANDLER --> +<substitute match-line="yes"> + <search>: public TAO_LF_CH_Event</search> + <replace>: public TAO_IIOP_SVC_HANDLER, + public TAO_LF_CH_Event + </replace> +</substitute> + +<!-- Forward declarations --> +<add> + <hook>CONNECTION_HANDLER_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +#include "ace/Svc_Handler.h" +#include "ace/SOCK_Stream.h" + +typedef ACE_Svc_Handler < ACE_SOCK_STREAM, ACE_NULL_SYNCH > + TAO_IIOP_SVC_HANDLER; + +namespace IIOP +{ + class ListenPointList; +} + </data> +</add> + +<!-- Public methods from IIOP_Connection_Handler class --> +<add> + <hook>CONNECTION_HANDLER_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> + int open (void *); + int close (u_long = 0); + + int resume_handler (void); + int handle_output (ACE_HANDLE); + int handle_close (ACE_HANDLE, ACE_Reactor_Mask); + int handle_timeout (const ACE_Time_Value &current_time, + const void *act = 0); + + /// Add ourselves to Cache. + int add_transport_to_cache (void); + + /// Process the @a listen_list + int process_listen_point_list (IIOP::ListenPointList &listen_list); + + /// Check if network priority needs to be enabled + int enable_network_priority (void); + + TAO_Connection_Handler (ACE_Thread_Manager * = 0); + + /// Constructor. + TAO_Connection_Handler (TAO_ORB_Core *orb_core, + CORBA::Boolean flag); + </data> +</add> + +<!-- Private data members --> +<add> + <hook>CONNECTION_HANDLER_SPL_PRIVATE_DATA_ADD_HOOK</hook> + <data>int dscp_codepoint_;</data> +</add> + +<!-- Typedef the class --> +<add> + <hook>CONNECTION_HANDLER_SPL_EXTERN_ADD_HOOK</hook> + <data>typedef TAO_Connection_Handler TAO_IIOP_Connection_Handler;</data> +</add> + +<!-- Remove all virtuals and =0; from the code --> +<remove>virtual</remove> + +<substitute match-line="yes"> + <search>= 0;</search> + <replace>;</replace> +</substitute> + +</file> + +<file name="Connection_Handler.cpp"> + +<!-- Add the include hook --> +<add> + <hook>CONNECTION_HANDLER_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +#include "IIOPC.h" +#include "Thread_Lane_Resources.h" +#include "Base_Transport_Property.h" +#include "Protocols_Hooks.h" +#include "Wait_Strategy.h" + +#include "ace/os_include/netinet/os_tcp.h" +#include "ace/os_include/os_netdb.h" + </data> +</add> + +<!-- IIOP_Connection_Handler constructors added --> +<add> + <hook>CONNECTION_HANDLER_SPL_METHODS_ADD_HOOK</hook> + <data> +TAO_Connection_Handler::TAO_Connection_Handler (ACE_Thread_Manager *t) + : TAO_IIOP_SVC_HANDLER (t, 0 , 0), + orb_core_ (0), + dscp_codepoint_ (IPDSFIELD_DSCP_DEFAULT << 2) +{ + ACE_ASSERT (0); +} + +TAO_Connection_Handler::TAO_Connection_Handler ( + TAO_ORB_Core *orb_core, + CORBA::Boolean flag) + : TAO_IIOP_SVC_HANDLER (orb_core->thr_mgr (), 0, 0), + orb_core_ (orb_core), + transport_ (0), + dscp_codepoint_ (IPDSFIELD_DSCP_DEFAULT << 2) +{ + TAO_IIOP_Transport* specific_transport = 0; + ACE_NEW (specific_transport, + TAO_IIOP_Transport (this, IOP::TAG_INTERNET_IOP, orb_core)); + + // store this pointer (indirectly increment ref count) + this->transport (specific_transport); + + // @@todo: We need to have a distinct option/ method in the resource + // factory for this and TAO_Transport. + this->lock_ = + this->orb_core_->resource_factory ()->create_cached_connection_lock (); + + // Put ourselves in the connection wait state as soon as we get + // created + this->state_changed (TAO_LF_Event::LFS_CONNECTION_WAIT, + this->orb_core_->leader_follower ()); +} + </data> +</add> + +<!-- Replace all occurances of IIOP_Connection_Handler with that + of TAO_Connection_Handler --> +<substitute> + <search>TAO_IIOP_Connection_Handler</search> + <replace>TAO_Connection_Handler</replace> +</substitute> + +<!-- Comment out base class methods that are over-ridden in the + derived class --> +<comment> + <start-hook>CONNECTION_HANDLER_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>CONNECTION_HANDLER_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Copy operations from IIOP_Connection_Handler class and put them + in the Connection_Handler class --> + +<copy-from-source> + + <source>IIOP_Connection_Handler.cpp</source> + <copy-hook-start>CONNECTION_HANDLER_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>CONNECTION_HANDLER_SPL_COPY_HOOK_END</copy-hook-end> + <dest-hook>CONNECTION_HANDLER_SPL_METHODS_ADD_HOOK</dest-hook> + +</copy-from-source> + +<add> + <hook>CONNECTION_HANDLER_DESTRUCTOR_ADD_HOOK</hook> + <data>delete this->transport ();</data> +</add> + +</file> + +<!-- Modifications to Acceptor and Connector Components in TAO --> +<file name="Transport_Acceptor.h"> + +<!-- Forward declaration --> +<add> + <hook>TAO_ACCEPTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +#include "tao/Connection_Handler.h" +#include "tao/Acceptor_Impl.h" +#include "tao/GIOP_Message_Version.h" +#include "ace/Acceptor.h" +#include "ace/SOCK_Acceptor.h" + </data> +</add> + +<!-- Methods from IIOP_Acceptor components --> +<copy-from-source> + <source>IIOP_Acceptor.h</source> + <copy-hook-start>TAO_ACCEPTOR_SPL_CONCRETE_METHODS_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_ACCEPTOR_SPL_CONCRETE_METHODS_COPY_HOOK_END</copy-hook-end> + <dest-hook>TAO_ACCEPTOR_SPL_PUBLIC_METHODS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- Typedef hook --> +<add> + <hook>TAO_ACCEPTOR_SPL_EXTERN_ADD_HOOK</hook> + <data>typedef TAO_Acceptor TAO_IIOP_Acceptor; + #if defined(__ACE_INLINE__) + #include "tao/IIOP_Acceptor.i" + #endif /* __ACE_INLINE__ */ + </data> +</add> + +<!-- Private data memeber --> +<copy-from-source> + <source>IIOP_Acceptor.h</source> + + <copy-hook-start>TAO_ACCEPTOR_SPL_DATA_MEMBERS_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_ACCEPTOR_SPL_DATA_MEMBERS_COPY_HOOK_END</copy-hook-end> + + <dest-hook>TAO_ACCEPTOR_SPL_DATA_MEMBERS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- Eliminate the virtual functions --> +<remove>virtual</remove> +<substitute match-line="yes"> + <search>= 0;</search> + <replace>;</replace> +</substitute> + +<!-- Remove destructor --> +<remove>~TAO_IIOP_Acceptor \(void\);</remove> + +<substitute> + <search>TAO_IIOP_Acceptor</search> + <replace>TAO_Acceptor</replace> +</substitute> + +</file> + +<!-- Transformations to Transport_Acceptor.cpp --> +<file name="Transport_Acceptor.cpp"> + +<copy-from-source> + <source>IIOP_Acceptor.cpp</source> + + <copy-hook-start>TAO_ACCEPTOR_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_ACCEPTOR_SPL_COPY_HOOK_END</copy-hook-end> + + <dest-hook>TAO_ACCEPTOR_SPL_METHODS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- Modify the constructor --> +<substitute match-line="yes"> + <search>: TAO_Acceptor \(IOP::TAG_INTERNET_IOP\),</search> + <replace>: tag_ (IOP::TAG_INTERNET_IOP), + </replace> +</substitute> + +<!-- Add mthods to the destructor --> +<add> + <hook>TAO_ACCEPTOR_DESTRUCTOR_ADD_HOOK</hook> + <data> + this->close (); + delete this->creation_strategy_; + delete this->concurrency_strategy_; + delete this->accept_strategy_; + + delete [] this->addrs_; + + for (CORBA::ULong i = 0; i < this->endpoint_count_; ++i) + CORBA::string_free (this->hosts_[i]); + + delete [] this->hosts_; + </data> +</add> + +<!-- Trasnform IIOP_Acceptor to TAO_Acceptor --> +<substitute match-line="yes"> + <search>#include "tao/IIOP_Acceptor.h"</search> + <replace> </replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "tao/IIOP_Profile.h"</search> + <replace>#include "tao/Profile.h"</replace> +</substitute> + +<substitute> + <search>TAO_IIOP_Acceptor::TAO_IIOP_Acceptor</search> + <replace>TAO_Acceptor::TAO_Acceptor</replace> +</substitute> + +</file> + +<file name="tao.mpc"> + +<!-- Do not build all IIOP_* files as the specializations + are moved to the base classes --> + +<substitute> + <search>IIOP_Transport.cpp</search> + <replace>// IIOP_Transport.cpp </replace> +</substitute> + +<substitute> + <search>IIOP_Transport.h</search> + <replace>// IIOP_Transport.h</replace> +</substitute> + +<substitute> + <search>IIOP_Connection_Handler.cpp</search> + <replace>// IIOP_Connection_Handler.cpp</replace> +</substitute> +<substitute> + <search>IIOP_Connection_Handler.h</search> + <replace>// IIOP_Connection_Handler.h</replace> +</substitute> + +<substitute> + <search>IIOP_Acceptor.cpp</search> + <replace>// IIOP_Acceptor.cpp</replace> +</substitute> +<substitute> + <search>IIOP_Acceptor.h</search> + <replace>// IIOP_Acceptor.h</replace> +</substitute> + +<substitute> + <search>IIOP_Connector.cpp</search> + <replace>// IIOP_Connector.cpp</replace> +</substitute> + +<substitute> + <search>IIOP_Endpoint.cpp</search> + <replace>// IIOP_Endpoint.cpp</replace> +</substitute> + +<substitute> + <search>IIOP_Connector.h</search> + <replace>// IIOP_Connector.h</replace> +</substitute> + +<substitute> + <search>IIOP_Endpoint.h</search> + <replace>// IIOP_Endpoint.h</replace> +</substitute> + +<substitute> + <search>IIOP_Profile.cpp</search> + <replace>// IIOP_Profile.cpp</replace> +</substitute> +<substitute> + <search>IIOP_Profile.h</search> + <replace>// IIOP_Profile.h</replace> +</substitute> + +</file> + +<file name="Endpoint.h"> + +<!-- Include and forward declation add hook --> +<add> + <hook>TAO_ENDPOINT_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +#include "tao/IIOP_EndpointsC.h" +#include "ace/INET_Addr.h" + </data> +</add> + +<!-- Copy the private member declarations from IIOP_Endpoint + implementation --> + +<copy-from-source> + <source>IIOP_Endpoint.h</source> + + <copy-hook-start>TAO_ENDPOINT_SPL_PRIVATE_DATA_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_ENDPOINT_SPL_PRIVATE_DATA_COPY_HOOK_END</copy-hook-end> + + <dest-hook>TAO_ENDPOINT_SPL_PRIVATE_DATA_ADD_HOOK</dest-hook> +</copy-from-source> + +<copy-from-source> + <source>IIOP_Endpoint.h</source> + <copy-hook-start>TAO_ENDPOINT_SPL_PUBLIC_METHODS_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_ENDPOINT_SPL_PUBLIC_METHODS_COPY_HOOK_END</copy-hook-end> + <dest-hook>TAO_ENDPOINT_SPL_PUBLIC_METHODS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- Remove the unimplemented copy constructor of the base class --> +<remove>ACE_UNIMPLEMENTED_FUNC \(TAO_Endpoint \(const TAO_Endpoint&\)\)</remove> + +<substitute> + <search>TAO_IIOP_Endpoint</search> + <replace>TAO_Endpoint</replace> +</substitute> + +<substitute> + <search>TAO_IIOP_Profile</search> + <replace>TAO_Profile</replace> +</substitute> + +<add> + <hook>TAO_ENDPOINT_SPL_EXTERN_ADD_HOOK</hook> + <data>typedef TAO_Endpoint TAO_IIOP_Endpoint; + #if defined (__ACE_INLINE__) + # include "tao/IIOP_Endpoint.i" + #endif /* __ACE_INLINE__ */ + </data> +</add> + +<!-- Eliminate the virtual functions --> +<remove>virtual</remove> +<substitute match-line="yes"> + <search>= 0;</search> + <replace>;</replace> +</substitute> + +</file> + +<file name="Endpoint.cpp"> + + <copy-from-source> + <source>IIOP_Endpoint.cpp</source> + <copy-hook-start>TAO_ENDPOINT_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_ENDPOINT_SPL_COPY_HOOK_END</copy-hook-end> + <dest-hook>TAO_ENDPOINT_SPL_METHODS_ADD_HOOK</dest-hook> + </copy-from-source> + + <!-- In the constructors copied from the derived class, there is a + invocation of the base class constructor. Expand it --> + <substitute match-line="yes"> + <search>: TAO_Endpoint \(IOP::TAG_INTERNET_IOP\)</search> + <replace>: addr_lookup_lock_ () + , hash_val_ (0) + , tag_ (IOP::TAG_INTERNET_IOP) + , priority_ (TAO_INVALID_PRIORITY) + </replace> + </substitute> + + <substitute match-line="yes"> + <search>: TAO_Endpoint \(IOP::TAG_INTERNET_IOP, priority\)</search> + <replace>: addr_lookup_lock_ () + , hash_val_ (0) + , tag_ (IOP::TAG_INTERNET_IOP) + , priority_ (priority) + </replace> + </substitute> + + <substitute match-line="yes"> + <search>: TAO_Endpoint \(rhs.tag_, rhs.priority_\)</search> + <replace>: addr_lookup_lock_ () + , hash_val_ (0) + , tag_ (rhs.tag_) + , priority_ (rhs.priority_) + </replace> + </substitute> + +<substitute> + <search>TAO_IIOP_Endpoint</search> + <replace>TAO_Endpoint</replace> +</substitute> + +<remove>#include "IIOP_Endpoint.h"</remove> + +</file> + +<file name="Transport_Connector.h"> + +<add> + <hook>TAO_CONNECTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +#include "ace/SOCK_Connector.h" +#include "ace/Connector.h" +#include "tao/Connector_Impl.h" +#include "tao/Connection_Handler.h" + </data> +</add> + +<copy-from-source> + <source>IIOP_Connector.h</source> + <copy-hook-start>TAO_CONNECTOR_SPL_PUBLIC_METHODS_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_CONNECTOR_SPL_PUBLIC_METHODS_COPY_HOOK_END</copy-hook-end> + <dest-hook>TAO_CONNECTOR_SPL_PUBLIC_METHODS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- IIOP_Connector's constructor --> +<add> + <hook>TAO_CONNECTOR_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> TAO_Connector (CORBA::Boolean flag = 0);</data> +</add> + +<copy-from-source> + <source>IIOP_Connector.h</source> + <copy-hook-start>TAO_CONNECTOR_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_CONNECTOR_SPL_COPY_HOOK_END</copy-hook-end> + <dest-hook>TAO_CONNECTOR_SPL_PRIVATE_DATA_ADD_HOOK</dest-hook> +</copy-from-source> + +<add> + <hook>TAO_CONNECTOR_SPL_EXTERN_ADD_HOOK</hook> + <data>typedef TAO_Connector TAO_IIOP_Connector;</data> +</add> + +<!-- eliminate all virtual methods --> +<remove>virtual</remove> + +<substitute match-line="yes"> + <search>= 0;</search> + <replace>;</replace> +</substitute> + +<substitute match-line="yes"> + <search>class TAO_Endpoint;</search> + <replace>#include "tao/Endpoint.h"</replace> +</substitute> + +</file> + +<file name="Transport_Connector.cpp"> + +<add> + <hook>TAO_CONNECTOR_SPL_INCLUDE_ADD_HOOK</hook> + <data> +#include "ace/OS_NS_strings.h" + </data> +</add> + +<!-- Instrument the constructor --> +<substitute match-line="yes"> + <search>: TAO_Connector \(IOP::TAG_INTERNET_IOP\)</search> + <replace>: active_connect_strategy_ (0) + , tag_ (IOP::TAG_INTERNET_IOP) + , orb_core_ (0) + </replace> +</substitute> + +<copy-from-source> + <source>IIOP_Connector.cpp</source> + + <copy-hook-start>TAO_CONNECTOR_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_CONNECTOR_SPL_COPY_HOOK_END</copy-hook-end> + + <dest-hook>TAO_CONNECTOR_SPL_METHODS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- replace all IIOP_Connector with TAO_Connector --> +<substitute> + <search>TAO_IIOP_Connector</search> + <replace>TAO_Connector</replace> +</substitute> + +</file> + +<file name="IIOP_Factory.cpp"> + +<substitute match-line="yes"> + <search>#include "IIOP_Acceptor.h"</search> + <replace>#include "Transport_Acceptor.h"</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "IIOP_Connector.h"</search> + <replace>#include "Transport_Connector.h"</replace> +</substitute> +</file> + +<file name="IIOP_Lite_Factory.cpp"> + +<substitute match-line="yes"> + <search>#include "IIOP_Acceptor.h"</search> + <replace>#include "Transport_Acceptor.h"</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "IIOP_Connector.h"</search> + <replace>#include "Transport_Connector.h"</replace> +</substitute> +</file> + +<!-- Transformations to Profile class to make it tailored for IIOP + Profile --> +<file name="Profile.h"> + +<!-- include and forward declarations --> +<substitute match-line="yes"> + <search>class TAO_Endpoint;</search> + <replace>#include "tao/Endpoint.h"</replace> +</substitute> + +<!-- Remove all virtual methods --> +<remove>virtual</remove> +<substitute match-line="yes"> + <search>= 0;</search> + <replace>;</replace> +</substitute> + +<!-- Copy all public methods from IIOP_Profile.h --> +<copy-from-source> + <source>IIOP_Profile.h</source> + <copy-hook-start>TAO_PROFILE_SPL_PUBLIC_METHODS_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_PROFILE_SPL_PUBLIC_METHODS_COPY_HOOK_END</copy-hook-end> + <dest-hook>TAO_PROFILE_SPL_PUBLIC_METHODS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- Add proteccted data from IIOP_Profile class --> +<copy-from-source> + <source>IIOP_Profile.h</source> + <copy-hook-start>TAO_PROFILE_SPL_PROTECTED_METHODS_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_PROFILE_SPL_PROTECTED_METHODS_COPY_HOOK_END</copy-hook-end> + <dest-hook>TAO_PROFILE_SPL_PROTECTED_METHODS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- Add all the private data methods --> +<copy-from-source> + <source>IIOP_Profile.h</source> + <copy-hook-start>TAO_PROFILE_SPL_PRIVATE_DATA_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_PROFILE_SPL_PRIVATE_DATA_COPY_HOOK_END</copy-hook-end> + <dest-hook>TAO_PROFILE_SPL_PRIVATE_DATA_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- Typedef the Profile class as IIOP_Profile --> +<add> + <hook>TAO_PROFILE_SPL_EXTERN_ADD_HOOK</hook> + <data> +typedef TAO_Profile TAO_IIOP_Profile; + </data> +</add> + +<substitute> + <search>TAO_IIOP_Profile</search> + <replace>TAO_Profile</replace> +</substitute> + + +</file> + +<!-- Transformations to Profile.cpp file specialized with the + IIOP_Profile implementation --> +<file name="Profile.cpp"> + +<!-- comment out virtual methods in the base class that do nothing + but have implementations due to compiler issues --> +<comment> + <start-hook>TAO_PROFILE_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_PROFILE_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<copy-from-source> + <source>IIOP_Profile.cpp</source> + + <copy-hook-start>TAO_PROFILE_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>TAO_PROFILE_SPL_COPY_HOOK_END</copy-hook-end> + + <dest-hook>TAO_PROFILE_SPL_METHODS_ADD_HOOK</dest-hook> +</copy-from-source> + +<!-- Add methods to the constructor of the Profile --> +<!-- Constructors are the exceptional case, we need to add + them specifically --> + +<add> + <hook>TAO_PROFILE_SPL_METHODS_ADD_HOOK</hook> + <data> +TAO_Profile::TAO_Profile (const ACE_INET_Addr &addr, + const TAO::ObjectKey &object_key, + const TAO_GIOP_Message_Version &version, + TAO_ORB_Core *orb_core) + : version_ (version) + , are_policies_parsed_ (false) + , addressing_mode_ (0) + , tagged_profile_ (0) + , ref_object_key_ (0) + , tag_ (IOP::TAG_INTERNET_IOP) + , orb_core_ (orb_core) + , forward_to_ (0) + , refcount_lock_ (0) + , refcount_ (1) + , endpoint_ (addr, + orb_core->orb_params ()->use_dotted_decimal_addresses ()) + , count_ (1) +{ + // @@ NOTE: Need to probably use a different type of lock. + this->refcount_lock_ = + this->orb_core_->client_factory ()->create_profile_lock (); + + (void) this->orb_core_->object_key_table ().bind (object_key, + this->ref_object_key_); +} + +TAO_Profile::TAO_Profile (const char* host, + CORBA::UShort port, + const TAO::ObjectKey &object_key, + const ACE_INET_Addr &addr, + const TAO_GIOP_Message_Version &version, + TAO_ORB_Core *orb_core) + : version_ (version) + , are_policies_parsed_ (false) + , addressing_mode_ (0) + , tagged_profile_ (0) + , ref_object_key_ (0) + , tag_ (IOP::TAG_INTERNET_IOP) + , orb_core_ (orb_core) + , forward_to_ (0) + , refcount_lock_ (0) + , refcount_ (1) + , endpoint_ (host, port, addr) + , count_ (1) +{ + // @@ NOTE: Need to probably use a different type of lock. + this->refcount_lock_ = + this->orb_core_->client_factory ()->create_profile_lock (); + (void) this->orb_core_->object_key_table ().bind (object_key, + this->ref_object_key_); +} + +TAO_Profile::TAO_Profile (TAO_ORB_Core *orb_core) + : version_ (TAO_GIOP_Message_Version (TAO_DEF_GIOP_MAJOR, + TAO_DEF_GIOP_MINOR)) + , are_policies_parsed_ (false) + , addressing_mode_ (0) + , tagged_profile_ (0) + , ref_object_key_ (0) + , tag_ (IOP::TAG_INTERNET_IOP) + , orb_core_ (orb_core) + , forward_to_ (0) + , refcount_lock_ (0) + , refcount_ (1) + , endpoint_ () + , count_ (1) +{ + this->refcount_lock_ = + this->orb_core_->client_factory ()->create_profile_lock (); +} +</data> +</add> + +<add> + <hook>TAO_PROFILE_SPL_DESTRUCTOR_ADD_HOOK</hook> + <data> +TAO_Endpoint *tmp = 0; +for (TAO_Endpoint *next = this->endpoint ()->next (); + next != 0; + next = tmp) +{ + tmp = next->next (); + delete next; +} + </data> +</add> + +<!-- Replace all occurances of IIOP_Profile + with TAO_Profile --> +<substitute> + <search>TAO_IIOP_Profile</search> + <replace>TAO_Profile</replace> +</substitute> + +<!-- remove the dynamic casts, as now there is no + inheritance hiearchy --> +<substitute> + <search>dynamic_cast</search> + <replace>static_cast</replace> +</substitute> + +</file> + +<file name="Invocation_Endpoint_Selectors.cpp"> + +<substitute match-line="yes"> + <search>#include "tao/IIOP_Endpoint.h"</search> + <replace>#include "tao/Endpoint.h"</replace> +</substitute> +</file> + +<file name="orbconf.h"> + +<substitute match-line="yes"> + <search>TAO_HAS_UIOP 1</search> + <replace>TAO_HAS_UIOP 0</replace> +</substitute> + +<substitute match-line="yes"> + <search>TAO_HAS_SHMIOP 1</search> + <replace>TAO_HAS_SHMIOP 0</replace> +</substitute> + +<substitute match-line="yes"> + <search>TAO_HAS_MIOP 1</search> + <replace>TAO_HAS_MIOP 0</replace> +</substitute> + +<substitute match-line="yes"> + <search>TAO_HAS_DIOP 1</search> + <replace>TAO_HAS_DIOP 0</replace> +</substitute> +</file> +</module> + +<module name="/TAO/tao/RTPortableServer"> + +<file name="RT_Servant_Dispatcher.cpp"> + +<substitute> + <search>IIOP_Transport.h</search> + <replace>Transport.h</replace> +</substitute> + +<substitute> + <search>IIOP_Connection_Handler.h</search> + <replace>Connection_Handler.h</replace> +</substitute> + +</file> + +</module> + +</transform> diff --git a/ACE/bin/FOCUS/specializations/README b/ACE/bin/FOCUS/specializations/README new file mode 100644 index 00000000000..e2126bf6566 --- /dev/null +++ b/ACE/bin/FOCUS/specializations/README @@ -0,0 +1,16 @@ +@file README +============ + +This file describes certain common conventions regarding how the +specializations rules are integrated/added to this specialization +database. This directory will serve as a repository that will host all +the specialization rules for the different families/components. At the +moment, all the specialization transformations are specific to the +ACE+TAO middleware. + +For each component framework, the following are the rules for adding +the specializations: + +. Create a directory with the name of the component family, e.g., Reactor_Family +. Within this directory, create the <<Specific_Component>>.spl file that has the + individual transformations defined. diff --git a/ACE/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_MT.spl b/ACE/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_MT.spl new file mode 100644 index 00000000000..6d4ecf6609b --- /dev/null +++ b/ACE/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_MT.spl @@ -0,0 +1,452 @@ +<?xml version="1.0"?> + +<!-- Select Reactor Specializations: + * =============================== + * Details all the specialization transformations necessary + * to specialize the Reactor framework when the target reactor + * is a select reactor. + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<!-- Define the module where there are multiple files --> +<module name="ace"> + +<!-- File where the transformations happen --> +<file name="Select_Reactor_Base.h"> + +<!-- Add the following lines based on a hook --> +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>class ACE_Sig_Handler;</data> + <data>class ACE_Sig_Action;</data> + <data>class ACE_Sig_Set;</data> +</add> + +<add> + <hook>REACTOR_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> +//--- How can we devirtualize these methods? +virtual ~ACE_Select_Reactor_Impl () {} + +virtual int notify (ACE_Event_Handler *event_handler = 0, + ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, + ACE_Time_Value * = 0) =0; + +virtual int remove_handler (ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; + +virtual int register_handler (ACE_HANDLE handle, + ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; + </data> +</add> + +<!-- Remove what ever is present in the tag from the file --> +<remove>virtual</remove> +<remove>: public ACE_Reactor_Impl</remove> +<remove>#include "ace/Reactor_Impl.h"</remove> + +<!-- Replace a with b --> +<substitute> + <search>public ACE_Reactor_Notify</search> + <replace>public ACE_Event_Handler</replace> +</substitute> + +<!-- Replace the generic versions with the Select specialized versions --> +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<!-- After the specialization, the following functions are still virtual --> +<substitute> + <search>void renew</search> + <replace>virtual void renew</replace> +</substitute> +<substitute> + <search>int is_suspended_i</search> + <replace>virtual int is_suspended_i</replace> +</substitute> +<substitute> + <search>void clear_dispatch_mask</search> + <replace>virtual void clear_dispatch_mask</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.cpp"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> + +<!-- Transformations to Reactor_Token_T.h --> +<file name="Reactor_Token_T.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "ace/Reactor_Impl.h"</search> + <replace>#include "ace/Select_Reactor_Base.h"</replace> +</substitute> + +</file> + +<file name="Reactor_Token_T.cpp"> + +<!-- Search for ACE_Reactor_Impl and replace it with + ACE_Select_Reactor_Impl --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Select_Reactor_T.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>class ACE_Sig_Handler;</data> +<data>class ACE_Sig_Action;</data> +<data>class ACE_Sig_Set;</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<remove>virtual</remove> + +</file> + +<file name="Select_Reactor_T.cpp"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>#include "ace/Countdown_Time.h"</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +</file> + +<!-- +<file name="Select_Reactor_T.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> +--> + +<file name="Reactor.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>#include "ace/Select_Reactor.h"</data> +</add> + +<remove>class ACE_Reactor_Impl;</remove> +<remove>virtual</remove> + +<substitute> +<search>ACE_Reactor_Impl</search> +<replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Remove the Reactor_Timer interface include --> +<remove>: public ACE_Reactor_Timer_Interface</remove> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + +<file name="Event_Handler.h"> + +<!-- remove the ACE_Event_Handler forware declaration --> +<remove>class ACE_Reactor_Timer_Interface;</remove> + +<!-- substitute ACE_Reactor_Timer operations with ACE_Reactor --> +<substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> +</substitute> +</file> + +<file name="Event_Handler.cpp"> + <substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> + </substitute> +</file> + +<file name="Timer_Queue_T.cpp"> + +<!-- Remove the Reactor_Timer_Interface include --> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + + +<file name="Reactor.cpp"> + +<!-- Comment the conditional includes in the file --> +<comment> + <start-hook>REACTOR_SPL_COMMENT_INCLUDE_START_HOOK</start-hook> + <end-hook>REACTOR_SPL_COMMENT_INCLUDE_END_HOOK</end-hook> +</comment> + +<!-- Comment out conditional includes files in the Reactor's + constructor +--> +<comment> + <start-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_START</start-hook> + <end-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Within the constructor now create the right Reactor --> +<add> + <hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</hook> + <data> + ACE_NEW (impl, + ACE_Select_Reactor); + </data> +</add> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<file name="Reactor.inl"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +// Check if this is necessary +#include "ace/Select_Reactor.h" + </data> +</add> + +</file> + +<!-- Do not build the other reactors than the Select Reactor! --> +<file name="ace.mpc"> + +<!-- Here is where regular expressions can come handy. Such + a capability is not currently provided + --> +<substitute> + <search>TP_Reactor.h</search> + <replace>// TP_Reactor.h </replace> +</substitute> +<substitute> + <search>TP_Reactor.cpp</search> + <replace>// TP_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Msg_WFMO_Reactor --> +<substitute> + <search>Msg_WFMO_Reactor.cpp</search> + <replace>// Msg_WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the WFMO Reactor --> +<substitute> + <search>WFMO_Reactor.cpp</search> + <replace>// WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor Impl --> +<substitute> + <search>Reactor_Impl.cpp</search> + <replace>// Reactor_Impl.cpp</replace> +</substitute> +<substitute> + <search>Reactor_Impl.h</search> + <replace>// Reactor_Impl.h</replace> +</substitute> + +<!-- Do not build the Dev Poll Reactor --> +<substitute> + <search>Dev_Poll_Reactor.cpp</search> + <replace>// Dev_Poll_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the priority Reactor --> +<substitute> + <search>Priority_Reactor.cpp</search> + <replace>// Priority_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor_Timer_Interface --> +<substitute> + <search>Reactor_Timer_Interface.h</search> + <replace>// Reactor_Timer_Interface.h</replace> +</substitute> +<substitute> + <search>Reactor_Timer_Interface.cpp</search> + <replace>// Reactor_Timer_Interface.cpp </replace> +</substitute> + +</file> + +</module> + +<!-- transformations required in TAO to work with a select reactor --> +<module name="TAO/tao"> + +<!-- Changes to default_resource.h --> +<file name="default_resource.h"> + +<!-- Remove the forward declaration of ACE_Reactor_Impl --> +<substitute match-line="yes"> +<search>class ACE_Reactor_Impl;</search> +<replace>#include "ace/Reactor.h"</replace> +</substitute> + +<!-- Replace all occurences of ACE_Reactor_Impl with + ACE_Select_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<!-- Changes to default_resource.cpp --> +<file name="default_resource.cpp"> + +<!-- Remove the occurence of TP_Reactor --> +<remove>#include "ace/TP_Reactor.h"</remove> + +<!-- Replace all occurences of ACE_Reactor_Impl with + ACE_Select_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Comment out the code that creates TP_Reactor --> +<comment> + <start-hook>TAO_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add hook to add code that creates the select reactor + component --> +<add> + <!-- We use the same hook that signifies where the comment code + ended to add the concrete Reactor type --> + <hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + TAO_REACTOR ((ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + 0, + (ACE_Select_Reactor_Notify*)0, + this->reactor_mask_signals_), + 0); + </data> +</add> +</file> + +<!-- changes to tao.mpc --> +<file name="tao.mpc"> + <substitute> + <search>GUIResource_Factory.cpp</search> + <replace>// GUIResource_Factory.cpp</replace> + </substitute> + <substitute> + <search>GUIResource_Factory.h</search> + <replace>// GUIResource_Factory.h</replace> + </substitute> +</file> + +</module> + +<module name="TAO/tao/Strategies"> + +<file name="advanced_resource.h"> + +<!-- Replace all occurances of ACE_Reactor_Impl with + Select_Reactor + --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<file name="advanced_resource.cpp"> + +<!-- Comment out all other reactor includes --> +<remove>#include "ace/FlReactor.h"</remove> +<remove>#include "ace/TkReactor.h"</remove> +<remove>#include "ace/WFMO_Reactor.h"</remove> +<remove>#include "ace/TP_Reactor.h"</remove> +<remove>#include "ace/Msg_WFMO_Reactor.h"</remove> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Replace Select_Reactor.h with Reactor.h --> +<substitute> + <search>ace/Select_Reactor.h</search> + <replace>ace/Reactor.h</replace> +</substitute> + +<!-- Comment out creation code for all other reactors --> +<comment> + <start-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Use the end hook to insert code that will create right reactor --> +<add> + <hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + TAO_REACTOR ((ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + 0, + (ACE_Select_Reactor_Notify*)0, + this->reactor_mask_signals_), + 0); + </data> +</add> + +</file> + +</module> + +</transform> diff --git a/ACE/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_ST.spl b/ACE/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_ST.spl new file mode 100644 index 00000000000..145136455a2 --- /dev/null +++ b/ACE/bin/FOCUS/specializations/Reactor_Family/Select_Reactor_ST.spl @@ -0,0 +1,468 @@ +<?xml version="1.0"?> + +<!-- Select Reactor Specializations: + * =============================== + * Details all the specialization transformations necessary + * to specialize the Reactor framework when the target reactor + * is a select reactor. + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<!-- Define the module where there are multiple files --> +<module name="ace"> + +<!-- File where the transformations happen --> +<file name="Select_Reactor_Base.h"> + +<!-- Add the following lines based on a hook --> +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>class ACE_Sig_Handler;</data> + <data>class ACE_Sig_Action;</data> + <data>class ACE_Sig_Set;</data> +</add> + +<add> + <hook>REACTOR_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> +//These methods needs to be virtual as they are used by +//Select_Reactor_Notify classes which use the base class +virtual ~ACE_Select_Reactor_Impl () {} + +virtual int notify (ACE_Event_Handler *event_handler = 0, + ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, + ACE_Time_Value * = 0) =0; + +virtual int remove_handler (ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; + +virtual int register_handler (ACE_HANDLE handle, + ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; + </data> +</add> + +<!-- Remove what ever is present in the tag from the file --> +<remove>virtual</remove> +<remove>: public ACE_Reactor_Impl</remove> +<remove>#include "ace/Reactor_Impl.h"</remove> + +<!-- Replace a with b --> +<substitute> + <search>public ACE_Reactor_Notify</search> + <replace>public ACE_Event_Handler</replace> +</substitute> + +<!-- Replace the generic versions with the Select specialized versions --> +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<!-- After the specialization, the following functions are still virtual --> +<substitute> + <search>void renew</search> + <replace>virtual void renew</replace> +</substitute> +<substitute> + <search>int is_suspended_i</search> + <replace>virtual int is_suspended_i</replace> +</substitute> +<substitute> + <search>void clear_dispatch_mask</search> + <replace>virtual void clear_dispatch_mask</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.cpp"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> + +<file name="Select_Reactor_T.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>class ACE_Sig_Handler;</data> +<data>class ACE_Sig_Action;</data> +<data>class ACE_Sig_Set;</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<remove>virtual</remove> + +</file> + +<file name="Select_Reactor_T.cpp"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>#include "ace/Countdown_Time.h"</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +</file> + +<!-- +<file name="Select_Reactor_T.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> +--> + +<!-- Transformations to Reactor_Token_T.h --> +<file name="Reactor_Token_T.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "ace/Reactor_Impl.h"</search> + <replace>#include "ace/Select_Reactor_Base.h"</replace> +</substitute> + +</file> + +<file name="Reactor_Token_T.cpp"> + +<!-- Search for ACE_Reactor_Impl and replace it with + ACE_Select_Reactor_Impl --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Reactor.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>#include "ace/Select_Reactor.h"</data> +</add> + +<remove>class ACE_Reactor_Impl;</remove> +<remove>virtual</remove> + +<substitute> +<search>ACE_Reactor_Impl</search> +<replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Remove the Reactor_Timer interface include --> +<remove>: public ACE_Reactor_Timer_Interface</remove> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + +<file name="Event_Handler.h"> + +<!-- remove the ACE_Event_Handler forware declaration --> +<remove>class ACE_Reactor_Timer_Interface;</remove> + +<!-- substitute ACE_Reactor_Timer operations with ACE_Reactor --> +<substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> +</substitute> +</file> + +<file name="Event_Handler.cpp"> + <substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> + </substitute> +</file> + +<file name="Timer_Queue_T.cpp"> + +<!-- Remove the Reactor_Timer_Interface include --> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + +<file name="Reactor.cpp"> + +<!-- Comment the conditional includes in the file --> +<comment> + <start-hook>REACTOR_SPL_COMMENT_INCLUDE_START_HOOK</start-hook> + <end-hook>REACTOR_SPL_COMMENT_INCLUDE_END_HOOK</end-hook> +</comment> + +<!-- Comment out conditional includes files in the Reactor's + constructor +--> +<comment> + <start-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_START</start-hook> + <end-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Within the constructor now create the right Reactor --> +<add> + <hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</hook> + <data> + ACE_NEW (impl, + ACE_Select_Reactor); + </data> +</add> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<file name="Reactor.inl"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +// Check if this is necessary +#include "ace/Select_Reactor.h" + </data> +</add> + +</file> + +<file name="Select_Reactor.h"> + +<!-- comment out the lock based select reactor, which is a select_mt --> +<comment> + <start-hook>TAO_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<add> + <hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + typedef ACE_Select_Reactor_T <ACE_Reactor_Token_T < ACE_Noop_Token > > ACE_Select_Reactor; + </data> +</add> +</file> + +<!-- Do not build the other reactors than the Select Reactor! --> +<file name="ace.mpc"> + +<!-- Here is where regular expressions can come handy. Such + a capability is not currently provided + --> +<substitute> + <search>TP_Reactor.h</search> + <replace>// TP_Reactor.h </replace> +</substitute> +<substitute> + <search>TP_Reactor.cpp</search> + <replace>// TP_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Msg_WFMO_Reactor --> +<substitute> + <search>Msg_WFMO_Reactor.cpp</search> + <replace>// Msg_WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the WFMO Reactor --> +<substitute> + <search>WFMO_Reactor.cpp</search> + <replace>// WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor Impl --> +<substitute> + <search>Reactor_Impl.cpp</search> + <replace>// Reactor_Impl.cpp</replace> +</substitute> +<substitute> + <search>Reactor_Impl.h</search> + <replace>// Reactor_Impl.h</replace> +</substitute> + +<!-- Do not build the Dev Poll Reactor --> +<substitute> + <search>Dev_Poll_Reactor.cpp</search> + <replace>// Dev_Poll_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the priority Reactor --> +<substitute> + <search>Priority_Reactor.cpp</search> + <replace>// Priority_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor_Timer_Interface --> +<substitute> + <search>Reactor_Timer_Interface.h</search> + <replace>// Reactor_Timer_Interface.h</replace> +</substitute> +<substitute> + <search>Reactor_Timer_Interface.cpp</search> + <replace>// Reactor_Timer_Interface.cpp </replace> +</substitute> + +</file> + +</module> + +<!-- transformations required in TAO to work with a select reactor --> +<module name="TAO/tao"> + +<!-- Changes to default_resource.h --> +<file name="default_resource.h"> + +<!-- Remove the forward declaration of ACE_Reactor_Impl --> +<substitute match-line="yes"> +<search>class ACE_Reactor_Impl;</search> +<replace>#include "ace/Reactor.h"</replace> +</substitute> + +<!-- Replace all occurences of ACE_Reactor_Impl with + ACE_Select_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<!-- Changes to default_resource.cpp --> +<file name="default_resource.cpp"> + +<!-- Remove the occurence of TP_Reactor --> +<remove>#include "ace/TP_Reactor.h"</remove> + +<!-- Replace all occurences of ACE_Reactor_Impl with + ACE_Select_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Comment out the code that creates TP_Reactor --> +<comment> + <start-hook>TAO_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add hook to add code that creates the select reactor + component --> +<add> + <!-- We use the same hook that signifies where the comment code + ended to add the concrete Reactor type --> + <hook>TAO_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + TAO_NULL_LOCK_REACTOR ((ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + 0, + (ACE_Select_Reactor_Notify*)0, + this->reactor_mask_signals_), + 0); + </data> +</add> +</file> + +<!-- changes to tao.mpc --> +<file name="tao.mpc"> + <substitute> + <search>GUIResource_Factory.cpp</search> + <replace>// GUIResource_Factory.cpp</replace> + </substitute> + <substitute> + <search>GUIResource_Factory.h</search> + <replace>// GUIResource_Factory.h</replace> + </substitute> +</file> + +</module> + +<module name="TAO/tao/Strategies"> + +<file name="advanced_resource.h"> + +<!-- Replace all occurances of ACE_Reactor_Impl with + Select_Reactor + --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +</file> + +<file name="advanced_resource.cpp"> + +<!-- Comment out all other reactor includes --> +<remove>#include "ace/FlReactor.h"</remove> +<remove>#include "ace/TkReactor.h"</remove> +<remove>#include "ace/WFMO_Reactor.h"</remove> +<remove>#include "ace/TP_Reactor.h"</remove> +<remove>#include "ace/Msg_WFMO_Reactor.h"</remove> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor</replace> +</substitute> + +<!-- Replace Select_Reactor.h with Reactor.h --> +<substitute> + <search>ace/Select_Reactor.h</search> + <replace>ace/Reactor.h</replace> +</substitute> + +<!-- Comment out creation code for all other reactors --> +<comment> + <start-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Use the end hook to insert code that will create right reactor --> +<add> + <hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + TAO_NULL_LOCK_REACTOR ((ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + 0, + (ACE_Select_Reactor_Notify*)0, + this->reactor_mask_signals_), + 0); + </data> +</add> + +</file> + +</module> + +</transform> diff --git a/ACE/bin/FOCUS/specializations/Reactor_Family/TP_Reactor.spl b/ACE/bin/FOCUS/specializations/Reactor_Family/TP_Reactor.spl new file mode 100644 index 00000000000..48b17f05e60 --- /dev/null +++ b/ACE/bin/FOCUS/specializations/Reactor_Family/TP_Reactor.spl @@ -0,0 +1,449 @@ +<?xml version="1.0"?> + +<!-- Thread Pool Reactor Specializations: + * ====================================== + * Thread Pool reactor is a variation of the Select Reactor. + * This specialization includes all of the specializations + * that are present in Select_Reactor.spl + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<module name="ace"> + +<!-- File where the transformations happen --> +<file name="Select_Reactor_Base.h"> + +<!-- Add the following lines based on a hook --> +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>class ACE_Sig_Handler;</data> + <data>class ACE_Sig_Action;</data> + <data>class ACE_Sig_Set;</data> +</add> + +<!-- Remove what ever is present in the tag from the file --> +<remove>#include "ace/Reactor_Impl.h"</remove> +<remove>virtual</remove> +<remove>: public ACE_Reactor_Impl</remove> + +<!-- Replace a with b --> +<substitute> + <search>public ACE_Reactor_Notify</search> + <replace>public ACE_Event_Handler</replace> +</substitute> + +<add> + <hook>REACTOR_SPL_PUBLIC_METHODS_ADD_HOOK</hook> + <data> +//--- How can we devirtualize these methods? +virtual ~ACE_Select_Reactor_Impl () {} + +virtual int notify (ACE_Event_Handler *event_handler = 0, + ACE_Reactor_Mask mask = ACE_Event_Handler::EXCEPT_MASK, + ACE_Time_Value * = 0) = 0; + +virtual int remove_handler (ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) = 0; + +virtual int register_handler (ACE_HANDLE handle, + ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) =0; +//-------------------------------------------- + </data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<!-- After the specialization, the following functions are still virtual --> +<substitute> + <search>void renew</search> + <replace>virtual void renew</replace> +</substitute> +<substitute> + <search>int is_suspended_i</search> + <replace>virtual int is_suspended_i</replace> +</substitute> +<substitute> + <search>void clear_dispatch_mask</search> + <replace>virtual void clear_dispatch_mask</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.cpp"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<file name="Select_Reactor_Base.inl"> + +<remove>#include "ace/Reactor.h"</remove> + +</file> + +<file name="Select_Reactor_T.h"> + +<add> +<hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> +<data>class ACE_Sig_Handler;</data> +<data>class ACE_Sig_Action;</data> +<data>class ACE_Sig_Set;</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> +</file> + +<file name="Select_Reactor_T.cpp"> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>#include "ace/Countdown_Time.h"</data> +</add> + +<substitute> + <search>ACE_Reactor_Notify</search> + <replace>ACE_Select_Reactor_Notify</replace> +</substitute> + +</file> + +<!-- Transformations to Reactor_Token_T.h --> +<file name="Reactor_Token_T.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +<substitute match-line="yes"> + <search>#include "ace/Reactor_Impl.h"</search> + <replace>#include "ace/Select_Reactor_Base.h"</replace> +</substitute> + +</file> + +<file name="Reactor_Token_T.cpp"> + +<!-- Search for ACE_Reactor_Impl and replace it with + ACE_Select_Reactor_Impl --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_Select_Reactor_Impl</replace> +</substitute> + +</file> + +<!-- Starting below is the specialization for TP_Reactor --> + +<!-- Transformations to Reactor.h --> +<file name="Reactor.h"> + +<!-- Replace all occurences of ACE_Reactor_Impl with TP_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +<!-- Remove all occurences of the word virtual --> +<remove>virtual</remove> + +<!-- Remove the Reactor_Timer interface include --> +<remove>: public ACE_Reactor_Timer_Interface</remove> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +</file> + +<file name="Event_Handler.h"> + +<!-- remove the ACE_Event_Handler forware declaration --> +<remove>class ACE_Reactor_Timer_Interface;</remove> + +<!-- substitute ACE_Reactor_Timer operations with ACE_Reactor --> +<substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> +</substitute> +</file> + +<file name="Event_Handler.cpp"> + <substitute> + <search>ACE_Reactor_Timer_Interface</search> + <replace>ACE_Reactor</replace> + </substitute> +</file> + +<file name="Timer_Queue_T.cpp"> + +<!-- Remove the Reactor_Timer_Interface include --> +<remove>#include "ace/Reactor_Timer_Interface.h"</remove> + +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data> +#include "ace/Reactor.h" + </data> +</add> + +</file> + +<file name="Reactor.cpp"> + +<!-- Replace ACE_Reactor_Impl with ACE_TP_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +<!-- Comment the conditional includes in the file --> +<comment> + <start-hook>REACTOR_SPL_COMMENT_INCLUDE_START_HOOK</start-hook> + <end-hook>REACTOR_SPL_COMMENT_INCLUDE_END_HOOK</end-hook> +</comment> + +<!-- Comment out conditional includes files in the Reactor's + constructor +--> +<comment> + <start-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_START</start-hook> + <end-hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add the TP_Reactor include file --> +<add> + <hook>REACTOR_SPL_COMMENT_INCLUDE_END_HOOK</hook> + <data>#include "ace/TP_Reactor.h"</data> +</add> + +<!-- Within the constructor now create the right Reactor --> +<add> + <hook>REACTOR_SPL_CONSTRUCTOR_COMMENT_HOOK_END</hook> + <data> + ACE_NEW (impl, + ACE_TP_Reactor); + </data> +</add> + +</file> + +<!-- Transformations to TP_Reactor.h --> +<file name="TP_Reactor.h"> + +<!-- Remove all occurances of virtual --> +<remove>virtual</remove> + +</file> + +<!-- Transformations to TP_Reactor.cpp --> +<file name="TP_Reactor.cpp"> + +<!-- Comment hook --> +<comment> + <start-hook>REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Add this function to the --> +<add> + <hook>REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> +int +ACE_TP_Reactor::register_handler (int signum, + ACE_Event_Handler *new_sh, + ACE_Sig_Action *new_disp, + ACE_Event_Handler **old_sh, + ACE_Sig_Action *old_disp) +{ + return ACE_Select_Reactor::register_handler (signum, + new_sh, + new_disp, + old_sh, + old_disp); +} + </data> +</add> + +</file> + +<!-- Transformations to Asynch_Pseudo_Task.h --> +<file name="Asynch_Pseudo_Task.h"> + +<!-- Remove the Select_Reacto.h include --> +<remove>#include "ace/Select_Reactor.h"</remove> + +<substitute> + <search>ACE_Select_Reactor</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +<!-- Add the TP_Reactor which is the concrete reactor --> +<add> + <hook>REACTOR_SPL_INCLUDE_FORWARD_DECL_ADD_HOOK</hook> + <data>#include "ace/TP_Reactor.h"</data> +</add> + +</file> + +<file name="ace.mpc"> + +<!-- Do not build the WFMO Reactor --> +<substitute> + <search>WFMO_Reactor.cpp</search> + <replace>// WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor Impl --> +<substitute> + <search>Reactor_Impl.cpp</search> + <replace>// Reactor_Impl.cpp</replace> +</substitute> +<substitute> + <search>Reactor_Impl.h</search> + <replace>// Reactor_Impl.h</replace> +</substitute> + +<!-- Do not build the Dev Poll Reactor --> +<substitute> + <search>Dev_Poll_Reactor.cpp</search> + <replace>// Dev_Poll_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Msg_WFMO_Reactor --> +<substitute> + <search>Msg_WFMO_Reactor.cpp</search> + <replace>// Msg_WFMO_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the priority Reactor --> +<substitute> + <search>Priority_Reactor.cpp</search> + <replace>// Priority_Reactor.cpp</replace> +</substitute> + +<!-- Do not build the Reactor_Timer_Interface --> +<substitute> + <search>Reactor_Timer_Interface.h</search> + <replace>// Reactor_Timer_Interface.h</replace> +</substitute> +<substitute> + <search>Reactor_Timer_Interface.cpp</search> + <replace>// Reactor_Timer_Interface.cpp </replace> +</substitute> + +</file> + +</module> +<!-- end of Changes to ace --> + +<!-- Transformations to TAO module --> +<module name="TAO/tao"> + +<file name="default_resource.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +</file> + +<file name="default_resource.cpp"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +</file> + +<file name="GUIResource_Factory.cpp"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +</file> + +<file name="GUIResource_Factory.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +</file> + +</module> + +<module name="TAO/tao/Strategies"> + +<file name="advanced_resource.h"> + +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +</file> + +<file name="advanced_resource.cpp"> + +<!-- Comment out all other reactor includes --> + +<remove>#include "ace/FlReactor.h"</remove> +<remove>#include "ace/TkReactor.h"</remove> +<remove>#include "ace/WFMO_Reactor.h"</remove> +<!-- <remove>#include "ace/Select_Reactor.h"</remove> --> +<remove>#include "ace/Msg_WFMO_Reactor.h"</remove> + +<!-- Substitute ACE_Reactor_Impl with ACE_TP_Reactor --> +<substitute> + <search>ACE_Reactor_Impl</search> + <replace>ACE_TP_Reactor</replace> +</substitute> + +<!-- Comment out creation code for all other reactors --> +<comment> + <start-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<!-- Use the end hook to insert code that will create right reactor --> +<add> + <hook>TAO_ADVANCED_RESOURCE_REACTOR_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (impl, + ACE_TP_Reactor (ACE::max_handles (), + 1, + (ACE_Sig_Handler*)0, + (ACE_Timer_Queue*)0, + this->reactor_mask_signals_, + ACE_Select_Reactor_Token::LIFO), + 0); + </data> +</add> + +</file> + +</module> + +</transform> diff --git a/ACE/bin/FOCUS/specializations/Wait_Strategy/Wait_On_Leader_Follower.spl b/ACE/bin/FOCUS/specializations/Wait_Strategy/Wait_On_Leader_Follower.spl new file mode 100644 index 00000000000..004ba08fc2d --- /dev/null +++ b/ACE/bin/FOCUS/specializations/Wait_Strategy/Wait_On_Leader_Follower.spl @@ -0,0 +1,141 @@ +<?xml version="1.0"?> + +<!-- Wait Strategy Specialization + * =============================== + * Details all the specialization transformations necessary + * to specialize the Wait_Strategy with the TAO_Wait_On_Leader_Follower strategy + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<module name="TAO/tao"> + +<file name="Wait_Strategy.cpp"> + +<!-- Copy specialized code from the Wait_On_Leader_Follower strategy + to this file --> + +<copy-from-source> + + <!-- Name of the source file from which to copy. In this case, this is + the Wait_On_Read source file --> + <source>Wait_On_Leader_Follower.cpp</source> + + <!-- Copy data between the following hooks defined in the aforementioned + file --> + <copy-hook-start>WAIT_STRATEGY_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>WAIT_STRATEGY_SPL_COPY_HOOK_END</copy-hook-end> + + <!-- Destination hook in the Wait_Strategy.h file where the code + should be placed --> + <dest-hook>TAO_WAIT_STRATEGY_SPL_ADD_HOOK</dest-hook> + +</copy-from-source> + +<!-- Copy include files to the hook to get the necessary include files --> +<add> + <hook>WAIT_STRATEGY_SPL_COPY_HOOK_START</hook> + <data> +#include "tao/Wait_On_Leader_Follower.h" +#include "tao/LF_Follower.h" +#include "tao/Leader_Follower.h" +#include "tao/Transport.h" +#include "tao/Synch_Reply_Dispatcher.h" +#include "tao/ORB_Core.h" + </data> +</add> + +<!-- Once this is done, replace all occurences of TAO_Wait_On_Leader_Follower with + TAO_Wait_Strategy --> +<substitute> + <search>TAO_Wait_On_Leader_Follower</search> + <replace>TAO_Wait_Strategy</replace> +</substitute> + +<comment> + <start-hook>LF_WAIT_STRATEGY_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>LF_WAIT_STRATEGY_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<add> + <hook>LF_WAIT_STRATEGY_SPL_SENDING_REQUEST_HOOK</hook> + <data> + return 0; + </data> +</add> + +</file> + +<file name="Wait_Strategy.h"> + +<!-- Remove all occurances of virtual --> +<remove>virtual</remove> +<remove>= 0</remove> + +</file> + +<file name="default_client.cpp"> + +<comment> + <start-hook>WAIT_STRATEGY_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>WAIT_STRATEGY_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<add> + <hook>WAIT_STRATEGY_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (ws, + TAO_Wait_Strategy (transport), + 0); + </data> +</add> + +</file> + +<file name="tao.mpc"> + +<!-- Do not build the other Wait strategy classes --> +<substitute> + <search>Wait_On_Read.h</search> + <replace>// Wait_On_Read.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_Read.cpp</search> + <replace>// Wait_On_Read.cpp</replace> +</substitute> + +<substitute> + <search>Wait_On_Reactor.h</search> + <replace>// Wait_On_Reactor.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_Reactor.cpp</search> + <replace>// Wait_On_Reactor.cpp</replace> +</substitute> + +<substitute> + <search>Wait_On_Leader_Follower.h</search> + <replace>// Wait_On_Leader_Follower.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_Leader_Follower.cpp</search> + <replace>// Wait_On_Leader_Follower.cpp</replace> +</substitute> + +<substitute> + <search>Wait_On_LF_No_Upcall.h</search> + <replace>// Wait_On_LF_No_Upcall.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_LF_No_Upcall.cpp</search> + <replace>// Wait_On_LF_No_Upcall.cpp</replace> +</substitute> + +</file> + +</module> + +</transform> diff --git a/ACE/bin/FOCUS/specializations/Wait_Strategy/Wait_On_Read.spl b/ACE/bin/FOCUS/specializations/Wait_Strategy/Wait_On_Read.spl new file mode 100644 index 00000000000..65d6ff48fe7 --- /dev/null +++ b/ACE/bin/FOCUS/specializations/Wait_Strategy/Wait_On_Read.spl @@ -0,0 +1,131 @@ +<?xml version="1.0"?> + +<!-- Wait Strategy Specialization + * =============================== + * Details all the specialization transformations necessary + * to specialize the Wait_Strategy with the Wait_On_Read strategy + * + * @author Arvind S. Krishna <arvindk@dre.vanderbilt.edu> + * $Id$ +--> + +<transform> + +<module name="TAO/tao"> + +<file name="Wait_Strategy.cpp"> + +<!-- Copy specialized code from the Wait_On_Read strategy + to this file --> + +<copy-from-source> + + <!-- Name of the source file from which to copy. In this case, this is + the Wait_On_Read source file --> + <source>Wait_On_Read.cpp</source> + + <!-- Copy data between the following hooks defined in the aforementioned + file --> + <copy-hook-start>WAIT_STRATEGY_SPL_COPY_HOOK_START</copy-hook-start> + <copy-hook-end>WAIT_STRATEGY_SPL_COPY_HOOK_END</copy-hook-end> + + <!-- Destination hook in the Wait_Strategy.h file where the code + should be placed --> + <dest-hook>TAO_WAIT_STRATEGY_SPL_ADD_HOOK</dest-hook> + +</copy-from-source> + +<!-- Copy include files to the hook to get the necessary include files --> +<add> + <hook>WAIT_STRATEGY_SPL_COPY_HOOK_START</hook> + <data> +#include "tao/Wait_On_Read.h" +#include "tao/Transport.h" +#include "tao/Resume_Handle.h" +#include "tao/Synch_Reply_Dispatcher.h" +#include "tao/Client_Strategy_Factory.h" +#include "tao/ORB_Core.h" +#include "ace/Reactor.h" +#include "ace/Countdown_Time.h" + </data> +</add> + +<!-- Once this is done, replace all occurences of TAO_Wait_On_Read with + TAO_Wait_Strategy --> +<substitute> + <search>TAO_Wait_On_Read</search> + <replace>TAO_Wait_Strategy</replace> +</substitute> + +</file> + +<file name="Wait_Strategy.h"> + +<!-- Remove all occurances of virtual --> +<remove>virtual</remove> +<remove>= 0</remove> + +</file> + +<file name="default_client.cpp"> + +<comment> + <start-hook>WAIT_STRATEGY_SPL_COMMENT_HOOK_START</start-hook> + <end-hook>WAIT_STRATEGY_SPL_COMMENT_HOOK_END</end-hook> +</comment> + +<add> + <hook>WAIT_STRATEGY_SPL_COMMENT_HOOK_END</hook> + <data> + ACE_NEW_RETURN (ws, + TAO_Wait_Strategy (transport), + 0); + </data> +</add> + +</file> + +<file name="tao.mpc"> + +<!-- Do not build the other Wait strategy classes --> +<substitute> + <search>Wait_On_Read.h</search> + <replace>// Wait_On_Read.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_Read.cpp</search> + <replace>// Wait_On_Read.cpp</replace> +</substitute> + +<substitute> + <search>Wait_On_Reactor.h</search> + <replace>// Wait_On_Reactor.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_Reactor.cpp</search> + <replace>// Wait_On_Reactor.cpp</replace> +</substitute> + +<substitute> + <search>Wait_On_Leader_Follower.h</search> + <replace>// Wait_On_Leader_Follower.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_Leader_Follower.cpp</search> + <replace>// Wait_On_Leader_Follower.cpp</replace> +</substitute> + +<substitute> + <search>Wait_On_LF_No_Upcall.h</search> + <replace>// Wait_On_LF_No_Upcall.cpp</replace> +</substitute> +<substitute> + <search>Wait_On_LF_No_Upcall.cpp</search> + <replace>// Wait_On_LF_No_Upcall.cpp</replace> +</substitute> + +</file> + +</module> + +</transform> diff --git a/ACE/bin/Hash_Map_Manager.pl b/ACE/bin/Hash_Map_Manager.pl new file mode 100755 index 00000000000..cf37f69b6a4 --- /dev/null +++ b/ACE/bin/Hash_Map_Manager.pl @@ -0,0 +1,146 @@ +eval '(exit $?0)' && eval 'exec perl -pi -S $0 ${1+"$@"}' + & eval 'exec perl -pi -S $0 $argv:q' + if 0; + +# $Id$ + +# +# This script is used by Hash_Map_Manager_Helper. +# + +# +# This script helps in fixing the template instantiations changes +# required by the new design of ACE_Hash_Map_Manager. +# +# Note that this script is not a 100% fool proof: +# +# (a) It uses commas to delimit the types in ACE_Hash_Map_Manager<X, +# Y, Z>. If X, Y, or Z are complicated types containing commas (e.g., +# T<a, b>), this script will not work. Also, all template parameters +# are assumed to be on the same line. +# +# In the case where this script will not work, here are the cookbook, +# do-it-yourself instructions: +# +# ACE_Hash_Map_Entry<X, Y> +# +# changes to: +# +# ACE_Hash_Map_Entry<X, Y> +# ACE_Hash<X> +# ACE_Equal_To<X> +# +# +# ACE_Hash_Map_Iterator_Base<X, Y, Z> +# +# changes to: +# +# ACE_Hash_Map_Iterator_Base_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z> +# +# +# ACE_Hash_Map_Manager<X, Y, Z> +# +# changes to: +# +# ACE_Hash_Map_Manager<X, Y, Z> +# ACE_Hash_Map_Manager_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z> +# +# +# ACE_Hash_Map_Iterator<X, Y, Z> +# +# changes to: +# +# ACE_Hash_Map_Iterator<X, Y, Z> +# ACE_Hash_Map_Iterator_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z> +# +# +# ACE_Hash_Map_Reverse_Iterator<X, Y, Z> +# +# changes to: +# +# ACE_Hash_Map_Reverse_Iterator<X, Y, Z> +# ACE_Hash_Map_Reverse_Iterator_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z> + + +# (b) The second problem is for g++ users (version lower than +# 2.8). g++ is broken such that if you explicitly instantiate +# templates, it will ignore template specialization. Therefore if you +# are using the template instantiation provided in ACE for ACE_Hash +# and ACE_Equal_To, don't instantiate those templates. + +# The first three lines above let this script run without specifying the +# full path to perl, as long as it is in the user's PATH. +# Taken from perlrun man page. + +$template_instantiation = "template class"; +$end_of_template_instantiation = ";"; + +$pragma_instantiation = "#pragma instantiate"; +$end_of_pragma_instantiation = ""; + +while ($line = <>) +{ + find_match ("ACE_Hash_Map_Entry"); + if ($match) + { + $template_parameters =~ /(.*),\s*(.*)/; + $X = $1; + $Y = $2; + + print "$instantiation ACE_Hash_Map_Entry<$template_parameters>$end_of_instantiation\n"; + print "$instantiation ACE_Hash<$X>$end_of_instantiation\n"; + print "$instantiation ACE_Equal_To<$X>$end_of_instantiation\n"; + next; + } + + add_ex ("ACE_Hash_Map_Manager", 1); + add_ex ("ACE_Hash_Map_Iterator", 1); + add_ex ("ACE_Hash_Map_Reverse_Iterator", 1); + add_ex ("ACE_Hash_Map_Iterator_Base", 0); + + print $line; +} + +sub find_match +{ + $key = $_[0].'\s*<\s*(.*)>\s*'; + if ($line =~ /$template_instantiation \s*$key$end_of_template_instantiation$/) + { + $match = 1; + $template_parameters = $1; + $instantiation = $template_instantiation; + $end_of_instantiation = $end_of_template_instantiation; + } + elsif ($line =~ /$pragma_instantiation \s*$key$end_of_pragma_instantiation$/) + { + $match = 1; + $template_parameters = $1; + $instantiation = $pragma_instantiation; + $end_of_instantiation = $end_of_pragma_instantiation; + } + else + { + $match = 0; + } +} + +sub add_ex +{ + $add_original_line = $_[1]; + find_match ($_[0]); + if ($match) + { + $template_parameters =~ /(.*),\s*(.*),\s*(.*)/; + $X = $1; + $Y = $2; + $Z = $3; + + if ($add_original_line) + { + print "$instantiation $_[0]<$template_parameters>$end_of_instantiation\n"; + } + + print "$instantiation $_[0]_Ex<$X, $Y, ACE_Hash<$X>, ACE_Equal_To<$X>, $Z>$end_of_instantiation\n"; + next; + } +} diff --git a/ACE/bin/Hash_Map_Manager_Helper b/ACE/bin/Hash_Map_Manager_Helper new file mode 100755 index 00000000000..f65cd584684 --- /dev/null +++ b/ACE/bin/Hash_Map_Manager_Helper @@ -0,0 +1,76 @@ +#! /bin/sh + +# +# $Id$ +# + +# +# This script uses Hash_Map_Manager.pl. +# + +# +# This script helps in fixing the template instantiations changes +# required by the new design of ACE_Hash_Map_Manager. +# +# Note that this script is not a 100% fool proof: +# +# (a) It uses commas to delimit the types in ACE_Hash_Map_Manager<X, +# Y, Z>. If X, Y, or Z are complicated types containing commas (e.g., +# T<a, b>), this script will not work. Also, all template parameters +# are assumed to be on the same line. +# +# In the case where this script will not work, here are the cookbook, +# do-it-yourself instructions: +# +# ACE_Hash_Map_Entry<X, Y> +# +# changes to: +# +# ACE_Hash_Map_Entry<X, Y> +# ACE_Hash<X> +# ACE_Equal_To<X> +# +# +# ACE_Hash_Map_Iterator_Base<X, Y, Z> +# +# changes to: +# +# ACE_Hash_Map_Iterator_Base_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z> +# +# +# ACE_Hash_Map_Manager<X, Y, Z> +# +# changes to: +# +# ACE_Hash_Map_Manager<X, Y, Z> +# ACE_Hash_Map_Manager_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z> +# +# +# ACE_Hash_Map_Iterator<X, Y, Z> +# +# changes to: +# +# ACE_Hash_Map_Iterator<X, Y, Z> +# ACE_Hash_Map_Iterator_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z> +# +# +# ACE_Hash_Map_Reverse_Iterator<X, Y, Z> +# +# changes to: +# +# ACE_Hash_Map_Reverse_Iterator<X, Y, Z> +# ACE_Hash_Map_Reverse_Iterator_Ex<X, Y, ACE_Hash<X>, ACE_Equal_To<X>, Z> + + +# (b) The second problem is for g++ users (version lower than +# 2.8). g++ is broken such that if you explicitly instantiate +# templates, it will ignore template specialization. Therefore if you +# are using the template instantiation provided in ACE for ACE_Hash +# and ACE_Equal_To, don't instantiate those templates. + +for file in `find . -type f \( -name "*.i" -o -name "*.h" -o -name "*.cpp" \) -print | xargs egrep -l "template[ \t]*class[ \t]*ACE_Hash_Map_Manager"` +do + echo Fixing template instantiations in $file + perl $ACE_ROOT/bin/Hash_Map_Manager.pl $file > $file.new + mv $file.new $file +done diff --git a/ACE/bin/LabVIEW_RT/PXI_Reset.exe b/ACE/bin/LabVIEW_RT/PXI_Reset.exe Binary files differnew file mode 100644 index 00000000000..7849adb56bd --- /dev/null +++ b/ACE/bin/LabVIEW_RT/PXI_Reset.exe diff --git a/ACE/bin/LabVIEW_RT/PXI_Reset.ini b/ACE/bin/LabVIEW_RT/PXI_Reset.ini new file mode 100755 index 00000000000..5141112e34c --- /dev/null +++ b/ACE/bin/LabVIEW_RT/PXI_Reset.ini @@ -0,0 +1,14 @@ +[PXI_Reset] +server.app.propertiesEnabled=True +server.ole.enabled=True +server.tcp.paranoid=True +server.tcp.servic="My Computer/VI Server" +server.vi.callsEnabled=True +server.vi.propertiesEnabled=True +WebServer.DirectoryIndex="index.htm" +WebServer.MimeTypes="htm;text/html;gif;image/gif;jpg;image/jpeg;png;image/png;txt;text/plain;html;text/html;jpeg;image/jpeg;css;text/css;llb;application/x-labview-llb;vi;application/x-labview-vi;doc;application/msword;dot;application/msword;bin;application/octet-stream;exe;application/octet-stream;rtf;application/rtf;pdf;application/pdf;ai;application/postscript;eps;application/postscript;ps;application/postscript;csh;application/x-csh;gtar;application/x-gtar;gz;application/x-gz;sh;application/x-sh;tar;application/x-tar;zip;application/zip;hqx;application/mac-binhex40;ua;audio/basic;wav;audio/wav;tif;image/tiff;tiff;image/tiff;xbm;image/x-xbitmap;rtx;text/richtext;qt;video/quicktime;mov;video/quicktime;avi;video/x-msvideo;movie;video/x-sgi-movie;aif;audio/aif;aifc;audio/aif;aiff;audio/aif;aim;application/x-aim;dif;video/x-dv;div;video/x-dv;js;application/x-javascript;pntg;image/x-macpaint;xlb;application/vnd.ms-excel;xls;application/vnd.ms-excel;ppa;application/vnd.ms-powerpoint;ppt;application/vnd.ms-powerpoint;pps;application/vnd.ms-powerpoint;pot;application/vnd.ms-powerpoint;pwz;application/vnd.ms-powerpoint;mid;audio/mid;midi;audio/mid;enc;video/mpeg;m1v;video/mpeg;mp2;video/mpeg;mpa;video/mpeg;mpe;video/mpeg;mpeg;video/mpeg;mpg;video/mpeg;psd;image/x-photoshop;bmp;image/bmp;pic;image/pic;ra;audio/vnd.rn-realaudio;rf;image/vnd.rf-realflash;rm;application/vnd.rn-realmedia;rp;image/vnd.rn-realpix;ram;audio/x-pn-realaudio;rmm;audio/x-pn-realaudio;rnx;application/vnd.rn-realplayer;rt;text/vnd.rn-realtext;rv;video/vnd.rn-realvideo;smi;application/smil;ssm;application/streamingmedia;sithqx;application/mac-binhex40;sit;application/x-stuffit" +WebServer.RootPath=C:\Program Files\National Instruments\LabVIEW 8.0\www +WebServer.TcpAccess="c+*" +WebServer.ViAccess="+*" +DebugServerEnabled=False +DebugServerWaitOnLaunch=False diff --git a/ACE/bin/LabVIEW_RT/README b/ACE/bin/LabVIEW_RT/README new file mode 100644 index 00000000000..f79c607704e --- /dev/null +++ b/ACE/bin/LabVIEW_RT/README @@ -0,0 +1,57 @@ +# $Id$ + +This directory contains utilities for running the ACE+TAO test suite on +a LabVIEW RT 8 / Phar Lap ETS target. Although it's running Phar Lap ETS, +and thus would normally be able to run programs, this environment is +different than plain Phar Lap ETS in that the LabVIEW RT layer takes up +the only process able to run on Phar Lap. Thus, everything executed needs +to be done via LabVIEW RT facilities. Thus, we have the following +restrictions: + +1. There's no NFS, no SMB; there's a target filesystem but no direct access. +2. No executables can be directly executed. + +This yields the following: + +- All test "programs" are built as DLLs instead of executables. The DLL has + a known "main" entrypoint. To run the test, the DLL must be copied down + to the target, explicitly loaded, and its entrypoint called. MPC will + automatically build these DLLs when an executable is specified in the MPC + file by basing the MPC project on the labviewrt_dll.mpb base. This is done + by supplying "-base labviewrt_dll" on the MPC command line. + +- There is a test-controlling DLL that lives on the LabVIEW RT target, and is + loaded when the target boots. This DLL spawns a thread that listens on a + TCP port for connections; it runs a text-based protocol by which it can + be directed to load and run test DLLs and report results. This DLL is in + the labview_test_controller subdirectory; see its ReadMe.txt file for + more details. + +- The Perl test framework in PerlACE has a ProcessLVRT.pm and + TestTarget_LVRT.pm that know how to run the test protocol, get the log file + back from the target, etc. in order to integrate the LabVIEW RT scheme into + the ACE+TAO testing framework. + +- If a test encounters any significant errors that would produce something akin + to a crash or significant leak on a multi-process OS, it will probably + render the LabVIEW RT target unuseable and unresponsive. There are two + utilities in this directory that will help in this sort of situation: + + 1. Reboot_Target.exe: A Windows executable that runs a LabVIEW VI to + reboot a local target box. If the box is alive enough to be contacted + and run the LabVIEW VI that triggers the reboot, this works fine. + However, if the box is unresponsive, as it usually is, this doesn't + work. The advantage of this utility is that it doesn't require any + additional hardware or software. + + 2. PXI_Reset.exe: A Windows executable that runs a LabVIEW VI to + trigger a hardware reset on the target box. This utility works all + the time since it does a hardware reset. However, it requires an + additional piece of hardware that connects to the host PC via USB + and connects to the DB9 on the back of the PXI target. This little + hardware box was custom-made by Lockheed Martin, so you can't just + go buy one at Radio Shack. + + If neither of these utilities is workable for you, you can probably use a + programmable power strip that can cycle the power on the target, and write + a utility that drives it. diff --git a/ACE/bin/LabVIEW_RT/Reboot_Target.exe b/ACE/bin/LabVIEW_RT/Reboot_Target.exe Binary files differnew file mode 100644 index 00000000000..c2054f79866 --- /dev/null +++ b/ACE/bin/LabVIEW_RT/Reboot_Target.exe diff --git a/ACE/bin/LabVIEW_RT/Reboot_Target.ini b/ACE/bin/LabVIEW_RT/Reboot_Target.ini new file mode 100755 index 00000000000..9010340ee2b --- /dev/null +++ b/ACE/bin/LabVIEW_RT/Reboot_Target.ini @@ -0,0 +1,14 @@ +[Reboot_Target] +server.app.propertiesEnabled=True +server.ole.enabled=True +server.tcp.paranoid=True +server.tcp.servic="My Computer/VI Server" +server.vi.callsEnabled=True +server.vi.propertiesEnabled=True +WebServer.DirectoryIndex="index.htm" +WebServer.MimeTypes="htm;text/html;gif;image/gif;jpg;image/jpeg;png;image/png;txt;text/plain;html;text/html;jpeg;image/jpeg;css;text/css;llb;application/x-labview-llb;vi;application/x-labview-vi;doc;application/msword;dot;application/msword;bin;application/octet-stream;exe;application/octet-stream;rtf;application/rtf;pdf;application/pdf;ai;application/postscript;eps;application/postscript;ps;application/postscript;csh;application/x-csh;gtar;application/x-gtar;gz;application/x-gz;sh;application/x-sh;tar;application/x-tar;zip;application/zip;hqx;application/mac-binhex40;ua;audio/basic;wav;audio/wav;tif;image/tiff;tiff;image/tiff;xbm;image/x-xbitmap;rtx;text/richtext;qt;video/quicktime;mov;video/quicktime;avi;video/x-msvideo;movie;video/x-sgi-movie;aif;audio/aif;aifc;audio/aif;aiff;audio/aif;aim;application/x-aim;dif;video/x-dv;div;video/x-dv;js;application/x-javascript;pntg;image/x-macpaint;xlb;application/vnd.ms-excel;xls;application/vnd.ms-excel;ppa;application/vnd.ms-powerpoint;ppt;application/vnd.ms-powerpoint;pps;application/vnd.ms-powerpoint;pot;application/vnd.ms-powerpoint;pwz;application/vnd.ms-powerpoint;mid;audio/mid;midi;audio/mid;enc;video/mpeg;m1v;video/mpeg;mp2;video/mpeg;mpa;video/mpeg;mpe;video/mpeg;mpeg;video/mpeg;mpg;video/mpeg;psd;image/x-photoshop;bmp;image/bmp;pic;image/pic;ra;audio/vnd.rn-realaudio;rf;image/vnd.rf-realflash;rm;application/vnd.rn-realmedia;rp;image/vnd.rn-realpix;ram;audio/x-pn-realaudio;rmm;audio/x-pn-realaudio;rnx;application/vnd.rn-realplayer;rt;text/vnd.rn-realtext;rv;video/vnd.rn-realvideo;smi;application/smil;ssm;application/streamingmedia;sithqx;application/mac-binhex40;sit;application/x-stuffit" +WebServer.RootPath=C:\Program Files\National Instruments\LabVIEW 8.2\www +WebServer.TcpAccess="c+*" +WebServer.ViAccess="+*" +DebugServerEnabled=False +DebugServerWaitOnLaunch=False diff --git a/ACE/bin/LabVIEW_RT/labview_test_controller/ReadMe.txt b/ACE/bin/LabVIEW_RT/labview_test_controller/ReadMe.txt new file mode 100644 index 00000000000..c2362a229e6 --- /dev/null +++ b/ACE/bin/LabVIEW_RT/labview_test_controller/ReadMe.txt @@ -0,0 +1,77 @@ +======================================================================== + DYNAMIC LINK LIBRARY : labview_test_controller Project Overview +======================================================================== + +The labview_test_controller DLL is needed to control execution and reporting +for ACE+TAO tests on a LabVIEW RT/Pharlap ETS target. The LabVIEW RT +environment can not execute programs - LabVIEW RT itself is the one program +that runs on the Pharlap ETS base, so no other processes can be started. +This DLL is built on the host VC7.1 Windows machine and copied to the +target. The target's \ni-rt.ini file must have the full path of the +labview_test_controller.dll on the target added to the [STARTUP] section, +EarlyStartupLibraries key. If there are already entries in that key, +append labview_test_controller.dll's path with a semi-colon separator. +For example, this is what mine ended up as: +[STARTUP] +EarlyStartupLibraries=C:\ni-rt\system\lvuste.dll;C:\ni-rt\system\tsengine.dll;C:\ni-rt\system\nisl_emb.dll;C:\ni-rt\labview_test_controller.dll; +MainExe=/ni-rt/system/emblview.exe + +After setting up the ni-rt.ini file and the DLL, reboot the target to +load the controller DLL. + +Keep in mind that the current working directory while tests are running will +be, at least on mine, \ni-rt\system. The test logs end up in \ni-rt\system\log. + +The labview_test_controller spawns a thread when the DLL is loaded at +system start. The child thread starts listening on TCP port 8888. For each +new connection to port 8888 a new thread is spawned to run the session. +The test host issues text commands to the controller via this TCP connection. +The responses are text as well. Thus, it's possible to test it using plain +telnet. There's also a "test" project in this VC7.1 solution. The test +project is a simple console app that calls the main thread's entrypoint +in labview_test_controller, facilitating its testing on the host Windows +machine where there's decent debugging capability. Debugging on the LabVIEW +target is by printf only. + +The client side of the TCP connection that drives this test controller is +in the ACE_wrappers/bin/PerlACE/ProcessLVRT.pm. The TestTarget_LVRT.pm is +also involved in testing on the LabVIEW RT target. + +The remainder of this is what Visual Studio .NET generated for this project. +======================================================================== +AppWizard has created this labview_test_controller DLL for you. +This file contains a summary of what you will find in each of the files that +make up your labview_test_controller application. + + +labview_test_controller.vcproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +labview_test_controller.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named labview_test_controller.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/ACE/bin/LabVIEW_RT/labview_test_controller/labview_test_controller.cpp b/ACE/bin/LabVIEW_RT/labview_test_controller/labview_test_controller.cpp new file mode 100644 index 00000000000..728c847121c --- /dev/null +++ b/ACE/bin/LabVIEW_RT/labview_test_controller/labview_test_controller.cpp @@ -0,0 +1,599 @@ +// $Id$ +// +// Defines the entry point for the LabVIEW RT test controller DLL application. +// This DLL is loaded at system boot by LabVIEW RT. The controller waits for +// TCP connections from the ACE+TAO test scripts. The test scripts will direct +// operation of the tests via commands sent over TCP. In order to be ready for +// connections without intervention via VI, the initial load will spawn a +// thread that sets up the listening socket. + +#include "stdafx.h" +#include <errno.h> +#include <fcntl.h> +#include <io.h> +#include <memory.h> +#include <process.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/types.h> +#include <sys/stat.h> + +#include <Winsock2.h> + +// NULL is the documented way to check DLL handles, and this is plain +// Windows code, not ACE, so we stick to the Microsoft way... +// FUZZ: disable check_for_NULL + +// This is plain Windows code, not ACE. Therefore we disable +// the check for ACE_OS +// FUZZ: disable check_for_lack_ACE_OS + +// TEST_FUNC is the prototype for the called test's main entrypoint. It's +// the normal C main. +typedef int (*TEST_FUNC) (int argc, char *argv[]); + +// Thread entrypoints +static unsigned int __stdcall test_control (void *param); +static unsigned int __stdcall peer_svc (void *peer_p); +static unsigned int __stdcall run_test (void *test_p); + +static const char *format_errmsg (unsigned int errcode, const char *prefix); + +// Logging information +static const char *LogName = "acetao.log"; +static HANDLE logf = INVALID_HANDLE_VALUE; + +BOOL APIENTRY DllMain( HANDLE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + if (ul_reason_for_call == DLL_PROCESS_ATTACH) + { + return (0 != _beginthreadex (0, // security + 8 * 1024, // stack size + test_control, // entrypoint + 0, // param + 0, // creation flags + 0)); // ptr to thread id + } + + return TRUE; +} + +class Test +{ +public: + Test () : dll_handle_ (NULL), + thr_handle_ (0), + entry_ (0), + running_ (false), + status_ (-1) + {} + ~Test (); + + HANDLE handle (void) { return this->thr_handle_; } + int run (void); + const char *start (const char *name); + bool status (int *exit_status); + int wait (void); + void kill (void); + + // Clean up remnants of a test run. + void cleanup (void); + +private: + HMODULE dll_handle_; + HANDLE thr_handle_; + TEST_FUNC entry_; + bool running_; + int status_; + enum { CMDLINE_LEN = 1024, ARGV_SIZE = 100 }; + char name_[CMDLINE_LEN]; + char cmdline_[CMDLINE_LEN]; + int argc_; + char *argv_[ARGV_SIZE]; +}; + +class Peer +{ +public: + Peer (SOCKET h) : handle_ (h) {} + + // Run the Peer's session; intended to be called from a new thread devoted + // to this peer's session. + int svc (void); + +private: + Peer () {}; + + // Process command input from socket. + int command (void); + + // Send a reply string to the peer. + int reply (const char *msg); + + SOCKET handle_; + Test test_; +}; + +// Run a peer session; assume there's a thread for each session, so this +// object has all it needs for context located in 'this' object, and it can +// block at any point as long as one remembers that there is one or more +// test threads running and some attention must be paid to the encapsulated +// socket handle over which this object receives control commands from the +// host test driver. +int +Peer::svc (void) +{ + // Read commands until EOF (peer closed) or protocol error + while (0 == this->command ()) + ; + closesocket (this->handle_); + this->handle_ = INVALID_SOCKET; + return 0; +} + +int +Peer::command (void) +{ + // The protocol exchanges with the peer are execpted to be lock-step + // request-reply command lines, so we can make assumptions about a complete + // line being available to make life easier. + const int MAX_RECV = 1024; + char line[MAX_RECV], *p; + p = &line[0]; + int count = 0, len = 0; + while ((count = recv (this->handle_, p, MAX_RECV - len, 0)) > 0) + { + p[count] = '\0'; + len += count; + p += count; + char *nl; + if ((nl = strchr (line, '\n')) == 0) + continue; + + // At this point we have a 0-terminated string with a newline ending + // the command line. Break out and process the command. + break; + } + if (count <= 0) + return -1; // Relay closed/error socket to caller + + char *cmd = strtok (line, "\t \n\r"); + if (cmd == 0) + { + char err[1024]; + sprintf (err, "Can't parse input: %s\n", line); + this->reply (err); + return -1; + } + // Which command is it? These commands are known: + // + // run <test-dll> [args] + // Run test in the named test-dll; respond with "OK" or an error string. + // status + // If test still running return "RUNNING" else return exit status. + // wait + // Wait for test to exit; return "OK" + // kill + // Kill the thread with the most recent test; return "OK". + // snaplog + // Take a snapshot of the current stdout/stderr log to a new file + // name and reset the stdout/stderr log. + if (strcmp ("run", cmd) == 0) + { + char *test = strtok (0, "\t \n\r"); + if (test == 0) + { + this->reply ("Malformed run command\n"); + return -1; + } + // start() pulls apart the rest of the command line... + const char *errmsg = this->test_.start (test); + if (errmsg == 0) + this->reply ("OK\n"); + else + this->reply (errmsg); + } + else if (strcmp ("status", cmd) == 0) + { + int status; + if (this->test_.status (&status)) + { + char retvalmsg[64]; + sprintf (retvalmsg, "%d\n", status); + this->reply (retvalmsg); + } + else + this->reply ("RUNNING\n"); + } + else if (strcmp ("wait", cmd) == 0) + { + int status = this->test_.wait (); + char retvalmsg[64]; + sprintf (retvalmsg, "%d\n", status); + this->reply (retvalmsg); + } + else if (strcmp ("kill", cmd) == 0) + { + // Killing things is bad... say we can't and the host should reboot us. + this->reply ("NO - please reboot me\n"); + } + else if (strcmp ("waitforfile", cmd) == 0) + { + char *name = strtok (0, "\t \n\r"); + if (name == 0) + { + this->reply ("Malformed waitforfile command\n"); + return -1; + } + char *secs_s = strtok (0, "\t \n\r"); + int secs = 0; + if (secs_s == 0 || (secs = atoi (secs_s)) <= 0) + { + this->reply ("Malformed waitforfile command\n"); + return -1; + } + struct _stat info; + const char *msg = 0; + bool found = false; + while (secs > 0) + { + if (_stat (name, &info) == -1) // No file yet + { + if (errno != ENOENT) + { + // Something more serious than no file yet; bail out. + msg = format_errmsg (errno, name); + break; + } + } + else + { + if (info.st_size > 0) + { + found = true; + break; + } + } + // Either no file yet, or it's there but with no content yet. + Sleep (1 * 1000); // arg is in msec + --secs; + } + if (found) + this->reply ("OK\n"); + else if (secs == 0) + this->reply ("TIMEOUT\n"); + else + this->reply (msg); + } + else if (strcmp ("snaplog", cmd) == 0) + { + if (logf == INVALID_HANDLE_VALUE) + { + this->reply ("NONE\n"); + } + else + { + CloseHandle (logf); + if (0 == rename (LogName, "snapshot.txt")) + { + char abspath[1024]; + if (_fullpath (abspath, "snapshot.txt", 1024)) + { + strcat (abspath, "\n"); + this->reply (abspath); + } + else + { + // Last ditch effort to get a name back to the client + this->reply ("\\ni-rt\\system\\snapshot.txt\n"); + } + } + else + { + this->reply ("NONE\n"); + } + // Reset stdout/stderr to a new file + logf = CreateFile (LogName, + FILE_ALL_ACCESS, + FILE_SHARE_READ, + 0, // security + CREATE_ALWAYS, + FILE_ATTRIBUTE_NORMAL, + 0); + SetStdHandle (STD_OUTPUT_HANDLE, logf); + SetStdHandle (STD_ERROR_HANDLE, logf); + } + } + else + { + this->reply ("Unrecognized command\n"); + return -1; + } + return 0; +} + +int +Peer::reply (const char *msg) +{ + int len = (int)strlen (msg); // size_t -> int + return send (this->handle_, msg, len, 0) > 0 ? 0 : -1; +} + +Test::~Test () +{ + this->cleanup (); +} + +int +Test::run (void) +{ + this->running_ = true; + this->status_ = (this->entry_) (this->argc_, this->argv_); + this->running_ = false; + // It's possible to cleanup() here; however, that would introduce a race + // with start() following beginthreadex(). So do all the cleanup on user + // action - either getting status, waiting, killing, or running another + // test. Or, terminating the connection. + return 0; +} + +const char * +Test::start (const char *name) +{ + if (this->running_) + return "Already running\n"; + + const char *msg = 0; + + // Reset test status to not inadvertantly report a previous test. + this->status_ = -1; + this->cleanup (); // Resets cmdline_, argc_, argv_ + + // The command line is part-way through being tokenized by strtok(). It + // left off after the program name. Anything remaining are the command + // line arguments for the program. Pick off whatever is there, copy it + // to the cmdline_ array and fill in argc_/argv_ for the eventual run. + strcpy (this->name_, name); + this->argv_[0] = this->name_; + this->argc_ = 1; + size_t cmdchars = 0; + for (char *token = strtok (0, "\t \n\r"); + token != 0 && (cmdchars + strlen (token) + 1) < CMDLINE_LEN; + token = strtok (0, "\t \n\r")) + { + // We have a new token and it will fit in cmdline_. Copy it to the + // next spot in cmdline_, add it to argv_/argc_ then update cmdchars + // to account for the copied-in token and its nul terminator. + strcpy (&this->cmdline_[cmdchars], token); + this->argv_[this->argc_] = &this->cmdline_[cmdchars]; + ++this->argc_; + cmdchars += (strlen (token) + 1); + } + char libspec[1024]; + sprintf (libspec, "%s.dll", name); + if ((this->dll_handle_ = LoadLibrary (libspec)) == NULL) + return format_errmsg (GetLastError (), libspec); + + this->entry_ = (TEST_FUNC) GetProcAddress (this->dll_handle_, "main"); + if (this->entry_ == NULL) + { + msg = format_errmsg (GetLastError (), "main"); + this->cleanup (); + return msg; + } + else + { + unsigned int thread_id; /* unused */ + uintptr_t h = _beginthreadex (0, // security + 1024 * 1024, // stack size + run_test, // entrypoint + (void *)this, // arglist + 0, // initflag + &thread_id); // thread ID + this->thr_handle_ = (HANDLE) h; + if (h == 0) // Test thread may have access to thr_handle_ + { + msg = format_errmsg (GetLastError (), "spawn"); + this->cleanup (); + return msg; + } + } + return 0; +} + +bool +Test::status (int *exit_status) +{ + if (this->running_) + return false; // still running + + *exit_status = this->status_; + this->cleanup (); + return true; +} + +int +Test::wait (void) +{ + WaitForSingleObject (this->thr_handle_, INFINITE); + if (!this->running_) + this->cleanup (); + return this->status_; +} + +void +Test::kill (void) +{ + TerminateThread (this->thr_handle_, -1); + this->cleanup (); + this->running_ = false; + this->status_ = -1; +} + +// Clean up remnants of a test run. +void +Test::cleanup (void) +{ + if (this->dll_handle_ != NULL) + { + FreeLibrary (this->dll_handle_); + this->dll_handle_ = NULL; + } + if (this->thr_handle_ != 0) + { + CloseHandle (this->thr_handle_); + this->thr_handle_ = 0; + } + this->entry_ = 0; + this->argc_ = 0; + for (int i = 0; i < ARGV_SIZE; ++i) + this->argv_[i] = 0; + memset (this->cmdline_, 0, CMDLINE_LEN); +} + +static unsigned int __stdcall +test_control (void * /* param */) +{ + // cd to ace dir?? (can this be an env variable?) + + // redirect stdout/stderr to a file + logf = CreateFile (LogName, + FILE_ALL_ACCESS, + FILE_SHARE_READ, + 0, // security + OPEN_ALWAYS, // Don't crush a previous one + FILE_ATTRIBUTE_NORMAL, + 0); + if (logf == INVALID_HANDLE_VALUE) + perror (LogName); + else + { + SetFilePointer (logf, 0, 0, FILE_END); // Append new content + SetStdHandle (STD_OUTPUT_HANDLE, logf); + SetStdHandle (STD_ERROR_HANDLE, logf); + } + + WORD want; + WSADATA offer; + want = MAKEWORD (2, 2); + if (0 != WSAStartup (want, &offer)) + { + perror ("WSAStartup"); + CloseHandle (logf); + return WSAGetLastError (); + } + + // listen on port 8888 (can I set an env variable for this?) + SOCKET acceptor = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); + sockaddr_in listen_addr; + memset (&listen_addr, 0, sizeof (listen_addr)); + listen_addr.sin_family = AF_INET; + listen_addr.sin_addr.s_addr = INADDR_ANY; + listen_addr.sin_port = htons (8888); + if (SOCKET_ERROR == bind (acceptor, + (struct sockaddr *)&listen_addr, + sizeof (listen_addr))) + { + perror ("bind"); + } + else + { + listen (acceptor, 10); + SOCKET peer; + while ((peer = accept (acceptor, 0, 0)) != INVALID_SOCKET) + { + Peer *p = new Peer (peer); + if (p == 0) + { + perror ("Out of memory"); + closesocket (peer); + peer = INVALID_SOCKET; + continue; + } + if (0 == _beginthreadex (0, // security + 64 * 1024, // stack size + peer_svc, // entrypoint + (void *)p, // param + 0, // creation flags + 0)) // ptr to thread id + { + perror ("beginthreadex peer"); + closesocket (peer); + delete p; + } + p = 0; + peer = INVALID_SOCKET; + } + perror ("accept"); + } + + closesocket (acceptor); + WSACleanup (); + return 0; +} + +// Entrypoint for thread that's spawned to run a peer's session. Direct +// control to the peer class. +static unsigned int __stdcall +peer_svc (void *peer_p) +{ + Peer *p = (Peer *)peer_p; + DWORD status = p->svc (); + delete p; + return status; +} + +// Entrypoint for the thread spawned to run a test. The thread arg is the +// Test * - call back to the test's run() method; return the test exit code +// as the thread's return value. +static unsigned int __stdcall +run_test (void *test_p) +{ + Test *t = (Test *)test_p; + return t->run (); +} + +// Format a Windows system or Winsock error message given an error code. +static const char * +format_errmsg (unsigned int errcode, const char *prefix) +{ + static const size_t errmsgsize = 1024; + static char errmsg[errmsgsize]; + + sprintf (errmsg, "%s: ", prefix); + size_t len = strlen (errmsg); + char *next = &errmsg[len]; + size_t max_fmt = errmsgsize - len; + if (0 != FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + 0, + errcode, + 0, // Use default language + next, + (DWORD)max_fmt, + 0)) + { + strcat (errmsg, "\n"); + return errmsg; + } + + errno = errcode; + char *msg = _strerror (prefix); + sprintf (errmsg, "err %d: %s", errcode, msg); + return errmsg; +} + +#ifdef TEST_RUNNER_EXPORTS +#define TEST_RUNNER_API __declspec(dllexport) +#else +#define TEST_RUNNER_API __declspec(dllimport) +#endif + +__declspec(dllexport) int test_entry(void) +{ + return 0; +} diff --git a/ACE/bin/LabVIEW_RT/labview_test_controller/labview_test_controller.sln b/ACE/bin/LabVIEW_RT/labview_test_controller/labview_test_controller.sln new file mode 100644 index 00000000000..877fb7e68f2 --- /dev/null +++ b/ACE/bin/LabVIEW_RT/labview_test_controller/labview_test_controller.sln @@ -0,0 +1,32 @@ +Microsoft Visual Studio Solution File, Format Version 8.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "labview_test_controller", "labview_test_controller.vcproj", "{646E6863-F3BE-403A-8B53-20C02664907B}"
+ ProjectSection(ProjectDependencies) = postProject
+ EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test.vcproj", "{01781FA2-36A3-49DA-A00C-2DEAE6A286FF}"
+ ProjectSection(ProjectDependencies) = postProject
+ {646E6863-F3BE-403A-8B53-20C02664907B} = {646E6863-F3BE-403A-8B53-20C02664907B}
+ EndProjectSection
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ Debug = Debug
+ Release = Release
+ EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {646E6863-F3BE-403A-8B53-20C02664907B}.Debug.ActiveCfg = Debug|Win32
+ {646E6863-F3BE-403A-8B53-20C02664907B}.Debug.Build.0 = Debug|Win32
+ {646E6863-F3BE-403A-8B53-20C02664907B}.Release.ActiveCfg = Release|Win32
+ {646E6863-F3BE-403A-8B53-20C02664907B}.Release.Build.0 = Release|Win32
+ {01781FA2-36A3-49DA-A00C-2DEAE6A286FF}.Debug.ActiveCfg = Debug|Win32
+ {01781FA2-36A3-49DA-A00C-2DEAE6A286FF}.Debug.Build.0 = Debug|Win32
+ {01781FA2-36A3-49DA-A00C-2DEAE6A286FF}.Release.ActiveCfg = Release|Win32
+ {01781FA2-36A3-49DA-A00C-2DEAE6A286FF}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/ACE/bin/LabVIEW_RT/labview_test_controller/labview_test_controller.vcproj b/ACE/bin/LabVIEW_RT/labview_test_controller/labview_test_controller.vcproj new file mode 100644 index 00000000000..2974e566a4c --- /dev/null +++ b/ACE/bin/LabVIEW_RT/labview_test_controller/labview_test_controller.vcproj @@ -0,0 +1,158 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="labview_test_controller"
+ ProjectGUID="{646E6863-F3BE-403A-8B53-20C02664907B}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;LABVIEW_TEST_CONTROLLER_EXPORTS"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ UsePrecompiledHeader="3"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ IgnoreImportLibrary="TRUE"
+ AdditionalDependencies="wsock32.lib"
+ OutputFile="$(OutDir)/labview_test_controller.dll"
+ LinkIncremental="2"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/labview_test_controller.pdb"
+ SubSystem="2"
+ ImportLibrary="$(OutDir)/labview_test_controller.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="2"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;LABVIEW_TEST_CONTROLLER_EXPORTS"
+ RuntimeLibrary="0"
+ UsePrecompiledHeader="3"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="wsock32.lib"
+ OutputFile="$(OutDir)/labview_test_controller.dll"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="2"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ ImportLibrary="$(OutDir)/labview_test_controller.lib"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath=".\labview_test_controller.cpp">
+ </File>
+ <File
+ RelativePath=".\stdafx.cpp">
+ <FileConfiguration
+ Name="Debug|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"/>
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Release|Win32">
+ <Tool
+ Name="VCCLCompilerTool"
+ UsePrecompiledHeader="1"/>
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ <File
+ RelativePath=".\stdafx.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ <File
+ RelativePath=".\ReadMe.txt">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ACE/bin/LabVIEW_RT/labview_test_controller/stdafx.cpp b/ACE/bin/LabVIEW_RT/labview_test_controller/stdafx.cpp new file mode 100644 index 00000000000..2c613e15662 --- /dev/null +++ b/ACE/bin/LabVIEW_RT/labview_test_controller/stdafx.cpp @@ -0,0 +1,9 @@ +// $Id$ +// stdafx.cpp : source file that includes just the standard includes +// labview_test_controller.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/ACE/bin/LabVIEW_RT/labview_test_controller/stdafx.h b/ACE/bin/LabVIEW_RT/labview_test_controller/stdafx.h new file mode 100644 index 00000000000..8b9e996b7c0 --- /dev/null +++ b/ACE/bin/LabVIEW_RT/labview_test_controller/stdafx.h @@ -0,0 +1,14 @@ +// $Id$ +// stdafx.h : include file for standard system include files, or +// project specific include files that are used frequently, but are +// changed infrequently +// + +#pragma once + + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include <windows.h> + +// TODO: reference additional headers your program requires here diff --git a/ACE/bin/LabVIEW_RT/labview_test_controller/test.cpp b/ACE/bin/LabVIEW_RT/labview_test_controller/test.cpp new file mode 100644 index 00000000000..4c2a2589fb4 --- /dev/null +++ b/ACE/bin/LabVIEW_RT/labview_test_controller/test.cpp @@ -0,0 +1,17 @@ +// $Id$ + +#include <stdio.h> +__declspec(dllimport) int test_entry(void); + +// This is plain Windows code, not ACE. Therefore we disable +// the check for ACE_OS +// FUZZ: disable check_for_lack_ACE_OS + +int main (int, char *[]) +{ + char line[80]; + test_entry(); + puts ("Ok, go... hit return to stop."); + gets (line); + return 0; +} diff --git a/ACE/bin/LabVIEW_RT/labview_test_controller/test.vcproj b/ACE/bin/LabVIEW_RT/labview_test_controller/test.vcproj new file mode 100644 index 00000000000..85a01d4d638 --- /dev/null +++ b/ACE/bin/LabVIEW_RT/labview_test_controller/test.vcproj @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.10"
+ Name="test"
+ ProjectGUID="{01781FA2-36A3-49DA-A00C-2DEAE6A286FF}"
+ Keyword="Win32Proj">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory="Debug"
+ IntermediateDirectory="Debug"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
+ MinimalRebuild="TRUE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="5"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="4"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="labview_test_controller.lib"
+ OutputFile="$(OutDir)/test.exe"
+ LinkIncremental="2"
+ AdditionalLibraryDirectories="$(OutDir)"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile="$(OutDir)/test.pdb"
+ SubSystem="1"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory="Release"
+ IntermediateDirectory="Release"
+ ConfigurationType="1"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
+ RuntimeLibrary="4"
+ UsePrecompiledHeader="0"
+ WarningLevel="3"
+ Detect64BitPortabilityProblems="TRUE"
+ DebugInformationFormat="3"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ OutputFile="$(OutDir)/test.exe"
+ LinkIncremental="1"
+ GenerateDebugInformation="TRUE"
+ SubSystem="1"
+ OptimizeReferences="2"
+ EnableCOMDATFolding="2"
+ TargetMachine="1"/>
+ <Tool
+ Name="VCMIDLTool"/>
+ <Tool
+ Name="VCPostBuildEventTool"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCXMLDataGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ <Tool
+ Name="VCManagedWrapperGeneratorTool"/>
+ <Tool
+ Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
+ UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
+ <File
+ RelativePath=".\test.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl;inc;xsd"
+ UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
+ UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/ACE/bin/MakeProjectCreator/README b/ACE/bin/MakeProjectCreator/README new file mode 100644 index 00000000000..697fee1691c --- /dev/null +++ b/ACE/bin/MakeProjectCreator/README @@ -0,0 +1,37 @@ +This directory contains ACE- and TAO-specific extensions of MPC. All +the base projects in the config directory are ACE- and TAO-specific, +along with the perl modules for the gnuace and borland types and the +templates that go along with those implementations. + +GNUACE-specific aspects of project keywords +------------------------------------------- + +requires Specifies which features should be enabled in order to + generate the project file. Under the GNUACE type, it also + specifies which tao macros should be set to build the + target. + +avoids Specifies which features should be disabled in order to + generate the project file. Under the GNUACE type, it also + specifies which tao macros should not be set to build the + target. + +The following keywords are GNUACE only: + +tagname Specifies the make macro to check before building the target +tagchecks Specifies the values for tagname to check + +NOTE: Within the GNUACE project type, setting sharedname to empty and +setting staticname to the static library name will result in a project +that will generate only static libraries. + +The default generation mode for the GNUACE project type is named targets. +The environment variable MPC_GNUACE_DIRECTORY_DEPS can be set to get the +directory based build that was used up until April of 2006. + +For more information about MPC, see the README and USAGE files in the +MPC docs directory. + +You can anonymously check-out MPC using Subversion: + +svn co svn://svn.dre.vanderbilt.edu/DOC/MPC/trunk MPC diff --git a/ACE/bin/MakeProjectCreator/config/MPC.cfg b/ACE/bin/MakeProjectCreator/config/MPC.cfg new file mode 100644 index 00000000000..f155b2b5ba5 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/MPC.cfg @@ -0,0 +1,2 @@ +includes = $TAO_ROOT/MPC/config, $CIAO_ROOT/MPC/config, $DDS_ROOT/MPC/config +dynamic_types = $ACE_ROOT/bin/MakeProjectCreator diff --git a/ACE/bin/MakeProjectCreator/config/ace_athena.mpb b/ACE/bin/MakeProjectCreator/config/ace_athena.mpb new file mode 100644 index 00000000000..c9dad81dc77 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_athena.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project: ace_xt { + requires += athena + lit_libs += Xaw +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_fl.mpb b/ACE/bin/MakeProjectCreator/config/ace_fl.mpb new file mode 100644 index 00000000000..fd7f56695aa --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_fl.mpb @@ -0,0 +1,29 @@ +// -*- MPC -*- +// $Id$ + +project : ace_x11, ace_gl { + requires += fl + + // Depends on configuration from include/makeinclude/platform_*.GNU + verbatim(gnuace,local) { + CPPFLAGS += $(PLATFORM_FL_CPPFLAGS) + CPPFLAGS += $(PLATFORM_GL_CPPFLAGS) $(PLATFORM_X11_CPPFLAGS) + LIBS += $(PLATFORM_FL_LIBS) $(PLATFORM_GL_LIBS) $(PLATFORM_X11_LIBS) + LDFLAGS += $(PLATFORM_FL_LDFLAGS) $(PLATFORM_GL_LDFLAGS) + LDFLAGS += $(PLATFORM_GL_LDFLAGS) + } + specific(vc9,vc8,vc71,vc7,vc6) { + libs += fltkdll + } + + specific(automake) { + // ACE_FLTK_* macros contain X11 settings + compile_flags -= $(ACE_X11_CPPFLAGS) + linkflags -= $(ACE_X11_LDFLAGS) + pure_libs -= $(ACE_X11_LIBS) + + compile_flags += $(ACE_FLTK_CPPFLAGS) + linkflags += $(ACE_FLTK_LDFLAGS) + pure_libs += $(ACE_FLTK_LIBS) + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_flreactor.mpb b/ACE/bin/MakeProjectCreator/config/ace_flreactor.mpb new file mode 100644 index 00000000000..63289cbac3a --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_flreactor.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : acelib, ace_fl { + requires += ace_flreactor + after += ACE_FlReactor + libs += ACE_FlReactor +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_for_tao.mpb b/ACE/bin/MakeProjectCreator/config/ace_for_tao.mpb new file mode 100644 index 00000000000..36b8309f1fc --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_for_tao.mpb @@ -0,0 +1,11 @@ +// -*- MPC -*- +// +// $Id$ + +feature(ace_for_tao) { + macros += ACE_LACKS_ACE_TOKEN ACE_LACKS_MSG_WFMO + + after += ACE_FOR_TAO + libs += ACE_FOR_TAO + +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_fox.mpb b/ACE/bin/MakeProjectCreator/config/ace_fox.mpb new file mode 100644 index 00000000000..cc8c2f967f6 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_fox.mpb @@ -0,0 +1,19 @@ +// -*- MPC -*- +// $Id$ + +project { + requires += fox + // Depends on configration from include/makeinclude/platform_*.GNU + + verbatim(gnuace,local) { + CPPFLAGS += $(PLATFORM_FOX_CPPFLAGS) + LIBS += $(PLATFORM_FOX_LIBS) + LDFLAGS += $(PLATFORM_FOX_LDFLAGS) + } + + specific(automake) { + compile_flags += $(ACE_FOX_CPPFLAGS) + linkflags += $(ACE_FOX_LDFLAGS) + pure_libs += $(ACE_FOX_LIBS) + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_foxreactor.mpb b/ACE/bin/MakeProjectCreator/config/ace_foxreactor.mpb new file mode 100644 index 00000000000..d18642408eb --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_foxreactor.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : acelib, ace_fox { + requires += ace_foxreactor + after += ACE_FoxReactor + libs += ACE_FoxReactor +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_gl.mpb b/ACE/bin/MakeProjectCreator/config/ace_gl.mpb new file mode 100644 index 00000000000..645fd0104aa --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_gl.mpb @@ -0,0 +1,16 @@ +// -*- MPC -*- +// $Id$ + +project : ace_x11 { + requires += gl + + // Depends on configration from include/makeinclude/platform_*.GNU + verbatim(gnuace,local) { + CPPFLAGS += $(PLATFORM_GL_CPPFLAGS) $(PLATFORM_X11_CPPFLAGS) + LIBS += $(PLATFORM_GL_LIBS) $(PLATFORM_X11_LIBS) + LDFLAGS += $(PLATFORM_GL_LDFLAGS) $(PLATFORM_GL_LDFLAGS) + } + specific(vc6,vc7,vc71,vc8,vc9) { + lit_libs += OpenGL32 + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_gtk.mpb b/ACE/bin/MakeProjectCreator/config/ace_gtk.mpb new file mode 100644 index 00000000000..c1235d4633f --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_gtk.mpb @@ -0,0 +1,13 @@ +// -*- MPC -*- +// $Id$ + +project { + macros += ACE_HAS_GTK + + // Depends on configration from include/makeinclude/platform_*.GNU + verbatim(gnuace,local) { + CPPFLAGS += $(PLATFORM_GTK_CPPFLAGS) + LIBS += $(PLATFORM_GTK_LIBS) + LDFLAGS += $(PLATFORM_GTK_LDFLAGS) + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_mfc.mpb b/ACE/bin/MakeProjectCreator/config/ace_mfc.mpb new file mode 100644 index 00000000000..3339a9220eb --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_mfc.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project: mfc { + macros += ACE_HAS_MFC=1 +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_motif.mpb b/ACE/bin/MakeProjectCreator/config/ace_motif.mpb new file mode 100644 index 00000000000..350291b8e52 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_motif.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +project: ace_xt { + requires += motif + lit_libs += Xm +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_openssl.mpb b/ACE/bin/MakeProjectCreator/config/ace_openssl.mpb new file mode 100644 index 00000000000..208de546c19 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_openssl.mpb @@ -0,0 +1,30 @@ +// -*- MPC -*- +// $Id$ + +project : openssl { + // For both automake and gnuace, we want to use built-in macros instead of + // the values provided by the openssl base project. + specific (automake, gnuace) { + lit_libs -= ssl crypto + includes -= $(SSL_ROOT)/include + includes -= /usr/kerberos/include + libpaths -= $(SSL_ROOT)/lib + } + + // The ACE/TAO configure scripts set ace_TLS_CFLAGS and ace_TLS_LIBS + // instead of $(SSL_ROOT)/include and $(SSL_ROOT)/lib as set by MPC's + // openssl.mpb. + specific (automake) { + compile_flags += @ACE_TLS_CPPFLAGS@ + linkflags += @ACE_TLS_LDFLAGS@ + pure_libs += @ACE_TLS_LIBS@ + } + + // These values get set in platform_macros.GNU or defaulted + // in wrapper_macros.GNU if the GNU make variable ssl is set to 1. + specific (gnuace) { + compile_flags += $(PLATFORM_SSL_CPPFLAGS) + linkflags += $(PLATFORM_SSL_LDFLAGS) + pure_libs += $(PLATFORM_SSL_LIBS) + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_output.mpb b/ACE/bin/MakeProjectCreator/config/ace_output.mpb new file mode 100644 index 00000000000..8c3c7337a61 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_output.mpb @@ -0,0 +1,12 @@ +// -*- MPC -*- +// $Id$ + +project { + libout = $(ACE_ROOT)/lib + + specific(automake) { + libout -= $(ACE_ROOT)/lib + libout += $(top_builddir)/lib + } +} + diff --git a/ACE/bin/MakeProjectCreator/config/ace_qt.mpb b/ACE/bin/MakeProjectCreator/config/ace_qt.mpb new file mode 100644 index 00000000000..3c8635caaf2 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_qt.mpb @@ -0,0 +1,28 @@ +// -*- MPC -*- +// $Id$ + + +project: qt { + // Depends on configration from include/makeinclude/platform_*.GNU + verbatim(gnuace,local) { + CPPFLAGS += $(PLATFORM_QT_CPPFLAGS) + LIBS += $(PLATFORM_QT_LIBS) + LDFLAGS += $(PLATFORM_QT_LDFLAGS) + } + + specific(automake) { + includes -= $(QTDIR)/include + libpaths -= $(QTDIR)/lib + macros -= QT_THREAD_SUPPORT + lit_libs -= qt-mt$(QT_VERSION) + + compile_flags += $(ACE_QT_CPPFLAGS) + linkflags += $(ACE_QT_LDFLAGS) + pure_libs += $(ACE_QT_LIBS) + } + + specific(vc6, vc7, vc71, vc8, vc9, nmake) { + lit_libs -= qt-mt$(QT_VERSION) + pure_libs += $(PLATFORM_QT_LIBS) + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_qtreactor.mpb b/ACE/bin/MakeProjectCreator/config/ace_qtreactor.mpb new file mode 100644 index 00000000000..5aafe14fdb7 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_qtreactor.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : acelib, ace_qt { + requires += ace_qtreactor + after += ACE_QtReactor + libs += ACE_QtReactor +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_tk.mpb b/ACE/bin/MakeProjectCreator/config/ace_tk.mpb new file mode 100644 index 00000000000..10493bbf4ea --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_tk.mpb @@ -0,0 +1,19 @@ +// -*- MPC -*- +// $Id$ + +project { + requires += tk + // Depends on configration from include/makeinclude/platform_*.GNU + + verbatim(gnuace,local) { + CPPFLAGS += $(PLATFORM_TCL_CPPFLAGS) $(PLATFORM_TK_CPPFLAGS) + LIBS += $(PLATFORM_TCL_LIBS) $(PLATFORM_TK_LIBS) + LDFLAGS += $(PLATFORM_TCL_LDFLAGS) $(PLATFORM_TK_LDFLAGS) + } + + specific(automake) { + compile_flags += $(ACE_TK_CPPFLAGS) $(ACE_TCL_CPPFLAGS) + linkflags += $(ACE_TK_LDFLAGS) $(ACE_TCL_LDFLAGS) + pure_libs += $(ACE_TK_LIBS) $(ACE_TCL_LIBS) + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_tkreactor.mpb b/ACE/bin/MakeProjectCreator/config/ace_tkreactor.mpb new file mode 100644 index 00000000000..1694ea6fc98 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_tkreactor.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : acelib, ace_tk { + requires += ace_tkreactor + after += ACE_TkReactor + libs += ACE_TkReactor +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_x11.mpb b/ACE/bin/MakeProjectCreator/config/ace_x11.mpb new file mode 100644 index 00000000000..38164eb093f --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_x11.mpb @@ -0,0 +1,22 @@ +// -*- MPC -*- +// $Id$ + +project { + specific(vc6,vc7,vc71,vc8,vc9) { + } else { + requires += x11 + } + + // Depends on configration from include/makeinclude/platform_*.GNU + verbatim(gnuace,local) { + CPPFLAGS += $(PLATFORM_X11_CPPFLAGS) + LIBS += $(PLATFORM_X11_LIBS) + LDFLAGS += $(PLATFORM_X11_LDFLAGS) + } + + specific(automake) { + compile_flags += $(ACE_X11_CPPFLAGS) + linkflags += $(ACE_X11_LDFLAGS) + pure_libs += $(ACE_X11_LIBS) + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_xt.mpb b/ACE/bin/MakeProjectCreator/config/ace_xt.mpb new file mode 100644 index 00000000000..78152e14cc1 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_xt.mpb @@ -0,0 +1,20 @@ +// -*- MPC -*- +// $Id$ + +project: ace_x11 { + // this feature by default is set to 1 as projects dependent on Xt has their own features + requires += xt + + // Depends on configration from include/makeinclude/platform_*.GNU + verbatim(gnuace,local) { + CPPFLAGS += $(PLATFORM_XT_CPPFLAGS) $(PLATFORM_X11_CPPFLAGS) + LIBS += $(PLATFORM_XT_LIBS) $(PLATFORM_X11_LIBS) + LDFLAGS += $(PLATFORM_XT_LDFLAGS) $(PLATFORM_X11_LDFLAGS) + } + + specific(automake) { + compile_flags += $(ACE_XT_CPPFLAGS) + linkflags += $(ACE_XT_LDFLAGS) + pure_libs += $(ACE_XT_LIBS) + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_xtreactor.mpb b/ACE/bin/MakeProjectCreator/config/ace_xtreactor.mpb new file mode 100644 index 00000000000..148d4c55556 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_xtreactor.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : acelib, ace_xt { + requires += ace_xtreactor + after += ACE_XtReactor + libs += ACE_XtReactor +} diff --git a/ACE/bin/MakeProjectCreator/config/ace_zzip.mpb b/ACE/bin/MakeProjectCreator/config/ace_zzip.mpb new file mode 100644 index 00000000000..726758cd81d --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ace_zzip.mpb @@ -0,0 +1,15 @@ +// $Id$ + +feature(zzip): zzip { + specific(automake) { + // Undo everything that comes from zzip and zlib + includes -= $(ZLIB_ROOT)/include $(ZZIP_ROOT)/include + libpaths -= $(ZLIB_ROOT)/lib $(ZZIP_ROOT)/lib + lit_libs -= zzip z + macros -= ZLIB USE_ZZIP + + compile_flags += $(ACE_ZZIP_CPPFLAGS) $(ACE_ZLIB_CPPFLAGS) + linkflags += $(ACE_ZZIP_LDFLAGS) $(ACE_ZLIB_LDFLAGS) + pure_libs += $(ACE_ZZIP_LIBS) $(ACE_ZLIB_LIBS) + } +}
\ No newline at end of file diff --git a/ACE/bin/MakeProjectCreator/config/acedefaults.mpb b/ACE/bin/MakeProjectCreator/config/acedefaults.mpb new file mode 100644 index 00000000000..93098d974ca --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/acedefaults.mpb @@ -0,0 +1,21 @@ +// -*- MPC -*- +// $Id$ + +project: ipv6, vc_warnings, build_files, test_files { + staticflags += ACE_AS_STATIC_LIBS + includes += $(ACE_ROOT) + libpaths += $(ACE_ROOT)/lib + + // Support the alternative Borland Make project type + specific(bmake) { + unicode_flags += -DACE_USES_WCHAR + macros += ACE_LD_DECORATOR_STR=ACE_LIB_TEXT(\\"$(ILIBMODIFIER)\\") + debug_macros += ACE_NO_INLINE=1 + } + + specific(automake) { + am_release = @ACE_VERSION_NAME@ + includes += $(ACE_BUILDDIR) + libpaths -= $(ACE_ROOT)/lib + } +} diff --git a/ACE/bin/MakeProjectCreator/config/aceexe.mpb b/ACE/bin/MakeProjectCreator/config/aceexe.mpb new file mode 100644 index 00000000000..cfd59d40b8d --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/aceexe.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project: acedefaults, acenosubsets, ace_for_tao, versioned_namespace { + +} diff --git a/ACE/bin/MakeProjectCreator/config/acelib.mpb b/ACE/bin/MakeProjectCreator/config/acelib.mpb new file mode 100644 index 00000000000..7a547f12320 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/acelib.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project: acedefaults, acenosubsets, ace_for_tao, versioned_namespace, pkgconfig { + +} diff --git a/ACE/bin/MakeProjectCreator/config/acenosubsets.mpb b/ACE/bin/MakeProjectCreator/config/acenosubsets.mpb new file mode 100644 index 00000000000..8ca2ce57d2e --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/acenosubsets.mpb @@ -0,0 +1,10 @@ +// -*- MPC -*- +// +// $Id$ + +feature(!ace_for_tao) { + + after += ACE + libs += ACE + +} diff --git a/ACE/bin/MakeProjectCreator/config/acexml.mpb b/ACE/bin/MakeProjectCreator/config/acexml.mpb new file mode 100644 index 00000000000..07ca8a17356 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/acexml.mpb @@ -0,0 +1,10 @@ +// -*- MPC -*- +// $Id$ + +project: ace_zzip { + avoids += ace_for_tao + after += ACEXML_Parser ACEXML + libs += ACEXML_Parser ACEXML + includes += $(ACE_ROOT)/ACEXML/common + requires += acexml +} diff --git a/ACE/bin/MakeProjectCreator/config/automake.features b/ACE/bin/MakeProjectCreator/config/automake.features new file mode 100644 index 00000000000..77109ba3a07 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/automake.features @@ -0,0 +1,38 @@ +// $Id$ + +// Ideally this file should enable all features, and the configure script +// would enable or disable the cooresponding automake conditionals. More +// work is required to make this a reality. + +automake=1 +ssl=1 +qos=0 + +gl=1 +x11=1 +athena=1 +motif=1 + +fl=1 +ace_flreactor=1 +tao_flresource=1 + +qt=1 +ace_qtreactor=1 +tao_qtresource=1 + +tk=1 +ace_tkreactor=1 +tao_tkresource=1 + +xt=1 +ace_xtreactor=1 +tao_xtresource=1 + +wxWindows=1 + +stl=1 +boost=1 +java=1 +zlib=1 +zzip=1 diff --git a/ACE/bin/MakeProjectCreator/config/avoids_ace_for_tao.mpb b/ACE/bin/MakeProjectCreator/config/avoids_ace_for_tao.mpb new file mode 100644 index 00000000000..d9a8a0a7fd9 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/avoids_ace_for_tao.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +feature(ace_for_tao) { + avoids += ace_for_tao +} diff --git a/ACE/bin/MakeProjectCreator/config/bmake.features b/ACE/bin/MakeProjectCreator/config/bmake.features new file mode 100644 index 00000000000..16181dc6293 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/bmake.features @@ -0,0 +1,7 @@ +// $Id$ + +ssl=0 +qos=1 +cidl=0 +rwho=0 +sctp=0 diff --git a/ACE/bin/MakeProjectCreator/config/borland.features b/ACE/bin/MakeProjectCreator/config/borland.features new file mode 100644 index 00000000000..16181dc6293 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/borland.features @@ -0,0 +1,7 @@ +// $Id$ + +ssl=0 +qos=1 +cidl=0 +rwho=0 +sctp=0 diff --git a/ACE/bin/MakeProjectCreator/config/conv_lib.mpb b/ACE/bin/MakeProjectCreator/config/conv_lib.mpb new file mode 100644 index 00000000000..e20d7f88f9e --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/conv_lib.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project { + specific(!automake) { + install_this_target = 1 + } +} diff --git a/ACE/bin/MakeProjectCreator/config/core.mpb b/ACE/bin/MakeProjectCreator/config/core.mpb new file mode 100644 index 00000000000..020ea646f80 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/core.mpb @@ -0,0 +1,5 @@ +// -*- MPC -*- +// $Id$ + +project : install { +} diff --git a/ACE/bin/MakeProjectCreator/config/crosscompile.mpb b/ACE/bin/MakeProjectCreator/config/crosscompile.mpb new file mode 100644 index 00000000000..ff7a21a96ba --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/crosscompile.mpb @@ -0,0 +1,14 @@ +// -*- MPC -*- +// $Id$ + +project { + verbatim(gnuace, circuit) { + ifneq ($(CROSS-COMPILE),) + all clean realclean idl_stubs depend lib_warning require_warning avoid_warning: + " @echo This project will not build on CROSS-COMPILE platforms." + else + } + verbatim(gnuace, bottom) { + endif # CROSS-COMPILE + } +} diff --git a/ACE/bin/MakeProjectCreator/config/default.rel b/ACE/bin/MakeProjectCreator/config/default.rel new file mode 100644 index 00000000000..6e61b7555f6 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/default.rel @@ -0,0 +1,8 @@ +// This is the default relative definitions. Wildcards are acceptable. +// +// The first column is the name for which we create a relative definition. +// The second (optional) column is the value to build up if it isn't defined +// as an environmenment variable. +*_ROOT +TAO_ROOT, $ACE_ROOT/TAO +CIAO_ROOT, $TAO_ROOT/CIAO diff --git a/ACE/bin/MakeProjectCreator/config/em3.features b/ACE/bin/MakeProjectCreator/config/em3.features new file mode 100644 index 00000000000..16181dc6293 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/em3.features @@ -0,0 +1,7 @@ +// $Id$ + +ssl=0 +qos=1 +cidl=0 +rwho=0 +sctp=0 diff --git a/ACE/bin/MakeProjectCreator/config/exceptions.mpb b/ACE/bin/MakeProjectCreator/config/exceptions.mpb new file mode 100644 index 00000000000..912530f5cfb --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/exceptions.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project { + requires += exceptions +} diff --git a/ACE/bin/MakeProjectCreator/config/global.features b/ACE/bin/MakeProjectCreator/config/global.features new file mode 100644 index 00000000000..84c5245e0a8 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/global.features @@ -0,0 +1,121 @@ +// $Id$ +// The global features file contains the default feature settings. +// By default, if a feature isn't listed here then it is enabled. +// If it is listed, then the value assigned to the feature is interpreted +// as a boolean value. You really shouldn't have to edit this file except +// to change the defaults. If you want to override these values you can do +// one of two things. +// +// 1) Create a default.features in this directory with the features you +// want enabled or disabled. +// 2) Create a feature file anywhere you like with the features you want and +// use the -feature_file option to specify where it is located. +// +// Feature definitions from this file are always overwritten by -features +// command option of mwc.pl. +// +// This file is somewhat akin to the platform_macros.GNU file in that build +// settings can be set here. + +// Enable these by default. +acexml = 1 +ace_svcconf = 1 +ace_token = 1 + +// By default we disable these. +ace_for_tao = 0 +ssl = 0 +qos = 0 +rapi = 0 +repo = 0 +minimum_corba = 0 +java = 0 +zlib = 0 +zzip = 0 +ipv6 = 0 +mfc = 0 +rpc = 0 +sctp = 0 +boost = 0 +dummy_label = 0 +cidl = 0 +wince = 0 +uses_wchar = 0 +gen_ostream = 0 +ziparchive = 0 +negotiate_codesets = 0 +versioned_namespace = 0 +vcl = 0 +stl = 0 +xsc = 0 +mcpp = 0 + +// Features for various GUI libraries + +// Some of features are switched on because they are also controlled +// by higher level features eg. gl is 1 because it is necessary for fl, +// but if someone turns on fl, we may assume gl is available. This way makefile +// generation is simplified. Moreover all internal ACE features like ace_qtreactor +// and tao_qtresource are also turn on, because we want to build every component +// related with qt if qt is provided. It is proposed to not remove +// switched on features from global.features just because features are available +// by default. This file is also a kind of ACE capabilities documentation, hence +// it is better to enumerate here all features recognized by ACE. + +// 1 - wxWindows (wxWidgets) libraries are avalaible +wxWindows = 0 +// 1 - Motif (Lestif) libraries are avalaible +motif = 0 +// 1 - Athena widgets libraries are avalaible +athena = 0 +// 1 - X11 libraries are avalaible +x11 = 1 +// 1 - X Toolkit libraries are avalaible +xt = 0 +// 1 - Tk libraries are avalaible +tk = 0 +// 1 - Fast Light toolkit libraries are avalaible (assume lowercase h in header files) +fl = 0 +// 1 - Qt libraries are avalaible +qt = 0 +// 1 - Fox libraries are avalaible +fox = 0 +// 1 - OpenGL libraries are avalaible +gl = 1 + +// Features for ACE support for various GUI libraries +// Use QtReactor +ace_qtreactor = 1 +// Use XtReactor +ace_xtreactor = 1 +// Use TkReactor +ace_tkreactor = 1 +// Use FlReactor +ace_flreactor = 1 + +// Features for TAO support for various GUI libraries +// Use QtResources for TAO +tao_qtresource = 1 +// Use XtResources for TAO +tao_xtresource = 1 +// Use TkResources for TAO +tao_tkresource = 1 +// Use FlResources for TAO +tao_flresource = 1 + +//Use the ZIP_Wrapper feature for when using the ZIP wrapper classes +ZIP_Wrapper = 0 + +// Feature for CORBA subsets +corba_e_compact = 0 +corba_e_micro = 0 + +// Footprint feature +optimize_collocated_invocations = 1 + +// Option to disable iiop +tao_no_iiop = 0 + +// Option to enable the linking of the TAO_CodecFactory library +// whenever TAO is linked in +link_codecfactory = 0 diff --git a/ACE/bin/MakeProjectCreator/config/gnuace.features b/ACE/bin/MakeProjectCreator/config/gnuace.features new file mode 100644 index 00000000000..8fccc7fad7b --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/gnuace.features @@ -0,0 +1,10 @@ +// $Id$ + +ssl=1 +qt=1 +fl=1 +tk=1 +xt=1 +cidl=1 +sctp=1 + diff --git a/ACE/bin/MakeProjectCreator/config/htbp.mpb b/ACE/bin/MakeProjectCreator/config/htbp.mpb new file mode 100644 index 00000000000..2a4fd8b12de --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/htbp.mpb @@ -0,0 +1,10 @@ +// -*- MPC -*- +// $Id$ + +project : acelib { + avoids += ace_for_tao // Requires ACE_Configuration_Heap + requires += ace_uuid + after += HTBP + libs += ACE_HTBP + includes += $(ACE_ROOT)/protocols +} diff --git a/ACE/bin/MakeProjectCreator/config/install.mpb b/ACE/bin/MakeProjectCreator/config/install.mpb new file mode 100644 index 00000000000..7dee217a245 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/install.mpb @@ -0,0 +1,5 @@ +// -*- MPC -*- +// $Id$ + +project : install_bin, install_lib, install_headers { +} diff --git a/ACE/bin/MakeProjectCreator/config/install_bin.mpb b/ACE/bin/MakeProjectCreator/config/install_bin.mpb new file mode 100644 index 00000000000..3a5b9e934d5 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/install_bin.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project { + specific { + install_this_target = 1 + } +} diff --git a/ACE/bin/MakeProjectCreator/config/install_headers.mpb b/ACE/bin/MakeProjectCreator/config/install_headers.mpb new file mode 100644 index 00000000000..0c459166ab3 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/install_headers.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project { + specific { + install_headers = 1 + } +} diff --git a/ACE/bin/MakeProjectCreator/config/install_lib.mpb b/ACE/bin/MakeProjectCreator/config/install_lib.mpb new file mode 100644 index 00000000000..3a5b9e934d5 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/install_lib.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project { + specific { + install_this_target = 1 + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ipv6.mpb b/ACE/bin/MakeProjectCreator/config/ipv6.mpb new file mode 100644 index 00000000000..291cee4960b --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ipv6.mpb @@ -0,0 +1,14 @@ +// -*- MPC -*- +// $Id$ + +feature(ipv6) { + specific(vc6, vc7, vc71, vc8, vc9, nmake, borland, bmake, bds4) { + lit_libs += iphlpapi + } + + specific(em3) { + lit_libs += iphlpapi ccrtrtti + } + + macros += ACE_HAS_IPV6 +} diff --git a/ACE/bin/MakeProjectCreator/config/kokyu.mpb b/ACE/bin/MakeProjectCreator/config/kokyu.mpb new file mode 100644 index 00000000000..af5719518dd --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/kokyu.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +project : acelib { + after += Kokyu + libs += Kokyu + includes += $(ACE_ROOT)/Kokyu +}
\ No newline at end of file diff --git a/ACE/bin/MakeProjectCreator/config/labviewrt_dll.mpb b/ACE/bin/MakeProjectCreator/config/labviewrt_dll.mpb new file mode 100644 index 00000000000..3294cf8669e --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/labviewrt_dll.mpb @@ -0,0 +1,17 @@ +// $Id$ +// +// This base project changes all projects to generate DLLs regardless of +// whether it's an exe or a dll project. The DLLs still go in the place the +// exe would have been generated, just as a DLL, not an EXE. +// This is needed when generating projects to build LabVIEW RT "programs" +// that must be loaded as DLLs. + +project { + macros += ACE_BUILD_LABVIEW_EXE_AS_DLL + specific(vc71) { + configuration_type = 2 + exe_ext = .dll + common_defines -= _CONSOLE + common_defines += _WINDOWS + } +} diff --git a/ACE/bin/MakeProjectCreator/config/man.mpb b/ACE/bin/MakeProjectCreator/config/man.mpb new file mode 100644 index 00000000000..ee5b1be7be3 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/man.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project { + Define_Custom(Man) { + automatic = 1 + inputext = .1 .2 .3 .4 .5 .6 .7 .8 + } +} diff --git a/ACE/bin/MakeProjectCreator/config/nmake.features b/ACE/bin/MakeProjectCreator/config/nmake.features new file mode 100644 index 00000000000..16181dc6293 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/nmake.features @@ -0,0 +1,7 @@ +// $Id$ + +ssl=0 +qos=1 +cidl=0 +rwho=0 +sctp=0 diff --git a/ACE/bin/MakeProjectCreator/config/pkgconfig.mpb b/ACE/bin/MakeProjectCreator/config/pkgconfig.mpb new file mode 100644 index 00000000000..e48f56242b6 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/pkgconfig.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project { + Define_Custom(pkgconfig) { + automatic = 0 + inputext = .in + } +} diff --git a/ACE/bin/MakeProjectCreator/config/qos.mpb b/ACE/bin/MakeProjectCreator/config/qos.mpb new file mode 100644 index 00000000000..5e938dd3e6f --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/qos.mpb @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +feature(qos) { + after += QoS + libs += ACE_QoS + macros += ACE_HAS_QOS +} diff --git a/ACE/bin/MakeProjectCreator/config/rmcast.mpb b/ACE/bin/MakeProjectCreator/config/rmcast.mpb new file mode 100644 index 00000000000..ac9427c3d2a --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/rmcast.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project : acelib, threads { + avoids += ace_for_tao + after += RMCast + libs += ACE_RMCast + includes += $(ACE_ROOT)/protocols +} diff --git a/ACE/bin/MakeProjectCreator/config/script.mpb b/ACE/bin/MakeProjectCreator/config/script.mpb new file mode 100644 index 00000000000..ea4def84cdd --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/script.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project { + Define_Custom(Script) { + automatic = 1 + inputext = .sh + } +} diff --git a/ACE/bin/MakeProjectCreator/config/ssl.mpb b/ACE/bin/MakeProjectCreator/config/ssl.mpb new file mode 100644 index 00000000000..859fda7d3d4 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ssl.mpb @@ -0,0 +1,12 @@ +// -*- MPC -*- +// $Id$ + +// In the future, other ssl libraries could be supported +// by creating a new xyzssl.mpb similar to openssl.mpb. +// You would then derive the following project from this base. +project : acelib, ssl_full, ssl_for_tao, ace_openssl { + + requires += ssl + macros += ACE_HAS_SSL=1 + +} diff --git a/ACE/bin/MakeProjectCreator/config/ssl_for_tao.mpb b/ACE/bin/MakeProjectCreator/config/ssl_for_tao.mpb new file mode 100644 index 00000000000..63e363ffade --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ssl_for_tao.mpb @@ -0,0 +1,12 @@ +// -*- MPC -*- +// +// $Id$ + +feature(ace_for_tao) { + +// Does not include ACE_SSL asynch stream support. + + after += SSL_FOR_TAO + libs += ACE_SSL_FOR_TAO + +} diff --git a/ACE/bin/MakeProjectCreator/config/ssl_full.mpb b/ACE/bin/MakeProjectCreator/config/ssl_full.mpb new file mode 100644 index 00000000000..6a64081cd16 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/ssl_full.mpb @@ -0,0 +1,12 @@ +// -*- MPC -*- +// +// $Id$ + +feature(!ace_for_tao) { + +// Includes ACE_SSL asynch stream support. + + after += SSL + libs += ACE_SSL + +} diff --git a/ACE/bin/MakeProjectCreator/config/stl.mpb b/ACE/bin/MakeProjectCreator/config/stl.mpb new file mode 100644 index 00000000000..0036507dd28 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/stl.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project { + requires += stl +} diff --git a/ACE/bin/MakeProjectCreator/config/support_ostream.mpb b/ACE/bin/MakeProjectCreator/config/support_ostream.mpb new file mode 100644 index 00000000000..870e0ee1516 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/support_ostream.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +feature(gen_ostream) { + requires += gen_ostream + macros += GEN_OSTREAM_OPS +} diff --git a/ACE/bin/MakeProjectCreator/config/test_files.mpb b/ACE/bin/MakeProjectCreator/config/test_files.mpb new file mode 100644 index 00000000000..94d3d035da3 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/test_files.mpb @@ -0,0 +1,10 @@ +// $Id$ +project { + Define_Custom(Test) { + automatic=0 + } + Test_Files { + run_test*.pl + } +} + diff --git a/ACE/bin/MakeProjectCreator/config/threads.mpb b/ACE/bin/MakeProjectCreator/config/threads.mpb new file mode 100644 index 00000000000..8d3b8648ca5 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/threads.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project { + requires += threads +} diff --git a/ACE/bin/MakeProjectCreator/config/tmcast.mpb b/ACE/bin/MakeProjectCreator/config/tmcast.mpb new file mode 100644 index 00000000000..4283f27902f --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/tmcast.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project: acelib, exceptions, threads { + avoids += ace_for_tao + after += TMCast + libs += ACE_TMCast + includes += $(ACE_ROOT)/protocols +} diff --git a/ACE/bin/MakeProjectCreator/config/vc71.features b/ACE/bin/MakeProjectCreator/config/vc71.features new file mode 100644 index 00000000000..16181dc6293 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/vc71.features @@ -0,0 +1,7 @@ +// $Id$ + +ssl=0 +qos=1 +cidl=0 +rwho=0 +sctp=0 diff --git a/ACE/bin/MakeProjectCreator/config/vc8.features b/ACE/bin/MakeProjectCreator/config/vc8.features new file mode 100644 index 00000000000..16181dc6293 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/vc8.features @@ -0,0 +1,7 @@ +// $Id$ + +ssl=0 +qos=1 +cidl=0 +rwho=0 +sctp=0 diff --git a/ACE/bin/MakeProjectCreator/config/vc8nmake.mpb b/ACE/bin/MakeProjectCreator/config/vc8nmake.mpb new file mode 100644 index 00000000000..98e2d9ca3da --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/vc8nmake.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project { +} + diff --git a/ACE/bin/MakeProjectCreator/config/vc9.features b/ACE/bin/MakeProjectCreator/config/vc9.features new file mode 100644 index 00000000000..16181dc6293 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/vc9.features @@ -0,0 +1,7 @@ +// $Id$ + +ssl=0 +qos=1 +cidl=0 +rwho=0 +sctp=0 diff --git a/ACE/bin/MakeProjectCreator/config/vc9nmake.mpb b/ACE/bin/MakeProjectCreator/config/vc9nmake.mpb new file mode 100644 index 00000000000..3e1cd845bde --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/vc9nmake.mpb @@ -0,0 +1,9 @@ +// -*- MPC -*- +// $Id$ + +project { + specific(nmake) { + addcompile -= /Wp64 + } +} + diff --git a/ACE/bin/MakeProjectCreator/config/vc_warnings.mpb b/ACE/bin/MakeProjectCreator/config/vc_warnings.mpb new file mode 100644 index 00000000000..32e49922a7b --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/vc_warnings.mpb @@ -0,0 +1,31 @@ +// -*- MPC -*- +// $Id$ + +// This file contains a number of optional features that disable VC +// warnings regarding various items that VC turned into warnings that were +// not present in earlier versions. Some people may consider these superfluous +// or have already checked code to be sure it causes no trouble. So these +// warnings are disabled by default. To enable them, generate your projects +// with the feature set to 0. + + +feature(vc_avoid_crt_secure_warnings) { + specific(vc8, vc9, nmake) { + macros += _CRT_SECURE_NO_WARNINGS _CRT_SECURE_NO_DEPRECATE _CRT_NONSTDC_NO_DEPRECATE + } +} + +feature(!vc_scl_secure_warnings) { + specific(vc8, vc9, nmake) { + macros += _SCL_SECURE_NO_WARNINGS + } +} + +feature(vc_avoid_this_in_initializer_warnings) { + specific(vc8, vc9) { + DisableSpecificWarnings += 4355 + } + specific(nmake) { + compile_flags += /wd4355 + } +} diff --git a/ACE/bin/MakeProjectCreator/config/vcfullmacros.mpt b/ACE/bin/MakeProjectCreator/config/vcfullmacros.mpt new file mode 100644 index 00000000000..a3bb4b1bbd1 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/vcfullmacros.mpt @@ -0,0 +1,14 @@ +// -*- MPC -*- +// $Id$ + +// ACE specific macros for nmake, vc6, vc7 and em3 + +Static MFC Release { + defines += ACE_HAS_MFC=1 ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER +} + +Static MFC Debug { + defines += ACE_HAS_MFC=1 ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER +} + +conditional_include "vcpartialmacros" diff --git a/ACE/bin/MakeProjectCreator/config/vcl.mpb b/ACE/bin/MakeProjectCreator/config/vcl.mpb new file mode 100644 index 00000000000..ba81ff4002f --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/vcl.mpb @@ -0,0 +1,16 @@ +// -*- MPC -*- +// $Id$ + +project { + requires += vcl + macros += ACE_HAS_VCL=1 + specific(bmake, borland, bds4) { + use_vcl = 1 + lit_libs += rtl vcl + compile_flags += -tW -tWV + linkflags += -aa + } + verbatim(borland,macros) { + VCL=1 + } +} diff --git a/ACE/bin/MakeProjectCreator/config/vcpartialmacros.mpt b/ACE/bin/MakeProjectCreator/config/vcpartialmacros.mpt new file mode 100644 index 00000000000..1105c25cd39 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/vcpartialmacros.mpt @@ -0,0 +1,12 @@ +// -*- MPC -*- +// $Id$ + +// ACE specific macros for nmake, vc6, vc7 and em3 + +MFC Release { + defines += ACE_HAS_MFC=1 ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER +} + +MFC Debug { + defines += ACE_HAS_MFC=1 ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER +} diff --git a/ACE/bin/MakeProjectCreator/config/versioned_namespace.mpb b/ACE/bin/MakeProjectCreator/config/versioned_namespace.mpb new file mode 100644 index 00000000000..502c8139ceb --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/versioned_namespace.mpb @@ -0,0 +1,13 @@ +// -*- MPC -*- +// +// $Id$ + +feature(versioned_namespace) { + + macros += ACE_HAS_VERSIONED_NAMESPACE=1 + + // Users, define the ACE_VERSIONED_NAMESPACE_NAME preprocessor + // symbol in your ace/config.h to override the default versioned + // namespace name of the form ACE_5_4_7. + +} diff --git a/ACE/bin/MakeProjectCreator/config/wfmo.mpb b/ACE/bin/MakeProjectCreator/config/wfmo.mpb new file mode 100644 index 00000000000..788d9905583 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/wfmo.mpb @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +feature(wfmo) { + requires += wfmo +} diff --git a/ACE/bin/MakeProjectCreator/config/winregistry.mpb b/ACE/bin/MakeProjectCreator/config/winregistry.mpb new file mode 100644 index 00000000000..4ccdb55836f --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/winregistry.mpb @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +feature(winregistry) { + avoids += ace_for_tao + requires += winregistry +} diff --git a/ACE/bin/MakeProjectCreator/config/wxwindows.mpb b/ACE/bin/MakeProjectCreator/config/wxwindows.mpb new file mode 100644 index 00000000000..8931ea36712 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/config/wxwindows.mpb @@ -0,0 +1,21 @@ +// -*- MPC -*- +// $Id$ + +project { + requires += wxWindows + verbatim(gnuace,local) { + # work based on the configuration of the wxWindows installation + # PLATFORM_WX_* defined in includes/makeincludes/*_macros.GNU + CPPFLAGS += $(PLATFORM_WX_CPPFLAGS) + LDFLAGS += $(PLATFORM_WX_LDFLAGS) + LDLIBS += $(PLATFORM_WX_LIBS) + } + + specific(automake) { + compile_flags += $(ACE_WX_CPPFLAGS) + linkflags += $(ACE_WX_LDFLAGS) + pure_libs += $(ACE_WX_LIBS) + } + + // TBD - support other platforms +} diff --git a/ACE/bin/MakeProjectCreator/docs/templates/gnu.txt b/ACE/bin/MakeProjectCreator/docs/templates/gnu.txt new file mode 100644 index 00000000000..9d16b357afb --- /dev/null +++ b/ACE/bin/MakeProjectCreator/docs/templates/gnu.txt @@ -0,0 +1,25 @@ +// Current as of 2/27/2007 +// This defines the role of all the template variables specific to the +// 'gnuace' project type. +// +// Please try to keep this alphabetically sorted. +// +ciao = Indicates whether or not this project contains CIAO code. +cidlc = The full path to the cidl compiler. +cidlc_dep = The full path to the cidl compiler as a dependency. +cidlc_flags = The default flags for the cidl compiler. +dds = Indicates whether or not this project contains DDS code. +idl_files = When a Define_Custom(IDL) is used, they will be accessible through this variable name. +install = This is a synonym for exeout. +tao = Indicates whether or not this project contains TAO code. +tao_idl = The full path to the idl compiler. +tao_idl3_to_idl2 = The full path to the idl3 to idl2 compiler. +tao_idl3_to_idl2_dep = The full path to the idl3 to idl2 compiler as a dependency. +tao_idl_dep = The full path to the idl compiler as a dependency. +tao_idlflags = The default flags for the idl compiler. +targetoutdir = Specifies a location for all targets and intermediaries within the makefile. It should always end in a slash. +vpath = The value will be used as the VPATH setting within the makefile. +xerceslib = The name of the Xerces library. +xsc_bin = The full path of the XSC executable. +xsc_dep = The full path of the XSC executable as a dependency. +xsc_flags = The default flags to the XSC executable. diff --git a/ACE/bin/MakeProjectCreator/modules/AutomakeWorkspaceHelper.pm b/ACE/bin/MakeProjectCreator/modules/AutomakeWorkspaceHelper.pm new file mode 100644 index 00000000000..7b7b30a0186 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/modules/AutomakeWorkspaceHelper.pm @@ -0,0 +1,209 @@ +package AutomakeWorkspaceHelper; + +# ************************************************************ +# Description : An Automake Workspace Helper +# Author : Chad Elliott +# Create Date : 9/01/2004 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use FileHandle; +use File::Basename; + +use WorkspaceHelper; + +use vars qw(@ISA); +@ISA = qw(WorkspaceHelper); + +# ************************************************************ +# Data Section +# ************************************************************ + +my(%vals) = ('ACE_ROOT' => '$(top_srcdir)', + 'TAO_ROOT' => '$(top_srcdir)', + 'CIAO_ROOT' => '$(top_srcdir)', + 'ACE_BUILDDIR' => '$(top_builddir)', + 'TAO_BUILDDIR' => '$(top_builddir)', + 'CIAO_BUILDDIR' => '$(top_builddir)', + 'TAO_IDL' => 'ACE_ROOT=$(ACE_ROOT) TAO_ROOT=$(TAO_ROOT) $(TAO_BUILDDIR)/TAO_IDL/tao_idl' . "\n" . + 'TAO_IDL_DEP = $(TAO_BUILDDIR)/TAO_IDL/tao_idl' . "\n" . + 'TAO_IDLFLAGS = -Wb,pre_include=ace/pre.h -Wb,post_include=ace/post.h -I$(TAO_ROOT) -I$(srcdir) -g $(ACE_BUILDDIR)/apps/gperf/src/gperf', + ); + +my(%addon) = ('ACE_ROOT' => {'CIAO_ROOT' => '/../..', + 'TAO_ROOT' => '/..', + 'CIAO_BUILDDIR' => '/../..', + 'TAO_BUILDDIR' => '/..'}, + 'ACE_BUILDDIR' => {'CIAO_ROOT' => '/../..', + 'TAO_ROOT' => '/..', + 'CIAO_BUILDDIR' => '/../..', + 'TAO_BUILDDIR' => '/..'}, + 'TAO_ROOT' => {'CIAO_ROOT' => '/..', + 'CIAO_BUILDDIR' => '/..'}, + 'TAO_BUILDDIR' => {'CIAO_ROOT' => '/..', + 'CIAO_BUILDDIR' => '/..'}, + ); + +## These are required when processing the TAO workspace +my(%libdirs) = ('libACE_SSL.la' => 'ace/SSL', + 'libACEXML.la' => 'ACEXML/common', + 'libACEXML_Parser.la' => 'ACEXML/parser/parser', + 'libACE_TMCast.la' => 'protocols/ace/TMCast', + 'libACE_RMCast.la' => 'protocols/ace/RMCast', + 'libACE_HTBP.la' => 'protocols/ace/HTBP', + 'libKokyu.la' => 'Kokyu', + ); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub modify_value { + my($self) = shift; + my($name) = shift; + my($value) = shift; + + if ($name eq 'includedir') { + ## TAO/orbsvcs and TAO are like separate projects, so first + ## remove the TAO/orbsvcs part and if that doesn't work try + ## removing the TAO part. The ACE related values don't need + ## any modification. + if (!($value =~ s/^\/orbsvcs\/orbsvcs$/\/orbsvcs/)) { + if (!($value =~ s/^\/TAO\/orbsvcs//)) { + if (!($value =~ s/^\/TAO//)) { + ## These ACE related libraries need fixing too. + $value =~ s/^\/protocols(\/ace)/$1/; + } + } + } + } + elsif ($name eq 'amflags') { + if (basename(Cwd::getcwd()) eq 'TAO') { + $value .= ' -I ../m4'; + } + } + elsif ($name eq 'extra') { + if (basename(Cwd::getcwd()) eq 'TAO') { + $value .= "EXTRA_DIST = \\\n" . + " PROBLEM-REPORT-FORM \\\n" . + " VERSION \\\n" . + " COPYING.sun \\\n" . + " LICENSE.sun \\\n" . + " README.sun\n\n" . + "release:\n" . + "\t\$(MAKE) dist\n\n". + "TAO_EXTRA_DIST = docs\n\n" . + "dist-hook:\n" . + "\t(cd \$(top_srcdir); tar cf - \$(TAO_EXTRA_DIST)) | (cd \$(distdir); \\\n" . + "\t tar xfBp -)\n" . + "\tlist=`find \$(distdir) -type d -name .svn -print`; for p in \$\$list; do \\\n" . + "\t rm -rf \$\$p; done\n"; + } + } + + return $value; +} + +sub modify_libpath { + my($self) = shift; + my($str) = shift; + my($reldir) = shift; + my($libname) = shift; + + if ($libname =~ /^lib(ace)/i) { + if (!defined $reldir || $reldir eq '') { + if (defined $libdirs{$libname}) { + $reldir = $libdirs{$libname}; + } + else { + $reldir = 'ace'; + } + } + $str =~ s!$libname!\$(ACE_BUILDDIR)/$reldir/$libname!; + return $str; + } + elsif ($libname =~ /^lib(kokyu\.)/i) { + if (!defined $reldir || $reldir eq '') { + if (defined $libdirs{$libname}) { + $reldir = $libdirs{$libname}; + } + else { + $reldir = 'Kokyu'; + } + } + $str =~ s!$libname!\$(top_builddir)/$reldir/$libname!; + return $str; + } + elsif ($libname =~ /^lib(tao|kokyu)/i) { + if (defined $reldir) { + $reldir =~ s!TAO/!!; + $str =~ s!$libname!\$(TAO_BUILDDIR)/$reldir/$libname!; + return $str; + } + } + elsif ($libname =~ /^libciao/i) { + if (defined $reldir) { + $reldir =~ s!TAO/CIAO/!!; + $str =~ s!$libname!\$(CIAO_BUILDDIR)/$reldir/$libname!; + return $str; + } + } + + return undef; +} + +sub write_settings { + my($self) = shift; + my($wsc) = shift; + my($fh) = shift; + my(@locals) = @_; + my($status) = 1; + my($error) = undef; + my($crlf) = $wsc->crlf(); + my($pfh) = new FileHandle(); + my(%seen) = (); + my($outdir) = $wsc->get_outdir(); + + foreach my $local (reverse @locals) { + if (open($pfh, "$outdir/$local")) { + while(<$pfh>) { + foreach my $key (keys %vals) { + if (/\$\($key\)/) { + $seen{$key} = $vals{$key}; + } + } + } + close($pfh); + } + else { + $status = 0; + $error = "Unable to open $local for reading."; + } + } + + foreach my $key (sort keys %seen) { + print $fh "$key = $seen{$key}"; + if (defined $addon{$key}) { + foreach my $add ( + sort { length($addon{$key}->{$b}) <=> + length($addon{$key}->{$a}) } keys %{$addon{$key}}) { + if ($seen{$add}) { + print $fh $addon{$key}->{$add}; + last; + } + } + } + print $fh $crlf; + } + + print $fh $crlf; + + return $status, $error; +} + + +1; diff --git a/ACE/bin/MakeProjectCreator/modules/BorlandProjectCreator.pm b/ACE/bin/MakeProjectCreator/modules/BorlandProjectCreator.pm new file mode 100644 index 00000000000..167c91ac295 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/modules/BorlandProjectCreator.pm @@ -0,0 +1,126 @@ +package BorlandProjectCreator; + +# ************************************************************ +# Description : A Borland Project Creator +# Author : Chad Elliott +# Create Date : 3/14/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use ProjectCreator; +use WinProjectBase; +use File::Basename; + +use vars qw(@ISA); +@ISA = qw(WinProjectBase ProjectCreator); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub dollar_special { + #my($self) = shift; + return 1; +} + + +sub fill_value { + my($self) = shift; + my($name) = shift; + my($value) = undef; + my(%names) = ('cppdir' => 'source_files', + 'rcdir' => 'resource_files', + ); + + if (defined $names{$name}) { + my(%dirnames) = (); + foreach my $file ($self->get_component_list($names{$name}, 1)) { + my($dirname) = $self->mpc_dirname($file); + if ($dirname eq '') { + $dirname = '.'; + } + elsif ($self->convert_slashes()) { + $dirname = $self->slash_to_backslash($dirname); + } + $dirnames{$dirname} = 1; + } + + ## Sort the directories to ensure that '.' comes first + $value = join(';', sort keys %dirnames); + } + elsif ($name eq 'relwd') { + my($useenv) = $self->get_use_env(); + my($rel) = ($useenv ? \%ENV : $self->get_relative()); + $value = $self->getcwd(); + + foreach my $key (keys %$rel) { + ## Do not use PWD or CD if we are expanding environment variables. + ## They could conflict with the "real" values we're looking for. + if ($useenv && ($key eq 'PWD' || $key eq 'CD')) { + next; + } + + ## Get the relative replacement value and convert back-slashes + my($val) = $$rel{$key}; + $val =~ s/\\/\//g; + + ## We only need to check for reverse replacement if the length + ## of the string is less than or equal to the length of our + ## replacement value or the string has a slash at the position + ## of the length of the replacement value + my($vlen) = length($val); + if (length($value) <= $vlen || substr($value, $vlen, 1) eq '/') { + ## Cut the string down by the length of the replacement value + my($lval) = substr($value, 0, $vlen); + + ## Here we make an assumption that we + ## have a case-insensitive file system. + if (lc($lval) eq lc($val)) { + substr($value, 0, length($val) + 1) = ''; + last; + } + } + } + $value = $self->slash_to_backslash($value); + } + + return $value; +} + + +sub project_file_name { + my($self) = shift; + my($name) = shift; + + if (!defined $name) { + $name = $self->project_name(); + } + + return $self->get_modified_project_file_name($name, '.bor'); +} + + +sub get_dll_exe_template_input_file { + #my($self) = shift; + return 'borexe'; +} + + +sub get_dll_template_input_file { + #my($self) = shift; + return 'bordll'; +} + + +sub get_template { + #my($self) = shift; + return 'bor'; +} + + +1; diff --git a/ACE/bin/MakeProjectCreator/modules/BorlandWorkspaceCreator.pm b/ACE/bin/MakeProjectCreator/modules/BorlandWorkspaceCreator.pm new file mode 100644 index 00000000000..5b4eab604d1 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/modules/BorlandWorkspaceCreator.pm @@ -0,0 +1,166 @@ +package BorlandWorkspaceCreator; + +# ************************************************************ +# Description : A Borland Workspace (Makefile.bor) creator +# Author : Chad Elliott +# Create Date : 7/02/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use File::Basename; + +use BorlandProjectCreator; +use WorkspaceCreator; + +use vars qw(@ISA); +@ISA = qw(WorkspaceCreator); + +# ************************************************************ +# Data Section +# ************************************************************ + +my($max_line_length) = 32767; ## Borland Make's maximum line length +my(@targets) = ('clean', 'realclean', 'install'); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub workspace_file_name { + my($self) = shift; + return $self->get_modified_workspace_name('Makefile', '.bor'); +} + + +sub workspace_per_project { + #my($self) = shift; + return 1; +} + + +sub pre_workspace { + my($self) = shift; + my($fh) = shift; + my($crlf) = $self->crlf(); + + print $fh '#----------------------------------------------------------------------------', $crlf, + '# Borland Workspace', $crlf, + '#', $crlf, + '# $Id$', $crlf, + '#', $crlf, + '# This file was generated by MPC. Any changes made directly to', $crlf, + '# this file will be lost the next time it is generated.', $crlf, + '#', $crlf, + '# MPC Command:', $crlf, + "# $0 @ARGV", $crlf, + '#----------------------------------------------------------------------------', $crlf, + $crlf; +} + + +sub write_project_targets { + my($self) = shift; + my($fh) = shift; + my($target) = shift; + my($list) = shift; + my($crlf) = $self->crlf(); + + foreach my $project (@$list) { + my($dir) = $self->mpc_dirname($project); + my($chdir) = 0; + my($back) = ''; + my($cwd) = $self->getcwd(); + + ## If the directory isn't '.' then we need + ## to figure out how to get back to our starting point + if ($dir ne '.') { + $chdir = 1; + my($count) = ($dir =~ tr/\///) + 1; + if ($dir =~ /^\.\.\//) { + ## Find out how many directories we went down + my($rel) = $dir; + while($rel =~ s/^\.\.\///) { + } + my($down) = ($rel =~ tr/\///) + 1; + + ## Get $count - $down parts of the base of the current directory + $rel = $cwd; + my($index) = length($rel); + for(my $i = $down; $i < $count; $i++) { + $index = rindex($rel, '/', $index - 1); + } + if ($index > -1) { + $rel = substr($rel, $index + 1); + } + $back = ('../' x $down) . $rel; + } + else { + $back = ('../' x $count); + } + } + + print $fh ($chdir ? "\t\@cd $dir$crlf" : '') . + "\t\$(MAKE) -\$(MAKEFLAGS) \$(MAKE_FLAGS) -f " . basename($project) . " $target$crlf" . + ($chdir ? "\t\@cd $back$crlf" : ''); + } +} + + +sub write_comps { + my($self) = shift; + my($fh) = shift; + my($projects) = $self->get_projects(); + my($pjs) = $self->get_project_info(); + my(%targnum) = (); + my(@list) = $self->number_target_deps($projects, $pjs, \%targnum, 0); + my($crlf) = $self->crlf(); + my(@ltargets) = @targets; + + print $fh "!include <\$(ACE_ROOT)\\include\\makeinclude\\make_flags.bor>$crlf"; + + ## Construct the "all" target + my($all) = $crlf . 'all:'; + foreach my $project (@list) { + $all .= " $$pjs{$project}->[0]"; + } + if (length($all) < $max_line_length) { + print $fh $all, $crlf; + } + else { + unshift(@ltargets, 'all'); + } + + ## Print out all other targets here + foreach my $target (@ltargets) { + print $fh $crlf . + "$target\:$crlf"; + $self->write_project_targets($fh, $target, \@list); + } + + ## Print out each target separately + foreach my $project (@list) { + print $fh $crlf . $$pjs{$project}->[0] . ':'; + if (defined $targnum{$project}) { + foreach my $number (@{$targnum{$project}}) { + print $fh " $$pjs{$list[$number]}->[0]"; + } + } + + print $fh $crlf; + $self->write_project_targets($fh, 'all', [ $project ]); + } + + ## Print out the project_name_list target + print $fh $crlf . "project_name_list:$crlf"; + foreach my $project (sort @list) { + print $fh "\t\@echo $$pjs{$project}->[0]$crlf"; + } +} + + + +1; diff --git a/ACE/bin/MakeProjectCreator/modules/GNUACEProjectCreator.pm b/ACE/bin/MakeProjectCreator/modules/GNUACEProjectCreator.pm new file mode 100644 index 00000000000..47ef47cb3d2 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/modules/GNUACEProjectCreator.pm @@ -0,0 +1,101 @@ +package GNUACEProjectCreator; + +# ************************************************************ +# Description : A GNU Project Creator for ACE +# Author : Chad Elliott +# Create Date : 3/13/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use File::Basename; + +use MakeProjectBase; +use ProjectCreator; + +use vars qw(@ISA); +@ISA = qw(MakeProjectBase ProjectCreator); + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub expand_variables_from_template_values { + #my($self) = shift; + return 0; +} + + +sub convert_slashes { + #my($self) = shift; + return 0; +} + + +sub fill_value { + my($self) = shift; + my($name) = shift; + + if ($name eq 'vpath') { + my(%vpath) = (); + foreach my $item ($self->get_component_list('source_files')) { + my($dname) = $self->relative($self->mpc_dirname($item)); + if ($dname ne '.') { + $vpath{$dname} = 1; + } + } + my($str) = join(':', keys %vpath); + if ($str ne '') { + return 'VPATH = .:' . $str . $self->crlf(); + } + } + elsif ($name eq 'tao') { + my($incs) = $self->get_assignment('includes'); + my($libs) = $self->get_assignment('libpaths'); + return ((defined $incs && $incs =~ /tao/i) || + (defined $libs && $libs =~ /tao/i)); + } + elsif ($name eq 'ciao') { + my($incs) = $self->get_assignment('includes'); + my($libs) = $self->get_assignment('libpaths'); + return ((defined $incs && $incs =~ /ciao/i) || + (defined $libs && $libs =~ /ciao/i)); + } + elsif ($name eq 'dds') { + my($incs) = $self->get_assignment('includes'); + my($libs) = $self->get_assignment('libpaths'); + return ((defined $incs && $incs =~ /dds/i) || + (defined $libs && $libs =~ /dds/i)); + } + + return undef; +} + + +sub project_file_prefix { + #my($self) = shift; + return 'GNUmakefile.'; +} + + +sub get_dll_exe_template_input_file { + #my($self) = shift; + return 'gnuexe'; +} + + +sub get_dll_template_input_file { + #my($self) = shift; + return 'gnudll'; +} + + +sub get_template { + #my($self) = shift; + return 'gnu'; +} + +1; diff --git a/ACE/bin/MakeProjectCreator/modules/GNUACEWorkspaceCreator.pm b/ACE/bin/MakeProjectCreator/modules/GNUACEWorkspaceCreator.pm new file mode 100644 index 00000000000..45a8c37dcca --- /dev/null +++ b/ACE/bin/MakeProjectCreator/modules/GNUACEWorkspaceCreator.pm @@ -0,0 +1,223 @@ +package GNUACEWorkspaceCreator; + +# ************************************************************ +# Description : A GNU Workspace (GNUmakefile) creator for ACE +# Author : Chad Elliott +# Create Date : 5/13/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use GNUACEProjectCreator; +use MakeWorkspaceBase; +use WorkspaceCreator; + +use vars qw(@ISA); +@ISA = qw(MakeWorkspaceBase WorkspaceCreator); + +# ************************************************************ +# Data Section +# ************************************************************ + +my($base) = 'GNUmakefile'; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub targets { + return 'clean depend idl_stubs realclean'; +} + + +sub generate_implicit_project_dependencies { + #my($self) = shift; + return 1; +} + + +sub workspace_file_prefix { + #my($self) = shift; + return $base; +} + + +sub pre_workspace { + my($self) = shift; + my($fh) = shift; + my($crlf) = $self->crlf(); + + print $fh '# -*- makefile -*-', $crlf; + $self->workspace_preamble($fh, $crlf, 'GNU ACE Workspace', + '$Id$'); + print $fh 'MAKEFILE = ', $self->get_modified_workspace_name($base, '', 1), + $crlf; +} + + +sub write_project_targets { + my($self) = shift; + my($fh) = shift; + my($crlf) = shift; + my($target) = shift; + my($list) = shift; + + foreach my $project (@$list) { + my($dname) = $self->mpc_dirname($project); + my($chdir) = ($dname ne '.'); + print $fh "\t\@", + ($chdir ? "cd $dname && " : ''), + "\$(MAKE) -f ", + ($chdir ? $self->mpc_basename($project) : $project), + " $target$crlf"; + } +} + + +sub write_comps { + my($self) = shift; + my($fh) = shift; + my($crlf) = $self->crlf(); + my(%targnum) = (); + my($pjs) = $self->get_project_info(); + my($named) = !defined $ENV{MPC_GNUACE_DIRECTORY_DEPS}; + my(@list) = $self->number_target_deps($self->get_projects(), + $pjs, \%targnum, + $named ? 0 : 1); + + ## Print out some preliminary information + print $fh $crlf, + "ifeq (\$(findstring k,\$(MAKEFLAGS)),k)$crlf", + " KEEP_GOING = -$crlf", + "endif$crlf$crlf", + "include \$(ACE_ROOT)/include/makeinclude/macros.GNU$crlf"; + + if ($named) { + $self->write_named_targets($fh, $crlf, \%targnum, \@list, + 'REMAINING_TARGETS := ' . + '$(subst all, , $(TARGETS_NESTED:.nested=)) $(CUSTOM_TARGETS)' . + "$crlf$crlf\$(REMAINING_TARGETS)", '', '', + $self->project_target_translation(1), 1); + } + else { + ## Determine the ordering of the sub-directories + my(@dirs) = (); + my(%found) = (); + foreach my $file (reverse @list) { + my($dir) = $self->get_first_level_directory($file); + if ($dir ne '.') { + if (!defined $found{$dir}) { + $found{$dir} = 1; + unshift(@dirs, $dir); + } + } + } + my($need_dirs) = ($#dirs > -1); + + ## Store the local projects in a separate list + my(@lprj) = (); + my(%dirprj) = (); + foreach my $project (@list) { + if ($project !~ /\//) { + push(@lprj, $project); + if ($need_dirs && defined $targnum{$project}) { + foreach my $number (@{$targnum{$project}}) { + if ($list[$number] =~ /\//) { + ## If any local project depends on a project that is not + ## in this directory, we can not rely on the directory + ## recursion to get the correct dependencies. We will do + ## all projects as local targets. + @lprj = (); + foreach my $prj (@list) { + push(@lprj, $prj); + if ($prj =~ /\//) { + $dirprj{$prj} = 1; + } + } + $need_dirs = 0; + last; + } + } + if (!$need_dirs) { + last; + } + } + } + } + + if ($#lprj >= 0) { + ## Print out the all target first. This will allow multiple projects + ## within the same directory to build in parallel. + print $fh 'all:'; + foreach my $project (@lprj) { + print $fh ' ', $$pjs{$project}->[0]; + } + print $fh $crlf; + if ($need_dirs) { + foreach my $dir (@dirs) { + print $fh "\t\$(KEEP_GOING)\@cd $dir && ", + "\$(MAKE) -f \$(MAKEFILE) \$(\@)$crlf"; + } + } + + ## Print out each target separately. Make can decide on which + ## targets can be built in parallel because we add the local + ## dependencies. + foreach my $project (@lprj) { + print $fh $crlf, '.PHONY: ', $$pjs{$project}->[0], + $crlf, $$pjs{$project}->[0], ':'; + if (defined $targnum{$project}) { + foreach my $number (@{$targnum{$project}}) { + print $fh ' ', $$pjs{$list[$number]}->[0]; + } + } + print $fh $crlf, + "\t\$(KEEP_GOING)\@"; + if (defined $dirprj{$project}) { + print $fh "cd ", $self->mpc_dirname($project), + " && \$(MAKE) -f ", $self->mpc_basename($project), + $crlf; + } + else { + print $fh "\$(MAKE) -f $project$crlf"; + } + } + print $fh $crlf, + 'REMAINING_TARGETS := ', + '$(subst all, , $(TARGETS_NESTED:.nested=)) $(CUSTOM_TARGETS)', + $crlf; + } + else { + print $fh 'REMAINING_TARGETS := $(TARGETS_NESTED:.nested=) ', + '$(CUSTOM_TARGETS)', $crlf; + } + + ## Print out the remaing targets. + ## They will be handled serially by make. + print $fh "\$(REMAINING_TARGETS):$crlf"; + foreach my $project (@lprj) { + print $fh "\t\$(KEEP_GOING)\@"; + if (defined $dirprj{$project}) { + print $fh "cd ", $self->mpc_dirname($project), + " && \$(MAKE) -f ", $self->mpc_basename($project), + " \$(\@)", $crlf; + } + else { + print $fh "\$(MAKE) -f $project \$(\@)$crlf"; + } + } + if ($need_dirs) { + foreach my $dir (@dirs) { + print $fh "\t\$(KEEP_GOING)\@cd $dir && ", + "\$(MAKE) -f \$(MAKEFILE) \$(\@)$crlf"; + } + } + print $fh $crlf; + } +} + +1; diff --git a/ACE/bin/MakeProjectCreator/modules/GNUAutobuildProjectCreator.pm b/ACE/bin/MakeProjectCreator/modules/GNUAutobuildProjectCreator.pm new file mode 100644 index 00000000000..aa24f83075c --- /dev/null +++ b/ACE/bin/MakeProjectCreator/modules/GNUAutobuildProjectCreator.pm @@ -0,0 +1,27 @@ +package GNUAutobuildProjectCreator; + +# ************************************************************ +# Description : A Project creator for the GNUAutobuild project type +# Author : Chad Elliott +# Create Date : 3/13/2002 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use File::Basename; + +use GNUACEProjectCreator; +use MakeProjectBase; +use ProjectCreator; + +use vars qw(@ISA); +@ISA = qw(GNUACEProjectCreator MakeProjectBase ProjectCreator); + +sub extractType { + return 'gnuace'; +} + +1; diff --git a/ACE/bin/MakeProjectCreator/modules/GNUAutobuildWorkspaceCreator.pm b/ACE/bin/MakeProjectCreator/modules/GNUAutobuildWorkspaceCreator.pm new file mode 100644 index 00000000000..faf10e6277f --- /dev/null +++ b/ACE/bin/MakeProjectCreator/modules/GNUAutobuildWorkspaceCreator.pm @@ -0,0 +1,58 @@ +package GNUAutobuildWorkspaceCreator; + +# ************************************************************ +# Description : A GNU Workspace (GNUmakefile) creator that +# collates build results for a single makefile +# before outputting to stdout. +# Author : Chad Elliott, minor modifications by Will Otte +# Create Date : 3/22/07 +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; + +use GNUACEWorkspaceCreator; +use GNUAutobuildProjectCreator; +use MakeWorkspaceBase; +use WorkspaceCreator; + +use vars qw(@ISA); +@ISA = qw(GNUACEWorkspaceCreator MakeWorkspaceBase WorkspaceCreator); + +# ************************************************************ +# Data Section +# ************************************************************ + +my($base) = 'GNUmakefile'; + +# ************************************************************ +# Subroutine Section +# ************************************************************ +sub extractType { + return 'gnuace'; +} + +sub write_project_targets { + my($self) = shift; + my($fh) = shift; + my($crlf) = shift; + my($target) = shift; + my($list) = shift; + + foreach my $project (@$list) { + my($dname) = $self->mpc_dirname($project); + my($chdir) = ($dname ne '.'); + my($output_project) = ($chdir ? $self->mpc_basename($project) : $project); + + print $fh "\t\@", + ($chdir ? "cd $dname && " : ''), + "\$(MAKE) -f ", + $output_project, + " $target &> $output_project.log ; cat $output_project.log ; rm $output_project.log $crlf"; + } +} + +1; diff --git a/ACE/bin/MakeProjectCreator/templates/bor.mpd b/ACE/bin/MakeProjectCreator/templates/bor.mpd new file mode 100644 index 00000000000..d2d85bedf59 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/templates/bor.mpd @@ -0,0 +1,219 @@ +# Makefile for building the <%if(exename)%><%exename%> exe<%endif%><%if(sharedname)%><%sharedname%> library<%else%><%if(staticname)%><%staticname%> library<%endif%><%endif%> with Borland C++ Make + +<%marker(top)%> +<%if(exename)%> +NAME = <%exename%> +<%else%> +<%if(sharedname || staticname)%> +NAME = <%if(sharedname)%><%sharedname%><%else%><%staticname%><%endif%> +<%endif%> +<%endif%> + +NO_FULL_PATH=1 +<%if(exename || sharedname || staticname)%> +<%if(source_files)%> + +OBJFILES = \ +<%foreach(source_files)%> + $(OBJDIR)\<%basenoextension(source_file)%>.$(OBJ_EXT)<%fornotlast(" \\")%> +<%endfor%> +<%endif%> +<%endif%> +<%if(libpaths)%> + +LFLAGS = \ +<%if(linkflags)%> + <%linkflags%> \ +<%endif%> +<%if(StackReserveSize)%> + /S:<%StackReserveSize%> \ +<%endif%> +<%if(StackCommitSize)%> + /Sc:<%StackCommitSize%> \ +<%endif%> +<%foreach(libpaths)%> + -L"<%libpath%>" \ + -j"<%libpath%>" <%fornotlast(" \\")%> +<%endfor%> +<%endif%> +<%if(libs || lit_libs || pure_libs)%> + +LIBFILES = \ +<%foreach(pure_libs)%> + <%pure_lib%> \ +<%endfor%> +<%foreach(lit_libs)%> + <%lit_lib%>.lib \ +<%endfor%> +<%foreach(reverse(libs))%> + <%lib%>$(LIB_DECORATOR).lib \ +<%endfor%> + $(DUMMY_VALUE_NOT_ENDING_IN_BACKSLASH) +<%endif%> +<%if(rcdir)%> + +RESDIR = <%rcdir%> +<%endif%> +<%if(resource_files)%> + +RESOURCE =<%foreach(resource_files)%> $(OBJDIR)\<%basenoextension(resource_file)%>.res<%endfor%> + +<%if(includes)%> +RC_FLAGS = \ +<%foreach(includes)%> + -i"<%include%>"<%fornotlast(" \\")%> +<%endfor%> +<%endif%> + +<%endif%> + +!ifdef STATIC +<%if(staticflags)%> +LIB_FLAGS = \ +<%foreach(staticflags)%> + -D<%staticflag%><%fornotlast(" \\")%> +<%endfor%> +<%endif%> +!else +<%if(dynamicflags)%> +DLL_FLAGS = \ +<%foreach(dynamicflags)%> + -D<%dynamicflag%><%fornotlast(" \\")%> +<%endfor%> +<%endif%> +!endif + +CFLAGS = \ +<%if(pch_header)%> +<%foreach(pch_defines)%> +# Borland precompiled headers choke on several tao header files. +# For example, any place that uses ACE_LIB_TEXT(). +# -D<%pch_define%> \ +<%endfor%> +<%endif%> +<%if(compile_flags)%> + <%compile_flags%> \ +<%endif%> +<%foreach(macros)%> + -D<%macro%> \ +<%endfor%> +<%foreach(includes)%> + -I"<%include%>" \ +<%endfor%> + $(LIB_FLAGS) \ + $(DLL_FLAGS) +<%if(pch_header)%> + +# Borland precompiled headers choke on several tao header files. +# For example, any place that uses ACE_LIB_TEXT(). +#PCH_HEADER=<%pch_header%> +<%endif%> +<%if(cppdir)%> + +CPPDIR = <%cppdir%> +CDIR = <%cppdir%> +<%endif%> +<%if(header_files || template_files || inline_files || idl_files)%> + +INCDIR_NAME = <%relwd%> +<%endif%> +<%foreach(custom_types)%> + +# <%custom_type%> rules + +<%if(custom_type->libpath)%> +PATH := $(PATH);<%custom_type->libpath%> + +<%endif%> +<%foreach(custom_type->input_files)%> +<%if(custom_type->input_file->output_files)%> + +<%custom_type%>_<%forcount(custom_type->input_files)%>=<%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%> +$(<%custom_type%>_<%forcount(custom_type->input_files)%>): <%custom_type->input_file%> +<%if(flag_overrides(custom_type->input_file, gendir))%> + -if not exist <%flag_overrides(custom_type->input_file, gendir)%> mkdir <%flag_overrides(custom_type->input_file, gendir)%> 2> nul +<%endif%> + <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> <%custom_type->input_file%> <%if(custom_type->output_option)%><%custom_type->output_option%> $@<%endif%> +<%if(flag_overrides(custom_type->input_file, postcommand))%> +<%foreach(custom_type->input_file->output_files)%> + <%flag_overrides(custom_type->input_file, postcommand)%> +<%endfor%> +<%else%> +<%if(custom_type->postcommand)%> +<%foreach(custom_type->input_file->output_files)%> + <%custom_type->postcommand%> +<%endfor%> +<%endif%> +<%endif%> +<%if(pch_header)%> +<%if(custom_type->pch_postrule)%> +<%foreach(custom_type->input_file->source_output_files)%> + @echo #include "<%pch_header%>" > temporary.src + @type <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%> >> temporary.src + @move /y temporary.src <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>\<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%> +<%endfor%> +<%endif%> +<%endif%> + +all: $(<%custom_type%>_<%forcount(custom_type->input_files)%>) + +customclean_<%custom_type%>_<%forcount(custom_type->input_files)%>: + @del $(<%custom_type%>_<%forcount(custom_type->input_files)%>) 2>nul + +clean: customclean_<%custom_type%>_<%forcount(custom_type->input_files)%> + +realclean: customclean_<%custom_type%>_<%forcount(custom_type->input_files)%> + +<%endif%> +<%endfor%> +<%endfor%> + +# Override defaults in outputdir.bor +<%if(INSTALL_THIS_TARGET)%> +INSTALL_THIS_TARGET = 1 + +<%endif%> +<%marker(macros)%> +INCLUDES_INSTALL=1 +<%if(exename)%> + +<%if(install)%> +# We use BINDIR for install instead of BASE_BINDIR, because +# this is the location for all scripts too. +BINDIR = <%install%> +<%else%> +BASE_BINDIR = . +<%endif%> + +!include <$(ACE_ROOT)\include\makeinclude\build_exe.bor> +<%else%> +<%if(sharedname || staticname)%> +BINDIR = <%if(dllout)%><%dllout%><%else%><%libout%><%endif%> + +!include <$(ACE_ROOT)\include\makeinclude\build_library.bor> +<%else%> +INSTALL_TYPES = includes + +!include <$(ACE_ROOT)\include\makeinclude\install.bor> + +all: + @-rem +<%endif%> +<%endif%> +<%if(header_files || template_files || inline_files || idl_files || pidl_files)%> + +includes_install: $(INCLUDES) +<%foreach(header_files template_files inline_files idl_files pidl_files)%> + -@if not exist $(INSTALL_DIR)\include\$(INCDIR_NAME)\<%dirname(header_file)%> mkdir $(INSTALL_DIR)\include\$(INCDIR_NAME)\<%dirname(header_file)%> + -© /Y <%header_file%> $(INSTALL_DIR)\include\$(INCDIR_NAME)\<%header_file%> 1> NUL +<%endfor%> +<%else%> + +includes_install: + @echo Nothing to install. +<%endif%> + +realclean: + @-rem + +<%marker(bottom)%> diff --git a/ACE/bin/MakeProjectCreator/templates/bordll.mpt b/ACE/bin/MakeProjectCreator/templates/bordll.mpt new file mode 100644 index 00000000000..c6ff3fc925f --- /dev/null +++ b/ACE/bin/MakeProjectCreator/templates/bordll.mpt @@ -0,0 +1,8 @@ +// -*- MPC -*- +// $Id$ + +conditional_include "common" + +type_is_binary = 1 +type_is_dynamic = 1 +common_defines = WIN32 diff --git a/ACE/bin/MakeProjectCreator/templates/borexe.mpt b/ACE/bin/MakeProjectCreator/templates/borexe.mpt new file mode 100644 index 00000000000..da49b919bc7 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/templates/borexe.mpt @@ -0,0 +1,7 @@ +// -*- MPC -*- +// $Id$ + +conditional_include "common" + +type_is_binary = 1 +common_defines = WIN32 diff --git a/ACE/bin/MakeProjectCreator/templates/gnu.mpd b/ACE/bin/MakeProjectCreator/templates/gnu.mpd new file mode 100644 index 00000000000..89556b25636 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/templates/gnu.mpd @@ -0,0 +1,669 @@ +# -*- Makefile -*- +#---------------------------------------------------------------------------- +# GNU Makefile +# +# @file <%project_file%> +# +# $Id$ +# +# This file was automatically generated by MPC. Any changes made directly to +# this file will be lost the next time it is generated. +# +#---------------------------------------------------------------------------- +<%marker(top)%> +MAKEFILE = <%project_file%> +DEPENDENCY_FILE = .depend.<%project_name%> +<%if(exename)%> +BIN_UNCHECKED = <%exename%> +<%endif%> +<%if(staticname)%> + +## LIB may be set to empty later on in this file +LIB_UNCHECKED = lib<%libname_prefix%><%staticname%>.a +LIB = $(LIB_UNCHECKED) +LIB_NAME = lib<%libname_prefix%><%staticname%> +<%if(!sharedname)%> +static_libs_only = 1 +<%endif%> +<%endif%> +<%if(sharedname)%> + +## SHLIB may be set to empty later on in this file +SHLIB_UNCHECKED = lib<%libname_prefix%><%sharedname%>.$(SOEXT) +SHLIB = $(SHLIB_UNCHECKED) +<%endif%> +<%if(tao || ciao)%> + +TAO_ROOT ?= $(ACE_ROOT)/TAO +<%if(ciao)%> +CIAO_ROOT ?= $(TAO_ROOT)/CIAO +<%endif%> +<%endif%> + +<%if(grouped_source_files)%> +<%foreach(grouped_source_files)%> +<%grouped_source_file%> = \ +<%foreach(grouped_source_file->files)%> + <%grouped_source_file->file%><%fornotlast(" \\")%> +<%endfor%> + +<%endfor%> +FILES += \ +<%foreach(grouped_source_files)%> + $(<%grouped_source_file%>)<%fornotlast(" \\")%> +<%endfor%> + +<%else%> +FILES = \ +<%foreach(source_files)%> + <%source_file%><%fornotlast(" \\")%> +<%endfor%> + +<%endif%> +<%vpath%> +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- +<%marker(macros)%> +<%if(xerceslib)%> +XERCESLIB ?= <%xerceslib%> +<%endif%> +<%if(exename)%> +LDLIBS =<%foreach(libs)%> -l<%libname_prefix%><%lib%><%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%> +<%else%> +<%if(sharedname)%> +ACE_SHLIBS =<%foreach(libs)%> -l<%libname_prefix%><%lib%><%endfor%><%foreach(lit_libs)%> -l<%lit_lib%><%endfor%><%foreach(pure_libs)%> <%pure_lib%><%endfor%> +<%endif%> +<%endif%> +<%if(tao_idl)%> +TAO_IDL = <%tao_idl%> +<%endif%> +<%if(tao_idl_dep)%> +TAO_IDL_DEP = <%tao_idl_dep%>$(EXEEXT) +<%endif%> +<%if(tao_idlflags)%> +TAO_IDLFLAGS = <%tao_idlflags%> +<%endif%> +<%if(cidlc)%> +CIDLC = <%cidlc%> +<%endif%> +<%if(cidlc_dep)%> +CIDLC_DEP = <%cidlc_dep%>$(EXEEXT) +<%endif%> +<%if(cidlc_flags)%> +CIDLC_FLAGS = <%cidlc_flags%> +<%endif%> +<%if(xsc_bin)%> +XSC_BIN = <%xsc_bin%> +<%endif%> +<%if(xsc_dep)%> +XSC_DEP = <%xsc_dep%>$(EXEEXT) +<%endif%> +<%if(xsc_flags)%> +XSC_FLAGS = <%xsc_flags%> +<%endif%> +<%if(tao_idl3_to_idl2)%> +TAO_IDL3_TO_IDL2 = <%tao_idl3_to_idl2%> +<%endif%> +<%if(tao_idl3_to_idl2_dep)%> +TAO_IDL3_TO_IDL2_DEP = <%tao_idl3_to_idl2_dep%>$(EXEEXT) +<%endif%> + +<%if(exename)%> +PRJ_TYPE = rtp +<%else%> +PRJ_TYPE = library +<%endif%> + +<%if(exename)%> +<%if(install)%> +INSBIN ?= <%install%> +<%endif%> +ifeq ($(INSBIN),.) + ifeq ($(PWD),) + PWD=$(shell pwd) + endif + INSBIN = $(PWD)<%if(targetoutdir)%>/<%targetoutdir%><%endif%> +<%if(targetoutdir)%> +else + ifneq ($(INSBIN),) + INSBIN := $(INSBIN)/<%targetoutdir%> + endif +<%endif%> +endif +OUTPUT_DIRECTORY = $(INSBIN) +<%else%> +<%if(dllout || libout)%> +INSLIB ?= <%if(dllout)%><%dllout%><%else%><%libout%><%endif%> +<%endif%> +ifeq ($(INSLIB),.) + ifeq ($(PWD),) + PWD=$(shell pwd) + endif + INSLIB = $(PWD)<%if(targetoutdir)%>/<%targetoutdir%><%endif%> +<%if(targetoutdir)%> +else + INSLIB := $(INSLIB)/<%targetoutdir%> +<%endif%> +endif +OUTPUT_DIRECTORY = $(INSLIB) +<%endif%> + +<%if(targetoutdir)%> +VDIR = <%targetoutdir%>.obj/ +VSHDIR = <%targetoutdir%>.shobj/ + +<%endif%> +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +<%if(!dds && version)%> + +ifeq ($(versioned_so),1) + SOVERSION = .<%version%> +endif # versioned_so + +<%endif%> +<%if(dds)%> +include $(DDS_ROOT)/rules.dds.GNU +<%endif%> +<%if(ciao)%> +include $(CIAO_ROOT)/rules.ciao.GNU +<%endif%> +<%if(tao)%> +include $(TAO_ROOT)/rules.tao.GNU +<%endif%> + +<%if(resource_files)%> +ifneq (,$(RC)) +RESOURCES += \ +<%foreach(resource_files)%> + <%resource_file%><%fornotlast(" \\")%> +<%endfor%> +<%if(includes)%> + +RCFLAGS = \ +<%foreach(includes)%> + --include-dir=<%include%><%fornotlast(" \\")%> +<%endfor%> +<%endif%> +endif + +<%endif%> +# To build multiple targets in the same directory on AIX, it works +# best to have a template directory per project. +# The compiler/linker isn't too smart about instantiating templates... +ifdef TEMPINCDIR +TEMPINCDIR := $(TEMPINCDIR)/<%project_name%> +all: $(TEMPINCDIR) +endif + +ifneq ($(OUTPUT_DIRECTORY),) +all: $(OUTPUT_DIRECTORY) +$(OUTPUT_DIRECTORY): + -@$(MKDIR) "$(OUTPUT_DIRECTORY)" +endif + +<%if(sharedname || staticname || exename)%> +<%if(libs && libpaths)%> +# turn off libcheck if doing a dry run +ifeq ($(findstring n, $(MAKEFLAGS)),n) + LIBCHECK = 1 +else + # turn off libcheck if keep going was passed too + ifeq ($(findstring k, $(MAKEFLAGS)),k) + LIBCHECK = 1 + else + LIBCHECK ?= $(filter-out $(foreach lib,<%foreach(libs)%><%libname_prefix%><%lib%><%fornotlast(" ")%><%endfor%>,$(findstring $(lib),$(foreach libpath,<%foreach(libpaths)%><%if(targetoutdir)%><%libpath%>/<%targetoutdir%> <%endif%><%libpath%> <%endfor%>/usr/lib $(INSLIB),$(wildcard $(libpath)/lib$(lib).* $(libpath)/$(lib).lib)))),<%foreach(libs)%><%libname_prefix%><%lib%><%fornotlast(" ")%><%endfor%>) + ifeq ($(LIBCHECK),) + LIBCHECK = 1 + endif + endif +endif +<%else%> +LIBCHECK = 1 +<%endif%> +<%else%> +LIBCHECK = 1 +<%endif%> +<%if(!exename)%> +<%foreach(requires)%> +ifeq ($(<%require%>),1) +<%endfor%> +<%foreach(avoids)%> +ifneq ($(<%avoid%>),1) +<%endfor%> +ifneq ($(LIBCHECK), 1) +<%if(staticname)%> + LIB = +<%endif%> +<%if(sharedname)%> + SHLIB = +<%endif%> + all: lib_warning +endif +<%foreach(avoids)%> +else +<%if(staticname)%> + LIB = +<%endif%> +<%if(sharedname)%> + SHLIB = +<%endif%> + all: avoid_warning +endif +<%endfor%> +<%foreach(requires)%> +else +<%if(staticname)%> + LIB = +<%endif%> +<%if(sharedname)%> + SHLIB = +<%endif%> + all: require_warning +endif +<%endfor%> + +<%if(tagname)%> +ifeq (,$(<%tagname%>)) +<%endif%> +<%foreach(requires)%> +ifeq ($(<%require%>),1) +<%endfor%> +<%foreach(avoids)%> +ifneq ($(<%avoid%>),1) +<%endfor%> +<%foreach(avoids)%> +else +<%if(staticname)%> + LIB = +<%endif%> +<%if(sharedname)%> + SHLIB = +<%endif%> + all: avoid_warning +endif +<%endfor%> +<%foreach(requires)%> +else +<%if(staticname)%> + LIB = +<%endif%> +<%if(sharedname)%> + SHLIB = +<%endif%> + all: require_warning +endif +<%endfor%> +<%if(tagname)%> +else +<%foreach(requires)%> +ifeq ($(<%require%>),1) +<%endfor%> +<%foreach(avoids)%> +ifneq ($(<%avoid%>),1) +<%endfor%> +<%foreach(tagchecks)%> + ifeq (<%tagcheck%>, $(findstring <%tagcheck%>, $(<%tagname%>))) +<%endfor%> +<%foreach(tagchecks)%> + else + LIB = + SHLIB = + endif +<%endfor%> +<%foreach(avoids)%> +else + LIB = + SHLIB = + all: avoid_warning +endif +<%endfor%> +<%foreach(requires)%> +else + LIB = + SHLIB = + all: require_warning +endif +<%endfor%> +endif +<%endif%> +<%endif%> +<%if(exename)%> +<%foreach(requires)%> +ifeq ($(<%require%>),1) +<%endfor%> +<%foreach(avoids)%> +ifneq ($(<%avoid%>),1) +<%endfor%> +ifeq ($(LIBCHECK), 1) +BIN = $(BIN_UNCHECKED)$(EXEEXT) +else + all: lib_warning +endif +<%foreach(avoids)%> +else + all: avoid_warning +endif +<%endfor%> +<%foreach(requires)%> +else + all: require_warning +endif +<%endfor%> + +# If it contains ../ at all use notdir. +OBJS = $(foreach var, $(addsuffix .$(OBJEXT), $(basename $(FILES)) $(RESOURCES)), $(if $(findstring ../,$(var)),$(notdir $(var)),$(var))) +SRC = $(FILES) +<%endif%> +<%if(sharedname || staticname)%> +LSRC = $(FILES) +<%endif%> + +<%marker(circuit)%> +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +<%if(exename)%> + +ifneq ($(OUTPUT_DIRECTORY),) +ifneq ($(OUTPUT_DIRECTORY),.) + INSTALL = $(VBIN:%=$(INSBIN)/%) + CLEANUP_INSTALL += $(CLEANUP_BIN:%=$(INSBIN)/%$(VAR)$(EXEEXT)) +endif +endif + +<%endif%> +<%if(sharedname || staticname)%> +include $(ACE_ROOT)/include/makeinclude/rules.lib.GNU +<%endif%> +<%if(pch_source)%> + +ACE_PCH_SOURCE = <%pch_source%> +ACE_PCH_FILE = <%basename(pch_header)%>.gch + +ifeq ($(pchsupport),1) +<%if(pch_defines)%> +CPPFLAGS +=<%foreach(pch_defines)%> -D<%pch_define%><%endfor%> +<%endif%> + +$(addprefix $(VDIR), $(OBJS)): $(VDIR)$(ACE_PCH_FILE) +$(VSHOBJS): $(VSHDIR)$(ACE_PCH_FILE) +endif + +<%endif%> +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU +ifeq ($(VXWORKSLINK),1) +include $(TGT_DIR)/h/make/rules.$(PRJ_TYPE) +endif + +<%foreach(source_files)%> +<%if(flag_overrides(source_file, buildflags))%> +$(VDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%> + @$(MKDIR) $(VDIR)<%dirname(source_file)%> + <%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%flag_overrides(source_file, buildflags)%> $(ACE_USE_PCH_OPT) $(CC_OUTPUT_FLAG) $@ $< + ${MVCMD} + +ifneq ($(VSHDIR), $(VDIR)) +$(VSHDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%> + @$(MKDIR) $(VSHDIR)<%dirname(source_file)%> + <%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%flag_overrides(source_file, buildflags)%> $(ACE_USE_PCH_OPT) $(PIC) $(CC_OUTPUT_FLAG) $@ $< +endif + +<%else%> +<%if(dirname(source_file) && !contains(source_file, \.\./))%> +<%if(starts_with(source_file, \$) || !ends_with(source_file, \.cpp))%> +$(VDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%> + @$(MKDIR) $(VDIR)<%dirname(source_file)%> + <%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(ACE_USE_PCH_OPT) $(CC_OUTPUT_FLAG) $@ $< + ${MVCMD} + +ifneq ($(VSHDIR), $(VDIR)) +$(VSHDIR)<%noextension(source_file)%>.$(OBJEXT): <%source_file%> + @$(MKDIR) $(VSHDIR)<%dirname(source_file)%> + <%if(ends_with(source_file, \.c))%>$(COMPILE.c)<%else%>$(COMPILE.cc)<%endif%> <%if(flag_overrides(source_file, buildflags))%><%flag_overrides(source_file, buildflags)%> <%endif%>$(ACE_USE_PCH_OPT) $(PIC) $(CC_OUTPUT_FLAG) $@ $< +endif + +<%endif%> +<%endif%> +<%endif%> +<%endfor%> +<%if(libpaths)%> +ifeq ($(VXWORKSLINK),1) +LDLIBPATH =<%foreach(libpaths)%> <%if(targetoutdir)%>-L<%libpath%>/<%targetoutdir%> <%endif%>-L<%libpath%><%endfor%><%if(linkflags)%> <%linkflags%><%endif%> +else +LDFLAGS +=<%foreach(libpaths)%> <%if(targetoutdir)%>-L<%libpath%>/<%targetoutdir%> <%endif%>-L<%libpath%><%endfor%><%if(linkflags)%> <%linkflags%><%endif%> +endif +<%endif%> +<%if(includes)%> +CPPFLAGS +=<%foreach(includes)%> -I<%include%><%endfor%> +<%endif%> +<%if(macros)%> +CPPFLAGS +=<%foreach(macros)%> -D<%macro%><%endfor%> +<%endif%> +<%if(compile_flags)%> +CPPFLAGS += <%compile_flags%> +<%endif%> +<%if(dynamicflags)%> +ifeq ($(shared_libs),1) + ifneq ($(SHLIB),) + CPPFLAGS +=<%foreach(dynamicflags)%> -D<%dynamicflag%><%endfor%> + endif +endif +<%endif%> +<%if(staticflags)%> +ifeq ($(static_libs),1) + CPPFLAGS +=<%foreach(staticflags)%> -D<%staticflag%><%endfor%> +<%if(exename)%> + ifeq ($(link_groups), 1) + LDLIBS := -Wl,--start-group $(LDLIBS) -Wl,--end-group + endif +<%endif%> +endif +<%endif%> + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- +<%marker(local)%> +lib_warning: + @echo <%project_name%> will not be built due to the following missing library: + @echo $(LIBCHECK) + +<%if(requires)%> +require_warning: + @echo <%project_name%> will not be built due to one of the following disabled make macros: + @echo<%foreach(requires)%> <%require%><%endfor%> + +<%endif%> +<%if(avoids)%> +avoid_warning: + @echo <%project_name%> will not be built due to one of the following enabled make macros: + @echo<%foreach(avoids)%> <%avoid%><%endfor%> + +<%endif%> +<%if(custom_types)%> +## Some OS's have /bin/test others only have /usr/bin/test +ifeq ($(wildcard /bin/test), /bin/test) + TEST_EXE = /bin/test +else +ifeq ($(wildcard /usr/bin/test), /usr/bin/test) + TEST_EXE = /usr/bin/test +endif +endif + +<%foreach(custom_types)%> +<%if(custom_type->libpath)%> +DYLD_LIBRARY_PATH := $(DYLD_LIBRARY_PATH):<%custom_type->libpath%> +LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):<%custom_type->libpath%> +SHLIB_PATH := $(SHLIB_PATH):<%custom_type->libpath%> +LIBPATH := $(LIBPATH):<%custom_type->libpath%> +PATH := $(PATH):<%custom_type->libpath%> + +<%endif%> +<%foreach(custom_type->input_files)%> +<%if(custom_type->input_file->output_files)%> +GENERATED_DIRTY +=<%foreach(custom_type->input_file->output_files)%> <%if(flag_overrides(custom_type->input_file, gendir))%><%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%><%flag_overrides(custom_type->input_file, gendir)%>/<%endif%><%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%endfor%> +<%if(custom_type->input_file->non_source_output_files)%> +OBJS_DEPEND_ON_GENERATED = 1 +<%endif%> +<%foreach(custom_type->input_file->output_files)%> +<%if(forlast && !forfirst)%> +## More than one file is generated by the command and therefore +## it can not be run in parallel. Unfortunately, there is no way to +## say that only this rule can't be run in parallel. However, we can +## determine if the generated files have already been generated. If that's +## the case, then we don't need this special rule. +ifeq ($(wildcard $(GENERATED_DIRTY)), $(GENERATED_DIRTY)) + ## If we can find /bin/test, then we will continue + ifneq ($(TEST_EXE),) + ## If all of the generated files are there, then we need to check + ## and make sure that the generated files are up-to-date. If they are not + ## then we need the special rule. + ifneq ($(shell<%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) <%custom_type->input_file%> -nt <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%> 2> /dev/null &&<%endfor%> echo 0),) + .NOTPARALLEL: +<%if(flag_overrides(custom_type->input_file, dependent))%> + else + ## By this point, all of the generated files are here and up-to-date + ## with respect to the source file. Now we need to make sure that + ## they are up-to-date with respect to the generation tool. If the tool + ## is newer than the generated files, then we need the special rule. + ifneq ($(shell<%foreach(dep, flag_overrides(custom_type->input_file, dependent))%><%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) <%dep%> -nt <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%> 2> /dev/null &&<%endfor%><%endfor%> echo 0),) + .NOTPARALLEL: + endif +<%else%> +<%if(custom_type->dependent)%> + else + ## By this point, all of the generated files are here and up-to-date + ## with respect to the source file. Now we need to make sure that + ## they are up-to-date with respect to the generation tool. If the tool + ## is newer than the generated files, then we need the special rule. + ifneq ($(shell<%foreach(custom_type->dependent)%><%foreach(custom_type->input_file->output_files)%> $(TEST_EXE) <%custom_type->dependent%> -nt <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%> 2> /dev/null &&<%endfor%><%endfor%> echo 0),) + .NOTPARALLEL: + endif +<%endif%> +<%endif%> + endif + else + .NOTPARALLEL: + endif +else +.NOTPARALLEL: +endif +<%endif%> +<%endfor%> +<%foreach(custom_type->input_file->output_files)%><%if(flag_overrides(custom_type->input_file, gendir))%><%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%><%flag_overrides(custom_type->input_file, gendir)%>/<%endif%><%basename(custom_type->input_file->output_file)%><%else%><%custom_type->input_file->output_file%><%endif%><%fornotlast(" ")%><%endfor%>: <%custom_type->input_file%><%if(custom_type->input_file->dependencies)%> <%custom_type->input_file->dependencies%><%endif%><%if(flag_overrides(custom_type->input_file, dependent))%> <%flag_overrides(custom_type->input_file, dependent)%><%else%><%if(custom_type->dependent)%> <%custom_type->dependent%><%endif%><%endif%> +<%if(flag_overrides(custom_type->input_file, gendir))%> +<%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%> + $(MKDIR) <%flag_overrides(custom_type->input_file, gendir)%> +<%endif%> +<%endif%> + <%if(flag_overrides(custom_type->input_file, command))%><%flag_overrides(custom_type->input_file, command)%><%else%><%custom_type->command%><%endif%> <%if(flag_overrides(custom_type->input_file, commandflags))%><%flag_overrides(custom_type->input_file, commandflags)%><%else%><%custom_type->commandflags%><%endif%> <%if(custom_type->output_option)%><%custom_type->input_file%> <%custom_type->output_option%> $@<%else%><%custom_type->input_file%><%endif%> +<%if(flag_overrides(custom_type->input_file, postcommand))%> +<%foreach(custom_type->input_file)%> + <%flag_overrides(custom_type->input_file, postcommand)%> +<%endfor%> +<%else%> +<%if(custom_type->postcommand)%> +<%foreach(custom_type->input_file)%> + <%custom_type->postcommand%> +<%endfor%> +<%endif%> +<%endif%> +<%if(pch_header)%> +<%if(custom_type->pch_postrule)%> +<%foreach(custom_type->input_file->source_output_files)%> + @echo '#include "<%pch_header%>"' > temp.$$$$ && cat <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%> >> temp.$$$$ && mv temp.$$$$ <%if(flag_overrides(custom_type->input_file, gendir))%><%flag_overrides(custom_type->input_file, gendir)%>/<%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%> +<%endfor%> +<%endif%> +<%endif%> + +<%endif%> +<%endfor%> +<%endfor%> +ifneq ($(GENERATED_DIRTY),) +.PRECIOUS: $(GENERATED_DIRTY) +<%if(source_files)%> +## If the generated files are anything but source files, we need to +## ensure that those files are generated before we attempt to build anything +## else. +ifeq ($(OBJS_DEPEND_ON_GENERATED),1) +$(VDIR)$(ACE_PCH_FILE) $(addprefix $(VDIR), $(OBJS)): $(GENERATED_DIRTY) +$(VSHDIR)$(ACE_PCH_FILE) $(VSHOBJS): $(GENERATED_DIRTY) +endif +<%else%> +<%foreach(requires)%> +ifeq ($(<%require%>),1) +<%endfor%> +<%foreach(avoids)%> +ifneq ($(<%avoid%>),1) +<%endfor%> +all: $(GENERATED_DIRTY) +<%foreach(avoids)%> +endif +<%endfor%> +<%foreach(requires)%> +endif +<%endfor%> +<%endif%> +endif + +<%endif%> +<%if(idl_files)%> +ADDITIONAL_IDL_TARGETS +=<%foreach(idl_files)%> <%if(flag_overrides(idl_file, gendir))%><%if(!compares(flag_overrides(idl_file, gendir),.))%><%flag_overrides(idl_file, gendir)%>/<%endif%><%basenoextension(idl_file)%>$(IDL_CLIENT_HDR_EXT)<%else%><%noextension(idl_file)%>$(IDL_CLIENT_HDR_EXT)<%endif%><%endfor%> +idl_stubs: $(ADDITIONAL_IDL_TARGETS) +<%if(source_files)%> + +# This assignment forces make to run the idl_stubs +# target before building any of the source files. +FORCED_IDL_STUBS = <%source_files%> <%if(pch_source)%>$(ACE_PCH_SOURCE)<%endif%> +<%foreach(custom_types)%> +<%foreach(custom_type->input_files)%> +<%if(custom_type->input_file->source_output_files)%> +<%foreach(custom_type->input_file->source_output_files)%> +FORCED_IDL_STUBS := $(FORCED_IDL_STUBS:<%if(flag_overrides(custom_type->input_file, gendir))%><%if(!compares(flag_overrides(custom_type->input_file, gendir),.))%><%flag_overrides(custom_type->input_file, gendir)%>/<%endif%><%basename(custom_type->input_file->source_output_file)%><%else%><%custom_type->input_file->source_output_file%><%endif%>=) +<%endfor%> +<%endif%> +<%endfor%> +<%endfor%> + +ifneq ($(FORCED_IDL_STUBS),) +$(FORCED_IDL_STUBS): idl_stubs +endif +<%endif%> +<%endif%> +<%if(exename)%> + +ifneq ($(VXWORKSLINK),1) +<%if(libs && libpaths)%> +ifeq ($(static_libs_only), 1) + ifeq ($(use_dep_libs), 1) + DEPLIBS = $(foreach lib,<%foreach(libs)%> <%libname_prefix%><%lib%><%endfor%> <%lit_libs%>, $(foreach libpath,<%foreach(libpaths)%><%if(targetoutdir)%> <%libpath%>/<%targetoutdir%><%endif%> <%libpath%><%endfor%>, $(wildcard $(libpath)/lib$(lib).a))) + endif +endif + +<%endif%> +$(BIN): $(addprefix $(VDIR), $(OBJS)) $(DEPLIBS) + $(LINK.cc) $(LDFLAGS) $(CC_OUTPUT_FLAG) $@ $^ $(VLDLIBS) $(POSTLINK) +endif +<%endif%> + +realclean: clean +ifneq ($(GENERATED_DIRTY),) + -$(RM) -r $(GENERATED_DIRTY) +endif + +__prebuild__: +<%if(prebuild)%> + @<%eval(prebuild)%> +<%else%> + @-: +<%endif%> + +<%if(postbuild)%> +all: __postbuild__ + +__postbuild__: + @<%eval(postbuild)%> + +<%endif%> +<%marker(bottom)%> diff --git a/ACE/bin/MakeProjectCreator/templates/gnudll.mpt b/ACE/bin/MakeProjectCreator/templates/gnudll.mpt new file mode 100644 index 00000000000..c5fa1017803 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/templates/gnudll.mpt @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +conditional_include "common" + +targetoutdir = diff --git a/ACE/bin/MakeProjectCreator/templates/gnuexe.mpt b/ACE/bin/MakeProjectCreator/templates/gnuexe.mpt new file mode 100644 index 00000000000..2b595402d86 --- /dev/null +++ b/ACE/bin/MakeProjectCreator/templates/gnuexe.mpt @@ -0,0 +1,4 @@ +// -*- MPC -*- +// $Id$ + +conditional_include "gnudll" diff --git a/ACE/bin/Makefile.am b/ACE/bin/Makefile.am new file mode 100644 index 00000000000..67c37859131 --- /dev/null +++ b/ACE/bin/Makefile.am @@ -0,0 +1,40 @@ +## Process this file with automake to create Makefile.in +## +## $Id$ +## +## This file was generated by MPC. Any changes made directly to +## this file will be lost the next time it is generated. +## +## MPC Command: +## bin/mwc.pl -type automake -noreldefs -features ssl=1,qos=1 ACE.mwc + +ACE_BUILDDIR = $(top_builddir) +ACE_ROOT = $(top_srcdir) + +SUBDIRS = \ + . \ + PerlACE + +## Makefile.bin.am + +noinst_SCRIPTS = auto_run_tests.pl ace_tests.lst + +noinst_PROGRAMS = envinfo + +envinfo_CPPFLAGS = \ + -I$(ACE_ROOT) \ + -I$(ACE_BUILDDIR) + +envinfo_SOURCES = \ + envinfo.cpp + +envinfo_LDADD = \ + $(ACE_BUILDDIR)/ace/libACE.la + +## Clean up template repositories, etc. +clean-local: + -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* + -rm -f gcctemp.c gcctemp so_locations *.ics + -rm -rf cxx_repository ptrepository ti_files + -rm -rf templateregistry ir.out + -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/ACE/bin/PerlACE/ConfigList.pm b/ACE/bin/PerlACE/ConfigList.pm new file mode 100644 index 00000000000..023e2f8cc9c --- /dev/null +++ b/ACE/bin/PerlACE/ConfigList.pm @@ -0,0 +1,176 @@ +# $Id$ + +package PerlACE::ConfigList; +use strict; +use FileHandle; + +@PerlACE::ConfigList::Configs = (); +@PerlACE::ConfigList::Excludes = (); + +my @new_argv = (); + +for(my $i = 0; $i <= $#ARGV; ++$i) { + if ($ARGV[$i] eq '-Config') { + if (defined $ARGV[$i + 1]) { + push @PerlACE::ConfigList::Configs, $ARGV[++$i]; + } + else { + print STDERR "You must pass a configuration with -Config\n"; + exit(1); + } + } + elsif ($ARGV[$i] eq '-Exclude') { + if (defined $ARGV[$i + 1]) { + push @PerlACE::ConfigList::Excludes, $ARGV[++$i]; + } + else { + print STDERR "You must pass an exclude pattern with -Exclude\n"; + exit(1); + } + } + else { + push @new_argv, $ARGV[$i]; + } +} +@ARGV = @new_argv; + + +sub new () +{ + my $self = {}; + @{$self->{MY_CONFIGS}} = @PerlACE::ConfigList::Configs; + bless $self; + return $self; +} + +sub my_config_list +{ + my $self = shift; + if (@_) { @{$self->{MY_CONFIGS}} = @_; } + return @{$self->{MY_CONFIGS}}; +} + +sub add_one_config ($) +{ + my $self = shift; + my $newconfig = shift; + push @{$self->{MY_CONFIGS}}, $newconfig; +} + +sub check_config (@) +{ + my $self = shift; + my @testconfigs = @_; + my $the_config_allows_this = 1; # default case is true + + # Go though each ID on the line in turn... + foreach my $config (@testconfigs) { + my $required_found = !($config =~ /^\w/); + foreach my $myconfig (@{$self->{MY_CONFIGS}}) { + if ($config eq "!$myconfig") { $the_config_allows_this = 0; } + if ($config eq $myconfig) { $required_found = 1; } + } + if (!$required_found) { $the_config_allows_this = 0; } + } + return $the_config_allows_this; +} + +sub load ($) +{ + my $self = shift; + my $filename = shift; + + my $fh = new FileHandle; + if (!$fh->open ("< $filename")) { + print STDERR "Could not open $filename: $!\n"; + exit (1); + } + + while (<$fh>) { + chomp; + if (/^\s*$/ || /^#/) { + next; + } + # compress white space + s/\s+/ /g; + + my $entry = ''; + my $configs = ''; + + ($entry, $configs) = split /:/; + + # remove trailing white spaces + $entry =~ s/\s+$//; + + push @{$self->{ENTRIES}}, $entry; + if (defined $configs) { + @{$self->{CONFIGS}->{$entry}} = split (" ", $configs); + } + } + + $fh->close (); +} + +sub valid_entries () +{ + my $self = shift; + my @entries = (); + my $exclude = 0; + + foreach my $entry (@{$self->{ENTRIES}}) { + $exclude = 0; + foreach my $expat (@PerlACE::ConfigList::Excludes) { + if ($entry =~ /$expat/) { + $exclude = 1; + last; + } + } + if (!$exclude && $self->check_config (@{$self->{CONFIGS}->{$entry}})) { + push @entries, $entry; + } + } + return @entries; +} + +sub list_configs () +{ + my $self = shift; + my %allconfigs = {}; + my $list = ''; + + foreach my $entry (@{$self->{ENTRIES}}) { + + foreach my $config (@{$self->{CONFIGS}->{$entry}}) { + $config =~ s/!//g; + if ($allconfigs{$config} != 1) { + $list .= $config.' '; + $allconfigs{$config} = 1; + } + } + } + + return $list; +} + +sub dump () +{ + my $self = shift; + + print "============================================================\n"; + print "Config\n"; + foreach my $config (@{$self->{MY_CONFIGS}}) { + print $config, "\n"; + } + print "\n"; + print "Entries\n"; + foreach my $entry (@{$self->{ENTRIES}}) { + print "- ", $entry, ": "; + foreach my $config (@{$self->{CONFIGS}->{$entry}}) { + print $config, " "; + } + print "\n"; + } + print "============================================================\n"; +} + +1; diff --git a/ACE/bin/PerlACE/MSProject.pm b/ACE/bin/PerlACE/MSProject.pm new file mode 100644 index 00000000000..86e6548456a --- /dev/null +++ b/ACE/bin/PerlACE/MSProject.pm @@ -0,0 +1,393 @@ +# $Id$ + +package PerlACE::MSProject; + +use strict; +use FileHandle; + +############################################################################### + +# Constructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + + $self->{FILENAME} = shift; + $self->{VERSION} = undef; + $self->{NAME} = undef; + %{$self->{CONFIGS}} = (); + + bless ($self, $class); + return $self; +} + +############################################################################### + +# Accessors + +sub Filename +{ + my $self = shift; + + if (@_ != 0) { + $self->{FILENAME} = shift; + } + + return $self->{FILENAME}; +} + +sub Version () +{ + my $self = shift; + return $self->{VERSION}; +} + +sub Name () +{ + my $self = shift; + return $self->{NAME}; +} + +sub Configs () +{ + my $self = shift; + return keys %{$self->{CONFIGS}}; +} + +sub DepOutputFile ($) +{ + my $self = shift; + my $config = shift; + + if (!defined $config) { + print STDERR "Error: No configuration specified\n"; + return; + } + + my $name = $self->OutputFile ($config); + + if ($name =~ m/\.dll$/) { + $name = $self->LibraryFile ($config); + } + + $name =~ s/.*\\//; # / <- For devenv + $name =~ s/.*\///; + + return $name; +} + +sub OutputFile ($) +{ + my $self = shift; + my $config = shift; + + if (!defined $config) { + print STDERR "Error: No configuration specified\n"; + return; + } + + if (%{$self->{CONFIGS}}->{$config}->{LINK} =~ m/out\:\"([^\"]*)\"/) { + return $1; + } + elsif (defined $self->Name ()) { + my $filename = $self->Filename; + my $ext = ""; + + if (%{$self->{CONFIGS}}->{$config}->{LINK} =~ m/\/dll/) { + $ext = ".dll"; + } + elsif (%{$self->{CONFIGS}}->{$config}->{LINK} =~ m/\/subsystem\:/) { + $ext = ".exe"; + } + else { + $ext = ".lib"; + } + + $filename =~ s/\.[^\.]*$/$ext/; + return $filename; + } +} + + +sub LibraryFile ($) +{ + my $self = shift; + my $config = shift; + my $dll = undef; + + if (!defined $config) { + print STDERR "Error: No configuration specified\n"; + return; + } + + if ($self->OutputFile ($config) =~ m/([^\/\\]*)\.dll$/i) { + $dll = $1; + } + + if (defined $dll) { + if (%{$self->{CONFIGS}}->{$config}->{LINK} =~ m/implib\:\"([^\"]*)\"/i) { + return $1; + } + else { + $dll =~ s/.*\\//ig; # / <- Just here to fix color coding in devenv beta + return $self->OutputDir ($config). $dll . ".lib"; + } + } +} + +sub OutputDir ($) +{ + my $self = shift; + my $config = shift; + + if (!defined $config) { + print STDERR "Error: No configuration specified\n"; + return; + } + + return %{$self->{CONFIGS}}->{$config}->{OUTPUTDIR}; +} + +sub IntermidiateDir ($) +{ + my $self = shift; + my $config = shift; + + if (!defined $config) { + print STDERR "Error: No configuration specified\n"; + return; + } + + return %{$self->{CONFIGS}}->{$config}->{INTERMEDIATEDIR}; +} + +sub TargetDir ($) +{ + my $self = shift; + my $config = shift; + + if (!defined $config) { + print STDERR "Error: No configuration specified\n"; + return; + } + + return %{$self->{CONFIGS}}->{$config}->{TARGETDIR}; +} + +sub CPPOptions ($) +{ + my $self = shift; + my $config = shift; + + if (!defined $config) { + print STDERR "Error: No configuration specified\n"; + return; + } + + return %{$self->{CONFIGS}}->{$config}->{CPP}; +} + +sub LINKOptions ($) +{ + my $self = shift; + my $config = shift; + + if (!defined $config) { + print STDERR "Error: No configuration specified\n"; + return; + } + + return %{$self->{CONFIGS}}->{$config}->{LINK}; +} + +sub Libs($) +{ + my $self = shift; + my $config = shift; + + if (!defined $config) { + print STDERR "Error: No configuration specified\n"; + return; + } + + return %{$self->{CONFIGS}}->{$config}->{LIBS}; +} + +sub UsesTAOIDL () +{ + my $self = shift; + + return $self->{TAOIDL}; +} + +sub Compiler () +{ + my $self = shift; + + return $self->{COMPILER}; +} + +############################################################################### + +# Big methods + +sub Load () +{ + my $self = shift; + my $config = "Unknown"; + + $self->{valid} = 0; + + my $fh = new FileHandle; + + unless ($fh->open ("<" . $self->{FILENAME})) { + print "Could not open file ", $self->{FILENAME}, ": ", $_; + return; + } + + while (<$fh>) { + if (m/^\#.*Project File - Name=\"([^\"]*)\"/) { + $self->{NAME} = $1; + } + + if (m/^\#.*Format Version (.*)/) { + $self->{VERSION} = $1; + } + + # Check for configurations + + if (m/^\!.*IF \"\$\(CFG\)\" == \".* - (.*)$\"/) { + $config = $1; + } + elsif (m/^\!ENDIF$/) { + $config = ""; + } + + # Check for directories + + if (m/\# PROP Output_Dir \"(.*)\"/) { + %{$self->{CONFIGS}}->{$config}->{OUTPUTDIR} = $1; + } + elsif (m/\# PROP Intermediate_Dir \"(.*)\"/) { + %{$self->{CONFIGS}}->{$config}->{INTERMEDIATEDIR} = $1; + } + elsif (m/\# PROP Target_Dir \"(.*)\"/) { + %{$self->{CONFIGS}}->{$config}->{TARGETDIR} = $1; + } + + # Look at CPP options + + if (m/\# ADD BASE CPP(.*)$/ || m/\# ADD CPP(.*)$/) { + my @flags = split (/ \//, $1); + + foreach my $flag (@flags) { + if ($flag && %{$self->{CONFIGS}}->{$config}->{CPP} !~ m/$flag/) { + %{$self->{CONFIGS}}->{$config}->{CPP} .= " /$flag"; + } + } + } + elsif (m/\# SUBTRACT CPP(.*)$/ || m/\# SUBTRACT BASE CPP(.*)$/) { + my @flags = split (/ \//, $1); + + foreach my $flag (@flags) { + if ($flag && %{$self->{CONFIGS}}->{$config}->{CPP} =~ m/$flag/) { + %{$self->{CONFIGS}}->{$config}->{CPP} =~ s/ \/$flag//g; + } + } + } + + # Look at LINK32 options + + if (m/\# ADD BASE LINK32(.*)$/ || m/\# ADD LINK32(.*)$/ + || m/\# ADD BASE LIB32(.*)$/ || m/\# ADD LIB32(.*)$/) { + my @flags = split (/ \//, $1); + + foreach my $flag (@flags) { + my $found = 0; + my @libs = split (/ /, $flag); + + foreach my $lib (@libs) { + if ($lib =~ m/\.lib$/) { + if (%{$self->{CONFIGS}}->{$config}->{LIBS} !~ m/\Q$lib\E/) { + %{$self->{CONFIGS}}->{$config}->{LIBS} .= " $lib"; + } + $found = 1; + } + } + + if (!$found && $flag) { + my $shortflag = $flag; + if ($flag =~ m/^(.*)\:/) { + $shortflag = $1; + } + + if (%{$self->{CONFIGS}}->{$config}->{LINK} !~ m/ \/$shortflag/) { + %{$self->{CONFIGS}}->{$config}->{LINK} .= " /$flag"; + } + } + } + } + elsif (m/\# SUBTRACT BASE LINK32(.*)$/ || m/\# SUBTRACT LINK32(.*)$/ + || m/\# SUBTRACT BASE LIB32(.*)$/ || m/\# SUBTRACT LIB32(.*)$/) { + my @flags = split (/ \//, $1); + + foreach my $flag (@flags) { + my $shortflag = $flag; + if ($flag =~ m/^(.*)\:/) { + $shortflag = $1; + } + + if ($flag && %{$self->{CONFIGS}}->{$config}->{LINK} =~ m/ (\/$shortflag\:[^ ]*)/) { + %{$self->{CONFIGS}}->{$config}->{LINK} =~ s/ \Q$1\E//ig; + } + } + } + + if (m/^\# Name \".* - (.*)\"/ && defined %{$self->{CONFIGS}}->{"Unknown"}) { + %{$self->{CONFIGS}}->{$1} = %{$self->{CONFIGS}}->{"Unknown"}; + delete %{$self->{CONFIGS}}->{"Unknown"}; + } + + if (m/tao\_idl/ && m/\$\(InputName\)\.idl/ || m/tao\_idl/ && m/\$\(InputPath\)/) { + $self->{TAOIDL} = 1; + } + } + $fh->close (); + $self->{valid} = 1; +} + +############################################################################### + +# Build functions + +sub Build ($) +{ + my $self = shift; + my ($config) = @_; + + my $command = $self->Compiler () . " " . $self->Filename () + . " /USEENV" + . " /MAKE \"" . $self->Name () + . " - " . $config . "\""; + + system $command; +} + +sub Clean ($) +{ + my $self = shift; + my ($config) = @_; + + my $command = $self->Compiler () . " " . $self->Filename () + . " /USEENV" + . " /MAKE \"" . $self->Name () + . " - " . $config . "\" /CLEAN"; + + system $command; +} + + +1;
\ No newline at end of file diff --git a/ACE/bin/PerlACE/MSProject/DSP.pm b/ACE/bin/PerlACE/MSProject/DSP.pm new file mode 100644 index 00000000000..b7ca0276a82 --- /dev/null +++ b/ACE/bin/PerlACE/MSProject/DSP.pm @@ -0,0 +1,28 @@ +# $Id$ + +package PerlACE::MSProject::DSP; + +use strict; +use PerlACE::MSProject; + +our @ISA = ("PerlACE::MSProject"); + +############################################################################### + +# Constructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = $class->SUPER::new (@_); + + $self->{COMPILER} = "msdev.com"; + + bless ($self, $class); + return $self; +} + +############################################################################### + +1;
\ No newline at end of file diff --git a/ACE/bin/PerlACE/MSProject/VCP.pm b/ACE/bin/PerlACE/MSProject/VCP.pm new file mode 100644 index 00000000000..8377d22788b --- /dev/null +++ b/ACE/bin/PerlACE/MSProject/VCP.pm @@ -0,0 +1,30 @@ +# $Id$ + +package PerlACE::MSProject::VCP; + +use strict; +use PerlACE::MSProject; + +our @ISA = ("PerlACE::MSProject"); + +############################################################################### + +# Constructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = $class->SUPER::new (@_); + + $self->{COMPILER} = "evc.com"; + + bless ($self, $class); + return $self; +} + +############################################################################### + +# Accessors + +1;
\ No newline at end of file diff --git a/ACE/bin/PerlACE/Makefile.am b/ACE/bin/PerlACE/Makefile.am new file mode 100644 index 00000000000..d02bf527aa5 --- /dev/null +++ b/ACE/bin/PerlACE/Makefile.am @@ -0,0 +1,23 @@ +## Process this file with automake to create Makefile.in +## +## $Id$ +## +## This file was generated by MPC. Any changes made directly to +## this file will be lost the next time it is generated. +## +## MPC Command: +## /acebuilds/ACE_wrappers-repository/bin/mwc.pl -include /acebuilds/MPC/config -include /acebuilds/MPC/templates -feature_file /acebuilds/ACE_wrappers-repository/local.features -noreldefs -type automake -exclude build,Kokyu + + +## Makefile.PerlACE.am + +noinst_SCRIPTS = ConfigList.pm Process.pm Process_Unix.pm Process_Win32.pm Run_Test.pm + + +## Clean up template repositories, etc. +clean-local: + -rm -f *~ *.bak *.rpo *.sym lib*.*_pure_* core core.* + -rm -f gcctemp.c gcctemp so_locations *.ics + -rm -rf cxx_repository ptrepository ti_files + -rm -rf templateregistry ir.out + -rm -rf ptrepository SunWS_cache Templates.DB diff --git a/ACE/bin/PerlACE/Process.pm b/ACE/bin/PerlACE/Process.pm new file mode 100644 index 00000000000..130df8166c5 --- /dev/null +++ b/ACE/bin/PerlACE/Process.pm @@ -0,0 +1,65 @@ +# $Id$ + +package PerlACE::Process; + +use strict; +use English; +use POSIX qw(:time_h); + +$PerlACE::Process::ExeSubDir = './'; + +sub delay_factor { + my($lps) = 128; + my($factor) = 1; + + ## Keep increasing the loops per second until the amount of time + ## exceeds the number of clocks per second. The original code + ## did not multiply $ticks by 8 but, for faster machines, it doesn't + ## seem to return false values. The multiplication is done to minimize + ## the amount of time it takes to determine the correct factor. + while(($lps <<= 1)) { + my($ticks) = clock(); + for(my $i = $lps; $i >= 0; $i--) { + } + $ticks = clock() - $ticks; + if ($ticks * 8 >= CLOCKS_PER_SEC) { + $factor = 500000 / (($lps / $ticks) * CLOCKS_PER_SEC); + last; + } + } + + return $factor; +} + +### Check for -ExeSubDir commands, store the last one +my @new_argv = (); + +for(my $i = 0; $i <= $#ARGV; ++$i) { + if ($ARGV[$i] eq '-ExeSubDir') { + if (defined $ARGV[$i + 1]) { + $PerlACE::Process::ExeSubDir = $ARGV[++$i].'/'; + } + else { + print STDERR "You must pass a directory with ExeSubDir\n"; + exit(1); + } + } + else { + push @new_argv, $ARGV[$i]; + } +} +@ARGV = @new_argv; + +$PerlACE::Process::WAIT_DELAY_FACTOR = $ENV{"ACE_RUNTEST_DELAY"}; + +if ($OSNAME eq "MSWin32") { + require PerlACE::Process_Win32; +} +elsif ($OSNAME eq "VMS") { + require PerlACE::Process_VMS; +} +else { + require PerlACE::Process_Unix; +} + +1; diff --git a/ACE/bin/PerlACE/ProcessLVRT.pm b/ACE/bin/PerlACE/ProcessLVRT.pm new file mode 100644 index 00000000000..edd0d9f81a4 --- /dev/null +++ b/ACE/bin/PerlACE/ProcessLVRT.pm @@ -0,0 +1,375 @@ +# $Id$ +# +# ProcessLVRT - how to run ACE+TAO tests on a LabVIEW RT target. +# Tests on LabVIEW RT are not executables - LabVIEW RT can't start plain +# executables; the tests are built/packaged as DLLs and loaded and executed +# from a DLL loaded at LabVIEW RT boot time. The DLL on the target listens +# on a TCP port (8888 by default) for connections from the host. Host requests +# actions using text commands to the target. +# +# NOTE: This module requires the Net-Telnet Perl module. +# +# We can FTP files to and from the LabVIEW target, but there's no NFS or +# SMB shares. + +package PerlACE::ProcessLVRT; +our @ISA = "PerlACE::Process"; + +use strict; +use Cwd; +use English; +use File::Basename; +use Net::FTP; +use Net::Telnet; +use POSIX qw(:time_h); + +$PerlACE::ProcessLVRT::ExeSubDir = './'; + +### Check for -ExeSubDir commands, store the last one +my @new_argv = (); + +for(my $i = 0; $i <= $#ARGV; ++$i) { + if ($ARGV[$i] eq '-ExeSubDir') { + if (defined $ARGV[$i + 1]) { + $PerlACE::ProcessLVRT::ExeSubDir = $ARGV[++$i].'/'; + } + else { + print STDERR "You must pass a directory with ExeSubDir\n"; + exit(1); + } + } + else { + push @new_argv, $ARGV[$i]; + } +} +@ARGV = @new_argv; + +### Constructor and Destructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + + $self->{EXECUTABLE} = shift; + $self->{ARGUMENTS} = shift; + $self->{RUNNING} = 0; + $self->{IGNOREEXESUBDIR} = 1; + $self->{FTP} = undef; + $self->{TARGET} = undef; + $self->{REBOOT_CMD} = $ENV{"ACE_REBOOT_LVRT_CMD"}; + if (!defined $self->{REBOOT_CMD}) { + $self->{REBOOT_CMD} = 'I_Need_A_Reboot_Command'; + } + $self->{REBOOT_TIME} = $ENV{"ACE_LVRT_REBOOT_TIME"}; + if (!defined $self->{REBOOT_TIME}) { + $self->{REBOOT_TIME} = 200; + } + + bless ($self, $class); + return $self; +} + +sub DESTROY +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> still running upon object destruction\n"; + $self->Kill (); + } + + # Reboot if needed; set up clean for the next test. + if ($self->{NEED_REBOOT} == 1 && $self->{REBOOT_CMD}) { + print STDERR "Attempting to reboot target...\n"; + system ($self->{REBOOT_CMD}); + sleep ($self->{REBOOT_TIME}); + } + + if (defined $self->{FTP}) { + $self->{FTP}->close; + } + if (defined $self->{TARGET}) { + $self->{TARGET}->close; + } +} + +############################################################################### + +# Adjust executable name for LabVIEW RT testing needs. These tests are DLLs. + +sub Executable +{ + my $self = shift; + + if (@_ != 0) { + $self->{EXECUTABLE} = shift; + } + + my $executable = $self->{EXECUTABLE}; + + my $basename = basename ($executable); + my $dirname = dirname ($executable). '/'; + + $executable = $dirname.$PerlACE::Process::ExeSubDir.$basename.".DLL"; + $executable =~ s/\//\\/g; # / <- # color coding issue in devenv + + return $executable; +} + +sub Arguments +{ + my $self = shift; + + if (@_ != 0) { + $self->{ARGUMENTS} = shift; + } + + return $self->{ARGUMENTS}; +} + +sub CommandLine () +{ + my $self = shift; + + my $commandline = "run " . basename($self->Executable(), ".dll"); + if (defined $self->{ARGUMENTS}) { + $commandline .= ' '.$self->{ARGUMENTS}; + } + + return $commandline; +} + +############################################################################### + +# Spawn the process and continue. + +sub Spawn () +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> already running\n"; + return -1; + } + + if (!defined $self->{EXECUTABLE}) { + print STDERR "ERROR: Cannot Spawn: No executable specified\n"; + return -1; + } + + if ($self->{IGNOREEXESUBDIR} == 0) { + if (!-f $self->Executable ()) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> not found\n"; + return -1; + } + } + + my $targethost; + if (defined $ENV{'ACE_RUN_LVRT_TGTHOST'}) { + $targethost = $ENV{'ACE_RUN_LVRT_TGTHOST'}; + } + else { + print STDERR "You must define target hostname/IP with ", + "ACE_RUN_LVRT_TGTHOST\n"; + return -1; + } + my $targetport; + if (defined $ENV{'ACE_RUN_LVRT_TGTPORT'}) { + $targetport = $ENV{'ACE_RUN_LVRT_TGTPORT'}; + } + else { + $targetport = 8888; + } + + my $status = 0; + + my $program = $self->Executable (); + my $cwdrel = dirname ($program); + if (length ($cwdrel) > 0) { + $cwdrel = File::Spec->abs2rel( cwd(), $ENV{"ACE_ROOT"} ); + } + else { + $cwdrel = File::Spec->abs2rel( $cwdrel, $ENV{"ACE_ROOT"} ); + } + + $self->{FTP} = new Net::FTP ($targethost); + if (!defined $self->{FTP}) { + print STDERR "$@\n"; + $self->{NEED_REBOOT} = 1; + return -1; + } + $self->{FTP}->login("",""); + $self->{FTP}->cwd("/ni-rt"); + $self->{FTP}->binary(); + $self->{FTP}->put($program); + + $self->{TARGET} = new Net::Telnet(Timeout => 600, Errmode => 'return'); + if (!$self->{TARGET}->open(Host => $targethost, Port => $targetport)) { + print STDERR "ERROR: target $targethost:$targetport: ", + $self->{TARGET}->errmsg(), "\n"; + $self->{NEED_REBOOT} = 1; + $self->{FTP}->delete($program); + return -1; + } + my $cmdline = $self->CommandLine(); + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "-> $cmdline\n"; + } + $self->{TARGET}->print("$cmdline"); + my $reply; + $reply = $self->{TARGET}->getline(); + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "<- $reply\n"; + } + if ($reply eq "OK\n") { + $self->{RUNNING} = 1; + return 0; + } + print STDERR "ERROR: can't $cmdline: " . $reply . "\n"; + $self->{FTP}->delete($program); + $self->{NEED_REBOOT} = 1; + return -1; +} + + +# Wait for the process to exit or kill after a time period + +sub WaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + my $status = $self->TimedWait ($timeout); + + if ($status == -1) { + print STDERR "ERROR: $self->{EXECUTABLE} timedout\n"; + $self->{NEED_REBOOT} = 1; + $self->Kill (); + } + + $self->{RUNNING} = 0; + + # Now get the log file from the test, and delete the test from the target. + # The FTP session should still be open. + my $program = $self->Executable (); + my $logname = basename($program,".dll") . ".log"; + $program = basename($program); + $self->{FTP}->delete($program); + $self->{FTP}->cwd("\\ni-rt\\system\\log"); + $self->{FTP}->get($logname,"log\\$logname"); + $self->{FTP}->delete($logname); + + return $status; +} + + +# Do a Spawn and immediately WaitKill + +sub SpawnWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->Spawn () == -1) { + return -1; + } + + return $self->WaitKill ($timeout); +} + +sub TerminateWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->{RUNNING}) { + print STDERR "INFO: $self->{EXECUTABLE} being killed.\n"; + $self->Kill(); + } + + return $self->WaitKill ($timeout); +} + +sub Kill () +{ + my $self = shift; + + if ($self->{RUNNING}) { + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "-> kill\n"; + } + $self->{TARGET}->print("kill"); + # Just wait for any reply; don't care what it is. + my $reply = $self->{TARGET}->getline(); + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "<- $reply\n"; + } + } + + $self->{RUNNING} = 0; +} + +# Wait until a process exits. +# return -1 if the process is still alive. +sub Wait ($) +{ + my $self = shift; + my $timeout = shift; + if (!defined $timeout || $timeout < 0) { + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "-> wait\n"; + } + $self->{TARGET}->print("wait"); + my $reply = $self->{TARGET}->getline(); + $self->{RUNNING} = 0; + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "<- $reply\n"; + } + return 0+ $reply; + } else { + return TimedWait($self, $timeout); + } + +} + +sub TimedWait ($) +{ + my $self = shift; + my $timeout = shift; + my $reply; + if (!$self->{RUNNING}) { + return -1; + } + +CHECK: + while ($timeout > 0) { + $self->{TARGET}->print ("status"); + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "-> status\n"; + } + $reply = $self->{TARGET}->getline(Timeout => $timeout); + if (!defined $reply) { + last CHECK; + } + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "<- $reply\n"; + } + if ($reply =~ /^RUNNING/) { + sleep 2; + $timeout -= 2; + next CHECK; + } + # Have a status; return it. + $self->{RUNNING} = 0; + return 0+ $reply; + } + + return -1; +} + +1; diff --git a/ACE/bin/PerlACE/ProcessVX.pm b/ACE/bin/PerlACE/ProcessVX.pm new file mode 100644 index 00000000000..7681a9538d9 --- /dev/null +++ b/ACE/bin/PerlACE/ProcessVX.pm @@ -0,0 +1,252 @@ +# $Id$ + +package PerlACE::ProcessVX; + +use strict; +use English; +use POSIX qw(:time_h); + +$PerlACE::ProcessVX::ExeSubDir = './'; +$PerlACE::ProcessVX::DoVxInit = (defined $ENV{"ACE_RUN_VX_NO_INITIAL_REBOOT"}) ? 0 : 1; +$PerlACE::ProcessVX::VxDefGw = 1; +$PerlACE::ProcessVX::RebootTime = (defined $ENV{"ACE_RUN_VX_REBOOT_TIME"}) ? $ENV{"ACE_RUN_VX_REBOOT_TIME"} : 90; +$PerlACE::ProcessVX::ExeExt = ($PerlACE::VxWorks_RTP_Test) ? '.vxe' : '.out'; +$PerlACE::ProcessVX::RebootCmd = $ENV{"ACE_RUN_VX_REBOOT_CMD"}; + +sub delay_factor { + my($lps) = 128; + my($factor) = 1; + + ## Keep increasing the loops per second until the amount of time + ## exceeds the number of clocks per second. The original code + ## did not multiply $ticks by 8 but, for faster machines, it doesn't + ## seem to return false values. The multiplication is done to minimize + ## the amount of time it takes to determine the correct factor. + while(($lps <<= 1)) { + my($ticks) = clock(); + for(my $i = $lps; $i >= 0; $i--) { + } + $ticks = clock() - $ticks; + if ($ticks * 8 >= CLOCKS_PER_SEC) { + $factor = 500000 / (($lps / $ticks) * CLOCKS_PER_SEC); + last; + } + } + + return $factor; +} + +sub iboot_cycle_power { + my $self = shift; + + my ($iboot_host, + $iboot_outlet, + $iboot_user, + $iboot_passwd ) = ($ENV{'ACE_RUN_VX_IBOOT'}, + $ENV{'ACE_RUN_VX_IBOOT_OUTLET'}, + $ENV{'ACE_RUN_VX_IBOOT_USER'}, + $ENV{'ACE_RUN_VX_IBOOT_PASSWORD'}); + + my $v = $ENV{'ACE_TEST_VERBOSE'}; + + if ($v) { + print "Using iBoot: $iboot_host\n"; + if (defined $iboot_outlet) { + print "Using iBoot Outlet #: $iboot_outlet\n"; + } + } + + # There are three cases to handle here: + # 1. using a single-outlet iBoot + # 2. using a multi-outlet iBootBar with custom firmware + # 3. using a multi-outlet iBootBar with standard firmware + # + # In cases 1 & 2, we use the iPAL protocol; in case 3 we + # use a telnet connection and the command-line syntax. + # + # We determine that it's case #3 by the concurrent presence + # of an outlet number, an iboot username, and an iboot password + # in the environment. + # + + if (defined($iboot_outlet) && defined($iboot_user) && defined($iboot_passwd)) { + # We perform case #3 + + my $t = new Net::Telnet(); + + $t->prompt('/iBootBar \> /'); + my $savedmode = $t->errmode(); + $t->errmode("return"); + + my $retries = 5; + my $is_open = 0; + + while ($retries--) { + my $r = $t->open($iboot_host); + if ($r == 1) { + $is_open = 1; + last; + } + } + continue { + print "Couldn't open connection; sleeping then retrying\n" if ($v); + sleep(5); + } + + if (! $is_open) { + print "Unable to open $iboot_host.\n" if ($v); + return 0; + } + + $t->errmode($savedmode); + + # Simple login b/c Net::Telnet::login hardcodes the prompts + $t->waitfor('/User Name:\s*$/i'); + $t->print($iboot_user); + $t->waitfor('/password:\s*/i'); + $t->print($iboot_passwd); + + $t->waitfor($t->prompt); + + print "successfully logged in to $iboot_host\n" if ($v); + + my $output = $t->cmd("set outlet $iboot_outlet cycle"); + + print "successfully cycled power on outlet $iboot_outlet\n" if ($v); + + $t->close(); + } + else { + # Perform cases 1 & 2 + my $iboot; + my $text; + if (!defined($iboot_passwd)) { + $iboot_passwd = "PASS"; + } + + my $ipal_command_series = (defined $iboot_outlet) ? ['E', 'D'] : ['f', 'n']; + + foreach my $ipal_cmd (@$ipal_command_series) { + my $retries = 3; + my $is_open = 0; + while ($retries--) { + $iboot = IO::Socket::INET->new ("$iboot_host"); + if ($iboot) { + # if ACE_RUN_VX_IBOOT_OUTLET is defined, we're using + # the iBootBar, and we're using the iPAL Protocol + # to communicate with the iBootBar + if (defined $iboot_outlet) { + $iboot->send ("\e".$iboot_passwd."\e".$iboot_outlet.$ipal_cmd); + } + else { + $iboot->send ("\e".$iboot_passwd."\e$ipal_cmd\r"); + } + $iboot->recv ($text,128); + print "iBoot is currently: $text\n" if ($v); + $iboot->close(); + if ($text eq "OFF" || $text eq "ON") { + $is_open = 1; + last; + } + else { + print "iBoot is $text; sleeping then retrying\n" if ($v); + sleep(5); + } + } + else { + print "ERROR: FAILED to execute 'reboot' command!\n"; + } + } + if (!$is_open) { + print "Unable to reboot using $iboot_host.\n" if ($v); + return 0; + } + } + } +} + +sub reboot { + my $self = shift; + my $iboot; + my $text; + my $t; + my $ok; + + my $target_login = $ENV{'ACE_RUN_VX_LOGIN'}; + my $target_password = $ENV{'ACE_RUN_VX_PASSWORD'}; + + ## + ## initialize VxWorks kernel (reboot!) if needed + if ($PerlACE::ProcessVX::DoVxInit || $ENV{'ACE_RUN_VX_TGT_REBOOT'}) { + if (defined $ENV{'ACE_RUN_VX_REBOOT_TOOL'}) { + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "Calling: $ENV{'ACE_RUN_VX_REBOOT_TOOL'}\n"; + } + system ($ENV{'ACE_RUN_VX_REBOOT_TOOL'}); + } + else { + if (defined $ENV{'ACE_RUN_VX_IBOOT'}) { + $self->iboot_cycle_power(); + } + else { + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "Executing 'reboot' command over Telnet to ".$ENV{'ACE_RUN_VX_TGTHOST'}.".\n"; + } + $t = new Net::Telnet(Timeout => 10, + Prompt => '/-> $/', + Errmode => 'return'); + $t->open($ENV{'ACE_RUN_VX_TGTHOST'}); + $t->print(""); + if (defined $target_login) { + $t->waitfor('/VxWorks login: $/'); + $t->print("$target_login"); + } + if (defined $target_password) { + $t->waitfor('/Password: $/'); + $t->print("$target_password"); + } + $ok = $t->waitfor('/-> $/'); + if ($ok) { + $t->print($PerlACE::ProcessVX::RebootCmd); + } + else { + print "ERROR: FAILED to execute 'reboot' command!\n"; + } + $t->close(); + } + } + $PerlACE::ProcessVX::VxDefGw = 1; + $PerlACE::ProcessVX::DoVxInit = 0; + sleep($PerlACE::ProcessVX::RebootTime); + } +} + +### Check for -ExeSubDir commands, store the last one +my @new_argv = (); + +for(my $i = 0; $i <= $#ARGV; ++$i) { + if ($ARGV[$i] eq '-ExeSubDir') { + if (defined $ARGV[$i + 1]) { + $PerlACE::ProcessVX::ExeSubDir = $ARGV[++$i].'/'; + } + else { + print STDERR "You must pass a directory with ExeSubDir\n"; + exit(1); + } + } + else { + push @new_argv, $ARGV[$i]; + } +} +@ARGV = @new_argv; + +$PerlACE::ProcessVX::WAIT_DELAY_FACTOR = $ENV{"ACE_RUNTEST_DELAY"}; + +if ($OSNAME eq "MSWin32") { + require PerlACE::ProcessVX_Win32; +} +else { + require PerlACE::ProcessVX_Unix; +} + +1; diff --git a/ACE/bin/PerlACE/ProcessVX_Unix.pm b/ACE/bin/PerlACE/ProcessVX_Unix.pm new file mode 100644 index 00000000000..5138b15f617 --- /dev/null +++ b/ACE/bin/PerlACE/ProcessVX_Unix.pm @@ -0,0 +1,486 @@ +# $Id$ + +package PerlACE::ProcessVX; + +use strict; +use POSIX "sys_wait_h"; +use File::Basename; +use File::Spec; +use Config; +use FileHandle; +use Cwd; + +require Net::Telnet; + +############################################################################### + +### Grab signal names + +my @signame; + +if (defined $Config{sig_name}) { + my $i = 0; + foreach my $name (split (' ', $Config{sig_name})) { + $signame[$i] = $name; + $i++; + } +} +else { + my $i; + for ($i = 0; $i < 255; ++$i) { + $signame[$i] = $i; + } +} + +############################################################################### + +# This is what GetExitCode will return if the process is still running. +my $STILL_ACTIVE = 259; + +############################################################################### + +### Constructor and Destructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + + $self->{RUNNING} = 0; + $self->{IGNOREEXESUBDIR} = 1; + $self->{PROCESS} = undef; + $self->{EXECUTABLE} = shift; + $self->{ARGUMENTS} = shift; + if (!defined $PerlACE::ProcessVX::WAIT_DELAY_FACTOR) { + $PerlACE::ProcessVX::WAIT_DELAY_FACTOR = 2; + } + if (!defined $PerlACE::ProcessVX::RebootCmd) { + $PerlACE::ProcessVX::RebootCmd = "reboot 0x02"; + } + bless ($self, $class); + return $self; +} + +sub DESTROY +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> still running upon object destruction\n"; + $self->Kill (); + } +} + +############################################################################### + +### Some Accessors + +sub Normalize_Executable_Name +{ + my $self = shift; + my $executable = shift; + + my $basename = basename ($executable); + my $dirname = dirname ($executable). '/'; + + $executable = $dirname.$PerlACE::ProcessVX::ExeSubDir.$basename.$PerlACE::ProcessVX::ExeExt; + + ## Installed executables do not conform to the ExeSubDir + if (! -e $executable && -e $dirname.$basename.$PerlACE::ProcessVX::ExeExt) { + $executable = $dirname.$basename.$PerlACE::ProcessVX::ExeExt; + } + + return $executable; +} + + +sub Executable +{ + my $self = shift; + + if (@_ != 0) { + $self->{EXECUTABLE} = shift; + } + + my $executable = $self->{EXECUTABLE}; + + if ($self->{IGNOREEXESUBDIR} == 0) { + $executable = $self->Normalize_Executable_Name ($executable); + } + else { + $executable = $executable.$PerlACE::ProcessVX::ExeExt; + } + + return $executable; +} + +sub Arguments +{ + my $self = shift; + + if (@_ != 0) { + $self->{ARGUMENTS} = shift; + } + + return $self->{ARGUMENTS}; +} + +sub CommandLine () +{ + my $self = shift; + + my $commandline = $self->Executable (); + + if (defined $self->{ARGUMENTS}) { + $commandline .= ' '.$self->{ARGUMENTS}; + } + + return $commandline; +} + +sub IgnoreExeSubDir +{ + my $self = shift; + + if (@_ != 0) { + $self->{IGNOREEXESUBDIR} = shift; + } + + return $self->{IGNOREEXESUBDIR}; +} + +############################################################################### + +### Spawning processes + + +# Spawn the process and continue. + +sub Spawn () +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> already running\n"; + return -1; + } + + if (!defined $self->{EXECUTABLE}) { + print STDERR "ERROR: Cannot Spawn: No executable specified\n"; + return -1; + } + + if ($self->{IGNOREEXESUBDIR} == 0) { + if (!-f $self->Executable ()) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> not found\n"; + return -1; + } + } + + my $status = 0; + + my $cmdline; + + # Reboot the target if necessery + $self->reboot(); + + my $program = $self->Executable (); + my $cwdrel = dirname ($program); + my $prjroot = defined $ENV{"ACE_RUN_VX_PRJ_ROOT"} ? $ENV{"ACE_RUN_VX_PRJ_ROOT"} : $ENV{"ACE_ROOT"}; + if (length ($cwdrel) > 0) { + $cwdrel = File::Spec->abs2rel( cwd(), $prjroot ); + } + else { + $cwdrel = File::Spec->abs2rel( $cwdrel, $prjroot ); + } + $program = basename($program, $PerlACE::ProcessVX::ExeExt); + + my @cmds; + my $cmdnr = 0; + my $arguments = ""; + my $prompt = ''; + + if ($PerlACE::VxWorks_RTP_Test) { + @cmds[$cmdnr++] = 'cmd'; + if ( defined $ENV{"ACE_RUN_VX_TGTSVR_DEFGW"} && $self->{SET_VX_DEFGW}) { + @cmds[$cmdnr++] = "C mRouteAdd(\"0.0.0.0\", \"" . $ENV{"ACE_RUN_VX_TGTSVR_DEFGW"} . "\", 0,0,0)"; + $self->{SET_VX_DEFGW} = 0; + } + + @cmds[$cmdnr++] = 'cd "' . $ENV{'ACE_RUN_VX_TGTSVR_ROOT'} . "/" . $cwdrel . '"'; + @cmds[$cmdnr++] = 'C putenv("TMPDIR=' . $ENV{"ACE_RUN_VX_TGTSVR_ROOT"} . "/" . $cwdrel . '")'; + + if (defined $ENV{'ACE_RUN_ACE_DEBUG'}) { + @cmds[$cmdnr++] = 'putenv("ACE_DEBUG=' . $ENV{"ACE_RUN_ACE_DEBUG"} . '")'; + } + + if (defined $ENV{'ACE_RUN_TAO_ORB_DEBUG'}) { + @cmds[$cmdnr++] = 'putenv("TAO_ORB_DEBUG=' . $ENV{"ACE_RUN_TAO_ORB_DEBUG"} . '")'; + } + + if (defined $ENV{'ACE_RUN_VX_CHECK_RESOURCES'}) { + @cmds[$cmdnr++] = 'C memShow()'; + } + + $cmdline = $program . $PerlACE::ProcessVX::ExeExt . ' ' . $self->{ARGUMENTS}; + @cmds[$cmdnr++] = $cmdline; + $prompt = '/\[vxWorks \*]# $/'; + } else { + if ( defined $ENV{"ACE_RUN_VX_TGTSVR_DEFGW"} && $self->{SET_VX_DEFGW}) { + @cmds[$cmdnr++] = "mRouteAdd(\"0.0.0.0\", \"" . $ENV{"ACE_RUN_VX_TGTSVR_DEFGW"} . "\", 0,0,0)"; + $self->{SET_VX_DEFGW} = 0; + } + + @cmds[$cmdnr++] = 'cd "' . $ENV{'ACE_RUN_VX_TGTSVR_ROOT'} . "/" . $cwdrel . '"'; + @cmds[$cmdnr++] = 'putenv("TMPDIR=' . $ENV{"ACE_RUN_VX_TGTSVR_ROOT"} . "/" . $cwdrel . '")'; + + if (defined $ENV{'ACE_RUN_VX_CHECK_RESOURCES'}) { + @cmds[$cmdnr++] = 'memShow()'; + } + + if (defined $ENV{'ACE_RUN_ACE_DEBUG'}) { + @cmds[$cmdnr++] = 'putenv("ACE_DEBUG=' . $ENV{"ACE_RUN_ACE_DEBUG"} . '")'; + } + + if (defined $ENV{'ACE_RUN_TAO_ORB_DEBUG'}) { + @cmds[$cmdnr++] = 'putenv("TAO_ORB_DEBUG=' . $ENV{"ACE_RUN_TAO_ORB_DEBUG"} . '")'; + } + + @cmds[$cmdnr++] = 'ld <'. $program . $PerlACE::ProcessVX::ExeExt; + $cmdline = $program . $PerlACE::ProcessVX::ExeExt . ' ' . $self->{ARGUMENTS}; + if (defined $self->{ARGUMENTS}) { + ($arguments = $self->{ARGUMENTS})=~ s/\"/\\\"/g; + $arguments = ",\"" . $arguments . "\""; + } + @cmds[$cmdnr++] = 'ace_vx_rc = vx_execae(ace_main' . $arguments . ')'; + @cmds[$cmdnr++] = 'unld "'. $program . $PerlACE::ProcessVX::ExeExt . '"'; + $prompt = '/-> $/'; + } + + FORK: + { + if ($self->{PROCESS} = fork) { + #parent here + bless $self; + } + elsif (defined $self->{PROCESS}) { + #child here + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "$cmdline\n"; + } + + my $t; + $t = new Net::Telnet(Timeout => 600, Errmode => 'return'); + $t->open($ENV{'ACE_RUN_VX_TGTHOST'}); + $t->print(""); + + my $target_login = $ENV{'ACE_RUN_VX_LOGIN'}; + my $target_password = $ENV{'ACE_RUN_VX_PASSWORD'}; + + if (defined $target_login) { + $t->waitfor('/VxWorks login: $/'); + $t->print("$target_login"); + } + + if (defined $target_password) { + $t->waitfor('/Password: $/'); + $t->print("$target_password"); + } + + my $ok; + $ok = $t->waitfor('/-> $/'); + if ($ok) { + $t->prompt ($prompt); + my $i = 0; + my @lines; + while($i < $cmdnr) { + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print @cmds[$i]."\n"; + } + @lines = $t->cmd (@cmds[$i++]); + print @lines; + } + } + else { + die "ERROR: exec failed for <" . $cmdline . ">"; + } + $t->close(); + sleep(2); + exit; + } + elsif ($! =~ /No more process/) { + #EAGAIN, supposedly recoverable fork error + sleep 5; + redo FORK; + } + else { + # weird fork error + print STDERR "ERROR: Can't fork <" . $cmdline . ">: $!\n"; + } + } + $self->{RUNNING} = 1; + return 0; +} + +# Wait for the process to exit or kill after a time period + +sub WaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + my $status = $self->TimedWait ($timeout); + + if ($status == -1) { + print STDERR "ERROR: $self->{EXECUTABLE} timedout\n"; + $self->Kill (); + + $PerlACE::ProcessVX::DoVxInit = 1; # force reboot on next run + } + + $self->{RUNNING} = 0; + + return $status; +} + + +# Do a Spawn and immediately WaitKill + +sub SpawnWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->Spawn () == -1) { + return -1; + } + + return $self->WaitKill ($timeout); +} + + +# Terminate the process and wait for it to finish + +sub TerminateWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->{RUNNING}) { + print STDERR "INFO: $self->{EXECUTABLE} being killed.\n"; + kill ('TERM', $self->{PROCESS}); + + $PerlACE::ProcessVX::DoVxInit = 1; # force reboot on next run + } + + return $self->WaitKill ($timeout); +} + +# really only for internal use +sub check_return_value ($) +{ + my $self = shift; + my $rc = shift; + + my $CC_MASK = 0xff00; + + # Exit code processing + if ($rc == 0) { + return 0; + } + elsif ($rc == $CC_MASK) { + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> failed: $!\n"; + + $PerlACE::ProcessVX::DoVxInit = 1; # force reboot on next run + + return ($rc >> 8); + } + elsif (($rc & 0xff) == 0) { + $rc >>= 8; + return $rc; + } + + # Remember Core dump flag + my $dump = 0; + + if ($rc & 0x80) { + $rc &= ~0x80; + $dump = 1; + } + + # check for ABRT, KILL or TERM + if ($rc == 6 || $rc == 9 || $rc == 15) { + return 0; + } + + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> exited with "; + + print STDERR "coredump from " if ($dump == 1); + + print STDERR "signal $rc : ", $signame[$rc], "\n"; + + $PerlACE::ProcessVX::DoVxInit = 1; # force reboot on next run + + return 0; +} + +sub Kill () +{ + my $self = shift; + + if ($self->{RUNNING} && !defined $ENV{'ACE_TEST_WINDOW'}) { + kill ('KILL', $self->{PROCESS}); + waitpid ($self->{PROCESS}, 0); + $self->check_return_value ($?); + } + + $self->{RUNNING} = 0; +} + +# Wait until a process exits. +# return -1 if the process is still alive. +sub Wait ($) +{ + my $self = shift; + my $timeout = shift; + if (!defined $timeout || $timeout < 0) { + waitpid ($self->{PROCESS}, 0); + } else { + return TimedWait($self, $timeout); + } + +} + +sub TimedWait ($) +{ + my $self = shift; + my $timeout = shift; + + if ($PerlACE::Process::WAIT_DELAY_FACTOR > 0) { + $timeout *= $PerlACE::Process::WAIT_DELAY_FACTOR; + } + + while ($timeout-- != 0) { + my $pid = waitpid ($self->{PROCESS}, &WNOHANG); + if ($pid != 0 && $? != -1) { + return $self->check_return_value ($?); + } + sleep 1; + } + + $PerlACE::ProcessVX::DoVxInit = 1; # force reboot on next run + + return -1; +} + + + + + +1; diff --git a/ACE/bin/PerlACE/ProcessVX_Win32.pm b/ACE/bin/PerlACE/ProcessVX_Win32.pm new file mode 100644 index 00000000000..3ecd7a1d06e --- /dev/null +++ b/ACE/bin/PerlACE/ProcessVX_Win32.pm @@ -0,0 +1,434 @@ +# $Id$ + +package PerlACE::ProcessVX; + +use strict; +use Win32::Process; +use File::Basename; +use File::Spec; +use FileHandle; +use Cwd; + +require Net::Telnet; + +############################################################################### + +# This is what GetExitCode will return if the process is still running. +my $STILL_ACTIVE = 259; + +############################################################################### + +### Constructor and Destructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + + $self->{RUNNING} = 0; + $self->{IGNOREEXESUBDIR} = 1; + $self->{PROCESS} = undef; + $self->{EXECUTABLE} = shift; + $self->{ARGUMENTS} = shift; + if (!defined $PerlACE::ProcessVX::WAIT_DELAY_FACTOR) { + $PerlACE::ProcessVX::WAIT_DELAY_FACTOR = 3; + } + if (!defined $PerlACE::ProcessVX::RebootCmd) { + $PerlACE::ProcessVX::RebootCmd = "reboot"; + } + bless ($self, $class); + return $self; +} + +sub DESTROY +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> still running upon object destruction\n"; + $self->Kill (); + } + + if (!defined $ENV{'ACE_TEST_VERBOSE'}) { + unlink "run_vx.pl"; + } +} + +############################################################################### + +### Some Accessors + +sub Normalize_Executable_Name +{ + my $self = shift; + my $executable = shift; + + my $basename = basename ($executable); + my $dirname = dirname ($executable). '/'; + + $executable = $dirname.$PerlACE::ProcessVX::ExeSubDir.$basename.$PerlACE::ProcessVX::ExeExt; + + ## Installed executables do not conform to the ExeSubDir + if (! -e $executable && -e $dirname.$basename.$PerlACE::ProcessVX::ExeExt) { + $executable = $dirname.$basename.$PerlACE::ProcessVX::ExeExt; + } + + return $executable; +} + + +sub Executable +{ + my $self = shift; + + if (@_ != 0) { + $self->{EXECUTABLE} = shift; + } + + my $executable = $self->{EXECUTABLE}; + + if ($self->{IGNOREEXESUBDIR} == 0) { + $executable = $self->Normalize_Executable_Name ($executable); + } + else { + $executable = $executable.$PerlACE::ProcessVX::ExeExt; + } + + return $executable; +} + +sub Arguments +{ + my $self = shift; + + if (@_ != 0) { + $self->{ARGUMENTS} = shift; + } + + return $self->{ARGUMENTS}; +} + +sub CommandLine () +{ + my $self = shift; + + my $commandline = $self->Executable (); + + if (defined $self->{ARGUMENTS}) { + $commandline .= ' '.$self->{ARGUMENTS}; + } + + return $commandline; +} + +sub IgnoreExeSubDir +{ + my $self = shift; + + if (@_ != 0) { + $self->{IGNOREEXESUBDIR} = shift; + } + + return $self->{IGNOREEXESUBDIR}; +} + +############################################################################### + +### Spawning processes + + +# Spawn the process and continue. + +sub Spawn () +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> already running\n"; + return -1; + } + + if (!defined $self->{EXECUTABLE}) { + print STDERR "ERROR: Cannot Spawn: No executable specified\n"; + return -1; + } + + if ($self->{IGNOREEXESUBDIR} == 0) { + if (!-f $self->Executable ()) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> not found\n"; + return -1; + } + } + + my $status = 0; + + my $cmdline; + + # Reboot the target if necessery + $self->reboot(); + + my $program = $self->Executable (); + my $cwdrel = dirname ($program); + my $prjroot = defined $ENV{"ACE_RUN_VX_PRJ_ROOT"} ? $ENV{"ACE_RUN_VX_PRJ_ROOT"} : $ENV{"ACE_ROOT"}; + if (length ($cwdrel) > 0) { + $cwdrel = File::Spec->abs2rel( cwd(), $prjroot ); + } + else { + $cwdrel = File::Spec->abs2rel( $cwdrel, $prjroot ); + } + $cwdrel =~ s/\\/\//g; + $program = basename($program, $PerlACE::ProcessVX::ExeExt); + + unlink "run_vx.pl"; + my $oh = new FileHandle(); + if (!open($oh, ">run_vx.pl")) { + print STDERR "ERROR: Unable to write to run_vx.pl\n"; + exit -1; + } + + my @cmds; + my $cmdnr = 0; + my $arguments = ""; + my $prompt = ''; + + if ($PerlACE::VxWorks_RTP_Test) { + @cmds[$cmdnr++] = 'cmd'; + if ( defined $ENV{"ACE_RUN_VX_TGTSVR_DEFGW"} && $PerlACE::ProcessVX::VxDefGw) { + @cmds[$cmdnr++] = "C mRouteAdd(\"0.0.0.0\", \"" . $ENV{"ACE_RUN_VX_TGTSVR_DEFGW"} . "\", 0,0,0)"; + $PerlACE::ProcessVX::VxDefGw = 0; + } + + @cmds[$cmdnr++] = 'cd "' . $ENV{"ACE_RUN_VX_TGTSVR_ROOT"} . "/" . $cwdrel . '"'; + @cmds[$cmdnr++] = 'C putenv("TMPDIR=' . $ENV{"ACE_RUN_VX_TGTSVR_ROOT"} . "/" . $cwdrel . '")'; + + if (defined $ENV{'ACE_RUN_ACE_DEBUG'}) { + @cmds[$cmdnr++] = 'putenv("ACE_DEBUG=' . $ENV{"ACE_RUN_ACE_DEBUG"} . '")'; + } + + if (defined $ENV{'ACE_RUN_TAO_ORB_DEBUG'}) { + @cmds[$cmdnr++] = 'putenv("TAO_ORB_DEBUG=' . $ENV{"ACE_RUN_TAO_ORB_DEBUG"} . '")'; + } + + if (defined $ENV{'ACE_RUN_VX_CHECK_RESOURCES'}) { + @cmds[$cmdnr++] = 'C memShow()'; + } + + $cmdline = $program . $PerlACE::ProcessVX::ExeExt . ' ' . $self->{ARGUMENTS}; + @cmds[$cmdnr++] = $cmdline; + $prompt = '/\[vxWorks \*]# $/'; + } else { + if ( defined $ENV{"ACE_RUN_VX_TGTSVR_DEFGW"} && $PerlACE::ProcessVX::VxDefGw) { + @cmds[$cmdnr++] = "mRouteAdd(\"0.0.0.0\", \"" . $ENV{"ACE_RUN_VX_TGTSVR_DEFGW"} . "\", 0,0,0)"; + $PerlACE::ProcessVX::VxDefGw = 0; + } + + @cmds[$cmdnr++] = 'cd "' . $ENV{"ACE_RUN_VX_TGTSVR_ROOT"} . "/" . $cwdrel . '"'; + @cmds[$cmdnr++] = 'putenv("TMPDIR=' . $ENV{"ACE_RUN_VX_TGTSVR_ROOT"} . "/" . $cwdrel . '")'; + + if (defined $ENV{'ACE_RUN_VX_CHECK_RESOURCES'}) { + @cmds[$cmdnr++] = 'memShow()'; + } + + if (defined $ENV{'ACE_RUN_ACE_DEBUG'}) { + @cmds[$cmdnr++] = 'putenv("ACE_DEBUG=' . $ENV{"ACE_RUN_ACE_DEBUG"} . '")'; + } + + if (defined $ENV{'ACE_RUN_TAO_ORB_DEBUG'}) { + @cmds[$cmdnr++] = 'putenv("TAO_ORB_DEBUG=' . $ENV{"ACE_RUN_TAO_ORB_DEBUG"} . '")'; + } + + @cmds[$cmdnr++] = 'ld <'. $program . $PerlACE::ProcessVX::ExeExt; + $cmdline = $program . $PerlACE::ProcessVX::ExeExt . ' ' . $self->{ARGUMENTS}; + if (defined $self->{ARGUMENTS}) { + ($arguments = $self->{ARGUMENTS})=~ s/\"/\\\"/g; + $arguments = ",\"" . $arguments . "\""; + } + @cmds[$cmdnr++] = 'ace_vx_rc = vx_execae(ace_main' . $arguments . ')'; + @cmds[$cmdnr++] = 'unld "'. $program . $PerlACE::ProcessVX::ExeExt . '"'; + $prompt = '/-> $/'; + } + + print $oh "require Net::Telnet;\n"; + print $oh "my \@cmds;\n"; + print $oh "my \$prompt = '$prompt';\n"; + my $i = 0; + while($i < $cmdnr) { + print $oh "\@cmds[$i] = '" . @cmds[$i++] . "';\n"; + } + print $oh "my \$cmdnr = $cmdnr;\n\n"; + + print $oh <<'__END__'; +if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "$cmdline\n"; +} + +my $ok; +my $t = new Net::Telnet(Timeout => 600, Errmode => 'return'); +$t->open($ENV{'ACE_RUN_VX_TGTHOST'}); +$t->print(""); + +my $target_login = $ENV{'ACE_RUN_VX_LOGIN'}; +my $target_password = $ENV{'ACE_RUN_VX_PASSWORD'}; + +if (defined $target_login) { + $t->waitfor('/VxWorks login: $/'); + $t->print("$target_login"); +} + +if (defined $target_password) { + $t->waitfor('/Password: $/'); + $t->print("$target_password"); +} + +$ok = $t->waitfor('/-> $/'); +if ($ok) { + $t->prompt ($prompt); + my $i = 0; + my @lines; + while($i < $cmdnr) { + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print @cmds[$i]."\n"; + } + @lines = $t->cmd (@cmds[$i++]); + print @lines; + } +} +else { + die "ERROR: exec failed for <" . $cmdline . ">"; +} +$t->close(); +sleep(2); +exit; +__END__ + + close($oh); + + Win32::Process::Create ($self->{PROCESS}, + "$^X", + "$^X run_vx.pl", + 0, + 0, + '.'); + + Win32::Process::GetExitCode ($self->{PROCESS}, $status); + + if ($status != $STILL_ACTIVE) { + print STDERR "ERROR: Spawn failed for <", "$^X run_vx.pl", ">\n"; + exit $status; + } + + $self->{RUNNING} = 1; + return 0; +} + +# Wait for a process to exit with a timeout + +sub TimedWait ($) +{ + my($self) = shift; + my($timeout) = shift; + return $self->Wait($timeout); +} + +# Wait for the process to exit or kill after a time period + +sub WaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + my $status = $self->TimedWait ($timeout); + + if ($status == -1) { + print STDERR "ERROR: $self->{EXECUTABLE} timedout\n"; + $self->Kill (); + # Don't need to Wait since we are on Win32 + + $PerlACE::ProcessVX::DoVxInit = 1; # force reboot on next run + } + + $self->{RUNNING} = 0; + + return $status; +} + + +# Do a Spawn and immediately WaitKill + +sub SpawnWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->Spawn () == -1) { + return -1; + } + + return $self->WaitKill ($timeout); +} + + +# Terminate the process and wait for it to finish + +sub TerminateWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->{RUNNING}) { + print STDERR "INFO: $self->{EXECUTABLE} being killed.\n"; + Win32::Process::Kill ($self->{PROCESS}, 0); + $PerlACE::ProcessVX::DoVxInit = 1; # force reboot on next run + } + + return $self->WaitKill ($timeout); +} + +# Wait until a process exits. +# return -1 if the process is still alive. +sub Wait ($) +{ + my $self = shift; + my $timeout = shift; + if (!defined $timeout || $timeout < 0) { + $timeout = INFINITE; + } else { + $timeout = $timeout * 1000 * $PerlACE::ProcessVX::WAIT_DELAY_FACTOR; + } + + my $result = 0; + + if ($self->{RUNNING}) { + $result = Win32::Process::Wait ($self->{PROCESS}, $timeout); + if ($result == 0) { + return -1; + } + } + Win32::Process::GetExitCode ($self->{PROCESS}, $result); + if ($result != 0) { + $PerlACE::ProcessVX::DoVxInit = 1; # force reboot on next run + } + return $result; +} + + + +# Kill the process + +sub Kill () +{ + my $self = shift; + + if ($self->{RUNNING}) { + Win32::Process::Kill ($self->{PROCESS}, -1); + } + + $self->{RUNNING} = 0; +} + + +1; diff --git a/ACE/bin/PerlACE/Process_Unix.pm b/ACE/bin/PerlACE/Process_Unix.pm new file mode 100644 index 00000000000..c7c3df46c3d --- /dev/null +++ b/ACE/bin/PerlACE/Process_Unix.pm @@ -0,0 +1,526 @@ +# $Id$ + +package PerlACE::Process; + +use strict; +use POSIX "sys_wait_h"; +use Cwd; +use File::Basename; +use Config; + +############################################################################### + +### Grab signal names + +my @signame; + +if (defined $Config{sig_name}) { + my $i = 0; + foreach my $name (split (' ', $Config{sig_name})) { + $signame[$i] = $name; + $i++; + } +} +else { + my $i; + for ($i = 0; $i < 255; ++$i) { + $signame[$i] = $i; + } +} + +############################################################################### + +### Constructor and Destructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + + $self->{RUNNING} = 0; + $self->{IGNOREEXESUBDIR} = 0; + $self->{IGNOREHOSTROOT} = 0; + $self->{PROCESS} = undef; + $self->{EXECUTABLE} = shift; + $self->{ARGUMENTS} = shift; + $self->{VALGRIND_CMD} = $ENV{"ACE_RUN_VALGRIND_CMD"}; + + if (!defined $PerlACE::Process::WAIT_DELAY_FACTOR) { + if (defined $self->{PURIFY_CMD}) { + $PerlACE::Process::WAIT_DELAY_FACTOR = 10; + } + elsif (defined $self->{VALGRIND_CMD}) { + $PerlACE::Process::WAIT_DELAY_FACTOR = 5; + } + else { + $PerlACE::Process::WAIT_DELAY_FACTOR = 1; + } + } + + bless ($self, $class); + return $self; +} + +sub DESTROY +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> still running upon object destruction\n"; + $self->Kill (); + } +} + +############################################################################### + +### Some Accessors + +sub Executable +{ + my $self = shift; + + if (@_ != 0) { + $self->{EXECUTABLE} = shift; + } + + my $executable = $self->{EXECUTABLE}; + + if ($self->{IGNOREHOSTROOT} == 0) { + if (PerlACE::is_vxworks_test()) { + $executable = PerlACE::VX_HostFile ($executable); + } + } + + if ($self->{IGNOREEXESUBDIR}) { + return $executable; + } + + my $basename = basename ($executable); + my $dirname = dirname ($executable). '/'; + + $executable = $dirname.$PerlACE::Process::ExeSubDir.$basename; + + return $executable; +} + +sub Arguments +{ + my $self = shift; + + if (@_ != 0) { + $self->{ARGUMENTS} = shift; + } + + return $self->{ARGUMENTS}; +} + +sub CommandLine () +{ + my $self = shift; + + my $commandline = $self->Executable (); + + if (defined $self->{REMOTEINFO}) { + my($method) = $self->{REMOTEINFO}->{method}; + my($username) = $self->{REMOTEINFO}->{username}; + my($remote) = $self->{REMOTEINFO}->{hostname}; + my($exepath) = $self->{REMOTEINFO}->{exepath}; + my($libpath) = $self->{REMOTEINFO}->{libpath}; + my($exe) = (defined $exepath ? + "$exepath/" . basename($commandline) : $commandline); + $commandline = "$method -l $username $remote \""; + if (defined $libpath) { + my($csh) = (defined $self->{REMOTEINFO}->{shell} && + $self->{REMOTEINFO}->{shell} =~ /csh/); + foreach my $pvar ('LD_LIBRARY_PATH', 'LIBPATH', 'SHLIB_PATH') { + if ($csh) { + $commandline .= "if (! \\\$?$pvar) setenv $pvar; " . + "setenv $pvar $libpath:\\\$$pvar; "; + } + else { + $commandline .= "$pvar=$libpath:\\\$$pvar; export $pvar; "; + } + } + my($env) = $self->{REMOTEINFO}->{env}; + if (defined $env) { + foreach my $pvar (keys %$env) { + if ($csh) { + $commandline .= "setenv $pvar $$env{$pvar}; "; + } + else { + $commandline .= "$pvar=$$env{$pvar}; export $pvar; "; + } + } + } + } + $commandline .= $exe; + } + + if (defined $self->{ARGUMENTS}) { + $commandline .= ' '.$self->{ARGUMENTS}; + } + + # Avoid modifying TAO/tests run_test.pl scripts by using the + # ACE_RUNTEST_ARGS environment variable to append command line + # arguments. + if ($^O eq "nonstop_kernel") { + my $global_args = $ENV{"ACE_RUNTEST_ARGS"}; + if ((length($global_args) > 0) + && ($commandline !~ /tao_idl/)) { + $commandline = $commandline + . ' ' + . $global_args; + } + } + + if (defined $self->{REMOTEINFO}) { + $commandline .= '"'; + } + + return $commandline; +} + +sub IgnoreExeSubDir +{ + my $self = shift; + + if (@_ != 0) { + $self->{IGNOREEXESUBDIR} = shift; + } + + return $self->{IGNOREEXESUBDIR}; +} + +sub IgnoreHostRoot +{ + my $self = shift; + + if (@_ != 0) { + $self->{IGNOREHOSTROOT} = shift; + } + + return $self->{IGNOREHOSTROOT}; +} + +sub RemoteInformation +{ + my($self) = shift; + my(%params) = @_; + + ## Valid keys for %params + ## hostname - The remote hostname + ## method - either rsh or ssh + ## username - The remote user name + ## exepath - The remote path to the executable + ## shell - The shell of the remote user + ## libpath - A library path for libraries required by the executable + ## env - A hash reference of name value pairs to be set in the + ## environment prior to executing the executable. + ## + ## At a minimum, the user must provide the remote hostname. + + if (defined $params{'hostname'}) { + my(@pwd) = getpwuid($<); + $self->{REMOTEINFO} = \%params; + if (!defined $self->{REMOTEINFO}->{'method'}) { + $self->{REMOTEINFO}->{'method'} = 'ssh'; + } + if (!defined $self->{REMOTEINFO}->{'username'}) { + $self->{REMOTEINFO}->{'username'} = $pwd[0] || + $ENV{LOGNAME} || $ENV{USERNAME}; + } + if (!defined $self->{REMOTEINFO}->{'shell'}) { + $self->{REMOTEINFO}->{'shell'} = basename($pwd[8]); + } + } +} + +############################################################################### + +# Spawn the process and continue; + +sub Normalize_Executable_Name +{ + my $executable = shift; + + my $basename = basename ($executable); + my $dirname = dirname ($executable). '/'; + + $executable = $dirname.$PerlACE::Process::ExeSubDir.$basename; + + return $executable; +} + +sub Spawn () +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> already running\n"; + return -1; + } + + if (!defined $self->{EXECUTABLE}) { + print STDERR "ERROR: Cannot Spawn: No executable specified\n"; + return -1; + } + + if ($self->{IGNOREEXESUBDIR} == 0) { + if (!defined $self->{REMOTEINFO} && !-f $self->Executable ()) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> not found\n"; + return -1; + } + } + + my $cmdline = ""; + my $executable = ""; + + if (defined $self->{VALGRIND_CMD}) { + my $orig_cmdline = $self->CommandLine(); + $executable = $self->{VALGRIND_CMD}; + my $basename = basename ($self->{EXECUTABLE}); + + $cmdline = "$executable $orig_cmdline"; + } + elsif (defined $ENV{'ACE_TEST_WINDOW'}) { + $cmdline = $ENV{'ACE_TEST_WINDOW'} . ' ' . $self->CommandLine(); + } + else { + $executable = $self->Executable(); + $cmdline = $self->CommandLine(); + } + + FORK: + { + if ($self->{PROCESS} = fork) { + #parent here + bless $self; + } + elsif (defined $self->{PROCESS}) { + #child here + my @cmdlist = $self->parse_command_line($cmdline); + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "INFO: $cmdline\n"; + foreach my $arg (@cmdlist) { + print "INFO: argument - '$arg'\n"; + } + } + exec @cmdlist; + die "ERROR: exec failed for <" . $cmdline . ">\n"; + } + elsif ($! =~ /No more process/) { + #EAGAIN, supposedly recoverable fork error + sleep 5; + redo FORK; + } + else { + # weird fork error + print STDERR "ERROR: Can't fork <" . $cmdline . ">: $!\n"; + } + } + $self->{RUNNING} = 1; + return 0; +} + +sub WaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->{RUNNING} == 0) { + return 0; + } + + my $status = $self->TimedWait ($timeout); + + if ($status == -1) { + print STDERR "ERROR: $self->{EXECUTABLE} timedout\n"; + $self->Kill (); + } + + $self->{RUNNING} = 0; + + return $status; +} + + +# Do a Spawn and immediately WaitKill + +sub SpawnWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->Spawn () == -1) { + return -1; + } + + return $self->WaitKill ($timeout); +} + +sub TerminateWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->{RUNNING}) { + print STDERR "INFO: $self->{EXECUTABLE} being killed.\n"; + kill ('TERM', $self->{PROCESS}); + } + + return $self->WaitKill ($timeout); +} + +# really only for internal use +sub check_return_value ($) +{ + my $self = shift; + my $rc = shift; + + # NSK OSS has a 32-bit waitpid() status + my $is_NSK = ($^O eq "nonstop_kernel"); + my $CC_MASK = $is_NSK ? 0xffff00 : 0xff00; + + # Exit code processing + if ($rc == 0) { + return 0; + } + elsif ($rc == $CC_MASK) { + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> failed: $!\n"; + return ($rc >> 8); + } + elsif (($rc & 0xff) == 0) { + $rc >>= 8; + return $rc; + } + + # Ignore NSK 16-bit completion code + $rc &= 0xff if $is_NSK; + + # Remember Core dump flag + my $dump = 0; + + if ($rc & 0x80) { + $rc &= ~0x80; + $dump = 1; + } + + # check for ABRT, KILL or TERM + if ($rc == 6 || $rc == 9 || $rc == 15) { + return 0; + } + + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> exited with "; + + print STDERR "coredump from " if ($dump == 1); + + print STDERR "signal $rc : ", $signame[$rc], "\n"; + + return 255; +} + +# for internal use +sub parse_command_line ($) +{ + my $self = shift; + my $cmdline = shift; + $cmdline =~ s/^\s+//; + + my @cmdlist = (); + while ($cmdline ne '') { + if ($cmdline =~ /^\"([^\"\\]*(?:\\.[^\"\\]*)*)\"(.*)/) { + my $unquoted = $1; + $cmdline = $2; + $unquoted =~ s/\\\"/\"/g; + push @cmdlist, $unquoted; + } + elsif ($cmdline =~ /^\'([^\'\\]*(?:\\.[^\'\\]*)*)\'(.*)/) { + my $unquoted = $1; + $cmdline = $2; + $unquoted =~ s/\\\'/\'/g; + push @cmdlist, $unquoted; + } + elsif ($cmdline =~ /^([^\s]*)(.*)/) { + push @cmdlist, $1; + $cmdline = $2; + } + else { + # this must be some kind of error + push @cmdlist, $cmdline; + } + $cmdline =~ s/^\s+//; + } + + return @cmdlist; +} + +sub Kill ($) +{ + my $self = shift; + my $ignore_return_value = shift; + + if ($self->{RUNNING} && !defined $ENV{'ACE_TEST_WINDOW'}) { + kill ('KILL', $self->{PROCESS}); + for(my $i = 0; $i < 10; $i++) { + my $pid = waitpid ($self->{PROCESS}, WNOHANG); + if ($pid > 0) { + if (! $ignore_return_value) { + $self->check_return_value ($?); + } + last; + } + else { + select(undef, undef, undef, .5); + } + } + } + + $self->{RUNNING} = 0; +} + +# Wait until a process exits. +# return -1 if the process is still alive. +sub Wait ($) +{ + my $self = shift; + my $timeout = shift; + if (!defined $self->{PROCESS}) { + return 0; + } + if (!defined $timeout || $timeout < 0) { + return waitpid ($self->{PROCESS}, 0); + } else { + return TimedWait($self, $timeout); + } + +} + +sub TimedWait ($) +{ + my $self = shift; + my $timeout = shift; + + if (!defined $self->{PROCESS}) { + return 0; + } + + $timeout *= $PerlACE::Process::WAIT_DELAY_FACTOR; + + while ($timeout-- != 0) { + my $pid = waitpid ($self->{PROCESS}, &WNOHANG); + if ($pid != 0 && $? != -1) { + return $self->check_return_value ($?); + } + sleep 1; + } + + return -1; +} + +1; diff --git a/ACE/bin/PerlACE/Process_VMS.pm b/ACE/bin/PerlACE/Process_VMS.pm new file mode 100644 index 00000000000..f3f524f78f6 --- /dev/null +++ b/ACE/bin/PerlACE/Process_VMS.pm @@ -0,0 +1,358 @@ +# $Id$ + +package PerlACE::Process; + +use strict; +use POSIX "sys_wait_h"; +use Cwd; +use File::Basename; +use Config; +use VmsProcess; + +############################################################################### + +### Chorus stuff + +$PerlACE::Process::chorushostname = "localhost"; +$PerlACE::Process::chorus = 0; + +$PerlACE::Process::cwd = getcwd(); + +for(my $i = 0; $i <= $#ARGV; $i++) { + if ($ARGV[$i] eq '-chorus') { + if (defined $ARGV[$i + 1]) { + $PerlACE::Process::chorus = 1; + $PerlACE::Process::chorushostname = $ARGV[$1 + 1]; + } + else { + print STDERR "The -chorus option requires " . + "the hostname of the target\n"; + exit(1); + } + + splice(@ARGV, $i, 2); + # Don't break from the loop just in case there + # is an accidental duplication of the -chorus option + } +} + +############################################################################### + +### Grab signal names + +my @signame; + +if (defined $Config{sig_name}) { + my $i = 0; + foreach my $name (split (' ', $Config{sig_name})) { + $signame[$i] = $name; + $i++; + } +} +else { + my $i; + for ($i = 0; $i < 255; ++$i) { + $signame[$i] = $i; + } +} + +############################################################################### + +### Constructor and Destructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + + $self->{RUNNING} = 0; + $self->{IGNOREEXESUBDIR} = 0; + $self->{PROCESS} = undef; + $self->{EXECUTABLE} = shift; + $self->{ARGUMENTS} = shift; + $self->{VALGRIND_CMD} = $ENV{"ACE_RUN_VALGRIND_CMD"}; + + if (!defined $PerlACE::Process::WAIT_DELAY_FACTOR) { + if (defined $self->{PURIFY_CMD}) { + $PerlACE::Process::WAIT_DELAY_FACTOR = 10; + } + elsif (defined $self->{VALGRIND_CMD}) { + $PerlACE::Process::WAIT_DELAY_FACTOR = 5; + } + else { + $PerlACE::Process::WAIT_DELAY_FACTOR = 1; + } + } + + bless ($self, $class); + return $self; +} + +sub DESTROY +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> still running upon object destruction\n"; + $self->Kill (); + } +} + +############################################################################### + +### Some Accessors + +sub Executable +{ + my $self = shift; + + if (@_ != 0) { + $self->{EXECUTABLE} = shift; + } + + my $executable = $self->{EXECUTABLE}; + + if ($self->{IGNOREEXESUBDIR}) { + return $executable; + } + + my $basename = basename ($executable); + my $dirname = dirname ($executable). '/'; + if ($dirname != "") { + $executable = $dirname.$PerlACE::Process::ExeSubDir.$basename; + } + else { + $executable = $dirname.$basename; + } + + if ( !-x $executable ) { + if ( -x $executable.'.exe' ) { + $executable = $executable.'.exe'; + } + } + + return $executable; +} + +sub Arguments +{ + my $self = shift; + + if (@_ != 0) { + $self->{ARGUMENTS} = shift; + } + + return $self->{ARGUMENTS}; +} + +sub CommandLine () +{ + my $self = shift; + + my $commandline = $self->Executable (); + + if (defined $self->{ARGUMENTS}) { + $commandline .= ' '.$self->{ARGUMENTS}; + } + + if ($PerlACE::Process::chorus == 1) { + $commandline = "rsh " + . $PerlACE::Process::chorushostname + . " arun " + . $PerlACE::Process::cwd + . "/" + . $commandline; + } + + return $commandline; +} + +sub IgnoreExeSubDir +{ + my $self = shift; + + if (@_ != 0) { + $self->{IGNOREEXESUBDIR} = shift; + } + + return $self->{IGNOREEXESUBDIR}; +} + +############################################################################### + +# Spawn the process and continue; + +sub Spawn () +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> already running\n"; + return -1; + } + + if (!defined $self->{EXECUTABLE}) { + print STDERR "ERROR: Cannot Spawn: No executable specified\n"; + return -1; + } + + if ($self->{IGNOREEXESUBDIR} == 0) { + if (!-f $self->Executable ()) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> not found\n"; + return -1; + } + + if (!$PerlACE::Process::chorus && !-x $self->Executable ()) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> not executable\n"; + return -1; + } + } + + { + $self->{PROCESS} = VmsProcess::Spawn $self->{EXECUTABLE}, $self->{ARGUMENTS}; + if ($self->{PROCESS}) { + #parent here + bless $self; + } + else { + # weird fork error + print STDERR "ERROR: Can't spawn <" . $self->CommandLine () . ">: $!\n"; + } + } + $self->{RUNNING} = 1; + return 0; +} + +sub WaitKill ($) +{ + my $self = shift; + my $timeout = shift; + my $status = $self->TimedWait ($timeout); + + if ($status == -1) { + print STDERR "ERROR: $self->{EXECUTABLE} timedout\n"; + $self->Kill (); + } + + $self->{RUNNING} = 0; + + return $status; +} + + +# Do a Spawn and immediately WaitKill + +sub SpawnWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->Spawn () == -1) { + return -1; + } + + return $self->WaitKill ($timeout); +} + +sub TerminateWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->{RUNNING}) { + print STDERR "INFO: $self->{EXECUTABLE} being killed.\n"; + kill ('TERM', $self->{PROCESS}); + } + + return $self->WaitKill ($timeout); +} + +# really only for internal use +sub check_return_value ($) +{ + my $self = shift; + my $rc = shift; + + if ($rc == 0) { + return 0; + } + elsif ($rc == 0xff00) { + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> failed: $!\n"; + return ($rc >> 8); + } + elsif (($rc & 0xff) == 0) { + $rc >>= 8; + return $rc; + } + + my $dump = 0; + + if ($rc & 0x80) { + $rc &= ~0x80; + $dump = 1; + } + + # check for ABRT, KILL or TERM + if ($rc == 6 || $rc == 9 || $rc == 15) { + return 0; + } + + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> exited with "; + + print STDERR "coredump from " if ($dump == 1); + + print STDERR "signal $rc : ", $signame[$rc], "\n"; + + return 0; +} + +sub Kill () +{ + my $self = shift; + + if ($self->{RUNNING}) { + kill ('KILL', $self->{PROCESS}); + waitpid ($self->{PROCESS}, 0); + $self->check_return_value ($?); + } + + $self->{RUNNING} = 0; +} + +# Wait until a process exits. +# return -1 if the process is still alive. +sub Wait ($) +{ + my $self = shift; + my $timeout = shift; + if (!defined $timeout || $timeout < 0) { + waitpid ($self->{PROCESS}, 0); + } else { + return TimedWait($self, $timeout); + } + +} + +sub TimedWait ($) +{ + my $self = shift; + my $timeout = shift; + + $timeout *= $PerlACE::Process::WAIT_DELAY_FACTOR; + + my $status; + my $pid = VmsProcess::TimedWaitPid ($self->{PROCESS}, $timeout, $status); + if ($pid > 0) { + return $self->check_return_value ($status); + } + return -1; +} + +1; diff --git a/ACE/bin/PerlACE/Process_Win32.pm b/ACE/bin/PerlACE/Process_Win32.pm new file mode 100644 index 00000000000..2f0163b2da6 --- /dev/null +++ b/ACE/bin/PerlACE/Process_Win32.pm @@ -0,0 +1,405 @@ +# $Id$ + +use PerlACE::Run_Test; + +package PerlACE::Process; + +use strict; +use Win32::Process; +use File::Basename; +use Cwd; + +############################################################################### + +# This is what GetExitCode will return if the process is still running. +my $STILL_ACTIVE = 259; + +############################################################################### + +### Constructor and Destructor + +# +# Hack in purify support thru 2 environment variables: +# ACE_RUN_PURIFY_CMD: complete path to purify executable +# ACE_RUNTEST_DELAY: wait delay factor, default to 10 if +# ACE_RUN_PURIFY_CMD is defined, or 1 if +# ACE_RUN_PURIFY_CMD is not defined. +# ** Notice that when ACE_RUN_PURIFY_CMD is define, PerlACE::Process +# reports the return status of *purify*, not the process being purified. +# +# Also hack in the ability to run the test on a WinCE device using the +# ACE_WINCE_TEST_CONTROLLER environment variable. If set, it specifies a +# controlling program to use for setting up and executing the test. +# Further setup can be specialized depending on the value of the variable. + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + + $self->{RUNNING} = 0; + $self->{IGNOREEXESUBDIR} = 0; + $self->{IGNOREHOSTROOT} = 0; + $self->{PROCESS} = undef; + $self->{EXECUTABLE} = shift; + $self->{ARGUMENTS} = shift; + $self->{PURIFY_CMD} = $ENV{"ACE_RUN_PURIFY_CMD"}; + $self->{PURIFY_OPT} = $ENV{"ACE_RUN_PURIFY_OPT"}; + if (!defined $PerlACE::Process::WAIT_DELAY_FACTOR) { + if (defined $self->{PURIFY_CMD}) { + $PerlACE::Process::WAIT_DELAY_FACTOR = 10; + } + else { + $PerlACE::Process::WAIT_DELAY_FACTOR = 1; + } + } + $self->{WINCE_CTL} = $ENV{"ACE_WINCE_TEST_CONTROLLER"}; + + bless ($self, $class); + return $self; +} + +sub DESTROY +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: <", $self->{EXECUTABLE}, + "> still running upon object destruction\n"; + $self->Kill (); + } +} + +############################################################################### + +### Some Accessors + +sub Normalize_Executable_Name +{ + my $executable = shift; + + my $basename = basename ($executable); + my $dirname = dirname ($executable). '/'; + + $executable = $dirname.$PerlACE::Process::ExeSubDir.$basename.".EXE"; + + ## Installed executables do not conform to the ExeSubDir + if (! -x $executable && -x $dirname.$basename.'.EXE') { + $executable = $dirname.$basename.'.EXE'; + } + + $executable =~ s/\//\\/g; # / <- # color coding issue in devenv + + return $executable; +} + + +sub Executable +{ + my $self = shift; + + if (@_ != 0) { + $self->{EXECUTABLE} = shift; + } + + my $executable = $self->{EXECUTABLE}; + + if ($self->{IGNOREHOSTROOT} == 0) { + if (PerlACE::is_vxworks_test()) { + $executable = PerlACE::VX_HostFile ($executable); + } + } + + if ($self->{IGNOREEXESUBDIR} == 0) { + $executable = PerlACE::Process::Normalize_Executable_Name ($executable); + } + else { + if ($executable !~ m/.EXE$/i) { + $executable = $executable.".EXE"; + } + $executable =~ s/\//\\/g; # / <- # color coding issue in devenv + } + + return $executable; +} + +sub Arguments +{ + my $self = shift; + + if (@_ != 0) { + $self->{ARGUMENTS} = shift; + } + + return $self->{ARGUMENTS}; +} + +sub CommandLine () +{ + my $self = shift; + + my $commandline = $self->Executable (); + + if (defined $self->{ARGUMENTS}) { + $commandline .= ' '.$self->{ARGUMENTS}; + } + + return $commandline; +} + +sub IgnoreExeSubDir +{ + my $self = shift; + + if (@_ != 0) { + $self->{IGNOREEXESUBDIR} = shift; + } + + return $self->{IGNOREEXESUBDIR}; +} + +sub IgnoreHostRoot +{ + my $self = shift; + + if (@_ != 0) { + $self->{IGNOREHOSTROOT} = shift; + } + + return $self->{IGNOREHOSTROOT}; +} + +############################################################################### + +### Spawning processes + + +# Spawn the process and continue. + +sub Spawn () +{ + my $self = shift; + + if ($self->{RUNNING} == 1) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> already running\n"; + return -1; + } + + if (!defined $self->{EXECUTABLE}) { + print STDERR "ERROR: Cannot Spawn: No executable specified\n"; + return -1; + } + + if ($self->{IGNOREEXESUBDIR} == 0) { + if (!-f $self->Executable ()) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> not found\n"; + return -1; + } + + if (!-x $self->Executable ()) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> not executable\n"; + return -1; + } + } + + my $state = 0; + my $cmdline = ""; + my $executable = ""; + + if (defined $self->{PURIFY_CMD}) { + my $orig_cmdline = $self->CommandLine (); + $executable = $self->{PURIFY_CMD}; + my $basename = basename ($self->{EXECUTABLE}); + + my $PurifyOptions = $self->{PURIFY_OPT}; + if (!defined $PurifyOptions) { + $PurifyOptions = + "/run ". +# "/save-data=$basename.pfy ". + "/save-text-data=$basename.pfytxt ". + "/AllocCallStackLength=20 ". + "/ErrorCallStackLength=20 ". + "/HandlesInUseAtExit ". + "/InUseAtExit ". + "/LeaksAtExit "; + } + my $basename = basename ($self->{EXECUTABLE}); + $cmdline = + "purify " . + "$PurifyOptions ". + "$orig_cmdline" ; + } + elsif (defined $self->{WINCE_CTL}) { + $executable = $self->Executable (); + $cmdline = $self->CommandLine (); + + # Generate a script to copy the test down to the device, run it, + # copy the log file(s) back to the log directory, then delete the + # program and log files on the remote device. + unless (open (SCRIPT, ">start_test.cmd")) { + print STDERR "ERROR: Cannot Spawn: <", $self->Executable (), + "> failed to create start_test.cmd\n"; + return -1; + } + + my $testname = basename($executable,'.EXE'); + my $here = getcwd(); + $here =~ s/\//\\/g; + $executable =~ s/^\.//; # Chop leading . + $executable = $here . $executable; # Fully qualified name + # Take off the test name from the start of the command line. + # The command name is preprended in the script below. + my @tokens = split(' ', $cmdline); + @tokens = splice(@tokens,1); + $cmdline = join(' ', @tokens); + print SCRIPT "copy $executable 1:\\Windows\n"; + print SCRIPT "start /wait $testname $cmdline\n"; + print SCRIPT "copy 1:\\log\\$testname*.txt $here\\log\n"; + print SCRIPT "del 1:\\Windows\\$testname.exe\n"; + print SCRIPT "del 1:\\log\\$testname*.txt\n"; + close SCRIPT; + + $executable = $ENV{"ComSpec"}; + my $pocket_device_opts = $ENV{"ACE_PCE_DEVICE"}; + $cmdline = "cmd /C start /B /WAIT $self->{WINCE_CTL} $pocket_device_opts -m NAME=start_test.cmd;WAIT=401000; -e" + } + elsif (defined $ENV{'ACE_TEST_WINDOW'}) { + $state = ($ENV{'ACE_TEST_WINDOW'} =~ /\/k/i ? CREATE_NEW_CONSOLE : DETACHED_PROCESS); + $executable = $ENV{'ComSpec'}; + $cmdline = $ENV{'ACE_TEST_WINDOW'} . ' ' . $self->CommandLine(); + } + else { + $executable = $self->Executable (); + $cmdline = $self->CommandLine (); + } + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "$executable $cmdline\n"; + } + Win32::Process::Create ($self->{PROCESS}, + $executable, + $cmdline, + 0, + $state, + '.'); + + my $status = 0; + + Win32::Process::GetExitCode ($self->{PROCESS}, $status); + + if ($status != $STILL_ACTIVE) { + print STDERR "ERROR: Spawn failed for <", $self->CommandLine (), ">\n"; + return -1; + } + + $self->{RUNNING} = 1; + return 0; +} + + +# Wait for the process to exit or kill after a time period + +sub WaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + my $status = $self->TimedWait ($timeout); + + if ($status == -1) { + print STDERR "ERROR: $self->{EXECUTABLE} timedout\n"; + $self->Kill (); + # Don't need to Wait since we are on Win32 + } + + $self->{RUNNING} = 0; + + return $status; +} + + +# Do a Spawn and immediately WaitKill + +sub SpawnWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->Spawn () == -1) { + return -1; + } + + return $self->WaitKill ($timeout); +} + + +# Kill the process + +sub Kill ($) +{ + my $self = shift; + my $notused = shift; #Used in Process_Unix.pm + + if ($self->{RUNNING} && !defined $ENV{'ACE_TEST_WINDOW'}) { + Win32::Process::Kill ($self->{PROCESS}, -1); + } + + $self->{RUNNING} = 0; +} + + +# Terminate the process and wait for it to finish + +sub TerminateWaitKill ($) +{ + my $self = shift; + my $timeout = shift; + + if ($self->{RUNNING}) { + print STDERR "INFO: $self->{EXECUTABLE} being killed.\n"; + Win32::Process::Kill ($self->{PROCESS}, 0); + } + + return $self->WaitKill ($timeout); +} + + +# Wait until a process exits. +# return -1 if the process is still alive. + +sub Wait ($) +{ + my $self = shift; + my $timeout = shift; + if (!defined $timeout || $timeout < 0) { + $timeout = INFINITE; + } else { + $timeout = $timeout * 1000 * $PerlACE::Process::WAIT_DELAY_FACTOR; + } + + my $result = 0; + + if ($self->{RUNNING}) { + $result = Win32::Process::Wait ($self->{PROCESS}, $timeout); + if ($result == 0) { + return -1; + } + } + Win32::Process::GetExitCode ($self->{PROCESS}, $result); + return $result; +} + + +# Wait for a process to exit with a timeout + +sub TimedWait ($) +{ + my($self) = shift; + my($timeout) = shift; + return $self->Wait($timeout); +} + +1; diff --git a/ACE/bin/PerlACE/Run_Test.pm b/ACE/bin/PerlACE/Run_Test.pm new file mode 100644 index 00000000000..edb159f4e4d --- /dev/null +++ b/ACE/bin/PerlACE/Run_Test.pm @@ -0,0 +1,246 @@ +# $Id$ + +# This module contains a few miscellanous functions and some +# startup ARGV processing that is used by all tests. + +use PerlACE::Process; +use PerlACE::ConfigList; + +package PerlACE; +use File::Spec; +use Cwd; + +$PerlACE::ACE_ROOT = $ENV{ACE_ROOT}; +if(exists $ENV{TAO_ROOT}) { + $PerlACE::TAO_ROOT = $ENV{TAO_ROOT}; +} else { + $PerlACE::TAO_ROOT = "$PerlACE::ACE_ROOT/TAO"; +} +if(exists $ENV{CIAO_ROOT}) { + $PerlACE::CIAO_ROOT = $ENV{CIAO_ROOT}; +} else { + $PerlACE::CIAO_ROOT = "$PerlACE::TAO_ROOT/CIAO"; +} + +my $config = new PerlACE::ConfigList; +$PerlACE::TestConfig = $config; + +# load VxWorks Process helpers in case this is a VxWorks target build +$PerlACE::VxWorks_Test = $config->check_config("VxWorks"); +$PerlACE::VxWorks_RTP_Test = $config->check_config("VxWorks_RTP"); +if ($PerlACE::VxWorks_Test or $PerlACE::VxWorks_RTP_Test) { + require PerlACE::ProcessVX; +} + +# Load LabVIEW RT Process helpers in case this is a LabVIEW RT target build. +$PerlACE::LabVIEW_RT_Test = $config->check_config("LabVIEW_RT"); +if ($PerlACE::LabVIEW_RT_Test) { + require PerlACE::ProcessLVRT; +} + +# Figure out the svc.conf extension +$svcconf_ext = $ENV{"ACE_RUNTEST_SVCCONF_EXT"}; +if (!defined $svcconf_ext) { + $svcconf_ext = ".conf"; +} + +# Default timeout. NSCORBA needs more time for process start up. +$wait_interval_for_process_creation = (($PerlACE::VxWorks_Test or $PerlACE::VxWorks_RTP_Test) ? 60 : 15); +if ($^O eq 'VMS') { + $wait_interval_for_process_creation *= 3; +} + +$wait_interval_for_process_shutdown = (($PerlACE::VxWorks_Test or $PerlACE::VxWorks_RTP_Test) ? 30 : 10); + +# Turn on autoflush +$| = 1; + +sub LocalFile ($) +{ + my $file = shift; + + my $newfile = getcwd () . '/' . $file; + + if ($^O eq "MSWin32") { + $newfile =~ s/\//\\/g; + } + elsif ($^O eq 'cygwin') { + chop($newfile = `/usr/bin/cygpath -w $newfile`); + $newfile =~ s/\\/\\\\/g; + } + + return $newfile; +} + +sub VX_HostFile($) +{ + my $file = shift; + $file = File::Spec->rel2abs ($file); + $file = File::Spec->abs2rel ($file, $ENV{"ACE_ROOT"}); + return $ENV{"HOST_ROOT"}."/".$file; +} + +# Returns a random port within the range of 10002 - 32767 +sub random_port { + return (int(rand($$)) % 22766) + 10002; +} + +# Returns a unique id, uid for unix, last digit of IP for NT +sub uniqueid +{ + if ($^O eq "MSWin32") + { + my $uid = 1; + + open (IPNUM, "ipconfig|") || die "Can't run ipconfig: $!\n"; + + while (<IPNUM>) + { + if (/Address/) + { + $uid = (split (/: (\d+)\.(\d+)\.(\d+)\.(\d+)/))[4]; + } + } + + close IPNUM; + + return $uid; + } + else + { + return $>; + } +} + +# Waits until a file exists +sub waitforfile +{ + local($file) = @_; + sleep 1 while (!(-e $file && -s $file)); +} + +sub waitforfile_timed +{ + my $file = shift; + my $maxtime = shift; + $maxtime *= (($PerlACE::VxWorks_Test || $PerlACE::VxWorks_RTP_Test) ? $PerlACE::ProcessVX::WAIT_DELAY_FACTOR : $PerlACE::Process::WAIT_DELAY_FACTOR); + + while ($maxtime-- != 0) { + if (-e $file && -s $file) { + return 0; + } + sleep 1; + } + return -1; +} + +sub check_n_cleanup_files +{ + my $file = shift; + my @flist = glob ($file); + + my $cntr = 0; + my $nfile = scalar(@flist); + + if ($nfile != 0) { + for (; $cntr < $nfile; $cntr++) { + print STDERR "File <$flist[$cntr]> exists but should be cleaned up\n"; + } + unlink @flist; + } +} + +sub generate_test_file +{ + my $file = shift; + my $size = shift; + + while ( -e $file ) { + $file = $file."X"; + } + + my $data = "abcdefghijklmnopqrstuvwxyz"; + $data = $data.uc($data)."0123456789"; + + open( INPUT, "> $file" ) || die( "can't create input file: $file" ); + for($i=62; $i < $size ; $i += 62 ) { + print INPUT $data; + } + $i -= 62; + if ($i < $size) { + print INPUT substr($data, 0, $size-$i); + } + close(INPUT); + + return $file; +} + +sub is_vxworks_test() +{ + return ($PerlACE::VxWorks_Test || $PerlACE::VxWorks_RTP_Test); +} + +sub is_vxworks_rtp_test() +{ + return ($PerlACE::VxWorks_RTP_Test); +} + +sub add_path { + my $name = shift; + my $value = shift; + if (defined $ENV{$name}) { + $ENV{$name} .= ($^O eq 'MSWin32' ? ';' : ':') . $value + } + else { + $ENV{$name} = $value; + } +} + +sub add_lib_path { + my($value) = shift; + + # Set the library path supporting various platforms. + add_path('PATH', $value); + add_path('LD_LIBRARY_PATH', $value); + add_path('LIBPATH', $value); + add_path('SHLIB_PATH', $value); + + if (defined $ENV{"HOST_ROOT"}) { + add_path('PATH', VX_HostFile ($value)); + add_path('LD_LIBRARY_PATH', VX_HostFile ($value)); + add_path('LIBPATH', VX_HostFile ($value)); + add_path('SHLIB_PATH', VX_HostFile ($value)); + } +} + +sub check_privilege_group { + if ($^O eq 'hpux') { + my($access) = 'RTSCHED'; + my($status) = 0; + my($getprivgrp) = '/bin/getprivgrp'; + + if (-x $getprivgrp) { + if (open(GPG, "$getprivgrp |")) { + while(<GPG>) { + if (index($_, $access) >= 0) { + $status = 1; + } + } + close(GPG); + } + } + + if (!$status) { + print STDERR "WARNING: You must have $access privileges to run this test.\n", + " Run \"man 1m setprivgrp\" for more information.\n"; + exit(0); + } + } +} + +# Add PWD to the load library path +add_lib_path ('.'); + +$sleeptime = 5; + +1; diff --git a/ACE/bin/PerlACE/TestTarget.pm b/ACE/bin/PerlACE/TestTarget.pm new file mode 100644 index 00000000000..af0b39a9eae --- /dev/null +++ b/ACE/bin/PerlACE/TestTarget.pm @@ -0,0 +1,87 @@ +# $Id$ +# +# The TestTarget class is for operations that are per-target while testing. +# They can be overridden for specific needs like embedded systems, etc. + +package PerlACE::TestTarget; + +use strict; +use English; +use POSIX qw(:time_h); + +############################################################################### + +# Create the proper kind of TestTarget based on arguments or test +# configuration. Pass the PerlACE::ConfigList as the first argument. + +sub create_target +{ + my $config = shift; + my $target = undef; + if ($config->check_config("LabVIEW_RT")) { + require PerlACE::TestTarget_LVRT; + $target = new PerlACE::TestTarget_LVRT; + } + else { + $target = new PerlACE::TestTarget; + } + return $target; +} + +### Constructor and Destructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + + bless ($self, $class); + return $self; +} + +sub DESTROY +{ + my $self = shift; +} + +################################################################## + +sub LocalFile ($) +{ + my $self = shift; + my $file = shift; + my $newfile = PerlACE::LocalFile($file); + return $newfile; +} + +sub DeleteFile ($) +{ + my $self = shift; + my $file = shift; + unlink $file; +} + +sub WaitForFileTimed ($) +{ + my $self = shift; + my $file = shift; + my $timeout = shift; + return PerlACE::waitforfile_timed ($file, $timeout); +} + +sub CreateProcess ($) +{ + my $self = shift; + my $process = new PerlACE::Process (@_); + return $process; +} + +# Don't need to do anything in most cases. +sub GetStderrLog ($) +{ + my $self = shift; + return; +} + +1; diff --git a/ACE/bin/PerlACE/TestTarget_LVRT.pm b/ACE/bin/PerlACE/TestTarget_LVRT.pm new file mode 100644 index 00000000000..a00a85fd306 --- /dev/null +++ b/ACE/bin/PerlACE/TestTarget_LVRT.pm @@ -0,0 +1,161 @@ +# $Id$ +# +# TestTarget_LVRT - how to manage the test environment on a LabVIEW RT target. +# +# We can FTP files to and from the LabVIEW target, but there's no NFS or +# SMB shares. +# Most information about the target itself is specified via environment +# variables. The current environment variables are: +# ACE_RUN_LVRT_TGTHOST - the host name/IP of the target. +# ACE_RUN_LVRT_FSROOT - the root of the filesystem on the target where +# ACE files will be created from (cwd, if you will). +# If not specified, "\ni-rt" is used as the root. + +package PerlACE::TestTarget_LVRT; +our @ISA = "PerlACE::TestTarget"; + +### Constructor and Destructor + +sub new +{ + my $proto = shift; + my $class = ref ($proto) || $proto; + my $self = {}; + + my $targethost; + if (defined $ENV{'ACE_RUN_LVRT_TGTHOST'}) { + $targethost = $ENV{'ACE_RUN_LVRT_TGTHOST'}; + } + else { + print STDERR "You must define target hostname/IP with ", + "ACE_RUN_LVRT_TGTHOST\n"; + return -1; + } + + my $fsroot = $ENV{'ACE_RUN_LVRT_FSROOT'}; + if (!defined $fsroot) { + $fsroot = '\\ni-rt'; + } + $self->{FSROOT} = $fsroot; + + $self->{FTP} = new Net::FTP ($targethost); + $self->{TGTHOST} = $targethost; + if (!defined $self->{FTP}) { + print STDERR "$@\n"; + return -1; + } + $self->{FTP}->login("",""); + $self->{TARGET} = undef; + $self->{REBOOT_TIME} = $ENV{"ACE_RUN_LVRT_REBOOT_TIME"}; + if (!defined $self->{REBOOT_TIME}) { + $self->{REBOOT_TIME} = 200; + } + + bless ($self, $class); + return $self; +} + +################################################################## + +sub LocalFile ($) +{ + my $self = shift; + my $file = shift; + my $newfile = $self->{FSROOT} . '\\' . $file; + print STDERR "LVRT LocalFile for $file is $newfile\n"; + return $newfile; +} + +sub DeleteFile ($) +{ + my $self = shift; + my $file = shift; + $self->{FTP}->login("",""); + $self->{FTP}->delete($file); +} + +sub WaitForFileTimed ($) +{ + my $self = shift; + my $file = shift; + my $timeout = shift; + my $targetport = 8888; + my $target = new Net::Telnet(Timeout => 600, Errmode => 'return'); + if (!$target->open(Host => $self->{TGTHOST}, Port => $targetport)) { + print STDERR "ERROR: target $self->{TGTHOST}:$targetport: ", + $target->errmsg(), "\n"; + return -1; + } + my $cmdline = "waitforfile $file $timeout"; + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "-> $cmdline\n"; + } + $target->print("$cmdline"); + my $reply; + $reply = $target->getline(); + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "<- $reply\n"; + } + $target->close(); + if ($reply eq "OK\n") { + return 0; + } + return -1; +} + +sub CreateProcess ($) +{ + my $self = shift; + my $process = new PerlACE::ProcessLVRT (@_); + return $process; +} + +sub GetStderrLog ($) +{ + my $self = shift; + # Tell the target to snapshot the stderr log; if there is one, copy + # it up here and put it out to our stderr. + my $targetport = 8888; + my $target = new Net::Telnet(Timeout => 600, Errmode => 'return'); + if (!$target->open(Host => $self->{TGTHOST}, Port => $targetport)) { + print STDERR "ERROR: target $self->{TGTHOST}:$targetport: ", + $target->errmsg(), "\n"; + return; + } + my $cmdline = "snaplog"; + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "-> $cmdline\n"; + } + $target->print("$cmdline"); + my $reply; + $reply = $target->getline(); + if (defined $ENV{'ACE_TEST_VERBOSE'}) { + print "<- $reply\n"; + } + $target->close(); + if ($reply eq "NONE\n") { + return; + } + chomp $reply; + $self->{FTP}->ascii(); + if ($self->{FTP}->get($reply, "stderr.txt")) { + $self->{FTP}->delete($reply); + open(LOG, "stderr.txt"); + while (<LOG>) { + print STDERR; + } + close LOG; + unlink "stderr.txt"; + } + return; +} + +# Copy a file to the target. Adjust for different types (DLL, EXE, TEXT) +# and debug/non (for DLLs). Additionally, a file can be removed when this +# object is deleted, or left in place. +sub NeedFile ($) +{ + my $self = shift; +} + +1; diff --git a/ACE/bin/PerlACE/perlace.mpc b/ACE/bin/PerlACE/perlace.mpc new file mode 100644 index 00000000000..8139eee3a2d --- /dev/null +++ b/ACE/bin/PerlACE/perlace.mpc @@ -0,0 +1,13 @@ +// -*- MPC -*- +// $Id$ + +project(PerlACE) : script { + Script_Files { + ConfigList.pm + Process.pm + Process_Unix.pm + Process_Win32.pm + Run_Test.pm + } + custom_only=1 +} diff --git a/ACE/bin/PythonACE/__init__.py b/ACE/bin/PythonACE/__init__.py new file mode 100644 index 00000000000..de05225d2cf --- /dev/null +++ b/ACE/bin/PythonACE/__init__.py @@ -0,0 +1,2 @@ + +import fuzz diff --git a/ACE/bin/PythonACE/fuzz/__init__.py b/ACE/bin/PythonACE/fuzz/__init__.py new file mode 100644 index 00000000000..26a7b9a3faf --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/__init__.py @@ -0,0 +1,97 @@ +""" This init script loads all python modules in the current directory that + do not start with an '_', loads them as a module""" + +file_type_handlers = dict () + +def register_handler (module): + + for item in module.type_list: + if file_type_handlers.has_key (item): + file_type_handlers[item].append (module.handler) + else: + handlers = list () + handlers.append (module.handler) + file_type_handlers[item] = handlers + +import re + +extension_re = re.compile(".+\.([^.]+)$") + + + +# The following is the initialization logic that is executed +# when the fuzz module is loaded +from os import listdir, chdir, getcwd +from sys import stderr, path +oldwd = getcwd () + +try: + # The following is a trick to get the directory THIS SCRIPT - note, not necessarily the CWD - + # is located. We use this path later to load all of the available fuzz checks. + import _path + script_path = str (_path).split ()[3][1:-11] + if script_path == "": + script_path = "." + + chdir (script_path) + + path.append (getcwd ()) + + files = listdir (".") + + modules = list () + + # We need to import the warning handler here. If we use a traditional import elsewhere, + # we get all kinds of problems with the warning_handler being imported twice - once as + # fuzz._warning_handler and again as _warning_handler - making the singleton instances + # NOT the same. + _warning_handler = __import__ ("_warning_handler") + Warning_Handler = _warning_handler.Warning_Handler + STDERR = _warning_handler.STDERR + MAILER = _warning_handler.MAILER + + for item in files: + if (item[0] != '_') and (item[-3:] == ".py"): + print "Registering " + item [:-3] + try: + module = __import__ (item[:-3]) + register_handler (module) + except: + stderr.write ("FUZZ ERROR: Unable to load the " + item[:-3] + " module, please notify the build czar\n") + +finally: + chdir (oldwd) + + +def fuzz_check (file_name, file_content): + # If the user of the module has not instanciated the warning handler, + # lets do it here + if not Warning_Handler._isInstantiated (): + Warning_Handler.getInstance (STDERR) + + # get the file extension + ext_match = extension_re.search (file_name) + if ext_match == None: + # we don't have no stinking file extension! + ext = "" + else: + ext = ext_match.group (1) + + retval = 0 + + if file_type_handlers.has_key (ext): + for handler in file_type_handlers[ext]: + try: # We don't want one misbehaving handler to screw up the whole sustem + retval += handler (file_name, file_content) + except: + stderr.write ("An unknown exception was thrown while trying to run one of the handlers\n") + + # Run the generic handlers + for handler in file_type_handlers["*"]: + try: # We don't want one misbehaving handler to screw up the whole sustem + retval += handler (file_name, file_content) + except: + stderr.write ("An unknown exception was thrown while trying to run one of the handlers\n") + + + return retval diff --git a/ACE/bin/PythonACE/fuzz/_fuzz.py b/ACE/bin/PythonACE/fuzz/_fuzz.py new file mode 100644 index 00000000000..5dccaa8136e --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/_fuzz.py @@ -0,0 +1,3 @@ +""" Defines the fuzz_check function """ + + diff --git a/ACE/bin/PythonACE/fuzz/_generic_handler.py b/ACE/bin/PythonACE/fuzz/_generic_handler.py new file mode 100644 index 00000000000..ffc7bc10167 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/_generic_handler.py @@ -0,0 +1,44 @@ +""" Defines a generic handler that tests against a given regex, and allows for exclusions. """ + +from sys import stderr +import _warning_handler + +def generic_handler (regex, begin_exclude, end_exclude, error_message, file_name, file_content, warn = False): + retval = 0 + + if regex.search (file_content) != None: + # We have a potential violation, lets check + lines = file_content.splitlines () + exclusion = False + for line in range (len (lines)): + if begin_exclude.search (lines[line]) != None: + exclusion = True + elif end_exclude.search (lines[line]) != None: + exclusion = False + elif (exclusion == False) and (regex.search (lines[line]) != None): + # Violation! + msg = file_name + ':' + str (line + 1) + error_message + if not warn: + stderr.write (msg) + retval = 1 + else: + handler = _warning_handler.Warning_Handler.getInstance () + handler.add_warning (msg) + return retval + +def generic_handler_no_exceptions (regex, error_message, file_name, file_content, warn = False): + retval = 0 + + if regex.search (file_content) != None: + # We have a potential violation, lets check + lines = file_content.splitlines () + for line in range (len (lines)): + if regex.search (lines[line]) != None: + msg = file_name + ':' + str (line + 1) + error_message + # Violation! + if not warn: + stderr.write (msg) + retval = 1 + else: + Warning_Handler.getInstance ().add_warning (msg) + return retval diff --git a/ACE/bin/PythonACE/fuzz/_mailer.py b/ACE/bin/PythonACE/fuzz/_mailer.py new file mode 100644 index 00000000000..6e33cc82c9e --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/_mailer.py @@ -0,0 +1,106 @@ +""" This module implements a mailer to mail a user about fuzz warnings """ + +import _singleton + +def ldap_lookup (username): + """ Performs a ldap lookup to find the email address associated with + username. If none exists, it returns the empty string.""" + import ldap + + try: + conn = ldap.open ("ldap.dre.vanderbilt.edu") + conn.protocol_version = ldap.VERSION3 + + baseDN = "dc=dre,dc=vanderbilt,dc=edu" + scope = ldap.SCOPE_SUBTREE + attrFilter = None + searchFilter = "uid=" + username + + result = conn.search (baseDN, scope, searchFilter, attrFilter) + + result_type, result_data = conn.result (result, 0) + email = "" + if (result_data != []) and (result_type == ldap.RES_SEARCH_ENTRY): + # we have a valid result! + if (result_data[0][1].has_key ('mail')): + email = result_data[0][1]['mail'][0] + elif (result_data[0][1].has_key ('svnmail')): + email = result_data[0][1]['svnmail'][0] + else: + email = "" + + conn.unbind () + + return email + except: + # Some error occurred when looking this guy up. + return "" + + + +class Mailer: + def __init__ (self): + self.recipient = "" + self.body = """\ +This is an automatically generated message from the fuzz check system +in the subversion repository. + +Your recent commit to the ACE/TAO/CIAO repository had a number of warnings +which should be addressed. + +""" + self.warnings = "" + self.subject = "Your recent commit to the DOC group repository." + self.sent = False + + def get_messages (self): + return self.warnings + def open (self, ldap_user_name): + from sys import stderr + stderr.write ("LDAP Name: " + ldap_user_name.rstrip () + "\n") + self.recipient = ldap_lookup (ldap_user_name.rstrip ()) + + def add_warning (self, warning_text): + self.warnings += warning_text + + def close (self): + try: + message = """\ +From: %s +To: %s +Subject: %s +\r\n +%s +""" % ("bczar@dre.vanderbilt.edu", + self.recipient, + self.subject, + self.body + self.warnings) + + print message + + import smtplib + server = smtplib.SMTP('discovery.isis.vanderbilt.edu') + server.sendmail ("bczar@dre.vanderbilt.edu", + [self.recipient], + message) + except smtplib.SMTPRecipientsRefused: + print "Recipients refused exception" + server.close () + except smtplib.SMTPHeloError: + print "Helo error" + server.close () + except smtplib.SMTPSenderRefused: + print "Sender refused" + server.close () + except smtplib.SMTPDataError: + print "Data error" + server.close () + except: + from sys import stderr + stderr.write ("Caught exception while sending email\n") + server.close () + + + + + diff --git a/ACE/bin/PythonACE/fuzz/_path.py b/ACE/bin/PythonACE/fuzz/_path.py new file mode 100644 index 00000000000..e69de29bb2d --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/_path.py diff --git a/ACE/bin/PythonACE/fuzz/_singleton.py b/ACE/bin/PythonACE/fuzz/_singleton.py new file mode 100644 index 00000000000..f7a686d4988 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/_singleton.py @@ -0,0 +1,60 @@ +""" Implements a singleton mixin class """ + +# The following code was written by Gary Robinson +# (grobinson@transpose.com) and placed in the public domain. His +# copyright notice is as follows: + +# By Gary Robinson, grobinson@transpose.com. No rights reserved -- +# placed in the public domain -- which is only reasonable considering +# how much it owes to other people's version which are in the +# public domain. The idea of using a metaclass came from +# a comment on Gary's blog (see +# http://www.garyrobinson.net/2004/03/python_singleto.html#comments). +# Other improvements came from comments and email from other +# people who saw it online. (See the blog post and comments +# for further credits.) + +# Not guaranteed to be fit for any particular purpose. Use at your +# own risk. + + +class SingletonException(Exception): + pass + +class MetaSingleton(type): + def __new__(metaclass, strName, tupBases, dict): + if dict.has_key('__new__'): + raise SingletonException, 'Can not override __new__ in a Singleton' + return super(MetaSingleton,metaclass).__new__(metaclass, strName, tupBases, dict) + + def __call__(cls, *lstArgs, **dictArgs): + raise SingletonException, 'Singletons may only be instantiated through getInstance()' + +class Singleton(object): + __metaclass__ = MetaSingleton + + def getInstance(cls, *lstArgs): + """ + Call this to instantiate an instance or retrieve the existing instance. + If the singleton requires args to be instantiated, include them the first + time you call getInstance. + """ + if cls._isInstantiated(): + if len(lstArgs) != 0: + raise SingletonException, 'If no supplied args, singleton must already be instantiated, or __init__ must require no args' + else: + if cls._getConstructionArgCountNotCountingSelf() > 0 and len(lstArgs) <= 0: + raise SingletonException, 'If the singleton requires __init__ args, supply them on first instantiation' + instance = cls.__new__(cls) + instance.__init__(*lstArgs) + cls.cInstance = instance + return cls.cInstance + getInstance = classmethod(getInstance) + + def _isInstantiated(cls): + return hasattr(cls, 'cInstance') + _isInstantiated = classmethod(_isInstantiated) + + def _getConstructionArgCountNotCountingSelf(cls): + return cls.__init__.im_func.func_code.co_argcount - 1 + _getConstructionArgCountNotCountingSelf = classmethod(_getConstructionArgCountNotCountingSelf) diff --git a/ACE/bin/PythonACE/fuzz/_types.py b/ACE/bin/PythonACE/fuzz/_types.py new file mode 100644 index 00000000000..d5cb851c440 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/_types.py @@ -0,0 +1,6 @@ +""" Defines a number of file extension groupings """ + +source_files = ["c", "cc", "cpp", "cxx"] +header_files = ["h", "cc", "cpp", "cxx"] +inline_files = ["i", "ipp", "inl", "ixx"] +idl_files = ["idl"] diff --git a/ACE/bin/PythonACE/fuzz/_warning_handler.py b/ACE/bin/PythonACE/fuzz/_warning_handler.py new file mode 100644 index 00000000000..f88b43a0782 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/_warning_handler.py @@ -0,0 +1,53 @@ +""" Implements a warning handler base class and a simple handler that simply + outputs warnings to stderr. """ + +import _singleton + +# Constants +STDERR = 1 +MAILER = 2 + +from sys import stderr + +class Warning_Handler (_singleton.Singleton): + def __init__(self, handlertype=STDERR): + """ Constructor. Type should be either STDERR or MAILER. + There are probably better ways to do this, but it is implemented + this way because I only wanted to have a dependancy on ldap if someone + actually wanted to use the mailer. """ + super (Warning_Handler, self).__init__ () + self.messages = "" + self.add_warning = self.default_add_warning + self.close = self.default_close + self.open = self.default_open + + if handlertype is STDERR: + self.add_warning = self.stderr_add_warning + elif handlertype is MAILER: + from _mailer import Mailer + self.handler = Mailer () + self.add_warning = self.handler.add_warning + self.open = self.handler.open + self.close = self.handler.close + self.get_messages = self.handler.get_messages + else: + self.add_warning = self.stderr_add_warning + + def default_add_warning (self, warning_text): + pass + + def default_open (self, arg = ""): + pass + + def default_close (self, arg = ""): + pass + + def get_messages (self): + return self.messages + + def stderr_add_warning (self, warning_text): + stderr.write (warning_text) + return + + + diff --git a/ACE/bin/PythonACE/fuzz/check_includes.py b/ACE/bin/PythonACE/fuzz/check_includes.py new file mode 100644 index 00000000000..7fd8e744c90 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/check_includes.py @@ -0,0 +1,20 @@ +""" Checks that includes of files in ace/tao/ciao use "" instead of <> """ + +import _types +type_list = _types.source_files + _types.header_files + _types.inline_files + _types.idl_files + +from sys import stderr +import re + +regex = re.compile ("\s*#\s*include\s*(\/\*\*\/){0,1}\s*<(ace|tao|ciao|TAO|CIAO).*>") +begin_exclude = re.compile ("FUZZ\: disable check_for_include") +end_exclude = re.compile ("FUZZ\: enable check_for_include") + +error_message = ": error: contains an include to ace/tao/ciao code using <>, instead of \"\"\n" + +from _generic_handler import generic_handler + +def handler (file_name, file_content): + return generic_handler (regex, begin_exclude, end_exclude, error_message, file_name, file_content) + + diff --git a/ACE/bin/PythonACE/fuzz/cpp_inline.py b/ACE/bin/PythonACE/fuzz/cpp_inline.py new file mode 100644 index 00000000000..1db614c103b --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/cpp_inline.py @@ -0,0 +1,23 @@ +""" Checks for ACE_INLINE or and ASYS_INLINE in a .cpp file """ +from _types import source_files +type_list = source_files + + +import re +from sys import stderr +regex = re.compile ("(^\s*ACE_INLINE)|(^\s*ASYS_INLINE)", re.MULTILINE) + +error_message = ": error: ACE_INLINE or ASYS_INLINE found in .cpp file\n" + +def handler (file_name, file_content): + if regex.search (file_content) != None: + # Lets take some time to generate a detailed error report + # since we appear to have a violation + lines = file_content.splitlines () + for line in range (len (lines)): + if regex.search (lines[line]) != None: + stderr.write (file_name + ':' + str (line + 1) + error_message) + + return 1 + else: + return 0 diff --git a/ACE/bin/PythonACE/fuzz/inline.py b/ACE/bin/PythonACE/fuzz/inline.py new file mode 100644 index 00000000000..c981289d105 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/inline.py @@ -0,0 +1,19 @@ +""" Checks that the C++ inline keyword is not used """ + +from _types import inline_files +type_list = inline_files + +from sys import stderr +import re + +regex = re.compile ("(\s|^)+inline\s+") +begin_exclude = re.compile ("FUZZ\: disable check_for_inline") +end_exclude = re.compile ("FUZZ\: enable check_for_inline") + +error_message = ": error: contains a C++ inline keyword, instead of ACE_INLINE\n" + +from _generic_handler import generic_handler + +def handler (file_name, file_content): + return generic_handler (regex, begin_exclude, end_exclude, error_message, file_name, file_content) + diff --git a/ACE/bin/PythonACE/fuzz/math_include.py b/ACE/bin/PythonACE/fuzz/math_include.py new file mode 100644 index 00000000000..cedbddb0b31 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/math_include.py @@ -0,0 +1,19 @@ +""" Checks that the C++ inline keyword is not used """ + +import _types +type_list = _types.source_files + _types.header_files + _types.inline_files + +from sys import stderr +import re + +regex = re.compile ("^\s*#\s*include\s*(\/\*\*\/){0,1}\s*\<math\.h\>") +begin_exclude = re.compile ("FUZZ\: disable check_math_include") +end_exclude = re.compile ("FUZZ\: enable check_math_include") + +error_message = ": error: contains an include to math.h\n" + +from _generic_handler import generic_handler + +def handler (file_name, file_content): + return generic_handler (regex, begin_exclude, end_exclude, error_message, file_name, file_content) + diff --git a/ACE/bin/PythonACE/fuzz/max_filename.py b/ACE/bin/PythonACE/fuzz/max_filename.py new file mode 100644 index 00000000000..26932064258 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/max_filename.py @@ -0,0 +1,16 @@ +""" Checks that filenames are the correct length """ + +type_list = ["*"] + +max_filename_length = 50 + +from os.path import split +from sys import stderr + +def handler (file_name, file_content): + path, filename = split (file_name) + if len (filename) >= max_filename_length: + stderr.write (file_name + ":0: error: File name meets or exceeds maximum allowable length (" + + str (max_filename_length) + ")\n") + return 1 + return 0 diff --git a/ACE/bin/PythonACE/fuzz/max_project_len.py b/ACE/bin/PythonACE/fuzz/max_project_len.py new file mode 100644 index 00000000000..e00c7937026 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/max_project_len.py @@ -0,0 +1,27 @@ +""" Checks that project names are not too long """ + +from max_filename import max_filename_length + +type_list = ["mpc"] + +max_proj_len = max_filename_length - 12 # GNUmakefile. + +from sys import stderr +import re + +regex = re.compile ("\s*project\s*\((\w+)\)") + +def handler (file_name, file_content): + match = regex.search (file_content) + if match == None: + return 0 + else: + for group in match.groups (): + if (len (group) >= max_proj_len): + stderr.write (file_name + ":0: error: Project named " + group + + " meets or exceeds the maximum project name length of " + + str (max_proj_len) + " characters\n") + + return 1 + + diff --git a/ACE/bin/PythonACE/fuzz/newline.py b/ACE/bin/PythonACE/fuzz/newline.py new file mode 100644 index 00000000000..39847e05c65 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/newline.py @@ -0,0 +1,17 @@ +""" Checks that the file has a newline at the end. """ + +type_list = ["cpp", "h", "inl", "html", "idl", "pl"] + +import re +from sys import stderr + +regex = re.compile ("\n\Z") + +def handler (file_name, file_content): + if regex.search (file_content) == None: + stderr.write (file_name + ":0: error: " + file_name + " lacks a newline at the end of the file.\n") + return 1 + else: + return 0 + + diff --git a/ACE/bin/PythonACE/fuzz/no_conflict_markers.py b/ACE/bin/PythonACE/fuzz/no_conflict_markers.py new file mode 100644 index 00000000000..62066b42333 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/no_conflict_markers.py @@ -0,0 +1,20 @@ +""" Checks that the file does not contain SVN conflict markers """ + + +type_list = ["*"] + +from sys import stderr +import re + +regex = re.compile ("^<<<<<<< \.|>>>>>>> \.r|^=======$", re.MULTILINE) +begin_exclude = re.compile ("FUZZ\: disable conflict_marker_check") +end_exclude = re.compile ("FUZZ\: enable conflict_marker_check") + +error_message = ": error: contains a SVN conflict marker. Please resolve the conflict before committing.\n" + +from _generic_handler import generic_handler + +def handler (file_name, file_content): + return generic_handler (regex, begin_exclude, end_exclude, error_message, file_name, file_content) + + diff --git a/ACE/bin/PythonACE/fuzz/noncvs.py b/ACE/bin/PythonACE/fuzz/noncvs.py new file mode 100644 index 00000000000..de52422c80d --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/noncvs.py @@ -0,0 +1,12 @@ +""" Catches most files disallowed in CVS """ + +type_list = ["icc", "ncb", "opt", "zip", "dsw", + "vcproj", "dsw", "bor", "vcp", "pdb", + "o", "ilk", "pyc", "so", "dll", "lib" ] + +from sys import stderr + +def handler (file_name, file_content): + stderr.write (file_name + ":0: error: This file should not be checked into the repository\n") + return 1 + diff --git a/ACE/bin/PythonACE/fuzz/ptr_arith_t.py b/ACE/bin/PythonACE/fuzz/ptr_arith_t.py new file mode 100644 index 00000000000..4ee73babb43 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/ptr_arith_t.py @@ -0,0 +1,17 @@ +""" Checks that ptr_arith_t usage in source code. ptr_arithh_t is non-portable + use ptrdiff_t instead. """ + +import _types +type_list = _types.source_files + _types.header_files + _types.inline_files + +from sys import stderr +import re + +regex = re.compile ("(ptr_arith_t )|(ptr_arith_t,)") +error_message = ": error: contains a non portable reference to ptr_arith_t, use ptrdiff_t instead.\n" + +from _generic_handler import generic_handler_no_exceptions + +def handler (file_name, file_content): + return generic_handler_no_exceptions (regex, error_message, file_name, file_content) + diff --git a/ACE/bin/PythonACE/fuzz/refcountservantbase.py b/ACE/bin/PythonACE/fuzz/refcountservantbase.py new file mode 100644 index 00000000000..31d8d5bb3a9 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/refcountservantbase.py @@ -0,0 +1,17 @@ +""" Checks that an obsolete PortableServer::RefCountServantBase is not used """ + +from _types import header_files +type_list = header_files + +from sys import stderr +import re + +regex = re.compile ("RefCountServantBase") + +error_message = ": error: reference to deprecated PortableServer::RefCountServantBase\n" + +from _generic_handler import generic_handler_no_exceptions + +def handler (file_name, file_content): + return generic_handler_no_exceptions (regex, error_message, file_name, file_content) + diff --git a/ACE/bin/PythonACE/fuzz/streams_include.py b/ACE/bin/PythonACE/fuzz/streams_include.py new file mode 100644 index 00000000000..24def75fd66 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/streams_include.py @@ -0,0 +1,19 @@ +""" Checks for inclusion of a non efficient streams include """ + +import _types +type_list = _types.source_files +_types. header_files + _types.inline_files + +import re + +regex = re.compile ("^\s*#\s*include\s*(\/\*\*\/){0,1}\s*\"ace\/streams\.h\"") +begin_exclude = re.compile ("FUZZ\: disable check_for_streams_include") +end_exclude = re.compile ("FUZZ\: enable check_for_streams_include") + +error_message = ": warning: expensive ace/streams.h included; consider ace/iosfwd.h\n" + +from _generic_handler import generic_handler +def handler (file_name, file_content): + return generic_handler (regex, begin_exclude, + end_exclude, error_message, + file_name, file_content, True) + diff --git a/ACE/bin/PythonACE/fuzz/verify_changelog.py b/ACE/bin/PythonACE/fuzz/verify_changelog.py new file mode 100644 index 00000000000..b84f2b3d147 --- /dev/null +++ b/ACE/bin/PythonACE/fuzz/verify_changelog.py @@ -0,0 +1,13 @@ +""" Verifies that changelogs obey certain properties """ + +type_list = [""] + +from sys import stderr +import re + +backslashes = re.compile ("") + +def handler (filename, filetext): + return 0 + + diff --git a/ACE/bin/Uniqueid.pm b/ACE/bin/Uniqueid.pm new file mode 100644 index 00000000000..f1367caa6e4 --- /dev/null +++ b/ACE/bin/Uniqueid.pm @@ -0,0 +1,28 @@ +# $Id$ +sub uniqueid +{ + if ($^O eq "MSWin32") + { + my $uid = 1; + + open (IPNUM, "ipconfig|") || die "Can't run ipconfig: $!\n"; + + while (<IPNUM>) + { + if (/Address/) + { + $uid = (split (/: (\d+)\.(\d+)\.(\d+)\.(\d+)/))[4]; + } + } + + close IPNUM; + + return $uid; + } + else + { + return getpwnam (getlogin ()); + } +} + +1;
\ No newline at end of file diff --git a/ACE/bin/ace-install b/ACE/bin/ace-install new file mode 100755 index 00000000000..8a26fd802e5 --- /dev/null +++ b/ACE/bin/ace-install @@ -0,0 +1,513 @@ +#!/bin/sh + +# $Id$ + + +##################################################################### +# install_ace: distill the minimal stuff out of the ACE+TAO distribution +# alias cpio 'xargs -i echo {}'; # just for testing the script +# +# according to David Levine <levine@cs.wustl.edu> on 1999/01/09: +# +# An even better way would be to only build what you need. +# These directories are probably a good start: +# +# ace +# apps/gperf/src +# TAO/tao +# TAO/TAO_IDL +# TAO/orbsvcs +# +# netsvcs ? - not built in here, probably useful +# +##################################################################### + +# actions +unpack=0 +config=0 +compile=0 +install=0 +force=0 + +# can we do it? +die=0 + + +##################################################################### +# check for install_ace options +##################################################################### + +while [ $# -gt 0 ]; do + + case $1 in + + ########################################## + # help output + + -h | --help*) + echo " " + echo "`basename $0` [options]" + echo " " + echo "options:" + echo " -h, --help show brief help" + echo " " + echo "required options:" + echo " -r, --aceroot=ACE_ROOT use ACE_ROOT directory for build/install" + echo " " + echo "extracting and configuring options:" + echo " -z, --archive=FILE unpack specified source archive" + echo " -p, --platform=HEADER,MAKE use HEADER,MAKE as config.h, platform_macros" + echo " " + echo "compiling options:" + echo " -c, --compile=ACE_OPTS compile with make options (e.g. debug=0)" + echo " " + echo "installing options:" + echo " -i, --install=ACE_DEST install into ACE_DEST directory" + echo " -a, --arch=ACE_ARCH use ACE_ARCH subdirs for arch-dependent files" + echo " " + echo "miscellaneous options:" + echo " -f, --force don't ask for confirmation before proceeding" + echo " " + exit 0 + ;; + + ########################################## + # required options + + -r) + shift + if [ $# -gt 0 ]; then + ACE_ROOT=$1; export ACE_ROOT + else + echo "no ACE_ROOT specified" + exit 1 + fi + shift + ;; + + --aceroot*) + ACE_ROOT=`echo $1 | sed -e 's/^[^=]*=//g'`; export ACE_ROOT + shift + ;; + + ########################################## + # extracting and configuring options + + -z) + shift + if [ $# -gt 0 ]; then + ACE_ARCHIVE=$1; export ACE_ARCHIVE + unpack=1 + else + echo "no archive specified" + exit 1 + fi + shift + ;; + + --archive*) + ACE_ARCHIVE=`echo $1 | sed -e 's/^[^=]*=//g'`; export ACE_ARCHIVE + unpack=1 + shift + ;; + + -p) + shift + if [ $# -gt 0 ]; then + ACE_HEADER=`echo $1 | cut -f 1 -d ,`; export ACE_HEADER + ACE_MAKE=`echo $1 | cut -f 2 -d ,`; export ACE_MAKE + else + echo "no header,make files specified" + exit 1 + fi + config=1 + shift + ;; + + --platform*) + stuff=`echo $1 | sed -e 's/^[^=]*=//g'` + ACE_HEADER=`echo $stuff | cut -f 1 -d ,`; export ACE_HEADER + ACE_MAKE=`echo $stuff | cut -f 2 -d ,`; export ACE_MAKE + config=1 + shift + ;; + + ########################################## + # compiling options + + -c) + shift + if [ $# -gt 0 ]; then + ACE_OPTS="$1"; export ACE_OPTS + compile=1 + else + echo "no compilation options specified (e.g. debug=0)" + exit 1 + fi + shift + ;; + + --compile*) + ACE_OPTS=`echo $1 | sed -e 's/^[^=]*=//g'`; export ACE_OPTS + compile=1 + shift + ;; + + ########################################## + # installing options + + -i) + shift + if [ $# -gt 0 ]; then + ACE_DEST=$1; export ACE_DEST + install=1 + else + echo "no installation target directory specified (e.g. /tools/ace)" + exit 1 + fi + shift + ;; + + --install*) + ACE_DEST=`echo $1 | sed -e 's/^[^=]*=//g'`; export ACE_DEST + install=1 + shift + ;; + + -a) + shift + if [ $# -gt 0 ]; then + ACE_ARCH=$1; export ACE_ARCH + else + echo "no installation target architecture specified" + exit 1 + fi + shift + ;; + + --arch*) + ACE_ARCH=`echo $1 | sed -e 's/^[^=]*=//g'`; export ACE_ARCH + shift + ;; + + ########################################## + # miscellaneous options + + -f) + shift + force=1 + ;; + + *) + # no more options, get on with life + if [ $# -gt 0 ]; then + echo "unrecognized option: $1" + exit 1 + fi + ;; + esac +done + + +##################################################################### +# sanity checks for required variables +##################################################################### + +if [ $install -ne 0 -a $compile -ne 0 -a $unpack -eq 0 ]; then + echo "- No actions specified." + die=1 +fi + +if [ $unpack -ne 0 -a $compile -ne 0 -a $config -eq 0 ] \ + || [ $unpack -ne 0 -a $install -ne 0 -a $config -eq 0 ]; then + echo "- Must set platform config options with --platform option" + echo " (`basename $0` -h for help) to unpack and compile/install" + die=1 +fi + +if [ -z "$ACE_ROOT" ]; then + echo "- Must set ACE_ROOT directory before proceeding..." + echo " The directory may be set with the ACE_ROOT environment" + echo " variable or the --aceroot option (`basename $0` -h for help)" + die=1 +fi + +if [ $install -eq 1 -a -z "$ACE_ARCH" ]; then + # just set it to blank if we want to flatten this level of subdirectory + ACE_ARCH="" +fi + +if [ $die -ne 0 ]; then + echo "- terminating `basename $0` script" + exit 2 +fi + + +##################################################################### +# announce intentions +##################################################################### + +echo "This script will perform the following actions:" + +echo "using ACE_ROOT directory: $ACE_ROOT" + +if [ $unpack -ne 0 ]; then + echo " " + echo "Extracting:" + echo "- unpack source archive: $ACE_ARCHIVE" +fi + +if [ $config -ne 0 ]; then + echo " " + echo "Configuring:" + echo "- platform config.h header: $ACE_HEADER" + echo "- platform makefile macros: $ACE_MAKE" +fi + +if [ $compile -ne 0 ]; then + echo " " + echo "Compiling:" + echo "- ACE/TAO compile options: $ACE_OPTS" +fi + +if [ $install -ne 0 ]; then + echo " " + echo "Installing:" + echo "- install target directory: $ACE_DEST" + echo "- install target arch: $ACE_ARCH" +fi + +echo "" + + +##################################################################### +# confirm desire to proceed +##################################################################### + +if [ $force -eq 0 ]; then + echo " " + echo "Type 'yes' to proceed, anything else to exit" + + read ready + if [ "$ready" != "yes" ]; then + echo "Terminating install script. Thank you for playing." + echo "We have some lovely parting gifts for you. =)" + exit 1 + fi +fi + + +##################################################################### +# extract ACE and TAO +##################################################################### + +if [ $unpack -ne 0 ]; then + + echo "Unpacking $ACE_ARCHIVE..." + + cd `dirname $ACE_ROOT` + gzip -dc $ACE_ARCHIVE | tar xvf - + +fi + + +##################################################################### +# configure ACE and TAO +##################################################################### + +if [ $config -ne 0 ]; then + + echo "Configuring: $ACE_HEADER,$ACE_MAKE..." + + # copy the files if they exist + test -f $ACE_ROOT/ace/$ACE_HEADER \ + && cp $ACE_ROOT/ace/$ACE_HEADER $ACE_ROOT/ace/config.h + test -f $ACE_ROOT/include/makeinclude/$ACE_MAKE \ + && cp $ACE_ROOT/include/makeinclude/$ACE_MAKE \ + $ACE_ROOT/include/makeinclude/platform_macros.GNU + + # print error message and die if they don't + if [ ! -f $ACE_ROOT/ace/$ACE_HEADER ]; then + echo "error: $ACE_HEADER doesn't exist" + die=1 + fi + if [ ! -f $ACE_ROOT/include/makeinclude/$ACE_MAKE ]; then + echo "error: $ACE_MAKE doesn't exist" + die=1 + fi + + if [ $die -ne 0 ]; then + exit $die + fi + +fi + + +##################################################################### +# compile ACE and TAO +##################################################################### + +if [ $compile -ne 0 ]; then + + echo "Compiling: $ACE_OPTS..." + + ########################################## + # add ACE_ROOT/ace to LD_LIBRARY_PATH so tao_idl can find libACE.so + if [ "`uname -s`" = "HP-UX" ]; then + if [ ! -z "$SHLIB_PATH" ]; then + SHLIB_PATH=$ACE_ROOT/ace:$SHLIB_PATH + else + SHLIB_PATH=$ACE_ROOT/ace; export SHLIB_PATH + fi + else + if [ ! -z "$LD_LIBRARY_PATH" ]; then + LD_LIBRARY_PATH=$ACE_ROOT/ace:$LD_LIBRARY_PATH + else + LD_LIBRARY_PATH=$ACE_ROOT/ace; export LD_LIBRARY_PATH + fi + fi + + ########################################## + # compile a few select directories + for d in ace apps/gperf/src TAO/tao TAO/TAO_IDL TAO/orbsvcs TAO/utils; do + echo --- Building in $d. + cd "$ACE_ROOT/$d" + make $ACE_OPTS + if [ $? -ne 0 ]; then + echo --- Error during build: $? + exit $? + fi + done +fi + + +##################################################################### +# install ACE and TAO +##################################################################### + +if [ $install -ne 0 ]; then + + echo "Installing: $ACE_DEST..." + + ########################################## + # determine final target directories + + ACE_VER=`head -n 1 $ACE_ROOT/VERSION | sed -e 's/^[^0-9]*//' -e 's/[, ].*//'` + ACE_DIR="$ACE_DEST/ACE-$ACE_VER"; export ACE_DIR + + TAO_VER=`head -n 1 $ACE_ROOT/TAO/VERSION | sed -e 's/^[^0-9]*//' -e 's/[, ].*//'` + TAO_DIR="$ACE_DEST/TAO-$TAO_VER"; export ACE_DIR + + ########################################## + # create target directories as needed + echo "creating target directories..." + + ace_dirs="$ACE_DIR $ACE_DIR/include $ACE_DIR/man" + ace_arch_dirs="$ACE_DIR/$ACE_ARCH/include/ace \ + $ACE_DIR/$ACE_ARCH/bin $ACE_DIR/$ACE_ARCH/lib" + tao_dirs="$TAO_DIR $TAO_DIR/include $TAO_DIR/include/orbsvcs" + tao_arch_dirs="$TAO_DIR/$ACE_ARCH/include \ + $TAO_DIR/$ACE_ARCH/bin $TAO_DIR/$ACE_ARCH/lib" + + for dir in $ace_dirs $ace_arch_dirs $tao_dirs $tao_arch_dirs; do + if [ ! -d $dir ]; then + echo $dir + mkdir -p $dir + fi + done + + ########################################## + # copy TAO stuff + + cd $ACE_ROOT/TAO + cp VERSION $TAO_DIR/$ACE_ARCH/TAO-VERSION + + # copy TAO includes + echo "Copying include files..." + find tao -type f -name "*.idl" -print | cpio -p -d -V $TAO_DIR/include + find tao -type f -name "*.pidl" -print | cpio -p -d -V $TAO_DIR/include + find tao -type f -name "*.h" -print | grep -v "^config\.h" | cpio -p -d -V $TAO_DIR/include + find tao -type f \( -name "*.i" -o -name "*.inl" \) -print | cpio -p -d -V $TAO_DIR/include + find tao -type f -name "*.cpp" -print | cpio -p -d -V $TAO_DIR/include + + # NOTE: may need all .h, .i and .cpp under TAO/orbsvcs, instead of just TAO/orbsvcs/orbsvcs + cd orbsvcs + find orbsvcs -type f -name "*.idl" -print | cpio -p -d -V $TAO_DIR/include + find orbsvcs -type f -name "*.pidl" -print | cpio -p -d -V $TAO_DIR/include + find orbsvcs -type f -name "*.h" -print | grep -v "^config\.h" | cpio -p -d -V $TAO_DIR/include + find orbsvcs -type f \( -name "*.i" -o -name "*.inl" \) -print | cpio -p -d -V $TAO_DIR/include + find orbsvcs -type f -name "*.cpp" -print | cpio -p -d -V $TAO_DIR/include + cd .. + + # copy TAO libs + echo "Copying libraries..." + for f in `find . -type f -name "lib?*" -not -name "*\.dsw" -not -name "*Test*" -print`; do + echo $f + cp $f $TAO_DIR/$ACE_ARCH/lib + done + + # copy TAO executables + echo "Copying executables..." + + ALL_PROGS=`find orbsvcs -type f -perm +a+x -print | grep -v ".*lib.*" | grep -v ".\.pl" | grep -v test | grep -v example` + ALL_PROGS="`find utils -type f -perm +a+x -print` $ALL_PROGS" + PROGS=`echo $ALL_PROGS | tr " " "\n" | grep -v test | grep -v default.bld | grep -v README | grep -v GNUmakefile` + + for f in TAO_IDL/tao_idl $PROGS; do + echo $f + cp $f $TAO_DIR/$ACE_ARCH/bin + done + + ########################################## + # copy ACE stuff + + cd $ACE_ROOT + cp VERSION $ACE_DIR/$ACE_ARCH/ACE-VERSION + + # copy ACE includes + echo "Copying include files..." + find ace -type f -name "*.h" -print | grep -v "^config\.h" | cpio -p -d -V $ACE_DIR/include + find ace -type f \( -name "*.i" -o -name "*.inl" \) -print | cpio -p -d -V $ACE_DIR/include + find ace -type f -name "*.cpp" -print | cpio -p -d -V $ACE_DIR/include + cp ace/config.h $ACE_DIR/$ACE_ARCH/include/ace/config.h + chmod -R a+r $ACE_DIR/$ACE_ARCH/include + + # copy ACE libs + echo "Copying libraries..." + for f in `find . -type f -name "lib?*" -not -name "*\.dsw" -not -name "*Test*" -print`; do + # only copy libs if they're not already in $TAO_DIR/$ACE_ARCH/lib + maybe_tao_lib=$TAO_DIR/$ACE_ARCH/lib/`basename $f` + if [ ! -f $maybe_tao_lib ]; then + echo $f + cp $f $ACE_DIR/$ACE_ARCH/lib + fi + test -f $maybe_tao_lib && echo "library $f already installed with TAO" + done + + # copy ACE executables + echo "Copying executables..." + ACE_PROGS=apps/gperf/src/gperf + + for f in $ACE_PROGS; do + echo $f + cp $f $ACE_DIR/$ACE_ARCH/bin + done + + # copy ACE man pages + echo "Copying man pages..." + find man -type f -print | cpio -p -d -V $ACE_DIR + + + # PERMISSIONS + chmod -R a+r $ACE_DEST + find $ACE_DEST -type d -exec chmod a+x {} \; + find $ACE_DEST -type f -perm +a+x -exec chmod a+x {} \; + +fi # if [ $install -ne 0 ] + + +##################################################################### +# that's all, folks +##################################################################### + +echo "`basename $0`: done." diff --git a/ACE/bin/ace_components b/ACE/bin/ace_components new file mode 100755 index 00000000000..23bfeb29149 --- /dev/null +++ b/ACE/bin/ace_components @@ -0,0 +1,111 @@ +#! /bin/sh +# $Id$ +# +# Encapsulates set/access of a components file, which records set of +# components that were built in a library. Intended to be used by +# GNUmakefiles and scripts. See ACE_wrappers/ace/GNUmakefile for an +# example. +# +usage="usage: $0 --ace | --orbsvcs | --tao | --pace \ + [--remove | --set \" <components list> \"]" + +#### +#### Make sure that PACE_ROOT, ACE_ROOT, and TAO_ROOT are set. +#### +if [ ! "$ACE_ROOT" ]; then + echo $0': your ACE_ROOT environment variable is not set!' 1>&2 + exit -1 +fi +if [ ! "$TAO_ROOT" ]; then + TAO_ROOT=$ACE_ROOT/TAO + export TAO_ROOT +fi +if [ ! "$PACE_ROOT" ]; then + PACE_ROOT=$ACE_ROOT/PACE + export PACE_ROOT +fi + +#### +#### Process command line arguments. +#### +if [ $# -ge 1 ]; then + case $1 in + --ace) components_file=$ACE_ROOT/ace/ACE_COMPONENTS.list ;; + --orbsvcs) + components_file=$TAO_ROOT/orbsvcs/orbsvcs/ORBSVCS_COMPONENTS.list ;; + --tao) components_file=$TAO_ROOT/tao/TAO_COMPONENTS.list ;; + --pace) components_file=$PACE_ROOT/PACE_COMPONENTS.list ;; + *) echo $usage; exit -1 ;; + esac + shift +else + echo $usage + exit -1 +fi + +set_components=0 +append_components=0 +if [ $# -ge 1 ]; then + if [ $1 = '--set' ]; then + set_components=1 + shift + if [ $# -eq 1 ]; then + components=$1 + shift + else + echo $usage + exit -1 + fi + elif [ $1 = '--append' ]; then + append_components=1 + shift + if [ $# -eq 1 ]; then + components=$1 + shift + else + echo $usage + exit -1 + fi + elif [ $1 = '--remove' ]; then + rm -f $components_file + else + echo $usage + exit -1 + fi +fi + +if [ $set_components -eq 1 ]; then + #### + #### Update the components file, if it has changed since last set. + #### + if [ -f $components_file ]; then + if echo "$components" | diff - $components_file > /dev/null; then + : + else + echo "$components" > $components_file + fi + else + echo "$components" > $components_file + fi +elif [ $append_components -eq 1 ]; then + #### + #### Update the components file, if it has changed since last set. + #### + if [ -f $components_file ]; then + if cat $components_file | grep "$components" > /dev/null; then + : + else + (cat $components_file; echo "$components") | tr ' ' '\012' | sort -u > $components_file.$$ + mv -f $components_file.$$ $components_file + fi + else + echo "$components" > $components_file + fi +else + #### + #### Access the contents of the components file, if it exists. + #### + if [ -f $components_file ]; then + cat $components_file + fi +fi diff --git a/ACE/bin/ace_ld b/ACE/bin/ace_ld new file mode 100755 index 00000000000..0f5cc50e1b0 --- /dev/null +++ b/ACE/bin/ace_ld @@ -0,0 +1,237 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# +# Drop-in replacement for "ld" that supports munching. +# +# The first three lines above let this script run without specifying the +# full path to perl, as long as it is in the user's PATH. +# Taken from perlrun man page. + +## +## Symbols that produce a warning due to size changing. +## This is a harmless known bug with the version of gcc that comes with +## Tornado II. Anything in this list will be suppressed unless the -w +## option is used. +## +my(@symbols) = ('dequeue__t17ACE_Message_Queue1Z14ACE_NULL_SYNCHRP17ACE_Message_BlockP14ACE_Time_Value', + 'activate__t17ACE_Message_Queue1Z14ACE_NULL_SYNCH', + ); + +$usage = + "usage: $0 [-? | [-w] [-o <VDIR>] [[-C <compile> --] [-m <munch>] [-n <nm>]] [-f]]] " . + "<ld command>\n"; + +#### To avoid quoting problems on the command line, all arguments +#### between -C and -- are combined into the single compile command. +$compile_option = 0; +$ss_change_warn = 0; + +#### +#### process command line args +#### +while ( $#ARGV >= 0 && $ARGV[0] =~ /^-/ ) { + if ( $ARGV[0] eq '-C' ) { + $compile_option = 1; + if ( $ARGV[1] !~ /^[-].+$/ ) { + $compile = $ARGV[1]; shift; + } else { + print STDERR "$0: must provide argument for -c option\n"; + die $usage; + } + } elsif ( $ARGV[0] eq '--' ) { + $compile_option = 0; + } elsif ( $ARGV[0] eq '-m' ) { + if ( $ARGV[1] !~ /^[-].+$/ ) { + $munch = $ARGV[1]; shift; + } else { + print STDERR "$0: must provide argument for -m option\n"; + die $usage; + } + } elsif ( $ARGV[0] eq '-n' ) { + if ( $ARGV[1] !~ /^[-].+$/ ) { + $nm = $ARGV[1]; shift; + } else { + print STDERR "$0: must provide argument for -n option\n"; + die $usage; + } + } elsif ( $ARGV[0] eq '-o' ) { + if ( $ARGV[1] !~ /^[-].+$/ ) { + $vdir = $ARGV[1]; shift; + } else { + print STDERR "$0: must provide argument for -o option\n"; + die $usage; + } + } elsif ( $ARGV[0] eq '-w' ) { + $ss_change_warn = 1; + } elsif ( $ARGV[0] eq '-?' ) { + print "$usage"; + exit; + } else { + if ($compile_option) { + $compile .= " $ARGV[0]"; + } else { + warn "$0: unknown option $ARGV[0]\n"; + die $usage; + } + } + shift; +} + +#### +#### If $vdir is empty, set default object file directory (.obj) +#### +if ($vdir eq ''){ + $vdir = ".obj"; +} + +#### +#### Save link command, i.e., current @ARGV, for use below. +#### +@args = @ARGV; + + +#### +#### Find full path to each library. +#### +@libDirs = (); +$current_dir_in_libDirs = 0; +@libs = (); +@objs = ''; + +foreach $arg (@ARGV) { + if ($arg =~ /^['"]?-L([\S]+)/) { + ($dir = $1) =~ s%/+$%%; #### trim any trailing slashes + push (@libDirs, $dir); + $current_dir_in_libDirs = 1 if $dir eq '.'; + } elsif ($arg =~ /^['"]?-l([\S]+)/) { + push (@libs, $1); + } elsif ($arg =~ /\.o$/) { + push (@objs, $arg); + } +} + +#### Add . to libDirs if it doesn't already have it. +push (@libDirs, ".") unless $current_dir_in_libDirs; + +foreach $lib (@libs) { + foreach $libDir (@libDirs) { + if (-e "$libDir/lib$lib.a") { + $full_path{$lib} = "$libDir/lib$lib.a"; + last; + } + } +} + + +#### +#### Set up signal handler. +#### +$done = 0; +$SIG{'HUP'} = $SIG{'INT'} = $SIG{'QUIT'} = $SIG{'TERM'} = 'cleanup'; + + +#### +#### Munch, if $munch is non-null. +#### +if ($munch) { + $munch_objs = join (' ', @objs); + $munch_libs = join (' ', values %full_path); + + open (MUNCH, "$nm $munch_objs $munch_libs | $munch |") || + &fail ("$0: unable to run \"$nm\" or \"$munch\"\n"); + + open (CTORDTOR, "> __ctordtor.c") || + &fail ("$0: unable to open \"__ctordtor.c\"\n"); + + while (<MUNCH>) { + #### Filter out munch output that contains '.cpp'. It results from + #### .cpp files that have no text or data, e.g., .cpp files that + #### only contain template instantiations. These lines confuse g++. + print CTORDTOR unless /\.cpp/; + } + + close CTORDTOR || &fail ("$0: unable to write \"__ctordtor.c\"\n"); + close MUNCH; + + system ("$compile -o $vdir/__ctordtor.o __ctordtor.c") && + &fail ("$0: \"$compile\" failed\n"); +} + + +#### +#### Construct the link command from @args and perform the link. +#### +if ($munch) { + #### Insert ctordtor object file before first library in link command. + $arg_lib = 0; + foreach $arg (@ARGV) { + if ($arg =~ /^['"]?-l/) { + last; + } + ++$arg_lib; + } + splice (@args, $arg_lib, 0, "$vdir/__ctordtor.o"); +} + +$link_command = join (' ', @args); + +if (open(PP, "$link_command 2>&1 |")) { + while(<PP>) { + my($line) = $_; + if ($ss_change_warn) { + print $line; + } + else { + my($found) = 0; + foreach my $symbol (@symbols) { + if ($line =~ /Warning: size of symbol `$symbol\'/) { + $found = 1; + } + } + if (!$found) { + print $line; + } + } + } + close(PP); + + if ($? ne 0) { + fail ("$0: $link_command failed\n"); + } +} +else { + fail ("$0: $link_command failed\n"); +} + + +$done = 1; +&cleanup; + + +#### +#### +#### +sub fail { + local ($message) = @_; + + warn $message; + &cleanup; +} + + +#### +#### clean up when done or on signal +#### +sub cleanup { + unlink "__ctordtor.c", "$vdir/__ctordtor.o"; + if ($done) { + exit 0; + } else { + exit 1; + } +} + +#### EOF diff --git a/ACE/bin/ace_tests.lst b/ACE/bin/ace_tests.lst new file mode 100644 index 00000000000..340782ab47f --- /dev/null +++ b/ACE/bin/ace_tests.lst @@ -0,0 +1,18 @@ +# $Id$ +# +# This is the list of run_test.pl's that need to be run by +# auto_run_tests.pl. +# Each line has its own test, and a test can be followed by a +# list of configurations it does _not_ run on. +# +# Example: TAO\examples\foo\run_test.pl: !MINIMUM !ST +# +# NOTE: This file contains tests only for ACE. Please do not include +# tests in TAO here.. +tests/run_test.pl +examples/Reactor/WFMO_Reactor/run_test.pl: !Cygwin !VxWorks !ACE_FOR_TAO !LabVIEW_RT +protocols/tests/RMCast/run_test.pl: RMCAST !ST !NO_MCAST !nsk !LynxOS !ACE_FOR_TAO !VxWorks !LabVIEW_RT +protocols/tests/HTBP/ping/run_test.pl: !NO_UUID !nsk !LynxOS !ACE_FOR_TAO !VxWorks !LabVIEW_RT +protocols/tests/HTBP/Send_Recv_Tests/run_test.pl: !NO_UUID !nsk !LynxOS !ACE_FOR_TAO !VxWorks !LabVIEW_RT +protocols/tests/HTBP/Send_Large_Msg/run_test.pl: !NO_UUID !nsk !LynxOS !ACE_FOR_TAO !VxWorks !LabVIEW_RT +protocols/tests/HTBP/Reactor_Tests/run_test.pl: !NO_UUID !nsk !LynxOS !ACE_FOR_TAO !VxWorks !LabVIEW_RT diff --git a/ACE/bin/add_rel_link.sh b/ACE/bin/add_rel_link.sh new file mode 100755 index 00000000000..fe5dd67e679 --- /dev/null +++ b/ACE/bin/add_rel_link.sh @@ -0,0 +1,98 @@ +# This script assumes it is being run by bash + +# ======= needed functions ====== +# abspath relpath curentpath +abspath () +{ +# treat "./" as a special case +if expr "$1" : '\./' >/dev/null; then + b=`echo $1 | sed 's@\./@@'` + echo $2/$b + return 0 +fi +b=$1 +a=$2 +# for each "../" we remove one directory from the current path +# and leading "../" from the relative path +# until we have the unique part in b and the abs prefix in a +while expr "$b" : '\.\./' >/dev/null +do + b=`echo $b | sed 's@\.\./@@'` + a=`echo $a | sed 's@/[^/]*$@@'` +done +# return the completed absolute path +echo $a/$b +} + +# relpath abspath curentpath +relpath () +{ +# take "/" off beginning +a=`echo $1 | sed 's@^/@@'` +# take "/" off beginning and add to end +b=`echo $2 | sed 's@^/@@;s@$@/@'` +while true +do + if [ "$b" = "" ]; then + break; + fi + a1=`echo $a | sed 's@\([^/]*\)/.*@\1@'` + b1=`echo $b | sed 's@\([^/]*\)/.*@\1@'` + if [ "$a1" != "$b1" ]; then + break; + fi + a=`echo $a | sed 's@[^/]*/@@'` + b=`echo $b | sed 's@[^/]*/@@'` +done +# a now has the unique part of the path +c="" +# c will have the required number of "../"'s +while [ "$b" != "" ] +do + c="../$c" + b=`echo $b | sed 's@[^/]*/@@'` +done +# return the completed relative path +echo "$c$a" +} + + +# ====== MAIN ====== +# Assume any relative path passed in is relative to the current directory +# Given $1 is a path to the source file +# Given $2 is a path of the link to be created +# Create a link that has the relative path to the source file +# That is, $1 converted relative to $2 +# Check if $1 is absolute or already relative +#echo add_rel_link.sh $1 $2 +if expr "$1" : '\/' >/dev/null; then + # The source path is absolute, this is the expected case + # Check if $2 is absolute or relative + if expr "$2" : '\/' >/dev/null; then + # The link path is already absolute, so just use it + lpath=$2 + else + # The link path is relative, this is the expected case + # WARNING: don't use $PWD here, it won't work right + # WARNING: pwd may be a shell alias. Use /bin/pwd. + cur=`/bin/pwd` + lpath=`abspath $2 $cur` + fi + # take name off the end of the dest + ldir=`echo $lpath | sed 's@/[^/]*$@@'` + + # If the original path and the ldir do not originate in the same + # directory tree, we should just use absolute paths + if [ "`echo $1 | cut -d/ -f2`" != "`echo $ldir | cut -d/ -f2`" ]; then + spath=$1 + else + spath=`relpath $1 $ldir` + fi + # use the completed relative path and the given destignation path + echo ln -s $spath $2 + ln -s $spath $2 +else + # The source path is already relative, so just use it + echo ln -s $1 $2 + ln -s $1 $2 +fi diff --git a/ACE/bin/aix_shr b/ACE/bin/aix_shr new file mode 100755 index 00000000000..16daded8e02 --- /dev/null +++ b/ACE/bin/aix_shr @@ -0,0 +1,32 @@ +#!/bin/sh +# $Id$ +# Filter out the duplicate symbol warnings from Visual Age C++ +# + +output=`basename $0`.$$.`/bin/date +%Y%m%d%H%M%S` +usrtmp="/tmp" +for possible in "$TMPDIR" "$TEMP" "$TMP"; do + if [ "$possible" != "" ]; then + if [ -w "$possible" ]; then + usrtmp="$possible" + break + fi + fi +done + +## Send the output to a temporary file and save the return code. +## This macro is being passed during the to avoid #include errors +## while instantiating templates. +$@ -DACE_VACPP_INSTANTIATING_TEMPLATES > "$usrtmp/$output" 2>&1 +status=$? + +## Print the output to stdout, but filter duplicate symbol warnings from +## Visual Age C++-using builds. The first pattern ends up coming from the +## linker in Visual Age C++ 5 builds; the second is from Visual Age C++ 6. +/bin/egrep -v '0711-(224|345)|1540-0(424|425|436)' "$usrtmp/$output" + +## Clean up the temporary file +/bin/rm -f "$usrtmp/$output" + +## Exit with the return code from the compiler +exit $status diff --git a/ACE/bin/auto_compile b/ACE/bin/auto_compile new file mode 100755 index 00000000000..914bcabaa18 --- /dev/null +++ b/ACE/bin/auto_compile @@ -0,0 +1,607 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# -*- perl -*- +# $Id$ +# +# This script checkouts ACE from CVS, updates the "clone" directory, +# compiles $ACE_ROOT/ace and $ACE_ROOT/tests and finally runs +# $ACE_ROOT/tests/run_tests.sh. +# +# If it detects any problem it send email. +# +# DO NOT invoke this script from your crontab, use +# auto_compile_wrapper for that. +# +# This script requires Perl5. +# +# TODO: Modify the script or split it in such a way that the main copy +# can be obtained either using cvs or downloading the lastest beta +# from the WWW. +# + +# The first three lines above let this script run without specifying the +# full path to perl, as long as it is in the user's PATH. +# Taken from perlrun man page. + +use File::Basename; +use File::Copy; +use FileHandle; +require POSIX; + +# This are the sub-directories (in the module) we really compile. + +# Find out the command name. +$CMD = basename($0); + +$dont_update = 0; +# $copy_logs = 1; +# $LOG_DESTINATION = $ENV{'HOME'}.'/.www-docs/auto_compile'; + +$copy_logs = 0; +$LOG_DESTINATION='bugzilla'.'@cs.wustl.edu'; + +$dont_build_tao = 0; +$dont_run = 0; +$makefile_suffix = ""; +$pre_realclean = 0; +$post_realclean = 0; +$report_success = 0; +$debug = 0; +$sandbox = ''; +$sandbox_timeout = 600; +$sendreport = 0; +@BUILD_LIST= (); +@CONFIGURATION_OPTIONS = (); + +@ARGS = (); +while ($#ARGV >= 0) { + if (!($ARGV[0] =~ m/^-/)) { + push @ARGS, $ARGV[0]; + } elsif ($ARGV[0] eq "-single_threaded") { + print STDERR "$CMD: obsolete option $ARGV[0], " + ."please use -config instead\n"; + push @CONFIGURATION_OPTIONS, 'ST'; + } elsif ($ARGV[0] eq "-minimum_corba") { + print STDERR "$CMD: obsolete option $ARGV[0], " + ."please use -config instead\n"; + push @CONFIGURATION_OPTIONS, 'MINIMUM'; + } elsif ($ARGV[0] eq "-ami") { + print STDERR "$CMD: obsolete option $ARGV[0], " + ."please use -config instead\n"; + push @CONFIGURATION_OPTIONS, 'AMI'; + } elsif ($ARGV[0] eq "-smart_proxies") { + print STDERR "$CMD: obsolete option $ARGV[0], " + ."please use -config instead\n"; + push @CONFIGURATION_OPTIONS, 'SMART_PROXIES'; + } elsif ($ARGV[0] eq "-static") { + print STDERR "$CMD: obsolete option $ARGV[0], " + ."please use -config instead\n"; + push @CONFIGURATION_OPTIONS, 'STATIC'; + } elsif ($ARGV[0] eq "-config") { + shift; + push @CONFIGURATION_OPTIONS, $ARGV[0]; + } elsif ($ARGV[0] eq "-build_list") { + shift; + @BUILD_LIST = split (/,/, $ARGV[0]); + } elsif ($ARGV[0] eq "-dont_update") { + $dont_update = 1; + } elsif ($ARGV[0] eq "-copy_logs") { + shift; + $copy_logs = 1; + $LOG_DESTINATION = $ARGV[0]; + } elsif ($ARGV[0] eq "-sandbox") { + shift; + $sandbox = $ARGV[0]; + } elsif ($ARGV[0] eq "-sandbox_timeout") { + shift; + $sandbox_timeout = $ARGV[0]; + } elsif ($ARGV[0] eq "-dont_run") { + $dont_run = 1; + } elsif ($ARGV[0] eq "-pre_realclean") { + $pre_realclean = 1; + } elsif ($ARGV[0] eq "-post_realclean") { + $post_realclean = 1; + } elsif ($ARGV[0] eq "-report_success") { + $report_success = 1; + } elsif ($ARGV[0] eq "-debug") { + $debug = 1; + } elsif ($ARGV[0] eq "-sendreport") { + $sendreport = 1; + } elsif ($ARGV[0] eq "-notao") { + $dont_build_tao = 1; + } elsif ($ARGV[0] eq "-make_type") { + shift; + $makefile_suffix = $ARGV[0]; + } else { + print "Ignoring option $ARGV[0]\n"; + } + shift; +} + +# Extract configuration information from command line. + # TODO: Some validation and checking should be done here. +$CHECKOUT = $ARGS[0]; +$BUILD = $ARGS[1]; +$LOGDIR = $ARGS[2]; +$ADMIN = $ARGS[3]; +$MAIL = "mail"; +if ($#ARGS >= 4) { + $MAIL = $ARGS[4]; +} +$LOG_URL = "http://ace.cs.wustl.edu/~bugzilla/auto_compile_logs/"; +if ($#ARGS >= 5) { + $LOG_URL = $ARGS[5]; +} +# This is the module we will checkout unless a different one is on the +# command line. +$MODULE='ACE_wrappers'; +if ($#ARGS >= 6) { + $MODULE = $ARGS[6]; +} + +$ENV{'ACE_ROOT'} = $CHECKOUT . '/' . $MODULE . '/build/' . $BUILD; +$ENV{'TAO_ROOT'} = $CHECKOUT . '/' . $MODULE . '/build/' . $BUILD . '/TAO'; + +# We obtain our revision to report errors. +$REVISION='$Revision$ '; + +# When an error is found we try to die gracefully and send some email +# to ADMIN. + +$disable_file = $LOGDIR . '/.disable'; +$histfile = $LOGDIR . '/history'; +$LOGBASE = POSIX::strftime("%Y_%m_%d_%H_%M", localtime); +$LOGFILE = $LOGDIR . '/' . $LOGBASE . '.txt'; +$HOST = `hostname`; +chop $HOST; +$LOG_NAME = $HOST . '_' . $BUILD . '/' . $LOGBASE . '.txt'; +$STATUS = "OK"; + +if ($debug) { + print "CHECKOUT = $CHECKOUT\n"; + print "BUILD = $BUILD\n"; + print "LOGDIR = $LOGDIR\n"; + print "ADMIN = $ADMIN\n"; + print "MAIL = $MAIL\n"; + print "ACE_ROOT = $ENV{ACE_ROOT}\n"; + print "TAO_ROOT = $ENV{TAO_ROOT}\n"; + print "CONFIGURATION_OPTIONS = ", @CONFIGURATION_OPTIONS, "\n"; +} + +push @INC, $CHECKOUT . '/' . $MODULE . '/bin'; + +require PerlACE::ConfigList; + +$config_list = new PerlACE::ConfigList; + +$config_list->my_config_list (@CONFIGURATION_OPTIONS); + +if ($#BUILD_LIST == -1) { + if ($dont_build_tao) { + @BUILD_LIST=('ace', 'netsvcs', 'tests'); + } + else { + @BUILD_LIST=('.', 'TAO'); + } +} + +sub mydie { + my $DEST_DIR = $LOG_DESTINATION.'/'.$HOST.'_'.$BUILD; + mkdir $DEST_DIR,0755 if (!-d $DEST_DIR); + if (open(STATUS, '>'.$DEST_DIR.'/status.txt')) { + print STATUS "SCOREBOARD_STATUS: Inactive\n"; + close STATUS; + } + unlink $disable_file; + die $_ . "\n"; +} + +@RUN_LIST = (); + +if ($debug) { + + @BUILD_LIST = ('ace'); + @RUN_LIST = ('TAO/tests/OctetSeq/run_test.pl'); + $ADMIN = $ENV{'LOGNAME'}; + +} else { + $config_list->load ($CHECKOUT . '/' . $MODULE . '/' . 'build/' . $BUILD . '/bin/auto_run_tests.lst'); + + @RUN_LIST = $config_list->valid_entries (); +} + +sub mail_logs { + open (MAIL, "|".$MAIL.' -s AUTO_COMPILE_LOG='.$LOG_NAME.' '.$LOG_DESTINATION) + || mydie "Cannot open mail pipe for: $LOG_NAME\n"; + + print MAIL 'This is the log for: ', "\n"; + print MAIL $CMD, ' [', $REVISION, "] for $HOST/$BUILD\n"; + + print MAIL "\n================================================================\n"; + + if (open (THELOG, "$LOGFILE")) + { + while (<THELOG>) { + print MAIL $_; + } + close (THELOG); + } + close (MAIL); # Ignore errors.... +} + +sub copy_logs { + local $DEST_DIR = $LOG_DESTINATION.'/'.$HOST.'_'.$BUILD; + mkdir $DEST_DIR,0755 if (!-d $DEST_DIR); + + copy($LOGFILE, $DEST_DIR.'/'.$LOGBASE.'.txt'); + + local $MAKE_PRETTY="$CHECKOUT/$MODULE/bin/make_pretty.pl"; + system ("perl $MAKE_PRETTY -b -i $LOGFILE >$DEST_DIR/$LOGBASE"."_brief.html"); + system ("perl $MAKE_PRETTY -i $LOGFILE >$DEST_DIR/$LOGBASE".".html"); + + chmod 0644, $DEST_DIR.'/'.$LOGBASE.'.txt' + , $DEST_DIR.'/'.$LOGBASE.'_brief.html' + , $DEST_DIR.'/'.$LOGBASE.'.html' ; +} + +sub report_errors { + + # First clear the lock, so the next execution works... + unlink $disable_file; # Ignore errors! + + if ($sendreport) { + # Now send a summary of the errors to the ADMIN account, if there are any. + + if ($#_ >= 0) { + local $to = $ADMIN; + + open (MAIL, "|".$MAIL.' -s "[AUTO_COMPILE] '.$HOST.' '.$BUILD.'" '.$to) + || mydie "Cannot open mail pipe for: $_\n"; + + print MAIL 'The following message is brought to you by: ', "\n"; + print MAIL $CMD, ' [', $REVISION, "] for $BUILD on $HOST\n\n"; + + print MAIL "\nPlease check the following log for more info:\n\n"; + print MAIL $LOG_URL, '?', $HOST, '_', $BUILD, "\n\n"; + + local $m; + foreach $m (@_) { + print MAIL $m, "\n"; + } + close (MAIL); # Ignore errors.... + } + } + + # Now send the complete log to bugzilla... + if ($copy_logs) { + copy_logs (); + } else { + mail_logs (); + } +} + +### MAIN FUNCTION + +if (-f $disable_file) { + print 'The following message is brought to you by: ', "\n"; + print $CMD, ' [', $REVISION, "] for $BUILD on $CHECKOUT\n"; + + print "DISABLED\n"; + + exit 0; +} + +open (DISABLE, '>' . $disable_file) + || die "cannot open disable file <$disable_file>\n"; +print DISABLE "auto_compile <$date> is running\n"; +close (DISABLE) + || die "cannot close disable file"; + +open(HIST, '>>' . $histfile) + # Do not use 'mydie' to report the problem, it tries to remove the + # disable file + || mydie "cannot open history file \"$histfile\"\n"; + +$date = localtime; + +print HIST $CMD, ': running at ', $date, ' '; + +open(LOG, '>' . $LOGFILE) + || mydie "cannot open log file"; + +LOG->autoflush (); + +# The following lines are useful when debugging the script or wrapper. +# print LOG $CHECKOUT, " ", $BUILD, " ", $LOGDIR, " ", $ADMIN, "\n"; +#while (($key,$value) = each %ENV) { +# print LOG $key, " = ", $value, "\n"; +#} + +print LOG "#################### CVS\n"; +my $DEST_DIR = $LOG_DESTINATION.'/'.$HOST.'_'.$BUILD; +mkdir $DEST_DIR,0755 if !-d $DEST_DIR; +if (open(STATUS, '>'.$DEST_DIR.'/status.txt')) { + print STATUS "SCOREBOARD_STATUS: CVS\n"; + close STATUS; +} + +chdir($CHECKOUT) + || mydie "Cannot chdir to $CHECKOUT"; + +if ($dont_update == 0) { + $date = localtime; + print LOG "$CMD: starting checkout at ", $date, "\n"; + open(CVS, "cvs -q checkout -P $MODULE 2>&1 |") + || mydie "cannot start checkout of $MODULE"; + + $conflicts = 0; + while (<CVS>) { + if (m/^C /) { + ($unused, $entry) = split('/'); + if (($entry ne "ChangeLog\n") && ($entry ne "THANKS\n")) { + $conflicts = 1; + } + } + print LOG $_; + } + close(CVS); +# || mydie "error while checking out $MODULE"; + $date = localtime; + print LOG "$CMD: checkout finished at ", $date, "\n"; + + if ($conflicts != 0) { + mydie "conflicts on checkout"; + } +} + +chdir($MODULE) + || mydie "cannot chdir to $MODULE"; + +$date = localtime; +print LOG "$CMD: starting clone at ", $date, "\n"; +open(CLONE, "perl bin/create_ace_build -a -v $BUILD 2>&1 |") + || mydie "cannot clone directory"; +while(<CLONE>) { + print LOG $_; +} +close(CLONE) + || mydie "error while cloning ACE_ROOT"; +$date = localtime; +print LOG "$CMD: clone finished at ", $date, "\n"; + +chdir('build/' . $BUILD) + || mydie "cannot chdir to $BUILD"; + +@failures = (); + +if ($makefile_suffix ne "") { + $MAKEFLAGS = "-f Makefile.$makefile_suffix"; +} + +print LOG "#################### Compiler\n"; +if (open(STATUS, '>'.$DEST_DIR.'/status.txt')) { + print STATUS "SCOREBOARD_STATUS: Compile\n"; + close STATUS; +} + +if ($pre_realclean) { + foreach $i (reverse(@BUILD_LIST)) { + $date = localtime; + print LOG "$CMD: =============================================\n"; + print LOG "$CMD: make realclean in $i started at ", $date, "\n"; + open(MAKE, "make -k $MAKEFLAGS -C $i realclean 2>&1 |") + || mydie "cannot start make in $i"; + + while (<MAKE>) { + # Ignore errors.... + } + if (close(MAKE) == 0) { + push @failures, "errors while cleaning $i"; + } + $date = localtime; + print LOG "$CMD: make realclean in $i finished at ", $date, "\n"; + print LOG "$CMD: =============================================\n\n"; + } +} + +$MAKEFLAGS .= ""; +foreach $i (@BUILD_LIST) { + $date = localtime; + print LOG "$CMD: =============================================\n"; + print LOG "$CMD: make for $i started at ", $date, "\n"; + open(MAKE, "make -k $MAKEFLAGS -C $i 2>&1 |") + || mydie "cannot start make for $i"; + + local $current_dir = $i; + local $last_error = ""; + local $this_error = 0; + local $this_warning = 0; + while (<MAKE>) { + chop; + $this_error = $this_warning = 0; + if ($^O eq 'hpux' + && m/^Warning:[ \t]+[0-9]+ future errors were detected/) { + next; + } + print LOG $_, "\n"; + + if (m/^make(\[[0-9]+\])?: Entering directory /) { + s/^make(\[[0-9]+\])?: Entering directory //; + s%^$ENV{'ACE_ROOT'}/%%; + $current_dir = $_; + } + if (m/error:/i || m/error /i + || m/^make(\[[0-9]+\])?: \*\*\*/) { + $this_error = 1; + } + if ($^O eq 'aix' + && m/\d+-\d+ \([SI]\)/) { + $this_error = 1; + } + if ($this_error) { + if ($last_error ne $current_dir + || STATUS eq "COMPILATION WARNING") { + $STATUS = "COMPILATION ERROR"; + push @failures, "Error while compiling in $current_dir \n"; + $last_error = $current_dir; + } + } + if (m/warning:/i + || m/warning /i + || m/Info: /i) { + $this_warning = 1; + if ($^O eq 'aix' + && m/^ld: \d+-\d+ WARNING: Duplicate symbol: .*ACE.*/) { + $this_warning = 0; + } + } + if ($^O eq 'aix' + && m/\d+-\d+ \(W\)/) { + $this_warning = 1; + } + if ($this_warning) { + if ($last_error ne $current_dir) { + if ($STATUS eq "OK") { + $STATUS = "COMPILATION WARNING"; + } + push @failures, "Warning while compiling in $current_dir\n"; + $last_error = $current_dir; + } + } + } + if (close(MAKE) == 0) { + push @failures, "errors while running make in $i"; + } + $date = localtime; + print LOG "$CMD: make for $i finished at ", $date, "\n"; + print LOG "$CMD: =============================================\n\n"; +} + +print LOG "#################### Tests\n"; +if (open(STATUS, '>'.$DEST_DIR.'/status.txt')) { + print STATUS "SCOREBOARD_STATUS: Tests\n"; + close STATUS; +} + +if ($dont_run == 0) { + my $config_params; + if ($#CONFIGURATION_OPTIONS != -1) { + $config_params = ' -Config '; + } + $config_params .= join ' -Config ', @CONFIGURATION_OPTIONS; + + foreach my $i (@RUN_LIST) { + + local $directory = '.'; + local $program = $i; + + if ($i =~ /(.*)\/([^\/]*)$/) { + $directory = $1; + $program = $2; + } + + $date = localtime; + print LOG "\n\n$CMD: ================ $date ================\n"; + print LOG "auto_run_tests: $i\n"; + local $subdir = + $CHECKOUT .'/'. $MODULE .'/build/'. $BUILD .'/'. $directory; + chdir ($subdir) + || mydie "cannot chdir to $subdir"; + + $run_error = 0; + my $prefix = ''; + if ($sandbox ne "") { + $prefix = $sandbox.' '.$sandbox_timeout.' '; + } + if (open(RUN, $prefix."perl $program $config_params 2>&1 |") == 0) { + push @failures, "cannot run $program in $directory"; + next; + } + while (<RUN>) { + print LOG $_; + if (m/Error/ + || m/ERROR/ + || m/FAILED/ + || m/EXCEPTION/ + || m/pure virtual /i) { + if ($STATUS eq "OK") { + $STATUS = "RUNTIME ERROR"; + } + $run_error = 1; + } + } + if (close(RUN) == 0) { + if ($STATUS eq "OK") { + $STATUS = "RUNTIME ERROR"; + } + print LOG "ERROR, non-zero status returned by test script\n"; + push @failures, "Error when closing pipe for $program in $directory"; + next; + } + $date = localtime; + print LOG "$CMD: $program finished ", $date, "\n"; + + if ($run_error != 0) { + push @failures, + "errors detected while running $program in $directory"; + } + } +} + +if ($post_realclean) { + foreach $i (reverse(@BUILD_LIST)) { + $date = localtime; + print LOG "$CMD: =============================================\n"; + print LOG "$CMD: make realclean in $i started at ", $date, "\n"; + open(MAKE, "make -k $MAKEFLAGS -C $i realclean 2>&1 |"); + + while (<MAKE>) { + # Ignore errors.... + } + if (close(MAKE) == 0) { + push @failures, "errors while cleaning $i"; + } + $date = localtime; + print LOG "$CMD: make realclean in $i finished at ", $date, "\n"; + print LOG "$CMD: =============================================\n\n"; + } +} + +print LOG "#################### Config\n"; + +chdir($CHECKOUT . "/" . $MODULE . "/build/" . $BUILD) + || mydie "Cannot chdir to $CHECKOUT/$MODULE/build/$BUILD"; + +open (CONFIG, "perl bin/nightlybuilds/print_config.pl $CHECKOUT/$MODULE/build/$BUILD 2>&1 |") + || mydie "Cannot run print_config.pl script"; +while (<CONFIG>) { + print LOG $_; +} +close (CONFIG) + || mydie "Error while running print_config.pl script"; + +report_errors @failures; + +print LOG "#################### End\n"; +if (open(STATUS, '>'.$DEST_DIR.'/status.txt')) { + print STATUS "SCOREBOARD_STATUS: Inactive\n"; + close STATUS; +} + +close(LOG) + || mydie "cannot close LOGFILE"; + +print HIST "$STATUS\n"; +close(HIST) + || mydie "cannot close history file"; + +unlink $disable_file + || die "cannot unlink disable file"; + +if ($report_success && $STATUS eq "OK") { + report_errors "Congratulations: No errors or warnings detected\n"; +} + +exit 0; diff --git a/ACE/bin/auto_compile_wrapper b/ACE/bin/auto_compile_wrapper new file mode 100755 index 00000000000..f99c8df01a7 --- /dev/null +++ b/ACE/bin/auto_compile_wrapper @@ -0,0 +1,56 @@ +#!/bin/sh +# +# $Id$ +# +# Usually cron setups a really miserable enviroment, this script +# serves two purposes: +# 1. Setup a good enviroment for auto_compile. +# 2. Invoke auto_compile with the proper arguments for each site. +# +# The idea is to modify this script on a per-site basis and leave +# auto_compile unmodified. +# + +# Setup a proper path, remember that cvs, GNU make, perl5 and your +# compiler must be there. +PATH=.:$HOME/bin:/pkg/gnu/bin:/opt/SUNWspro/bin:$PATH +export PATH + +# Obvious enough. +CVSROOT=/project/cvs-repository +export CVSROOT + +# It could be a good idea to set CVSREAD this will make the staging +# area read-only, but our staging areas are public. +# CVSREAD=Y +# export CVSREAD + +# Here we define the cvs working copy for our staging area. +CHECKOUT=$HOME/head + +# In some sites the building directory differs from the cvs working +# copy. The directory is updated running +# $ACE_ROOT/bin/create_ace_build; but it must be setup manually the +# first time. +# TODO: Arrange for automatic creation of platform_macros.GNU & +# config.h. +BUILD=SUNCC + +# Here is where we store auto_compile output and keep a history of +# each run. +LOGDIR=$HOME/head/ACE_wrappers/build/$BUILD/auto_compile + +# Who do we send email when compilation (or anything else) fails. +ADMIN=PUT_YOUR_ADDRESS_HERE ; echo "You must edit this file" ; exit 0 + +# You must select a mail tool that can understand the -s option such +# as: +# +# /usr/bin/mailx Solaris +# /usr/bin/mailx HP-UX +# /usr/sbin/mailx IRIX +# /bin/mail Linux + +exec /pkg/gnu/bin/perl $CHECKOUT/ACE_wrappers/bin/auto_compile \ + $CHECKOUT $BUILD $LOGDIR $ADMIN /usr/bin/mailx + diff --git a/ACE/bin/auto_ptr.perl b/ACE/bin/auto_ptr.perl new file mode 100755 index 00000000000..ca75bb8b4c1 --- /dev/null +++ b/ACE/bin/auto_ptr.perl @@ -0,0 +1,16 @@ +eval '(exit $?0)' && eval 'exec perl -pi -S $0 ${1+"$@"}' + & eval 'exec perl -pi -S $0 $argv:q' + if 0; + +# $Id$ +# +# You may want to run the "find" command with this script, which maybe +# something like this: +# +# find . -type f \( -name "*.i" -o -name "*.h" -o -name "*.C" -o -name "*.cc" -o -name "*.c" -o -name "*.cpp" -o -name "*.hpp" -o -name "*.ipp" \) -print | xargs $ACE_ROOT/bin/auto_ptr.perl + +# The first three lines above let this script run without specifying the +# full path to perl, as long as it is in the user's PATH. +# Taken from perlrun man page. + +s/__TEXT/ACE_TEXT/g; diff --git a/ACE/bin/auto_run_tests.pl b/ACE/bin/auto_run_tests.pl new file mode 100755 index 00000000000..940a43c6327 --- /dev/null +++ b/ACE/bin/auto_run_tests.pl @@ -0,0 +1,208 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- +# This file is for running the run_test.pl scripts listed in +# auto_run_tests.lst. + +use lib "$ENV{ACE_ROOT}/bin"; +if (defined $ENV{srcdir}) { + use lib "$ENV{srcdir}/bin"; +} +use PerlACE::Run_Test; + +use English; +use Getopt::Std; +use Cwd; + +use Env qw(ACE_ROOT PATH TAO_ROOT CIAO_ROOT); + +################################################################################ + +if (!getopts ('adl:os:r:tC') || $opt_h) { + print "auto_run_tests.pl [-a] [-h] [-s sandbox] [-o] [-t]\n"; + print "\n"; + print "Runs the tests listed in auto_run_tests.lst\n"; + print "\n"; + print "Options:\n"; + print " -a ACE tests only\n"; + print " -c config Run the tests for the <config> configuration\n"; + print " -h display this help\n"; + print " -s sandbox Runs each program using a sandbox program\n"; + print " -o ORB test only\n"; + print " -t TAO tests (other than ORB tests) only\n"; + print " -C CIAO tests only\n"; + print " -Config cfg Run the tests for the <cfg> configuration\n"; + print " -l list Load the list and run only those tests\n"; + print " -r dir Root directory for running the tests\n"; + print "\n"; + $ace_config_list = new PerlACE::ConfigList; + $ace_config_list->load ($ACE_ROOT."/bin/ace_tests.lst"); + print "ACE Test Configs: " . $ace_config_list->list_configs () . "\n"; + $orb_config_list = new PerlACE::ConfigList; + $orb_config_list->load ($ACE_ROOT."/bin/tao_orb_tests.lst"); + print "ORB Test Configs: " . $orb_config_list->list_configs () . "\n"; + $tao_config_list = new PerlACE::ConfigList; + $tao_config_list->load ($ACE_ROOT."/bin/tao_other_tests.lst"); + print "TAO Test Configs: " . $tao_config_list->list_configs () . "\n"; + $ciao_config_list = new PerlACE::ConfigList; + $ciao_config_list->load ($ACE_ROOT."/bin/ciao_tests.lst"); + print "CIAO Test Configs: " . $ciao_config_list->list_configs () . "\n"; + exit (1); +} + +my @file_list; + +if ($opt_a) { +push (@file_list, "/bin/ace_tests.lst"); +} + +if ($opt_o) { +push (@file_list, "/bin/tao_orb_tests.lst"); +} + +if ($opt_t) { +push (@file_list, "/bin/tao_other_tests.lst"); +} + +if ($opt_C) { +push (@file_list, "/bin/ciao_tests.lst"); +} + +if ($opt_r) { + $startdir = $opt_r; +} +else { + $startdir = "$ACE_ROOT"; +} + +if ($opt_l) { +push (@file_list, "$opt_l"); +} + +if (scalar(@file_list) == 0) { + push (@file_list, "/bin/ace_tests.lst"); + if (-d $TAO_ROOT || -d "$ACE_ROOT/TAO") { + push (@file_list, "/bin/tao_orb_tests.lst"); + push (@file_list, "/bin/tao_other_tests.lst"); + } + if (-d $CIAO_ROOT || -d "$ACE_ROOT/TAO/CIAO") { + push (@file_list, "/bin/ciao_tests.lst"); + } +} + +foreach my $test_lst (@file_list) { + + my $config_list = new PerlACE::ConfigList; + if (-r $ACE_ROOT.$test_lst) { + $config_list->load ($ACE_ROOT.$test_lst); + } + elsif (-r "$startdir/$test_list") { + $config_list->load ("$startdir/$test_lst"); + } + else { + $config_list->load ($test_list); + } + + # Insures that we search for stuff in the current directory. + $PATH .= $Config::Config{path_sep} . '.'; + + foreach $test ($config_list->valid_entries ()) { + my $directory = "."; + my $program = "."; + + ## Remove intermediate '.' directories to allow the + ## scoreboard matrix to read things correctly + $test =~ s!/./!/!g; + + if ($test =~ /(.*)\/([^\/]*)$/) { + $directory = $1; + $program = $2; + } + else { + $program = $test; + } + + # this is to ensure that we dont print out the time for tests/run_test.pl + # that test prints out the times for each of the ace tests individually + my $is_ace_test = ($directory eq "tests"); + + if (! $is_ace_test) { + print "auto_run_tests: $test\n"; + } + + my($orig_dir) = $directory; + if ($directory =~ m:^TAO/(.*):) { + $directory = $1; + } + if ($directory =~ m:^CIAO/(.*):) { + $directory = $1; + } + + $status = undef; + foreach my $path ($ACE_ROOT."/$directory", + $TAO_ROOT."/$directory", + $CIAO_ROOT."/$directory", + $startdir."/$directory", + $startdir."/$orig_dir") { + if (-d $path && ($status = chdir ($path))) { + last; + } + } + + if (!$status) { + print STDERR "ERROR: Cannot chdir to $ACE_ROOT/$directory\n"; + next; + } + + if ($program =~ /(.*?) (.*)/) { + if (! -e $1) { + print STDERR "ERROR: $directory.$1 does not exist\n"; + next; + } + } + else { + if (! -e $program) { + print STDERR "ERROR: $directory.$program does not exist\n"; + next; + } + } + + ### Generate the -ExeSubDir and -Config options + my $inherited_options = " -ExeSubDir $PerlACE::Process::ExeSubDir "; + + foreach my $config ($config_list->my_config_list ()) { + $inherited_options .= " -Config $config "; + } + + $cmd = ''; + if ($opt_s) { + $cmd = "$opt_s \"perl $program $inherited_options\""; + } + else { + $cmd = "perl $program$inherited_options"; + } + + my $result = 0; + + if (defined $opt_d) { + print "Running: $cmd\n"; + } + else { + $start_time = time(); + $result = system ($cmd); + $time = time() - $start_time; + + # see note about tests/run_test.pl printing reports for ace tests individually + if (! $is_ace_test) { + if ($result != 0) { + print "Error: $test returned with status $result\n"; + } + + print "\nauto_run_tests_finished: $test Time:$time"."s Result:$result\n"; + } + } + } +} diff --git a/ACE/bin/autoconf_compile b/ACE/bin/autoconf_compile new file mode 100755 index 00000000000..8c3a283723d --- /dev/null +++ b/ACE/bin/autoconf_compile @@ -0,0 +1,520 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# -*- perl -*- +# $Id$ +# +# This script checkouts ACE from CVS, configures ACE, and compiles +# `ace', `tests' and finally runs `tests/run_tests.sh'. +# +# If it detects any problem it sends e-mail. +# +# DO NOT invoke this script from your crontab, use +# autoconf_compile_wrapper for that. +# +# This script requires Perl 5. +# +# TODO: Modify the script or split it in such a way that the main copy +# can be obtained either using cvs or downloading the latest beta +# from the WWW. +# + +# The first three lines above let this script run without specifying the +# full path to perl, as long as it is in the user's PATH. +# Taken from perlrun man page. + +use File::Basename; +use FileHandle; +require POSIX; + +$directory_mode=0755; + +# This is the module we will checkout, someday someone could define a +# smaller module. +$MODULE='ACE_wrappers'; + +# These are the sub-directories (in the module) we really compile. + +# Find out the command name. +$CMD = basename($0); + +$single_threaded = 0; +$minimum_corba = 0; +$ami = 0; +$dont_update = 0; +$dont_run = 0; +$pre_clean = 0; +$post_clean = 0; +$report_success = 0; +$debug = 0; +@BUILD_LIST= (); + +@ARGS = (); +while ($#ARGV >= 0) { + if (!($ARGV[0] =~ m/-/)) { + push @ARGS, $ARGV[0]; + shift; + } elsif ($ARGV[0] eq "-single_threaded") { + $single_threaded = 1; + shift; + } elsif ($ARGV[0] eq "-minimum_corba") { + $minimum_corba = 1; + shift; + } elsif ($ARGV[0] eq "-ami") { + $ami =1; + shift; + } elsif ($ARGV[0] eq "-build_list") { + shift; + @BUILD_LIST = split (/,/, $ARGV[0]); + shift; + } elsif ($ARGV[0] eq "-dont_update") { + $dont_update = 1; + shift; + } elsif ($ARGV[0] eq "-dont_run") { + $dont_run = 1; + shift; + } elsif ($ARGV[0] eq "-pre_clean") { + $pre_clean = 1; + shift; + } elsif ($ARGV[0] eq "-post_clean") { + $post_clean = 1; + shift; + } elsif ($ARGV[0] eq "-report_success") { + $report_success = 1; + shift; + } elsif ($ARGV[0] eq "-debug") { + $debug = 1; + shift; + } +} + +# Extract configuration information from command line. + # TODO: Some validation and checking should be done here. +$CHECKOUT = $ARGS[0]; +$BUILD = $ARGS[1]; +$LOGDIR = $ARGS[2]; +$ADMIN = $ARGS[3]; +$MAIL = "mail"; +if ($#ARGS >= 4) { + $MAIL = $ARGS[4]; +} + +# We obtain our revision to report errors. +$REVISION='$Revision$ '; + +# When an error is found we try to die gracefully and send some email +# to ADMIN. + +$disable_file = $LOGDIR . '/.disable'; +$histfile = $LOGDIR . '/history'; +$LOGBASE = POSIX::strftime("%b%d_%Y.txt", localtime); +$LOGFILE = $LOGDIR . '/' . $LOGBASE; +$HOST = `hostname`; +chop $HOST; +$LOG_NAME = $HOST . "_" . $BUILD . "_" . $LOGBASE; +$STATUS = "OK"; + +if ($debug) { + print "CHECKOUT = $CHECKOUT\n"; + print "BUILD = $BUILD\n"; + print "LOGDIR = $LOGDIR\n"; + print "ADMIN = $ADMIN\n"; + print "MAIL = $MAIL\n"; +} + +push @INC, $CHECKOUT . '/' . $MODULE . '/bin'; +#require run_all_list; +@RUN_LIST = ('tests'); # Temporary hack + + +if ($#BUILD_LIST == -1) { + @BUILD_LIST= + ('ace', + 'netsvcs', + 'tests', + 'apps/gperf'); +} +if ($debug) { + + @BUILD_LIST = ('ace'); + @RUN_LIST = ('tests'); +# @SINGLE_THREADED_LIST = ('TAO/tests/OctetSeq'); +# @MINIMUM_CORBA_LIST = ('TAO/tests/OctetSeq'); + $ADMIN = $ENV{'LOGNAME'}; + +} + +sub mydie { + unlink $disable_file; + die $_ . "\n"; +} + +sub report_errors { + # First clear the lock, so the next execution works... + unlink $disable_file; # Ignore errors! + + # Now send a summary of the errors to the ADMIN account... + local $to = $ADMIN; + + open (MAIL, "|".$MAIL.' -s "[AUTO_COMPILE] '.$BUILD.'" '.$to) + || mydie "Cannot open mail pipe for: $_\n"; + + print MAIL 'The following message is brought to you by: ', "\n"; + print MAIL $CMD, ' [', $REVISION, "] for $BUILD on $CHECKOUT\n\n"; + + local $m; + foreach $m (@_) { + print MAIL $m, "\n"; + } + + print MAIL "\nPlease check the following log for more info:\n\n"; + print MAIL 'http://www.cs.wustl.edu/~bugzilla/auto_compile_logs/', + $LOG_NAME, "\n\n"; + + close (MAIL); # Ignore errors.... + + # Now send the complete log to bugzilla... + local $bugs = 'bugzilla'.'@cs.wustl.edu'; + open (MAIL, "|".$MAIL.' -s AUTO_COMPILE_LOG='.$LOG_NAME.' '.$bugs) + || mydie "Cannot open mail pipe for: $LOG_NAME\n"; + + print MAIL 'This is the log for: ', "\n"; + print MAIL $CMD, ' [', $REVISION, "] for $BUILD on $CHECKOUT\n"; + + print MAIL "\n================================================================\n"; + + if (open (THELOG, "$LOGFILE")) + { + while (<THELOG>) { + print MAIL $_; + } + close (THELOG); + } + close (MAIL); # Ignore errors.... +} + +### MAIN FUNCTION + +if (-f $disable_file) { + print 'The following message is brought to you by: ', "\n"; + print $CMD, ' [', $REVISION, "] for $BUILD on $CHECKOUT\n"; + + print "DISABLED\n"; + + exit 0; +} + +open (DISABLE, '>' . $disable_file) + || die "cannot open disable file"; +print DISABLE "autoconf_compile <$date> is running\n"; +close (DISABLE) + || die "cannot close disable file"; + +open(HIST, '>>' . $histfile) + # Do not use 'mydie' to report the problem, it tries to remove the + # disable file + || mydie "cannot open history file \"$histfile\"\n"; + +$date = localtime; + +print HIST $CMD, ': running at ', $date, ' '; + +open(LOG, '>' . $LOGFILE) + || mydie "cannot open log file"; + +LOG->autoflush (); + +# The following lines are useful when debugging the script or wrapper. +# print LOG $CHECKOUT, " ", $BUILD, " ", $LOGDIR, " ", $ADMIN, "\n"; +#while (($key,$value) = each %ENV) { +# print LOG $key, " = ", $value, "\n"; +#} + +chdir($CHECKOUT) + || mydie "Cannot chdir to $CHECKOUT"; + +if ($dont_update == 0) { + $date = localtime; + print LOG "$CMD: starting checkout at ", $date, "\n"; + open(CVS, "cvs -q checkout -P $MODULE 2>&1 |") + || mydie "cannot start checkout of $MODULE"; +# open(CVS, "cvsup -g -L 2 -P m ace-supfile 2>&1 |") +# || mydie "cannot start checkout"; + + $conflicts = 0; + while (<CVS>) { + if (m/^C /) { + $conflicts = 1; + } + print LOG $_; + } + close(CVS) + || mydie "error while checking out $MODULE"; + $date = localtime; + print LOG "$CMD: checkout finished at ", $date, "\n"; + + if ($conflicts != 0) { + mydie "conflicts on checkout"; + } +} + +chdir($MODULE) + || mydie "cannot chdir to $MODULE"; + +open (CHLOG, "ChangeLog") + || mydie "cannot open Changelog"; +$_ = <CHLOG>; +chop; +print LOG "ACE ChangeLogTag:", $_, "\n"; +close (CHLOG); + +open (CHLOG, "TAO/ChangeLog") + || mydie "cannot open TAO/Changelog"; +$_ = <CHLOG>; +chop; +print LOG "TAO ChangeLogTag:", $_, "\n"; +close (CHLOG); + +# Bootstrap the workspace +print LOG "$CMD: ==================================================\n\n"; +print LOG "$CMD: bootstrapping the workspace\n"; +open(BOOTSTRAP, "cd $CHECKOUT/ACE_wrappers && " + . "sh bin/bootstrap workspace --enable-deps 2>&1 |") + || mydie "cannot bootstrap workspace for $BUILD"; +while(<BOOTSTRAP>) { + print LOG $_; +} +close(BOOTSTRAP) + || mydie "error while bootstrapping the workspace"; +print LOG "$CMD: ==================================================\n\n"; + +# Begin the workspace configuration +$date = localtime; +print LOG "$CMD: starting configuration at ", $date, "\n"; + +# Check that we're in an ACE "top level" directory. +# We can actually build outside of the top level ACE directory, but +# let's do it this way for now. +(-d 'ace' && -d 'm4') || + die "$0: must be in top level ACE directory!\n"; + +# Create build directories, if needed. +-d 'build' || mkdir ('build', $directory_mode); +-d "$build" || mkdir ('build/' . "$BUILD", $directory_mode); + +# Now enter the build directory. +chdir('build/' . $BUILD) + || mydie "cannot chdir to $BUILD"; + +# Remove the configuration cache file to make sure a fresh +# configuration is created. +unlink "config.cache"; + +# Run the configuration script. +open(CONFIGURE, "sh $CHECKOUT/ACE_wrappers/configure 2>&1 |") + || mydie "cannot configure for $BUILD"; +while(<CONFIGURE>) { + print LOG $_; +} +close(CONFIGURE) + || mydie "error while configuring ACE"; +$date = localtime; +print LOG "$CMD: configure finished at ", $date, "\n"; + + +@failures = (); + +if ($pre_clean) { + foreach $i (@BUILD_LIST) { + $date = localtime; + print LOG "$CMD: =============================================\n"; + print LOG "$CMD: make clean in $i started at ", $date, "\n"; + open(MAKE, "make -k $MAKEFLAGS -C $i clean 2>&1 |") + || mydie "cannot start make in $i"; + + while (<MAKE>) { + # Ignore errors.... + } + if (close(MAKE) == 0) { + push @failures, "errors while cleaning $i"; + } + $date = localtime; + print LOG "$CMD: make clean in $i finished at ", $date, "\n"; + print LOG "$CMD: ==================================================\n\n"; + } +} + +$MAKEFLAGS .= ""; +foreach $i (@BUILD_LIST) { + $date = localtime; + print LOG "$CMD: =============================================\n"; + print LOG "$CMD: make for $i started at ", $date, "\n"; + open(MAKE, "make -k $MAKEFLAGS -C $i 2>&1 |") + || mydie "cannot start make for $i"; + + local $current_dir = $i; + local $last_error = ""; + while (<MAKE>) { + chop; + if ($^O eq 'hpux' + && m/^Warning:[ \t]+[0-9]+ future errors were detected/) { + next; + } + print LOG $_, "\n"; + + if (m/^make(\[[0-9]+\])?: Entering directory /) { + s/^make(\[[0-9]+\])?: Entering directory //; + $current_dir = $_; + } + if (m/error:/i || m/error /i + || m/^make(\[[0-9]+\])?: \*\*\*/) { + if ($last_error ne $current_dir + || STATUS eq "COMPILATION WARNING") { + $STATUS = "COMPILATION ERROR"; + push @failures, "Error while compiling in $current_dir \n"; + $last_error = $current_dir; + } + } + if (m/warning:/i || m/warning /i) { + if ($last_error ne $current_dir) { + if ($STATUS eq "OK") { + $STATUS = "COMPILATION WARNING"; + } + push @failures, "Warning while compiling in $current_dir\n"; + $last_error = $current_dir; + } + } + } + if (close(MAKE) == 0) { + push @failures, "errors while running make in $i"; + } + $date = localtime; + print LOG "$CMD: make for $i finished at ", $date, "\n"; + print LOG "$CMD: =============================================\n\n"; +} + +if ($dont_run == 0) { + @LIST = @RUN_LIST; + if ($single_threaded) { + @LIST = @SINGLE_THREADED_LIST; + } elsif ($minimum_corba) { + @LIST = @MINIMUM_CORBA_LIST; + } elsif ($ami) { + @LIST = @AMI_CORBA_LIST; + } + + foreach $i (@LIST) { + + $date = localtime; + print LOG "$CMD: ==================================================\n"; + print LOG "$CMD: running checks in $i at ", $date, "\n"; + local $subdir = + $CHECKOUT .'/'. $MODULE .'/build/'. $BUILD .'/'. $i; + chdir ($subdir) + || mydie "cannot chdir to $subdir"; + + $run_error = 0; + open(CHECK, "make -k $MAKEFLAGS -C $subdir check 2>&1 |"); + + local $current_dir = $i; + local $last_error = ""; + while (<CHECK>) { + chop; + if ($^O eq 'hpux' + && m/^Warning:[ \t]+[0-9]+ future errors were detected/) { + next; + } + print LOG $_, "\n"; + + if (m/^make(\[[0-9]+\])?: Entering directory /) { + s/^make(\[[0-9]+\])?: Entering directory //; + $current_dir = $_; + } + if (m/error:/i || m/error /i + || m/^make(\[[0-9]+\])?: \*\*\*/) { + if ($last_error ne $current_dir + || STATUS eq "COMPILATION WARNING") { + $STATUS = "COMPILATION ERROR"; + push @failures, "Error while compiling in $current_dir \n"; + $last_error = $current_dir; + } + } + if (m/warning:/i || m/warning /i) { + if ($last_error ne $current_dir) { + if ($STATUS eq "OK") { + $STATUS = "COMPILATION WARNING"; + } + push @failures, "Warning while compiling in $current_dir\n"; + $last_error = $current_dir; + } + } + if (m/Error/ + || m/ERROR/ + || m/FAILED/ + || m/failed/ + || m/FAIL/ + || m/EXCEPTION/ + || m/pure virtual /i) { + if ($STATUS eq "OK") { + $STATUS = "RUNTIME ERROR"; + } + $run_error = 1; + } + } + + if (close(CHECK) == 0) { + if ($STATUS eq "OK") { + $STATUS = "RUNTIME ERROR"; + } + push @failures, "Error when closing pipe in $i"; + next; + } + $date = localtime; + print LOG "$CMD: check finished ", $date, "\n"; + + if ($run_error != 0) { + push @failures, + "errors detected while making check in $i"; + } + } +} + +if ($post_clean) { + foreach $i (@BUILD_LIST) { + $date = localtime; + print LOG "$CMD: ==================================================\n"; + print LOG "$CMD: make clean in $i started at ", $date, "\n"; + open(MAKE, "make -k $MAKEFLAGS -C $i clean 2>&1 |"); + + while (<MAKE>) { + # Ignore errors.... + } + if (close(MAKE) == 0) { + push @failures, "errors while cleaning $i"; + } + $date = localtime; + print LOG "$CMD: make clean in $i finished at ", $date, "\n"; + print LOG "$CMD: ==================================================\n\n"; + } +} + +if ($#failures >= 0) { + report_errors @failures; +} + +close(LOG) + || mydie "cannot close LOGFILE"; + +print HIST "$STATUS\n"; +close(HIST) + || mydie "cannot close history file"; + +unlink $disable_file + || die "cannot unlink disable file"; + +if ($report_success && $STATUS eq "OK") { + report_errors "Congratulations: No errors or warnings detected\n"; +} + +exit 0; diff --git a/ACE/bin/autoconf_compile_wrapper b/ACE/bin/autoconf_compile_wrapper new file mode 100755 index 00000000000..3ffddafb1a1 --- /dev/null +++ b/ACE/bin/autoconf_compile_wrapper @@ -0,0 +1,56 @@ +#! /bin/sh +# +# $Id$ +# +# Usually cron setups a really miserable enviroment, this script +# serves two purposes: +# 1. Setup a good enviroment for auto_compile. +# 2. Invoke auto_compile with the proper arguments for each site. +# +# The idea is to modify this script on a per-site basis and leave +# auto_compile unmodified. +# + +# Setup a proper path, remember that cvs, make, perl5 and your +# compiler must be there. +PATH=.:$HOME/bin:/pkg/gnu/bin:/opt/SUNWspro/bin:$PATH +export PATH + +# Obvious enough. +CVSROOT=/project/cvs-repository +export CVSROOT + +# It could be a good idea to set CVSREAD this will make the staging +# area read-only, but our staging areas are public. +# CVSREAD=Y +# export CVSREAD + +# Here we define the cvs working copy for our staging area. +CHECKOUT=$HOME/head + +# In some sites the building directory differs from the cvs working +# copy. The directory is updated running +# $ACE_ROOT/bin/create_ace_build; but it must be setup manually the +# first time. +# TODO: Arrange for automatic creation of platform_macros.GNU & +# config.h. +BUILD=SUNCC + +# Here is where we store autoconf_compile output and keep a history of +# each run. +LOGDIR=$HOME/head/ACE_wrappers/build/$BUILD/autoconf_compile + +# Who do we send email when compilation (or anything else) fails. +ADMIN=PUT_YOUR_ADDRESS_HERE ; echo "You must edit this file" ; exit 0 + +# You must select a mail tool that can understand the -s option such +# as: +# +# /usr/bin/mailx Solaris +# /usr/bin/mailx HP-UX +# /usr/sbin/mailx IRIX +# /bin/mail Linux + +exec /pkg/gnu/bin/perl $CHECKOUT/ACE_wrappers/bin/autoconf_compile \ + $CHECKOUT $BUILD $LOGDIR $ADMIN /usr/bin/mailx + diff --git a/ACE/bin/bin.mpc b/ACE/bin/bin.mpc new file mode 100644 index 00000000000..38c100259a0 --- /dev/null +++ b/ACE/bin/bin.mpc @@ -0,0 +1,13 @@ +// -*- MPC -*- +// $Id$ + +project(bin) : aceexe, script { + exename = envinfo + Source_Files { + envinfo.cpp + } + Script_Files { + auto_run_tests.pl + ace_tests.lst + } +} diff --git a/ACE/bin/bootstrap b/ACE/bin/bootstrap new file mode 100755 index 00000000000..9aadb28bf13 --- /dev/null +++ b/ACE/bin/bootstrap @@ -0,0 +1,123 @@ +#! /bin/sh + +# ------------------------------------------------------------------------- +# $Id$ +# +# Bootstrap ACE/TAO configuration tools when checked out from CVS. +# Requires GNU autoconf, GNU automake and GNU libtool. +# +# This script is only meant to be run by ACE/TAO maintainers. +# +# ------------------------------------------------------------------------- + +# Copyright (C) 1999, 2002 Ossama Othman +# +# All Rights Reserved +# +# This library is free software; you can redistribute it and/or +# modify it under the current ACE distribution terms. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + + +set -e + +# If paginator environment variable isn't set then use `more'. +PAGER=${PAGER:-more} + +usage() +{ + cat <<EOF | $PAGER +Usage: bootstrap [OPTIONS] + +Generic options: + --help display this help and exit + +EOF + + exit $1 +} + + +if test $# -gt 2; then + usage 1 +fi + +while test $# -gt 0; do + case "$1" in + --help) + usage 0 + ;; + esac + shift +done + + +# This script must be run from the top-level ACE source directory +if test -d m4; then + + ## + # The beta is now cut on a linux box. These are available in /usr/bin. + # + # Set the PATH containing the GNU tools + #if (uname | grep SunOS > /dev/null 2>&1); then + # PATH=/project/danzon/pkg/gnu/bin:$PATH + # export PATH + #fi + + # Update the NEWS file + # For now just copy the contents of the `VERSION' file to make automake + # happy. Eventually, we should start putting real news in to it. +# echo "Creating a NEWS file" +# cp VERSION NEWS + +# autoreconf -I m4 --install --force --symlink --verbose + autoreconf -I m4 --install --force + +# # Generate the man pages. +# # Only generate man pages if bootstrapping a release. +# if test $bootstrap_release = yes; then +# if test -f man/man3/ACE.3; then +# echo ACE man pages have already been generated. +# else +# echo 'Generating the ACE man pages (this may take several minutes)' + +# (ACE_ROOT=.; \ +# export ACE_ROOT; \ +# ./bin/generate_doxygen.pl -is_release -exclude_tao > /dev/null) +# fi # test -f man/man3/ACE.3 +# fi # test $bootstrap_release = yes + +# # Regenerate the man pages lists in the man page Makefiles. + +# if test -f man/man3/Makefile.am; then +# # Only insert man page lists if bootstrapping a release. +# if test $bootstrap_release = yes; then +# echo 'Inserting ACE man page lists into appropriate Makefile.am files.' +# ACE_MAN_PAGES=`(cd man/man3 && echo *.3)` +# else +# ACE_MAN_PAGES= +# fi + +# (cd man/man3; \ +# eval "sed -e 's/^man_MANS =.*$/man_MANS = $ACE_MAN_PAGES/' \ +# Makefile.am > Makefile.am.new"; \ +# mv Makefile.am.new Makefile.am) +# (cd man/html; \ +# eval "sed -e 's/^html_DATA =.*$/html_DATA = $ACE_HTML_MAN_PAGES/' \ +# Makefile.am > Makefile.am.new"; \ +# mv Makefile.am.new Makefile.am) +# else +# test -f man/man3/Makefile.am || echo 'man/man3/Makefile.am is missing!' +# exit 1; +# fi # test -f man/man3/Makefile.am + + # Provide some more "useful" information. + echo "Done bootstrapping ACE autotool support." +else + echo "ACE autotool support must be bootstrapped from the" + echo "top-level ACE source directory." + exit 1; +fi # test -d m4 diff --git a/ACE/bin/ciao_tests.lst b/ACE/bin/ciao_tests.lst new file mode 100644 index 00000000000..7856088794f --- /dev/null +++ b/ACE/bin/ciao_tests.lst @@ -0,0 +1,16 @@ +# $Id$ +# +# This is the list of run_test.pl's that need to be run by +# auto_run_tests.pl. +# Each line has its own test, and a test can be followed by a +# list of configurations it does _not_ run on. +# +# Example: TAO\examples\foo\run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST +# +TAO/CIAO/examples/Hello/descriptors/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST +TAO/CIAO/examples/Hello/descriptors/run_test_without_ns.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO !ST +TAO/CIAO/examples/Hello/descriptors_RTCCM/rt_run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NOXERCES !ACE_FOR_TAO RT_CAPABLE !ST +TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_simple.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST +TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST +TAO/CIAO/DAnCE/tests/NodeApplicationTest/run_test_ex.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST +TAO/CIAO/tests/IDL3/Events/Any/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST diff --git a/ACE/bin/cle.pl b/ACE/bin/cle.pl new file mode 100755 index 00000000000..c6f0b2e2e27 --- /dev/null +++ b/ACE/bin/cle.pl @@ -0,0 +1,289 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# ****************************************************************** +# Author: Chad Elliott +# Date: 6/18/2002 +# $Id$ +# ****************************************************************** + +use strict; +use Cwd; +use File::Basename; +use Sys::Hostname; + +if ( $^O eq 'VMS' ) { + require VMS::Filespec; + import VMS::Filespec qw(unixpath); +} + +unshift(@INC, getExecutePath($0) . 'ChangeLogEditor'); + +require ChangeLogEdit; +require EmailTranslator; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub which { + my($prog) = shift; + my($exec) = $prog; + my($part) = ''; + if ( $^O eq 'VMS' ) { + my($envSep) = ';'; + if (defined $ENV{'PATH'}) { + foreach $part (split(/$envSep/, $ENV{'PATH'})) { + $part .= "$prog"; + if ( -x $part ) { + $exec = $part; + last; + } + } + } + } + else { + my($envSep) = ($^O eq 'MSWin32' ? ';' : ':'); + if (defined $ENV{'PATH'}) { + foreach $part (split(/$envSep/, $ENV{'PATH'})) { + $part .= "/$prog"; + if ( -x $part ) { + $exec = $part; + last; + } + } + } + } + + return $exec; +} + + +sub getExecutePath { + my($prog) = shift; + my($loc) = ''; + + if ( $^O eq 'VMS' ) { + if ($prog ne basename($prog)) { + my($dir) = unixpath( dirname($prog) ); + if ($prog =~ /^[\/\\]/) { + $loc = $dir; + } + else { + $loc = unixpath(getcwd()) . $dir; + } + } + else { + $loc = unixpath( dirname(which($prog)) ); + } + + if ($loc eq '.') { + $loc = unixpath( getcwd() ); + } + } else { + if ($prog ne basename($prog)) { + if ($prog =~ /^[\/\\]/ || + $prog =~ /^[A-Za-z]:[\/\\]?/) { + $loc = dirname($prog); + } + else { + $loc = getcwd() . '/' . dirname($prog); + } + } + else { + $loc = dirname(which($prog)); + } + + $loc =~ s/\/\.$//; + + if ($loc eq '.') { + $loc = getcwd(); + } + + if ($loc ne '') { + $loc .= '/'; + } + } + + return $loc; +} + +sub getDefaultDomain { + my($domain) = undef; + my($host) = hostname(); + + if (defined $host) { + ## First try the hostname + if ($host =~ /[^\.]+\.(.*)/) { + $domain = $1; + } + else { + ## Next try the hosts file + my($hosts) = ($^O eq 'MSWin32' ? + "$ENV{SystemRoot}/system32/drivers/etc/hosts" : + '/etc/hosts'); + my($fh) = new FileHandle(); + if (open($fh, $hosts)) { + while(<$fh>) { + if (/$host\.([^\s]+)/) { + $domain = $1; + last; + } + } + close($fh); + } + + if (!defined $domain) { + ## Next try ipconfig on Windows + if ($^O eq 'MSWin32') { + if (open($fh, 'ipconfig /all |')) { + while(<$fh>) { + if (/Primary\s+DNS\s+Suffix[^:]+:\s+(.*)/) { + $domain = $1; + } + elsif (/DNS\s+Suffix\s+Search[^:]+:\s+(.*)/) { + $domain = $1; + } + } + close($fh); + } + } + else { + ## Try /etc/resolv.conf on UNIX + if (open($fh, '/etc/resolv.conf')) { + while(<$fh>) { + if (/search\s+(.*)/) { + $domain = $1; + last; + } + } + close($fh); + } + } + } + } + } + return $domain; +} + + +sub usageAndExit { + my($arg) = shift; + my($base) = basename($0); + if (defined $arg) { + print "$arg\n\n"; + } + print "Usage: $base [ChangeLog File] [user name] [email address]\n" . + " " . (' ' x length($base)) . "[-d <dir1 dir2 ... dirN>]\n\n" . + " Uses cvs to determine which files are modified or added\n" . + " and generates a bare ChangeLog entry based on those files.\n" . + " This script should be run at the same directory level in\n" . + " which the ChangeLog exists. The entry is prepended to the\n" . + " existing ChangeLog.\n" . + "\n" . + " Email addresses are generated with a certain set of\n" . + " defaults and can be modified using various environment\n" . + " variables. By default email addresses are generated\n" . + " using the user last name followed by an underscore and\n" . + " the first initial of the user first name followed by the\n" . + " email domain.\n" . + "\n" . + " REPLYTO If this environment variable is set, the value\n" . + " is used as the email address.\n" . + " CL_USERNAME This environment variable is used to override\n" . + " the user name (obtained from the password file).\n" . + "\n" . + " The user name and email address can be passed as a parameter to\n" . + " this script. If either is not passed, then the script will try\n" . + " to determine it automatically.\n" . + "\n" . + " If -d is used, everything on the command line after it is\n" . + " considered a directory or file to be considered in the\n" . + " ChangeLog entry.\n"; + exit(0); +} + + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +my($file) = undef; +my($name) = undef; +my($email) = undef; +my(@dirs) = (); +my($restdirs) = 0; + +foreach my $arg (@ARGV) { + if ($restdirs) { + push(@dirs, $arg); + } + elsif ($arg eq '-h') { + usageAndExit(); + } + elsif ($arg eq '-d') { + $restdirs = 1; + } + elsif ($arg =~ /^\-/) { + usageAndExit("Unrecognized parameter: $arg"); + } + elsif (!defined $file) { + $file = $arg; + } + elsif (!defined $name) { + $name = $arg; + } + elsif (!defined $email) { + $email = $arg; + } +} + +if (!defined $file) { + $file = 'ChangeLog'; +} +if (!defined $name) { + my(@pwd) = (); + if (defined $ENV{CL_USERNAME}) { + $pwd[6] = $ENV{CL_USERNAME}; + } + else { + if ($^O eq 'MSWin32' || $^O eq 'cygwin') { + $pwd[6] = 'unknown'; + } + else { + @pwd = getpwuid($<); + $pwd[6] =~ s/,//g; + } + } + $name = $pwd[6]; +} + +if (!defined $email) { + my($trans) = new EmailTranslator(getDefaultDomain()); + $email = $trans->translate($name); +} + +my($editor) = new ChangeLogEdit($name, $email); +my($status, $error, $unknown) = $editor->edit($file, @dirs); + +if (defined $unknown) { + my(@uarray) = @$unknown; + if ($#uarray >= 0) { + print "WARNING: The following files are unknown to the ", + "revision control system:\n"; + foreach my $unk (@uarray) { + print "$unk\n"; + } + print "\n"; + } +} + +if ($status) { + print "You are now ready to edit the $file.\n"; +} +else { + print "$error\n"; +} + +exit($status ? 0 : 1); diff --git a/ACE/bin/clean_dsp.pl b/ACE/bin/clean_dsp.pl new file mode 100755 index 00000000000..a3ff9be8205 --- /dev/null +++ b/ACE/bin/clean_dsp.pl @@ -0,0 +1,52 @@ +# $Id$ +# DSP cleaner + +$if_depth = 0; +@saved_lines = (); +$dirty = 0; +$in_dependency = 0; + +die "Not enough args" if ($#ARGV < 0); + +open (FILE, "<$ARGV[0]"); + +loop: while (<FILE>) +{ + # Check for dependency information + + if (/^DEP/ || /^NODEP/) { + $in_dependency = 1; + } + + if ($in_dependency) { + $in_dependency = 0 if (!/\\$/); + goto loop; + } + + # Check for empty !IF blocks + + if (/^\!IF/) { + ++$if_depth; + } + + push @saved_lines, $_ + if ($if_depth > 0); + + if (/^\!ENDIF/) { + --$if_depth; + print @saved_lines + if ($if_depth == 0 && $dirty == 1); + @saved_lines = (); + $dirty = 0; + } + elsif ($if_depth == 0) { + print; + } + + $dirty = 1 + if ($if_depth > 0 && !/^\!/ && !/^\s+$/); + + +} + +close (FILE); diff --git a/ACE/bin/clean_sems.sh b/ACE/bin/clean_sems.sh new file mode 100755 index 00000000000..b73793c7b62 --- /dev/null +++ b/ACE/bin/clean_sems.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +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 + + +case "$SYSTEM" in + "Linux" ) + ipcs -a | grep $USER | awk '{ print ($2) }' | xargs -r ipcrm sem; + ;; + * ) + semids=`$IPCS | grep "^s" | grep $USER | awk '{ print ($2) }'` + for p in $semids + do $IPCRM $p + done + ;; +esac diff --git a/ACE/bin/clone.csh b/ACE/bin/clone.csh new file mode 100644 index 00000000000..1c14e912d64 --- /dev/null +++ b/ACE/bin/clone.csh @@ -0,0 +1,26 @@ +#!/bin/csh + +set src_root=`pwd` +set dst_root=`abspath $1` + +set subdirs=`find * -type d -print` + +mkdir $dst_root +set files=`find * \( -type d -prune \) -o -type f -print` + +if ($#files) then + ln $files $dst_root +endif + +if ($#subdirs) then + foreach subdir ($subdirs) + cd $src_root + mkdir $dst_root/$subdir + cd $src_root/$subdir + set files=`find * \( -type d -prune \) -o -type f -print` + if ($#files) then + ln $files $dst_root/$subdir + endif + end +endif +exit 0 diff --git a/ACE/bin/cltime.pl b/ACE/bin/cltime.pl new file mode 100755 index 00000000000..a962a20912a --- /dev/null +++ b/ACE/bin/cltime.pl @@ -0,0 +1,13 @@ +# $Id$ +use strict; + +my($name) = shift; +my($email) = shift; +my($entry) = scalar(gmtime()); + +my($tz) = 'UTC'; +$entry =~ s/(:\d\d\s+)(.*)(\d\d\d\d)$/$1$tz $3/; + +$entry .= " $name <$email>"; + +print $entry; diff --git a/ACE/bin/copy-script.sh b/ACE/bin/copy-script.sh new file mode 100755 index 00000000000..aca38ae198e --- /dev/null +++ b/ACE/bin/copy-script.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +for i in *.gz *.bz2 *.zip; do + d=`echo $i | sed 's/\.[tz][ai][rp]/-$1&/'` + echo "Copying $i to $d" + cp -ip $i /export/www/download.dre/previous_versions/$d +done + diff --git a/ACE/bin/count_lines b/ACE/bin/count_lines new file mode 100755 index 00000000000..f440e19c765 --- /dev/null +++ b/ACE/bin/count_lines @@ -0,0 +1,236 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# -*- perl -*- +# $Id$ +# + +use File::Basename; + +$cmd= basename($0); + +if ($#ARGV < 0) { + die "Usage: $cmd module...\n"; +} + +@match_order = (); +%typeRE = (); + +&initfiletypes; + +foreach $module (@ARGV) { + if ( ! -d $module ) { + warn "$cmd: no such directory $module\n"; + next; + } + + open(DIRS, "find $module -type d|"); + @dirs = grep {if(!/CVS/) {chop;}} <DIRS>; + close(DIRS); + + open(FIND, "find $module -type f|"); + @files = grep {if (!/build/ + && !/CVS/ + && !/rpc\+\+/ + && !/\.bpr$/ + && !/\.mdp$/ + && !/\.MDP$/ + && !/\.dsp$/ + && !/\.DSP$/ + && !/\.dsw$/ + && !/\.DSW$/ + && !/\.mak$/ + && !/\.MAK$/ + && !/\.o$/ + && !/\.sl$/ + && !/\.a$/) {chop;}} <FIND>; + close(FIND); + + $totdirs = $#dirs; + $totfiles = $#files; + $totlines = 0; + %lines = (); + + foreach $file (@files) { + $n = 0; + if (!open(IN, $file)) { + warn "$cmd: cannot open '$file' for reading\n"; + next; + } + while(<IN>) { + $n++; + } + close(IN); + $lines{$file} = $n; + $totlines += $n; + } + + + # Define two associative arrays to keep the results for each kind + # of file. + %linespertype = (); + %filespertype = (); + foreach $type (keys %typeRE) { + $linespertype{$type} = 0; + $filespertype{$type} = 0; + } + # The file is classified and added to the corresponding variable. + FILE: while (($file, $l) = each %lines) { + foreach $type (@match_order) { + $re = $typeRE{$type}; + if($file =~ m/$re/) { + $linespertype{$type} += $l; + $filespertype{$type}++; + next FILE; + } + } + print STDERR "Unmatched file: $file\n"; + } + + format STDOUT_TOP= + @||| + $% + + Lines of code in module @<<<<<<<<<<<<<<<<<<<< + $module + +Files: @>>>>>>>> + $totfiles +Directories: @>>>>>>>> + $totdirs +Lines: @>>>>>>>> + $totlines + +File type lines files +---------------------------- ------------------ ----------------- +. + format STDOUT= +@<<<<<<<<<<<<<<<<<<<<<<<<<<< @>>>>>>>>>>>>>>>>> @>>>>>>>>>>>>>>>> +$type, $typelines, $typefiles +. + + + foreach $type (@match_order) { + $typelines = $linespertype{$type}; + $typefiles = $filespertype{$type}; + if ($typefiles != 0) { + write; + } + } + # Forzamos un newpage para cada modulo. + $- = 0; +} + +sub updateRE { + local $desc = shift; + local $re = shift; + + if (exists $typeRE{$desc}) { + local $mix = $typeRE{$desc} . '|(' . $re . ')'; + $typeRE{$desc} = $mix; + } else { + $typeRE{$desc} = '(' . $re . ')'; + push @match_order, $desc; + } +} + +sub initfiletypes { + # Here we define the regular expressions for each kind of file. + # This RE must be mutually exclusive, a file will not be counted + # twice, but it could be unproperly classified. + + local %filenames = + ('GNUmakefile' => 'Makefile', + 'Makefile.*' => 'Makefile', + 'README' => 'README files', + 'COPYING' => 'Licenses', + 'LICENSE.*' => 'Licenses', + 'ChangeLog.*' => 'ChangeLog', + 'ChangeLog-.*' => 'ChangeLog', + '.cvsignore' => 'Control CVS', + 'run_test.pl' => 'Test driver', + 'run_test' => 'Test driver', + 'run_tests' => 'Test driver', + 'run_test.sh' => 'Test driver'); + local %fileexts = + ('cc' => 'C++ sources', + 'cpp' => 'C++ sources', + 'inl' => 'C++ sources', + 'i' => 'C++ sources', + 'h' => 'Headers', + 'hh' => 'Headers', + 'c' => 'C/C++ sources', + 'idl' => 'IDL sources', + 'IDL' => 'IDL sources', + 'pidl' => 'IDL sources', + 'y' => 'yacc source', + 'yy' => 'yacc source', + 'l' => 'lex source', + 'll' => 'lex source', + 'php' => 'php script', + 'pm' => 'perl script', + 'pl' => 'perl script', + 'perl' => 'perl script', + 'py' => 'python script', + 'GNU' => 'GNU make config', + 'tex' => '(La)TeX', + 'txt' => 'Text files', + '1' => 'man pages', + '3' => 'man pages', + 'html' => 'HTML', + 'bib' => 'BibTeX', + 'sty' => 'TeX styles', + 'bld' => 'VxWorks build file', + 'am' => 'Automake file', + 'icc' => 'VisualAge project files', + 'icp' => 'VisualAge project files', + 'vac' => 'VisualAge project files', + 'vcp' => 'Microsof eMbedded Visual Tools project files', + 'vcw' => 'Microsof eMbedded Visual Tools project files', + 'bpr' => 'Borland project files', + 'bor' => 'Borland project files', + 'dsp' => 'DevStudio project files', + 'DSP' => 'DevStudio project files', + 'mdp' => 'MSVC project files', + 'MDP' => 'MSVC project files', + 'dsw' => 'MSVC workspaces', + 'DSW' => 'MSVC workspaces', + 'mak' => 'MSVC MAK files', + 'MAK' => 'MSVC MAK files', + 'java' => 'JAVA source', + 'class' => 'JAVA class', + 'cccc' => 'codecount output', + 'gif' => 'GIF images', + 'conf' => 'Svc_Config files', + 'diff' => 'patches', + 'zip' => 'Compressed files', + 'gz' => 'Compressed files', + 'EXE' => 'Win32 executable', + 'shar' => 'Shar archive', + 'mib' => 'MIB definition files', + 'gperf' => 'GPERF input', + 'phil.*'=> 'Test driver' + ); + local %paths = (); + + local ($desc, $reseed); + while (($reseed, $desc) = each %filenames) { + local $re = '/' . $reseed . '$'; + updateRE($desc, $re); + } + while (($reseed, $desc) = each %fileexts) { + local $re = '/[^/]*\.' . $reseed . '$'; + updateRE($desc, $re); + } + while (($reseed, $desc) = each %paths) { + local $re = $reseed; + updateRE($desc, $re); + } + + updateRE('Others', '.*'); + +# while (($desc, $reseed) = each %typeRE) { +# print STDERR $desc, " ==> ", $reseed, "\n"; +# } +} diff --git a/ACE/bin/create_ace_build b/ACE/bin/create_ace_build new file mode 100755 index 00000000000..273342bbd50 --- /dev/null +++ b/ACE/bin/create_ace_build @@ -0,0 +1,307 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# +# Creates an ACE build tree in directory "build/<build name>" below the current +# directory, which must be an ACE "top level" directory (such as +# $ACE_ROOT). The build tree directory structure mirrors that of the ACE +# top level directory structure, except that instead of containing any plain +# files, it contains only symlinks to the files in the ACE top level structure. +# +# This program has a similar purpose to "clone", but in addition to +# only creating symlinks (clone creates hard links, by default), this +# script: +# 1) uses relative rather than absolute symlinks, +# 2) tries not to put junk files into the build tree, +# 3) only creates a new tree in a build/ directory below the current, +# top level ACE directory (it's a feature :-), but it does enforce +# consistency). +# +# This program can be re-run on a build tree at any time in order to +# update it. It will add symlinks for newly added files, and remove +# any that are no longer valid. +# +# If the <build name> starts with "build/", that part will be removed +# from it. +# +# The first three lines above let this script run without specifying the +# full path to perl, as long as it is in the user's PATH. +# Taken from perlrun man page. + +use File::Find (); +use File::Basename; +use FileHandle; + +print "You should consider using clone_build_tree.pl found with MPC\n"; + +$usage = "usage: $0 -? | [-a] [-d <directory mode>] [-v] <build name>\n"; +$directory_mode = 0777; #### Will be modified by umask, also. +$verbose = 0; + +$source='.'; +$absolute= 0; + +$perl_version = $] + 0; +if ($perl_version >= 5) { + #### Use an eval so that this script will compile with perl4. + eval <<'PERL5_CWD' + require Cwd; + sub cwd { + Cwd::getcwd (); + } +PERL5_CWD +} else { + sub cwd { + local ($pwd); + + chop ($pwd = `pwd`); + $pwd; + } +} + +my($starting_dir) = cwd (); +my(@nlinks) = (); +my($build_re) = undef; + +sub cab_link { + my($real) = shift; + my($fake) = shift; + my($uif) = ($^O eq 'MSWin32' ? 'link' : 'symlink'); + + print "$uif $real $fake\n" if $verbose; + + my($status) = 0; + if ($^O eq 'MSWin32') { + my($fixed) = $fake; + $fixed =~ s/$build_re//; + push(@nlinks, $fixed); + + chdir(dirname($fake)); + $status = link ($real, basename($fake)); + chdir($starting_dir); + } + else { + $status = symlink ($real, $fake); + } + if (!$status) { + warn "$0: $uif to $fake failed\n"; + } +} + +#### +#### Process command line args. +#### +while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) { + if ($ARGV[0] eq '-v') { + $verbose = 1; + } elsif ($ARGV[0] eq '-d') { + if ($ARGV[1] =~ /^\d+$/) { + $directory_mode = eval ($ARGV[1]); shift; + } else { + warn "$0: must provide argument for -d option\n"; + die $usage; + } + } elsif ($ARGV[0] eq '-a') { + $source = &cwd (); + $absolute = 1; + } elsif ($ARGV[0] eq '-?') { + print "$usage"; + exit; + } else { + warn "$0: unknown option $ARGV[0]\n"; + die $usage; + } + shift; +} + +die $usage unless $#ARGV == 0; +$build = $ARGV[0]; +$build =~ s%^build[/\\]%%; #### remove leading "build/", if any +$build = "build/$build"; + +## Set up the build regular expression use under MSWin32 +if ($^O eq 'MSWin32') { + ## Get the original build name + $build_re = $build; + + ## Remove any trailing slashes + $build_re =~ s/[\\\/]+$//; + + ## Add a single trailing slash + $build_re .= '/'; + + ## Escape any special characters + $build_re =~ s/([\\\$\[\]\(\)\.])/\\$1/g; +} + +#### +#### Check that we're in an ACE "top level" directory. +#### +(-d 'ace' && -d 'include') || + die "$0: must be in an ACE top level (ACE_ROOT) directory!\n"; + +#### +#### Create build directories, if needed. +#### +-d 'build' || mkdir ('build', $directory_mode); +-d "$build" || mkdir ("$build", $directory_mode); + +#### +#### Get all ACE plain file and directory names. +#### +@files = (); + +sub wanted { + my ($dev,$ino,$mode,$nlink,$uid,$gid); + + /^CVS\z/s && + ($File::Find::prune = 1) + || + /^build\z/s && + ($File::Find::prune = 1) + || + /^\..*obj\z/s && + ($File::Find::prune = 1) + || + /^Templates\.DB\z/s && + ($File::Find::prune = 1) + || + /^Debug\z/s && + ($File::Find::prune = 1) + || + /^Release\z/s && + ($File::Find::prune = 1) + || + /^Static_Debug\z/s && + ($File::Find::prune = 1) + || + /^Static_Release\z/s && + ($File::Find::prune = 1) + || + ( + ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) && + ! -l $_ && + ! /^core\z/s && + ! /^.*\.state\z/s && + ! /^.*\.so\z/s && + ! /^.*\.[oa]\z/s && + ! /^.*\.dll\z/s && + ! /^.*\.lib\z/s && + ! /^.*\.obj\z/s && + ! /^.*~\z/s && + ! /^\.\z/s && + ! /^\.#.*\z/s && + ! /^.*\.log\z/s + ) && + push(@files, $File::Find::name); +} + +File::Find::find({wanted => \&wanted}, '.'); + +#### +#### Create directories and symlinks to files. +#### +foreach $file (@files) { + $file =~ s%^./%%g; #### excise leading ./ directory component + + if (-d $file) { + unless (-d "$build/$file") { + print "mkdir $build/$file, $directory_mode\n" if $verbose; + mkdir ("$build/$file", $directory_mode); + } + } else { + unless (-e "$build/$file") { + if (!$absolute) { + $up = '../..'; + while ($file =~ m%/%g) { + $up .= '/..'; + } + + cab_link("$up/$file", "$build/$file"); + } else { + $path = $source . '/' . $file; + cab_link("$path", "$build/$file"); + } + } + } +} + +#### +#### Find all the symlinks in the build directory, and remove ones +#### that are no longer actually linked to a file. +#### + +if ($^O eq 'MSWin32') { + my($lfh) = new FileHandle(); + my($txt) = "$build/create_ace_build.links"; + if (open($lfh, "$txt")) { + while(<$lfh>) { + my($line) = $_; + $line =~ s/\s+$//; + if (-e $line) { + push(@nlinks, $line); + } + else { + print "Removing $build/$line \n" if $verbose; + unlink("$build/$line") || warn "$0: unlink of $build/$line failed\n"; + } + } + close($lfh); + } + + ## Rewrite the link file. + unlink($txt); + if (open($lfh, ">$txt")) { + foreach my $file (@nlinks) { + print $lfh "$file\n"; + } + close($lfh); + } +} +else { + @lfiles = (); + + sub lcheck { + ## There's no way to know if we have hard linked back to a now + ## non-existent file. So, just do the normal -l on the file + ## which will cause no files to be pushed on Windows. + if (-l $_) { + push(@lfiles, $File::Find::name); + } + } + + File::Find::find({wanted => \&lcheck}, $build); + + foreach (@lfiles) { + local @s = stat $_; + if ($#s == -1) { + print "Removing $_ \n" if $verbose; + unlink $_ || warn "$0: unlink of $_ failed\n"; + } + } +} + +#### +#### Done: print message. +#### +print "\nCompleted creation of $build/.\n"; +my($msg) = ''; +if (! -e "$build/ace/config.h") { + $msg .= "$build/ace/config.h"; +} + +if ($^O ne 'MSWin32' && + ! -e "$build/include/makeinclude/platform_macros.GNU") { + if ($msg ne '') { + $msg .= " and\n"; + } + $msg .= "$build/include/makeinclude/platform_macros.GNU"; +} + +if ($msg ne '') { + print "Be sure to setup $msg.\n"; +} + +#### EOF diff --git a/ACE/bin/create_ace_build.pl b/ACE/bin/create_ace_build.pl new file mode 100755 index 00000000000..e7876bd3791 --- /dev/null +++ b/ACE/bin/create_ace_build.pl @@ -0,0 +1,463 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# +# Creates an ACE build tree in directory "build/<build name>" below the $ACE_ROOT +# directory. The build tree directory structure mirrors that of the ACE +# top level directory structure, except that instead of containing any plain +# files, it contains only links to the files in the ACE top level structure. +# Symbolic links will be used instead of hard links if available. +# +# Makefiles, projects, and other build files are not linked. This allows +# use of MPC to generate the correct project types as needed. Use the +# -nompc option to disable this. +# +# This program has a similar purpose to "clone", but in addition to +# only creating symlinks (clone creates hard links, by default), this +# script: +# 1) uses relative rather than absolute symlinks, +# 2) tries not to put junk files into the build tree, +# 3) only creates a new tree in a build/ directory below the current, +# top level ACE directory (it's a feature :-), but it does enforce +# consistency). +# +# This program can be re-run on a build tree at any time in order to +# update it. It will add links for newly added files, and remove +# any that are no longer valid. +# Specifying no command line options will cause all current builds +# to be updated. +# +# If the <build name> starts with "build/", that part will be removed +# from it. + +use File::Find (); +use File::Basename; +use FileHandle; +use File::stat; +use File::Copy; +use File::Path; + +print "You should consider using clone_build_tree.pl found with MPC\n"; + +$usage = "usage: $0 -? | [-a] [-d <directory mode>] [-v] [-nompc] <build name>\n"; +$directory_mode = 0777; #### Will be modified by umask, also. +$verbose = 0; +$mpc = 1; #### When using mpc, we don't want links created for mpc-generated files. +$update_all = 1; +$source='.'; +$absolute = 0; + +#### +#### Check that we're in an ACE "top level" directory. +#### +unless (-d 'ace' && -d 'include') { + die "Must be in an ACE top level (ACE_ROOT) directory!\n"; +} +if (-e 'create_ace_build.links') { + die "Must be in an ACE top level (ACE_ROOT) directory!\n"; +} + +$perl_version = $] + 0; +if ($perl_version >= 5) { + #### Use an eval so that this script will compile with perl4. + eval <<'PERL5_CWD' + require Cwd; + sub cwd { + Cwd::getcwd (); + } +PERL5_CWD +} else { + sub cwd { + local ($pwd); + + chop ($pwd = `pwd`); + $pwd; + } +} + +my($starting_dir) = cwd (); +my(@nlinks) = (); +my(@build_re) = (); + +print "Creating or updating builds in $starting_dir\n"; + +#### If the $linked file is newer than the real file then +#### backup the real file, and replace it with the linked +#### version. + +sub backup_and_copy_changed { + my($real, $linked) = @_; + my($status_real) = stat($real); + + if (! $status_real) { + die "ERROR: cannot access $real.\n"; + } + + my($status_linked) = stat($linked); + if ($status_linked->mtime > $status_real->mtime) { + rename($real, $real . '.bak'); + rename($linked, $real); + return 1; + } + + if ($status_real->mtime != $status_linked->mtime) { + unlink($linked); + return 1; + } + if ($status_real->size != $status_linked->size) { + unlink($linked); + return 1; + } + return 0; +} + +sub cab_link { + my($real,$linked,$build_regex) = @_; + + my($status) = 0; + if ($^O eq 'MSWin32') { + my($fixed) = $linked; + $fixed =~ s/$build_regex//; + push(@nlinks, $fixed); + + my($curdir) = "$starting_dir/" . dirname($linked); + if (! -d $curdir) { + die "ERROR: Dir not found: $curdir\n"; + } + $status = chdir($curdir); + if (! $status) { + die "ERROR: cab_link() chdir " . $curdir . " failed.\n"; + } + + my($base_linked) = basename($linked); + + if (! -e $real) { + ## If the real file "doesn't exist", then we need to change back to + ## the starting directory and look up the short file name. + chdir($starting_dir); + my($short) = Win32::GetShortPathName($fixed); + + ## If we were able to find the short file name, then we need to + ## modyfy $real. Note, we don't need to change back to $curdir + ## unless the short name lookup was successful. + if (defined $short) { + ## Replace a section of $real (the part that isn't a relative + ## path) with the short file name. The hard link will still have + ## the right name, it's just pointing to the short name. + substr($real, length($real) - length($fixed)) = $short; + + ## Get back to the right directory for when we make the hard link + chdir($curdir); + } + else { + ## This should never happen, but there appears to be a bug + ## with the underlying win32 apis on Windows Server 2003. + ## Long paths will cause an error which perl will ignore. + ## Unicode versions of the apis seem to work fine. + ## To experiment try Win32 _fullpath() and CreateHardLink with + ## long paths. + print "ERROR : Skipping $real.\n"; + return; + } + } + + if (-e $base_linked) { + if (! backup_and_copy_changed($real, $base_linked)) { + return; + } + } + + print "link $real $linked\n" if $verbose; + $status = link ($real, $base_linked); + if (! $status) { + ## Once again, this happens for long paths on Win2003 + print "ERROR: Can't link $real\n"; + return; + } + chdir($starting_dir); + } else { + print "$symlink $real $linked\n" if $verbose; + $status = symlink ($real, $linked); + } + if (!$status) { + die "$0: $real -> $linked failed\n"; + } +} + +#### +#### Process command line args. +#### +while ($#ARGV >= 0 && $ARGV[0] =~ /^-/) { + if ($ARGV[0] eq '-v') { + $verbose = 1; + } elsif ($ARGV[0] eq '-d') { + if ($ARGV[1] =~ /^\d+$/) { + $directory_mode = eval ($ARGV[1]); shift; + } else { + warn "$0: must provide argument for -d option\n"; + die $usage; + } + } elsif ($ARGV[0] eq '-a' && ! ($^O eq 'MSWin32')) { + $source = &cwd (); + $absolute = 1; + } elsif ($ARGV[0] =~ /-[?hH]$/) { + die "$usage"; + } elsif ($ARGV[0] eq '-nompc') { + $mpc = 0; + } else { + warn "$0: unknown option $ARGV[0]\n"; + die $usage; + } + shift; +} + +@builds = (); + +if ($#ARGV == 0) { + $update_all = 0; + $builds[0] = $ARGV[0]; + $builds[0] =~ s%^build[/\\]%%; #### remove leading "build/", if any + $builds[0] = "build/$builds[0]"; +} else { + @builds = glob "build/*"; +} + +sub create_build_regex { + if ($^O eq 'MSWin32') { + for ($idx = 0; $idx <= $#builds; $idx++) { + ## Get the original build name + $build_re[$idx] = $builds[idx]; + + ## Remove any trailing slashes + $build_re[$idx] =~ s/[\\\/]+$//; + + ## Add a single trailing slash + $build_re[$idx] .= '/'; + + ## Escape any special characters + $build_re[$idx] =~ s/([\\\$\[\]\(\)\.])/\\$1/g; + } + } +} + +create_build_regex(); + +# all builds go in ACE_wrappers\build +unless (-d "$starting_dir/build") { + print "Creating $starting_dir/build\n"; + mkdir ("$starting_dir/build", $directory_mode); +} +foreach $build (@builds) { + unless (-d "$starting_dir/$build") { + print "Creating $starting_dir/$build\n"; + mkpath ("$starting_dir/$build", 0, $directory_mode); + } +} + +#### +#### Get all ACE plain file and directory names. +#### +@files = (); + +sub wanted { + my ($dev,$ino,$mode,$nlink,$uid,$gid); + + $matches = ! ( + /^CVS\z/s && ($File::Find::prune = 1) + || + /^build\z/s && ($File::Find::prune = 1) + || + /^\..*obj\z/s && ($File::Find::prune = 1) + || + /^Templates\.DB\z/s && ($File::Find::prune = 1) + || + /^Debug\z/s && ($File::Find::prune = 1) + || + /^Release\z/s && ($File::Find::prune = 1) + || + /^Static_Debug\z/s && ($File::Find::prune = 1) + || + /^Static_Release\z/s && ($File::Find::prune = 1) + || + /^\.svn\z/s && ($File::Find::prune = 1) + ); + + $matches = $matches && + ( + ($nlink || (($dev,$ino,$mode,$nlink,$uid,$gid) = lstat($_))) && + ! -l $_ && + ! /^core\z/s && + ! /^.*\.state\z/s && + ! /^.*\.so\z/s && + ! /^.*\.[oa]\z/s && + ! /^.*\.dll\z/s && + ! /^.*\.lib\z/s && + ! /^.*\.obj\z/s && + ! /^.*~\z/s && + ! /^\.\z/s && + ! /^\.#.*\z/s && + ! /^.*\.log\z/s + ); + + if ($mpc && $matches) { + $matches = + ($File::Find::dir =~ /include\/makeinclude*/) || + ( + ! /^.*\.dsp\z/s && + ! /^.*\.vcproj\z/s && + ! /^.*\.bor\z/s && + ! /^.*\.dsw\z/s && + ! /^.*\.sln\z/s && + ! /^.*\.vcp\z/s && + ! /^.*\.nmake\z/s && + ! /^.*\.am\z/s && + ! /^.*\.vcw\z/s && + ! /^.*\.mak\z/s && + ! /^.*\.bld\z/s && + ! /^.*\.icc\z/s && + ! /^.*\.icp\z/s && + ! /^.*\.ncb\z/s && + ! /^.*\.opt\z/s && + ! /^.*\.bak\z/s && + ! /^.*\.ilk\z/s && + ! /^.*\.pdb\z/s && + ! /^\.cvsignore\z/s && + ! /^\.disable\z/s && + ! /^GNUmakefile.*\z/s + ); + } + + if ($matches) { + push(@files, $File::Find::name); + } +} + +File::Find::find({wanted => \&wanted}, '.'); + +print "Found $#files files and directories.\n"; + +#### +#### Create directories and symlinks to files. +#### +foreach $file (@files) { + $file =~ s%^./%%g; #### excise leading ./ directory component + my($fullname) = "$starting_dir/$file"; + for ($idx = 0; $idx <= $#builds; $idx++) { + my($build) = $builds[$idx]; + if (-d $fullname) { + unless (-d "$starting_dir/$build/$file") { + print "Creating $build/$file\n" if $verbose; + mkdir ("$starting_dir/$build/$file", $directory_mode); + } + } else { + unless (($^O ne 'MSWin32') && (-e "$build/$file")) { + if (!$absolute) { + $up = '..'; + while ($build =~ m%/%g) { + $up .= '/..'; + } + while ($file =~ m%/%g) { + $up .= '/..'; + } + cab_link("$up/$file", "$build/$file", $build_re[$idx]); + } else { + $path = $source . '/' . $file; + cab_link("$path", "$build/$file", $build_re[$idx]); + } + + } + } + } +} + +print "Finished creating and updating links.\n"; + +foreach $build (@builds) { + #### + #### Find all the symlinks in the build directory, and remove ones + #### that are no longer actually linked to a file. + #### + + if ($^O eq 'MSWin32') { + my($lfh) = new FileHandle(); + my($links_file) = "$starting_dir/$build/create_ace_build.links"; + if (-e $links_file) { + if (open($lfh, $links_file)) { + while(<$lfh>) { + my($line) = $_; + $line =~ s/\s+$//; + if (-e "$starting_dir/$line") { + ## The links were already added in cab_link when they + ## were checked for changes. + } else { + print "Removing $build/$line \n" if $verbose; + unlink("$starting_dir/$build/$line") || warn "$0: unlink of $build/$line failed\n"; + } + } + close($lfh); + } + unless (unlink($links_file)) { + die "Couldn't delete links file.\n"; + } + } + print "Writing $#nlinks links to link file.\n"; + if (open($lfh, ">$links_file")) { + foreach my $lnk (@nlinks) { + print $lfh "$lnk\n"; + } + close($lfh); + } else { + die "Couldn't open links file.\n"; + } + } + else { + @lfiles = (); + + sub lcheck { + ## There's no way to know if we have hard linked back to a now + ## non-existent file. So, just do the normal -l on the file + ## which will cause no files to be pushed on Windows. + if (-l $_) { + push(@lfiles, $File::Find::name); + } + } + + File::Find::find({wanted => \&lcheck}, $build); + + foreach (@lfiles) { + local @s = stat $_; + if ($#s == -1) { + print "Removing $_ \n" if $verbose; + unlink $_ || warn "$0: unlink of $_ failed\n"; + } + } + } + + #### + #### Done: print message. + #### + print "\nCompleted creation of $build/.\n"; + +foreach $build (@builds) { + unless (-d "$starting_dir/$build") { + print "Creating $starting_dir/$build\n"; + mkdir ("$starting_dir/$build", $directory_mode); + } + + + if (! -e "$starting_dir/$build/ace/config.h") { + print "Be sure to setup $build/ace/config.h"; + } + + if ($^O ne 'MSWin32' && + ! -e "$starting_dir/$build/include/makeinclude/platform_macros.GNU") { + print " and\n$build/include/makeinclude/platform_macros.GNU"; + } + print ".\n"; +} + +} + +#### EOF diff --git a/ACE/bin/cut_cidlc.sh b/ACE/bin/cut_cidlc.sh new file mode 100755 index 00000000000..09f9e5de913 --- /dev/null +++ b/ACE/bin/cut_cidlc.sh @@ -0,0 +1,55 @@ +#!/bin/bash +# $Id$ + +function strip-binary { + mkdir -p cut_cidlc/$1 + cd cut_cidlc/$1 + cp /web/users/isisbuilds/CIDLC/$1/cidlc . + strip cidlc + bzip2 cidlc + mv cidlc.bz2 cidlc-$2.bz2 +} + +case "$1" in + gnu-linux) + strip-binary $1 $2 + ;; + + solaris-sparc) + strip-binary "Solaris/SPARC" $2 + ;; + + solaris-x86) + strip-binary "Solaris/x86" $2 + ;; + + darwin) + strip-binary "Darwin/PowerPC" $2 + ;; + + *) + ssh tango.dre.vanderbilt.edu ~/cut_cidlc.sh gnu-linux $1 + ssh sparc.dre.vanderbilt.edu ~/cut_cidlc.sh solaris-sparc $1 + ssh corona.dre.vanderbilt.edu ~/cut_cidlc.sh solaris-x86 $1 + ssh abbarach.dre.vanderbilt.edu ~/cut_cidlc.sh darwin $1 + + cd cut_cidlc + cp gnu-linux/cidlc-$1.bz2 /web/www/cidlc/binary/gnu-linux/i386/ + cp Solaris/SPARC/cidlc-$1.bz2 /web/www/cidlc/binary/solaris/SPARC/ + cp Solaris/x86/cidlc-$1.bz2 /web/www/cidlc/binary/solaris/x86/ + cp Darwin/PowerPC/cidlc-$1.bz2 /web/www/cidlc/binary/darwin/powerpc/ + + #Grab windows + cp /web/users/isisbuilds/CIDLC/Win32/cidlc.exe . + zip ./cidlc-$1.zip ./cidlc.exe + rm ./cidlc.exe + cp ./cidlc-$1.zip /web/www/cidlc/binary/windows/i386/ + + cd .. + rm -rf cut_cidlc + ;; +esac + +exit 0 + + diff --git a/ACE/bin/depgen.pl b/ACE/bin/depgen.pl new file mode 100755 index 00000000000..1a137f47d96 --- /dev/null +++ b/ACE/bin/depgen.pl @@ -0,0 +1,56 @@ +eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' + & eval 'exec perl -w -S $0 $argv:q' + if 0; + +# ************************************************************ +# Description : Generate dependencies for GNU Make and NMake. +# Author : Chad Elliott +# Create Date : 5/06/2002 +# $Id$ +# ************************************************************ + +# ************************************************************ +# Pragma Section +# ************************************************************ + +use strict; +use FindBin; +use File::Spec; +use File::Basename; + +my($basePath) = $FindBin::Bin; +if ($^O eq 'VMS') { + $basePath = File::Spec->rel2abs(dirname($0)) if ($basePath eq ''); + $basePath = VMS::Filespec::unixify($basePath); +} +unshift(@INC, $basePath . '/DependencyGenerator'); + +my($mpcroot) = $ENV{MPC_ROOT}; +my($mpcpath) = (defined $mpcroot ? $mpcroot : + dirname($basePath) . '/MPC'); +unshift(@INC, $mpcpath . '/modules/Depgen', $mpcpath . '/modules'); + +if (! -d "$mpcpath/modules/Depgen") { + print STDERR "ERROR: Unable to find the MPC DependencyGenerator ", + "modules in $mpcpath.\n"; + if (defined $mpcroot) { + print STDERR "Your MPC_ROOT environment variable does not point to a ", + "valid MPC location.\n"; + } + else { + print STDERR "You can set the MPC_ROOT environment variable to the ", + "location of MPC.\n"; + } + exit(255); +} + +require Driver; + +# ************************************************************ +# Main Section +# ************************************************************ + +my($driver) = new Driver('UNIX=gnu', + 'automatic=ACE_ROOT,TAO_ROOT,CIAO_ROOT,' . + 'DDS_ROOT,ACE_PLATFORM_CONFIG'); +exit($driver->run(\@ARGV)); diff --git a/ACE/bin/diff-builds.pl b/ACE/bin/diff-builds.pl new file mode 100755 index 00000000000..1add07303c0 --- /dev/null +++ b/ACE/bin/diff-builds.pl @@ -0,0 +1,299 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use File::Spec qw/ tmpdir /; +use File::Temp qw/ tempfile tempdir /; +use POSIX qw/ strftime /; + +my $debugging = 0; # Print additional info +my $verbose = '-q'; # WGET verbosity +my $new_errors_only = 0; # Show new errors only +my $clean_builds_only = 1; # Only diff todays clean builds + +# The root of the test statistics +my $teststaturl = "http://www.dre.vanderbilt.edu/~remedynl/teststat/builds/"; + +my $allbuildsurl = "http://www.dre.vanderbilt.edu/~remedynl/teststat/buildscore.log"; +my $cleanbuildsurl = "http://www.dre.vanderbilt.edu/~remedynl/teststat/cleanbuildtests.log"; + +# Determine the available timestamps for a build on a date, +# by scanning the index page (build.html) +sub find_timestamps ($$) { + + my ($file,$date) = @_; + +# print "\nSearching for $file, $date\n"; + open (INDEX, "wget " . $verbose . " \'" . $teststaturl . $file . ".html\' -O - |") + || die "***Could not read the index page for $file\n"; + + # Split at all HTML tags, except <a ..> + my @suffixes = split ( /[<][b-zB-Z\/]+[>]/, <INDEX>); + close (INDEX); + + # Select only those of the "href=..." that match our file and date + my $rx = quotemeta ( $file . '_' . $date); + my @temp = map { (/${rx}_([0-9][0-9]_[0-9][0-9])/) ? $1 : "" } @suffixes; + return grep /^[0-9]/, @temp; +} + +# Determine the timestamp by scanning the index +sub find_closest_earlier { + + my ($file,$date) = @_; + + open (INDEX, "wget " . $verbose . " \'" . $teststaturl . $file . ".html\' -O - |") + || die "***Could not read the index page for $file\n"; + + # Split at all HTML tags, except <a ..> + my @suffixes = split ( /[<][b-zB-Z\/]+[>]/, <INDEX>); + close (INDEX); + + # Select only those of the "href=..." that match our file + my $rx = quotemeta ( $file); + my @temp = map { (/${rx}_([0-9][0-9][0-9][0-9]_[0-9][0-9]_[0-9][0-9])/ && $1 le $date) ? $1 : undef } @suffixes; + my @temp2 = grep /^[0-9]/, @temp; + + if ($#temp2 == -1) { + return undef; + } + + return $temp2[0]; +} + + +sub select_builds ($$$) +{ + my ($rdates, $rbuilds, $rfiles) = @_; + my @dates = @{$rdates}; + my @builds = @{$rbuilds}; + + if ($#dates eq 1) { + $rfiles->[0] = $rbuilds->[0]; + $rfiles->[1] = $rbuilds->[0]; + } + elsif ($#builds eq 1) { + $rfiles->[0] = $rbuilds->[0]; + $rfiles->[1] = $rbuilds->[1]; + + $rdates->[1] = $rdates->[0]; + + } + else { + die "Dates: $#dates, Builds: $#builds\n"; + } + + return 0; +} + + +sub load_failed_tests_list ($$) +{ + my ($file, $original_date) = @_; + + my $date = $original_date; + my $last_tried_date = $original_date; + my @timestamps = (); + + while ($#timestamps < 0) { + + @timestamps = find_timestamps ($file, $date); + + if ($#timestamps == -1) { + $date = find_closest_earlier ($file, $date); + if (!$date) { + print "***Found no builds for $file on, or before $original_date\n"; + return File::Spec->devnull(); + } + + print "***No builds for $file on $last_tried_date. The closest earlier is " + . $date . "\n"; + + $last_tried_date = $date; + next; + } + + print "Build times for $file on $date are " + . join (', ', @timestamps) . "\n" unless !$debugging; + } + + my $tmpdir = File::Spec->tmpdir(); + my $fullfile = $file .'_' . $date . '_' . $timestamps[0]; + my ($fh, $tmpfile) = tempfile ($fullfile . ".XXXXXX", UNLINK => 1, DIR => $tmpdir); + + print "wget " . $verbose . " \'" .$teststaturl + . $fullfile . ".log\' -O - | sort >\'" . $tmpfile . '\'' . "\n" unless !$debugging; + + system ("wget " . $verbose . " \'" .$teststaturl + . $fullfile . ".log\' -O - | sort >\'" . $tmpfile . '\''); + close ($fh); + + return $tmpfile; +} + +sub differentiate ($$) +{ + my ($rfiles, $rdates) = @_; + + print "Difference for dates " . join (', ', @$rdates) . "\n" unless !$debugging; + + my $first_file = load_failed_tests_list ($rfiles->[0], $rdates->[0]); + my $second_file = load_failed_tests_list ($rfiles->[1], $rdates->[1]); + + open (DIFF, "diff -u \'" . $first_file . "\' \'" . $second_file . "\' 2>&1 |") + || die "***Failed to diff \'" . $first_file . "\' \'" . $second_file . "\'\n"; + + while (<DIFF>) { + + # Don't filter out the build details when printing the new errors only + if (/^---/) { + print; + } + elsif (/^[^\+]/) { + print unless ($new_errors_only == 1); + } + else { + print; + } + } + + close (DIFF); + print "\n"; +} + + +sub find_builds ($$$) +{ + my ($rbuilds, $buildscoreurl, $selectcolumn) = @_; + + print "Reading from $buildscoreurl\n" unless !$debugging; + + open (CLEANS, "wget " . $verbose . " \'" . $buildscoreurl . "\' -O - |") + || die "Could not read builds score page $buildscoreurl\n"; + + # Split at all spaces + for(my $begin=0; <CLEANS>;) + { + chomp; + my @columns = split (/ +/); + + if (/=+/) { + $begin++; + next; + } + + push (@{$rbuilds}, $columns[$selectcolumn]) unless !$begin; + + } + close (CLEANS); + sort @{$rbuilds}; + + print "Using builds @{$rbuilds}\n" unless !$debugging; +} + +my @dates = (); +my @builds = (); +my @files = (); + + +while ($arg = shift(@ARGV)) { + + if ($arg eq "-h" || $arg eq "-?") { + print "Prints a diff for the list of test failures, for two builds on a certain date\n\n"; + print "diff-builds [-n] [-d] [-D date] [-A] [build ...]\n"; + print "\n"; + print " -n -- Show only new test failing (default=no)\n"; + print " -d -- Show debug info\n"; + print " -h -- Prints this information\n"; + print " -D date -- Specify a date. Either YYYY_MM_DD or YYYY-MM-DD works\n"; + print " Use two date parameters to specify an interval\n"; + print " -A -- Use all builds, not just the clean (successful) ones\n"; + print " build -- Specify the build name. As it appears on the scoreboard\n"; + print " Works with two builds and one date to show the differences\n"; + print " between them. One build and two dates works, too.\n"; + print " Just a single date (no builds) implies comparing all of \n"; + print " today's builds with the builds on the supplied date.\n"; + exit 0; + } + if ($arg eq '-D') { + my $date = shift(@ARGV); + $date =~ s/-/_/g; + push (@dates, $date); + print "Date=$date\n" + unless !$debugging; + } + elsif ($arg eq '-v') { + $verbose = undef; + } + elsif ($arg eq '-d') { + $debugging = 1; + } + elsif ($arg eq '-n') { + $new_errors_only = 1; + } + elsif ($arg eq '-A') { + $clean_builds_only = 0; + } + else { + push (@builds, $arg); + print "Build=$arg\n" + unless !$debugging; + } +} + + +# Diff the todays clean builds with the ones from a specific date +if ($#builds == -1 && $#dates >= 0) +{ + if ($clean_builds_only) { + find_builds (\@builds, $cleanbuildsurl, 7); + } + else { + find_builds (\@builds, $allbuildsurl, 3); + } + + # only the start date given - implies we should + # use the today's date + if ($#dates == 0) { + $dates[1] = strftime ("%Y_%m_%d", gmtime); + } + + foreach $build (sort @builds) { + $files[0] = $files[1] = $build; + differentiate (\@files, \@dates); + } +} +else +{ + + die "More than one date or build name are required" + unless ($#dates + $#builds ge 1); + + print "dates=@dates ($#dates)\n" + unless !$debugging; + + print "builds=@builds ($#builds)\n" + unless !$debugging; + + select_builds (\@dates, \@builds, \@files); + differentiate (\@files, \@dates); +} +__END__ + +=head1 diff-builds.pl Diff the lists of failing tests + +=item DESCRIPTION +Prints a diff for the list of test failures, for two builds on a certain date. +Or, for two dates and a certain build. + + +=item EXAMPLE + +diff-builds.pl WinXP_VC71_NET_Static_Debug -D 2006_04_17 -D 2006_05_12 + +=item AUTHOR +Iliyan Jeliazkov <iliyan@ociweb.com> + diff --git a/ACE/bin/doxygen-convert-h.pl b/ACE/bin/doxygen-convert-h.pl new file mode 100755 index 00000000000..279359eb41b --- /dev/null +++ b/ACE/bin/doxygen-convert-h.pl @@ -0,0 +1,562 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# doxygen-convert-h.pl is a script that would be used to convert old +# documented style ACE/TAO header files to doxygen style. + +# TODO List: +# (Search for @todo in this script) + +use File::Copy; +use FileHandle; +use Getopt::Std; + +############################################################################## +# Parse the options + +if (!getopts ('dDhsu') || $opt_h) { + print "doxygen-convert-h.pl [-dDhsu] filenames or directories\n"; + print "\n"; + print " -d debug script\n"; + print " -D really verbose debug\n"; + print " -h display this help\n"; + print " -s print result to stdout\n"; + print " -u turn off file verification\n"; + exit (1); +} + +## if verbose debug, also regular debug +$opt_d = 1 if (defined $opt_D); + +############################################################################## +# Find the files + +@files = (); + +sub recursive_find { + my($file) = shift; + my(@rfiles) = (); + my($fh) = new FileHandle(); + + if (opendir($fh, $file)) { + foreach my $f (grep(!/^\.\.?$/, readdir($fh))) { + if ($f ne '.svn') { + my($full) = "$file/$f"; + if (-d $full) { + push(@rfiles, recursive_find($full)); + } + else { + push(@rfiles, $full) + if ($f =~ /\.(h|hxx|hpp|hh|inl|cpp|cxx|cc|c|C)$/) + ; + } + } + } + closedir($fh); + } + + return @rfiles; +} + +foreach $arg (@ARGV) { + my @results = glob $arg; + if ($#results < 0) { + print STDERR "File not Found: $arg\n" + } + else { + foreach my $result (@results) { + if (-d $result) { + push(@files, recursive_find($result)); + } + else { + push(@files, $result); + } + } + } +} + +############################################################################## +# Subroutines used to change the file. + +$fail = 0; + +sub verify (@) +{ + my (@contents) = @_; + + print "Verification\n" if (defined $opt_d); + + my $found_id = 0; + my $found_filename = 0; + + foreach $line (@contents) { + $found_id = 1 if ($line =~ /\$Id\:/); + $found_filename = 1 if ($line =~ /\= FILENAME/); + } + + return 0 if ($found_id == 1 && $found_filename == 1); + + # failed + return 1; +} + +sub format_description (@) +{ + my (@description) = @_; + my @after = (); + + my $line; + + if ($#description < 1) { + foreach $line (@description) { + $line =~ s/\/\// \* \@brief /; + push @after, $line; + } + } + else { + foreach $line (@description) { + $line =~ s/\/\// \*/; + $line =~ s/\* /\* /; + push @after, $line; + } + } + + return @after; +} + +sub fix_file_header (@) +{ + my (@before) = @_; + my @after = (); + my @description = (); + my $id = "\$Id\$\n"; + my $authors = ""; + + my $state = 'before'; + ## state = before, filename, description, author, after, done + + print "Fixing File Header\n" if (defined $opt_d); + + LOOP: foreach $line (@before) { + printf ("%10s %s", $state, $line) if (defined $opt_D); + + if ($state eq 'done') { + push @after, $line; + next LOOP; + } + + if ($state eq 'before') { + if ($line =~ /\-\*\- C\+\+ \-\*\-/) { + push @after, $line; + } + elsif ($line =~ /\$Id\:(.*)\n/) { + $id = "\$Id\:$1"; + } + elsif ($line =~ /===================/) { + push @after, "//========================================". + "=====================================\n"; + push @after, "/**\n"; + } + elsif ($line =~ /\= FILENAME/) { + $state = 'filename'; + next LOOP; + } + elsif ($line !~ /^\s*\/\//) { + push @after, $line; + } + } + + if ($state eq 'filename') { + if ($line =~ /\/\/ (.+)/) { + push @after, " * \@file $1\n"; + push @after, " *\n"; + push @after, " * $id\n"; + push @after, " *\n"; + } + elsif ($line =~ /\= DESCRIPTION/) { + $state = 'description'; + next LOOP; + } + elsif ($line =~ /\= AUTHOR/) { + $state = 'author'; + next LOOP; + } + elsif ($line =~ /===================/) { + $state = 'after'; + ### Fall through so the after can put the ending in + } + } + + if ($state eq 'description') { + if ($line =~ /\= AUTHOR/) { + push @after, format_description (@description); + @description = (); + push @after, " *\n"; + $state = 'author'; + next LOOP; + } + elsif ($line =~ /===================/) { + push @after, format_description (@description); + @description = (); + push @after, " *\n"; + $state = 'after'; + ### Fall through + } + push @description, $line; + } + if ($state eq 'author') { + if ($line =~ /\/\/ (.+)\n/) { + $authors .= $1; + } + elsif ($line =~ /===================/ + || $line =~ /\= DESCRIPTION/) { + ## print the authors + + if ($authors ne "") { + @authors = split /\,/, $authors; + + foreach $author (@authors) { + if ($author =~ /^ (.*)/) { + $author = $1; + } + push @after, " * \@author $author\n"; + } + } + + if ($line =~ /\= DESCRIPTION/) { + push @after, " *\n"; + $state = 'description'; + next LOOP; + } + else { + $state = 'after'; + ## Fall through + } + } + } + + if ($state eq 'after') { + if ($line =~ /===================/) { + ## print the rest + push @after, " */\n"; + push @after, "//========================================". + "=====================================\n"; + push @after, "\n"; + $state = 'done'; + } + + next LOOP; + } + } + + return @after; +} + + +sub fix_class_headers (@) +{ + my (@before) = @_; + my @after = (); + my @store = (); + my $classname = ""; + + my $state = 'outside'; + ## state = + ## outside = not in class + ## template = stored template line + ## class = started collecting lines, in case of a class + ## header = after a class foo, but before any methods + + print "Fixing class headers\n" if (defined $opt_d); + + LOOP: foreach $line (@before) { + printf ("%10s %s", $state, $line) if (defined $opt_D); + + if ($state eq 'outside') { + if ($line =~ /^\s*template/) { + push @store, $line; + $state = 'template'; + next LOOP; + } + elsif ($line =~ /^\s*class/) { + $state = 'class'; + ## Fall through + } + else { + push @after, $line; + } + + } + + if ($state eq 'template') { + if ($line =~ /^\s*class/) { + $state = 'class'; + ## Fall through + } + else { + push @after, @store; + @store = (); + push @after, $line; + $state = 'outside'; + next LOOP; + } + } + + if ($state eq 'class') { + if ($line =~ /^\s*class(.*)\n/) { + push @store, $line; + my @s = split / /, $1; + if ($s[1] =~ /export$/i) { + $classname = $s[2]; + } + else { + $classname = $s[1]; + } + } + elsif ($line =~ /^\s*\{/) { + push @store, $line; + } + elsif ($line =~ /^\s*\/\//) { + $state = 'header'; + ### Fall through + } + else { + push @after, @store; + @store = (); + push @after, $line; + $state = 'outside'; + next LOOP; + } + } + + if ($state eq 'header') { + if ($line =~ /^\s*\/\//) { + push @headers, $line; + } + else { + my $prefix = ''; + + $line =~ /^(\s*)[\w\/]/; ### used to get indent + my $indent = $1; + push @after, "$indent/**\n"; + push @after, "$indent * \@class $classname\n"; + + foreach $header (@headers) { + if ($header =~ /\= TITLE/) { + push @after, "$indent *\n"; + $prefix = "$indent * \@brief"; + } + elsif ($header =~ /\= DESCRIPTION/) { + push @after, "$indent *\n"; + $prefix = "$indent *"; + } + elsif ($header !~ /\/\/\s*\n/) { + my $myline = $header; + $myline =~ s/\s*\/\/\s*/$prefix /; + push @after, $myline; + $prefix = "$indent *"; + + } + } + push @after, "$indent */\n"; + @headers = (); + + push @after, @store; + push @after, $line; + @store = (); + $state = 'outside'; + next LOOP; + } + } + } + + return @after; +} + + +sub format_comment (@) +{ + my (@comments) = @_; + my @after = (); + + my $line; + + if ($#comments < 2) { + foreach $line (@comments) { + $line =~ s/\/\//\/\/\//; + push @after, $line; + } + } + else { + my $line = $comments[0]; + $line =~ /^(\s*)\//; + my $indent = $1; + + push @after, "$indent/**\n"; + foreach $line (@comments) { + $line =~ s/\/\// */; + push @after, $line; + } + push @after, "$indent */\n"; + } + + return @after; +} + +sub fix_class_members (@) +{ + my (@before) = @_; + my @after = (); + my @method = (); + my @comment = (); + + my $classfound = 0; + my $classlevel = 0; + my $level = 0; + + print "Fixing class methods\n" if (defined $opt_d); + + LOOP: foreach $line (@before) { + if ($line =~ /\{/ && $line !~ /^\s*\/\//) { + $level++; + } + + if ($line =~ /^\s*class/ + && $line !~ /\;/ + && $level == $classlevel) + { + $classlevel++; + } + + if ($line =~ /\}/ && $line !~ /^\s*\/\//) { + if ($classlevel == $level) { + $classlevel--; + } + $level--; + } + + printf ("%2d%2d", $level, $classlevel) if (defined $opt_D); + + if ($level == $classlevel && $level > 0) { + if ($line =~ /^\s*public/ + || $line =~ /^\s*private/ + || $line =~ /\s*protected/ + || $line =~ /^\s*\n$/ + || $line =~ /^\s*\{/ + || $line =~ /^\s*\}/ + || $line =~ /^\s*\#/) + { + push @after, format_comment (@comment); + push @after, @method; + @comment = (); + @method = (); + + print " $line" if (defined $opt_D); + push @after, $line; + } + elsif ($line =~ /^\s*\/\//) { + print "C $line" if (defined $opt_D); + + if ($#method >= 0) { + push @comment, $line; + } + else { + push @after, $line; + } + } + else { + print "M $line" if (defined $opt_D); + push @method, $line; + } + + } + else { + push @after, format_comment (@comment); + push @after, @method; + @comment = (); + @method = (); + + print " $line" if (defined $opt_D); + push @after, $line; + } + } + + if ($level > 0 || $classlevel > 0) { + $fail = 1; + $failmessage = "Brace level recognition failed" + } + + return @after; +} + +############################################################################## +# Read in the files. + +FILELOOP: foreach $file (@files) { + print "\n" if (defined $opt_d); + print "$file\n"; + print "\n" if (defined $opt_d); + + $fail = 0; + + my @contents = (); + + ### Read file into @contents + print "Reading\n" if (defined $opt_d); + + unless (open (FILE, "<$file")) { + print STDERR "$file: $!\n"; + next FILELOOP; + } + + @contents = <FILE>; + + close (FILE); + + ### Verify file + print "Verifying file\n" if (defined $opt_d); + + if (!defined $opt_u) { + if (verify (@contents) == 1) { + print "$file did not pass verification\n"; + next FILELOOP; + } + elsif (defined $opt_d) { + print "Passed verification\n"; + } + } + + ### Fix up parts of it + print "Fixing file\n" if (defined $opt_d); + + @contents = fix_file_header (@contents); + @contents = fix_class_headers (@contents); + @contents = fix_class_members (@contents); + + if ($fail != 0) { + print "$file: $failmessage\n"; + } + else { + if (defined $opt_s) { + print @contents; + } + elsif (!defined $opt_D) { + ### Save @contents back to the file + print "Saving\n" if (defined $opt_d); + + unless (open (FILE, ">$file")) { + print STDERR "$file: $!\n"; + next FILELOOP; + } + + foreach $line (@contents) { + print FILE $line; + } + + close (FILE); + } + } +} + diff --git a/ACE/bin/envinfo.cpp b/ACE/bin/envinfo.cpp new file mode 100644 index 00000000000..7a727d08818 --- /dev/null +++ b/ACE/bin/envinfo.cpp @@ -0,0 +1,40 @@ +// $Id$ + +#include "ace/ACE.h" +#include "ace/Log_Msg.h" +#include "ace/OS_main.h" +#include "ace/OS_NS_sys_utsname.h" + +ACE_RCSID(bin, envinfo, "$Id$") + +int +ACE_TMAIN (int, ACE_TCHAR *[]) +{ + ACE_DEBUG ((LM_INFO, ACE_TEXT ("ACE: %u.%u.%u\n"), + ACE::major_version(), + ACE::minor_version(), + ACE::beta_version())); + + ACE_utsname uname; + ACE_OS::uname(&uname); +#if defined (ACE_LACKS_UTSNAME_T) + ACE_DEBUG ((LM_INFO, + ACE_TEXT ("OS: %s %s\n"), + uname.sysname, + uname.release)); +#else + ACE_DEBUG ((LM_INFO, + ACE_TEXT ("OS: %C %C\n"), + uname.sysname, + uname.release)); +#endif + + ACE_DEBUG ((LM_INFO, ACE_TEXT ("Compiler: %s %u.%u\n"), + ACE::compiler_name(), + ACE::compiler_major_version(), + ACE::compiler_minor_version(), + ACE::compiler_beta_version())); + + return 0; +} + diff --git a/ACE/bin/footprint_stats.sh b/ACE/bin/footprint_stats.sh new file mode 100755 index 00000000000..4792da5afc0 --- /dev/null +++ b/ACE/bin/footprint_stats.sh @@ -0,0 +1,76 @@ +#!/bin/sh +# +# $Id$ +# + + +if [ $# -lt 2 ]; then + echo "Usage: $0 [ACE_ROOT] [DEST]" + exit 0 +fi + +ACE_ROOT=$1 +DEST=$2 +DATE=`date +%Y/%m/%d-%H:%M` + +BINS="TAO/tests/ORB_init/ORB_init TAO/tests/ORB_destroy/ORB_destroy" + +LIBS="ace/libACE.a \ + TAO/tao/libTAO.a \ + TAO/tao/libTAO_PortableServer.a \ + TAO/tao/libTAO_Strategies.a \ + TAO/tao/libTAO_SmartProxies.a \ + TAO/tao/libTAO_DynamicAny.a \ + TAO/tao/libTAO_DynamicInterface.a \ + TAO/tao/libTAO_IFR_Client.a \ + TAO/tao/libTAO_BiDirGIOP.a \ + TAO/tao/libTAO_Domain.a \ + TAO/tao/libTAO_IORManip.a \ + TAO/tao/libTAO_IORTable.a \ + TAO/tao/libTAO_TypeCodeFactory.a \ + TAO/tao/libTAO_RTCORBA.a \ + TAO/tao/libTAO_IORInterceptor.a \ + TAO/tao/libTAO_Messaging.a \ + TAO/tao/libTAO_ObjRefTemplate.a \ + TAO/tao/libTAO_Valuetype.a \ + TAO/tao/libTAO_RTScheduler.a \ + TAO/tao/libTAO_AnyTypeCode.a \ + TAO/tao/libTAO_PI.a \ + TAO/tao/libTAO_PI_Server.a \ + TAO/tao/libTAO_Codeset.a \ + TAO/tao/libTAO_CodecFactory.a \ + TAO/tao/libTAO_RTPortableServer.a" + +cd $ACE_ROOT + +for i in $BINS; do + b=`basename $i` + if [ -x $i ]; then + ( + echo -n $DATE " "; + size $i | + grep -v text | + awk '{print $4}' + ) >> $DEST/source/${b}_size.txt + fi +done + +for i in $LIBS; do + b=`basename $i`; + if [ -f $i ]; then + ( + echo -n $DATE " "; + size $i | + awk '{s += $4} END {print s}' + ) >> $DEST/source/${b}_size.txt + fi +done + +cd $DEST/source + +for i in $LIBS $BINS; do + b=`basename $i` + /usr/bin/tac ${b}_size.txt > $DEST/data/${b}_size.txt + /usr/bin/tail -5 ${b}_size.txt > $DEST/data/LAST_${b}_size.txt + $ACE_ROOT/bin/generate_footprint_chart.sh ${b}_size.txt $DEST/images/${b}_size.png $b +done diff --git a/ACE/bin/fuzz.pl b/ACE/bin/fuzz.pl new file mode 100755 index 00000000000..297ef6244c1 --- /dev/null +++ b/ACE/bin/fuzz.pl @@ -0,0 +1,1860 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# Fuzz is a script whose purpose is to check through ACE/TAO/CIAO files for +# easy to spot (by a perl script, at least) problems. + +use Cwd; +use File::Find; +use File::Basename; +use Getopt::Std; + +###### TODO +# +# Add tests for these: +# +# - not setting up the release configs correctly in dsp files +# - Guards in .h files +# - no global functions +# - other commit_check checks, tabs, trailing spaces. +# +# And others in ACE_Guidelines and Design Rules +# +# Also add a -g flag to ignore tao_idl generated files +# +###### END TODO + +# Lists of all the files +@files_cpp = (); +@files_inl = (); +@files_h = (); +@files_html = (); +@files_dsp = (); +@files_dsw = (); +@files_gnu = (); +@files_idl = (); +@files_pl = (); +@files_changelog = (); +@files_makefile = (); +@files_mpc = (); +@files_bor = (); +@files_noncvs = (); + +# To keep track of errors and warnings +$errors = 0; +$warnings = 0; + +############################################################################## + +# Find_Modified_Files will use 'cvs -nq' to get a list of locally modified +# files to look through +sub find_mod_files () +{ + unless (open (CVS, "cvs -nq up |")) { + print STDERR "Error: Could not run cvs\n"; + exit (1); + } + + while (<CVS>) { + if (/^[M|A] (.*)/) { + store_file ($1); + } + } + close (CVS); +} + + + +# Find_Files will search for files with certain extensions in the +# directory tree +sub find_files () +{ + # wanted is only used for the File::Find + sub wanted + { + store_file ($File::Find::name); + } + + find (\&wanted, '.'); +} + +# +sub store_file ($) +{ + my $name = shift; + if ($name =~ /\.(c|cc|cpp|cxx)$/i) { + push @files_cpp, ($name); + } + elsif ($name =~ /\.(inl|i)$/i) { + push @files_inl, ($name); + } + elsif ($name =~ /\.(h|hh|hpp|hxx)$/i) { + push @files_h, ($name); + } + elsif ($name =~ /\.(htm|html)$/i) { + push @files_html, ($name); + } + elsif ($name =~ /\.(bor)$/i) { + push @files_bor, ($name); + } + elsif ($name =~ /\.(GNU)$/i) { + push @files_gnu, ($name); + } + elsif ($name =~ /\.(dsp|vcp)$/i) { + push @files_dsp, ($name); + } + elsif ($name =~ /\.(dsw|vcp)$/i) { + push @files_dsw, ($name); + } + elsif ($name =~ /\.(pidl|idl)$/i) { + push @files_idl, ($name); + } + elsif ($name =~ /\.pl$/i) { + push @files_pl, ($name); + } + elsif ($name =~ /ChangeLog/i && -f $name) { + push @files_changelog, ($name); + } + elsif ($name =~ /\/GNUmakefile.*.[^~]$/) { + push @files_makefile, ($name); + } + elsif ($name =~ /\.(mpc|mwc|mpb|mpt)$/i) { + push @files_mpc, ($name); + } + elsif ($name =~ /\.(icc|ncb|opt|zip)$/i) { + push @files_noncvs, ($name); + } +} + +############################################################################## +## Just messages + +sub print_error ($) +{ + my $msg = shift; + print "Error: $msg\n"; + ++$errors; +} + + +sub print_warning ($) +{ + my $msg = shift; + print "Warning: $msg\n"; + ++$warnings; +} + + +############################################################################## +## Tests + +# The point of this test is to check for the existence of ACE_INLINE +# or ASYS_INLINE in a .cpp file. This is most commonly caused by +# copy/pasted code from a .inl/.i file +sub check_for_inline_in_cpp () +{ + print "Running ACE_INLINE/ASYS_INLINE check\n"; + foreach $file (@files_cpp) { + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/^ACE_INLINE/) { + print_error ("$file:$.: ACE_INLINE found"); + } + if (/^ASYS_INLINE/) { + print_error ("$file:$.: ASYS_INLINE found"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks to make sure files have the $Id string in them. +# Commit_check should find these when checking in files, but this can +# be used locally or to check for files +sub check_for_id_string () +{ + print "Running \$Id\$ string check\n"; + foreach $file (@files_cpp, @files_inl, @files_h, @files_mpc, @files_bor, @files_gnu, + @files_html, @files_idl, @files_pl, @makefile_files) { + my $found = 0; + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/\$Id\:/ or /\$Id\$/) { + $found = 1; + } + if (/\$id\$/) { + print_error ("$file:$.: Incorrect \$id\$ found (correct casing)"); + } + } + close (FILE); + if ($found == 0) { + print_error ("$file:1: No \$Id\$ string found."); + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# check for _MSC_VER +sub check_for_msc_ver_string () +{ + print "Running _MSC_VER check\n"; + foreach $file (@files_cpp, @files_inl, @files_h) { + my $found = 0; + if (open (FILE, $file)) { + my $disable = 0; + my $mscline = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/FUZZ\: disable check_for_msc_ver/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_msc_ver/) { + $disable = 0; + } + if ($disable == 0 and /\_MSC_VER \<= 1200/) { + $found = 1; + $mscline = $.; + } + if ($disable == 0 and /\_MSC_VER \>= 1200/) { + $found = 1; + $mscline = $.; + } + if ($disable == 0 and /\_MSC_VER \> 1200/) { + $found = 1; + $mscline = $.; + } + if ($disable == 0 and /\_MSC_VER \< 1300/) { + $found = 1; + $mscline = $.; + } + if ($disable == 0 and /\_MSC_VER \<= 1300/) { + $found = 1; + $mscline = $.; + } + } + close (FILE); + if ($found == 1) { + print_error ("$file:$mscline: Incorrect _MSC_VER check found"); + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the newline at the end of a file +sub check_for_newline () +{ + print "Running newline check\n"; + foreach $file (@files_cpp, @files_inl, @files_h, + @files_html, @files_idl, @files_pl) { + if (open (FILE, $file)) { + my $line; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + $line = $_ + } + close (FILE); + if ($line !~ /\n$/) { + print_error ("$file:$.: No ending newline found in $file"); + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + + +# This test checks for files that are not allowed to be in svn +sub check_for_noncvs_files () +{ + print "Running non svn files check\n"; + foreach $file (@files_noncvs, @files_dsp, @files_dsw, @files_makefile) { + print_error ("File $file should not be in svn!"); + } +} + +# This test checks for the use of ACE_SYNCH_MUTEX in TAO/CIAO, +# TAO_SYNCH_MUTEX should used instead. + +sub check_for_ACE_SYNCH_MUTEX () +{ + print "Running ACE_SYNCH_MUTEX check\n"; + ITERATION: foreach $file (@files_cpp, @files_inl, @files_h) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_ACE_SYNCH_MUTEX/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_ACE_SYNCH_MUTEX/) { + $disable = 0; + next ITERATION; + } + if ($disable == 0 and /ACE_SYNCH_MUTEX/) { + # It is okay to use ACE_SYNCH_MUTEX in ACE + # so don't check the ACE directory. The below + # will check it for TAO and CIAO. + if (($file !~ /.*TAO.*/)) { + next ITERATION; + } + + # Disable the check in the ESF directory for the + # time being until we fix the issues there. + if(($file =~ /.*TAO\/orbsvcs\/orbsvcs\/ESF.*/)) { + next ITERATION; + } + + print_error ("$file:$.: found ACE_SYNCH_MUTEX, use TAO_SYNCH_MUTEX instead"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the use of ACE_Thread_Mutex in TAO/CIAO, +# TAO_SYNCH_MUTEX should used instead to make the code build +# in single-threaded builds. + +sub check_for_ACE_Thread_Mutex () +{ + print "Running ACE_Thread_Mutex check\n"; + ITERATION: foreach $file (@files_cpp, @files_inl, @files_h) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_ACE_Thread_Mutex/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_ACE_Thread_Mutex/) { + $disable = 0; + next ITERATION; + } + if ($disable == 0 and /ACE_Thread_Mutex/) { + # It is okay to use ACE_Thread_Mutex in ACE + # so don't check the ACE directory. The below + # will check it for TAO and CIAO. + if (($file !~ /.*TAO.*/)) { + next ITERATION; + } + + print_error ("$file:$.: found ACE_Thread_Mutex, use TAO_SYNCH_MUTEX instead to allow the code to work in single-threaded builds"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the use of tabs, spaces should be used instead of tabs +sub check_for_tab () +{ + print "Running tabs check\n"; + ITERATION: foreach $file (@files_cpp, @files_inl, @files_h, @files_idl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_tab/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_tab/) { + $disable = 0; + } + if ($disable == 0 and /\t/) { + # The following directories are infested + # with tabs. When don't check these + # directories for now to enable detection + # of new tabs introduced in the core + # of ACE/TAO/CIAO + if (($file =~ /(ACE)*.*examples/i) || + ($file =~ /(ACE)*.*apps/i) || + ($file =~ /(TAO)*.*tests/i) || + ($file =~ /(TAO)*.*orbsvcs/i) || + ($file =~ /(TAO)*.*tools/i) || + ($file =~ /(TAO)*.*performance-tests/i) || + ($file =~ /(TAO)*.*examples/i)) { + next ITERATION; + } + + # for now, we don't want to indicate + # each occurance of tab in a file, + # we just want to indicate once that + # tabs exist in a file. + # print_error ("$file:$.: tab found"); + #print_error ("$file: tab found"); + #next ITERATION; + + print_error ("$file:$.: found tab"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the lack of ACE_OS +sub check_for_lack_ACE_OS () +{ + $OS_NS_arpa_inet_symbols = "inet_addr|inet_aton|inet_ntoa|inet_ntop|inet_pton"; + + $OS_NS_ctype_symbols = "isalnum|isalpha|iscntrl|isdigit|isgraph|islower|isprint|ispunct|isspace|isupper|isxdigit|tolower|toupper"; + + $OS_NS_dirent_symbols = "closedir|opendir|readdir|readdir_r|rewinddir|scandir|alphasort|seekdir|telldir|opendir_emulation|scandir_emulation|closedir_emulation|readdir_emulation"; + + $OS_NS_dlfcn_symbols = "dlclose|dlerror|dlopen|dlsym"; + + $OS_NS_errno_symbols = "last_error|set_errno_to_last_error|set_errno_to_wsa_last_error"; + + $OS_NS_fcntl_symbols = "fcntl|open"; + + $OS_NS_math_symbols = "floor|ceil|log2"; + + $OS_NS_netdb_symbols = "gethostbyaddr|gethostbyaddr_r|gethostbyname|gethostbyname_r|getipnodebyaddr|getipnodebyname|getmacaddress|getprotobyname|getprotobyname_r|getprotobynumber|getprotobynumber_r|getservbyname|getservbyname_r|netdb_acquire|netdb_release"; + + $OS_NS_poll_symbols = "poll"; + + $OS_NS_pwd_symbols = "endpwent|getpwent|getpwnam|getpwnam_r|setpwent"; + + $OS_NS_regex_symbols = "compile|step"; + + $OS_NS_signal_symbols = "kill|pthread_sigmask|sigaction|sigaddset|sigdelset|sigemptyset|sigfillset|sigismember|signal|sigprocmask|sigsuspend"; + + $OS_NS_stdio_symbols = "checkUnicodeFormat|clearerr|cuserid|fclose|fdopen|fflush|fgetc|getc|fgetpos|fgets|flock_adjust_params|flock_init|flock_destroy|flock_rdlock|flock_tryrdlock|flock_trywrlock|flock_unlock|flock_wrlock|fopen|default_win32_security_attributes|default_win32_security_attributes_r|get_win32_versioninfo|get_win32_resource_module|set_win32_resource_module|fprintf|ungetc|fputc|putc|fputs|fread|freopen|fseek|fsetpos|ftell|fwrite|perror|printf|puts|rename|rewind|snprintf|sprintf|tempnam|vsprintf|vsnprintf|asprintf|aswprintf|vasprintf|vaswprintf"; + + $OS_NS_stdlib_symbols = "_exit|abort|atexit|atoi|atop|bsearch|calloc|exit|free|getenv|getenvstrings|itoa|itoa_emulation|itow_emulation|malloc|mkstemp|mkstemp_emulation|mktemp|putenv|qsort|rand|rand_r|realloc|realpath|set_exit_hook|srand|strenvdup|strtod|strtol|strtol_emulation|strtoul|strtoul_emulation|system|getprogname|setprogname"; + + $OS_NS_string_symbols = "memchr|memchr_emulation|memcmp|memcpy|fast_memcpy|memmove|memset|strcat|strchr|strcmp|strcpy|strcspn|strdup|strdup_emulation|strecpy|strerror|strerror_emulation|strlen|strncat|strnchr|strncmp|strncpy|strnlen|strnstr|strpbrk|strrchr|strrchr_emulation|strsncpy|strspn|strstr|strtok|strtok_r|strtok_r_emulation"; + + $OS_NS_strings_symbols = "strcasecmp|strncasecmp|strcasecmp_emulation"; + + $OS_NS_stropts_symbols = "getmsg|getpmsg|fattach|fdetach|ioctl|isastream|putmsg|putpmsg"; + + $OS_NS_sys_mman_symbols = "madvise|mmap|mprotect|msync|munmap|shm_open|shm_unlink"; + + $OS_NS_sys_msg_symbols = "msgctl|msgget|msgrcv|msgsnd"; + + $OS_NS_sys_resource_symbols = "getrlimit|getrusage|setrlimit"; + + $OS_NS_sys_select_symbols = "select"; + + $OS_NS_sys_sendfile_symbols = "sendfile|sendfile_emulation"; + + $OS_NS_sys_shm_symbols = "shmat|shmctl|shmdt|shmget"; + + $OS_NS_sys_socket_symbols = "accept|bind|closesocket|connect|enum_protocols|getpeername|getsockname|getsockopt|join_leaf|listen|recv|recvfrom|recvmsg|recvv|send|sendmsg|sendto|sendv|setsockopt|shutdown|if_nametoindex|if_indextoname|if_nameindex|socket_init|socket_fini|socket|socketpair"; + + $OS_NS_sys_stat_symbols = "creat|filesize|fstat|lstat|mkdir|mkfifo|stat|umask"; + + $OS_NS_sys_time_symbols = "gettimeofday"; + + $OS_NS_sys_uio_symbols = "readv|readv_emulation|writev|writev_emulation"; + + $OS_NS_sys_utsname_symbols = "uname"; + + $OS_NS_sys_wait_symbols = "wait|waitpid"; + + $OS_NS_Thread_symbols = "cleanup_tss|condattr_init|condattr_destroy|cond_broadcast|cond_destroy|cond_init|cond_signal|cond_timedwait|cond_wait|event_destroy|event_init|event_pulse|event_reset|event_signal|event_timedwait|event_wait|lwp_getparams|lwp_setparams|mutex_destroy|mutex_init|mutex_lock|mutex_lock_cleanup|mutex_trylock|mutex_unlock|priority_control|recursive_mutex_cond_unlock|recursive_mutex_cond_relock|recursive_mutex_destroy|recursive_mutex_init|recursive_mutex_lock|recursive_mutex_trylock|recursive_mutex_unlock|rw_rdlock|rw_tryrdlock|rw_trywrlock|rw_trywrlock_upgrade|rw_unlock|rw_wrlock|rwlock_destroy|rwlock_init|sched_params|scheduling_class|sema_destroy|sema_init|sema_post|sema_trywait|sema_wait|semctl|semget|semop|set_scheduling_params|sigtimedwait|sigwait|sigwaitinfo|thr_cancel|thr_cmp|thr_continue|thr_create|thr_equal|thr_exit|thr_getconcurrency|thr_getprio|thr_getspecific_native|thr_getspecific|thr_join|thr_get_affinity|thr_set_affinity|thr_key_detach|thr_key_used|thr_keycreate_native|thr_keycreate|thr_keyfree|thr_kill|thr_min_stack|thr_self|thr_setcancelstate|thr_setcanceltype|thr_setconcurrency|thr_setprio|thr_setspecific_native|thr_setspecific|thr_sigsetmask|thr_suspend|thr_testcancel|thr_yield|thread_mutex_destroy|thread_mutex_init|thread_mutex_lock|thread_mutex_trylock|thread_mutex_unlock|unique_name"; + + $OS_NS_time_symbols = "asctime|asctime_r|clock_gettime|clock_settime|ctime|ctime_r|difftime|gmtime|gmtime_r|localtime|localtime_r|mktime|nanosleep|readPPCTimeBase|strftime|strptime|strptime_emulation|strptime_getnum|time|timezone|tzset"; + + $OS_NS_unistd_symbols = "access|alarm|allocation_granularity|argv_to_string|chdir|rmdir|close|dup|dup2|execl|execle|execlp|execv|execve|execvp|fork|fork_exec|fsync|ftruncate|getcwd|getgid|getegid|getopt|getpagesize|getpgid|getpid|getppid|getuid|geteuid|hostname|isatty|lseek|llseek|num_processors|num_processors_online|pipe|pread|pwrite|read|read_n|readlink|sbrk|setgid|setegid|setpgid|setregid|setreuid|setsid|setuid|seteuid|sleep|string_to_argv|swab|sysconf|sysinfo|truncate|ualarm|unlink|write|write_n"; + + $OS_NS_wchar_symbols = "fgetwc|wcscat_emulation|wcschr_emulation|wcscmp_emulation|wcscpy_emulation|wcscspn_emulation|wcsicmp_emulation|wcslen_emulation|wcsncat_emulation|wcsncmp_emulation|wcsncpy_emulation|wcsnicmp_emulation|wcspbrk_emulation|wcsrchr_emulation|wcsrchr_emulation|wcsspn_emulation|wcsstr_emulation|wslen|wscpy|wscmp|wsncmp|ungetwc"; + + print "Running ACE_OS check\n"; + foreach $file (@files_cpp, @files_inl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_lack_ACE_OS/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_lack_ACE_OS/) { + $disable = 0; + } + if ($disable == 0) { + if($file !~ /.c$/ && $file !~ /S.cpp$/ && $file !~ /S.inl$/ && $file !~ /C.cpp$/ && $file !~ /C.inl$/) { + if($file !~ /OS_NS_arpa_inet/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_arpa_inet_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_ctype/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_ctype_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_dirent/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_dirent_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_dlfcn/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_dlfcn_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_errno/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_errno_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_fcntl/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_fcntl_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_math/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_math_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_netdb/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_netdb_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_poll/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_netdb_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_pwd/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_pwd_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_regex/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_regex_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_signal/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_signal_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_stdlib/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_stdlib_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_stdio/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_stdio_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_string/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_string_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_strings/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_strings_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_stropts/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_stropts_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_mman/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_mman_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_msg/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_msg_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_resource/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_resource_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_select/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_select_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_sendfile/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_sendfile_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_shm/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_shm_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_socket/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_socket_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_stat/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_stat_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_time/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_time_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_uio/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_uio_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_utsname/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_utsname_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_sys_wait/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_sys_wait_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_Thread/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_Thread_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_time/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_time_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_unistd/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_unistd_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + if($file !~ /OS_NS_wchar/) { + if(/(\s+:{0,2}|\(:{0,2}|\s*!:{0,2}|^|\):{0,2})($OS_NS_wchar_symbols)\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: missing ACE_OS"); + } + } + } + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the use of exception specification, +# exception specification has fallen out of favor, and generally +# should not be used. +sub check_for_exception_spec () +{ + print "Running exception specification check\n"; + + foreach $file (@files_cpp, @files_inl, @files_h) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_exception_sepc/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_exception_sepc/) { + $disable = 0; + } + if ($disable == 0) { + if(/throw\s*\(\s*\)/) { + #next; + } + elsif(/(^|\s+)throw\s*\(/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: exception specification found"); + } + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the use of NULL, +# NULL shouldn't be used, use 0 instead +sub check_for_NULL () +{ + print "Running NULL usage check\n"; + + foreach $file (@files_cpp, @files_inl, @files_h) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_NULL/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_NULL/) { + $disable = 0; + } + if ($disable == 0) { + if(/(\(|\)|\s+|=)NULL(\)|\s+|\;|\,)/ and $` !~ /\/\// and $` !~ /\/\*/ and $` !~ /\*\*+/ and $` !~ /\s+\*+\s+/) { + print_error ("$file:$.: NULL found"); + } + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for improper main declaration, +# the proper form should look like: +# int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) +sub check_for_improper_main_declaration () +{ + print "Running Improper main declration check\n"; + + foreach $file (@files_cpp) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_improper_main_declaration/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_improper_main_declaration/) { + $disable = 0; + } + if ($disable == 0) { + if(/^\s*main\s*\(.*\)/) { + print_error ("$file:$.: Use proper form of main declaration (use ACE_TMAIN)"); + } + if(/^\s*ACE_TMAIN\s*\(.*,\s*char.*\)/) { + print_error ("$file:$.: Use proper form of main declaration (use ACE_TCHAR)"); + } + if(/^\s*ACE_TMAIN\s*\(.*,\s*ACE_TCHAR\s*\*\*\)/) { + print_error ("$file:$.: Use proper form of main declaration (second argument should be ACE_TCHAR *argv[])"); + } + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the use of "inline" instead of ACE_INLINE +sub check_for_inline () +{ + print "Running inline check\n"; + foreach $file (@files_inl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + ++$line; + if (/FUZZ\: disable check_for_inline/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_inline/) { + $disable = 0; + } + if ($disable == 0 and m/^\s*inline/) { + print_error ("$file:$.: 'inline' keyword found"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + + +# This test checks for the inclusion of math.h. math.h should be avoided +# since on some platforms, "exceptions" is defined as a struct, which will +# cause problems with exception handling +sub check_for_math_include () +{ + print "Running math.h test\n"; + foreach $file (@files_h, @files_cpp, @files_inl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/FUZZ\: disable check_for_math_include/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_math_include/) { + $disable = 0; + } + if ($disable == 0 + and /^\s*#\s*include\s*(\/\*\*\/){0,1}\s*\<math\.h\>/) { + print_error ("$file:$.: <math.h> included"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the inclusion of streams.h. +# // FUZZ: disable check_for_streams_include +sub check_for_streams_include () +{ + print "Running ace/streams.h test\n"; + foreach $file (@files_h, @files_cpp, @files_inl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/FUZZ\: disable check_for_streams_include/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_streams_include/) { + $disable = 0; + } + if ($disable == 0 + and /^\s*#\s*include\s*\"ace\/streams\.h\"/) { + print_error ("$file:$.: expensive ace/streams.h included; consider ace/iosfwd.h"); + print " ace/streams.h is very expensive in both "; + print "compile-time and footprint. \n"; + print " Please consider including ace/iosfwd.h instead.\n\n"; + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the inclusion of OS.h. +sub check_for_OS_h_include () +{ + print "Running ace/OS.h test\n"; + foreach $file (@files_h, @files_cpp, @files_inl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/FUZZ\: disable check_for_OS_h_include/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_OS_h_include/) { + $disable = 0; + } + if ($disable == 0 + and /^\s*#\s*include\s*\"ace\/OS\.h\"/) { + print_error ("$file:$.: expensive ace/OS.h included; consider an OS_NS_*.h file"); + print " OS.h is very expensive in both "; + print "compile-time and footprint. \n"; + print " Please consider including one of the "; + print "OS_NS_*.h files instead.\n\n"; + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the inclusion of Synch*.h. +sub check_for_synch_include () +{ + print "Running ace/Synch*.h test\n"; + foreach $file (@files_h, @files_cpp, @files_inl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/FUZZ\: disable check_for_synch_include/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_synch_include/) { + $disable = 0; + } + if ($disable == 0 + and (/^\s*#\s*include\s*\"(ace\/Synch\.h)\"/ + or /^\s*#\s*include\s*\"(ace\/Synch_T\.h)\"/)) { + my $synch = $1; + print_error ("$file:$.: expensive $synch included; consider individual synch file"); + print " $synch is very expensive in both "; + print "compile-time and footprint. \n"; + print " Please consider including one of the "; + print "individual synch files instead.\n\n"; + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# For general readability, lines should not contain more than 80 characters +sub check_for_line_length () +{ + print "Running line length test\n"; + foreach $file (@files_h, @files_cpp, @files_inl) { + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + + # Make sure to ignore ACE_RCSID lines, since they + # are difficult to get under 80 chars. + if (/.{80,}/ and !/^ACE_RCSID/) { + print_error ("$file:$.: line longer than 80 chars"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + + +# For preprocessor directives, only the old C style comments (/* */) +# should be used, not the newer // style. +sub check_for_preprocessor_comments () +{ + print "Running preprocessor comment test\n"; + foreach $file (@files_h, @files_cpp, @files_inl) { + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/^\#.*\/\//) { + print_error ("$file:$.: C++ comment in directive"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# We should not have empty files in the repo +sub check_for_empty_files () +{ + print "Running empty file test\n"; + foreach $file (@files_inl, @files_cpp) { + my $found_non_empty_line = 0; + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + next if /^[:blank:]*$/; # skip empty lines + next if /^[:blank:]*\/\//; # skip C++ comments + next if /^[:blank:]*\/\*/; # skip C++ comments + $found_non_empty_line = 1; + last; + } + close (FILE); + if ($found_non_empty_line == 0) { + print_error ("$file:1: empty file should not be in the repository"); + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + + +# This test checks for the use of the Win32 Unicode string defines +# or outdated ASYS_* macros +# We should only be using the ACE_TCHAR, ACE_TEXT macros instead. +sub check_for_tchar +{ + print "Running TCHAR test\n"; + foreach $file (@files_h, @files_cpp, @files_inl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/FUZZ\: disable check_for_tchar/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_tchar/) { + $disable = 0; + } + if ($disable == 0) { + if (/LPTSTR/) { + print_error ("$file:$.: LPTSTR found"); + } + + if (/LPCTSTR/) { + print_error ("$file:$.: LPCTSTR found"); + } + + if (/ASYS_TCHAR/) { + print_error ("$file:$.: ASYS_TCHAR found"); + } + elsif (/TCHAR/ and !/ACE_TCHAR/) { + ### Do a double check, since some macros do have TCHAR + ### (like DEFAULTCHARS) + if (/^TCHAR[^\w_]/ or /[^\w_]TCHAR[^\w_]/) { + print_error ("$file:$.: TCHAR found"); + } + } + + if (/ASYS_TEXT/) { + print_error ("$file:$.: ASYS_TEXT found"); + } + elsif (/TEXT/ and !/ACE_TEXT/) { + ### Do a double check, since there are several macros + ### that end with TEXT + if (/^TEXT\s*\(/ or /[^\w_]TEXT\s*\(/) { + print_error ("$file:$.: TEXT found"); + } + } + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This checks to see if Makefiles define a DEPENDENCY_FILE, and if they do +# whether or not it's in the cvs repo. +sub check_for_dependency_file () +{ + print "Running DEPENDENCY_FILE test\n"; + foreach $file (@files_makefile) { + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/^DEPENDENCY_FILE\s* =\s*(.*)/) { + my $depend = $1; + my $path = $file; + $path =~ s/\/GNUmakefile.*/\//; + $depend = $path . $depend; + unless (open (DFILE, $depend)) { + print_error ("DEPENDENCY_FILE \"$depend\" not found"); + print " Either add \"$depend\" to svn "; + print "or remove DEPENDENCY_FILE variable\n"; + print " from $file\n\n"; + } + close (DFILE); + } + } + close (FILE); + } + else { + print_error ("cannot open $file"); + } + } +} + +# This checks to see if GNUmakefiles define a MAKEFILE, and if it matches the +# name of the GNUmakefile +sub check_for_makefile_variable () +{ + print "Running MAKEFILE variable test\n"; + foreach $file (@files_makefile) { + if (!(substr($file,-4) eq ".bor") + and !(substr($file,-3) eq ".am") + and !(substr($file,-4) eq ".vac") + and !(substr($file,-4) eq ".alt")) { + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + my $makevarfound = 0; + my $filename = basename($file,""); + while (<FILE>) { + if (/^MAKEFILE\s*=\s*(.*)/) { + $makevarfound = 1; + $makevar = $1; + if (!($makevar eq $filename)) { + print_error ("$file:$.: MAKEFILE variable $makevar != $filename"); + print " Change MAKEFILE = $filename in $file.\n\n"; + } + } + } + if ($makevarfound == 0 and !($filename eq "GNUmakefile")) { + print_error ("$file:$.: MAKEFILE variable missing in $file"); + print " Add MAKEFILE = $filename to the top of $file.\n\n"; + } + close (FILE); + } + else { + print_error ("cannot open $file"); + } + } + } +} + + +# This checks to make sure files include ace/post.h if ace/pre.h is included +# and vice versa. +sub check_for_pre_and_post () +{ + print "Running pre.h/post.h test\n"; + foreach $file (@files_h) { + my $pre = 0; + my $post = 0; + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/FUZZ\: disable check_for_pre_and_post/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_pre_and_post/) { + $disable = 0; + } + if ($disable == 0) { + if (/^\s*#\s*include\s*\"ace\/pre\.h\"/) { + print_error ("$file:$.: pre.h missing \"/**/\""); + ++$pre; + } + if (/^\s*#\s*include\s*\s*\"ace\/post\.h\"/) { + print_error ("$file:$.: post.h missing \"/**/\""); + ++$post; + } + if (/^\s*#\s*include\s*\/\*\*\/\s*\"ace\/pre\.h\"/) { + ++$pre; + } + if (/^\s*#\s*include\s*\/\*\*\/\s*\"ace\/post\.h\"/) { + ++$post; + } + } + } + close (FILE); + + if ($disable == 0 && $pre != $post) { + print_error ("$file:1: pre.h/post.h mismatch"); + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test verifies that the same number of "#pragma warning(push)" and +# "#pragma warning(pop)" pragmas are used in a given header. +sub check_for_push_and_pop () +{ + print "Running #pragma (push)/(pop) test\n"; + foreach $file (@files_h) { + my $push_count = 0; + my $pop_count = 0; + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/FUZZ\: disable check_for_push_and_pop/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_push_and_pop/) { + $disable = 0; + } + if ($disable == 0) { + if (/^\s*#\s*pragma\s*warning\s*\(\s*push[,1-4]*\s*\)/) { + ++$push_count; + } + if (/^\s*#\s*pragma\s*warning\s*\(\s*pop\s*\)/) { + ++$pop_count; + } + } + } + close (FILE); + + if ($disable == 0 && $push_count != $pop_count) { + print_error ("$file: #pragma warning(push)/(pop) mismatch"); + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test verifies that the same number of +# "ACE_VERSIONED_NAMESPACE_BEGIN_DECL" and +# "ACE_END_VERSIONED_NAMESPACE_DECL" macros are used in a given +# source file. +sub check_for_versioned_namespace_begin_end () +{ + print "Running versioned namespace begin/end test\n"; + foreach $file (@files_cpp, @files_inl, @files_h) { + my $begin_count = 0; + my $end_count = 0; + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/^\s*\w+_BEGIN_VERSIONED_NAMESPACE_DECL/) { + ++$begin_count; + } + if (/^\s*\w+_END_VERSIONED_NAMESPACE_DECL/) { + ++$end_count; + } + if ($begin_count > $end_count and + /^\s*#\s*include(\s*\/\*\*\/)?\s*"/) { + print_error ("$file:$.: #include directive within Versioned namespace block"); + } + } + + close (FILE); + + if ($begin_count != $end_count) { + print_error ("$file: Versioned namespace begin($begin_count)/end($end_count) mismatch"); + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + + +# Check doxygen @file comments +sub check_for_mismatched_filename () +{ + print "Running doxygen \@file test\n"; + foreach $file (@files_h, @files_cpp, @files_inl, @files_idl) { + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (m/\@file\s*([^\s]+)/){ + # $file includes complete path, $1 is the name after + # @file. We must strip the complete path from $file. + # we do that using the basename function from + # File::BaseName + $filename = basename($file,""); + if (!($filename eq $1)){ + print_error ("$file:$.: \@file mismatch in $file, found $1"); + } + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# check for bad run_test +sub check_for_bad_run_test () +{ + print "Running run_test.pl test\n"; + foreach $file (@files_pl) { + if (open (FILE, $file)) { + my $is_run_test = 0; + my $sub = 0; + + print "Looking at file $file\n" if $opt_d; + + while (<FILE>) { + + if (m/PerlACE/ || m/ACEutils/) { + $is_run_test = 1; + } + + if ($is_run_test == 1) { + if (m/ACEutils/) { + print_error ("$file:$.: ACEutils.pm still in use"); + } + + if (m/unshift \@INC/) { + print_error ("$file:$.: unshifting \@INC; use \"use lib\""); + } + + if (m/\$EXEPREFIX/) { + print_error ("$file:$.: using \$EXEPREFIX"); + } + + if (m/\$EXE_EXT/) { + print_error ("$file:$.: using \$EXE_EXT"); + } + + if (m/\$DIR_SEPARATOR/) { + print_error ("$file:$.: using \$DIR_SEPARATOR"); + } + if (m/ACE\:\:/ && !m/PerlACE\:\:/) { + print_error ("$file:$.: using ACE::*"); + } + + if (m/Process\:\:/ && !m/PerlACE\:\:Process\:\:/) { + print_error ("$file:$.: using Process::*"); + } + + if (m/Process\:\:Create/) { + print_error ("$file:$.: using Process::Create"); + } + + if ((m/\.ior/ || m/\.conf/) && !m/LocalFile/) { + print_error ("$file:$.: Not using PerlACE::LocalFile"); + } + + if (m/^ [^ ]/) { + print_warning ("$file:$.: using two-space indentation"); + } + + if (m/^\s*\t/) { + print_error ("$file:$.: Indenting using tabs"); + } + + if (m/^\s*\{/ && $sub != 1) { + print_warning ("$file:$.: Using Curly Brace alone"); + } + + if (m/timedout/i && !m/\#/) { + print_error ("$file:$.: timedout message found"); + } + + if (m/^\s*sub/) { + $sub = 1; + } + else { + $sub = 0; + } + } + } + + close (FILE); + + if ($is_run_test) { + my @output = `perl -wc $file 2>&1`; + + foreach $output (@output) { + chomp $output; + if ($output =~ m/error/i) { + print_error ($output); + } + elsif ($output !~ m/syntax OK/) { + print_warning ($output); + } + } + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + + +# Check for links to ~schmidt/ACE_wrappers/, which should not be in the +# documentation +sub check_for_absolute_ace_wrappers() +{ + print "Running absolute ACE_wrappers test\n"; + foreach $file (@files_html) { + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (m/\~schmidt\/ACE_wrappers\//) { + chomp; + print_error ("$file:$.: ~schmidt/ACE_wrappers found"); + print_error ($_) if (defined $opt_v); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# Make sure ACE_[OS_]TRACE matches the function/method +sub check_for_bad_ace_trace() +{ + print "Running TRACE test\n"; + foreach $file (@files_inl, @files_cpp) { + if (open (FILE, $file)) { + my $class; + my $function; + + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + + # look for methods or functions + if (m/(^[^\s][^\(]*)\:\:([^\:^\(]*[^\s^\(])\s*/) { + $class = $1; + $function = $2; + } + elsif (m/^([^\s^\(^\#]*) \(/i) { + $class = ""; + $function = $1; + } + elsif (m/^(operator.*) \(/i) { + $class = ""; + $function = $1; + } + + # Look for TRACE statements + if (m/ACE_OS_TRACE\s*\(\s*\"(.*)\"/ + || m/ACE_TRACE\s*\(\s*\"(.*)\"/) { + my $trace = $1; + + # reduce the classname + if ($class =~ m/([^\s][^\<^\s]*)\s*\</) { + $class = $1; + } + + if ($class =~ m/([^\s^\&^\*]*)\s*$/) { + $class = $1; + } + + if ($trace !~ m/\Q$function\E/ + || ($trace =~ m/\:\:/ && !($trace =~ m/\Q$class\E/ && $trace =~ m/\Q$function\E/))) { + print_error ("$file:$.: Mismatched TRACE"); + print_error ("$file:$.: I see \"$trace\" but I think I'm in \"" + . $class . "::" . $function . "\"") if (defined $opt_v); + } + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + + +# This test checks for broken ChangeLog entries. +sub check_for_changelog_errors () +{ + print "Running ChangeLog check\n"; + foreach $file (@files_changelog) { + if (open (FILE, $file)) { + my $found_backslash = 0; + my $found_cvs_conflict = 0; + + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + + next if m/^\s*\/\//; + next if m/^\s*$/; + + # Check for backslashes in paths. + if (m/\*.*\\[^ ]*:/) { + print_error ("$file:$.: Backslashes in file path"); + } + + # Check for CVS conflict tags + if (m/^<<<<</ || m/^=====/ || m/^>>>>>/) { + print_error ("$file:$.: CVS conflict markers"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +sub check_for_deprecated_macros () +{ + ## Take the current working directory and remove everything up to + ## ACE_wrappers (or ACE for the peer-style checkout). This will be + ## used to determine when the use of ACE_THROW_SPEC is an error. + my($cwd) = getcwd(); + if ($cwd =~ s/.*(ACE_wrappers)/$1/) { + } + elsif ($cwd =~ s/.*(ACE)/$1/) { + } + + print "Running deprecated macros check\n"; + foreach $file (@files_cpp, @files_inl, @files_h) { + if (open (FILE, $file)) { + + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + # Check for ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION usage. + if (m/ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION\)/) { + print_error ("$file:$.: ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION found."); + } + elsif (/ACE_THROW_SPEC/) { + ## Do not use ACE_THROW_SPEC in TAO or CIAO. + if ($file =~ /TAO|CIAO/i || $cwd =~ /TAO|CIAO/i) { + print_error ("$file:$.: ACE_THROW_SPEC found."); + } + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} +# This test checks for ptr_arith_t usage in source code. ptr_arith_t +# is non-portable. Use ptrdiff_t instead. +sub check_for_ptr_arith_t () +{ + print "Running ptr_arith_t check\n"; + foreach $file (@files_cpp, @files_inl, @files_h) { + if (open (FILE, $file)) { + + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + + next if m/^\s*\/\//; # Ignore C++ comments. + next if m/^\s*$/; # Skip lines only containing + # whitespace. + + # Check for ptr_arith_t usage. This test should + # ignore typedefs, and should only catch variable + # declarations and parameter types. + if (m/ptr_arith_t / || m/ptr_arith_t,/) { + print_error ("$file:$.: ptr_arith_t; use ptrdiff_t instead."); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test checks for the #include <ace/...> +# This check is suggested by Don Hinton to force user to use +# " " instead of <> to avoid confict with Doxygen. +sub check_for_include () +{ + print "Running the include check\n"; + foreach $file (@files_h, @files_cpp, @files_inl, @files_idl) { + my $bad_occurance = 0; + if (open (FILE, $file)) { + my $disable = 0; + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + if (/FUZZ\: disable check_for_include/) { + $disable = 1; + } + if (/FUZZ\: enable check_for_include/) { + $disable = 0; + } + if ($disable == 0) { + if (/^\s*#\s*include\s*<[(ace)|(TAO)|(CIAO)]\/.*>/) { + print_error ("$file:$.: include <ace\/..> used") if ($opt_v); + ++$bad_occurance; + } + if (/^\s*#\s*include\s*<tao\/.*>/) { + print_error ("$file:$.: include <tao\/..> used") if ($opt_v); + ++$bad_occurance; + } + if (/^\s*#\s*include\s*<ciao\/.*>/) { + print_error ("$file:$.: include <ciao\/..> used") if ($opt_v); + ++$bad_occurance; + } + } + } + close (FILE); + + if ($disable == 0 && $bad_occurance > 0 ) { + print_error ("$file:1: found $bad_occurance usage(s) of #include <> of ace\/tao\/ciao."); + } + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test verifies that all equality, relational and logical +# operators return bool, as is the norm for modern C++. +# +# NOTE: This test isn't fool proof yet. +sub check_for_non_bool_operators () +{ + print "Running non-bool equality, relational and logical operator check\n"; + foreach $file (@files_h, @files_inl, @files_cpp) { + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + my $found_bool = 0; + my $found_return_type = 0; + while (<FILE>) { + + if ($found_bool == 0 + && (/[^\w]bool\s*$/ + || /^bool\s*$/ + || /\sbool\s+\w/ + || /^bool\s+\w/ + || /[^\w]return\s*$/)) + { + $found_bool = 1; + $found_return_type = 0; + next; + } + + if ($found_bool == 0 && $found_return_type == 0 + && /^(?:\w+|\s+\w+)\s*$/ + && !/[^\w]return\s*$/) + { + $found_return_type = 1; + $found_bool = 0; + next; + } + + if ($found_bool == 0 + && /(?<![^\w]bool)(\s+|\w+::|>\s*::)operator\s*(?:!|<|<=|>|>=|==|!=|&&|\|\|)\s*\(/ + && !/\(.*operator\s*(?:!|<|<=|>|>=|==|!=|&&|\|\|)\s*\(/ + && !/^\s*return\s+/) { + print_error ("$file:$.: non-bool return type for operator"); + } + + $found_return_type = 0; + $found_bool = 0; + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +# This test verifies that all filenames are short enough + +sub check_for_long_file_names () +{ + my $max_filename = 50; + my $max_mpc_projectname = $max_filename - 12; ## GNUmakefile.[project_name] + print "Running file names check\n"; + + foreach $file (@files_cpp, @files_inl, @files_h, @files_html, + @files_dsp, @files_dsw, @files_gnu, @files_idl, + @files_pl, @files_changelog, @files_makefile, + @files_bor, @files_mpc) { + if ( length( basename($file) ) >= $max_filename ) + { + print_error ("File name $file meets or exceeds $max_filename chars."); + } + } + foreach $file (grep(/\.mpc$/, @files_mpc)) { + if (open(FH, $file)) { + my($blen) = length(basename($file)) - 4; ## .mpc + while(<FH>) { + if (/project\s*(:.*)\s*{/) { + if ($blen >= $max_mpc_projectname) { + print_warning ("File name $file meets or exceeds $max_mpc_projectname chars."); + } + } + elsif (/project\s*\(([^\)]+)\)/) { + my($name) = $1; + if ($name =~ /\*/) { + my($length) = length($name) + (($name =~ tr/*//) * $blen); + if ($length >= $max_mpc_projectname) { + print_warning ("Project name ($name) from $file will meet or exceed $max_mpc_projectname chars when expanded by MPC."); + } + } + else { + if (length($name) >= $max_mpc_projectname) { + print_warning ("Project name ($name) from $file meets or exceeds $max_mpc_projectname chars."); + } + } + } + } + close(FH); + } + } +} + +sub check_for_refcountservantbase () +{ + print "Running PortableServer::RefCountServantBase derivation check\n"; + + foreach $file (@files_h) { + if (open (FILE, $file)) { + print "Looking at file $file\n" if $opt_d; + while (<FILE>) { + + if (/PortableServer::RefCountServantBase/) { + print_error ("$file:$.: reference to deprecated PortableServer::RefCountServantBase"); + } + } + close (FILE); + } + else { + print STDERR "Error: Could not open $file\n"; + } + } +} + +############################################################################## + +use vars qw/$opt_c $opt_d $opt_h $opt_l $opt_t $opt_m $opt_v/; + +if (!getopts ('cdhl:t:mv') || $opt_h) { + print "fuzz.pl [-cdhm] [-l level] [-t test_name][file1, file2, ...]\n"; + print "\n"; + print " -c only look at the files passed in\n"; + print " -d turn on debugging\n"; + print " -h display this help\n"; + print " -l level set detection level (default = 5)\n"; + print " -t test_name specify any single test to run. This will disable the run level setting\n"; + print " -m only check locally modified files (uses cvs)\n"; + print " -v verbose mode\n"; + print "======================================================\n"; + print "list of the tests that could be run:\n"; + print "\t check_for_noncvs_files + check_for_synch_include + check_for_OS_h_include + check_for_streams_include + check_for_dependency_file + check_for_makefile_variable + check_for_inline_in_cpp + check_for_id_string + check_for_newline + check_for_ACE_SYNCH_MUTEX + check_for_ACE_Thread_Mutex + check_for_tab + check_for_exception_spec + check_for_NULL + check_for_improper_main_declaration + check_for_lack_ACE_OS + check_for_inline + check_for_math_include + check_for_line_length + check_for_preprocessor_comments + check_for_tchar + check_for_pre_and_post + check_for_push_and_pop + check_for_versioned_namespace_begin_end + check_for_mismatched_filename + check_for_bad_run_test + check_for_absolute_ace_wrappers + check_for_bad_ace_trace + check_for_changelog_errors + check_for_ptr_arith_t + check_for_include + check_for_non_bool_operators + check_for_long_file_names + check_for_refcountservantbase\n"; + exit (1); +} + +if (!$opt_l) { + $opt_l = 5; +} + +if ($opt_c) { + foreach $file (@ARGV) { + store_file ($file); + } +} +elsif ($opt_m) { + find_mod_files (); +} +else { + find_files (); +} + +if ($opt_t) { + &$opt_t(); + exit (1); +} + +print "--------------------Configuration: Fuzz - Level ",$opt_l, + "--------------------\n"; + +check_for_deprecated_macros () if ($opt_l > 1 ); +check_for_refcountservantbase () if ($opt_l > 1 ); +check_for_msc_ver_string () if ($opt_l >= 3); +check_for_empty_files () if ($opt_l >= 1); +check_for_noncvs_files () if ($opt_l >= 1); +check_for_streams_include () if ($opt_l >= 6); +check_for_dependency_file () if ($opt_l >= 1); +check_for_makefile_variable () if ($opt_l >= 1); +check_for_inline_in_cpp () if ($opt_l >= 2); +check_for_id_string () if ($opt_l >= 1); +check_for_newline () if ($opt_l >= 1); +check_for_ACE_Thread_Mutex () if ($opt_l >= 1); +check_for_ACE_SYNCH_MUTEX () if ($opt_l >= 1); +check_for_tab () if ($opt_l >= 1); +check_for_lack_ACE_OS () if ($opt_l >= 10); +check_for_exception_spec () if ($opt_l >= 1); +check_for_NULL () if ($opt_l >= 1); +check_for_improper_main_declaration () if ($opt_l >= 10); +check_for_inline () if ($opt_l >= 2); +check_for_math_include () if ($opt_l >= 3); +check_for_synch_include () if ($opt_l >= 6); +check_for_OS_h_include () if ($opt_l >= 6); +check_for_line_length () if ($opt_l >= 8); +check_for_preprocessor_comments () if ($opt_l >= 7); +check_for_tchar () if ($opt_l >= 4); +check_for_pre_and_post () if ($opt_l >= 4); +check_for_push_and_pop () if ($opt_l >= 4); +check_for_versioned_namespace_begin_end () if ($opt_l >= 4); +check_for_mismatched_filename () if ($opt_l >= 2); +check_for_bad_run_test () if ($opt_l >= 6); +check_for_absolute_ace_wrappers () if ($opt_l >= 3); +check_for_bad_ace_trace () if ($opt_l >= 4); +check_for_changelog_errors () if ($opt_l >= 4); +check_for_ptr_arith_t () if ($opt_l >= 4); +check_for_include () if ($opt_l >= 5); +check_for_non_bool_operators () if ($opt_l > 2); +check_for_long_file_names () if ($opt_l > 1 ); + + +print "\nFuzz.pl - $errors error(s), $warnings warning(s)\n"; + +exit (1) if $errors > 0; diff --git a/ACE/bin/fuzz.py b/ACE/bin/fuzz.py new file mode 100755 index 00000000000..cdf38de87f5 --- /dev/null +++ b/ACE/bin/fuzz.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python +""" Implements a command line client for the Python Fuzz module, much like fuzz.pl """ + +def parse_args (): + from optparse import OptionParser + + parser = OptionParser ("usage %prog [options] <files or directories to check>") + + parser.add_option ("--exclude-dirs", dest="exclude_dir", action="append", default=list (), + help="A regular expression that when matched, will cause directories to be skipped.") + parser.add_option ("--exclude-files", dest="exclude_file", action="append", default=list (), + help="A regular expression that when matched, will cause files to be skipped.") + + return parser.parse_args () + + +import PythonACE.fuzz + +class Fuzz_Client: + def __init__ (self, opts, args): + import re + + self.ex_dirs = map (re.compile, opts.exclude_dir) + self.ex_files = map (re.compile, opts.exclude_file) + self.args = args + + def walk_dir (self, directory): + import os + + for root, dirs, files in os.walk (directory): + # Prune out .svn directories + for item in dirs: + if item == ".svn": + dirs.remove (item) + + # Prune out exclusions + for regex in self.ex_dirs: + if regex.search (item) != None: + dirs.remove (item) + + for item in files: + for regex in self.ex_files: + if regex.serch (item) != None: + continue + self.check_file (os.path.join (root, item)) + + def check_file (self, the_file): + f = open (the_file, 'r') + PythonACE.fuzz.fuzz_check (the_file, f.read ()) + f.close () + + def main (self): + for item in self.args: + import os.path + if os.path.isfile (item): + self.check_file (item) + elif os.path.isdir (item): + self.walk_dir (item) + else: + print item + " is not a file or directory." + +if __name__ == "__main__": + opts, args = parse_args () + Fuzz = Fuzz_Client(opts, args) + Fuzz.main () + diff --git a/ACE/bin/g++_metric.sh b/ACE/bin/g++_metric.sh new file mode 100755 index 00000000000..93af97932a1 --- /dev/null +++ b/ACE/bin/g++_metric.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# +# $Id$ +# +# This simple script is used to gather compile time metrics. You can use +# it with make like this: +# +# $ make CXX=g++_metric.sh +# + +commandline=$@ +# find the target and save it to a variable +until [ -z "$1" ] # test all command line parameters +do + if [ "-o" = "$1" ] + then + shift + target=$1 + break + fi + shift +done + +# echo out "(%x)", the return value from g++, so the script processes the output +# will only use times for successful compilations, i.e., "(0)". +/usr/bin/time -f "//compile time(%x): ${PWD#$ACE_ROOT/}/${target} %U %S" g++ $commandline + +retval=$? + +exit $retval diff --git a/ACE/bin/g++dep b/ACE/bin/g++dep new file mode 100755 index 00000000000..a4cd4873301 --- /dev/null +++ b/ACE/bin/g++dep @@ -0,0 +1,173 @@ +#! /bin/sh +# $Id$ + +# This utility is a lightly editted version of the freed Berkeley +# script `mkdep'. The current script is intended to work for GNU G++. + +# Here is the original BSD header: +# @(#)mkdep.sh 1.7 (Berkeley) 10/13/87 +# + +if [ $# = 0 ] ; then + echo 'usage: g++dep [-p] [-f makefile] [flags] file ...' + exit 1 +fi + +DO_ACE_MAKE_DEPEND=0 +MAKE=GNUmakefile +STOPNOW=0 +REL="" + +while [ $STOPNOW -eq 0 ] +do +case $1 in + # -e for compatibility with depgen.pl + -e) shift; shift ;; + + # -f allows you to select a makefile name + -f) MAKE=$2 + shift; shift ;; + + # the -p flag produces "program: program.c" style dependencies + # so .o's don't get produced + -p) SED='s;\.o;;' + shift ;; + + # -A implies -r and fixes the .obj line, hate + -A) REL="ACE_ROOT TAO_ROOT "$REL + DO_ACE_MAKE_DEPEND=1 + shift ;; + + # -r allows the use of relative pathnames... + -r) REL="ACE_ROOT TAO_ROOT "$REL + shift ;; + + # -R VARNAME allows you to specify a variable which should be used + # to generate relative paths if it's defined. You can use multiple + # -R options, but be careful if one of the values is a proper + # subset of a subsequent value, because I suspect that sed will + # substitute for the first value properly, but not for the + # second. You might be able to get around this by reordering and + # having the more specific values lead the less specific values. + -R) REL=$2" "$REL + shift; shift;; + *) STOPNOW=1 +esac +done + +if [ ! -w $MAKE ]; then + echo "g++dep: no writeable file \"$MAKE\"" + exit 1 +fi + +TMP=/tmp/g++dep$$ +SCRIPT=${TMP}_script + +trap 'rm -f $TMP $SCRIPT; exit 1' 1 2 3 13 15 + +cp $MAKE ${MAKE}.bak + +sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP + +cat << _EOF_ >> $TMP +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +_EOF_ + +# Local files may appear as './foo' change that to 'foo' +echo 's; \./; ;g' >$SCRIPT + +# If the -p flag is set we want to change 'foo.o' to simply 'foo' +echo $SED >>$SCRIPT + +# Dependencies on local files are better expressed like that, instead +# of using $(TAO_ROOT) or $(ACE_ROOT). This is specially important +# for IDL generated files. +echo "s;`pwd`/;;g" >>$SCRIPT + +if [ -z "$TAO_ROOT" ]; then + TAO_ROOT=${ACE_ROOT}/TAO +fi + +# This is a long series of commands to change the actual value of +# $ACE_ROOT to '$(ACE_ROOT)', similar changes are done for TAO_ROOT +# and any number of "variables" defined via the -R option. +for varname in $REL; do + varvalue=$(eval echo \$${varname}) + echo "s;"$varvalue";$""("$varname");g" >>$SCRIPT +done + +if [ $DO_ACE_MAKE_DEPEND -eq 1 ]; then + # Append a series of commands to the sed script that help with the + # ACE build style (.obj subdirectories, plaform indenpendent + # dependencies, etc.) + + # To avoid interpolation we build this string in pieces, the idea is + # to generate a rule that will convert + # foo.o: + # into + # .obj/foo.o .shobj/foo.o .obj/foo.so .shobj/foo.so: + # + # will be foo.o foo. + LONG_TARGET="$""(sort " + for i in VDIR VSHDIR; do + for j in OBJEXT SOEXT; do + LONG_TARGET=${LONG_TARGET}"$""("${i}")\1.$""("${j}") " + done + done + LONG_TARGET=${LONG_TARGET}")" + + cat >>$SCRIPT <<EOF +# +# Change the actual plaform config.h file to a MAKE macro... +s;${ACE_PLATFORM_CONFIG};\$(ACE_PLATFORM_CONFIG);g +# +# Append a 'x' character to the config-all and config-lite names, +# because we are going to remove all the config-* names.. +s/config-all/configx-all/ +s/config-lite/configx-lite/ +# +# Remove the config-* names +/config-.*\.h/d +# +# Restore configx-all and configx-lite to their original names +s/configx-all/config-all/ +s/configx-lite/config-lite/ +# +# Remove any absolute dependencies +s; /[-a-zA-Z0-9_./+]*\.h;;g +# +# Remove blanks followed by a backslash +s;[ \\t][ \\t]*\\\\; \\\\;g +# +# g++ generate dependencies for foo.o in the current directory, but we +# we need dependencies for foo.o and foo.so in the .obj and .shobj +# subdirectories. Actually .obj and .shobj are, respectively, the +# expansions of VDIR and VSHDIR, therefore it is better *NOT* to use +# the values of said variables, but generated dependencies that expand +# them. +s;\([-a-zA-Z0-9._+]*\)\.o:;\\${LONG_TARGET}:; +# +# An older implementation of the previous code, but using the actual +# value of VDIR and VSHDIR at time of dependency generation. +# +#s;\([-a-zA-Z0-9._+]*\)\.o:;\\${VDIR}\1.${OBJEXT} ${VDIR}\1.${SOEXT} ${VSHDIR}\1.${OBJEXT} ${VSHDIR}\1.${SOEXT}:; +# +# +EOF +fi + +g++ -MM -MG -DACE_LACKS_PRAGMA_ONCE $* | + sed -f $SCRIPT ${ACE_DEPEND_SED_CMD} >>$TMP +/bin/rm -f $SCRIPT + +cat << _EOF_ >> $TMP + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY +_EOF_ + +# copy to preserve permissions +cp $TMP $MAKE +rm -f ${MAKE}.bak $TMP +exit 0 diff --git a/ACE/bin/generate_compile_stats.sh b/ACE/bin/generate_compile_stats.sh new file mode 100755 index 00000000000..c78d6589a1c --- /dev/null +++ b/ACE/bin/generate_compile_stats.sh @@ -0,0 +1,1093 @@ +#! /bin/sh +# +# $Id$ +# +# This script generate metrics html pages for either compile times or +# footprint. +# +# Compile times: +# Parse the build.txt file from an autobuild that was generated with the +# g++_metric.sh script, e.g., with CXX=g++_metric.sh which outputs +# compile times on a per object basis, and use the data to generate time +# series graphs with gnuplot. +# +# Footprint: +# Parse the build.txt file and and the *.map files, generated with LDFLAGS +# set to =-Xlinker -M -Xlinker -Map -Xlinker \$@.map and static_libs_only=1. +# +# For use with an autobuild, place a line something like this in the xml file, +# after the log file is closed, but before it's moved. +# +# <command name="shell" options="$ACE_ROOT/bin/generate_compile_stats.sh <path>/build.txt <destination> Footprint" /> +# + +############################################################################### +# +# usage +# +############################################################################### +usage () +{ + echo "Usage: `basename $0` [--base=<dir>] [--name=<name>] [--compiler=compiler]" + echo " <input_file> <destination_directory> [target_file]" + echo " [Footprint|Compilation] [<date>] [<fudge_factor>]" + echo "" + echo "--base This option can be used to set the base root directory to" + echo " something other than the default \$ACE_ROOT." + echo "--name This option can be used to set the software title to something" + echo " other than the default ACE+TAO+CIAO." + echo "--compiler This option can be used to set the compiler to something" + echo " other than the default gcc." + echo "input_file This is the compilation log file." + echo "destination_directory This designates the location of the generated html." + echo "target_file This is similar to input_file, but should contain no errors." + echo "date Set the date used in all generated html pages." + echo "fudge_factor Add the specified number of seconds to the compilation time" + echo " for each target." + echo "" + echo "Options must be specified in the order shown above." + exit +} + +############################################################################### +# +# parse_time +# +# this only works for english +# assumes the date is formatted like this: Sat Apr 12 18:19:31 UTC 2003 +# and outputs this: 2003/04/12-18:19 +# +############################################################################### +parse_time () +{ + # todo: add a format parameter + local INDEX=0 + local PT_MONTH="" + local PT_DAY="" + local PT_YEAR="" + local PT_HOUR="" + local PT_MINUTE="" + local PT_SECOND="" + local PT_TIMEZONE="" + + read -a line + for token in "${line[@]}"; do + #echo "$INDEX = $token" + case $INDEX in + 1 ) case $token in + Jan ) PT_MONTH="01" ;; + Feb ) PT_MONTH="02" ;; + Mar ) PT_MONTH="03" ;; + Apr ) PT_MONTH="04" ;; + May ) PT_MONTH="05" ;; + Jun ) PT_MONTH="06" ;; + Jul ) PT_MONTH="07" ;; + Aug ) PT_MONTH="08" ;; + Sep ) PT_MONTH="09" ;; + Oct ) PT_MONTH="10" ;; + Nov ) PT_MONTH="11" ;; + Dec ) PT_MONTH="12" ;; + esac ;; + 2 ) PT_DAY="$token" ;; + 3 ) PT_HOUR="${token%%:*}" + PT_MINUTE="${token%:*}" + PT_MINUTE="${PT_MINUTE#*:}" + PT_SECOND="${token##*:}" ;; + 4 ) PT_TIMEZONE="$token" ;; + 5 ) PT_YEAR="$token" ;; + esac + let INDEX=$INDEX+1 + done + if [ "$1" = "debug" ]; then + echo "month = $PT_MONTH" + echo "day = $PT_DAY" + echo "year = $PT_YEAR" + echo "hour = $PT_HOUR" + echo "min = $PT_MINUTE" + echo "sec = $PT_SECOND" + echo "tz = $PT_TIMEZONE" + fi + echo "$PT_YEAR/$PT_MONTH/$PT_DAY-$PT_HOUR:$PT_MINUTE" +} + +############################################################################### +# +# strip_date +# +# grab date from line with following format: +# ################### End [Fri Apr 11 00:18:31 2003 UTC] +# and return it in this format: Fri Apr 11 00:18:31 UTC 2003 which is +# what parse_time() expects +# +############################################################################### +strip_date () +{ + local INDEX=0 + local TEMP_DATE="" + local DATE="" + read -a line + for token in "${line[@]}"; do + #echo "$INDEX = $token" + case $INDEX in + 2 ) DATE=${token#[} ;; + 7 ) DATE="$DATE ${token%]} $TEMP_DATE" ;; + # this is a hack since the autobuild scripts don't format the date + # correctly... :-( + 6 ) TEMP_DATE=$token ;; + * ) DATE="$DATE $token" ;; + esac + let INDEX=$INDEX+1 + done + echo $DATE +} + +############################################################################### +# +# parse +# +# Parse the commandline and validate the inputs +# +############################################################################### +parse () +{ + echo "parse()" + while [ $# -gt 1 ]; do + if [ -n "`echo $1 | grep '^--base=.*'`" ]; then + BASE_ROOT=`echo $1 | sed 's/^--base=//'` + shift + elif [ -n "`echo $1 | grep '^--name=.*'`" ]; then + BASE_TITLE=`echo $1 | sed 's/^--name=//'` + shift + elif [ -n "`echo $1 | grep '^--compiler.*'`" ]; then + COMPILER=`echo $1 | sed 's/^--compiler=//'` + shift + else + break + fi + done + + # set input file and destination (required) + if [ $# -gt 1 ]; then + INFILE=$1 + DEST=$2 + + if ! [ -e "$INFILE" ]; then + echo "input_file $INFILE does not exist." + usage + fi + else + usage + fi + + # set the target file from command line + if [ $# -gt 2 ]; then + TARGETS=$3 + else + TARGETS=$INFILE + fi + + # set type of metric from command line + if [ $# -gt 3 ]; then + METRIC=$4 + else + METRIC="Compilation" + fi + echo "metric = ($METRIC)" + + # set the date from command line + if [ $# -gt 4 ]; then + DATE=$5 + else + DATE=`tail -n 1 $INFILE | strip_date | parse_time` + fi + echo "date = ($DATE)" + + # set fudge factor from commandline (for testing) + if [ $# -gt 5 ]; then + FUDGE_FACTOR=$6 + else + FUDGE_FACTOR=0 + fi +} + +############################################################################### +# +# gen_chart +# +# Generate the actual charts and move them to $DEST +# +############################################################################### +gen_chart () +{ + local object=$1 + local DEST=$2 + local TYPE=$3 + local EXT="txt" + local YLABEL="Compile Time (Seconds)" + local FACTOR=100 + if [ "$TYPE" = "Footprint" ]; then + EXT="size" + YLABEL="Footprint (KBytes)" + FACTOR=1024 + fi + + local low=$4 + let low="${low}/${FACTOR}" + local high=$5 + let high="${high}/${FACTOR}" + + gnuplot <<EOF + set data style lp l + set time "$DATE" + set xdata time + set timefmt "%Y/%m/%d-%H:%M" + set format x "%Y/%m/%d" + set xtics rotate + set xlabel 'Date (YYYY/MM/DD)' 0,-3 + set ylabel "${YLABEL}" + set terminal png small size 800,600 color + set yrange [$low:$high] + set output ".metrics/images/${object}_${TYPE}.png" + set title "${object//___//}" + plot '.metrics/data/${object}.${EXT}' using 1:(\$2/$FACTOR) notitle w points, '.metrics/data/${object}.${EXT}' using 1:(\$2/$FACTOR) notitle w l lt 3 lw 4 + exit +EOF + + # here's how to reduce the scale + # plot '$1' using 1:(\$2/1024.0) title '$3' w l + + # copy the data and images to $DEST + /bin/cp .metrics/images/${object}_${TYPE}.png $DEST/images/${object}_${TYPE}.png + # don't do thumbnails, yet... + #/bin/cp .metrics/images/${object}_size.png .metrics/images/thumbnails/${object}_size.png + #/usr/bin/X11/mogrify -geometry '25%' .metrics/images/thumbnails/${object}_size.png + #/bin/cp .metrics/images/thumbnails/${object}_size.mgk $DEST/images/thumbnails/${object}_size.png + /usr/bin/tac .metrics/data/${object}.${EXT} > $DEST/data/${object}.${EXT} + /usr/bin/tail -5 .metrics/data/${object}.${EXT} > $DEST/data/LAST_${object}.${EXT} + +} + +############################################################################### +# +# create_dirs +# +# Make sure hidden directory tree exists, and create it if it doesn't +# +############################################################################### +create_dirs () +{ + echo "create_dirs() '$1'" + if ! [ -d "${1}" ]; then + mkdir ${1} + fi + if ! [ -d "${1}data" ]; then + mkdir ${1}data + fi + if ! [ -d "${1}images" ]; then + mkdir ${1}images + fi + if ! [ -d "${1}images/thumbnails" ]; then + mkdir ${1}images/thumbnails + fi +} + +############################################################################### +# +# process_file +# +# Process the the $INPUT file +# +############################################################################### +process_file () +{ + echo "process_file()" + + local CURRENT_TIME=0 + local CURRENT_OBJECT="" + local CURRENT_PATH="" + local seconds=0 + local hundreths=0 + + while read target usertime systemtime; do + + # get path + CURRENT_PATH=${target%/*} + + # strip off the hidden directory if needbe + CURRENT_PATH=${CURRENT_PATH%/.*} + + # replace all "/" with "___" + # (so we can keep them all in the same directory) + CURRENT_PATH=${CURRENT_PATH//\//___} + + # strip path off of target + CURRENT_OBJECT=${CURRENT_PATH}___${target##*/} + #echo "target = $target, object = $CURRENT_OBJECT, path = $CURRENT_PATH" + #echo "usertime = $usertime, systemtime = $systemtime" + + let seconds="${usertime%.*}+${systemtime%.*}" + + # it's just easier to grab the values first, since .0n causes problems... + userdec="${usertime#*.}" + userdec=${userdec#0} + systemdec="${systemtime#*.}" + systemdec=${systemdec#0} + let hundreths="${userdec}+${systemdec}" + + let CURRENT_TIME="(${seconds}*100 + ${hundreths})+$FUDGE_FACTOR" + echo $DATE $CURRENT_TIME >> .metrics/data/${CURRENT_OBJECT}.txt + + done # while +} + +############################################################################### +# +# composite_list +# +############################################################################### +composite_list () +{ + local FOUND_OBJ=0 + local BASE_OBJ_FLAG=0 + local BASE_OBJ="" + local OBJ_LIST="" + local DIR_LINE=0 + local DIR="" + local INDEX=0 + + while read -a line; do + DIR_LINE=0 + INDEX=0 + + for i in "${line[@]}"; do + if [ $DIR_LINE -eq 1 ]; then + + # only process when entering a directory + if [ $INDEX -eq 1 ] && [ "$i" = "Leaving" ]; then + DIR="" + break + fi + + if [ $INDEX -eq 3 ]; then + DIR="${i%?}" # strip off last "'" + DIR="${DIR#*$BASE_ROOT/}" # strip off $BASE_ROOT + DIR="${DIR//\//___}___" # replace "/" with "___" + break + else + let INDEX="$INDEX+1" + continue + fi + fi + + # if it was a "make" line then continue to the next token which will + # continue to process above + if [ "${i%[*}" = "make" ] || [ "${i%:*}" = "make" ]; then + DIR="" + let DIR_LINE=1 + let INDEX="$INDEX+1" + continue + fi + + # not an "make" line, so process it here. + if [ $BASE_OBJ_FLAG -eq 1 ]; then + BASE_OBJ="${DIR}${i##.*/}" + # strip off lib numbers + if [ "$BASE_OBJ" != "${BASE_OBJ%.so.*}" ]; then + BASE_OBJ=${BASE_OBJ%.so.*}.so + fi + BASE_OBJ_FLAG=0 + elif [ "$i" = "-o" ]; then + # found our base object, set flag so we can grab the next one + BASE_OBJ_FLAG=1 + elif [ "$i" = "${i#-}" -a "$i" = "${i#/}" -a "$i" != "${i%.o}" ]; then + OBJ_LIST="$OBJ_LIST ${DIR}${i##*/}" + FOUND_OBJ=1 + fi + done # for + if [ $FOUND_OBJ -eq 1 ]; then + echo "$BASE_OBJ : $OBJ_LIST" + FOUND_OBJ=0 + OBJ_LIST="" + BASE_OBJ="" + fi + done # while +} + +############################################################################### +# +# create_composite_list +# +############################################################################### +create_composite_list () +{ + echo "create_composite_list()" + local INFILE=$1 + + # create a pattern file + echo "\-L" > .metrics/comp_match.txt + echo "Entering directory" >> .metrics/comp_match.txt + + # grep out the entering directory line and all the link lines, + # but only keep entering directory lines preceeding link lines. + cat $INFILE | grep -f .metrics/comp_match.txt | grep -B1 "\-L" \ + | grep -ve "--" | composite_list > .metrics/composites.txt +} + +############################################################################### +# +# library_list +# +############################################################################### +library_list () +{ + local FOUND_OBJ=0 + local BASE_OBJ_FLAG=0 + local BASE_OBJ="" + local OBJ_LIST="" + local DIR_LINE=0 + local DIR="" + local INDEX=0 + + while read -a line; do + DIR_LINE=0 + INDEX=0 + for i in "${line[@]}"; do + if [ $DIR_LINE -eq 1 ]; then + if [ $INDEX -eq 3 ]; then + DIR="${i%?}" # strip off last "'" + DIR="${DIR#*$BASE_ROOT/}" # strip off $BASE_ROOT + DIR="${DIR//\//___}___" # replace "/" with "___" + break + else + let INDEX="$INDEX+1" + continue + fi + fi + + # if it was a "make" line then continue to the next token which will + # continue to process above + if [ "${i%[*}" = "make" ]; then + let DIR_LINE=1 + let INDEX="$INDEX+1" + continue + fi + + # not a "make" line, so process it here. We are interested in the + # 3rd, and last, token, i.e., lib*.a + let INDEX="$INDEX+1" + if [ $INDEX -eq 3 ]; then + echo "$DIR$i" + fi + done # for + done # while +} + +############################################################################### +# +# create_library_list +# +############################################################################### +create_library_list () +{ + echo "create_library_list()" + local INFILE=$1 + + # create a pattern file + echo "chmod" > .metrics/lib_match.txt + echo "Entering directory" >> .metrics/lib_match.txt + + # grep out the entering directory line and all the link lines, + # but only keep entering directory lines preceeding link lines. + cat $INFILE | grep -f .metrics/lib_match.txt | grep -B1 "chmod" \ + | grep -ve "--" | library_list > .metrics/libraries.txt +} + +############################################################################### +# +# rollup_compile_times +# +############################################################################### +rollup_compile_times () +{ + echo "process_composite_objects()" + local TOTAL_TIME=0 + local temp + local tdate="" + local ttime=0 + local lpath=".metrics/data/" + + # rollup compile times + while read outfile colon infiles; do + #echo "$outfile ----- $infiles" + for i in $infiles; do + temp=`tail -n 1 ${lpath}${i}.txt` + tdate=${temp%% *} + let ttime="${temp##* }" + + if [ "$tdate" = "$DATE" ]; then + let TOTAL_TIME="$TOTAL_TIME + ${ttime}" + fi + done # for + echo "$DATE $TOTAL_TIME" >> ${lpath}${outfile}.txt + let TOTAL_TIME=0 + done # while +} + +############################################################################### +# +# footprint +# +############################################################################### +footprint () +{ + echo "footprint()" + local TYPE="$1" + local fpath="" + local lpath=".metrics/data/" + local FILE="" + local SIZE="" + + # Remove the old size_composites.txt and create a new one since + # we have all the info we need from the size command on a library. + if [ "$TYPE" = "LIB" ] && [ -e .metrics/size_composites.txt ]; then + rm .metrics/size_composites.txt + fi + + # go through all the targets and get the sizes of the target and + # each dependent object and write it to a *.size file. + while read outfile colon infiles; do + # reconstitue file name + FILE="$BASE_ROOT/${outfile//___//}" + + if [ -e $FILE ]; then + #echo "inside if" + SIZE=`size $FILE | grep -v text | awk '{s += \$4} END {print s}'` + echo "$DATE $SIZE" >> $lpath/${outfile}.size + + # only process the included objects if it's a library + if [ "$TYPE" = "LIB" ]; then + fpath=${FILE%/*} + # now, do the same for all the objects in the file (if any) + size $FILE | + grep -v text | + awk '{print $4 " : " $6}' | process_included $fpath $lpath $FILE + fi + fi + + done # while +} + +############################################################################### +# +# process_included +# +############################################################################### +process_included () +{ + echo "process_included()" + local fpath=$1 + local lpath=$2 + local LIBRARY=$3 + local FILE="" + local OUTFILE="" + + # while we are here, and have the info, go ahead and write out + # size dependencies for each library. + LIBRARY="${LIBRARY#*$BASE_ROOT/}" # strip off $BASE_ROOT + LIBRARY="${LIBRARY//\//___}" # replace "/" with "___" + echo -n "$LIBRARY : " >> .metrics/size_composites.txt + + while read size colon file; do + FILE=$fpath/$file + OUTFILE="${FILE#*$BASE_ROOT/}" # strip off $BASE_ROOT + OUTFILE="${OUTFILE//\//___}" # replace "/" with "___" + #echo "size = ($size)" + echo "$DATE $size" >> $lpath/${OUTFILE}.size + + # add the object + echo -n "$OUTFILE " >> .metrics/size_composites.txt + + done + # add newline + echo "" >> .metrics/size_composites.txt + +} + +############################################################################### +# +# process_map_file +# +############################################################################### +process_map_file () +{ + # this is way too noisy... + #echo "process_map_file()" + local index=0 + local INFILE=$1 + local FILE="" + + # Read in the map file. The first section is all we are interested + # in right now. As soon as we see "Memory Configuration" we are done. + while read line; do + let index=$index+1 + # Skip the first 2 lines, then read in all the odd lines, they are the + # objects that must be loaded. The following line, even lines, is the + # object that caused it to be loaded. + if [ $index -lt 3 ] || [ "$line" = "" ]; then + continue + fi + + # The line looks like this: + #/ace_root_path/ace/libACE.a(Malloc.o) + # need to find the real library path, since these libs will + # always be in ace/, but the objects will be in the original + # location. + lib="${line##/*/}" # strip off path, but only if it starts a line + lib="${lib%%.a*}" # strip off rest of line + lib="$lib.a" # put back the .a to make it unambiguous + libpath=`grep $lib .metrics/libraries.txt` + path="${libpath%___lib*}" # strip off libname + FILE="${line#*(}" # strip off everything up to object name + FILE="${FILE%%)*}" # strip off rest of line + FILE="${path}___${FILE}" + echo -n "$FILE " >> .metrics/size_composites.txt + done + + echo "" >> .metrics/size_composites.txt + +} + +############################################################################### +# +# create_size_composites +# +############################################################################### +create_size_composites () +{ + echo "create_size_composites()" + local FILE="" + + while read outfile colon infiles; do + # reconstitue file name + FILE="$BASE_ROOT/${outfile//___//}.map" + if [ -e $FILE ]; then + echo -n "$outfile : " >> .metrics/size_composites.txt + # only process lines that don't begin with a space + cat $FILE | sed -e '/Memory Configuration/,$d' \ + | sed -e '/Allocating common symbols/,$d' \ + | grep -v "^ " | process_map_file $FILE + fi + #break + done + +} + +############################################################################### +# +# create_images +# +############################################################################### +create_images () +{ + echo "create_images()" + + local DEST=$1 + local TYPE=$2 + local LOW=0 + local HIGH=5000 + local STEP=0 + local TMP=0 + + while read object; do + if [ -e $object ] && [ `sort -k 2n $object | tail -n 1 | cut -d' ' -f2` ]; then + let TMP=`sort -k 2n $object | tail -n 1 | cut -d' ' -f2` + let TMP=$TMP*16/10 + STEP=1000 + HIGH=0 + while [ $HIGH -eq 0 ]; do + if [ $TMP -lt $STEP ]; then + HIGH=$STEP + fi + let STEP=$STEP*15/10 + done + + if [ "$TYPE" = "Footprint" ]; then + object="${object%.size}" + else + object="${object%.txt}" + fi + + gen_chart "${object##*/}" ${DEST} ${TYPE} ${LOW} ${HIGH} >/dev/null 2>&1 + fi + done + +} + +############################################################################### +# +# create_index_page +# +############################################################################### +create_index_page () +{ + local TYPE="$1" + local TITLE="$TYPE metrics for $BASE_TITLE" + + echo "<html>" + echo "<head><title>$TITLE</title></head>" + echo '<style><!--' + echo 'body,td,a,p,.h{font-family:arial,sans-serif;}' + echo '.h{font-size: 20px;}' + echo '.q{text-decoration:none; color:#0000cc;}' + echo '//-->' + echo '</style>' + echo '<body text = "#000000" link="#000fff" vlink="#ff0f0f" bgcolor="#ffffff">' + echo "<br><center><h1>$TITLE</h1></center><br><hr>" + if [ $BASE_TITLE = $DEFAULT_TITLE ]; then + echo '<p>One of the goals of the PCES-TENA project is to decrease compile times.' + else + echo '<p>' + fi + echo ' Metrics are gathered nightly on all + objects in the '$BASE_TITLE' distribution and displayed here.' + echo '<ul>' + if [ $BASE_TITLE = $DEFAULT_TITLE ]; then + echo "<li><a href=\"ace_${TYPE}.html\">ACE</a>" + echo "<li><a href=\"tao_${TYPE}.html\">TAO</a>" + echo "<li><a href=\"ciao_${TYPE}.html\">CIAO</a>" + else + echo "<li><a href=\"all_${TYPE}.html\">ALL</a>" + fi + echo '</ul>' + echo '<hr>' + + echo '<P>All the experiments run on the system described below. ' + echo 'The machine is running Linux (' + + if [ -e "/etc/SuSE-release" ]; then + cat /etc/SuSE-release + fi + + if [ -e "/etc/redhat-release" ]; then + cat /etc/redhat-release + fi + + echo "), and we use " $COMPILER " version " + + $COMPILER -dumpversion > .metrics/compilerversion.txt 2>&1 + cat .metrics/compilerversion.txt + + echo ' to compile '$BASE_TITLE'. </P>' + + if [ -z "$MPC_ROOT" ]; then + MPC_ROOT=$ACE_ROOT/MPC + fi + + CFG_FILES=$ACE_ROOT/ace/config.h + if [ -r $ACE_ROOT/bin/MakeProjectCreator/config/default.features ]; then + CFG_FILES="$CFG_FILES $ACE_ROOT/bin/MakeProjectCreator/config/default.features" + elif [ -r $MPC_ROOT/config/default.features ]; then + CFG_FILES="$CFG_FILES $MPC_ROOT/config/default.features" + fi + CFG_FILES="$CFG_FILES $ACE_ROOT/include/makeinclude/platform_macros.GNU" + + echo '<TABLE border="2"><TBODY>' + for cfg_file in $CFG_FILES; do + if [ -r $cfg_file ]; then + echo "<TR><TD>ACE+TAO+CIAO Configuration</TD><TD>`basename $cfg_file`</TD></TR>" + echo '<TR><TD colspan="2"><PRE>' + cat $cfg_file + echo '</PRE></TD></TR>' + fi + done + + echo '<TR><TD>CPU Information</TD><TD>/proc/cpuinfo</TD></TR>' + echo '<TR><TD colspan="2"><PRE>' + + cat /proc/cpuinfo + + echo '</PRE></TD></TR><TR><TD>Available Memory</TD><TD>/proc/meminfo</TD></TR>' + echo '<TR><TD colspan="2"><PRE>' + + cat /proc/meminfo + + echo '</PRE></TD></TR><TR><TD>OS Version</TD><TD>uname -a</TD></TR>' + echo '<TR><TD colspan="2"><PRE>' + + /bin/uname -a + + echo '</PRE></TD></TR><TR><TD>Compiler Version</TD><TD>'$COMPILER' -v</TD></TR>' + echo '<TR><TD colspan="2">' + + $COMPILER -v > .metrics/compiler.txt 2>&1 + cat .metrics/compiler.txt + + if [ -e "/lib/libc.so.6" ]; then + echo '</TD></TR><TR><TD>Library Version</TD><TD>/lib/libc.so.6</TD></TR>' + echo '<TR><TD colspan="2"><PRE>' + + /lib/libc.so.6 | sed -e 's/</\</g' -e 's/>/\>/g' + fi + + echo '</PRE></TD></TR></TBODY></TABLE>' + echo '</body></html>' +} + +############################################################################### +# +# create_page +# +############################################################################### +create_page () +{ + # always strip off "TAO___" / "CIAO___" + local BASE=$1 + local TYPE=$2 + local EXT="" + local BASE_NAME=${BASE#TAO___} + local BASE_NAME=${BASE#CIAO___} + local TITLE="${TYPE} metrics for ${BASE_NAME//___//}" + + if [ "$TYPE" = "Compilation" ]; then + EXT="txt" + UNITS="100th's of seconds" + else + EXT="size" + UNITS="Bytes" + fi + + # header + echo "<html>" + echo "<head><title>$TITLE</title></head>" + echo '<style><!--' + echo 'body,td,a,p,.h{font-family:arial,sans-serif;}' + echo '.h{font-size: 20px;}' + echo '.q{text-decoration:none; color:#0000cc;}' + echo '//-->' + echo '</style>' + echo '<body text = "#000000" link="#000fff" vlink="#ff0f0f" bgcolor="#ffffff">' + echo "<br><center><h1>$TITLE</h1></center><br>" + if [ -e ".metrics/images/${BASE}_${TYPE}.png" ]; then + echo '<DIV align="center"><P>' + echo "<IMG alt=\"$BASE\" border=0 src=\"images/${BASE}_${TYPE}.png\"" + echo 'width="800" height="600"></P></DIV>' + fi + + echo "<br><hr><br>" + echo "<center><h2>Detail (${DATE})</h2></center>" + + echo '<TABLE border="2"><TBODY><TR><TD rowspan=2><b>Object</b></TD>' + echo '<TD colspan="3" align=center><b>Last Compile</b></TD></TR>' + echo "<TR><TD align=center><b>Date</b></TD><TD align=center><b>$UNITS</b></TD>" + echo '<TD align=center><b>%chg</b></TD></TR>' + while read i; do + if [ -e ".metrics/data/${i}.${EXT}" ]; then + LAST=0 PRE=0 VAL_TMP=0 VAL_INT=0 VAL_SIGN="+" + echo '<TR><TD>' + if [ -e ".metrics/${i}_${TYPE}.html" ]; then + # strip off "TAO___" if it exists + NAME=${i#TAO___} + # strip off "CIAO___" if it exists + NAME=${i#CIAO___} + echo "<a href=\"${i}_${TYPE}.html\">${NAME//___//}</a>" + elif [ -e ".metrics/images/${i}_${TYPE}.png" ]; then + # since you'll only have images if it's a composite, strip off the + # path for the name + if [ "$TYPE" = "Footprint" ]; then + # if we are doing footprint, add library + llib=`grep -e "lib.*\.a" .metrics/size_composites.txt | grep ${i} | awk '{print $1}'` + #echo "lib $llib" + #llib="${llib% :}" + llib="${llib//___//}" + NAME="${llib}(${i##*___})" + else + NAME="${i##*___}" + fi + echo "<a href=\"images/${i}_${TYPE}.png\">${NAME}</a>" + else + echo "${i##*___}" + fi + echo '</TD><TD>' + echo `tail -n1 .metrics/data/${i}.${EXT} | cut -d" " -f1` + let LAST=`tail -n1 .metrics/data/${i}.${EXT} | cut -d" " -f2` + echo "</TD><TD align=right>$LAST</TD>" + let PRE=`tail -n2 .metrics/data/${i}.${EXT} | head -n1 | cut -d" " -f2` + let VAL_TMP="((($LAST+1)-($PRE+1))*1000)/($PRE+1)" + if [ $VAL_TMP -lt 0 ]; then + VAL_SIGN="-" + let VAL_TMP="-1*$VAL_TMP" + elif [ $VAL_TMP -eq 0 ]; then + VAL_SIGN= + fi + let VAL_INT="$VAL_TMP/10" + let VAL_TENTH="$VAL_TMP-($VAL_INT*10)" + echo "<TD align=right>${VAL_SIGN}${VAL_INT}.${VAL_TENTH}</TD></TR>" + else + echo '<TR><TD>' + echo "${i}" + echo '</TD><TD>' + echo '?' + echo "</TD><TD align=right>?</TD>" + echo "<TD align=right>?</TD></TR>" + fi + done # for + echo '</TBODY></TABLE>' + + # footer + echo '</body></html>' + +} + +############################################################################### +# +# sort_list +# +############################################################################### +sort_list () +{ + # sort the dependency files + if [ -e .metrics/tmp_list ]; then + rm .metrics/tmp_list + fi + + touch .metrics/tmp_list + for i in $@; do + echo "$i" >> .metrics/tmp_list + #echo $i + done + + # sort eats underscores, soo... + sed "s/___/000/g" .metrics/tmp_list | sort -f | sed "s/000/___/g" +} + +############################################################################### +# +# create_html +# +############################################################################### +create_html () +{ + echo "create_html()" + + local DEST=$1 + local TYPE=$2 + local ALL_BASE="" + local ACE_OBJS="" + local TAO_OBJS="" + local CIAO_OBJS="" + + while read base colon files; do + # create individual page for app/lib + + sort_list ${files} | create_page ${base} ${TYPE} \ + > .metrics/${base}_${TYPE}.html + cp .metrics/${base}_${TYPE}.html $DEST/${base}_${TYPE}.html + if [ "${base}" != "${base#TAO___CIAO}" ]; then + CIAO_OBJS="${CIAO_OBJS} ${base}" + elif [ "${base}" != "${base#TAO}" ]; then + TAO_OBJS="${TAO_OBJS} ${base}" + else + ACE_OBJS="${ACE_OBJS} ${base}" + fi + ALL_OBJS="${ALL_BASE} ${base}" + done + + # create main page + create_index_page ${TYPE} > .metrics/index.html + cp .metrics/index.html ${DEST}/index.html + + if [ "${TYPE}" = "Compilation" ] || [ "${TYPE}" = "Footprint" ]; then + if [ $BASE_TITLE = $DEFAULT_TITLE ]; then + name="ace_${TYPE}.html" + sort_list ${ACE_OBJS} | create_page "ACE" ${TYPE} > .metrics/${name} + cp .metrics/${name} ${DEST}/${name} + + name="tao_${TYPE}.html" + sort_list ${TAO_OBJS} | create_page "TAO" ${TYPE} > .metrics/${name} + cp .metrics/${name} ${DEST}/${name} + + name="ciao_${TYPE}.html" + sort_list ${CIAO_OBJS} | create_page "CIAO" ${TYPE} > .metrics/${name} + cp .metrics/${name} ${DEST}/${name} + else + name="all_${TYPE}.html" + sort_list ${ACE_OBJS} | create_page $BASE_TITLE ${TYPE} > .metrics/${name} + cp .metrics/${name} ${DEST}/${name} + fi + fi +} + +############################################################################### +# +# main program +# +############################################################################### + +INFILE="" +DEST="" +TARGETS="" +DATE="" +METRIC="Compilation" +FUDGE_FACTOR=0 +BASE_ROOT=$ACE_ROOT +DEFAULT_TITLE=ACE+TAO+CIAO +BASE_TITLE=$DEFAULT_TITLE +COMPILER="gcc" + +parse $@ +create_dirs ".metrics/" +create_dirs "$DEST/" + +if [ "$METRIC" = "Compilation" ]; then + + ######################################################## + # compile times + + # grab the compile time metrics for objects only and process them + grep "compile time(0):" $INFILE | grep "\.o" | cut -d' ' -f3,4,5 | process_file + + # Create .metrics/composites.txt with entries like this: + # tests___OS_Test : tests___OS_Test.o tests___Main.o + create_composite_list $TARGETS + + # compile times + cat .metrics/composites.txt | rollup_compile_times + find .metrics/data/ -name "*.txt" | create_images $DEST "Compilation" + cat .metrics/composites.txt | create_html $DEST "Compilation" + +elif [ "$METRIC" = "Footprint" ]; then + + ######################################################## + # footprint + + # Create .metrics/libraries.txt with entries like this: + # ace___libACE.a + create_library_list $TARGETS + + # Create .metrics/composites.txt with entries like this: + # tests___OS_Test : tests___OS_Test.o tests___Main.o + create_composite_list $TARGETS + + # Run size on the executables and append results to *.size file. + cat .metrics/composites.txt | footprint + + # Run size on the libraries and append results to *.size for the + # library and each contained object. + # It also creates .metrics/size_composites.txt based on size output for + # libraries with entries like this: + # ace___libACE.a : ace___ACE.o ace___Addr.o + cat .metrics/libraries.txt | footprint LIB + + # Add executables to .metrics/size_composites.txt based on output + # from the map files (created with LDFLAGS=-Xlinker -M -Xlinker + # -Map -Xlinker $(@).map). Find the map files of we want based on + # entries in .metrics/composites.txt. + cat .metrics/composites.txt | create_size_composites + + find .metrics/data/ -name "*.size" | create_images $DEST "Footprint" + cat .metrics/size_composites.txt | create_html $DEST "Footprint" + +else + echo "metric type ($METRIC) not recognized" + usage +fi diff --git a/ACE/bin/generate_doxygen.pl b/ACE/bin/generate_doxygen.pl new file mode 100755 index 00000000000..86f7fabf9a1 --- /dev/null +++ b/ACE/bin/generate_doxygen.pl @@ -0,0 +1,317 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# -*- perl -*- +# $Id$ +# + +require POSIX; +require File::Path; + +use Cwd; +use File::Spec; +use Env qw(ACE_ROOT TAO_ROOT CIAO_ROOT DDS_ROOT); + +# Configuration and default values + +if (!defined $TAO_ROOT) { + $TAO_ROOT = "$ACE_ROOT/TAO"; +} +if (!defined $CIAO_ROOT) { + $CIAO_ROOT = "$TAO_ROOT/CIAO"; +} + +$is_release = 0; +$exclude_ace = 0; +$exclude_tao = !-r "$TAO_ROOT/VERSION"; +$exclude_ciao = !-r "$CIAO_ROOT/VERSION"; +$verbose = 0; +$perl_path = '/usr/bin/perl'; +$html_output_dir = '.'; + +$dds = 0; +if (defined $DDS_ROOT && -r "$DDS_ROOT/VERSION") { + $dds_path = Cwd::abs_path($DDS_ROOT); + $cwd_path = Cwd::abs_path(getcwd()); + if ($dds_path eq $cwd_path) { + $dds = $exclude_ace = $exclude_tao = $exclude_ciao = 1; + } +} + +@ACE_DOCS = ('ace', + 'ace_man', + 'ace_rmcast', + 'ace_ssl', + 'ace_qos', + 'acexml'); +@TAO_DOCS = ('tao' + ,'tao_anytypecode' + ,'tao_portableserver' + ,'tao_pi' + ,'tao_pi_server' + ,'tao_rtportableserver' + ,'tao_compression' + ,'tao_transportcurrent' + ,'tao_rtcorba' + ,'tao_dynamicany' + ,'tao_dynamicinterface' + ,'tao_iormanip' + ,'tao_iortable' + ,'tao_esf' + ,'tao_rtevent' + ,'tao_cosevent' + ,'tao_cosnotification' + ,'tao_implrepo' + ,'tao_strategies' + ,'tao_smartproxies' + ,'tao_av' + ,'tao_security' + ,'tao_ssliop' + ,'tao_cosnaming' + ,'tao_costime' + ,'tao_costrader' + ,'tao_portablegroup' + ,'tao_pss' + ,'tao_ifr'); +@CIAO_DOCS = ('ciao_config_handlers' + ,'ciao_DAnCE' + ,'ciao'); + +# Modify defaults using the command line arguments +&parse_args (); + +$wrote_configh = 0; +if (!-r "$ACE_ROOT/ace/config.h") { + open(CONFIG_H, ">$ACE_ROOT/ace/config.h") + || die "Cannot create config file\n"; + print CONFIG_H "#include \"ace/config-doxygen.h\"\n"; + close(CONFIG_H); + $wrote_configh = 1; +} + +&generate_doxy_files ('ACE', "$ACE_ROOT/VERSION", @ACE_DOCS) if (!$exclude_ace); +&generate_doxy_files ('TAO', "$TAO_ROOT/VERSION", @TAO_DOCS) if (!$exclude_tao); +&generate_doxy_files ('CIAO',"$CIAO_ROOT/VERSION", @CIAO_DOCS) if (!$exclude_ciao); +&generate_doxy_files ('DDS', "$DDS_ROOT/VERSION", ('dds')) if $dds; + +unlink "$ACE_ROOT/ace/config.h" if $wrote_configh; + +exit 0; + +sub parse_args { + my @ARGS = (); + while ($#ARGV >= 0) { + if (!($ARGV[0] =~ m/^-/)) { + push @ARGS, $ARGV[0]; + } elsif ($ARGV[0] eq "-is_release") { + $is_release = 1; + } elsif ($ARGV[0] eq "-exclude_ace") { + $exclude_ace = 1; + } elsif ($ARGV[0] eq "-exclude_tao") { + $exclude_tao = 1; + } elsif ($ARGV[0] eq "-exclude_ciao") { + $exclude_ciao = 1; + } elsif ($ARGV[0] eq "-include_dds") { + $dds = 1; + } elsif ($ARGV[0] eq "-verbose") { + $verbose = 1; + } elsif ($ARGV[0] eq "-perl_path" && $#ARGV >= 1) { + $perl_path = $ARGV[1]; + shift; + } elsif ($ARGV[0] eq "-html_output" && $#ARGV >= 1) { + $html_output_dir = $ARGV[1]; + shift; + } else { + print "Ignoring option $ARGV[0]\n"; + } + shift @ARGV; + } + @ARGV = @ARGS; +} + +#is $arg1 the same path as "$arg2/$arg3"? +sub same_dir { + my $lhs = shift; + my $rhs_base = shift; + my $rhs_dir = shift; + my $rhs = File::Spec->catdir($rhs_base, $rhs_dir); + return File::Spec->canonpath($lhs) eq File::Spec->canonpath($rhs); +} + +sub generate_doxy_files { + + my $KIT = shift; + my $VERSION_FILE = shift; + my @DOCS = @_; + + my $VERSION = 'Snapshot ('. + POSIX::strftime("%Y/%m/%d-%H:%M", localtime) + .')'; + + my $KIT_path = ($KIT eq 'CIAO') ? 'TAO/CIAO' : $KIT; + my $translate_paths = + ($KIT eq 'TAO' && !same_dir($TAO_ROOT, $ACE_ROOT, 'TAO')) || + ($KIT eq 'CIAO' && !same_dir($CIAO_ROOT, $TAO_ROOT, 'CIAO')); + + foreach my $i (@DOCS) { + if ($is_release) { + my ($major, $minor, $beta) = &get_versions ($KIT, $VERSION_FILE); + $VERSION = $major.'.'.$minor.'.'.$beta; + } + + my $input = "etc/".$i.".doxygen"; + my $output = "/tmp/".$i.".".$$.".doxygen"; + + open(DOXYINPUT, $input) + || die "Cannot open doxygen input file $input\n"; + open(DOXYOUTPUT, ">$output") + || die "Cannot open doxygen output file $output\n"; + + my $generate_man = 0; + my $generate_html = 0; + my @output_dirs = (); + while (<DOXYINPUT>) { + chomp; + if (/^PROJECT_NUMBER/) { + print DOXYOUTPUT "PROJECT_NUMBER = ", $VERSION, "\n"; + next; + } elsif (/^PERL_PATH /) { + print DOXYOUTPUT "PERL_PATH = $perl_path\n"; + next; + } elsif (/^QUIET / && $verbose) { + print DOXYOUTPUT "QUIET = NO\n"; + next; + } elsif (/^INLINE_SOURCES/ && $is_release) { + print DOXYOUTPUT "INLINE_SOURCES = NO\n"; + next; + } elsif (/^SOURCE_BROWSER/ && $is_release) { + print DOXYOUTPUT "SOURCE_BROWSER = NO\n"; + next; + } elsif (/^VERBATIM_HEADERS/ && $is_release) { + print DOXYOUTPUT "VERBATIM_HEADERS = NO\n"; + next; + } elsif (/^GENERATE_MAN/ && /= YES/) { + $generate_man = 1; + } elsif (/^GENERATE_HTML/ && /= YES/) { + $generate_html = 1; + } elsif ($generate_html && /^HTML_OUTPUT/) { + my @field = split(' = '); + if ($#field >= 1) { + my $html_out_dir = "$html_output_dir/$field[1]"; + push @output_dirs, $html_out_dir; + print DOXYOUTPUT "HTML_OUTPUT = $html_out_dir\n"; + next; + } + } elsif ($generate_html && /^GENERATE_TAGFILE/) { + my @field = split(' = '); + if ($#field >= 1) { + my $html_out_dir = "$html_output_dir/$field[1]"; + print DOXYOUTPUT "GENERATE_TAGFILE = $html_out_dir\n"; + next; + } + } elsif ($generate_html && /^TAGFILES\s*=\s*(.*)$/) { + my $value = $1; + while ($value =~ /\\$/) { + chop $value; #removes trailing \ + my $line = <DOXYINPUT>; + chomp $line; + $value .= ' ' . $line; + } + my @values = split(' ', $value); + map {$_ = $html_output_dir . '/' . $_; } @values; + print DOXYOUTPUT 'TAGFILES = ' . join(' ', @values) . "\n"; + next; + } elsif ($generate_man && /^MAN_OUTPUT/) { + my @field = split(' = '); + if ($#field >= 1) { + push @output_dirs, $field[1]; + } + } elsif ($translate_paths && /^(INPUT|INCLUDE_PATH)\s*=\s*(.*)$/) { + my $keyword = $1; + my $value = $2; + while ($value =~ /\\$/) { + chop $value; #removes trailing \ + my $line = <DOXYINPUT>; + chomp $line; + $value .= ' ' . $line; + } + $value =~ s/$KIT_path/${"${KIT}_ROOT"}/g; + print DOXYOUTPUT "$keyword = $value\n"; + next; + } + + print DOXYOUTPUT $_, "\n"; + } + close (DOXYOUTPUT); + close (DOXYINPUT); + + foreach my $i (@output_dirs) { + File::Path::mkpath($i, 0, 0755); + } + + &run_doxy ($output); + + unlink $output; + } + + if ($generate_man) { + open(FIND, "find man -type f -print |") or die "Can't run find\n"; + while (<FIND>) { + chomp; + my $name_with_whitespace = $_; + next unless ($name_with_whitespace =~ /\s/); + my $name_without_whitespace = $name_with_whitespace; + $name_without_whitespace =~ s/\s+//g; + rename $name_with_whitespace, $name_without_whitespace; + } + close FIND; + } +} + +sub run_doxy { + my $config = shift; + open(DOX,"doxygen $config 2>&1 |") + || die "cannot start ACE doxygen process\n"; + while (<DOX>) { + print $_; + } + close (DOX) + || die "error while running doxygen on $config\n"; +} + +######## +######## Retrieve version information from VERSION file(s). +######## +sub get_versions () { + my $KIT = shift; + my $VERSION_FILE = shift; + my ($major_version, $minor_version, $beta_version); + + open (VERSION, '<'.$VERSION_FILE) || + die "$0: unable to open VERSION\n"; + while (<VERSION>) { + chomp; + if (/$KIT version (\d+)\.(\d+)\.(\d+)/) { + $major_version = $1; + $minor_version = $2; + $beta_version = $3; + last; + } elsif (/$KIT version (\d+)\.(\d+)[^\.]/) { + #### Previous release was a minor. + $major_version = $1; + $minor_version = $2; + $beta_version = '0'; + last; + } elsif (/$KIT version (\d+)[^\.]/) { + #### Previous release was a major. + $major_version = $1; + $minor_version = '0'; + $beta_version = '0'; + last; + } + } + close VERSION; + + return ($major_version, $minor_version, $beta_version); +} diff --git a/ACE/bin/generate_export_file.pl b/ACE/bin/generate_export_file.pl new file mode 100755 index 00000000000..7349f816e4c --- /dev/null +++ b/ACE/bin/generate_export_file.pl @@ -0,0 +1,165 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# Replacement for the old trusty GenExportH.bat +# Creates the nice little *_export file which is used for +# importing and exporting of symbols in DLLs. +# (they are soooo cute!) + +use Getopt::Std; + +############################################################################## +# Grab the options + +$flags = join (" ", @ARGV); + +if (!getopts ('df:hsn') || $opt_h) { + print STDERR + "generate_export_file.pl [-d] [-f dependency] [-n] library_name\n", + "\n", + " -d Turn on debug mode\n", + " -f Adds a dependency to another *_HAS_DLL macro\n", + " -n Do not add in ACE_AS_STATIC_LIBS check\n", + "\n", + "generate_export_file creates the *_export files that are used\n", + "in exporting of symbols for DLLs (and not exporting them when\n", + "the library is static). If library_name is something like\n", + "\"Foo\", then the file will contain definitions for Foo_Export\n", + "and FOO_SINGLETON_DECLARE, etc. which will be controlled by\n", + "FOO_HAS_DLL, etc.\n"; + exit (1); +} + +if (defined $opt_d) { + print STDERR "Debugging Turned on\n"; + + if (defined $opt_f) { + print STDERR "Dependency to $opt_f\n"; + } + + if (defined $opt_n) { + print STDERR "ACE_AS_STATIC_LIBS turned off\n"; + } +} + + +if ($#ARGV < 0) { + print STDERR "No library_name specified, use -h for help\n"; + exit (1); +} + +$name = shift @ARGV; +$ucname = uc $name; + +############################################################################## +# Prologue + +$prologue = ' +// -*- C++ -*- +// ' . '$' . 'Id' . '$ +// Definition for Win32 Export directives. +// This file is generated automatically by generate_export_file.pl '."$flags".' +// ------------------------------'." +#ifndef -UC-_EXPORT_H +#define -UC-_EXPORT_H + +#include \"ace/config-all.h\" +"; + + +############################################################################## +# Static Stuff + +if (!defined $opt_n) +{ + $static_stuff = " +#if defined (ACE_AS_STATIC_LIBS) && !defined (-UC-_HAS_DLL) +# define -UC-_HAS_DLL 0 +#endif /* ACE_AS_STATIC_LIBS && -UC-_HAS_DLL */ +"; +} + +############################################################################## +# Dependencies + +if (defined $opt_f) +{ + $has_dll = " +#if defined ($opt_f) +# if !defined (-UC-_HAS_DLL) +# define -UC-_HAS_DLL 0 +# endif /* ! -UC-_HAS_DLL */ +#else +# if !defined (-UC-_HAS_DLL) +# define -UC-_HAS_DLL 1 +# endif /* ! -UC-_HAS_DLL */ +#endif +"; +} +else +{ + $has_dll = " +#if !defined (-UC-_HAS_DLL) +# define -UC-_HAS_DLL 1 +#endif /* ! -UC-_HAS_DLL */ +"; +} + +############################################################################## +# Epilogue + +$epilogue = " +#if defined (-UC-_HAS_DLL) && (-UC-_HAS_DLL == 1) +# if defined (-UC-_BUILD_DLL) +# define -NC-_Export ACE_Proper_Export_Flag +# define -UC-_SINGLETON_DECLARATION(T) ACE_EXPORT_SINGLETON_DECLARATION (T) +# define -UC-_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_EXPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# else /* -UC-_BUILD_DLL */ +# define -NC-_Export ACE_Proper_Import_Flag +# define -UC-_SINGLETON_DECLARATION(T) ACE_IMPORT_SINGLETON_DECLARATION (T) +# define -UC-_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) ACE_IMPORT_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +# endif /* -UC-_BUILD_DLL */ +#else /* -UC-_HAS_DLL == 1 */ +# define -NC-_Export +# define -UC-_SINGLETON_DECLARATION(T) +# define -UC-_SINGLETON_DECLARE(SINGLETON_TYPE, CLASS, LOCK) +#endif /* -UC-_HAS_DLL == 1 */ + +// Set -UC-_NTRACE = 0 to turn on library specific tracing even if +// tracing is turned off for ACE. +#if !defined (-UC-_NTRACE) +# if (ACE_NTRACE == 1) +# define -UC-_NTRACE 1 +# else /* (ACE_NTRACE == 1) */ +# define -UC-_NTRACE 0 +# endif /* (ACE_NTRACE == 1) */ +#endif /* !-UC-_NTRACE */ + +#if (-UC-_NTRACE == 1) +# define -UC-_TRACE(X) +#else /* (-UC-_NTRACE == 1) */ +# if !defined (ACE_HAS_TRACE) +# define ACE_HAS_TRACE +# endif /* ACE_HAS_TRACE */ +# define -UC-_TRACE(X) ACE_TRACE_IMPL(X) +# include \"ace/Trace.h\" +#endif /* (-UC-_NTRACE == 1) */ + +#endif /* -UC-_EXPORT_H */ + +// End of auto generated file. +"; + +############################################################################## +# Print the stuff out + +foreach $export ($prologue, $static_stuff, $has_dll, $epilogue) +{ +## -NC- stands for normal case, the name as it is +## -UC- stands for the name all upper case + map { s/-NC-/$name/g; s/-UC-/$ucname/g; } $export; + + print $export; +}; diff --git a/ACE/bin/generate_footprint_chart.sh b/ACE/bin/generate_footprint_chart.sh new file mode 100755 index 00000000000..49b783dde0a --- /dev/null +++ b/ACE/bin/generate_footprint_chart.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $Id$ +# + +gnuplot <<_EOF_ >/dev/null 2>&1 + set xdata time + set timefmt '%Y/%m/%d-%H:%M' + set xlabel 'Date (MM/DD)' + set ylabel 'Size (KBytes)' + set terminal png small size 800,600 color + set output "$2" + plot '$1' using 1:(\$2/1024.0) title '$3' w l + exit +_EOF_ + diff --git a/ACE/bin/generate_performance_chart.sh b/ACE/bin/generate_performance_chart.sh new file mode 100755 index 00000000000..ebff5f13c96 --- /dev/null +++ b/ACE/bin/generate_performance_chart.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $Id$ +# + +gnuplot <<_EOF_ >/dev/null 2>&1 + set xdata time + set timefmt '%Y/%m/%d-%H:%M' + set xlabel 'Date (YYYYMMDD)' + set ylabel 'Throughput (Requests/Second)' + set terminal png small size 800,600 color + set yrange [4000:25000] + set output "$2" + plot '$1' using 1:2 title '$3' w l + exit +_EOF_ diff --git a/ACE/bin/generate_rel_manpages b/ACE/bin/generate_rel_manpages new file mode 100755 index 00000000000..4183691e5f8 --- /dev/null +++ b/ACE/bin/generate_rel_manpages @@ -0,0 +1,121 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ + +use strict; +require Cwd; + + +########### +###### Sanity Checks +########## +my $hostname; +chomp ($hostname = $ENV{'HOSTNAME'} || `uname -n`); +unless ("$hostname" eq 'naboo') { + #### For efficiency sake . . . + die "$0: must run on host naboo.dre.vanderbilt.edu\n"; +} +my $perl_path = '/usr/bin/perl'; + +my $status= 0; + +&can_run($perl_path.' -V') || + die "$0: perl path is incorrect, please fix the script\n"; + +my $doxy_path = '/usr/bin'; + +my $doxy_version = '1.5.3'; + +&can_run($doxy_path.'/doxygen --version | grep '.$doxy_version.' >/dev/null') || + die "$0: doxygen path or version incorrect, please fix the script\n"; + +$ENV{'PATH'} = $ENV{'PATH'}.':'.$doxy_path; + + + +print "Starting doxygen document generation \n"; + +my $chgrp = 'chgrp'; +my $cpio = 'cpio'; +my $date = 'date'; +my $egrep = 'egrep'; +my $find = 'find'; +my $gzip = 'gzip'; +my $bzip = 'bzip2'; +my $make = 'make -f Release -s'; +my $mv = 'mv -f'; +my $scp = 'scp '; +my $rm = 'rm -f'; +my $cp = 'cp -f'; +my $md5sum = 'md5sum'; +my $shell_cd = 'cd'; +my $cksum_ext = 'md5'; +my $redirect = '>'; +my $checksum = '$md5sum'; + +$SIG{'HUP'} = $SIG{'INT'} = $SIG{'QUIT'} = $SIG{'TERM'} = 'cleanup'; + +my $release_filter = '\\( -name .svn -o -name build \\) -prune -o ' . + '! -name \'.\#*\' ! -name \'\#*\' ! -name \'*~\' ' . + '! -name \'*.MAK\' -print'; + +my $bin_files = + "\"\\.mak|\\.mdp|\\.ide|\\.exe\|\\.ico\|\\.gz\|\\.zip\|" . + "\\.gif|\\.vcp|\\.vcproj|\\.vcw|\\.sln\""; + +my $dest = 'bczar@download.dre.vanderbilt.edu:/export/www/download.dre/ACE+TAO-distribution'; +my $release_files = ''; + +chomp ($release_files = `$make show_release_files`); + +######## +######## Main execution thread. +######## +&ex ("bin/generate_doxygen.pl -is_release -perl_path $perl_path") + && die "$0: failed to generate ACE man pages\n"; + +my $build_command = + "$find ./html $release_filter | $cpio -o -H tar | " . + "$gzip -9 > ACE-html.tar.gz && ". + "$find ./html $release_filter | $cpio -o -H tar | " . + "$bzip -9 > ACE-html.tar.bz2 && ". + "$find ./html $release_filter | $egrep -v $bin_files | " . + "zip ACE-html.zip -q9@ &&" . + "md5sum ACE-html.tar.gz > ACE-html.tar.gz.md5 &&" . + "md5sum ACE-html.tar.bz2 > ACE-html.tar.bz2.md5 &&" . + "md5sum ACE-html.zip > ACE-html.zip.md5 &&" . + "$scp ACE-html.tar.gz ACE-html.tar.bz2 ACE-html.zip ACE-html.tar.gz.md5 ACE-html.tar.bz2.md5 ACE-html.zip.md5 $dest;"; + +&ex ($build_command) + && die "$0: failed to move ACE man pages to $dest\n"; + +exit $status; + + +######## +######## Verify that a command can be executed, return 1 on sucess +######## +sub can_run { + my $command = shift; + + open (RUN, "$command 2>&1 |") + || return 0; + while (<RUN>) {} + close(RUN) + || return 0; + return 1; +} + +######## +######## Execute a command, unless -n had been specified. Return value +######## of 0 indicates success. +######## +sub ex () +{ + my ($command) = @_; + + print "Command is $command \n"; + system ("$command"); +} diff --git a/ACE/bin/generate_topinfo_charts.sh b/ACE/bin/generate_topinfo_charts.sh new file mode 100755 index 00000000000..09e2f0a1f51 --- /dev/null +++ b/ACE/bin/generate_topinfo_charts.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# +# $Id$ +# + +gnuplot <<_EOF_ >/dev/null 2>&1 + set xdata time + set timefmt '%Y/%m/%d-%H:%M' + set xlabel 'Date (MM/DD)' + set ylabel 'Size (KBytes) $4' + set terminal png small size 800,600 color + set output "$2" + plot '$1' using 1:2 title '$3' w l + exit +_EOF_ + diff --git a/ACE/bin/indent_macros.pl b/ACE/bin/indent_macros.pl new file mode 100755 index 00000000000..3429d746dba --- /dev/null +++ b/ACE/bin/indent_macros.pl @@ -0,0 +1,59 @@ +eval '(exit $?0)' && eval 'exec perl -i -S $0 ${1+"$@"}' + & eval 'exec perl -i -S $0 $argv:q' + if 0; + +# $Id$ + +# This perl script re-arrange the macro indentation so it's easier to +# see the layering relationship. + +$lineno = 0; +$indent = 0; + +sub inc_indent +{ + $indent += 2; +} + +sub dec_indent +{ + $indent -= 2; +} + +sub get_indent +{ + $retv = 0; + print STDERR "$0 (", $lineno, "): Unbalanced macro pairs\n" if ($indent < 0); + $retv = $indent - 1 if ($indent > 0); + $retv; +} + +while (<>) { + $lineno++; + if (/^[ \t]*\#[ \t]*((if|el|en|).*)/) + { + $cont = $1; + $temp = $2; + if ($temp =~ /if/) { + print "#", " " x &get_indent (), $cont,"\n"; + inc_indent (); + } + elsif ($temp =~ /el/) { + dec_indent (); + print "#", " " x &get_indent (), $cont,"\n"; + inc_indent (); + } + elsif ($temp =~ /en/) { + dec_indent (); + print "#", " " x &get_indent (), $cont,"\n"; + } + else { + print "#", " " x &get_indent (), $cont,"\n"; + } + } + else { + print $_; + } +} + +die ("$0 (EOF): Unbalanced macro pairs\n") if ($indent != 0); diff --git a/ACE/bin/libsize.pl b/ACE/bin/libsize.pl new file mode 100755 index 00000000000..3fd3a468b10 --- /dev/null +++ b/ACE/bin/libsize.pl @@ -0,0 +1,192 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# +# Provides size breakdown of ACE, TAO, or orbsvcs libs. +# +# Assumes (or builds) the lib with debug=0. Allows other make args, +# such as -j 4, to be passed on the command line. + +$usage = + "$0 [-h, for html output] [-s, for shared libs] [-v] [make arguments]\n"; + +#### +#### Configuration parameters. +#### +$build_args = + 'debug=0 optimize=1 static_libs_only=1 DEFFLAGS=-DACE_USE_RCSID=0'; +$ACE_COMPONENTS = + 'OS Utils Logging Threads Demux Connection Sockets IPC Svcconf ' . + 'Streams Memory Token Other'; +$TAO_COMPONENTS = + 'POA Pluggable_Protocols Default_Resources Interpretive_Marshaling ' . + 'IDL_Compiler ORB_Core Dynamic_Any'; +$ORBSVCS_COMPONENTS = + 'Naming ImplRepo Time Concurrency Property Trader LifeCycle Sched ' . + 'Event CosEvent Event2 AV'; + + +#### The following are only used for VxWorks libraries, and +#### only if the corresponding environment variable isn't set. +$default_toolenv = '386'; +$default_wind_base = '/project/doc/pkg/wind'; +$default_host_type = 'sun4-solaris2'; + +#### Use gmake if it's on the user's PATH, otherwise use make. Use +#### sh -c to avoid warning if gmake isn't found. +$make = + system ("sh -c \"gmake --version\" > /dev/null 2>&1") ? 'make' : 'gmake'; + +$ACE_ROOT = $ENV{'ACE_ROOT'} || + die "$0: ACE_ROOT was not set!\n"; + + +$html = $verbose = 0; +$lib_extension = 'a'; + +#### +#### Process command line args. +#### +while ($#ARGV >= $[ && $ARGV[0] =~ /^-/) { + if ($ARGV[0] eq '-h') { + $html = 1; + chop ($sysname = `uname -s`); + chop ($sysrev = `uname -r`); + shift; + } elsif ($ARGV[0] eq '-s') { + $lib_extension = 'so'; + $build_args =~ s/ static_libs_only=1//; + shift; + } elsif ($ARGV[0] eq '-v') { + $verbose = 1; + shift; + } elsif ($ARGV[0] eq '-?') { + print "$usage"; + exit; + } else { + #### Pass remaining args to make. + } +} + +$make_args = join (' ', @ARGV) . $build_args; + +chop ($pwd = `pwd`); + +if ($pwd =~ m%/ace$%) { + #### libACE + $COMPONENTS = "$ACE_COMPONENTS"; + $LIB_COMPONENTS = 'ACE_COMPONENTS'; + $libname = 'ACE'; +} elsif ($pwd =~ m%/tao$%) { + $COMPONENTS = "$TAO_COMPONENTS"; + $LIB_COMPONENTS = 'TAO_COMPONENTS'; + $libname = 'TAO'; +} elsif ($pwd =~ m%/orbsvcs/orbsvcs$%) { + $COMPONENTS = "$ORBSVCS_COMPONENTS"; + $LIB_COMPONENTS = 'TAO_ORBSVCS'; + $libname = 'orbsvcs'; +} else { + die "$0: unsupported directory; $pwd\n"; +} + +$lib = "lib${libname}.$lib_extension"; + + +#### +#### Select the size command based on ACE_ROOT setting. +#### +if ($ACE_ROOT =~ /vxworks/) { + $TOOLENV = $ENV{'TOOLENV'} || $default_toolenv; + $WIND_BASE = $ENV{'WIND_BASE'} || $default_wind_base; + $WIND_HOST_TYPE = $ENV{'WIND_HOST_TYPE'} || $default_host_type; + $size = "$WIND_BASE/host/$WIND_HOST_TYPE/bin/size$TOOLENV"; +} elsif ($ACE_ROOT =~ /lynx-ppc/) { + $size = '/usr/lynx/3.0.0/ppc/cdk/sunos-xcoff-ppc/bin/size'; +} elsif ($ACE_ROOT =~ /lynx/) { + $size = '/usr/lynx/3.0.0/x86/cdk/sunos-coff-x86/bin/size'; +} elsif ($ACE_ROOT =~ /chorus/) { + $size = '/project/doc/mvme/green68k/gnu/bin/size'; +} else { + $size = 'size'; +} + + +#### +#### Measure the size of the entire library. +#### +$sizeTotal = build_lib ("$LIB_COMPONENTS=\"$COMPONENTS\""); +$components = " <th>Platform\n <th>Component\n <th>Total"; +$componentSize = " <th>Size, bytes\n <td align=center>$sizeTotal"; +$componentPercentage = + " <th>Percentage of<br>total size\n <td align=center>100"; +print "Total $sizeTotal (100)\n" unless $html; + + +#### +#### Measure the size of each library component. +#### +foreach my $i (split (' ', $COMPONENTS)) { + $sizeLib = build_lib ("$LIB_COMPONENTS=\"$i\""); + $components .= "\n <th>$i"; + $componentSize .= "\n <td align=center>$sizeLib"; + $thisPercentage = percentage ($sizeLib, $sizeTotal); + $componentPercentage .= "\n <td align=center>$thisPercentage"; + print "$i $sizeLib ($thisPercentage)\n" unless $html; +} + +#### +#### Produce HTML output, if requested. +#### +if ($html) { + print '<center><table cellpadding=4 border=4>' . "\n"; + print ' <tr>' . "\n"; + print "$echoArgs $components\n"; + print ' <tr>' . "\n"; + print " <th rowspan=2>$sysname $sysrev $ACE_ROOT\n"; + print "$echoArgs $componentSize\n"; + print ' <tr>' . "\n"; + print "$echoArgs $componentPercentage\n"; + print '</table></center><p>' . "\n"; +} + + +#### +#### Build library with componnents specified in argument. +#### +sub build_lib () +{ + my ($lib_components) = @_; + + unlink "$lib"; + + print "$make $make_args $lib_components\n" if $verbose; + + system ("$make $make_args $lib_components >> make.log 2>&1") && + die "$0: command failed; $make $make_args $lib_components\n"; + + my $libSize = 0; + + open (SIZE, "$size $lib |") || + die "$0: unable to open $size\n"; + while (<SIZE>) { + my (@field) = split; + $libSize += $field[3] if $field[3] =~ /\d/; #### Skip size header line. + } + close (SIZE); + + $libSize; +} + + +#### +#### Return percentage of first argument as fraction of second. +#### Returns a string with two-decimal place precision. +#### +sub percentage () +{ + my ($size, $total) = @_; + + sprintf ("%.2f", $size * 100 / $total); +} diff --git a/ACE/bin/main2TMAIN.pl b/ACE/bin/main2TMAIN.pl new file mode 100755 index 00000000000..bbbb558194b --- /dev/null +++ b/ACE/bin/main2TMAIN.pl @@ -0,0 +1,16 @@ +eval '(exit $?0)' && eval 'exec perl -pi -S $0 ${1+"$@"}' + & eval 'exec perl -pi -S $0 $argv:q' + if 0; + +# $Id$ +# +# You may want to run the "find" command with this script, which maybe +# something like this: +# +# find . -type f \( -name "*.C" -o -name "*.cc" -o -name "*.c" -o -name "*.cpp" \) -print | xargs $ACE_ROOT/bin/auto_ptr.perl + +# The first three lines above let this script run without specifying the +# full path to perl, as long as it is in the user's PATH. +# Taken from perlrun man page. + +s/main( *\(int[ A-Za-z]*, *ACE_TCHAR)/ACE_TMAIN$1/g; diff --git a/ACE/bin/make-components b/ACE/bin/make-components new file mode 100755 index 00000000000..a2b9c782807 --- /dev/null +++ b/ACE/bin/make-components @@ -0,0 +1,17 @@ +#! /bin/sh +# $Id$ + +# Allow each ACE component to be built in a simple way, as follows: +# +# $ACE_ROOT/bin/make-components "your flags" +# +# to build libACE.$(SOEXT), libACE_OS.$(SOEXT), etc. + +flags="$*" +cd $ACE_ROOT/ace +make $flags +for component in `cat $ACE_ROOT/ace/ACE_COMPONENTS.list` +do + make $flags LIBACE=libACE_$component ACE_COMPONENTS=$component +done +exit 0 diff --git a/ACE/bin/make_release.py b/ACE/bin/make_release.py new file mode 100755 index 00000000000..a4f7f74ea52 --- /dev/null +++ b/ACE/bin/make_release.py @@ -0,0 +1,815 @@ +#!/usr/local/bin/python2.5 + +# @file make_release.py +# @author William R. Otte <wotte@dre.vanderbilt.edu> +# +# Packaging script for ACE/TAO/CIAO + +from __future__ import with_statement +from time import strftime +import pysvn +import re + +################################################## +#### Global variables +################################################## +""" Options from the command line """ +opts=None + +""" Arguments from the command line """ +args=None + +""" Absolute path from the SVN workspace to be used for the +release""" +doc_root=None + +""" Full name of person performing release, obtained from the +environment""" +signature=None + +""" Full email address of person performing release. """ +mailid = None + +""" A dict containing version information used for the release. +This dict contains entries of the form +COMPONENT_version +COMPONENT_beta +COMPONENT_minor +COMPONENT_major """ +comp_versions = dict () + +release_date = strftime (# ie: Mon Jan 23 00:35:37 CST 2006 + "%a %b %d %H:%M:%S %Z %Y") + +# Packaging configuration + +""" This is a regex that detects files that SHOULD NOT have line endings +converted to CRLF when being put into a ZIP file """ +bin_regex = re.compile ("\.(mak|mdp|ide|exe|ico|gz|zip|xls|sxd|gif|vcp|vcproj|vcw|sln|dfm|jpg|png|vsd|bz2)$") + + +################################################## +#### SVN Client Hooks +################################################## +svn_auth_info = None +def svn_login_callback (realm, username, may_save): + """ Callback used by the SVN library to obtain login credentials""" + global svn_auth_info + if svn_auth_info is None: + print "Please enter your Subversion login credentials. They will be saved for the duration of this script." + username = raw_input ("Username: ") + password = raw_input ("Password: ") + + svn_auth_info = (True, username, password, False) + + return svn_autn_info + +def svn_log_message_callback (): + """ Callback used by the svn library to generate log messages + for operations such as copy """ + return (True, "ChangeLogTag:%s %s <%s>" % (release_date, signature, mailid)) + +svn_client = pysvn.Client () +svn_client.callback_get_login = svn_login_callback +svn_client.callback_get_log_message = svn_log_message_callback + +################################################## +#### Utility Methods +################################################## +def parse_args (): + from optparse import OptionParser + + parser = OptionParser ("usage %prog [options]") + + parser.add_option ("--major", dest="release_type", action="store_const", + help="Create a major release.", default=None, const="major") + parser.add_option ("--minor", dest="release_type", action="store_const", + help="Create a minor release.", default=None, const="minor") + parser.add_option ("--beta", dest="release_type", action="store_const", + help="Create a beta release.", default=None, const="beta") + + + parser.add_option ("--tag", dest="action", action="store_const", + help="Tag the release. DO NOT USE WITH --kit", default=None, const="tag") + parser.add_option ("--update", dest="update", action="store_true", + help="Update the version numbers, only used with --tag", default=False) + + + parser.add_option ("--kit", dest="action", action="store_const", + help="Create kits. DO NOT USE WITH --tag", default=None, const="kit") + parser.add_option ("--dest", dest="package_dir", action="store", + help="Specify destination for the created packages.", default=None) + + parser.add_option ("--root", dest="repo_root", action="store", + help="Specify an alternate repository root", + default="https://svn.dre.vanderbilt.edu/DOC/") + + parser.add_option ("-n", dest="take_action", action="store_false", + help="Take no action", default=True) + parser.add_option ("--verbose", dest="verbose", action="store_true", + help="Print out actions as they are being performed", + default=False) + parser.add_option ("--override-host", dest="override_host", action="store_true", + help="Override the default release host. Not reccomended", default=False) + (options, arguments) = parser.parse_args () + + if options.action is None: + parser.error ("Must specify an action, ie --tag or --kit") + + if options.action == "tag": + if options.release_type is None: + parser.error ("When tagging, must specify a release type") + + if options.update is False: + print "Warning: You are tagging a release, but not requesting a version increment" + + return (options, arguments) + + +def ex (command): + from os import system + global opts + vprint ("Executing " + command) + + if not opts.take_action: + print "Executing " + command + return + + status = system(command) + if status != 0: + print "ERROR: Nonzero retrun value from " + command + raise Exception + +### +# Checks that the users environment is sane. +# +def check_environment (): + from os import getenv + + global doc_root, signature, mailid, opts + + doc_root = getenv ("DOC_ROOT") + if (doc_root is None): + print "ERROR: Environment DOC_ROOT must be defined." + return False + + signature = getenv ("SIGNATURE") + if (signature is None): + print "ERROR: Must define SIGNATURE environment variable to your full name, used in changelogs." + return False + + mailid = getenv ("MAILID") + if (mailid is None): + print "ERROR: Must define MAILID environment to your email address for changelogs." + return False + + from socket import gethostname + + if ((not opts.override_host) and gethostname () != "anduril.dre.vanderbilt.edu"): + print "ERROR: Must run script on anduril.dre.vanderbilt.edu" + return False + + return True + +def vprint (string): + """ Prints the supplied message if verbose is enabled""" + global opts + + if opts.verbose: + print string + +################################################## +#### Tagging methods +################################################## +def commit (files): + """ Commits the supplied list of files to the repository. """ + vprint ("Committing the following files: " + " ".join (files)) + + rev = svn_client.checkin (files, + "ChangeLogTag:%s %s <%s>" % (release_date, signature, mailid)) + + print "Checked in files, resuling in revision ", rev.number + +def check_workspace (): + """ Checks that the DOC and MPC repositories are up to date. """ + global opts, doc_root, svn_client + # @@TODO: Replace with a svn library + try: + rev = svn_client.update (doc_root) + print "Successfully updated ACE/TAO/CIAO working copy to revision " + except: + print "Unable to update ACE/TAO/CIAO workspace at " + doc_root + raise + + try: + rev = svn_client.update (doc_root + "ACE/MPC") + print "Successfully updated MPC working copy to revision " + except: + print "Unable to update the MPC workspace at " + doc_root + "/MPC" + raise + +def update_version_files (component): + """ Updates the version files for a given component. This includes + Version.h, the PRF, and the VERSION file.""" + + global comp_versions, opts, release_date + + vprint ("Updating version files for " + component) + + import re + + retval = list () + + ## Update component/VERSION + with open (component + "/VERSION", "r+") as version_file: + new_version = re.sub (component + " version .*", + "%s version %s, released %s" % (component, + comp_versions[component + "_version"], + release_date), + version_file.read ()) + if opts.take_action: + version_file.seek (0) + version_file.truncate (0) + version_file.write (new_version) + else: + print "New version file for " + component + print new_version + + vprint ("Updating Version.h for " + component) + + retval += [component + "/VERSION"] + + ## Update component/component/Version.h + version_header = """ +// -*- C++ -*- +// $Id$ +// This is file was automatically generated by \$ACE_ROOT/bin/make_release. + +#define %s_MAJOR_VERSION %s +#define %s_MINOR_VERSION %s +#define %s_BETA_VERSION %s +#define %s_VERSION \"%s\" +""" % (component, comp_versions[component + "_major"], + component, comp_versions[component + "_minor"], + component, comp_versions[component + "_beta"], + component, comp_versions[component + "_version"]) + + if opts.take_action: + with open (component + '/' + component.lower () + "/Version.h", 'r+') as version_h: + version_h.write (version_header) + else: + print "New Version.h for " + component + print version_header + + retval += [component + '/' + component.lower () + "/Version.h"] + + # Update component/PROBLEM-REPORT-FORM + vprint ("Updating PRF for " + component) + + version_string = re.compile ("^\s*(\w+) +VERSION ?:") + + with open (component + "/PROBLEM-REPORT-FORM", 'r+') as prf: + new_prf = "" + for line in prf.readlines (): + match = None + match = version_string.search (line) + if match is not None: + vprint ("Found PRF Version for " + match.group (1)) + line = re.sub ("(\d\.)+\d?", + comp_versions[match.group(1) + "_version"], + line) + + new_prf += line + + if opts.take_action: + prf.seek (0) + prf.truncate (0) + prf.writelines (new_prf) + else: + print "New PRF for " + component + print "".join (new_prf) + + retval += [component + "/PROBLEM-REPORT-FORM"] + return retval + + +def get_and_update_versions (): + """ Gets current version information for each component, + updates the version files, creates changelog entries, + and commit the changes into the repository.""" + + try: + get_comp_versions ("ACE") + get_comp_versions ("TAO") + get_comp_versions ("CIAO") + + files = list () + files += update_version_files ("ACE") + files += update_version_files ("TAO") + files += update_version_files ("CIAO") + files += create_changelog ("ACE") + files += create_changelog ("TAO") + files += create_changelog ("CIAO") + + commit (files) + except: + print "Fatal error in get_and_update_versions." + raise + +def create_changelog (component): + """ Creates a changelog entry for the supplied component that includes + the version number being released""" + vprint ("Creating ChangeLog entry for " + component) + + global comp_versions, opts + + # generate our changelog entry + changelog_entry = """%s %s <%s> + +\t* %s version %s released. + +""" % (release_date, signature, mailid, + component, + comp_versions[component + "_version"]) + + vprint ("Changelog Entry for " + component + "\n" + changelog_entry) + + with open ("%s/ChangeLog" % (component), 'r+') as changelog: + changelog_entry += changelog.read () + + if opts.take_action: + changelog.seek (0) + changelog.truncate (0) + changelog.write (changelog_entry) + + return ["%s/ChangeLog" % (component)] + +def get_comp_versions (component): + """ Extracts the current version number from the VERSION + file and increments it appropriately for the release type + requested.""" + vprint ("Detecting current version for" + component) + + import re + + global comp_versions, opts + + beta = re.compile ("version (\d+)\.(\d+)\.(\d+)") + minor = re.compile ("version (\d+)\.(\d+)[^\.]") + major = re.compile ("version (\d+)[^\.]") + + with open (component + "/VERSION") as version_file: + for line in version_file: + match = None + + match = beta.search (line) + if match is not None: + vprint ("Detected beta version %s.%s.%s" % + (match.group (1), match.group (2), match.group (3))) + + comp_versions[component + "_major"] = int (match.group (1)) + comp_versions[component + "_minor"] = int (match.group (2)) + comp_versions[component + "_beta"] = int (match.group (3)) + break + + match = minor.search (line) + if match is not None: + vprint ("Detected minor version %s.%s" % + (match.group (1), match.group (2))) + + comp_versions[component + "_major"] = int (match.group (1)) + comp_versions[component + "_minor"] = int (match.group (2)) + comp_versions[component + "_beta"] = 0 + break + + match = major.search (line) + if match is not None: + vprint ("Detected major version " + match.group (1) + ".0") + + comp_versions[component + "_major"] = int (match.group (1)) + comp_versions[component + "_minor"] = 0 + comp_versions[component + "_beta"] = 0 + break + + print "FATAL ERROR: Unable to locate current version for " + component + raise Exception + + if opts.update: + if opts.release_type == "major": + comp_versions[component + "_major"] += 1 + comp_versions[component + "_minor"] = 0 + comp_versions[component + "_beta"] = 0 + elif opts.release_type == "minor": + comp_versions[component + "_minor"] += 1 + comp_versions[component + "_beta"] = 0 + elif opts.release_type == "beta": + comp_versions[component + "_beta"] += 1 + + if opts.release_type == "beta": + comp_versions [component + "_version"] = \ + str (comp_versions[component + "_major"]) + '.' + \ + str (comp_versions[component + "_minor"]) + '.' + \ + str (comp_versions[component + "_beta"]) + else: + comp_versions [component + "_version"] = \ + str (comp_versions[component + "_major"]) + '.' + \ + str (comp_versions[component + "_minor"]) + + +def tag (): + """ Tags the DOC and MPC repositories for the version """ + global comp_versions, opts + + branch = "ACE+TAO+CIAO-%d_%d_%d" % (comp_versions["ACE_major"], + comp_versions["ACE_minor"], + comp_versions["ACE_beta"]) + # Tag middleware + svn_client.copy (opts.repo_root + "/Middleware/trunk", + opts.repo_root + "/Middleware/tags/" + branch) + + # Tag MPC + svn_client.copy (opts.repo_root + "/MPC/trunk", + opts.repo_root + "/MPC/tags/" + branch) + +################################################## +#### Packaging methods +################################################## +def export_wc (stage_dir): + + global doc_root + + # Export our working copy + print ("Exporting ACE") + svn_client.export (doc_root + "/ACE", + stage_dir + "/ACE_wrappers") + + print ("Exporting MPC") + svn_client.export (doc_root + "/ACE/MPC", + stage_dir + "/ACE_wrappers/MPC") + + print ("Exporting TAO") + svn_client.export (doc_root + "/TAO", + stage_dir + "/ACE_wrappers/TAO") + + print ("Exporting CIAO") + svn_client.export (doc_root + "/CIAO", + stage_dir + "/ACE_wrappers/TAO/CIAO") + + +def update_packages (text_files, bin_files, stage_dir, package_dir): + import os + + print "Updating packages...." + os.chdir (stage_dir) + + # -g appends, -q for quiet operation + zip_base_args = " -gqu " + # -l causes line ending conversion for windows + zip_text_args = " -l " + zip_file = stage_dir + "/zip-archive.zip" + + # -r appends, -f specifies file. + tar_args = "-uf " + tar_file = stage_dir + "/tar-archive.tar" + + # Zip binary files + print "\tAdding binary files to zip...." + instream, outstream = os.popen2 ("xargs zip " + zip_base_args + zip_file) + + instream.write (bin_files) + + instream.close () + outstream.close () + + # Need to wait for zip process spawned by popen2 to complete + # before proceeding. + os.wait () + + print "\tAdding text files to zip....." + instream, outstream = os.popen2 ("xargs zip " + zip_base_args + zip_text_args + zip_file) + + instream.write (text_files) + + instream.close () + outstream.close () + + # Need to wait for zip process spawned by popen2 to complete + # before proceeding. + os.wait () + + # Tar files + print "\tAdding to tar file...." + instream, outstream = os.popen2 ("xargs tar " + tar_args + tar_file) + + instream.write (' ' + bin_files + ' ' + text_files) + + instream.close () + outstream.close () + + os.wait () + +def move_packages (name, stage_dir, package_dir): + """ Copies the temporary files from the stage_dir to the package_dir. + Renames them to name.tar and name.zip, respectively, and compresses + the tarfile with gzip and bzip2. """ + import shutil, os + from os.path import join + + print "Storing packages for ", name + + # Take care of the zip file + print "\tZip file..." + target_file = join (package_dir, name + ".zip") + shutil.copy (join (stage_dir, "zip-archive.zip"), + target_file) + ex ("md5sum " + target_file + " > " + target_file + ".md5") + + + tar_file = join (stage_dir, "tar-archive.tar") + target_file = join (package_dir, name + ".tar") + + # bzip + print "\tBzip2 file....." + shutil.copy (tar_file, + target_file) + ex ("bzip2 " + target_file) + ex ("md5sum " + target_file + ".bz2 > " + target_file + ".bz2.md5") + + print "\tgzip file....." + shutil.copy (tar_file, + target_file) + ex ("gzip " + target_file) + ex ("md5sum " + target_file + ".gz > " + target_file + ".gz.md5") + +def create_file_lists (base_dir, prefix, exclude): + """ Creates two lists of files: files that need CR->CRLF + conversions (useful for zip files) and those that don't, + excluding filies/directories found in exclude. """ + import os + + text_files = list () + bin_files = list () + + for root, dirs, files in os.walk (base_dir, topdown=True): +# print "root", root + + relroot = root.replace (base_dir, "") + +# print "relroot", relroot + + if len(relroot) and relroot[0] == '/': + relroot = relroot [1:] + + excluded = False + for item in exclude: + dir_item = item + '/' + if relroot.startswith (dir_item) or relroot.startswith (item): +# print "excluding", relroot + excluded = True +# else: +# print relroot, "does not start with", dir_item, "or", item + + if excluded: + continue + + # Remove dirs from our exclude pattern + for item in dirs: +# print "item", item + # Remove our excludes + if (item) in exclude: +# print "Removing " + item + " from consideration...." + dirs.remove (item) + + for item in files: + + fullitem = os.path.join (relroot, item) + if fullitem in exclude or item in exclude: +# print "Removing " + fullitem + " from consideration...." + files.remove (item) + continue + else: + if bin_regex.search (fullitem) is not None: + bin_files.append (os.path.join (prefix, fullitem)) + else: + text_files.append (os.path.join (prefix, fullitem)) + + return (text_files, bin_files) + +def write_file_lists (comp, text, bin): + outfile = open (comp + ".files", 'w') + + outfile.write ("\n".join (text)) + outfile.write (".............\nbin files\n.............\n") + outfile.write ("\n".join (bin)) + + outfile.close () + +def package (stage_dir, package_dir, decorator): + """ Packages ACE, ACE+TAO, and ACE+TAO+CIAO releases of current + staged tree, with decorator appended to the name of the archive. """ + from os.path import join + from os import remove + from os import chdir + + chdir (stage_dir) + + text_files = list () + bin_files = list () + + # Erase our old temp files + try: +# print "removing files", join (stage_dir, "zip-archive.zip"), join (stage_dir, "tar-archive.tar") + remove (join (stage_dir, "zip-archive.zip")) + remove (join (stage_dir, "tar-archive.tar")) + except: + print "error removing files", join (stage_dir, "zip-archive.zip"), join (stage_dir, "tar-archive.tar") + pass # swallow any errors + + text_files, bin_files = create_file_lists (join (stage_dir, "ACE_wrappers"), + "ACE_wrappers", ["TAO", "autom4te.cache"]) + +# write_file_lists ("fACE" + decorator, text_files, bin_files) + update_packages ("\n".join (text_files), + "\n".join (bin_files), + stage_dir, + package_dir) + + + move_packages ("ACE" + decorator, stage_dir, package_dir) + + text_files = list () + bin_files = list () + + # for TAO: + text_files, bin_files = create_file_lists (join (stage_dir, "ACE_wrappers/TAO"), + "ACE_wrappers/TAO", ["CIAO", "autom4te.cache"]) + +# write_file_lists ("fTAO" + decorator, text_files, bin_files) + update_packages ("\n".join (text_files), + "\n".join (bin_files), + stage_dir, + package_dir) + + move_packages ("ACE+TAO" + decorator, stage_dir, package_dir) + + text_files = list () + bin_files = list () + # for CIAO: + text_files, bin_files = create_file_lists (join (stage_dir, "ACE_wrappers/TAO/CIAO"), + "ACE_wrappers/TAO/CIAO", "") + +# write_file_lists ("fCIAO" + decorator, text_files, bin_files) + update_packages ("\n".join (text_files), + "\n".join (bin_files), + stage_dir, + package_dir) + + move_packages ("ACE+TAO+CIAO" + decorator, stage_dir, package_dir) + +def generate_workspaces (stage_dir): + """ Generates workspaces in the given stage_dir """ + print "Generating workspaces..." + global opts + import os + + # Make sure we are in the right directory... + os.chdir (os.path.join (stage_dir, "ACE_wrappers")) + + # Set up our environment + os.putenv ("ACE_ROOT", os.path.join (stage_dir, "ACE_wrappers")) + os.putenv ("MPC_ROOT", os.path.join (stage_dir, "ACE_wrappers", "MPC")) + os.putenv ("TAO_ROOT", os.path.join (stage_dir, "ACE_wrappers", "TAO")) + os.putenv ("CIAO_ROOT", os.path.join (stage_dir, "ACE_wrappers", "TAO", "CIAO")) + + # Create option strings + mpc_command = os.path.join (stage_dir, "ACE_wrappers", "bin", "mwc.pl") + exclude_option = ' -exclude TAO/TAO_*.mwc,TAO/CIAO/CIAO_*.mwc ' + mpc_option = ' -recurse -hierarchy -relative ACE_ROOT=' + stage_dir + '/ACE_wrappers ' + mpc_option += ' -relative TAO_ROOT=' + stage_dir + '/ACE_wrappers/TAO ' + mpc_option += ' -relative CIAO_ROOT=' + stage_dir + '/ACE_wrappers/TAO/CIAO ' + + static_vc71_option = ' -static -name_modifier *_vc71_Static -apply_project -exclude TAO/CIAO ' + static_vc71_option += mpc_option + + static_vc8_option = ' -static -name_modifier *_vc8_Static -apply_project -exclude TAO/CIAO ' + static_vc8_option += mpc_option + + static_vc9_option = ' -static -name_modifier *_vc9_Static -apply_project -exclude TAO/CIAO ' + static_vc9_option += mpc_option + + vc9_option = ' -name_modifier *_vc9 ' + vc8_option = ' -name_modifier *_vc8 ' + vc71_option = ' -name_modifier *_vc71 ' + + # Build option string for VC8 platforms + ce_option = ' -name_modifier *_vc8_WinCE -features "uses_wchar=1,wince=1" ' + ce_option += ' -value_template platforms=\'"Pocket PC 2003 (ARMV4)"\' ' + ce_option += ' -value_template platforms+=\'"Smartphone 2003 (ARMV4)"\' ' + ce_option += ' -value_template platforms+=\'"Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"\' ' + ce_option += ' -value_template platforms+=\'"Windows Mobile 5.0 Smartphone SDK (ARMV4I)"\' ' + + redirect_option = str () + if not opts.verbose: + redirect_option = " >> ../mpc.log 2>&1" + + # Generate GNUmakefiles + print "\tGenerating GNUmakefiles...." + ex (mpc_command + " -type gnuace " + exclude_option + mpc_option + redirect_option) + + print "\tGenerating VC9 solutions..." + ex (mpc_command + " -type vc9 " + mpc_option + vc9_option + redirect_option) + + print "\tGenerating VC8 solutions..." + ex (mpc_command + " -type vc8 " + mpc_option + vc8_option + redirect_option) + + print "\tGenerating VC8 Windows CE solutions..." + ex (mpc_command + " -type vc8 " + mpc_option + exclude_option + ce_option + redirect_option) + + print "\tGenerating VC71 solutions..." + ex (mpc_command + " -type vc71 " + mpc_option + vc71_option + redirect_option) + + print "\tGenerating Borland makefiles" + ex (mpc_command + " -type borland " + mpc_option + exclude_option + redirect_option) + + print "\tGenerating VC71 Static solutions" + ex (mpc_command + " -type vc71 " + static_vc71_option + redirect_option) + + print "\tGenerating VC8 Static solutions" + ex (mpc_command + " -type vc8 " + static_vc8_option + redirect_option) + + print "\tGenerating VC9 Static solutions" + ex (mpc_command + " -type vc9 " + static_vc9_option + redirect_option) + + print "\tBootstrapping autotools support" + ex ("bin/bootstrap " + redirect_option) + + print "\tCorrecting permissions for all generated files..." + ex ("find ./ -name '*.vc[p,w]' -or -name '*.bor' -or -name '*.vcproj' -or -name '*.sln' -or -name 'GNUmake*' | xargs chmod 0644") + +def create_kit (): + """ Creates kits """ + import os + from os.path import join + # Get version numbers for this working copy, note this will + # not update the numbers. + print "Getting current version information...." + + get_comp_versions ("ACE") + get_comp_versions ("TAO") + get_comp_versions ("CIAO") + + print "Creating working directories...." + stage_dir, package_dir = make_working_directories () + + print "Exporting working copy..." + export_wc (stage_dir) + + ### make source only packages + package (stage_dir, package_dir, "-src") + + generate_workspaces (stage_dir) + + ### create standard packages. + package (stage_dir, package_dir, "") + +def make_working_directories (): + """ Creates directories that we will be working in. + In particular, we will have DOC_ROOT/stage-PID and + DOC_ROOT/packages-PID """ + global doc_root + import os.path, os + + stage_dir = os.path.join (doc_root, "stage-" + str (os.getpid ())) + package_dir = os.path.join (doc_root, "package-" + str (os.getpid ())) + + os.mkdir (stage_dir) + os.mkdir (package_dir) + + return (stage_dir, package_dir) + +def main (): + global opts + + if opts.action == "tag": + print "Tagging a " + opts.release_type + " release." + raw_input ("Press enter to continue") + + check_workspace () + get_and_update_versions () + tag () + + else: + print "Creating a kit." + raw_input ("Press enter to continue") + + create_kit () + + + +if __name__ == "__main__": + (opts, args) = parse_args () + + if check_environment() is not True: + exit (1) + + main () diff --git a/ACE/bin/mpc.pl b/ACE/bin/mpc.pl new file mode 100755 index 00000000000..c547851e21d --- /dev/null +++ b/ACE/bin/mpc.pl @@ -0,0 +1,66 @@ +eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' + & eval 'exec perl -w -S $0 $argv:q' + if 0; + +# ****************************************************************** +# Author: Chad Elliott +# Date: 6/17/2002 +# $Id$ +# ****************************************************************** + +# ****************************************************************** +# Pragma Section +# ****************************************************************** + +require 5.006; + +use strict; +use FindBin; +use File::Spec; +use File::Basename; + +my($basePath) = $FindBin::Bin; +if ($^O eq 'VMS') { + $basePath = File::Spec->rel2abs(dirname($0)) if ($basePath eq ''); + $basePath = VMS::Filespec::unixify($basePath); +} +$basePath .= '/MakeProjectCreator'; + +my($mpcroot) = $ENV{MPC_ROOT}; +my($mpcpath) = (defined $mpcroot ? $mpcroot : + dirname(dirname($basePath)) . '/MPC'); +unshift(@INC, $mpcpath . '/modules'); + +if (defined $mpcroot) { + print STDERR "MPC_ROOT was set to $mpcroot.\n"; +} + +if (! -d "$mpcpath/modules") { + print STDERR "ERROR: Unable to find the MPC modules in $mpcpath.\n"; + if (defined $mpcroot) { + print STDERR "Your MPC_ROOT environment variable does not point to a ", + "valid MPC location.\n"; + } + else { + print STDERR "You can set the MPC_ROOT environment variable to the ", + "location of MPC.\n"; + } + exit(255); +} + +require Driver; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub getBasePath { + return $mpcpath; +} + +# ************************************************************ +# Main Section +# ************************************************************ + +my($driver) = new Driver($basePath, basename($0)); +exit($driver->run(@ARGV)); diff --git a/ACE/bin/msvc_mpc_auto_compile.pl b/ACE/bin/msvc_mpc_auto_compile.pl new file mode 100755 index 00000000000..02033d3be37 --- /dev/null +++ b/ACE/bin/msvc_mpc_auto_compile.pl @@ -0,0 +1,367 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# Win32 auto_compile script. + +use File::Find; +use Cwd; + +if (!$ENV{ACE_ROOT}) { + $ACE_ROOT = getcwd ()."\\"; + warn "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT"; +} +else { + $ACE_ROOT = $ENV{ACE_ROOT}; +} + +@directories = (); + + +@ace_core_dirs = ("$ACE_ROOT\\ace", + "$ACE_ROOT\\Kokyu", + "$ACE_ROOT\\ACEXML", + "$ACE_ROOT\\examples", + "$ACE_ROOT\\tests", + "$ACE_ROOT\\protocols"); + +@tao_core_dirs = ("$ACE_ROOT\\apps", + "$ACE_ROOT\\TAO\\TAO_IDL", + "$ACE_ROOT\\TAO\\tao", + "$ACE_ROOT\\TAO\\tests"); + +@ciao_core_dirs = ("$ACE_ROOT\\TAO\\orbsvcs\\orbsvcs", # CIAO dependancy + "$ACE_ROOT\\TAO\\CIAO"); + +$debug = 0; +$verbose = 0; +$print_status = 0; +$Ignore_errors = 0; # By default, bail out if an error occurs. +$Build_Debug = 0; +$Build_Release = 0; +$build_all = 0; +$Build_Cmd = "/BUILD"; +$use_custom_dir = 0; +$useenv = ''; +$vc7 = 0; + +# Build_Config takes in a string of the type "project--configuration" and +# runs msdev to build it. +# sub Build_Config ($) +#{ +# my ($arg) = @_; +# my ($project, $config) = split /--/, $arg; +# +# return Build ($project, $config); +#} + +# Build +sub Build ($$) +{ + my ($project, $config) = @_; + + if ($debug == 1) { + print "$project\n"; + return 0; + } + else { + print "Auto_compiling $project : $config\n"; + + print "Building $project $config\n" if $verbose; + + return system ("msdev.com $project /MAKE \"$config\" $Build_Cmd $useenv"); + } +} + +# Build +sub Build_VC7 ($$) +{ + my ($project, $config) = @_; + + if ($debug == 1) { + print "$project\n"; + return 0; + } + else { + print "Auto_compiling $project : $config\n"; + + print "Building $project $config\n" if $verbose; + + return system ("devenv.com $project $Build_Cmd $config $useenv"); + } +} + +sub Find_Dsw (@) +{ + my (@dir) = @_; + @array = (); + + sub wanted_dsw { + $array[++$#array] = + $File::Find::name if ($File::Find::name =~ /\.dsw$/i); + } + + find (\&wanted_dsw, @dir); + + print "List of dsw's \n" if ($verbose == 1); + return @array; +} + +sub Find_Sln (@) +{ + my (@dir) = @_; + @array = (); + + sub wanted_sln { + $array[++$#array] = + $File::Find::name if ($File::Find::name =~ /\.sln$/i); + } + + find (\&wanted_sln, @dir); + + print "List of sln's \n" if ($verbose == 1); + return @array; +} + +# Only builds the core libraries. +sub Build_Custom () +{ + print STDERR "Building Custom\n"; + print "Building Custom directories specified\n";# if ($verbose == 1); + + print "Build " if ($verbose); + print "Debug " if ($verbose) && ($Build_Debug); + print "Release " if ($verbose) && ($Build_Release); + print "\n" if ($verbose); + + my @custom_list = Find_Dsw (@directories); + + print "List now is @custom_list \n"; + foreach $c (@custom_list) { + print "List now is $c \n"; + if ($Build_Debug) { + $Status = Build ($c, "ALL - Win32 Debug"); + return if $Status != 0 && !$Ignore_errors; + } + if ($Build_Release) { + $Status = Build ($c, "ALL - Win32 Release"); + return if $Status != 0 && !$Ignore_errors; + } + } +} + +# Build all examples and directories +sub Build_All () +{ + push @directories, @ace_core_dirs; + push @directories, @tao_core_dirs; + push @directories, @ciao_core_dirs; + + print STDERR "First pass (libraries)\n" if ($print_status == 1); + print "\nmsvc_auto_compile: First Pass CORE (libraries)\n"; + + Build_Custom (); + + my @new_directory_search = "$ACE_ROOT"; + + my @configurations = Find_Dsw (@new_directory_search); + + print STDERR "Second pass (for other things)\n" if ($print_status == 1); + print "\nmsvc_mpc_auto_compile: Second Pass (rest of the stuff)\n"; + + foreach $c (@configurations) { + print "\nUsing $c for compilation\n"; + if ($Build_Debug) { + $Status = Build ($c, "ALL - Win32 Debug"); + return if $Status != 0 && !$Ignore_errors; + } + if ($Build_Release) { + $Status = Build ($c, "ALL - Win32 Release"); + return if $Status != 0 && !$Ignore_errors; + } + } +} + + +# Only builds the core libraries. +sub Build_Custom_VC7 () +{ + print STDERR "Building Custom\n"; + print "Building Custom directories specified\n";# if ($verbose == 1); + + print "Build " if ($verbose); + print "Debug " if ($verbose) && ($Build_Debug); + print "Release " if ($verbose) && ($Build_Release); + print "\n" if ($verbose); + + my @custom_list = Find_Sln (@directories); + + print "List now is @custom_list \n"; + foreach $c (@custom_list) { + print "List now is $c \n"; + if ($Build_Debug) { + $Status = Build_VC7 ($c, "debug"); + return if $Status != 0 && !$Ignore_errors; + } + if ($Build_Release) { + $Status = Build_VC7 ($c, "release"); + return if $Status != 0 && !$Ignore_errors; + } + } +} + +# Build all examples and directories +sub Build_All_VC7 () +{ + push @directories, @ace_core_dirs; + push @directories, @tao_core_dirs; + push @directories, @ciao_core_dirs; + + print STDERR "First pass (libraries)\n" if ($print_status == 1); + print "\nmsvc_auto_compile: First Pass CORE (libraries)\n"; + + Build_Custom_VC7 (); + + my @new_directory_search = "$ACE_ROOT"; + + my @configurations = Find_Sln (@new_directory_search); + + print STDERR "Second pass (for other things)\n" if ($print_status == 1); + print "\nmsvc_mpc_auto_compile: Second Pass (rest of the stuff)\n"; + + foreach $c (@configurations) { + print "\nUsing $c for compilation\n"; + if ($Build_Debug) { + $Status = Build_VC7 ($c, "debug"); + return if $Status != 0 && !$Ignore_errors; + } + if ($Build_Release) { + $Status = Build_VC7 ($c, "release"); + return if $Status != 0 && !$Ignore_errors; + } + } +} + +## Parse command line argument +while ( $#ARGV >= 0 && $ARGV[0] =~ /^(-|\/)/ ) +{ + if ($ARGV[0] =~ '-k') { # Ignore errors + print "Ignore errors\n" if ( $verbose ); + $Ignore_errors = 1; + } + elsif ($ARGV[0] =~ /^-d$/i) { # debug + $debug = 1; + } + elsif ($ARGV[0] =~ '-vc7') { # Use VC7 project and solution files. + print "Using VC7 files\n" if ( $verbose ); + $vc7 = 1; + } + elsif ($ARGV[0] =~ '-vc8') { # Use VC8 project and solution files. + print "Using VC8 files\n" if ( $verbose ); + $vc7 = 1; # vc8 is like vc7 + } + elsif ($ARGV[0] =~ '-vc9') { # Use VC9 project and solution files. + print "Using VC9 files\n" if ( $verbose ); + $vc7 = 1; # vc9 is like vc7 + } + elsif ($ARGV[0] =~ '-v') { # verbose mode + $verbose = 1; + } + elsif ($ARGV[0] =~ '-s') { # status messages + $print_status = 1; + } + elsif ($ARGV[0] =~ '-u') { # USEENV + print "Using Environment\n" if ($verbose); + $useenv = '/USEENV'; + } + elsif ($ARGV[0] =~ '-ACE') {# Build ACE and its tests + print "Building ACE\n" if ( $verbose ); + $use_custom_dir = 1; + push @directories, @ace_core_dirs; + } + elsif ($ARGV[0] =~ '-TAO') {# Build TAO and its tests + print "Building TAO\n" if ( $verbose ); + $use_custom_dir = 1; + push @directories, @ace_core_dirs; + push @directories, @tao_core_dirs; + } + elsif ($ARGV[0] =~ '-CIAO') {# Build the CIAO and related + # libraries + print "Building only CIAO\n" if ( $verbose ); + $use_custom_dir = 1; + push @directories, @ace_core_dirs; + push @directories, @tao_core_dirs; + push @directories, @ciao_core_dirs; + } + elsif ($ARGV[0] =~ '-ALL') {# Build the CIAO and related + # libraries + print "Building ALL \n" if ( $verbose ); + $build_all = 1; + } + elsif ($ARGV[0] =~ '-dir') { # Compile only a specific directory + shift; + print "Adding directory $ARGV[0]\n" if ( $verbose ); + $use_custom_dir = 1; + push @directories, $ARGV[0]; + } + 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 ); + $Build_Cmd = "/CLEAN"; + } + elsif ($ARGV[0] =~ '-Debug') { # Debug versions + print "Building Debug Version\n" if ( $verbose ); + $Build_Debug = 1; + } + elsif ($ARGV[0] =~ '-Release') { # Release versions + print "Building Release Version\n" if ( $verbose ); + $Build_Release = 1; + } + elsif ($ARGV[0] =~ '-(\?|h)') { # Help information + print "Options\n"; + print "-d = Debug (only print out projects)\n"; + print "-k = Ignore Errors\n"; + print "-v = Script verbose Mode\n"; + print "-s = Print status messages to STDERR\n"; + print "-u = Tell MSVC to use the environment\n"; + print "-vc7 = Use MSVC 7 toolset\n"; + print "-vc8 = Use MSVC 8 toolset\n"; + print "\n"; + print "-CORE = Build ACE+TAO+CIAO core \n"; + print "-ACE = Build ACE and its tests\n"; + print "-TAO = Build TAO and its tests\n"; + print "-dir <dir> = Compile custom directories\n"; + print "\n"; + print "-rebuild = Rebuild All\n"; + print "-clean = Clean\n"; + print "-Debug = Compile Debug versions\n"; + print "-Release = Compile Release versions\n"; + exit; + } + else { + warn "$0: error unknown option $ARGV[0]\n"; + die -1; + } + shift; +} + +if (!$Build_Debug && !$Build_Release) { + $Build_Debug = 1; + $Build_Release = 1; +} + +print "MPC version of msvc_mpc_auto_compile: Begin\n"; +if ($vc7) { + Build_All_VC7 if ($build_all && !$use_custom_dir); + Build_Custom_VC7 if $use_custom_dir; +} +else { + Build_All if ($build_all && !$use_custom_dir); + Build_Custom if $use_custom_dir; +} +print "msvc_mpc_auto_compile: End\n"; +print STDERR "End\n" if ($print_status == 1); diff --git a/ACE/bin/msvc_static_compile.pl b/ACE/bin/msvc_static_compile.pl new file mode 100755 index 00000000000..aadc0039ffe --- /dev/null +++ b/ACE/bin/msvc_static_compile.pl @@ -0,0 +1,416 @@ +# $Id$ +# Win32 auto_compile script. +if (!$ENV{ACE_ROOT}) { + $ACE_ROOT = getcwd ()."\\"; + warn "ACE_ROOT not defined, defaulting to ACE_ROOT=$ACE_ROOT"; +} +else { + $ACE_ROOT = $ENV{ACE_ROOT}; +} + +use lib "$ENV{ACE_ROOT}/bin"; + +use File::Find; +use PerlACE::Run_Test; +use Cwd; + +@directories = (); + +@ace_dirs = ("$ACE_ROOT\\ace", + "$ACE_ROOT\\ACEXML\\common", + "$ACE_ROOT\\ACEXML\\parser", + "$ACE_ROOT\\ACEXML\\apps", + "$ACE_ROOT\\ACEXML\\tests", + "$ACE_ROOT\\ACEXML\\examples", + "$ACE_ROOT\\apps", + "$ACE_ROOT\\ASNMP", + "$ACE_ROOT\\examples", + "$ACE_ROOT\\netsvcs", + "$ACE_ROOT\\performance-tests", + "$ACE_ROOT\\protocols", + "$ACE_ROOT\\tests", + "$ACE_ROOT\\websvcs"); + +$debug = 0; +$verbose = 0; +$print_status = 0; +$Ignore_errors = 0; # By default, bail out if an error occurs. +$Build_LIB = 0; +$Build_Debug = 0; +$Build_Release = 0; +$Build_All = 1; +$build_core_only = 0; +$Build_Cmd = "/BUILD"; +$use_custom_dir = 0; +$useenv = ''; +$vc7 = 0; +$name_mod = ''; +$mod_name = 0; +$proj_ext = '.dsp'; + +# Build +sub Build ($$) +{ + my ($project, $config) = @_; + + if ($debug == 1) { + print "$project\n"; + return 0; + } + else { + print "Auto_compiling $project : $config\n"; + + print "Building $project $config\n" if $verbose; + + return system ("msdev.com $project /MAKE \"$config\" $Build_Cmd $useenv"); + } +} + +# Build +sub Build_VC7 ($$) +{ + my ($project, $config) = @_; + + if ($debug == 1) { + print "$project\n"; + return 0; + } + else { + print "Auto_compiling $project : $config\n"; + + print "Building $project $config\n" if $verbose; + + return system ("devenv.com $project $Build_Cmd $config $useenv"); + } +} + +sub Find_Dsw (@) +{ + my (@dir) = @_; + @array = (); + + sub wanted_dsw { + $array[++$#array] = + $File::Find::name if ($File::Find::name =~ /\.dsw$/i); + } + + find (\&wanted_dsw, @dir); + + print "List of dsw's \n" if ($verbose == 1); + return @array; +} + +sub Find_Sln (@) +{ + my (@dir) = @_; + @array = (); + + sub wanted_sln { + $array[++$#array] = + $File::Find::name if ($File::Find::name =~ /\.sln$/i); + } + + find (\&wanted_sln, @dir); + + print "List of sln's \n" if ($verbose == 1); + return @array; +} + +sub Rename_Files ($$) +{ + my ($target) = shift; + my ($newext) = shift; + my (@array) = (); + + sub wanted_file { + my ($text) = shift; + my ($next) = shift; + if ($File::Find::name =~ /^(.*)$text$/i) { + my ($newname) = $1 . $next; + rename ($File::Find::name, $newname); + } + } + + find (sub { wanted_file ($target, $newext) }, $ACE_ROOT); +} + +# Only builds the core libraries. +sub Build_Core () +{ + print STDERR "Building Core of ACE/TAO\n" if ($print_status == 1); + print "\nmsvc_static_compile: Building Core of ACE/TAO\n"; + + print "Build \n" if ($verbose); + print "Debug " if ($verbose) && ($Build_Debug); + print "Release " if ($verbose) && ($Build_Release); + print "LIB " if ($verbose) && ($Build_LIB); + print "\n" if ($verbose); + + my @core_list = (); + + if ($Build_LIB) { + push (@file_list, "/bin/msvc_static_order.lst"); + + foreach my$test_lst (@file_list) { + my $config_list = new PerlACE::ConfigList; + $config_list->load ($ACE_ROOT.$test_lst); + + foreach $test ($config_list->valid_entries ()) { + if ($mod_name) { + @plist = split (/\//, $test); + $fname = pop @plist; + $fname_mod = $name_mod; + $fname_mod =~ s/\*/$fname/; + push @plist,($fname_mod); + push (@core_list, join('/', @plist) . $proj_ext); + } + else { + push (@core_list, $test . $proj_ext); + } + } + } + + + if ( $vc7 ) { + foreach $c (@core_list) { + if ($Build_Debug) { + $Status = Build_VC7 ($c, "debug"); + return if $Status != 0 && !$Ignore_errors; + } + if ($Build_Release) { + $Status = Build_VC7 ($c, "release"); + return if $Status != 0 && !$Ignore_errors; + } + } + } + else { + foreach $c (@core_list) { + if ($Build_Debug) { + $Status = Build ($c, "ALL - Win32 Debug"); + return if $Status != 0 && !$Ignore_errors; + } + if ($Build_Release) { + $Status = Build ($c, "ALL - Win32 Release"); + return if $Status != 0 && !$Ignore_errors; + } + } + } + } +} + +sub Build_All () +{ + my @configurations = Find_Dsw (@directories); + + print STDERR "Building selected projects\n" if ($print_status == 1); + print "\nmsvc_static_compile: Building selected projects\n"; + + $count = 0; + foreach $c (@configurations) { + print STDERR "Configuration ".$count++." of ".$#configurations."\n" if ($print_status == 1); + if ($Build_Debug) { + $Status = Build ($c, "ALL - Win32 Debug"); + return if $Status != 0 && !$Ignore_errors; + } + if ($Build_Release) { + $Status = Build ($c, "ALL - Win32 Release"); + return if $Status != 0 && !$Ignore_errors; + } + } +} + +sub Build_All_VC7 () +{ + my @configurations = Find_Sln (@directories); + + print STDERR "Building selected projects\n" if ($print_status == 1); + print "\nmsvc_static_compile: Building selected projects\n"; + + $count = 0; + foreach $c (@configurations) { + print STDERR "Configuration ".$count++." of ".$#configurations."\n" if ($print_status == 1); + if ($Build_Debug) { + $Status = Build_VC7 ($c, "debug"); + return if $Status != 0 && !$Ignore_errors; + } + if ($Build_Release) { + $Status = Build_VC7 ($c, "release"); + return if $Status != 0 && !$Ignore_errors; + } + } +} + + +## Parse command line argument +while ( $#ARGV >= 0 && $ARGV[0] =~ /^(-|\/)/ ) +{ + if ($ARGV[0] =~ '-k') { # Ignore errors + print "Ignore errors\n" if ( $verbose ); + $Ignore_errors = 1; + } + elsif ($ARGV[0] =~ /^-d$/i) { # debug + $debug = 1; + } + elsif ($ARGV[0] =~ '-vc7') { # Use VC7 project and solution files. + print "Using VC7 files\n" if ( $verbose ); + $vc7 = 1; + $proj_ext = '.vcproj'; + } + elsif ($ARGV[0] =~ '-vc8') { # Use VC8 project and solution files. + print "Using VC8 files\n" if ( $verbose ); + $vc7 = 1; # VC8 is like VC7 + $proj_ext = '.vcproj'; + } + elsif ($ARGV[0] =~ '-vc9') { # Use VC9 project and solution files. + print "Using VC9 files\n" if ( $verbose ); + $vc7 = 1; # VC9 is like VC7 + $proj_ext = '.vcproj'; + } + elsif ($ARGV[0] =~ '-v') { # verbose mode + $verbose = 1; + } + elsif ($ARGV[0] =~ '-name_modifier') { # use MPC name_modifier for project + shift; + print "Setting name_modifier $ARGV[0]\n" if ( $verbose ); + $name_mod = $ARGV[0]; + $mod_name = 1; + } + elsif ($ARGV[0] =~ '-s') { # status messages + $print_status = 1; + } + elsif ($ARGV[0] =~ '-u') { # USEENV + print "Using Environment\n" if ($verbose); + $useenv = '/USEENV'; + } + elsif ($ARGV[0] =~ '-CORE') { # Build the core of ace/tao + print "Building only Core\n" if ( $verbose ); + $build_core_only = 1; + } + elsif ($ARGV[0] =~ '-ACE') { # Build ACE and its programs + print "Building ACE\n" if ( $verbose ); + $use_custom_dir = 1; + push @directories, @ace_dirs; + } + elsif ($ARGV[0] =~ '-TAO') { # Build TAO and its programs + print "Building TAO\n" if ( $verbose ); + $use_custom_dir = 1; + # Other tests depend on the lib in this dir so we need to force it + # to the front of the build list. This is pretty ugly. + push @directories, ("$ACE_ROOT\\TAO\\orbsvcs\\tests\\Notify\\lib"); + push @directories, ("$ACE_ROOT\\TAO"); + } + elsif ($ARGV[0] =~ '-dir') { # Compile only a specific directory + shift; + print "Adding directory $ARGV[0]\n" if ( $verbose ); + $use_custom_dir = 1; + push @directories, $ARGV[0]; + } + 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 ); + $Build_Cmd = "/CLEAN"; + } + 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 ); + $Build_Release = 1; + $Build_All = 0; + } + elsif ($ARGV[0] =~ '-LIB') { # Build LIB only + print "Build LIB only\n" if ( $verbose ); + $Build_LIB = 1; + $Build_All = 0; + } + elsif ($ARGV[0] =~ '-(\?|h)') { # Help information + print "Options\n"; + print "-d = Debug (only print out projects)\n"; + print "-k = Ignore Errors\n"; + print "-v = Script verbose Mode\n"; + print "-s = Print status messages to STDERR\n"; + print "-u = Tell MSVC to use the environment\n"; + print "-vc7 = Use MSVC 7 toolset\n"; + print "-vc8 = Use MSVC 8 toolset\n"; + print "-name_modifier <mod> = Use MPC name_modifier to match projects\n"; + print "\n"; + print "-CORE = Build the Core libraries\n"; + print "-ACE = Build ACE and its programs\n"; + print "-TAO = Build TAO and its programs\n"; + print "-dir <dir> = Compile custom directories\n"; + print "\n"; + print "-rebuild = Rebuild All\n"; + print "-clean = Clean\n"; + print "-Debug = Compile Debug versions\n"; + print "-Release = Compile Release versions\n"; + print "-LIB = Comple LIB Configurations\n"; + exit; + } + else { + warn "$0: error unknown option $ARGV[0]\n"; + die -1; + } + shift; +} + +if (!$Build_DLL && !$Build_LIB) { + $Build_DLL = 1; + $Build_LIB = 1; +} + +if (!$Build_Debug && !$Build_Release) { + $Build_Debug = 1; + $Build_Release = 1; +} + +if ($#directories < 0) { + @directories = ($ACE_ROOT); +} + +print "msvc_static_compile: Begin\n"; +print STDERR "Beginning Core Build\n" if ($print_status == 1); +if (!$use_custom_dir || $build_core_only) { + if ($vc7) { + ## devenv is too smart for it's own good. When a .vcproj is specified, + ## as is done when building the CORE, it will find the solution to which + ## the .vcproj belongs and begin to build additional portions of the + ## solution. This is not what we want as dependencies are not set up + ## between library projects. + my($sln) = '.sln'; + my($core_sln) = $sln . '.build_core'; + + Rename_Files ($sln, $core_sln); + + foreach my $sig ('INT', 'TERM') { + $SIG{$sig} = sub { print STDERR "Renaming solution files, please be patient...\n"; + Rename_Files ($core_sln, $sln); + exit(1); }; + } + + Build_Core (); + + Rename_Files ($core_sln, $sln); + + foreach my $sig ('INT', 'TERM') { + $SIG{$sig} = 'DEFAULT'; + } + } + else { + Build_Core (); + } +} +print STDERR "Beginning Full Build\n" if ($print_status == 1); +if ( $vc7 ) { + Build_All_VC7 if !$build_core_only; +} +else { + Build_All if !$build_core_only; +} + +print "msvc_static_compile: End\n"; +print STDERR "End\n" if ($print_status == 1); diff --git a/ACE/bin/msvc_static_order.lst b/ACE/bin/msvc_static_order.lst new file mode 100644 index 00000000000..528935c0313 --- /dev/null +++ b/ACE/bin/msvc_static_order.lst @@ -0,0 +1,400 @@ +# $Id$ +# +# This file lists the project files that must be build first in a static +# build using msvc_static_compile.pl + +ace/ace +Kokyu/Kokyu +ACEXML/parser/parser/ACEXML_Parser +ACEXML/common/ACEXML +apps/gperf/src/gperf +TAO/TAO_IDL/TAO_IDL_BE +TAO/TAO_IDL/TAO_IDL_FE +TAO/TAO_IDL/TAO_IDL_EXE +TAO/tao/TAO +TAO/tao/AnyTypeCode +TAO/tao/CodecFactory +TAO/tao/Codeset +TAO/tao/PI +TAO/tao/PortableServer +TAO/tao/PI_Server +TAO/tao/Valuetype +TAO/tao/ObjRefTemplate +TAO/tao/IORInterceptor +TAO/tao/DynamicAny +TAO/tao/IORManipulation +TAO/tao/IORTable +TAO/tao/Messaging +TAO/tao/DynamicInterface +TAO/tao/Strategies +TAO/tao/RTCORBA +TAO/tao/RTPortableServer +TAO/tao/Utils +TAO/tao/TAO_Utils +TAO/tao/RTScheduler +TAO/tao/IFR_Client +TAO/tao/TypeCodeFactory +TAO/tao/ImR_Client +TAO/tao/CSD_Framework +TAO/tao/CSD_ThreadPool +TAO/tao/TC +TAO/tao/DiffServPolicy +TAO/orbsvcs/orbsvcs/Svc_Utils +TAO/orbsvcs/orbsvcs/CosNaming_IDL +TAO/orbsvcs/orbsvcs/CosNaming +TAO/orbsvcs/orbsvcs/CosNaming_Skel +TAO/orbsvcs/orbsvcs/CosNaming_Serv +TAO/orbsvcs/orbsvcs/CosProperty_IDL +TAO/orbsvcs/orbsvcs/CosProperty +TAO/orbsvcs/orbsvcs/CosProperty_Skel +TAO/orbsvcs/orbsvcs/CosProperty_Serv +TAO/orbsvcs/orbsvcs/CosTrading_IDL +TAO/orbsvcs/orbsvcs/CosTrading +TAO/orbsvcs/orbsvcs/CosTrading_Skel +TAO/orbsvcs/orbsvcs/CosTrading_Serv +TAO/orbsvcs/orbsvcs/HTIOP +TAO/orbsvcs/orbsvcs/AV +TAO/orbsvcs/orbsvcs/ETCL +TAO/orbsvcs/orbsvcs/RTCosScheduling +TAO/orbsvcs/orbsvcs/RTEvent +TAO/orbsvcs/orbsvcs/RTEvent_Skel +TAO/orbsvcs/orbsvcs/RTEvent_Serv +TAO/orbsvcs/orbsvcs/RTSched +TAO/orbsvcs/orbsvcs/RTSchedEvent +TAO/orbsvcs/orbsvcs/CosEvent_IDL +TAO/orbsvcs/orbsvcs/CosEvent +TAO/orbsvcs/orbsvcs/CosEvent_Skel +TAO/orbsvcs/orbsvcs/CosEvent_Serv +TAO/orbsvcs/orbsvcs/RTKokyuEvent +TAO/orbsvcs/orbsvcs/CosConcurrency_IDL +TAO/orbsvcs/orbsvcs/CosConcurrency +TAO/orbsvcs/orbsvcs/CosConcurrency_Skel +TAO/orbsvcs/orbsvcs/CosConcurrency_Serv +TAO/orbsvcs/orbsvcs/CosLifeCycle +TAO/orbsvcs/orbsvcs/CosTime +TAO/orbsvcs/orbsvcs/CosNotification_IDL +TAO/orbsvcs/orbsvcs/CosNotification +TAO/orbsvcs/orbsvcs/CosNotification_Skel +TAO/orbsvcs/orbsvcs/CosNotification_Serv +TAO/orbsvcs/orbsvcs/CosNotification_Persist +TAO/orbsvcs/orbsvcs/DsLogAdmin_IDL +TAO/orbsvcs/orbsvcs/DsLogAdmin +TAO/orbsvcs/orbsvcs/DsLogAdmin_Skel +TAO/orbsvcs/orbsvcs/DsLogAdmin_Serv +TAO/orbsvcs/orbsvcs/DsEventLogAdmin_IDL +TAO/orbsvcs/orbsvcs/DsEventLogAdmin +TAO/orbsvcs/orbsvcs/DsEventLogAdmin_Skel +TAO/orbsvcs/orbsvcs/DsEventLogAdmin_Serv +TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin_IDL +TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin +TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin_Skel +TAO/orbsvcs/orbsvcs/DsNotifyLogAdmin_Serv +TAO/orbsvcs/orbsvcs/PortableGroup +TAO/orbsvcs/orbsvcs/FTORB_Utils +TAO/orbsvcs/orbsvcs/FT_ClientORB +TAO/orbsvcs/orbsvcs/FT_ServerORB +TAO/orbsvcs/orbsvcs/FtRtEvent +TAO/orbsvcs/orbsvcs/FaultTolerance +TAO/orbsvcs/orbsvcs/CosLoadBalancing +TAO/orbsvcs/orbsvcs/IFRService +TAO/orbsvcs/orbsvcs/RTCORBAEvent +TAO/orbsvcs/orbsvcs/RT_Notification +TAO/orbsvcs/orbsvcs/RTEventLogAdmin_IDL +TAO/orbsvcs/orbsvcs/RTEventLogAdmin +TAO/orbsvcs/orbsvcs/RTEventLogAdmin_Skel +TAO/orbsvcs/orbsvcs/RTEventLogAdmin_Serv +TAO/orbsvcs/orbsvcs/Security +TAO/orbsvcs/Naming_Service/Naming_Service +TAO/orbsvcs/ImplRepo_Service/ImR_Activator_IDL +TAO/orbsvcs/ImplRepo_Service/ImR_Locator_IDL +TAO/orbsvcs/ImplRepo_Service/ImR_Activator +TAO/orbsvcs/ImplRepo_Service/ImR_Activator_Service +TAO/orbsvcs/ImplRepo_Service/ImR_Locator +TAO/orbsvcs/ImplRepo_Service/ImR_Locator_Service +TAO/orbsvcs/ImplRepo_Service/tao_imr +TAO/orbsvcs/FT_ReplicationManager/FT_ReplicationManager_Lib +TAO/orbsvcs/orbsvcs/FTRT_ClientORB +TAO/orbsvcs/tests/Concurrency/CC_client +TAO/orbsvcs/tests/Event/lib/Event_Test_Lib +TAO/orbsvcs/tests/Event/Mcast/Common/ECMcastTests_lib +TAO/orbsvcs/tests/Trading/Trading_Test_Lib +TAO/orbsvcs/examples/CosEC/RtEC_Based/lib/CosEC_RtEC_Based_lib +TAO/orbsvcs/performance-tests/RTEvent/lib/RTEC_Perf +TAO/tests/CSD_Strategy_Tests/TP_Common/CSD_TP_Test_Lib +TAO/tests/Smart_Proxies/Collocation/SP_Collocation_Idl +TAO/tests/Smart_Proxies/Collocation/SP_Collocation_TestStubsLib +TAO/tests/Collocation/Collocation_Idl +TAO/tests/Collocation/Collocation_Test_Stub +TAO/tests/Collocation/Collocation_Diamond +TAO/tests/ORB_Local_Config/Two_DLL_ORB/Two_DLL_ORB_Idl +TAO/tests/TransportCurrent/lib/Current_Test_Lib_Idl +TAO/tests/TransportCurrent/lib/Current_Test_Lib_Client +TAO/tests/TransportCurrent/lib/Current_Test_Lib_Server +TAO/examples/POA/Generic_Servant/POA_Generic_Servant_Lib +TAO/examples/Simple/time-date/Simple_Time_Date_Lib +TAO/docs/tutorials/Quoter/idl/Quoter_Idl_Lib +TAO/performance-tests/RTCorba/Multiple_Endpoints/Common/RTCORBA_Common +TAO/examples/RTScheduling/Job +TAO/examples/RTScheduling/RTSchedSynch +TAO/examples/RTScheduling/RTSchedTestLib +tests/Test_Output +tests/DLL_Test_Parent +TAO/tests/CSD_Strategy_Tests/TP_Common/CSD_TP_Test_Lib +performance-tests/Synch-Benchmarks/Synch_Lib/Synch_Lib +examples/Service_Configurator/Misc/Service_Configurator_Misc_Timer +examples/Timer_Queue/Timer_Queue_Library +ASNMP/asnmp/asnmp_lib +netsvcs/lib/netsvcs +netsvcs/clients/Naming/Client/Netsvsc_Client_Test_Lib +netsvcs/clients/Naming/Dump_Restore/Netsvcs_Dump_Restore_Lib +websvcs/lib/websvcs +protocols/ace/HTBP/HTBP +protocols/ace/RMCast/RMCast +protocols/ace/TMCast/TMCast +TAO/CIAO/CCF/CCF/CIDL/CIDL +TAO/CIAO/CCF/CCF/CodeGenerationKit/CodeGenerationKit +TAO/CIAO/CCF/CCF/CompilerElements/CompilerElements +TAO/CIAO/CCF/CCF/IDL2/IDL2 +TAO/CIAO/CCF/CCF/IDL3/IDL3 +TAO/CIAO/CIDLC/CIDLC +TAO/CIAO/ciao/CIAO_Client +TAO/CIAO/ciao/CIAO_Container +TAO/CIAO/ciaosvcs/Events/CIAO_Events_Base/CIAO_Events_Base +TAO/CIAO/DAnCE/Deployment/Deployment_stub +TAO/CIAO/ciaosvcs/Events/CIAO_RTEC/CIAO_RTEvent +TAO/CIAO/ciaosvcs/Events/CIAO_Events +TAO/CIAO/DAnCE/Deployment/Deployment_svnt +TAO/CIAO/DAnCE/Interfaces/ExecutionManager_stub +TAO/CIAO/DAnCE/DomainApplicationManager/DomainApplicationManager +TAO/CIAO/ciao/CIAO_Server +TAO/CIAO/DAnCE/ExecutionManager/ExecutionManager +TAO/CIAO/DAnCE/Interfaces/NodeManager_stub +TAO/CIAO/DAnCE/NodeApplication/Config_Manager +TAO/CIAO/DAnCE/NodeApplication/NodeApp_Configurator +TAO/CIAO/DAnCE/NodeApplication/NA_Configurator +TAO/CIAO/DAnCE/NodeApplication/NoOp_Configurator +TAO/CIAO/DAnCE/NodeApplication/NodeApplicationLib +TAO/CIAO/DAnCE/NodeApplication/NodeApplication +TAO/CIAO/DAnCE/NodeApplication/RTNA_Configurator +TAO/CIAO/DAnCE/TargetManager/CIAO_TargetManager_stub +TAO/CIAO/DAnCE/NodeApplicationManager/NodeApplicationManager +TAO/CIAO/DAnCE/NodeManager/Monitor_Monitorlib +TAO/CIAO/DAnCE/NodeManager/NodeManager_svnt +TAO/CIAO/DAnCE/NodeManager/NodeManager +TAO/CIAO/tools/Config_Handlers/XSC_XML_Generation +TAO/CIAO/tools/Config_Handlers/XSC_XML_Handlers +TAO/CIAO/tools/Config_Handlers/Utils/CIAO_XML_Utils +TAO/CIAO/tools/Config_Handlers/XSC_DynAny_Handler +TAO/CIAO/tools/Config_Handlers/XSC_Config_Handlers_Common +TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_XML_Generation +TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers +TAO/CIAO/tools/Config_Handlers/RT-CCM/RT_CCM_XML_Generation +TAO/CIAO/tools/Config_Handlers/RT-CCM/RT_CCM_Config_Handlers +TAO/CIAO/tools/Config_Handlers/XSC_Config_Handlers +TAO/CIAO/tools/Config_Handlers/Package_Handlers/Package_Config_Handlers +TAO/CIAO/DAnCE/RepositoryManager/RepositoryManager +TAO/CIAO/DAnCE/Plan_Generator/Plan_Generator +TAO/CIAO/DAnCE/Utils/DAnCE_Utils +TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher_Impl +TAO/CIAO/DAnCE/Plan_Launcher/Plan_Launcher +TAO/CIAO/DAnCE/RepositoryManager/RMAdmin +TAO/CIAO/DAnCE/StaticConfigurator/StaticDAnCEParser +TAO/CIAO/DAnCE/TargetManager/CIAO_TargetManager_svnt +TAO/CIAO/DAnCE/TargetManager/CIAO_TargetManager_exec +TAO/CIAO/DAnCE/TargetManager/TMClient +TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip_stub +TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip_svnt +TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_RoundTrip_exec +TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_client +TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_client_dynamic +TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_client_ex +TAO/CIAO/DAnCE/tests/NodeApplicationTest/NodeAppTest_client_simple +TAO/CIAO/bin/PerlCIAO/PerlCIAO +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_idl_gen +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_stub +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_skel +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockBroker_idl_gen +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockBroker_cidl_gen +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockBroker_stub +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockBroker_exec +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockBroker_svnt +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockBrokerDriver +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockDistributor_idl_gen +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockDistributor_cidl_gen +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockDistributor_stub +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockDistributor_exec +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockDistributor_svnt +TAO/CIAO/docs/tutorials/Quoter/Simple/Stock_Base/Stock_Base_StockDistributorDriver +TAO/CIAO/examples/BasicSP/BasicSP_lem_gen +TAO/CIAO/examples/BasicSP/BasicSP_stub_gen +TAO/CIAO/examples/BasicSP/BasicSP_stub +TAO/CIAO/examples/BasicSP/BasicSP_exec +TAO/CIAO/examples/BasicSP/BMClosedED/BMClosedED_lem_gen +TAO/CIAO/examples/BasicSP/BMClosedED/BMClosedED_stub_gen +TAO/CIAO/examples/BasicSP/BMClosedED/BMClosedED_stub +TAO/CIAO/examples/BasicSP/BMClosedED/BMClosedED_exec +TAO/CIAO/examples/BasicSP/BasicSP_svnt +TAO/CIAO/examples/BasicSP/BMClosedED/BMClosedED_svnt +TAO/CIAO/examples/BasicSP/BMDevice/BMDevice_lem_gen +TAO/CIAO/examples/BasicSP/BMDevice/BMDevice_stub_gen +TAO/CIAO/examples/BasicSP/BMDevice/BMDevice_stub +TAO/CIAO/examples/BasicSP/BMDevice/BMDevice_exec +TAO/CIAO/examples/BasicSP/BMDevice/BMDevice_svnt +TAO/CIAO/examples/BasicSP/BMDisplay/BMDisplay_lem_gen +TAO/CIAO/examples/BasicSP/BMDisplay/BMDisplay_stub_gen +TAO/CIAO/examples/BasicSP/BMDisplay/BMDisplay_stub +TAO/CIAO/examples/BasicSP/BMDisplay/BMDisplay_exec +TAO/CIAO/examples/BasicSP/BMDisplay/BMDisplay_svnt +TAO/CIAO/examples/BasicSP/EC/EC_stub_gen +TAO/CIAO/examples/BasicSP/EC/EC_stub +TAO/CIAO/examples/BasicSP/EC/EC_client +TAO/CIAO/examples/BasicSP/EC/EC_controller +TAO/CIAO/examples/BasicSP/EC/EC_lem_gen +TAO/CIAO/examples/BasicSP/EC/EC_exec +TAO/CIAO/examples/BasicSP/EC/EC_svnt +TAO/CIAO/examples/Display/Display_Base/Display_Base_idl_gen +TAO/CIAO/examples/Display/Display_Base/Display_Base_stub +TAO/CIAO/examples/Display/Display_Base/Display_Base_skel +TAO/CIAO/examples/Display/GPS/Display_GPS_idl_gen +TAO/CIAO/examples/Display/GPS/Display_GPS_cidl_gen +TAO/CIAO/examples/Display/GPS/Display_GPS_stub +TAO/CIAO/examples/Display/GPS/Display_GPS_exec +TAO/CIAO/examples/Display/GPS/Display_GPS_svnt +TAO/CIAO/examples/Display/NavDisplay/Display_NavDisplay_idl_gen +TAO/CIAO/examples/Display/NavDisplay/Display_NavDisplay_cidl_gen +TAO/CIAO/examples/Display/NavDisplay/Display_NavDisplay_stub +TAO/CIAO/examples/Display/NavDisplay/Display_NavDisplay_exec +TAO/CIAO/examples/Display/NavDisplay/Display_NavDisplay_svnt +TAO/CIAO/examples/Display/NavDisplayGUI_exec/Display_NavDisplayGUI_exec +TAO/CIAO/examples/Display/NavDisplayGUI_exec/Display_NavDisplayGUI_svnt +TAO/CIAO/examples/Display/RateGen/Display_RateGen_idl_gen +TAO/CIAO/examples/Display/RateGen/Display_RateGen_cidl_gen +TAO/CIAO/examples/Display/RateGen/Display_RateGen_stub +TAO/CIAO/examples/Display/RateGen/Display_RateGen_exec +TAO/CIAO/examples/Display/RateGen/Display_RateGen_svnt +TAO/CIAO/examples/Display/RateGen/Display_controller +TAO/CIAO/examples/Hello/Hello_Base/Hello_Base_idl_gen +TAO/CIAO/examples/Hello/Hello_Base/Hello_Base_stub +TAO/CIAO/examples/Hello/Hello_Base/Hello_Base_skel +TAO/CIAO/examples/Hello/Receiver/Hello_Receiver_idl_gen +TAO/CIAO/examples/Hello/Receiver/Hello_Receiver_cidl_gen +TAO/CIAO/examples/Hello/Receiver/Hello_Receiver_stub +TAO/CIAO/examples/Hello/Receiver/Hello_Receiver_exec +TAO/CIAO/examples/Hello/Receiver/Hello_Receiver_svnt +TAO/CIAO/examples/Hello/Sender/Hello_Sender_idl_gen +TAO/CIAO/examples/Hello/Sender/Hello_Sender_cidl_gen +TAO/CIAO/examples/Hello/Sender/Hello_Sender_stub +TAO/CIAO/examples/Hello/Sender/Hello_Sender_exec +TAO/CIAO/examples/Hello/Sender/Hello_Sender_svnt +TAO/CIAO/examples/Hello/Sender/Hello_starter +TAO/CIAO/examples/Null_Component/Null_Interface_idl_gen +TAO/CIAO/examples/Null_Component/Null_Interface_stub +TAO/CIAO/examples/Null_Component/Null_Interface_skel +TAO/CIAO/examples/Null_Component/Null_Component_idl_gen +TAO/CIAO/examples/Null_Component/Null_Component_cidl_gen +TAO/CIAO/examples/Null_Component/Null_Component_stub +TAO/CIAO/examples/Null_Component/Null_Component_exec +TAO/CIAO/examples/Null_Component/Null_Component_svnt +TAO/CIAO/examples/Null_Component/Null_Component_StaticDAnCEApp +TAO/CIAO/examples/Swapping/Hello_Base/Swapping_Hello_Base_idl_gen +TAO/CIAO/examples/Swapping/Hello_Base/Swapping_Hello_Base_stub +TAO/CIAO/examples/Swapping/Hello_Base/Swapping_Hello_Base_skel +TAO/CIAO/examples/Swapping/Receiver/Swapping_Hello_Receiver_idl_gen +TAO/CIAO/examples/Swapping/Receiver/Swapping_Hello_Receiver_cidl_gen +TAO/CIAO/examples/Swapping/Receiver/Swapping_Hello_Receiver_stub +TAO/CIAO/examples/Swapping/Receiver/Swapping_Hello_Receiver_exec +TAO/CIAO/examples/Swapping/Receiver/Swapping_Hello_Receiver_svnt +TAO/CIAO/examples/Swapping/Sender/Swapping_Hello_Sender_idl_gen +TAO/CIAO/examples/Swapping/Sender/Swapping_Hello_Sender_cidl_gen +TAO/CIAO/examples/Swapping/Sender/Swapping_Hello_Sender_stub +TAO/CIAO/examples/Swapping/Sender/Swapping_Hello_Sender_exec +TAO/CIAO/examples/Swapping/Sender/Swapping_Hello_Sender_exec_1 +TAO/CIAO/examples/Swapping/Sender/Swapping_Hello_Sender_exec_2 +TAO/CIAO/examples/Swapping/Sender/Swapping_Hello_Sender_svnt +TAO/CIAO/examples/Swapping/Sender/Swapping_Hello_Starter +TAO/CIAO/performance-tests/Benchmark/Benchmark_idl_gen +TAO/CIAO/performance-tests/Benchmark/Benchmark_stub +TAO/CIAO/performance-tests/Benchmark/Benchmark_skel +TAO/CIAO/performance-tests/Benchmark/Benchmark_server +TAO/CIAO/performance-tests/Benchmark/RoundTripClient/Benchmark_RoundTripClient_idl_gen +TAO/CIAO/performance-tests/Benchmark/RoundTripClient/Benchmark_RoundTripClient_cidl_gen +TAO/CIAO/performance-tests/Benchmark/RoundTripClient/Benchmark_RoundTripClient_stub +TAO/CIAO/performance-tests/Benchmark/RoundTripClient/Benchmark_RoundTripClient_exec +TAO/CIAO/performance-tests/Benchmark/RoundTripClient/Benchmark_RoundTripClient_svnt +TAO/CIAO/performance-tests/Benchmark/RoundTripClient/RoundTripClient_client +TAO/CIAO/performance-tests/Benchmark/Multi_Threaded/Multi_Threaded_client +TAO/CIAO/performance-tests/Benchmark/RoundTrip/Benchmark_RoundTrip_idl_gen +TAO/CIAO/performance-tests/Benchmark/RoundTrip/Benchmark_RoundTrip_cidl_gen +TAO/CIAO/performance-tests/Benchmark/RoundTrip/Benchmark_RoundTrip_stub +TAO/CIAO/performance-tests/Benchmark/RoundTrip/Benchmark_RoundTrip_exec +TAO/CIAO/performance-tests/Benchmark/RoundTrip/Benchmark_RoundTrip_svnt +TAO/CIAO/performance-tests/Benchmark/RoundTrip/RoundTrip_client +TAO/CIAO/performance-tests/Benchmark/RoundTripServer/RoundTrip_server +TAO/CIAO/performance-tests/Protocols/common/Protocols_idl_gen +TAO/CIAO/performance-tests/Protocols/common/Protocols_stub +TAO/CIAO/performance-tests/Protocols/common/Protocols_skel +TAO/CIAO/performance-tests/Protocols/Receiver/Protocols_Receiver_idl_gen +TAO/CIAO/performance-tests/Protocols/Receiver/Protocols_Receiver_cidl_gen +TAO/CIAO/performance-tests/Protocols/Receiver/Protocols_Receiver_stub +TAO/CIAO/performance-tests/Protocols/Receiver/Protocols_Receiver_exec +TAO/CIAO/performance-tests/Protocols/Receiver/Protocols_Receiver_svnt +TAO/CIAO/performance-tests/Protocols/Sender/Protocols_Sender_idl_gen +TAO/CIAO/performance-tests/Protocols/Sender/Protocols_Sender_cidl_gen +TAO/CIAO/performance-tests/Protocols/Sender/Protocols_Sender_stub +TAO/CIAO/performance-tests/Protocols/Sender/Protocols_Sender_exec +TAO/CIAO/performance-tests/Protocols/Sender/Protocols_Sender_svnt +TAO/CIAO/performance-tests/Protocols/Controller/Protocols_Controller +TAO/CIAO/tests/Bug_2130_Regression/interfaces/ENW_stub +TAO/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_stub +TAO/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_controller +TAO/CIAO/tests/Bug_2130_Regression/interfaces/ENW_skel +TAO/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_svnt +TAO/CIAO/tests/Bug_2130_Regression/SEC_CheckPoint/TSEC_CheckPoint_exec +TAO/CIAO/tests/CIDL/CodeGen/Basic_idl_gen +TAO/CIAO/tests/CIDL/CodeGen/Basic_stub +TAO/CIAO/tests/CIDL/CodeGen/Basic_skel +TAO/CIAO/tests/CIDL/CodeGen/Basic_CodeGen_idl_gen +TAO/CIAO/tests/CIDL/CodeGen/Basic_CodeGen_cidl_gen +TAO/CIAO/tests/CIDL/CodeGen/Basic_CodeGen_stub +TAO/CIAO/tests/CIDL/CodeGen/Basic_CodeGen_exec +TAO/CIAO/tests/CIDL/CodeGen/Basic_CodeGen_svnt +TAO/CIAO/tests/IDL3/Components/ComplexComponent/Attributes/Attributes_stub +TAO/CIAO/tests/IDL3/Components/ComplexComponent/EventSink/EventSink_stub +TAO/CIAO/tests/IDL3/Components/ComplexComponent/EventSource/EventSource_stub +TAO/CIAO/tests/IDL3/Components/ComplexComponent/Facets/Facets_stub +TAO/CIAO/tests/IDL3/Components/ComplexComponent/Receptacles/Receptacles_stub +TAO/CIAO/tests/IDL3/Components/SimpleComponent/SimpleComponent_stub +TAO/CIAO/tests/IDL3/Events/Abstract/Abstract_stub +TAO/CIAO/tests/IDL3/Events/Any/EventAny_local +TAO/CIAO/tests/IDL3/Events/Regular/Regular_stub +TAO/CIAO/tests/IDL3/Homes/Attributes/HomeAttributes_stub +TAO/CIAO/tests/IDL3/Homes/Basic/IDL3_Basic_stub +TAO/CIAO/tests/IDL3/Homes/Factory/Factory_stub +TAO/CIAO/tests/IDL3/Homes/Finder/Finder_stub +TAO/CIAO/tests/IDL3/Homes/Inheritance/Inheritance_stub +TAO/CIAO/tools/IDL3_to_IDL2/TAO_IDL3_TO_IDL2_BE +TAO/CIAO/tools/IDL3_to_IDL2/TAO_IDL3_TO_IDL2_EXE +TAO/CIAO/tests/IDL3/ImpliedIDL/All/ConvertIDL3 +TAO/CIAO/tests/IDL3/ImpliedIDL/Components/Basic/ICBasic_stub +TAO/CIAO/tests/IDL3/ImpliedIDL/Components/EventSink/ICEventSink_stub +TAO/CIAO/tests/IDL3/ImpliedIDL/Components/EventSource/ICEventSource_stub +TAO/CIAO/tests/IDL3/ImpliedIDL/Components/Receptacles/ICReceptacles_stub +TAO/CIAO/tests/IDL3/ImpliedIDL/Events/Events_stub +TAO/CIAO/tests/IDL3/ImpliedIDL/Homes/Homes_stub +TAO/CIAO/tests/IDL3/Lookup/LookupTest_stub +TAO/CIAO/tests/Minimum/Minimum_Base/Minimum_Base_idl_gen +TAO/CIAO/tests/Minimum/Minimum_Base/Minimum_Base_stub +TAO/CIAO/tests/Minimum/Minimum_Base/Minimum_Base_skel +TAO/CIAO/tests/Minimum/Receiver/Minimum_Base_Receiver_idl_gen +TAO/CIAO/tests/Minimum/Receiver/Minimum_Base_Receiver_cidl_gen +TAO/CIAO/tests/Minimum/Receiver/Minimum_Base_Receiver_stub +TAO/CIAO/tests/Minimum/Receiver/Minimum_Base_Receiver_exec +TAO/CIAO/tests/Minimum/Receiver/Minimum_Base_Receiver_svnt +TAO/CIAO/tests/Minimum/Sender/Minimum_Base_Sender_idl_gen +TAO/CIAO/tests/Minimum/Sender/Minimum_Base_Sender_cidl_gen +TAO/CIAO/tests/Minimum/Sender/Minimum_Base_Sender_stub +TAO/CIAO/tests/Minimum/Sender/Minimum_Base_Sender_exec +TAO/CIAO/tests/Minimum/Sender/Minimum_Base_Sender_svnt +TAO/CIAO/tools/Config_Handlers/CIAO_Events/CIAO_Events_Handlers_Tests +TAO/CIAO/tools/Config_Handlers/XSC_Config_Handlers_Tests +TAO/CIAO/tools/Config_Handlers/Package_Handlers/Package_Config_Handlers_Tests diff --git a/ACE/bin/mwc.pl b/ACE/bin/mwc.pl new file mode 100755 index 00000000000..c547851e21d --- /dev/null +++ b/ACE/bin/mwc.pl @@ -0,0 +1,66 @@ +eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' + & eval 'exec perl -w -S $0 $argv:q' + if 0; + +# ****************************************************************** +# Author: Chad Elliott +# Date: 6/17/2002 +# $Id$ +# ****************************************************************** + +# ****************************************************************** +# Pragma Section +# ****************************************************************** + +require 5.006; + +use strict; +use FindBin; +use File::Spec; +use File::Basename; + +my($basePath) = $FindBin::Bin; +if ($^O eq 'VMS') { + $basePath = File::Spec->rel2abs(dirname($0)) if ($basePath eq ''); + $basePath = VMS::Filespec::unixify($basePath); +} +$basePath .= '/MakeProjectCreator'; + +my($mpcroot) = $ENV{MPC_ROOT}; +my($mpcpath) = (defined $mpcroot ? $mpcroot : + dirname(dirname($basePath)) . '/MPC'); +unshift(@INC, $mpcpath . '/modules'); + +if (defined $mpcroot) { + print STDERR "MPC_ROOT was set to $mpcroot.\n"; +} + +if (! -d "$mpcpath/modules") { + print STDERR "ERROR: Unable to find the MPC modules in $mpcpath.\n"; + if (defined $mpcroot) { + print STDERR "Your MPC_ROOT environment variable does not point to a ", + "valid MPC location.\n"; + } + else { + print STDERR "You can set the MPC_ROOT environment variable to the ", + "location of MPC.\n"; + } + exit(255); +} + +require Driver; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub getBasePath { + return $mpcpath; +} + +# ************************************************************ +# Main Section +# ************************************************************ + +my($driver) = new Driver($basePath, basename($0)); +exit($driver->run(@ARGV)); diff --git a/ACE/bin/package_copy_script.sh b/ACE/bin/package_copy_script.sh new file mode 100755 index 00000000000..2398d3d2908 --- /dev/null +++ b/ACE/bin/package_copy_script.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +for i in *.gz *.bz2 *.zip; do + d=`echo $i | sed 's/\.[tz][ai][rp]/-5.5.10&/'` + echo "Copying $i to $d" + cp -ip $i /export/www/download.dre/previous_versions/$d +done diff --git a/ACE/bin/performance_stats.sh b/ACE/bin/performance_stats.sh new file mode 100755 index 00000000000..85143de5d71 --- /dev/null +++ b/ACE/bin/performance_stats.sh @@ -0,0 +1,199 @@ +#!/bin/sh +# +# $Id$ +# + +if [ $# -lt 2 ]; then + echo "Usage: $0 <ACE_ROOT> <DEST>" + exit 0 +fi + +ACE_ROOT=$1 +DEST=$2 +DATE=`date +%Y/%m/%d-%H:%M` + +COMMON_TESTS="AMI DII DSI Deferred Single_Threaded Thread_Per_Connection Thread_Pool AMH_Single_Threaded" + +SEQUENCE_TESTS="AMI DII DSI Deferred Single_Threaded Thread_Per_Connection Thread_Pool AMH_Single_Threaded" + +SEQ_TEST_TYPE="octet long short char double longlong" + +cd $DEST/source + +/bin/sync +sleep 10 +( + cd $ACE_ROOT/performance-tests/TCP; + ./run_test.pl +) >tcp_test.log 2>&1 + +if grep -q 'Client throughput: ' tcp_test.log; then + ( + echo -n $DATE " "; + awk '/^Client throughput:/ {print $3}' tcp_test.log + ) >> TCP.txt; +fi + +/bin/sync +sleep 10 +( + cd $ACE_ROOT/TAO/performance-tests/Latency/Single_Threaded; + ./default_configuration.pl > $DEST/source/Default.log 2>&1 +) +if grep -q 'Total throughput: ' Default.log; then + ( + echo -n $DATE " "; + awk '/^Total throughput:/ {print $3}' Default.log + ) >> Default.txt +fi + +/bin/sync +sleep 2 +( + cd $ACE_ROOT/TAO/performance-tests/Sequence_Latency/Single_Threaded; + + for i in $SEQ_TEST_TYPE; do + ( + ./default_configuration.pl -t $i > $DEST/source/Sequence_Default_${i}.log 2>&1 + if grep -q 'Total throughput: ' $DEST/source/Sequence_Default_${i}.log; then + ( + echo -n $DATE " "; + awk '/^Total throughput:/ {print $3}' $DEST/source/Sequence_Default_${i}.log + ) >> $DEST/source/Sequence_Default_${i}.txt + fi + ) + done + +) + +for i in $COMMON_TESTS; do + /bin/sync + sleep 10 + ( + cd $ACE_ROOT/TAO/performance-tests/Latency/${i}; + ./run_test.pl > $DEST/source/${i}.log 2>&1 + ) + if grep -q 'Total throughput: ' ${i}.log; then + ( + echo -n $DATE " "; + awk '/^Total throughput:/ {print $3}' $DEST/source/${i}.log + ) >> ${i}.txt + fi +done + +for i in $SEQUENCE_TESTS; do + /bin/sync + sleep 10 + ( + cd $ACE_ROOT/TAO/performance-tests/Sequence_Latency/${i}; + for j in $SEQ_TEST_TYPE; do + ( + ./run_test.pl -t $j > $DEST/source/Sequence_${i}_${j}.log 2>&1 + + if grep -q 'Total throughput: ' $DEST/source/Sequence_${i}_${j}.log; then + ( + echo -n $DATE " "; + awk '/^Total throughput:/ {print $3}' $DEST/source/Sequence_${i}_${j}.log + ) >> $DEST/source/Sequence_${i}_${j}.txt + fi + ) + done + ) + +done + +for i in $COMMON_TESTS TCP Default; do + $ACE_ROOT/bin/generate_performance_chart.sh ${i}.txt ${i}.png "$i" + /bin/cp ${i}.png $DEST/images/${i}.png + /usr/bin/tac ${i}.txt > $DEST/data/${i}.txt + /usr/bin/tail -5 ${i}.txt > $DEST/data/LAST_${i}.txt +done + +for i in $SEQ_TEST_TYPE ; do + $ACE_ROOT/bin/generate_performance_chart.sh Sequence_Default_${i}.txt Sequence_Default_${i}.png "Default Configuration for $i sequences" + /bin/cp Sequence_Default_${i}.png $DEST/images/Sequence_Default_${i}.png + /usr/bin/tac $DEST/source/Sequence_Default_${i}.txt > $DEST/data/Sequence_Default_${i}.txt + /usr/bin/tail -5 $DEST/source/Sequence_Default_${i}.txt > $DEST/data/LAST_Sequence_Default_${i}.txt +done + +for i in $SEQUENCE_TESTS; do +for j in $SEQ_TEST_TYPE; do + $ACE_ROOT/bin/generate_performance_chart.sh Sequence_${i}_${j}.txt Sequence_${i}_${j}.png "Sequence_$i_$j" + /bin/cp Sequence_${i}_${j}.png $DEST/images/Sequence_${i}_${j}.png + /usr/bin/tac Sequence_${i}_${j}.txt > $DEST/data/Sequence_${i}_${j}.txt + /usr/bin/tail -5 Sequence_${i}_${j}.txt > $DEST/data/LAST_Sequence_${i}_${j}.txt +done +done + +gnuplot <<_EOF_ >/dev/null 2>&1 + set xdata time + set timefmt '%Y/%m/%d-%H:%M' + set xlabel 'Date (YYYYMMDD)' + set ylabel 'Throughput (Requests/Second)' + set yrange [0:] + set terminal png small size 800,600 color + set output "/dev/null" + plot 'AMI.txt' using 1:2 title 'AMI' w l + replot 'DII.txt' using 1:2 title 'DII' w l + replot 'DSI.txt' using 1:2 title 'DSI' w l + replot 'Deferred.txt' using 1:2 title 'Deferred' w l + replot 'Single_Threaded.txt' using 1:2 title 'Single_Threaded' w l + replot 'Default.txt' using 1:2 title 'Single_Threaded (Defaults)' w l + replot 'Thread_Per_Connection.txt' using 1:2 title 'Thread_Per_Connection' w l + replot 'Thread_Pool.txt' using 1:2 title 'Thread_Pool' w l + replot 'AMH_Single_Threaded.txt' using 1:2 title 'AMH' w l + replot 'TCP.txt' using 1:2 title 'TCP/IP' w l + set output "All.png" + replot + exit +_EOF_ + +gnuplot <<_EOF_ >/dev/null 2>&1 + set xdata time + set timefmt '%Y/%m/%d-%H:%M' + set xlabel 'Date (YYYYMMDD)' + set ylabel 'Throughput (Requests/Second)' + set yrange [0:35000] + set terminal png small size 800,600 color + set output "/dev/null" + plot 'AMI.txt' using 1:2 title 'AMI' w l + replot 'DII.txt' using 1:2 title 'DII' w l + replot 'DSI.txt' using 1:2 title 'DSI' w l + replot 'Deferred.txt' using 1:2 title 'Deferred' w l + replot 'Single_Threaded.txt' using 1:2 title 'Single_Threaded' w l + replot 'Default.txt' using 1:2 title 'Single_Threaded (Defaults)' w l + replot 'Thread_Per_Connection.txt' using 1:2 title 'Thread_Per_Connection' w l + replot 'Thread_Pool.txt' using 1:2 title 'Thread_Pool' w l + replot 'AMH_Single_Threaded.txt' using 1:2 title 'AMH' w l + set output "CORBA.png" + replot + exit +_EOF_ + +/bin/cp CORBA.png All.png $DEST/images/ + +MOGRIFY=/usr/local/bin/mogrify +if [ ! -x "$MOGRIFY" ]; then + MOGRIFY=/usr/X11R6/bin/mogrify +fi + +( + cd $DEST/images + /bin/cp *.png thumbnails + for i in *.png; do + $MOGRIFY -geometry '25%' thumbnails/$i + done +) + +cd $DEST/data +/bin/uname -a > uname.txt +/usr/bin/gcc -v > gcc.txt 2>&1 +/usr/bin/gcc -dumpversion > gccversion.txt 2>&1 +/lib/libc.so.6 | sed -e 's/</\</g' -e 's/>/\>/g' > libc.txt +cat /proc/cpuinfo > cpuinfo.txt +cat /proc/meminfo > meminfo.txt +cat /etc/SuSE-release > linuxversion.txt + +cat $ACE_ROOT/ace/config.h > config.h.txt +cat $ACE_ROOT/include/makeinclude/platform_macros.GNU > platform_macros.GNU.txt +cp $ACE_ROOT/html/Stats/* $DEST diff --git a/ACE/bin/pippen.pl b/ACE/bin/pippen.pl new file mode 100755 index 00000000000..8c8c55b8a04 --- /dev/null +++ b/ACE/bin/pippen.pl @@ -0,0 +1,419 @@ +# $Id$ + +BEGIN { + use Cwd; + if (!$ENV{ACE_ROOT}) { + $ACE_ROOT = getcwd ()."\\"; + print STDERR "Error: ACE_ROOT not defined\n"; + exit 1; + } + else { + $ACE_ROOT = $ENV{ACE_ROOT}; + } +} +use lib "$ACE_ROOT/bin"; +use PerlACE::MSProject::DSP; +use PerlACE::MSProject::VCP; +use File::DosGlob 'glob'; +use DirHandle; +use strict; + +################################################################################ + +my $extension; +my $recurse = 0; +my $list = 0; +my $verbose = 0; +my @arguments; +my @configs; +my @roots; +my $auto_compile = 0; +my $clean = 0; +my $debug = 0; + +my $aceroot = 0; + +################################################################################ + +# Parse command line arguments + +while ( $#ARGV >= 0) +{ + if ($ARGV[0] =~ m/^-list/i) { + $list = 1; + } + elsif ($ARGV[0] =~ m/^-evc3/i) { + $extension = "vcp"; + } + elsif ($ARGV[0] =~ m/^-msvc6/i) { + $extension = "dsp"; + } + elsif ($ARGV[0] =~ m/^-msvc7/i) { + $extension = "vcproj"; + } + elsif ($ARGV[0] =~ m/^-config/i) { + push @configs, $ARGV[1]; + shift; + } + elsif ($ARGV[0] =~ m/^-r/i) { + $recurse = 1; + } + elsif ($ARGV[0] =~ m/^-v/i) { + $verbose = 1; + } + elsif ($ARGV[0] =~ m/^-auto_compile/i) { + $auto_compile = 1; + } + elsif ($ARGV[0] =~ m/^-clean/i) { + $clean = 1; + } + elsif ($ARGV[0] =~ m/^-useroot/i) { + push @roots, $ARGV[1]; + shift; + } + elsif ($ARGV[0] =~ m/^-aceroot/i) { + $aceroot = 1; + } + elsif ($ARGV[0] =~ m/^-(\?|h)/i) { # Help information + print "Options\n"; + print "-list - Prints out the list of project files\n"; + print "-config <c> - Use <c> as a configuratoin\n"; + print "-evc3 - Looks for eMbedded Visual C++ 3.0 projects\n"; + print "-msvc6 - Looks for Visual C++ 5.0/6.0 projects\n"; + print "-msvc7 - Looks for Visual C++ 7.0 projects\n"; + print "-clean - Clean instead of building\n"; + print "-recurse - Recurse into directories\n"; + print "-verbose - Make some noise\n"; + print "-auto_compile - Print out auto_compile info during build\n"; + print "-useroot <dir> - Use <dir> as a root to look for dependencies\n"; + print "-aceroot - Use %ACE_ROOT% as a dependency root\n"; + exit; + } + elsif ($ARGV[0] =~ m/^-/) { + warn "$0: unknown option $ARGV[0]\n"; + exit 1; + } + else { + push @arguments, $ARGV[0]; + } + shift; +} + +if ($#configs < 0) { + if (defined $ENV{WINMAKE_CONFIGS}) { + @configs = split /:/, $ENV{WINMAKE_CONFIGS}; + } + elsif (defined $ENV{PIPPEN_CONFIGS}) { + @configs = split /:/, $ENV{PIPPEN_CONFIGS}; + } + else { + print STDERR "Error: No config specified\n"; + exit 1; + } +} + +if (!defined $extension) { + my $compiler = ''; + if (defined $ENV{WINMAKE_COMPILER}) { + $compiler = $ENV{WINMAKE_COMPILER}; + } + elsif (defined $ENV{PIPPEN_COMPILER}) { + $compiler = $ENV{PIPPEN_COMPILER}; + } + else { + print STDERR "Error: No compiler specified\n"; + exit 1; + } + + if ($compiler eq "evc3") { + $extension = "vcp"; + } + elsif ($compiler eq "msvc6") { + $extension = "dsp"; + } + elsif ($compiler eq "msvc7") { + $extension = "vcproj"; + } +} + +################################################################################ + +# I like these variables + +# %projects->{$file}->{BUILD} <- Are we supposed to build this file? +# ->{PROJ} <- MSProject object +# ->{CONFIGS}->{$config}->{DEPS} <- List of dependencies +# ->{DONE} <- Have we compiled it yet? + +my %projects; + +# %names->{$output} <- points to the $file used in the above %projects + +my %names; + +################################################################################ + +# Expand all the files/directories passed in on the command line + +sub ProjectSearch ($@) +{ + my $build = shift; + my @targets = @_; + + while ($#targets >= 0) { + my $target = $targets[0]; + if (-d $target) { + print " Reading Directory $target\n" if ($verbose); + if ($recurse) { + my $dh = new DirHandle ($target); + + if (defined $dh) { + foreach my $entry ($dh->read ()) { + if (-d "$target/$entry" && $entry ne "." && $entry ne "..") { + $entry =~ s/^.\\//; # / <- fix for color coding in devenv + push @targets, ($target . "\\". $entry); + } + } + } + else { + print STDERR "Error: Cannot read $target: $!\n"; + } + } + + foreach my $t (glob ($target . "\\*." . $extension)) { + print " Adding project $t\n" if ($verbose); + %projects->{$t}->{BUILD} = $build; + } + } + else { + foreach my $t (glob ($target)) { + print " Adding project $t\n" if ($verbose); + %projects->{$t}->{BUILD} = $build; + } + } + shift @targets; + } +} + +print "=== Expanding Command line Arguments\n" if ($verbose); + +if ($#arguments < 0) { + print " No files specified, defaulting to \".\"\n" if ($verbose); + push @arguments, ("."); +} + +ProjectSearch (1, @arguments); + +print "=== Expanding Root Arguments\n" if ($verbose); + +ProjectSearch (0, @roots); + +if ($aceroot == 1) { + my $oldrecurse = $recurse; + $recurse = 1; + my @aceroots = ($ENV{ACE_ROOT}."\\ace", + $ENV{ACE_ROOT}."\\apps\\gperf\\src", + $ENV{ACE_ROOT}."\\TAO\\TAO_IDL", + $ENV{ACE_ROOT}."\\TAO\\tao", + $ENV{ACE_ROOT}."\\TAO\\orbsvcs\\orbsvcs"); + ProjectSearch (0, @aceroots); + $recurse = $oldrecurse; +} + +################################################################################ + +# Read each project file to gather dependency and output information + +print "=== Reading Project Files\n" if ($verbose); + +foreach my $project (keys %projects) { + my $proj; + + if ($project =~ m/\.dsp$/i) { + $proj = new PerlACE::MSProject::DSP ($project); + } + elsif ($project =~ m/\.vcp$/i) { + $proj = new PerlACE::MSProject::VCP ($project); + } + elsif ($project =~ m/\.vcproj$/i) { + print STDERR "Error: MSVC7 not supported yet\n"; + } + else { + print STDERR "Error: Unrecognized file: $project\n"; + } + + print " Loading $project:" if ($verbose); + + $proj->Load (); + + foreach my $config (@configs) { + foreach my $proj_config ($proj->Configs ()) { + if ($proj_config =~ m/\Q$config\E/i) { + print " \"$proj_config\"" if ($verbose); + my $name = $proj->DepOutputFile ($proj_config); + + %names->{lc $name} = $project; + my @deps = split / /, $proj->Libs ($proj_config); + + foreach my $dep (@deps) { +# $dep =~ s/.*[\/\\]//g; + push (@{%projects->{$project}->{CONFIGS}->{$proj_config}->{DEPS}}, $dep); + } + if ($proj->UsesTAOIDL () == 1) { + push @{%projects->{$project}->{CONFIGS}->{$proj_config}->{DEPS}}, ("gperf.exe", "tao_idl.exe"); + } + } + } + } + + print "\n" if ($verbose); + + %projects->{$project}->{PROJ} = $proj; +} + +################################################################################ + +# Clean out the dependency lists, we only keep the libraries which we know +# how to generate + +print "=== Cleaning out Dependency Lists\n" if ($verbose); + +foreach my $project (keys %projects) { + foreach my $config (keys %{%projects->{$project}->{CONFIGS}}) { + print " Cleaning Dependencies: $project ($config)\n" if ($verbose); + print " Before:", join (" ", @{%projects->{$project}->{CONFIGS}->{$config}->{DEPS}}), "\n" if ($verbose); + my @newdeps; + foreach my $dep (@{%projects->{$project}->{CONFIGS}->{$config}->{DEPS}}) { + $dep =~ s/.*[\/\\]//g; + + if (defined %names->{lc $dep}) { + push @newdeps, $dep; + } + } + print " After:", join (" ", @newdeps), "\n" if ($verbose); + @{%projects->{$project}->{CONFIGS}->{$config}->{DEPS}} = @newdeps; + } +} + +################################################################################ + +# Make sure to build any dependencies found + +print "=== Walking Dependency Lists\n" if ($verbose); + +my $finished = 0; + +do { + $finished = 1; + foreach my $project (keys %projects) { + foreach my $config (keys %{%projects->{$project}->{CONFIGS}}) { + if (%projects->{$project}->{BUILD} == 1) { + foreach my $dep (@{%projects->{$project}->{CONFIGS}->{$config}->{DEPS}}) { + if (%projects->{%names->{lc $dep}}->{BUILD} != 1) { + %projects->{%names->{lc $dep}}->{BUILD} = 1; + $finished = 0; + } + } + } + } + } + +} while (!$finished); + + +################################################################################ + +# Output a list, if requested + +if ($debug) { + print "List of Dependencies\n"; + print "--------------------\n"; + foreach my $project (keys %projects) { + print "=== $project\n"; + foreach my $config (keys %{%projects->{$project}->{CONFIGS}}) { + print " Config: $config\n"; + print " Depends: ", join (" ", @{%projects->{$project}->{CONFIGS}->{$config}->{DEPS}}), "\n"; + } + } + + print "\n"; + print "List of Outputs\n"; + print "---------------\n"; + + foreach my $name (keys %names) { + print "$name\n"; + } +} + +################################################################################ + +# Loop through and + +print "=== Compiling\n" if ($verbose); + +my $compilations; # Keep track of the number of compiles done during a pass +my $unfinished; +my $loop = 1; + +do { + $compilations = 0; + $unfinished = 0; + + foreach my $project (keys %projects) { + if (%projects->{$project}->{BUILD} == 1) { + foreach my $config (keys %{%projects->{$project}->{CONFIGS}}) { + if (%projects->{$project}->{CONFIGS}->{$config}->{DONE} != 1) { + my $depsleft = 0; + foreach my $dep (@{%projects->{$project}->{CONFIGS}->{$config}->{DEPS}}) { + if (%projects->{%names->{lc $dep}}->{CONFIGS}->{$config}->{DONE} != 1) { + ++$depsleft; + } + } + + if ($depsleft == 0) { + ++$compilations; + print "Auto_compiling $project : $config\n" if ($auto_compile); + + if ($list == 1) { + if ($clean == 1) { + print "Cleaning "; + } + else { + print "Compiling "; + } + + print "$project : $config\n"; + } + elsif ($clean == 1) { + %projects->{$project}->{PROJ}->Clean ($config); + } + else { + %projects->{$project}->{PROJ}->Build ($config); + } + + %projects->{$project}->{CONFIGS}->{$config}->{DONE} = 1; + } + else { + ++$unfinished; + } + } + } + } + } + + print " === Loop $loop: $compilations compiles, $unfinished left\n" if ($verbose); + ++$loop; +} while ($compilations != 0); + +# Loop through and see if anything wasn't compiled. If so, this means either there is +# an error in the script or that there are circular dependencies + +foreach my $project (keys %projects) { + if (%projects->{$project}->{BUILD} == 1) { + foreach my $config (keys %{%projects->{$project}->{CONFIGS}}) { + if (%projects->{$project}->{CONFIGS}->{$config}->{DONE} != 1) { + print STDERR "Error: Project not compiled: $project - $config\n", + } + } + } +} diff --git a/ACE/bin/regenerate_exports.pl b/ACE/bin/regenerate_exports.pl new file mode 100755 index 00000000000..95e6bf67986 --- /dev/null +++ b/ACE/bin/regenerate_exports.pl @@ -0,0 +1,54 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# Goes through ACE/TAO and replaces + +use File::Find; +use Cwd; + +$args = ''; +$root = cwd.'/'; + +while ($#ARGV >= 0) { + $args = $args . ' ' . shift @ARGV; +} + +# wanted is only used for the File::Find +sub wanted +{ + my $file = $File::Find::name; + + $file =~ s/\.\//$root/; + + if ($File::Find::name =~ /\_export\.h$/i) { + my $flag = 0; + my $name = ''; + + if (!open (FILE, $file)) { + print STDERR "Error: Could not open $file\n"; + } + + while (<FILE>) { + $flag = 1 if ((/generate_export/ || /GenExportH/) && $flag == 0); + $name = $1 if (/define (\w*)_Export/); + } + + if ($flag == 1) { + print "Regenerating: $file\n"; + if ($OSNAME eq 'MSWIn32') { + $file =~ s/\//\\/g; + } + system ("perl -S generate_export_file.pl $args $name > $file"); + } + else { + print "Skipping: $file\n"; + } + close FILE; + } +} + + +find (\&wanted, "."); + diff --git a/ACE/bin/reverse_clean b/ACE/bin/reverse_clean new file mode 100755 index 00000000000..37d77daee50 --- /dev/null +++ b/ACE/bin/reverse_clean @@ -0,0 +1,25 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; +# -*- perl -*- +# $Id$ +# +# This script does a realclean of the list in the reverse order that +# is passed to this. This is just a utility script + +@ARGS = (); + +if ($ARGV[0] eq ''){ + print STDERR "$0: No directories provided\n"; + die "provide list of directories"; +} + +my $make = $ARGV[0]; +shift; + +@BUILD_LIST = @ARGV; + + +foreach $i (reverse (@BUILD_LIST)) { + system ("$make -k -C $i realclean"); +} diff --git a/ACE/bin/run_all.pl b/ACE/bin/run_all.pl new file mode 100755 index 00000000000..dfa4841262c --- /dev/null +++ b/ACE/bin/run_all.pl @@ -0,0 +1,224 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# -*- perl -*- +# $Id$ +# +# This script execute the test programs (usually, other scripts) in +# the RUN_LIST defined below. If it detects any problem it send email. +# +# This script requires ActivePerl for Win32 and libnet from CPAN. +# +# Usage: run_all.pl <log directory> <admin email address> +# +# For example: run_all.pl /tmp/log peter_pan@neverland.org + +use Net::SMTP; +use File::Basename; +use FileHandle; +require POSIX; + +push @INC, $ENV{'ACE_ROOT'}.'/bin'; +require run_all_list; + +# Find out the command name. +$CMD = basename($0); + +$single_threaded = 0; +$minimum_corba = 0; +$dont_run = 0; +$report_success = 0; +$debug = 0; +$ami=0 +@ARGS = (); +while ($#ARGV >= 0) { + if (!($ARGV[0] =~ m/-/)) { + push @ARGS, $ARGV[0]; + shift; + } elsif ($ARGV[0] eq "-single_threaded") { + $single_threaded = 1; + shift; + } elsif ($ARGV[0] eq "-minimum_corba") { + $minimum_corba = 1; + shift; + } elsif ($ARGV[0] eq "-ami") { + $ami = 1; + shift; + } elsif ($ARGV[0] eq "-report_success") { + $report_success = 1; + shift; + } elsif ($ARGV[0] eq "-debug") { + $debug = 1; + shift; + } +} + +# We obtain our revision to report errors. +$REVISION='$Revision$ '; + +# Extract configuration information from command line. + # TODO: Some validation and checking should be done here. +$LOGDIR = $ARGS[0]; +$ADMIN = $ARGS[1]; +$MAIL = "mail"; +if ($#ARGS >= 2) { + $MAIL = $ARGS[2]; +} + +$disable_file = $LOGDIR . '/.disable'; +$histfile = $LOGDIR . '/history'; +$LOGBASE = POSIX::strftime("%b%d_%Y.log", localtime); +$LOGFILE = $LOGDIR . '/' . $LOGBASE; +$HOST = `hostname`; +chop $HOST; +$LOG_NAME = $HOST . "_" . $BUILD . "_" . $LOGBASE; +$STATUS = "OK"; + +sub report_errors { + # Now send a summary of the errors to the ADMIN account... + local $to = $ADMIN; + + open (MAIL, "|".$MAIL.' -s [AUTO_COMPILE] '.$to) + || die "Cannot open mail pipe for: $_\n"; + + print MAIL 'The following message is brought to you by: ', "\n"; + print MAIL $CMD, ' [', $REVISION, "] for $BUILD on $CHECKOUT\n"; + + local $m; + foreach $m (@_) { + print MAIL $m, "\n"; + } + + print MAIL "\nPlease check the following log for more info:\n\n"; + print MAIL 'http://www.cs.wustl.edu/~bugzilla/auto_compile_logs/', + $LOG_NAME, "\n\n"; + + close (MAIL); # Ignore errors.... + +# # Now send the complete log to bugzilla... +# local $bugs = 'bugzilla'.'@cs.wustl.edu'; +# open (MAIL, "|".$MAIL.' -s AUTO_COMPILE_LOG='.$LOG_NAME.' '.$bugs) +# || die "Cannot open mail pipe for: $LOG_NAME\n"; + +# print MAIL 'This is the log for: ', "\n"; +# print MAIL $CMD, ' [', $REVISION, "] for $BUILD on $CHECKOUT\n"; + +# print MAIL "\n================================================================\n"; + +# if (open (THELOG, "$LOGFILE")) +# { +# while (<THELOG>) { +# print MAIL $_; +# } +# close (THELOG); +# } +# close (MAIL); # Ignore errors.... +} + +### MAIN FUNCTION + +$histfile = $LOGDIR . '/history'; +open(HIST, '>>' . $histfile) + # Do not use 'die' to report the problem, it tries to use HIST.... + || die "cannot open history file \"$histfile\"\n"; + +$date = localtime; + +print HIST $CMD, ': running at ', $date, ' '; + +if (-f $disable_file) { + print HIST "DISABLED\n"; + exit 0; +} + +open (DISABLE, '>' . $disable_file) + || die "cannot open disable file"; +print DISABLE "auto_compile <$date> is running\n"; +close (DISABLE) + || die "cannot close disable file"; + +$LOGFILE = $LOGDIR . '/' . POSIX::strftime("%b%d_%Y.log", localtime); +open(LOG, '>' . $LOGFILE) + || die "cannot open log file"; + +LOG->autoflush (); + +@failures = (); + +if ($dont_run == 0) { + @LIST = @RUN_LIST; + if ($single_threaded) { + @LIST = @SINGLE_THREADED_LIST; + } elsif ($minimum_corba) { + @LIST = @MINIMUM_CORBA_LIST; + } elsif ($ami) { + @LIST = @AMI_CORBA_LIST; + } + + $DIR = $ENV{'PWD'}; + foreach $i (@LIST) { + local @test_info = split (/\ \,\ /, $i); + local $directory = $test_info[0]; + local $program = $test_info[1]; + + $date = localtime; + print LOG "$CMD: =============================================\n"; + print LOG "$CMD: running $program in $directory at ", $date, "\n"; + local $subdir = $DIR . '/' . $directory; + chdir ($subdir) + || die "cannot chdir to $subdir"; + + $run_error = 0; + if (open(RUN, "perl $program 2>&1 |") == 0) { + push @failures, "cannot run $program in $directory"; + next; + } + while (<RUN>) { + print LOG $_; + if (m/Error/ + || m/FAILED/ + || m/EXCEPTION/ + || m/pure virtual /i) { + if ($STATUS eq "OK") { + $STATUS = "RUNTIME ERROR"; + } + $run_error = 1; + } + } + if (close(RUN) == 0) { + if ($STATUS eq "OK") { + $STATUS = "RUNTIME ERROR"; + } + push @failures, "Error when closing pipe for $program in $directory"; + next; + } + $date = localtime; + print LOG "$CMD: $program finished ", $date, "\n"; + + if ($run_error != 0) { + push @failures, + "errors detected while running $program in $directory"; + } + } +} + +if ($#failures >= 0) { + report_errors @failures; +} + +close(LOG) + || die "cannot close LOGFILE"; + +print HIST "$STATUS\n"; +close(HIST) + || die "cannot close history file"; + +unlink $disable_file + || die "cannot unlink disable file"; + +if ($report_success) { + report_errors "Congratulations: No errors or warnings detected\n"; +} + +exit 0; diff --git a/ACE/bin/run_all_win32.pl b/ACE/bin/run_all_win32.pl new file mode 100755 index 00000000000..84021c3a8d9 --- /dev/null +++ b/ACE/bin/run_all_win32.pl @@ -0,0 +1,180 @@ +# -*- perl -*- +# $Id$ +# +# This script execute the test programs (usually, other scripts) in +# the RUN_LIST defined below. If it detects any problem it send email. +# +# This script requires ActivePerl for Win32 and libnet from CPAN. +# +# Usage: run_all_win32.pl <log directory> <admin email address> +# +# For example: run_all_win32.pl c:\log peter_pan@neverland.org + +use Net::SMTP; +use File::Basename; +use FileHandle; +require POSIX; + +use lib "$ENV{ACE_ROOT}/bin"; +require run_all_list; + +# This is the module we will checkout, someday someone could define a +# smaller module. +$MODULE='ACE_wrappers'; + +# The following are for redirecting execution results to temporary files. +$exe_log_name='run_test.log'; # Name of the tempfile used. + +# If using 'sh'. +$sh_cmd="c:/bin/sh "; +$sh_redirection=" > $exe_log_name 2>&1"; + +#if using '4nt', 4nt is not quite working yet. +$four_nt_cmd="d:/Utils/4NT301/4NT.EXE "; +$four_nt_redirection=" >& $exe_log_name"; + +# Pick the one your like. +$shell_invoke = $sh_cmd; +$redirect_output = $sh_redirection; + +# We obtain our revision to report errors. +#$REVISION='$Revision$'; + +# Find out the command name. +$CMD = basename($0); + +# Extract configuration information from command line. +# TODO: Some validation and checking should be done here. +$LOGDIR = $ARGV[0]; +$ADMIN = $ARGV[1]; + +# When an error is found we try to die gracefully and send some email +# to ADMIN. + +$disable_file = $LOGDIR . '/.disable'; + +sub mywarn { + local @msg = @_; + + # Need more error checking here. + + $smtp = Net::SMTP->new('mail.cs.wustl.edu'); + $smtp->mail( "$ADMIN" ); # sender's address + $smtp->to("$ADMIN"); # recipient's address + $smtp->data(); # Start the mail + + # Mail Header + $smtp->datasend("To: $ADMIN\n"); + $smtp->datasend("Subject: Auto run results\n"); + $smtp->datasend("From: $ADMIN\n"); + $smtp->datasend("\n"); + + # Now the message body + $smtp->datasend ('The following message is brought to you by: ', "\n"); + $smtp->datasend ("$CMD, [ $REVISION ] for $BUILD on $CHECKOUT\n\n"); + + local $m; + foreach $m (@msg) { + $smtp->datasend ("$m \n"); + } + + $smtp->datasend ("\nPlease check log files for more info\n"); + + $smtp->dataend(); # Finish sending the mail + $smtp->quit; # Close the SMTP connection +} + +sub mydie { + mywarn @_; + print HIST 'FAILED', "\n"; + unlink $disable_file + || die "cannot unlink disable file"; + exit 0; +} + +### MAIN FUNCTION + +### MAIN FUNCTION + +$histfile = $LOGDIR . '/history'; +open(HIST, '>>' . $histfile) + # Do not use 'mydie' to report the problem, it tries to use HIST.... + || die "cannot open history file \"$histfile\"\n"; + +$date = localtime; + +print HIST $CMD, ': running at ', $date, ' '; + +if (-f $disable_file) { + print HIST "DISABLED\n"; + exit 0; +} + +open (DISABLE, '>' . $disable_file) + || mydie "cannot open disable file"; +print DISABLE "auto_compile <$date> is running\n"; +close (DISABLE) + || mydie "cannot close disable file"; + +$LOGFILE = $LOGDIR . '/' . POSIX::strftime("%b%d_%Y.log", localtime); +open(LOG, '>' . $LOGFILE) + || mydie "cannot open log file"; + +LOG->autoflush (); + +foreach $i (@RUN_LIST) { + local @test_info = split (/\ \,\ /, $i); + local $directory = $test_info[0]; + local $program = $test_info[1]; + print "$directory, $program\n"; + + $date = localtime; + print LOG "$CMD: =============================================\n"; + print LOG "$CMD: running $program in $directory at ", $date, "\n"; + local $subdir = + $ENV{ACE_ROOT} . '/'. $directory; + chdir ($subdir) + || mydie "cannot chdir to $subdir"; + + $run_error = 0; + + system ($shell_invoke . " " . $program . " " . $redirect_output); + + open (RUN, "$exe_log_name") || push @failures, "Can't open execution log file $exe_log_name\n"; + + while (<RUN>) { + print LOG $_; + if (m/^Error/ || m/FAILED/ || m/EXCEPTION/) { + $run_error = 1; + } + } + if (close(RUN) == 0) { + push @failures, "Error when closing log file $program in $directory"; + next; + } + $date = localtime; + print LOG "$CMD: $program finished ", $date, "\n"; + + if ($run_error != 0) { + push @failures, + "errors detected while running $program in $directory"; + } + + unlink ("$exe_log_name"); +} + +if ($#failures >= 0) { + mydie @failures; +} + +close(LOG) + || mydie "cannot close LOGFILE"; + +print HIST "OK\n"; +close(HIST) + || mydie "cannot close history file"; + +unlink $disable_file + || mydie "cannot unlink disable file"; + +exit 0; diff --git a/ACE/bin/sets-manager.py b/ACE/bin/sets-manager.py new file mode 100755 index 00000000000..2806efe1c82 --- /dev/null +++ b/ACE/bin/sets-manager.py @@ -0,0 +1,210 @@ +#!/usr/bin/env python + +""" This script implements branching and tagging in the DOC group +repository, and automates the process of creating sets. """ + +import os + +def parse_args (): + from optparse import OptionParser + + parser = OptionParser ("usage: %prog [options] name") + parser.add_option ("-A", "--ACE", dest="project", action="store_const", + help="Branch/tag only ACE", default=None, const="ace") + parser.add_option ("-T", "--TAO", dest="project", action="store_const", + help="Branch/tag ACE and TAO", default=None, const="tao") + parser.add_option ("-C", "--CIAO", dest="project", action="store_const", + help="Branch/tag ACE, TAO, and CIAO", default=None, const="ciao") + parser.add_option ("-t", "--tag", dest="action", + help="Create a tag", action="store_true", default=None) + parser.add_option ("-b", "--branch", dest="action", action="store_false", + help="Create a branch", default=None) + parser.add_option ("-v", "--verbose", dest="verbose", action="store_true", + help="Print out verbose debugging output", default=False) + parser.add_option ("-s", "--svn", dest="svn", default="svn", + help="Full path to svn binary, if not in path") + parser.add_option ("-r", "--repo", dest="repo", + default="https://svn.dre.vanderbilt.edu/DOC/Middleware/", + help="Repository to use, defaults to s.d.v.e/DOC/Middleware.") + parser.add_option ("--src", dest="source", default="trunk/", + help="Path in repository from which to branch, defaults to trunk") + parser.add_option ("--dest", dest="dest", default="", + help="Specifies a subdirectory of branches or tags in which " + + "to place the new branch/tag. dest must already exist.") + parser.add_option ("-n", dest="take_action", action="store_false", default=True, + help="Take no action") + (opts, args) = parser.parse_args () + + if len(args) != 1: + parser.error ("must specify exactly one branch or tag name") + + if opts.action is None: + parser.error ("must specify either a branch or tag action") + + if opts.project is None: + parser.error ("must specity a project to branch") + + return (opts, args) + +def execute (command): + from os import system + + if opts.verbose: + print "executing " + command + if opts.take_action and os.system (command) != 0: + raise Exception ("Command failed: " + command) + +def svn_copy (source, dest): + command = " ".join ([opts.svn, + "copy", + '-m "branching/tagging"', + source, + dest]) + execute (command) + +def svn_propset (path, prop, value): + command = " ".join ([opts.svn, + "propset", + prop, + "'" + value + "'", + path]) + execute (command) + +def svn_mkdir (path): + command = " ".join ([opts.svn, + "mkdir", + '-m "branching/tagging"', + path]) + execute (command) + +def svn_mkdir_local (path): + command = " ".join ([opts.svn, + "mkdir", + path]) + execute (command) + +def get_head_revision (url): + command = " ".join ([opts.svn, + "info", + url]) + + import re + lineregex = re.compile ("Last Changed Rev: (\d+)") + + for line in os.popen (command).readlines (): + match = lineregex.match (line) + if (match is not None): + return int(match.group (1)) + + print "ERROR: Unable to find current MPC head revision" + raise Exception + +def branch_ACE (): + # Perform branching + destination = opts.repo + opts.dest + svn_copy (opts.repo + opts.source + "/ACE", + destination + "modules/ACE") + + # pin MPC revision + # Need local copy of the ACE directory to to the propset +# execute ("svn up -N " + opts.repo + path + "/modules/ACE sets_manager_temp/module_ACE") + execute ("svn up -N sets_manager_temp/modules/ACE") + mpc_rev = get_head_revision ("svn://svn.dre.vanderbilt.edu/DOC/MPC/trunk") + + svn_propset ("sets_manager_temp/modules/ACE", + "svn:externals", + "%s\t-r %d %s" % ("MPC", + mpc_rev, + "svn://svn.dre.vanderbilt.edu/DOC/MPC/trunk")) + + #Create the set + svn_mkdir_local ("sets_manager_temp/sets/ACE") + svn_propset ("sets_manager_temp/sets/ACE", + "svn:externals", + "%s\t%s" % ("ACE_wrappers", + destination + "modules/ACE")) + +def branch_TAO (): + branch_ACE () + + # Perform branching + destination = opts.repo + opts.dest + svn_copy (opts.repo + opts.source + "/TAO", + destination + "modules/TAO") + + #Create the set + svn_mkdir_local ("sets_manager_temp/sets/ACE+TAO") + svn_propset ("sets_manager_temp/sets/ACE+TAO", + "svn:externals", + "%s\t%s\n%s\t%s" % ("ACE_wrappers", + destination + "modules/ACE", + "ACE_wrappers/TAO", + destination + "modules/TAO")) + +def branch_CIAO (): + branch_TAO () + + #Perform branching + destination = opts.repo + opts.dest + svn_copy (opts.repo + opts.source + "/CIAO", + destination + "modules/CIAO") + + # Create the set + svn_mkdir_local ("sets_manager_temp/sets/ACE+TAO+CIAO") + svn_propset ("sets_manager_temp/sets/ACE+TAO+CIAO", + "svn:externals", + "%s\t%s\n%s\t%s\n%s\t%s" % + ("ACE_wrappers", + destination + "modules/ACE", + "ACE_wrappers/TAO", + destination + "modules/TAO", + "ACE_wrappers/TAO/CIAO", + destination + "modules/CIAO")) + +def main (opts, args): + # Lets make opts global + globals ()['opts'] = opts + + path = str () + if opts.action: + # True for tag + path = "tags/" + else: # Branch + path = "branches/" + + path += "%s/%s" % (opts.dest, args[0]) + # Make branch/tag directory + svn_mkdir (opts.repo + path) + + execute ("svn co " + opts.repo + path + " sets_manager_temp") + + # Make modules and sets subdirectory + svn_mkdir_local ("sets_manager_temp/modules") + svn_mkdir_local ("sets_manager_temp/sets") + + # commit the new directories + execute ('svn commit -m "branching/tagging" sets_manager_temp') + + # opts.dest should now be set to path, all of the branching + # functions assume dest now points to the branch/tag in which + # the copies should be places + opts.dest = path + '/' + + {'ace': branch_ACE, + 'tao': branch_TAO, + 'ciao': branch_CIAO}[opts.project] () + + # Commit the sets directory + execute ('svn commit -m "branching/tagging" sets_manager_temp') + + # remove the sets directory + for root, dirs, files in os.walk ('sets_manager_temp', False): + for name in files: + os.remove (os.path.join (root, name)) + for name in dirs: + os.rmdir (os.path.join (root, name)) + +if __name__ == "__main__": + opts, args = parse_args () + main (opts, args) + diff --git a/ACE/bin/show_unused_macros.pl b/ACE/bin/show_unused_macros.pl new file mode 100755 index 00000000000..820b22e602d --- /dev/null +++ b/ACE/bin/show_unused_macros.pl @@ -0,0 +1,224 @@ +eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' + & eval 'exec perl -w -S $0 $argv:q' + if 0; + +# ************************************************************ +# Description : Find macros in specified config files that +# are not referenced in other config files, +# but are referenced in the rest of the source +# files. +# Author : Chad Elliott +# Create Date : 12/22/2004 +# $Id$ +# ************************************************************ + +# ************************************************************ +# Pragmas +# ************************************************************ + +use strict; +use Cwd; +use FileHandle; +use File::Basename; + +# ************************************************************ +# Data Section +# ************************************************************ + +my($in_comment) = undef; + +# ************************************************************ +# Subroutine Section +# ************************************************************ + +sub getline { + my($fh) = shift; + my($line) = $fh->getline(); + + if (defined $line) { + ## Remove the line feed + $line =~ s/\n//; + + ## Remove one line c comments + $line =~ s/\/\*.*\*\///; + + ## Check for multi lined c comments + if ($line =~ s/\/\*.*//) { + $in_comment = 1; + } + elsif ($line =~ s/.*\*\///) { + $in_comment = 0; + } + elsif ($in_comment) { + $line = ''; + } + else { + ## Remove c++ comments + $line =~ s/\/\/.*//; + + ## Concatenate lines + if ($line =~ s/\\\s*$//) { + $line .= getline($fh); + } + } + } + + return $line; +} + + +sub findMacros { + my($defines) = shift; + my($macros) = shift; + my(@files) = @_; + foreach my $file (@files) { + my($fh) = new FileHandle(); + + if (open($fh, $file)) { + $in_comment = undef; + while(defined($_ = getline($fh))) { + if (($defines & 1) == 1 && /^\s*#\s*define\s*([^\s]+)/) { + my($word) = $1; + $word =~ s/\(.*//; + if (!defined $$macros{$word}) { + $$macros{$word} = $file; + } + } + elsif (($defines & 2) == 2 && /^\s*#\s*if/) { + foreach my $word (split(/[^\w]/, $_)) { + if ($word =~ /^[^\d]\w+$/ && + $word !~ /^if([n]?def)?$/ && + $word !~ /^define[d]?/ && + $word !~ /^els(e|if)$/ && !defined $$macros{$word}) { + $$macros{$word} = $file; + } + } + } + } + + close($fh); + } + else { + print STDERR "Unable to open $file\n"; + exit(2); + } + } +} + + +sub usageAndExit { + my($msg) = shift; + + if (defined $msg) { + print STDERR "ERROR: $msg\n"; + } + + print STDERR 'Usage: ', basename($0), " [-I <directory>] <config headers>\n\n", + "This script will provide a set of macros that may possibly\n", + "be removed from ACE.\n\n", + "It should be run under ACE_wrappers/ace and the input should\n", + "be the config header file or files planned for removal.\n"; + exit(1); +} + + +# ************************************************************ +# Main Section +# ************************************************************ + +my(@files) = (); +my(@dirs) = ('.', 'os_include', 'os_include/sys', + 'os_include/netinet', 'os_include/net', + 'os_include/arpa', + ); + +for(my $i = 0; $i <= $#ARGV; ++$i) { + my($arg) = $ARGV[$i]; + if ($arg =~ /^-/) { + if ($arg eq '-h') { + usageAndExit(); + } + elsif ($arg eq '-I') { + ++$i; + if (defined $ARGV[$i]) { + push(@dirs, $ARGV[$i]); + } + else { + usageAndExit('-I requires a directory parameter'); + } + } + else { + usageAndExit("$arg is an unknown option"); + } + } + else { + push(@files, $arg); + } +} + +if (!defined $files[0]) { + usageAndExit(); +} + +## First find all of the control macros +my(%control) = (); +findMacros(3, \%control, @files); + +## Now find all of the macros from the other config files +my(@other) = grep(!/config-all\.h|config-lite\.h/, <config-*.h>); + +for(my $i = 0; $i <= $#other; ++$i) { + foreach my $file (@files) { + if ($other[$i] eq $file) { + splice(@other, $i, 1); + --$i; + last; + } + } +} +my(%other) = (); +findMacros(3, \%other, @other); + + +my(%notreferenced) = (); +foreach my $macro (keys %control) { + if (!defined $other{$macro}) { + $notreferenced{$macro} = $control{$macro}; + } +} + + +## Find all other macros +my(@all) = (); +foreach my $dir (@dirs) { + my($orig) = getcwd(); + if (chdir($dir)) { + my(@more) = <*.h *.i* *.cpp>; + if ($dir ne '.') { + foreach my $file (@more) { + $file = "$dir/$file"; + } + } + push(@all, @more); + chdir($orig); + } +} + +for(my $i = 0; $i <= $#all; ++$i) { + foreach my $file (@files, @other) { + if ($all[$i] eq $file) { + splice(@all, $i, 1); + --$i; + last; + } + } +} + +my(%all) = (); +findMacros(2, \%all, @all); + +foreach my $macro (sort keys %notreferenced) { + if (defined $all{$macro}) { + print "$macro\n"; + } +} diff --git a/ACE/bin/split-cpp b/ACE/bin/split-cpp new file mode 100755 index 00000000000..513c52a946c --- /dev/null +++ b/ACE/bin/split-cpp @@ -0,0 +1,422 @@ +eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}' + & eval 'exec perl -w -S $0 $argv:q' + if 0; + +# Splits C++ source files into one file per function or data item. +# +# Author: David L. Levine, with much help and encouragment from +# Umar Syyid and Gonzalo A. Diethelm. +# Completed by Andrew Gilpin, July 2000 +# Date: 10 November 1998 +# +# For each C++ source file: +# 1) Extracts the "intro" code, i.e., #includes and declarations. +# 2) Identifies function definitions, relying on {, and } at the +# beginning of a line, to delineate the function begin and +# end. +# +# Assumptions: (applies only to the files being split, i.e. .cpp files) +# * Function definition bodies are terminated with } appearing at +# the beginning of a line. +# * Free-standing (outside of functions) macro invocations must be +# followed by a blank line, or terminated with a semicolon. +# * A function must not have a blank line between its header +# (signature) and its body. +# * There aren't multiple C-style comments on one line, with code +# between them. +# * typedefs are on a single line +# * A #endif doesn't have a multi-line C comment starting on that line. + +# The first three lines above let this script run without specifying the +# full path to perl, as long as it is in the user's PATH. +# Taken from perlrun man page. + +# Changes made by Andrew Gilpin (June - July 2000) +# * Added option -c to use .c extension instead of .cpp extension +# * Prints message when no filenames are specified on the command line +# * Changed -? option to -h so that it works properly in most shells +# * Added option -s to skip certain files, but copy them to $split_dir, +# renaming them. (filename.cpp -> $split_dir/filename_S1.cpp). This is +# here so that ACE can selectively not split certain files (namely those +# that this script doesn't work with :) +# * Added support for classes declared in the .cpp file. + +$usage="usage: $0 [-h] [-d] [-v] [-c] [-s filename] filenames\n"; + +#### Configuration parameters. +$verbose = 0; +$debug = 0; +$split_dir = 'SPLIT'; +$extension = 'cpp'; +@files_to_skip = (); + +#### Constants. +$DIR_SEPARATOR = $^O eq "MSWin32" ? '\\' : '/'; + + +#### +#### Process command line args. +#### +while ( $#ARGV >= $[ && $ARGV[0] =~ /^-/ ) { + if ( $ARGV[0] eq '-d' ) { + $debug = 1; + } elsif ( $ARGV[0] eq '-v' ) { + $verbose = 1; + } elsif ( $ARGV[0] eq '-c' ) { + $extension = 'c'; + } elsif ( $ARGV[0] eq '-s' ) { + push @files_to_skip, $ARGV[1]; + shift; + } elsif ( $ARGV[0] eq '-h' ) { + print "$usage"; + exit; + } else { + print STDERR "$0: unknown option $ARGV[0]\n"; + die $usage; + } + shift; +} + + +&main (); + + +#### +#### Reset state, to process a new file starting with a clean slate. +#### +sub reset { + #### Working data buffers. + @intro = (); + @current_comments = (); + @current_code = (); + @if = (); + @save_if = (); + @endif = (); + @unknown = (); + ####@unknown_s = (); + + #### State variables. + $current_file_number = 0; + $top_of_file = 1; + $in_braces = 0; + $in_nonfunction_code = 0; + $in_C_comment = 0; + $intro_length = 0; + $preprocessor_continuation = 0; + $preserved_ifs = 0; +} + + +sub main { + #### Print error message if no files are specified. + #### We need to do this before we modify anything on disk. + die "No files specified!\n$usage" if (@ARGV == 0); + + #### Remove the destination subdirectory, if it exists. + #### Attempts to clean it out using unlink may fail because + #### it can have many files. + if (-d "$split_dir") { + system ("/bin/rm -r $split_dir") << 256 && + die "$0: unable to rm \"$split_dir\"\n"; + } + + #### Create the destination subdirectory. + mkdir "$split_dir", 0755 || + die "$0: unable to create $split_dir directory: $!\n"; + + MAIN_LOOP: foreach $file (@ARGV) { + #### Strip off filename extension. + ($basename = $file) =~ s/\.[^\.]+$//; + + foreach $skip_file (@files_to_skip) { + if ($skip_file eq $file) { + system ("/bin/cp $file $split_dir/" . $basename. "_S1\.$extension"); + next MAIN_LOOP; + } + } + + &reset (); + + print "FILE: $file\n" if $verbose; + open INPUT, "$file" || die "$0: unable to open \"$file\"\n"; + + while (<INPUT>) { + #### Strip comments from $line and use that for processing. + #### But, use $_ for output, so that comments will be preserved. + my $line = $_; + + #### If we're in the midst of a multiline C comment, see + #### if it's finished on this line. + if ($in_C_comment) { + if ($line =~ s%^.*\*/%%) { + #### End C-style comment. + $in_C_comment = 0; + + if ($line =~ /^\s*$/ && ! $in_braces) { + #### No code on the line. + #&save_comment ($_); + next; + } + } else { + unless ($in_braces) { + #&save_comment ($_); + next; + } + } + } + + #### Strip C++-style comments. + if ($line =~ s%\s*//.*$%%) { + if ($line =~ /^\s*$/ && ! $in_braces) { + #### C++-style comment, without any code on the line. + #&save_comment ($_); + next; + } + } + + #### And C-style comments. + if ($line =~ m%/\*%) { + #### Begin C-style comment. Strip any complete comment(s), + #### then see what's left. + + $line =~ s%\s*/\*.*\*/\s*%%g; + + #### check to see if a preprocessor is on this line + if (! $in_braces) { + if ($line eq '') { + #### The line just had comment(s). Save it. + #&save_comment ($_); + next; + } else { + #### There's other text on the line. See if it's just the + #### start of a comment. + if ($line =~ m%/\*% && $line !~ m%\*/%) { + #### The C-style comment isn't terminated on this line. + $in_C_comment = 1; + #&save_comment ($_); + next; + } + } + } + } + + #### For now, skip ACE_RCSID's. Eventually, we might want to + #### consider putting them in _every_ file, if they're enabled. + next if $line =~ /^ACE_RCSID/; + + if ($in_braces) { + push @unknown, $_; + if ($line =~ /{/) { + ++$in_braces; + } elsif ($line =~ /^};/) { + #### }; at beginning of line could signify end of class + --$in_braces; + if ($in_braces == 0) { + push @intro, @unknown; + @unknown = (); + } + } elsif ($line =~ /^}/) { + #### } at beginning of line signifies end of function. + --$in_braces; + push @current_code, @unknown; + @unknown = (); + &finish_current ($basename, ++$current_file_number); + } elsif ($line =~ /};/) { + #### end of multi-line data delcaration + --$in_braces; + if ($in_braces == 0) { + push @current_code, @unknown; + @unknown = (); + &finish_current ($basename, ++$current_file_number); + } + } + } else { + #### Not in braces. + if (($line =~ m%[^/]*{%) && (! $preprocessor_continuation)) { + #### { signifies beginning of braces (obviously :). + if ($line =~ /};/) { + #### braces end on this line + push @unknown, $_; + push @current_code, @unknown; + @unknown = (); + &finish_current ($basename, ++$current_file_number); + } else { + push @unknown, $_; + $in_braces = 1; + $in_nonfunction_code = $top_of_file = 0; + } + } elsif ($line =~ /^}/) { + warn "$0: skipping unexpected } on line $. of \"$file\"\n"; + next; + } elsif ($line =~ /^typedef/) { + push @intro, $_; + } elsif ($line =~ /^\s*#/ || $preprocessor_continuation) { + #### Preprocessor directive. + if ($in_nonfunction_code) { + push @unknown, $_; + } else { + push @intro, $_; + } + $top_of_file = 0; + $preprocessor_continuation = /\\$/ ? 1 : 0; + + if ($line =~ m%^\s*#\s*if\s*(.*)(/.*)*$%) { + push @save_if, $_; + unshift @endif, "#endif /* $1 [Added by split-cpp.] */\n"; + + } elsif ($line =~ /^\s*#\s*endif/) { + #### End an #if/#else block. + unless (defined pop @save_if) { + pop @if; + if ($preserved_ifs > 0) { + --$preserved_ifs; + } + } + shift @endif; + + #### } elsif ($line =~ /^\s*#/) { + #### Any other preprocessor directive. + } + + } elsif ($line =~ /^\s*$/) { + #### Whitespace only, or empty line.. + push @current_code, "\n"; + if ($in_nonfunction_code) { + #### In the midst of non-function code, we reached a + #### blank line. Assume that we're done with it. + &finish_current ($basename, ++$current_file_number); + } else { + #### Not in a function, so add to intro. Just in case data or + #### a function follow it, flush now. + $preserved_ifs += $#save_if + 1; + &flush_current (\@intro); + } + + } elsif ($line =~ /;/) { + #### Data definition or semicolon-terminated macro invocation. + push @unknown, $_; + $top_of_file = 0; + + #### Is it file-static? Squash newlines out of @current_code. + my $statement = join (' ', @current_code); + if ($statement =~ /([^=[(]+)[=[(](.*)/) { + if ($1 =~ /static/) { + #### Move code to the intro. + push @intro, @current_comments; + @current_comments = (); + &flush_current (\@intro); + + #### Not separate code. + $in_nonfunction_code = 0; + + #### ???? Extract name from the left side and save for + #### later matching. + } else { + if ($statement =~ /^USEUNIT\s*\(/) { + #### Special-case those Borland USEUNIT things. + &flush_current (\@intro); + } else { + #### Non-static entity, with semicolon. Wrap it up. + push @current_code, @unknown; + @unknown = (); + &finish_current ($basename, ++$current_file_number); + } + } + } else { + #### Dunno. Wrap it up, anyways. + push @current_code, @unknown; + @unknown = (); + &finish_current ($basename, ++$current_file_number); + } + } else { + #### Beginning of data definition or function or class. + push @unknown, $_; + $in_nonfunction_code = 1; + $top_of_file = 0; + } + } + + if (eof) { + close (ARGV); #### To reset line number counter. + if ($#intro > $intro_length) { + #### Leftover prepreprocessor statement(s), such as #pragma + #### instantiate. + &finish_current ($basename, ++$current_file_number); + } + } + } + + close INPUT; + } +}; + + +#### +#### Save a comment in the appropriate array. +#### +#sub save_comment { +# my ($comment) = @_; +# +# if ($top_of_file) { +# push @intro, $comment; +# } else { +# push @current_comments, $comment; +# } +#} + + +#### +#### Flush the contents of the @current_code array to the destination +#### argument array. It is passed by reference. +#### +sub flush_current { + my ($destination) = @_; + + push @$destination, @current_code; + @current_code = (); +} + + +#### +#### Flush what we've got now to an output (split) file. +#### +sub finish_current { + my ($basename, $current_file_number) = @_; + + my $current_file_name = + sprintf "$split_dir$DIR_SEPARATOR${basename}_S%d.$extension", + $current_file_number++; + + if ($verbose) { + print "CURRENT OUTPUT FILE: $current_file_name\n"; + print "INTRO:\n"; + print @intro; + print @if; + print @current_comments; + print "CURRENT CODE:\n"; + print @current_code; + print @endif; + } + + open OUTPUT, "> $current_file_name" || + die "unable to open $current_file_name\n"; + + print OUTPUT "// Automatically generated by ACE's split-cpp.\n" . + "// DO NOT EDIT!\n\n"; + if ($debug) { + print OUTPUT "INTRO:\n", @intro, "IF:\n", @if, + "COMMENTS:\n", @current_comments, + "CURRENT:\n", @current_code, "ENDIF:\n", @endif; + } else { + print OUTPUT @intro, @if, @current_comments, @current_code, @endif; + } + + close OUTPUT; + + #### For detection of leftover preprocessor statements and + #### comments at end of file. + $intro_length = $#intro; + + @current_comments = @current_code = @save_if = (); + $in_braces = $in_nonfunction_code = 0; +} diff --git a/ACE/bin/svcconf-convert.pl b/ACE/bin/svcconf-convert.pl new file mode 100755 index 00000000000..fbfa8dc9864 --- /dev/null +++ b/ACE/bin/svcconf-convert.pl @@ -0,0 +1,300 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# +# File: svcconf-convert.pl: +# Purpose: This perl script convert classic svc.conf file into XML svc.conf file format. +# Usage: svcconf-convert.pl [-i infile] [-o outfile] [-verbose] [-nocomment] +# -i: Specify the input classic svc.conf filename. +# If omitted, the default input filename is "svc.conf". +# -o: Specify the output XML svc.conf filename. +# If this argument is omitted, the resulting XML file will be written +# to file called <input filename>.xml. +# -verbose: Verbose output. +# -nocomment: Remove all comments. Use this argument if you have comments +# mixing in the middle of a classic svc.conf directive. + +$indent = 0; + +sub inc_indent +{ + $indent += 2; +} + +sub dec_indent +{ + $indent -= 2; +} + +sub get_indent +{ + $retv = 0; + print STDERR "$0 (", $lineno, "): Unbalanced macro pairs\n" if ($indent < 0); + $retv = $indent - 1 if ($indent > 0); + $retv; +} + +sub acexml_comment +{ + my $comment = shift; + print OUT " " x &get_indent (), "<!-- $comment -->\n"; +} + +sub acexml_start +{ + my $name = shift; + my $standalone = shift; + + print OUT " " x &get_indent (), "<$name"; + + + while (@attnames) + { + print OUT " ", pop (@attnames), '="', pop (@attvalues), '"'; + } + + if ($standalone != 0) + { + print OUT "/>\n"; + } + else + { + print OUT ">\n"; + inc_indent (); + } +} + +sub acexml_end +{ + my $name = shift; + + dec_indent (); + print OUT " " x &get_indent (), "</$name>\n"; +} + +$verbose = 0; +$nocomment = 0; +@attvalues = (); +@attnames = (); +$stream = ""; +$infile = ""; +$outfile = ""; + +while ( $#ARGV >= 0) +{ + if ($ARGV[0] =~ m/^-i/i) { + shift; + $infile = "$ARGV[0]"; + } + elsif ($ARGV[0] =~ m/^-o/i) { + shift; + $outfile = "$ARGV[0]"; + } + elsif ($ARGV[0] =~ m/^-verbose/i) { + $verbose = 1; + } + elsif ($ARGV[0] =~ m/^-nocomment/i) { + $nocomment = 1; + } + elsif ($ARGV[0] =~ m/^-(\?|h|help)/i) { # Help information + print +" Usage: svcconf-convert.pl [-i infile] [-o outfile] [-verbose] [-nocomment] + -i: Specify the input classic svc.conf filename. + If omitted, the default input filename is 'svc.conf'. + -o: Specify the output XML svc.conf filename. + If this argument is omitted, the resulting XML file will + be written to file called <input filename>.xml. + -verbose: Verbose output. + -nocomment: Remove all comments. Use this argument if you + have comments mixing in the middle of a classic + svc.conf directive. +"; + exit; + } + elsif ($ARGV[0] =~ m/^-/) { + warn "$0: unknown option $ARGV[0]\n"; + exit 1; + } + else { + die "unknow argument\n"; + } + shift; +} + +if ($infile eq "") { + print "Using default svc.conf name\n" if ($verbose != 0); + $infile = "svc.conf"; +} + + +if ($outfile eq "") { + $outfile = "$infile.xml"; +} +print "OUTFILE = $outfile \n" if ($verbose); + +open (OUT, "> $outfile") or die "Unable to open $outfile\n"; + +undef $/; +open (FH, "< $infile"); +$_ = <FH>; + +if ($nocomment) { + if (s/^\#(.*)$//mg) { + print "ts = $_\n" if ($verbose != 0); + } +} + +print "------------------------------------------------------------\n" if ($verbose != 0); + +print OUT "<?xml version='1.0'?>\n"; +print OUT "<!-- Converted from $infile by svcconf-convert.pl -->\n"; +acexml_start ("ACE_Svc_Conf", 0); + +while (length ($_) != 0) { + s/^\s*$//mg; + + print "INPUT =\n$_\n" if ($verbose); + PARSE: { + if (s/^\s*\#(.*)//) { + acexml_comment ($1); + print "# $1\n" if ($verbose); + } + if (s/^\s*{//) { + acexml_start ("module", 0); + print "open module\n" if ($verbose); + } + + if (s/^\s*}//) { + acexml_end ("module"); + acexml_end ($stream); + print "close module\n" if ($verbose); + } + + if (s/^\s*stream\s+dynamic\s+(\w+)\s+(\w+)\s*\*\s*(\S+):(\S+)\s*\(\s*\)(\s+(active|inactive))?(\s+"([^"]*)")?//) { + $name = $1; + $type = $2; + $path = $3; + $init = $4; + $state = $6; + $param = $8; + acexml_start ("streamdef"); + if ($status ne "") { + push @attnames, ("status"); + push @attvalues, ("$state"); + } + push @attnames, ("type"); + push @attvalues, ("$type"); + push @attnames, ("id"); + push @attvalues, ("$name"); + acexml_start ("dynamic", 0); + if ($param ne "") { + push @attnames, ("params"); + push @attvalues, ("$param"); + } + push @attnames, ("init"); + push @attvalues, ("$init"); + push @attnames, ("path"); + push @attvalues, ("$path"); + acexml_start ("initializer", 1); + acexml_end ("dynamic"); + $stream = "streamdef"; + print "stream dynamic $name $type * $init:$path \"$param\" $state\n" if ($verbose); + } + + if (s/^\s*stream\s+static\s+(\w+)(\s+("(.*)"))?//) { + $name = $1; + $param = $4; + acexml_start ("streamdef", 0); + if ($param ne "") { + push @attnames, ("params"); + push @attvalues, ("$param"); + } + push @attnames, ("id"); + push @attvalues, ("$name"); + acexml_start ("static", 1); + $stream = "streamdef"; + print "static $name \"$param\"\n" if ($verbose); + } + + if (s/^\s*stream\s+(\w+)//) { + $name = $1; + push @attnames, ("id"); + push @attvalues, ("$name"); + acexml_start ("stream", 0); + $stream = "stream"; + print "stream $name\n" if ($verbose); + } + + if (s/^\s*dynamic\s+(\w+)\s+(\w+)\s*\*\s*(\S+):(\S+)\s*\(\s*\)(\s+(active|inactive))?(\s+"([^"]*)")?//) { + $name = $1; + $type = $2; + $path = $3; + $init = $4; + $state = $6; + $param = $8; + if ($status ne "") { + push @attnames, ("status"); + push @attvalues, ("$state"); + } + push @attnames, ("type"); + push @attvalues, ("$type"); + push @attnames, ("id"); + push @attvalues, ("$name"); + acexml_start ("dynamic", 0); + if ($param ne "") { + push @attnames, ("params"); + push @attvalues, ("$param"); + } + push @attnames, ("init"); + push @attvalues, ("$init"); + push @attnames, ("path"); + push @attvalues, ("$path"); + acexml_start ("initializer", 1); + acexml_end ("dynamic"); + print "dynamic $name $type * $init:$path \"$param\" $state\n" if ($verbose); + } + + if (s/^\s*static\s+(\w+)(\s+("(.*)"))?//) { + $name = $1; + $param = $4; + if ($param ne "") { + push @attnames, ("params"); + push @attvalues, ("$param"); + } + push @attnames, ("id"); + push @attvalues, ("$name"); + acexml_start ("static", 1); + print "static $name \"$param\"\n" if ($verbose); + } + + if ( s/^\s*resume\s+(\w+)//) { + $name = $1; + push @attnames, ("id"); + push @attvalues, ("$name"); + acexml_start ("resume", 1); + print "resume $name\n" if ($verbose); + } + + if ( s/^\s*remove\s+(\w+)//) { + $name = $1; + push @attnames, ("id"); + push @attvalues, ("$name"); + acexml_start ("remove", 1); + print "remove $name\n" if ($verbose); + } + + if ( s/^\s*suspend\s+(\w+)//) { + $name = $1; + push @attnames, ("id"); + push @attvalues, ("$name"); + acexml_start ("suspend", 1); + print "suspend $name\n" if ($verbose); + } + + $nothing = 1; + } +} + +acexml_end ("ACE_Svc_Conf"); diff --git a/ACE/bin/svn_props.py b/ACE/bin/svn_props.py new file mode 100755 index 00000000000..da1a6d62df9 --- /dev/null +++ b/ACE/bin/svn_props.py @@ -0,0 +1,48 @@ +#!/usr/bin/python + +import sys +import re +import os +import string + +print """WARNING: this script is dumb. I mean, really, really dumb. Every file is treated +as a text file, so if you are checking in any binary files, YOU MUST set a non-text +MIME type by hand, otherwise it WILL be corrupted by the checkout process. +A better approach will be to add the unmatched files to the config file in +ACE/docs/svn/config (and update yours!) so others won't have to put up with them +in the future. + +To use this program, copy and paste the output from the svn command into standard +input. +""" + +foo = raw_input("That being said, if you want to continue, press enter") + +sin, sout = os.popen2 ("svn info") +sin.close () +os.wait () + +url = "" +root = "" +path = "" + +for line in sout.readlines (): + if line.startswith ("URL: "): + url = line.replace ("URL: ", "")[:-1] + if line.startswith ("Repository Root: "): + root = line.replace ("Repository Root: ", "")[:-1] + +path = url.replace (root, "")[1:] + '/' +files = "" + +eol_style = " svn ps svn:eol-style native " +keywords = " svn ps svn:keywords 'Author Date Id Revision' " + +for line in sys.stdin.readlines (): + ln = line[0:line.find (':')] + ' ' + ln = ln.replace (path,"") + os.system (eol_style + ln) + os.system (keywords + ln) + + + diff --git a/ACE/bin/tao_orb_tests.lst b/ACE/bin/tao_orb_tests.lst new file mode 100644 index 00000000000..e7858a7a22d --- /dev/null +++ b/ACE/bin/tao_orb_tests.lst @@ -0,0 +1,348 @@ +# $Id$ +# +# This is the list of run_test.pl's that need to be run by +# auto_run_tests.pl. +# Each line has its own test, and a test can be followed by a +# list of configurations it does _not_ run on. +# +# Example: TAO\examples\foo\run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST +# +# NOTE: This file contains tests only for TAO's ORB. Please do not +# include things like performance-tests, and examples here. + +TAO/tests/Oneway_Send_Timeouts/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !Win32 !LabVIEW_RT +TAO/tests/Oneway_Send_Timeouts/run_test.pl -blocking: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !Win32 !LabVIEW_RT +TAO/tests/Oneway_Send_Timeouts/run_test.pl -reactive: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !Win32 !LabVIEW_RT +TAO/tests/Abstract_Interface/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2702_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/ORB_Local_Config/Bunch/run_test.pl: !LabVIEW_RT +TAO/tests/ORB_Local_Config/Bug_1459/run_test.pl: SSL !STATIC !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/ORB_Local_Config/Bug_2612/run_test.pl: !ST !STATIC !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/ORB_Local_Config/Separation/run_test.pl: !LabVIEW_RT +TAO/tests/ORB_Local_Config/Service_Dependency/run_test.pl: !ST !STATIC !LabVIEW_RT +TAO/tests/ORB_Local_Config/Shared/run_test.pl: !LabVIEW_RT +TAO/tests/ORB_Local_Config/Simple/run_test.pl: !LabVIEW_RT +TAO/tests/ORB_Local_Config/Two_DLL_ORB/run_test.pl: !ST !STATIC !LabVIEW_RT +TAO/tests/Param_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/tests/Param_Test/run_test_dii.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/AMI/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/AMI_Timeouts/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/AMH_Exceptions/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_ToFix_LynxOS_x86 !ACE_FOR_TAO +TAO/tests/AMH_Oneway/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_ToFix_LynxOS_x86 !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/CORBA_e_Implicit_Activation/run_test.pl: CORBA_E_COMPACT !LabVIEW_RT +TAO/tests/Collocation/run_test.pl: !ACE_FOR_TAO +TAO/tests/Collocation_Tests/run_test.pl: !ST !LabVIEW_RT +TAO/tests/Collocation_Opportunities/run_test.pl: !ST !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Collocation_Oneway_Tests/run_test.pl: !ST !NO_MESSAGING !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Collocation_Exception_Test/run_test.pl: !ST !LabVIEW_RT +TAO/tests/CollocationLockup/run_test.pl: !ST !DISABLE_ToFix_LynxOS_x86 !LabVIEW_RT +TAO/tests/OctetSeq/run_test.pl: !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/OctetSeq/run_test1.pl: !STATIC !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/OctetSeq/run_test2.pl: !STATIC !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/BiDirectional/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !GIOP10 !DISABLE_BIDIR !LynxOS !LabVIEW_RT +TAO/tests/BiDirectional/run_test_ipv6.pl: IPV6 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !GIOP10 !DISABLE_BIDIR !LabVIEW_RT +TAO/tests/BiDirectional_NestedUpcall/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !GIOP10 !DISABLE_BIDIR !DISABLE_ToFix_LynxOS_PPC !LabVIEW_RT +TAO/tests/BiDirectional_DelayedUpcall/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !GIOP10 !DISABLE_BIDIR !DISABLE_ToFix_LynxOS_PPC !LabVIEW_RT +TAO/tests/Leader_Followers/run_test.pl: !ST !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Leader_Followers/run_test_mt.pl: !ST !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Multiple_Inheritance/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_933_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_1269_Regression/run_test.pl: !Win32 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !QUICK !LabVIEW_RT +TAO/tests/Bug_1269_Regression/run_test.pl -quick : QUICK !LabVIEW_RT +TAO/tests/Bug_1495_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Bug_1535_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_1568_Regression/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_1670_Regression/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_1270_Regression/run_test.pl: !Win32 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !QUICK !LabVIEW_RT +TAO/tests/Bug_1270_Regression/run_test.pl -quick : QUICK !LabVIEW_RT +TAO/tests/Bug_1020_Basic_Regression/run_test.pl: !Win32 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !VxWorks !QUICK !LabVIEW_RT +TAO/tests/Bug_1020_Basic_Regression/run_test.pl -quick : QUICK !LabVIEW_RT +TAO/tests/Bug_1020_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !Win32 !QUICK !LabVIEW_RT +TAO/tests/Bug_1020_Regression/run_test.pl -quick : QUICK !LabVIEW_RT +TAO/tests/Bug_1254_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_1330_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_1361_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !Win32 !IRIX !QUICK !LabVIEW_RT +TAO/tests/Bug_1361_Regression/run_test.pl -quick : QUICK !LabVIEW_RT +TAO/tests/Bug_1476_Test/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_1482_Regression/run_test.pl: !VxWorks !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !VxWorks_RTP !QUICK !LabVIEW_RT +TAO/tests/Bug_1482_Regression/run_test.pl -quick : QUICK !LabVIEW_RT +TAO/tests/Bug_1551_Regression/run_test.pl: !VxWorks !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !IRIX !OpenVMS_IA64Crash !QUICK !LabVIEW_RT +TAO/tests/Bug_1551_Regression/run_test.pl -quick: QUICK !LabVIEW_RT +TAO/tests/Bug_1676_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2084_Regression/run_test.pl: !ST !LabVIEW_RT +TAO/tests/Bug_2134_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2174_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2183_Regression/run_test.pl: !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Bug_2186_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Bug_2188_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2201_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2234_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Bug_2289_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2319_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2328_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2345_Regression/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2349_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2356_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2417_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/Bug_2429_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2494_Regression/run_test.pl: !ST !LabVIEW_RT +TAO/tests/Bug_2503_Regression/run_test.pl: !NO_MESSAGING !ST !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2542_Regression/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2560_Regression/run_test.pl: !ST !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2593_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Bug_2595_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2654_Regression/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2669_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2677_Regression/run_test.pl: !STATIC !LabVIEW_RT +TAO/tests/Bug_2683_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2734_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2735_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2768_Regression/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2791_Regression/run_test.pl: !MINIMUM !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2792_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2795_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2804_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2805_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2809_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2826_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2869_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2844_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2909_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_2935_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_2936_Regression/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LynxOS !STATIC !LabVIEW_RT +TAO/tests/Bug_2953_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/Bug_2966_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_3000_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Bug_3042_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_3108_Regression/run_test.pl: !ST !LabVIEW_RT +TAO/tests/Bug_3154_Regression/run_test.pl: !NO_IFR !LabVIEW_RT +TAO/tests/Bug_3163_Regression/run_test.pl: !LabVIEW_RT +TAO/tests/Bug_3171_Regression/run_test.pl: !ST !MINIMUM !NO_MESSAGING !LabVIEW_RT +TAO/tests/Bug_3198_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/DIOP/run_test.pl: !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/DIOP/run_test_ipv6.pl: IPV6 !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/RTCORBA/Activate_Object_Multiple_ORBs/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Banded_Connections/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Client_Propagated/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Client_Protocol/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !IPV6 !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/RTCORBA/Collocation/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Destroy_Thread_Pool/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Explicit_Binding/run_test.pl: !VxWorks !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !IPV6 !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/RTCORBA/Linear_Priority/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/MT_Client_Protocol_Priority/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !ACE_FOR_TAO !OpenVMS_IA64Crash !LabVIEW_RT +TAO/tests/RTCORBA/ORB_init/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/RTCORBA/Persistent_IOR/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Policies/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Policy_Combinations/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Priority_Inversion_With_Bands/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !ACE_FOR_TAO !OpenVMS_IA64Crash !LabVIEW_RT +TAO/tests/RTCORBA/Private_Connection/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/RTCORBA/Profile_And_Endpoint_Selection/run_test.pl: !VxWorks !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !IPV6 !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/RTCORBA/RTMutex/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Server_Declared/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/RTCORBA/Server_Protocol/run_test.pl: !VxWorks !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !IPV6 !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/RTCORBA/Thread_Pool/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/RTScheduling/VoidData/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/RTScheduling/Thread_Cancel/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ST !OpenVMS_IA64Crash !LabVIEW_RT +TAO/tests/RTScheduling/DT_Spawn/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/RTScheduling/Current/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ST !LabVIEW_RT +TAO/tests/RTScheduling/Scheduling_Interceptor/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !STATIC !LabVIEW_RT +TAO/tests/OBV/Any/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/OBV/Collocated/Forward/run_test.pl: !ST !LynxOS !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/OBV/Factory/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/OBV/Forward/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/OBV/TC_Alignment/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/OBV/ValueBox/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/OBV/Truncatable/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/OBV/Simple/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Hello/run_test.pl: +TAO/tests/LongDouble/run_test.pl: !LabVIEW_RT +TAO/tests/IPV6/run_test.pl: IPV6 !LabVIEW_RT +TAO/tests/AlternateIIOP/run_test.pl: !DISABLE_ToFix_LynxOS_x86 !LabVIEW_RT +TAO/tests/Optimized_Connection/run_test.pl: !DISABLE_ToFix_LynxOS_x86 !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Cache_Growth_Test/run_test.pl: !LabVIEW_RT +TAO/tests/Muxing/run_test.pl: !ST !LabVIEW_RT +TAO/tests/Muxed_GIOP_Versions/run_test.pl: !VxWorks !ST !DISABLE_ToFix_LynxOS_PPC !OpenVMS_IA64Crash !LabVIEW_RT +TAO/tests/MT_Client/run_test.pl: !ST !LabVIEW_RT +TAO/tests/MT_BiDir/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !GIOP10 !DISABLE_BIDIR !LynxOS !LabVIEW_RT +TAO/tests/File_IO/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/MT_Server/run_test.pl: !ST !LabVIEW_RT +TAO/tests/No_Server_MT_Connect_Test/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Connect_Strategy_Test/run_test.pl: !LabVIEW_RT +# DISABLED TAO/tests/Client_Leaks/run_test.pl: !VxWorks !ST !Tru64 +TAO/tests/Server_Leaks/run_test.pl: !LabVIEW_RT +TAO/tests/Smart_Proxies/Policy/run_test.pl: !LabVIEW_RT +TAO/tests/Smart_Proxies/run_test.pl: !LabVIEW_RT +TAO/tests/Smart_Proxies/dtor/run_test.pl: !LabVIEW_RT +TAO/tests/Stack_Recursion/run_test.pl: !ST !DISABLE_ToFix_LynxOS_PPC !QUICK !LabVIEW_RT +TAO/tests/Stack_Recursion/run_test.pl -quick : QUICK !LabVIEW_RT +TAO/tests/Faults/run_test.pl: !VxWorks !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !OpenVMS_IA64Crash !LabVIEW_RT +TAO/tests/CallbackTest/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO +TAO/tests/CallbackTest/run_test_ipv6.pl: IPV6 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/CallbackTest/run_test_mixed_ip.pl: IPV6 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Crashed_Callback/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !OpenVMS_IA64Crash !LabVIEW_RT +# Disabled Crash On Write on Win32, see bugzilla 959 why !LabVIEW_RT +TAO/tests/Crash_On_Write/run_test.pl: !VxWorks !ST !Win32 !LabVIEW_RT +TAO/tests/Nested_Upcall_Crash/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !OpenVMS_IA64Crash !QUICK !LabVIEW_RT +TAO/tests/Nested_Upcall_Crash/run_test.pl -quick: QUICK !LabVIEW_RT +TAO/tests/NestedUpcall/Simple/run_test.pl: !ST !LabVIEW_RT +TAO/tests/NestedUpcall/MT_Client_Test/run_test.pl: !ST !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/NestedUpcall/Triangle_Test/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Nested_Event_Loop/run_test.pl: !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/POA/Identity/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Forwarding/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Policies/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Excessive_Object_Deactivations/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Persistent_ID/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Etherealization/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Object_Reactivation/run_test.pl: !ST !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/POA_Destruction/run_test.pl: !LabVIEW_RT +TAO/tests/POA/Default_Servant/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Single_Threaded_POA/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/POA/Non_Servant_Upcalls/run_test.pl: !SUNCC5_1 !LabVIEW_RT +TAO/tests/POA/MT_Servant_Locator/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/POA/Bug_1592_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Bug_2511_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Nested_Non_Servant_Upcalls/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/POA/Deactivate_Object/run_test.pl: !LabVIEW_RT +TAO/tests/POA/Reference_Counting/run_test.pl: !LabVIEW_RT +TAO/tests/POA/Current/run_test.pl: !LabVIEW_RT +TAO/tests/POA/wait_for_completion/run_test.pl: !LabVIEW_RT +TAO/tests/POA/POAManagerFactory/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/EndpointPolicy/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Adapter_Activator/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !SUNCC5_1 !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/POA/POA_BiDir/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_BIDIR !LabVIEW_RT +TAO/tests/POA/DSI/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Default_Servant2/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/Explicit_Activation/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/POA/FindPOA/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/NewPOA/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/POA/On_Demand_Activation/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/POA/On_Demand_Loading/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !KCC_Linux !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/POA/Reference_Counted_Servant/run_test.pl: !SUNCC5_1 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/POA/Loader/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !KCC_Linux !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/POA/RootPOA/run_test.pl: !LabVIEW_RT +TAO/tests/DiffServ/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/IORManipulation/run_test.pl: !LabVIEW_RT +TAO/tests/IORManipulation/filter/run_test.pl: !LabVIEW_RT +TAO/tests/Policies/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/Timeout/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/MT_Timeout/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !OpenVMS_IA64Crash !LabVIEW_RT +TAO/tests/Timed_Buffered_Oneways/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Single_Read/run_test.pl: !LabVIEW_RT +TAO/tests/Connection_Timeout/run_test.pl: !VxWorks !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LabVIEW_RT +#TAO/tests/Connection_Failure/run_test.pl ! Timesout for good reasons !LabVIEW_RT +TAO/tests/MProfile_Connection_Timeout/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Codec/run_test.pl: +TAO/tests/Bug_1693_Test/run_test.pl: !LabVIEW_RT +TAO/tests/IDL_Test/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/ORB_init/run_test.pl: !LabVIEW_RT +TAO/tests/ORB_destroy/run_test.pl: !LabVIEW_RT +TAO/tests/ORB_shutdown/run_test.pl: !LabVIEW_RT +TAO/tests/DSI_Gateway/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/DSI_AMI_Gateway/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/DSI_AMH/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/DII_AMI_Forward/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/DynAny_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/DynUnion_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Connection_Purging/run_test.pl: !VxWorks !ST !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Server_Connection_Purging/run_test.pl: !VxWorks !Win32 !LabVIEW_RT +TAO/tests/LongUpcalls/run_test.pl: !VxWorks !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Reliable_Oneways/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Blocking_Sync_None/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Oneway_Buffering/run_message_count.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Oneway_Buffering/run_buffer_size.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Oneway_Buffering/run_timeout.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Oneway_Buffering/run_timeout_reactive.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Oneway_Timeouts/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_MESSAGING !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/AMI_Buffering/run_message_count.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/AMI_Buffering/run_buffer_size.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/AMI_Buffering/run_timeout.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/AMI_Buffering/run_timeout_reactive.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/Big_AMI/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Big_Oneways/run_test.pl: !ST !LabVIEW_RT +TAO/tests/Big_Twoways/run_test.pl: !ST !LabVIEW_RT +TAO/tests/Big_Reply/run_test.pl: !ST !LabVIEW_RT +TAO/tests/Big_Request_Muxing/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Oneways_Invoking_Twoways/run_test.pl: !ST !LabVIEW_RT +TAO/tests/Queued_Message_Test/run_test.pl: !LabVIEW_RT +TAO/tests/DLL_ORB/run_test.pl: !STATIC !LabVIEW_RT +TAO/tests/InterOp-Naming/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Multiple/run_test.pl: !SUNCC5_1 !LabVIEW_RT +TAO/tests/Exposed_Policies/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Portable_Interceptors/Bug_1559/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Bug_2510_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ST !LabVIEW_RT +TAO/tests/Portable_Interceptors/Collocated/Dynamic/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ST !LabVIEW_RT +TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Collocated/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ST !LabVIEW_RT +TAO/tests/Portable_Interceptors/Processing_Mode_Policy/Remote/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ST !LabVIEW_RT +TAO/tests/Portable_Interceptors/Collocated/Service_Context_Manipulation/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ST !LabVIEW_RT +TAO/tests/Portable_Interceptors/Dynamic/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/IORInterceptor/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !GIOP10 !LabVIEW_RT +TAO/tests/Portable_Interceptors/ForwardRequest/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Service_Context_Manipulation/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Request_Interceptor_Flow/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !HAS_EXTENDED_FT_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/PICurrent/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/AMI/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/ORB_Shutdown/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Bug_2088/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Recursive_ORBInitializer/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Register_Initial_References/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Slot/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/AdvSlot/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/AdvSlotDblCpy/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/AdvSlotExt/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Redirection/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Bug_3079/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Bug_3080/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Portable_Interceptors/Bug_2133/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/ORT/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !LabVIEW_RT +TAO/tests/Object_Loader/run_test.pl: !STATIC !LabVIEW_RT +TAO/tests/Two_Objects/run_test.pl: !ST !LabVIEW_RT +TAO/tests/TransportCurrent/Framework/run_test.pl -dynamic: !DISABLE_TRANSPORT_CURRENT !STATIC !DISABLE_INTERCEPTORS !MINIMUM !LabVIEW_RT +TAO/tests/TransportCurrent/Framework/run_test.pl -static: !DISABLE_TRANSPORT_CURRENT STATIC !DISABLE_INTERCEPTORS !MINIMUM !LabVIEW_RT +TAO/tests/TransportCurrent/IIOP/run_test.pl -dynamic: !DISABLE_TRANSPORT_CURRENT !STATIC !DISABLE_INTERCEPTORS !MINIMUM !LabVIEW_RT +TAO/tests/TransportCurrent/IIOP/run_test.pl -static: !DISABLE_TRANSPORT_CURRENT STATIC !DISABLE_INTERCEPTORS !MINIMUM !LabVIEW_RT +TAO/tests/UNKNOWN_Exception/run_test.pl: Exceptions !LabVIEW_RT +TAO/tests/Native_Exceptions/run_test.pl: Exceptions !LabVIEW_RT +TAO/tests/Servant_To_Reference_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !LabVIEW_RT +TAO/tests/Sequence_Unit_Tests/run_test.pl -noboost: !LabVIEW_RT +TAO/tests/Sequence_Unit_Tests/run_test.pl -boost: BOOST !LabVIEW_RT +TAO/tests/Typedef_String_Array/run_test.pl: !LabVIEW_RT +TAO/tests/GIOP_Fragments/PMB_With_Fragments/run_test.pl: !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/CodeSets/simple/run_test.pl: !GIOP10 !STATIC !LabVIEW_RT +TAO/tests/Hang_Shutdown/run_test.pl: !ST !ACE_FOR_TAO !LabVIEW_RT +TAO/tests/Any/Recursive/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_1/run_test.pl: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl remote: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl collocated: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl remote_orbthreads: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl remote_servants: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl remote_csdthreads: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl remote_big: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_2/run_test.pl big: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_3/run_test.pl: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_3/run_test.pl remote: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_3/run_test.pl collocated: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_3/run_test.pl remote_orbthreads: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_3/run_test.pl remote_servants: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_3/run_test.pl remote_csdthreads: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_3/run_test.pl remote_big: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_3/run_test.pl big: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_4/run_test.pl: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_4/run_test.pl remote: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_4/run_test.pl collocated: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_4/run_test.pl remote_orbthreads: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_4/run_test.pl remote_servants: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_4/run_test.pl remote_csdthreads: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_4/run_test.pl remote_big: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_4/run_test.pl big: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_Dynamic/run_test.pl: !STATIC !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Strategy_Tests/TP_Test_Static/run_test.pl: !ST !CORBA_E_MICRO !LynxOS !LabVIEW_RT +TAO/tests/CSD_Collocation/run_test.pl: !ST !CORBA_E_COMPACT !CORBA_E_MICRO !MINIMUM !LynxOS !LabVIEW_RT +TAO/tests/Permanent_Forward/run_test.pl: !LabVIEW_RT +TAO/tests/Parallel_Connect_Strategy/run_test.pl: !QUICK !LabVIEW_RT +TAO/tests/Parallel_Connect_Strategy/run_test.pl -quick : QUICK !LabVIEW_RT +TAO/tests/DII_Collocation_Tests/oneway/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/DII_Collocation_Tests/twoway/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LabVIEW_RT +TAO/tests/Compression/run_test.pl: ZLIB !LabVIEW_RT diff --git a/ACE/bin/tao_other_tests.lst b/ACE/bin/tao_other_tests.lst new file mode 100644 index 00000000000..3a3c6cf8f40 --- /dev/null +++ b/ACE/bin/tao_other_tests.lst @@ -0,0 +1,187 @@ +# $Id$ +# +# This is the list of run_test.pl's that need to be run by +# auto_run_tests.pl. +# Each line has its own test, and a test can be followed by a +# list of configurations it does _not_ run on. +# +# Example: TAO\examples\foo\run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST +# +# NOTE: This file contains examples and other service level test for +# TAO's. Please do not include regular tests here. +TAO/performance-tests/Cubit/TAO/IDL_Cubit/run_test.pl: !LynxOS !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Cubit/TAO/MT_Cubit/run_test.pl: !ST !OpenBSD !Win32 !ACE_FOR_TAO !OpenVMS !CORBA_E_MICRO +TAO/performance-tests/Latency/Single_Threaded/run_test.pl -n 1000: !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Latency/Thread_Pool/run_test.pl -n 1000: !ST !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Latency/Thread_Per_Connection/run_test.pl -n 1000: !ST !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Latency/AMI/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Latency/DSI/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Latency/DII/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Latency/Deferred/run_test.pl: !QNX !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Sequence_Latency/Single_Threaded/run_test.pl: !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Sequence_Latency/Thread_Pool/run_test.pl: !ST !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Sequence_Latency/Thread_Per_Connection/run_test.pl: !ST !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Sequence_Latency/AMI/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Sequence_Latency/DSI/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Sequence_Latency/DII/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Sequence_Latency/Deferred/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/Throughput/run_test.pl: !Win32 !ACE_FOR_TAO !OpenVMS +TAO/performance-tests/POA/Object_Creation_And_Registration/run_test.pl: !Win32 !ACE_FOR_TAO !OpenVMS !CORBA_E_MICRO +TAO/performance-tests/RTCorba/Oneways/Reliable/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !Win32 !OpenVMS +TAO/performance-tests/Protocols/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !Win32 !ACE_FOR_TAO !OpenVMS +TAO/examples/Simple/bank/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO +TAO/examples/Simple/grid/run_test.pl: !NO_MESSAGING !CORBA_E_MICRO +TAO/examples/Simple/time-date/run_test.pl: !ST !STATIC !NO_MESSAGING !Win32 +TAO/examples/Simple/time/run_test.pl: !NO_MESSAGING !Win32 !CORBA_E_MICRO +TAO/examples/Quoter/run_test.pl: !DISABLE_ToFix_LynxOS_PPC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !Win32 !ACE_FOR_TAO +TAO/examples/Load_Balancing/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !SUNCC5_1 !ACE_FOR_TAO +TAO/examples/PluggableUDP/tests/SimplePerformance/run_test.pl: !QNX !NO_DIOP !ACE_FOR_TAO +TAO/examples/AMH/Sink_Server/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !Win32 !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl -p TCP,UDP,RTP_UDP: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/AVStreams/Pluggable/run_test.pl -p SCTP_SEQ: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO SCTP !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/AVStreams/Full_Profile/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LynxOS +TAO/orbsvcs/tests/AVStreams/Multicast/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LynxOS +#TAO/orbsvcs/tests/AVStreams/Multicast_Full_Profile/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +#TAO/orbsvcs/tests/AVStreams/Latency/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl -p TCP,UDP,RTP_UDP: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage/run_test.pl -p SCTP_SEQ: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO SCTP !ACE_FOR_TAO +TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl -p TCP,UDP,RTP_UDP: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/AVStreams/Simple_Two_Stage_With_QoS/run_test.pl -p SCTP_SEQ: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO SCTP !ACE_FOR_TAO +TAO/orbsvcs/tests/AVStreams/Simple_Three_Stage/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !DISABLE_ToFix_LynxOS_x86 +TAO/orbsvcs/tests/AVStreams/Asynch_Three_Stage/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/AVStreams/Component_Switching/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_1334_Regression/run_test.pl: !ACE_FOR_TAO !CORBA_E_MICRO +TAO/orbsvcs/tests/Bug_1393_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_1395_Regression/run_test.pl: !LynxOS !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_MESSAGING !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_1436_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_1437_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_MESSAGING !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_1630_Regression/run_test.pl: !NO_IFR !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2074_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !NO_MESSAGING +TAO/orbsvcs/tests/Bug_2247_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2248_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2285_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2285_Regression/run_test2.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2287_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2316_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !SUNCC5_1 +TAO/orbsvcs/tests/Bug_2377_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC +TAO/orbsvcs/tests/Bug_2615_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2777_Regression/run_test.pl: !MINIMUM !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2926_Regression/run_test.pl: !ST !NO_MESSAGING !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !LynxOS +TAO/orbsvcs/tests/Bug_3215_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_3216_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/CosEvent/Basic/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/HTIOP/Hello/run_test.pl: !NO_UUID !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/HTIOP/AMI/run_test.pl: !NO_UUID !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/HTIOP/BiDirectional/run_test.pl: !NO_UUID !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Simple_Naming/run_test.pl: !ST !SUNCC5_1 !NO_MESSAGING !ACE_FOR_TAO !LynxOS !CORBA_E_MICRO +TAO/orbsvcs/tests/Simple_Naming/run_test_ffp.pl: !ST !SUNCC5_1 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_MESSAGING !ACE_FOR_TAO +TAO/orbsvcs/tests/Redundant_Naming/run_test.pl: !ST !SUNCC5_1 !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Trading/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !SUNCC5_1 +TAO/orbsvcs/tests/unit/Trading/Interpreter/run_test.pl: !CORBA_E_MICRO +TAO/orbsvcs/tests/Event/Basic/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Event/Performance/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Event/UDP/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !NO_DIOP +TAO/orbsvcs/tests/EC_Custom_Marshal/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !DISABLE_ToFix_LynxOS_x86 +TAO/orbsvcs/tests/EC_Throughput/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_ToFix_LynxOS_x86 !ACE_FOR_TAO +TAO/orbsvcs/tests/EC_MT_Mcast/run_test.pl:!ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/run_test.pl: !NO_MCAST !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Event/Mcast/RTEC_MCast_Federated/run_test.pl -ipv6: IPV6 !NO_MCAST !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/FaultTolerance/GroupRef_Manipulation/run_test.pl:!MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/FaultTolerance/IOGR/run_test.pl:!MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/FaultTolerance/IOGRManipulation/run_test.pl:!MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2137_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/Application_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !STATIC !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/IDL3_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/IFR_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/IFR_Inheritance_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/Latency_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/Persistence_Test/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/Bug_2962_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/Bug_3155_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/InterfaceRepo/Bug_3174_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/run_test.pl both_ir: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/run_test.pl nestea_ir: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/run_test.pl airplane_ir: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/run_test.pl persistent_ir: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/run_test.pl nt_service_ir: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO Win32 !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/run_test.pl shutdown: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/run_test.pl perclient: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/NameService/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/locked/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !LynxOS !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/scale/run_test.pl -servers 5 -objects 5: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/Bug_689_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/ImplRepo/Bug_2604_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_EXCEPTIONS !ACE_FOR_TAO +TAO/orbsvcs/examples/ImR/Combined_Service/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !ST !ACE_FOR_TAO +TAO/orbsvcs/examples/CosEC/TypedSimple/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !NO_IFR !ACE_FOR_TAO +TAO/orbsvcs/tests/CosEvent/Timeout/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !NO_MESSAGING !ACE_FOR_TAO +TAO/orbsvcs/tests/Log/Basic_Log_Test/run_test.pl: !NO_MESSAGING !ACE_FOR_TAO !CORBA_E_MICRO +TAO/orbsvcs/tests/Notify/Basic/run_test.pl notify.reactive.conf: !ST !NO_MESSAGING !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl notify.reactive.conf: IPV6 !ST !NO_MESSAGING !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Basic/run_test.pl notify.mt.conf: !ST !NOTIFY !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl notify.mt.conf: IPV6 !ST !NOTIFY !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Basic/run_test.pl notify.rt.conf: !ST !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Basic/run_test_ipv6.pl notify.rt.conf: IPV6 !ST !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Blocking/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !DISABLE_ToFix_LynxOS_x86 +TAO/orbsvcs/tests/Notify/Bug_1385_Regression/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !DISABLE_ToFix_LynxOS_x86 +TAO/orbsvcs/tests/Notify/Bug_2561_Regression/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !DISABLE_ToFix_LynxOS_x86 +TAO/orbsvcs/tests/Notify/Discarding/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !DISABLE_ToFix_LynxOS_x86 +TAO/orbsvcs/tests/Notify/MT_Dispatching/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Ordering/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !DISABLE_ToFix_LynxOS_x86 +TAO/orbsvcs/tests/Notify/performance-tests/Filter/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !IRIX !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/performance-tests/RedGreen/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Sequence_Multi_ETCL_Filter/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Sequence_Multi_Filter/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Structured_Filter/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !DISABLE_ToFix_LynxOS_x86 +TAO/orbsvcs/tests/Notify/Structured_Multi_Filter/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/Reconnecting/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !ACE_FOR_TAO +TAO/orbsvcs/tests/Notify/XML_Persistence/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !ACE_FOR_TAO +TAO/orbsvcs/tests/EC_Mcast/run_test.pl: !NO_MCAST !NO_MESSAGING !DISABLE_ToFix_LynxOS_PPC !ACE_FOR_TAO !CORBA_E_MICRO +# FAILS 'TAO/orbsvcs/tests/EC_Multiple/run_test.pl +# NO REDIRECTION TAO/examples/Simple/echo/run_test.pl < Echo.idl +TAO/orbsvcs/tests/Property/run_test.pl: !NO_MESSAGING !ACE_FOR_TAO !CORBA_E_MICRO +#HANGS TAO/orbsvcs/tests/ImplRepo/run_test.pl airplane +#HANGS'TAO/orbsvcs/tests/ImplRepo/run_test.pl airplane_ir +TAO/orbsvcs/tests/Security/Secure_Invocation/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/Bug_1107_Regression/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/Bug_2908_Regression/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/Big_Request/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/BiDirectional/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/Callback/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test.pl: !ST SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/MT_IIOP_SSL/run_test.pl: !ST SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +#Bug 1647. run_test_harsh.pl takes 5 minutes; but there aren't many SSL builds +TAO/orbsvcs/tests/Security/MT_SSLIOP/run_test_harsh.pl: !ST SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/Crash_Test/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/InsecureReferences/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Security/EndpointPolicy/run_test.pl: SSL !STATIC !DISABLE_INTERCEPTORS !ACE_FOR_TAO +TAO/orbsvcs/tests/Miop/McastHello/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC !SUNCC5_1 !NO_MCAST +# The following 2 tests use dynamic loading to change the default reactor on Windows +TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Application_Controlled/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !STATIC !ACE_FOR_TAO +TAO/orbsvcs/tests/LoadBalancing/GenericFactory/Infrastructure_Controlled/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !STATIC !ACE_FOR_TAO +TAO/orbsvcs/tests/LoadBalancing/LoadMonitor/CPU/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !NO_LOADAVG !DISABLE_ToFix_LynxOS_x86 +TAO/examples/RTCORBA/Activity/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ST !ACE_FOR_TAO +TAO/examples/RTScheduling/Fixed_Priority_Scheduler/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !STATIC !ST !ACE_FOR_TAO +TAO/examples/RTScheduling/MIF_Scheduler/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !DISABLE_INTERCEPTORS !STATIC !ST !ACE_FOR_TAO +TAO/examples/ior_corbaloc/run_test.pl: !NO_MESSAGING !ACE_FOR_TAO !CORBA_E_MICRO +TAO/utils/nslist/run_test.pl: !ST !SUNCC5_1 !NO_MESSAGING !ACE_FOR_TAO !CORBA_E_MICRO +TAO/orbsvcs/tests/BiDir_CORBALOC/run_test.pl: !NO_MESSAGING !ACE_FOR_TAO !CORBA_E_MICRO +TAO/orbsvcs/tests/IOR_MCast/run_test_ipv6.pl: IPV6 !NO_MCAST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO +TAO/orbsvcs/tests/Bug_2709_Regression/run_test.pl: !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO !ST +TAO/orbsvcs/tests/Bug_2800_Regression/run_test.pl: !ST !CORBA_E_MICRO +TAO/orbsvcs/tests/Bug_2800_Regression/run_test_federated.pl: !ST !CORBA_E_MICRO +TAO/orbsvcs/examples/Notify/Filter/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/examples/Notify/Subscribe/run_test.pl: !ST !NO_MESSAGING !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !ACE_FOR_TAO +TAO/orbsvcs/tests/Bug_2925_Regression/run_test.pl: !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC +TAO/orbsvcs/tests/Bug_2925_Regression/run_test_ipv6.pl: IPV6 !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC +TAO/orbsvcs/tests/Bug_2377_Regression/run_test_ipv6.pl: IPV6 !ST !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO !STATIC +TAO/examples/PluggableUDP/tests/SimplePerformance/run_test_ipv6.pl: IPV6 !QNX !NO_DIOP !ACE_FOR_TAO +TAO/examples/PluggableUDP/tests/Performance/run_test.pl: !QNX !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_COMPACT !CORBA_E_MICRO +TAO/examples/PluggableUDP/tests/Performance/run_test_ipv6.pl: IPV6 !QNX !ST !NO_DIOP !ACE_FOR_TAO !CORBA_E_COMPACT !CORBA_E_MICRO +TAO/orbsvcs/tests/unit/Notify/MC/Control/run_test.pl: +TAO/orbsvcs/tests/unit/Notify/MC/MonitorControlExt/run_test.pl: !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO +TAO/orbsvcs/tests/unit/Notify/MC/MonitorManager/run_test.pl: !ST !STATIC +TAO/orbsvcs/tests/unit/Notify/MC/NotificationServiceMonitor/run_test.pl: +TAO/orbsvcs/tests/unit/Notify/MC/Statistic_Registry/run_test.pl: +TAO/orbsvcs/tests/unit/Notify/MC/Statistic/run_test.pl: +TAO/orbsvcs/tests/Notify/MC/run_test.pl: !ST !STATIC !MINIMUM !CORBA_E_COMPACT !CORBA_E_MICRO +TAO/orbsvcs/tests/Simple_Naming/run_test_ipv6.pl: IPV6 !ST !SUNCC5_1 !NO_MESSAGING !ACE_FOR_TAO !LynxOS !CORBA_E_MICRO diff --git a/ACE/bin/topinfo_iorsize_stats.sh b/ACE/bin/topinfo_iorsize_stats.sh new file mode 100755 index 00000000000..86088779c0b --- /dev/null +++ b/ACE/bin/topinfo_iorsize_stats.sh @@ -0,0 +1,78 @@ +#!/bin/sh +# +# $Id$ +# + +if [ $# -lt 4 ]; then + echo "Usage: $0 [ROOT] [DEST] [USER] [OPTIMIZED]" + exit 0 +fi + +ROOT=$1 +DEST=$2 +US=$3 +OPT=$4 + +DATE=`date +%Y/%m/%d-%H:%M` +cd $ROOT +ACE_ROOT=$ROOT +export ACE_ROOT +LD_LIBRARY_PATH=$ACE_ROOT/ace +export LD_LIBRARY_PATH +PATH=/usr/bin:/bin:$PATH +export PATH +cd TAO/performance-tests/Memory/IORsize + +# start the server. If OPT == 1 then start the optimized version, else +# the non-optimized version + +if test $OPT == 1 + then ./server -ORBSvcConf server.conf & + else ./server & +fi + +s_id=$!; + +server_start_size=`cat /proc/$s_id/status | grep VmRSS | awk '{print $2}'`; + +# Just sleep for 2 seconds. +sleep 2; +# Check whether the server has started +file="test.ior" +if test -f $file + then + # start the client + ./client & + c_id=$!; + # Wait till all the invocations are done + sleep 30; + # Get the size once the client has made sufficient invocations. + s_invocations=`cat /proc/$s_id/status | grep VmRSS | awk '{print $2}'`; + let "actual_server_growth=${s_invocations}-${server_start_size}"; + if test $OPT == 1 + then + echo $DATE $s_invocations >> $DEST/source/server_opt_ior_size.txt + echo $DATE $actual_server_growth >> $DEST/source/opt_ior_size.txt + else + echo $DATE $s_invocations >> $DEST/source/server_ior_size.txt + echo $DATE $actual_server_growth >> $DEST/source/actual_ior_size.txt + fi + + # Kill the server and client. We will look at better ways of doing + # this later. + kill -9 $c_id; + kill -9 $s_id; + rm -f $file +else + echo $file doesnt exist +fi + + +cd $DEST/source +STRING="for 50000 IORs" +FILES="server_opt opt server actual" +for i in $FILES ; do +/usr/bin/tac ${i}_ior_size.txt > $DEST/data/${i}_ior_size.txt +/usr/bin/tail -5 ${i}_ior_size.txt > $DEST/data/LAST_${i}_ior_size.txt +$ROOT/bin/generate_topinfo_charts.sh ${i}_ior_size.txt $DEST/images/${i}_ior_size.png ${i}_ior_size.txt +done diff --git a/ACE/bin/topinfo_simple_stats.sh b/ACE/bin/topinfo_simple_stats.sh new file mode 100755 index 00000000000..dab12934160 --- /dev/null +++ b/ACE/bin/topinfo_simple_stats.sh @@ -0,0 +1,78 @@ +#!/bin/sh +# +# $Id$ +# + + +if [ $# -lt 3 ]; then + echo "Usage: $0 [ROOT] [DEST] [USER]" + exit 0 +fi + +ROOT=$1 +DEST=$2 +US=$3 + +DATE=`date +%Y/%m/%d-%H:%M` +cd $ROOT +ACE_ROOT=$ROOT +export ACE_ROOT +LD_LIBRARY_PATH=$ACE_ROOT/ace +export LD_LIBRARY_PATH +PATH=/usr/bin:/bin:$PATH +export PATH +cd TAO/performance-tests/Memory/Single_Threaded +# start the server +./server & +s_id=$!; +# Just sleep for 2 seconds. +sleep 2; +# Check whether the server has started +file="test.ior" +if test -f $file + then + # Just get the size as soon the server is started, ie. the vanilla + # server. + s_up=`cat /proc/$s_id/status | grep VmRSS | awk '{print $2}'`; + + # Write it a file + echo $DATE $s_up >> $DEST/source/st_start_size.txt + # start the client + ./client & + c_id=$!; + # Wait till all the invocations are done + sleep 10; + # Get the size once the client has made sufficient invocations. + s_invocations=`cat /proc/$s_id/status | grep VmRSS| awk '{print $2}'`; + + echo $DATE $s_invocations >> $DEST/source/st_after_invoke_size.txt + + # Get teh size of the client after all the invocations + c_invocations=`cat /proc/$c_id/status | grep VmRSS | awk '{print $2}'`; + echo $DATE $c_invocations >> $DEST/source/st_client_size.txt + + # Kill the server and client. We will look at better ways of doing + # this later. + kill -9 $c_id; + + # Just sleep for the server to release memory etc. + sleep 5; + + # Get the size once the client is killed or crashed + s_client_death=`cat /proc/$s_id/status | grep VmRSS | awk '{print $2}'`; + echo $DATE $s_client_death >> $DEST/source/st_after_peer_death_size.txt + kill -9 $s_id; + rm -f $file +else + echo $file doesnt exist +fi + + +cd $DEST/source + +FILES="start after_invoke client after_peer_death" +for i in $FILES ; do +/usr/bin/tac st_${i}_size.txt > $DEST/data/st_${i}_size.txt +/usr/bin/tail -5 st_${i}_size.txt > $DEST/data/LAST_st_${i}_size.txt +$ROOT/bin/generate_topinfo_charts.sh st_${i}_size.txt $DEST/images/st_${i}_size.png st_${i}_size.txt +done diff --git a/ACE/bin/topinfo_stats.sh b/ACE/bin/topinfo_stats.sh new file mode 100755 index 00000000000..5e572f357b9 --- /dev/null +++ b/ACE/bin/topinfo_stats.sh @@ -0,0 +1,74 @@ +#!/bin/sh +# +# $Id$ +# + + +if [ $# -lt 3 ]; then + echo "Usage: $0 [ROOT] [DEST] [USER]" + exit 0 +fi + +ROOT=$1 +DEST=$2 +US=$3 + +DATE=`date +%Y/%m/%d-%H:%M` +cd $ROOT +ACE_ROOT=$ROOT +export ACE_ROOT +LD_LIBRARY_PATH=$ACE_ROOT/ace +export LD_LIBRARY_PATH +PATH=/usr/bin:$PATH +export PATH +cd TAO/performance-tests/Memory/Single_Threaded +# start the server +./server & +s_id=$!; +# Just sleep for 2 seconds. +sleep 2; +# Check whether the server has started +file="test.ior" +if test -f $file + then + # Just get the size as soon the server is started, ie. the vanilla + # server. + s_up=`top -p $s_id -n 1 -b | grep $US| awk '{print $5}'`; + + # Write it a file + echo $DATE $s_up >> $DEST/source/st_start_size.txt + # start the client + ./client & + c_id=$!; + # Wait till all the invocations are done + sleep 10; + # Get the size once the client has made sufficient invocations. + s_invocations=`top -p $s_id -n 1 -b | grep $US| awk '{print $5}'`; + + echo $DATE $s_invocations >> $DEST/source/st_after_invoke_size.txt + + # Kill the server and client. We will look at better ways of doing + # this later. + kill -9 $c_id; + + # Just sleep for the server to release memory etc. + sleep 5; + + # Get the size once the client is killed or crashed + s_client_death=`top -p $s_id -n 1 -b | grep $US| awk '{print $5}'`; + echo $DATE $s_client_death >> $DEST/source/st_after_peer_death_size.txt + kill -9 $s_id; + rm -f $file +else + echo $file doesnt exist +fi + + +cd $DEST/source +STRING="" +FILES="start after_invoke after_peer_death" +for i in $FILES ; do +/usr/bin/tac st_${i}_size.txt > $DEST/data/st_${i}_size.txt +/usr/bin/tail -5 st_${i}_size.txt > $DEST/data/LAST_st_${i}_size.txt +$ROOT/bin/generate_topinfo_charts.sh st_${i}_size.txt $DEST/images/st_${i}_size.png st_${i}_size.txt $STRING +done diff --git a/ACE/bin/update-ace+tao.sh b/ACE/bin/update-ace+tao.sh new file mode 100755 index 00000000000..9956eb8bb0e --- /dev/null +++ b/ACE/bin/update-ace+tao.sh @@ -0,0 +1,39 @@ +#!/bin/sh +# Update ACE/TAO source tree to the latest numeric-assigned version. +# $Id$ + +# Define helper function to extract version number into tag format +d='\([0-9]*\)' +version() { sed -n -e "s,.*$1 version $d\.$d\.$d.*,$1-\1_\2_\3,p" \ + -e "s,.*$1 version $d\.$d.*,$1-\1_\2,p"; } + +# Use ccvs instead of cvs since it supports SOCKS5, if that environment found. +if [ ! -z "$SOCKS5_USER" ]; then cvs () { ccvs $*; } fi + +old_ace_version=`version <VERSION ACE` +old_tao_version=`version <TAO/VERSION TAO` + +# Abort with message if no values in variables +if [ -z $old_ace_version ]; then echo No existing ACE version; exit 1; fi +if [ -z $old_tao_version ]; then echo No existing TAO version; exit 1; fi + +cvs update -A VERSION TAO/VERSION GNUmakefile + +ace_version=`version <VERSION ACE` +tao_version=`version <TAO/VERSION TAO` + +# Abort with message if no values in variables +if [ -z $ace_version ]; then echo No ACE version after update; exit 1; fi +if [ -z $tao_version ]; then echo No TAO version after update; exit 1; fi + +echo Old software version tags: $old_ace_version $old_tao_version +echo New software version tags: $ace_version $tao_version + +# Conserve net bandwidth if no change was observed +if [ $old_ace_version != $ace_version ] || [ x"$1"x = x"force"x ]; then + cvs -q update -Pd -r $ace_version `make -s show_controlled_files` +fi +if [ $old_tao_version != $tao_version ] || [ x"$1"x = x"force"x ]; then + cvs -q update -Pd -r $tao_version TAO +fi + diff --git a/ACE/bin/vx_repo_link.pl b/ACE/bin/vx_repo_link.pl new file mode 100755 index 00000000000..b4ec5f82ed8 --- /dev/null +++ b/ACE/bin/vx_repo_link.pl @@ -0,0 +1,217 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# +# $Id$ +# + + +use FindBin; +use lib $FindBin::Bin; + +use diagnostics; +use Time::Local; +use File::Basename; +use File::Spec; +use FileHandle; +use Cwd; + +my $VXDEBUG = (defined $ENV{'VX_REPO_LINK_DEBUG'}) ? $ENV{'VX_REPO_LINK_DEBUG'} : 0; +my $ace_root = $ENV{'ACE_ROOT'}; +$ace_root =~ s/\//\\/g; +my $wind_base = $ENV{'WIND_BASE'}; +$wind_base =~ s/\//\\/g; +my $AR = $ENV{'AR'}; +my $RANLIB = $ENV{'RANLIB'}; +my @lib_arr; +my $lib; +my $curdir = cwd(); +$curdir =~ s/\//\\/g; + + +if ($VXDEBUG > 1) +{ + print STDERR "AR = ". $AR . "\n"; + print STDERR "ACE_ROOT = " . $ace_root . "\n"; + print STDERR "WIND_BASE = " . $wind_base, "\n"; + print STDERR "curdir = " . $curdir, "\n"; +} + +if ($VXDEBUG > 1) { + print STDERR "LINKLIBS are:\n"; +} + +while ($#ARGV >= 0) +{ + if ($ARGV[0] =~ /^-l/) { + $lib = shift; + $lib =~ s/^-l//; + if ($VXDEBUG > 1) { + print STDERR $ace_root."/lib/lib".$lib.".a\n"; + } + push @lib_arr, $lib; + } +} + +my @lib_registry = (); + +my $LINKLIBS = ""; + +my $libobj_dir = ".lib"; +system("if not exist ".$libobj_dir." mkdir ".$libobj_dir); +foreach $lib (@lib_arr) { + my $libname = $ace_root."\\lib\\lib".$lib.".a"; + if (-e $libname) { + if (! -e $libobj_dir."\\lib".$lib.".a") { + if ($VXDEBUG) { + print STDERR "Unpacking ".$lib."...\n"; + } + system("cmd /c if exist ".$libobj_dir."\\".$lib." del /q/f ".$libobj_dir."\\".$lib."\\*.*"); + system("cmd /c (mkdir ".$libobj_dir."\\".$lib." && cd ".$libobj_dir."\\".$lib." && ".$AR." -x ".$libname." && cd ".$curdir.")"); + + if ($VXDEBUG) { + print STDERR "Processing ".$lib."...\n"; + } + + my @rpo_arr = glob ($libobj_dir."\\".$lib."\\*.rpo"); + + if ($VXDEBUG > 1) { + print STDERR "Read #".$#rpo_arr." filenames\n"; + } + + my $line; + my $fh; + my $newfh; + my $module; + foreach $rpo (@rpo_arr) { + if ($VXDEBUG > 2) { + print STDERR $rpo."\n"; + } + $fh = new FileHandle(); + $newfh = new FileHandle(); + $module = basename($rpo, ".rpo"); + open ($newfh, '>', dirname($rpo)."\\".$module.".__rpo"); + open ($fh, '<', $rpo); + while (defined ($line = readline $fh)) { + if ($line =~ /^M /) { + $line =~ s/\//\\/g; + } + elsif ($line =~ /^D /) { + $line =~ s/(^D[ ])(.*ACE_wrappers)(.*)/${1}$ace_root${3}/; + $line =~ s/\//\\/g; + } + elsif ($line =~ /^A /) { + $line =~ s/('-I)([^ ]*ACE_wrappers)([']|[^']+')/${1}$ace_root${3}/g; + $line =~ s/('-I)([^ ]*Tornado[^\/\\]+)([']|[^']+')/${1}$wind_base${3}/g; + $line =~ s/('-o' )('.*')/'-o' '$curdir\/$libobj_dir\/$lib\/$module.o'/g; + $line =~ s/\//\\/g; + } + print $newfh $line; + } + close ($fh); + close ($newfh); + + system("cmd /c (del /f/q ".$rpo." && rename ".dirname($rpo)."\\".$module.".__rpo ".basename($rpo).")"); + } + + $fh = new FileHandle(); + open($fh, '<', $libobj_dir."\\".$lib."\\.prelink.spec"); + my $lnkcmd = readline($fh); + my $arcmd = readline($fh); + my $libdeps = readline($fh); + close($fh); + + $lib_registry[++$#lib_registry] = { + lib => $lib, + linkcmd => $lnkcmd, + arcmd => $arcmd, + libdeps => (defined $libdeps ? $libdeps : '') + }; + } + + $LINKLIBS = $LINKLIBS." ".$libobj_dir."\\lib".$lib.".a"; + } + else { + $LINKLIBS = "-l".$lib." ".$LINKLIBS; + } +} + +sub _find_lib_entry +{ + my $lib = shift; + foreach my $reg (@lib_registry) { + if ($reg->{lib} =~ /(^| )$lib( |$)/) { + return $reg; + } + } + return undef; +} + +sub _prelink_lib +{ + my $lentry = shift; + my $stack = shift; + my $lib = $lentry->{lib}; + my $lnkcmd = $lentry->{linkcmd}; + my $arcmd = $lentry->{arcmd}; + my @deps = split(' ', $lentry->{libdeps}); + + $lnkcmd =~ s/\n//g; + $arcmd =~ s/\n//g; + + if ($VXDEBUG) { + print STDERR "Prelink requested for ".$lib." (dependend on ".join(' ', @deps).")...\n"; + } + + # check dependencies + foreach my $dep (@deps) { + if ($VXDEBUG > 1) { + print STDERR " Checking dependency ".$dep."(stack = ".$stack.")...\n"; + } + if (($stack !~ /\<$dep\>/) && !(-e $libobj_dir."\\lib".$dep.".a")) { + my $le = _find_lib_entry ($dep); + if (defined $le) { + _prelink_lib ($le, $stack." <".$lib.">"); + } + } + } + + # prelink library + if ($VXDEBUG) { + print STDERR "Prelinking ".$lib."...\n"; + } + + my $objs = join(' ', glob ($libobj_dir."\\".$lib."\\*.o")); + my $libs = join(' ', glob ($libobj_dir."\\*.a")); + if ($VXDEBUG > 1) { + print STDERR " > cmd /c ".$lnkcmd." ".$libobj_dir."\\.prelink_lib ".$objs." ".$libs."\n"; + } + system("cmd /c ".$lnkcmd." ".$libobj_dir."\\.prelink_lib ".$objs." ".$libs); + system("cmd /c del /f/q ".$libobj_dir."\\.prelink_lib"); + + # build prelinked library + if ($VXDEBUG) { + print STDERR "Building prelinked lib ".$lib."...\n"; + } + + $arcmd =~ s/lib$lib/$libobj_dir\\lib$lib/; + #$arcmd = $AR." r ".$libobj_dir."\\lib".$lib.".a"; + $arcmd =~ s/ rv / rc /g; + if ($VXDEBUG > 1) { + print STDERR "cmd /c echo ".$objs." | ".$arcmd."\n"; + print STDERR "cmd /c (".$RANLIB." ".$libobj_dir."\\lib".$lib.".a && rmdir /s/q ".$libobj_dir."\\".$lib.")"."\n"; + } + system("cmd /c echo ".$objs." | ".$arcmd); + system("cmd /c (".$RANLIB." ".$libobj_dir."\\lib".$lib.".a && rmdir /s/q ".$libobj_dir."\\".$lib.")"); +} + +foreach my $libentry (@lib_registry) { + if (! -e $libobj_dir."\\lib".$libentry->{lib}.".a") { + _prelink_lib ($libentry, ""); + } +} + +print $LINKLIBS."\n"; + +1; diff --git a/ACE/bin/vxworks_modify.pl b/ACE/bin/vxworks_modify.pl new file mode 100755 index 00000000000..75d4537b6be --- /dev/null +++ b/ACE/bin/vxworks_modify.pl @@ -0,0 +1,578 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# ****************************************************************** +# Author: Chad Elliott (elliott_c@ociweb.com) +# Date: 8/14/2000 +# $Id$ +# Description: Modify c++ source for combination with other source +# files into a VxWorks module. +# ****************************************************************** + +# ****************************************************************** +# Pragma Section +# ****************************************************************** + +use strict; +use File::Basename; + +# ****************************************************************** +# Data Section +# ****************************************************************** + +my($name) = ""; +my(@types) = ("short", "int", "long", "unsigned", "size_t", + "char", "float", "double", "void", + "CORBA::Boolean", "CORBA::Short", "CORBA::UShort", + "CORBA::Long", "CORBA::ULong", "CORBA::Octet", + "CORBA::Char", "CORBA::WChar", "CORBA::LongLong", + "CORBA::ULongLong", "CORBA::Float", "CORBA::Double", + "CORBA::LongDouble", "CORBA::Environment", + ); + +# ************************************************************** +# Subroutine Section +# ************************************************************** + +sub needsToBeStatic { + my($line) = shift; + $line =~ s/^\s+//; + $line =~ s/\s+$//; + + if ($line !~ /\s*static\s+/) { + foreach my $type (@types) { + if ($line =~ /^(const\s+)?$type\s*[\*]*[\&]*\s*[^:]+/ || + $line =~ /^(const\s+)?$type\s*[\*]*[\&]*$/) { + return 1; + } + } + } +} + + +sub countChar { + my($line) = shift; + my($char) = shift; + my($len) = length($line); + my($count) = 0; + my($indouble) = 0; + my($insingle) = 0; + + for(my $i = 0; $i < $len; $i++) { + my($ch) = substr($line, $i, 1); + if ($char ne '"' && $ch eq '"') { + $indouble ^= 1; + } + elsif ($char ne '\'' && $ch eq '\'') { + $indouble ^= 1; + } + elsif ($ch eq $char && !$indouble && !$insingle) { + $count++; + } + } + return $count; +} + + +my($orbManager) = undef; +sub lookForOrbRun { + my($line) = shift; + my($status) = 0; + + if ($line =~ /([\w:\-\>\.\(\)]+)->run\s*\(.*\)/ || + $line =~ /.*orb.*\.run/ || + (defined $orbManager && ($line =~ /$orbManager.run/ || + $line =~ /$orbManager->run/))) { + $status = 1; + } + return $status; +} + + +sub modifyOrbRun { + my($line) = shift; + if (defined $orbManager && $line =~ /$orbManager/ && + $line =~ /(.*->run\s*\()([^\)]*)(\).*)/) { + my($p1) = $1; + my($p2) = $2; + my($p3) = $3; + + $p2 =~ s/^\s+//; + $p2 =~ s/\s+$//; + + # I am relying on convention here + if ($p2 !~ /\s/) { + $line = "$p1" . "TAO_TestCombinedThreads::getTimeout() " . + "ACE_ENV_ARG_PARAMETER$p3\n"; + } + } + elsif ($line =~ /(.*->run\s*\()([^\)]*)(\).*)/) { + my($p1) = $1; + my($p2) = $2; + my($p3) = $3; + + $p2 =~ s/^\s+//; + $p2 =~ s/\s+$//; + + # I am relying on convention here + if ($p2 !~ /\s/ && $p2 =~ /env/i) { + $p3 = " ACE_ENV_ARG_PARAMETER$p3"; + $p2 = ""; + } + + if ($p2 eq "") { + $line = $p1 . "TAO_TestCombinedThreads::getTimeout()" . "$p3\n"; + } + } + elsif ($line =~ /(.*\.run\s*\()([^\)]*)(\).*)/) { + my($p1) = $1; + my($p2) = $2; + my($p3) = $3; + + $p2 =~ s/^\s+//; + $p2 =~ s/\s+$//; + + # I am relying on convention here + if ($p2 !~ /\s/ && $p2 =~ /env/i) { + $line = "$p1" . "TAO_TestCombinedThreads::getTimeout() ". + "ACE_ENV_ARG_PARAMETER$p3\n"; + } + } + return $line; +} + + +sub lookForActivate { + my($line) = shift; + my($taskBase) = shift; + if ($line =~ /(\w+)\.activate/) { + $$taskBase = $1; + } +} + +my($orbInitArg) = 0; +sub lookForOrbInit { + my($line) = shift; + my($status) = 0; + if ($line =~ /CORBA::ORB_init\s*\(/) { + $orbInitArg = 0; + $status = 1; + } + return $status; +} + + +sub replaceOrbName { + my($line) = shift; + if ($orbInitArg < 3) { + if ($line =~ /ACE_ENV_ARG_PARAMETER/) { + $line =~ s/ACE_ENV_ARG_PARAMETER/,ACE_ENV_ARG_PARAMETER/; + } + my($length) = length($line); + my($previous) = 0; + for(my $i = 0; $i < $length; $i++) { + my($ch) = substr($line, $i, 1); + ## Add the substr check because the ACE_ENV_ARG_PARAMETER doesn't + ## have a comma before it and the above search and replace doesn't + ## work for multi-lined ORB_init's + if ($ch eq "," || $ch eq ")" || + ($orbInitArg == 2 && $i == $length - 1 && + substr($line, $previous) !~ /^\s+$/)) { + $orbInitArg++; + if ($ch eq ")" && $orbInitArg == 2) { + $orbInitArg = 3; + $previous = $i; + } + if ($orbInitArg == 3) { + my($size) = $i - $previous; + my($part) = substr($line, $previous, $size); + $part =~ s/^\s+//; + $part =~ s/\s+$//; + if ($part eq '""' || $part eq '0') { + substr($line, $previous, $size) = " \"$name\""; + } + elsif ($part eq '') { + substr($line, $previous, $size) = ", \"$name\""; + } + last; + } + $previous = $i + 1; + } + } + if ($line =~ /,ACE_ENV_ARG_PARAMETER/) { + $line =~ s/,ACE_ENV_ARG_PARAMETER/ ACE_ENV_ARG_PARAMETER/; + } + } + return $line; +} + + +my($initChildPOAArg) = 0; +sub lookForInitChildPOA { + my($line) = shift; + my($status) = 0; + if ($line =~ /init_child_poa\s*\(/) { + $initChildPOAArg = 0; + $status = 1; + } + return $status; +} + + +sub replaceChildOrbName { + my($line) = shift; + if ($initChildPOAArg < 4) { + if ($line =~ /ACE_ENV_ARG_PARAMETER/) { + $line =~ s/ACE_ENV_ARG_PARAMETER/,ACE_ENV_ARG_PARAMETER/; + } + my($length) = length($line); + my($previous) = 0; + my($replace) = " TAO_TestCombinedThreads::getRandomString(" . + "\"$name\").c_str()"; + + for(my $i = 0; $i < $length; $i++) { + my($ch) = substr($line, $i, 1); + ## Add the substr check because the ACE_ENV_ARG_PARAMETER doesn't + ## have a comma before it and the above search and replace doesn't + ## work for multi-lined ORB_init's + if ($ch eq "," || $ch eq ")" || + ($orbInitArg == 2 && $i == $length - 1 && + substr($line, $previous) !~ /^\s+$/)) { + $initChildPOAArg++; + if ($initChildPOAArg == 4) { + my($size) = $i - $previous; + my($part) = substr($line, $previous, $size); + # I am relying on convention here + if ($part !~ /env/i) { + substr($line, $previous, $size) = $replace; + } + else { + substr($line, $previous, 0) = "$replace,\n"; + } + last; + } + $previous = $i + 1; + } + } + if ($line =~ /,ACE_ENV_ARG_PARAMETER/) { + $line =~ s/,ACE_ENV_ARG_PARAMETER/ ACE_ENV_ARG_PARAMETER/; + } + } + return $line; +} + + +sub usageAndExit { + my($str) = shift; + if (defined $str) { + print STDERR "$str\n"; + } + print STDERR "Usage: " . basename($0) . + " [-orbcore] [-unix] [-notimeout] [-main <main prefix>]\n" . + " <input file> <output file>\n"; + exit(1); +} + + +sub modifyFileAttributes { + my($orig) = shift; + my($new) = shift; + my(@buf) = stat($orig); + + if (defined $buf[0]) { + utime($buf[8], $buf[9] + 1, $new); + } +} + + +# ************************************************************** +# Main Section +# ************************************************************** + +my($useORBCore) = 0; +my($useThreadM) = 0; +my($unixDefines) = 0; +my($useTimeouts) = 1; + +while(defined $ARGV[0] && $ARGV[0] =~ /^-/) { + if ($ARGV[0] eq '-threadmanager') { + $useThreadM = 1; + shift; + } + elsif ($ARGV[0] eq '-orbcore') { + $useORBCore = 1; + shift; + } + elsif ($ARGV[0] eq '-unix') { + $unixDefines = 1; + shift; + } + elsif ($ARGV[0] eq '-main') { + shift; + if (defined $ARGV[0]) { + $name = $ARGV[0]; + shift; + } + else { + usageAndExit("-main requires a parameter"); + } + } + elsif ($ARGV[0] eq '-notimeout') { + $useTimeouts = 0; + shift; + } + else { + usageAndExit("Unknown option: $ARGV[0]"); + } +} + +## We should have an input and output file name at this point. +if ($#ARGV != 1) { + usageAndExit(); +} + + +# ************************************************************** +# Get the basename and remove the .cpp +# We will use this as the prefix to our main function +# ************************************************************** + +if ($name eq "") { + $name = basename($ARGV[0]); + $name =~ s/\.cpp//; + $name =~ s/\-/_/g; +} + +# ************************************************************** +# Read in the file and push it into an array. Then, print it +# out when we are done modifying it. +# ************************************************************** + +my($status) = 0; +if (open(IN, $ARGV[0])) { + if (open(OUT, ">$ARGV[1]")) { + my(@lines) = (); + my($line) = ""; + if ($useThreadM) { + while(<IN>) { + $line = $_; + $line =~ s/ACE_Thread\s*::\s*join/TAO_TestCombinedThreads::thr_join/g; +# $line =~ s/^\s*template\s*class\s*.*;\s*$//g; + push(@lines, $line); + } + unshift(@lines, "#include <tests/TestUtils/TestCombinedThreads.h>\n"); + } + elsif ($useORBCore) { + my($insideInstance) = 0; + while(<IN>) { + $line = $_; +# $line =~ s/^\s*template\s*class\s*.*;\s*$//g; + if ($line =~ /^TAO_ORB_Core_instance\s*\(.*\)/) { + $insideInstance = 1; + } + if ($insideInstance && $line =~ /return\s+/) { + $line = " // Find the orb for the thread that " . + "registered the ORB id\n" . + " TAO_ORB_Core* hack = orb_table->find(" . + "TAO_TestCombinedThreads::getORBId());\n" . + " if (hack != 0) {\n" . + " return hack;\n" . + " }\n\n" . $line; + $insideInstance = 0; + } + push(@lines, $line); + } + unshift(@lines, "#include <tests/TestUtils/TestCombinedThreads.h>\n"); + } + else { + my($insideComment) = 0; + my($insideParens) = 0; + my($scope) = 0; + my($orbrunFound) = 0; + my($insideORB_init) = 0; + my($insideInitChildPOA) = 0; + my($taskBase) = ""; + while(<IN>) { + $line = $_; + + my($lookForClosingParens) = 1; + ## Remove comments + if ($line =~ /(.*)(\/\/[\/]+.*)/ || $line =~ /(.*)(\/\/.*)/) { + my($qcount) = countChar($1, '"'); + $line = "$1"; + if (($qcount & 1) == 1) { + $line .= $2; + } + $line .= "\n"; + } + if ($line =~ /(.*)(\/\*.*\*\/)(.*)/) { + $line = "$1$3\n"; + } + elsif ($line =~ /(.*)(\/\*.*)/) { + $insideComment = 1; + $line = "$1\n"; + } + elsif ($insideComment && $line =~ /(.*\*\/)(.*)/) { + $insideComment = 0; + $line = $2; + } + elsif ($insideComment) { + $line = "\n"; + } + + if ($line =~ /TAO_ORB_Manager[\*\s]*\s+(\w+)/) { + $orbManager = $1; + } + + lookForActivate($line, \$taskBase); + if ($taskBase ne "" && $line =~ /thr_mgr\s*\(\)\->wait\s*\(\)/) { + $line =~ s/\->wait\s*\(.*\)/\->wait_grp \($taskBase.grp_id\(\)\)/; + } + + $insideInitChildPOA = ($insideInitChildPOA ? 1 : + lookForInitChildPOA($line)); + if ($insideInitChildPOA) { + $line = replaceChildOrbName($line); + if ($line =~ /\)\s*;/) { + $insideInitChildPOA = 0; + } + } + + $insideORB_init = ($insideORB_init ? 1 : lookForOrbInit($line)); + if ($insideORB_init) { + $line = replaceOrbName($line); + if ($line =~ /\)\s*;/) { + $insideORB_init = 0; + } + } + + + if (!$orbrunFound && $useTimeouts) { + if ($orbrunFound = lookForOrbRun($line)) { + $line = modifyOrbRun($line); + } + } + + ## Check the scope + if ($line =~ /{/) { + $scope += countChar($line, '{'); + } + ## Check for parens + if ($line =~ /\(/) { + $insideParens += countChar($line, '('); + ## This takes care of things like + ## int parse_args(...), but allows things like + ## int parse_args(..., + ## ...) to pass through which is what we want + if ($line =~ /\)/) { + $insideParens -= countChar($line, ')'); + $lookForClosingParens = 0; + } + } + + if ($scope == 0) { + ## This section is for forward declarations + if ($line =~ /;$/) { + my($forward_done) = 0; + my($counter) = $#lines; + while(!$forward_done) { + if ($lines[$counter] =~ /,$/) { + if ($lines[$counter] =~ /\s+\w+\s*\(.*,$/ && + needsToBeStatic($lines[$counter])) { + $lines[$counter] = "static $lines[$counter]"; + $forward_done = 1; + } + } + else { + $forward_done = 1; + } + $counter--; + } + } + if (!$insideParens && needsToBeStatic($line)) { + my($test) = $lines[$#lines]; + $test =~ s/^\s+//; + $test =~ s/\s+$//; + if ($test ne "static") { + $line = "static $line"; + } + } + } + + if ($scope == 1 && $orbrunFound && + ($line =~ /\s*return/ || $line =~ /\s*ACE_RETURN/)) { + $orbrunFound = 0; + } + + # Going down in scope + if ($line =~ /}/) { + $scope -= countChar($line, '}'); + if ($orbrunFound && $scope == 1) { + $orbrunFound = 0; + } + } + if ($lookForClosingParens && $line =~ /\)/) { + $insideParens -= countChar($line, ')'); + } + + ## Work backwards to remove the static from + ## the main or a method body + if ($scope == 0 && + ($line =~ /(main\s*(\()?)/ || $line =~ /\w+\s*::\s*\w+\s*\(/)) { + if ($line =~ /^static\s+/) { + $line =~ s/static\s+//; + } + else { + if ($lines[$#lines] =~ /static\s+/) { + $lines[$#lines] =~ s/static\s+//; + } + } + } + + push(@lines, $line); + if ($line =~ /(\smain\s*(\()?)/ || $line =~ /(^main\s*(\()?)/) { + my($saved) = pop(@lines); + if ($1 !~ /^\s*int/) { + my($below) = pop(@lines); + $saved = "$below$saved"; + } + if ($unixDefines) { + push(@lines, "#define main $name" . "_main\n\n"); + } + else { + push(@lines, "#define ace_main $name" . "_main\n" . + "#define ace_main_i $name" . "_main_i\n\n"); + } + push(@lines, $saved); + } + } + ## Look for last include and append include statement + for(my $i = $#lines; $i >= 0; $i--) { + if ($lines[$i] =~ /#include\s+/) { + $lines[$i] .= "#include <tests/" . + "TestUtils/TestCombinedThreads.h>\n"; + last; + } + } + unshift(@lines, "// \$Id\$\n\n"); + } + print OUT @lines; + close(OUT); + + if ($useThreadM || $useORBCore) { + modifyFileAttributes($ARGV[0], $ARGV[1]); + } + } + else { + print STDERR "Unable to open $ARGV[1] for output\n"; + $status = 1; + } + close(IN); +} +else { + print STDERR "Unable to open $ARGV[0] for input\n"; + $status = 1; +} + +exit($status); |