#!/usr/bin/env perl $num_libs = 1; $num_classes = 2; $num_methods = 2; $num_mains = 2; $gxx = "g++ -m64 -mcpu=ultrasparc"; # Build method declarations. my $method_decl, @method_decl; my $method_call, @method_call; foreach $method (1 .. $num_methods) { push (@method_decl, "void method_${method} () { throw 1; }"); push (@method_call, "to_destroy d_${method}; method_${method} ();"); } $method_decl = join ("\n ", @method_decl); $method_call = join ("\n ", @method_call); foreach $lib (1 .. $num_libs) { my @objs; foreach $class (1 .. $num_classes) { my $header = "l_${lib}_${class}.h"; open (HEADER, ">${header}") || die "Can not open $header"; print HEADER < #include struct foo_${lib}_${class} { typedef foo_${lib}_${class} self_type; struct to_destroy { to_destroy () { self_type tem; tem.method_1 (); } ~to_destroy () { self_type tem; tem.method_1 (); } }; foo_${lib}_${class} () { $method_call } foo_${lib}_${class} (const self_type &) { $method_call } ~foo_${lib}_${class} () { $method_call } $method_decl static self_type bar (); std::string _a_string; }; EOH close (HEADER); } foreach $class (1 .. $num_classes) { my $source = "l_${lib}_${class}.cc"; my $object = "l_${lib}_${class}.o"; open (SOURCE, ">${source}") || die "Can not open $source"; foreach $j (1 .. $lib) { foreach $i (1 .. $num_classes) { print SOURCE <${source}") || die "Can not open ${source}"; foreach $lib (1 .. $num_libs) { foreach $class (1 .. $num_classes) { print MAIN <