Skip to content

Commit

Permalink
Rename to opendds_mwc.pl, Don't Hardcode ACE_ROOT
Browse files Browse the repository at this point in the history
Also undo setenv bin path order change
  • Loading branch information
iguessthislldo committed Nov 29, 2022
1 parent 0f1d9e1 commit c0b7eeb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
/dcpsinfo_dump
/RtpsRelay
/inspect
/mwc.pl
/opendds_mwc.pl*
29 changes: 17 additions & 12 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -2059,15 +2059,19 @@ sub get_features {

sub write_opendds_mwc {
my $root = shift;
my $command_list = shift;
my $args = shift;

my $command = join(', ', map {perlstring($_)} @{$command_list});
$args = join(', ', (map {perlstring($_)} @{$args}));

my $path = "$root/bin/mwc.pl";
my $path = "$root/bin/opendds_mwc.pl";
my $fd = backup_and_open($path);
print $fd <<"EOF";
#!/usr/bin/env perl
exec($command, \@ARGV) or die("Failed to exec mwc: \$!");
if (!defined(\$ENV{ACE_ROOT}) || !defined(\$MPC_ROOT)) {
die("The enviroment needs to be setup.");
}
exec('perl', "\$ENV{ACE_ROOT}/bin/mwc.pl", $args, \@ARGV)
or die("Failed to exec mwc: \$!");
EOF
$fd->close();
print "Wrote $path\n" if $opts{'verbose'};
Expand Down Expand Up @@ -2303,13 +2307,13 @@ EOT
print "ENV: saving current environment\n" if $opts{'verbose'};
mergeToEnv($buildEnv);

my @mwccmd = ('perl', "$ENV{'ACE_ROOT'}/bin/mwc.pl", '-type', "$mpctype");
my @mwc_common_args = ('-type', "$mpctype");
if ($static) {
push(@mwccmd, '-static');
push(@mwc_common_args, '-static');
}
if (defined $opts{'mpcopts'}) {
for my $i (@{$opts{'mpcopts'}}) {
push(@mwccmd, split(/ /, $i));
push(@mwc_common_args, split(/ /, $i));
}
}

Expand All @@ -2319,19 +2323,20 @@ EOT
}

# Generate our own mwc wrapper script
write_opendds_mwc($buildEnv->{'DDS_ROOT'}, [@mwccmd, @feature_opts]);
write_opendds_mwc($buildEnv->{'DDS_ROOT'}, [@mwc_common_args, @feature_opts]);

my @mwc = ('perl', "$ENV{ACE_ROOT}/bin/mwc.pl");
print 'Running MPC to generate ', ($mpctype eq 'gnuace' ? 'makefiles' :
'project files'), ".\n";
if (run_command([@mwccmd, @feature_opts, "$buildEnv->{'DDS_ROOT'}$slash$ws"])) {
if (run_command([@mwc, @mwc_common_args, @feature_opts, "$buildEnv->{'DDS_ROOT'}$slash$ws"])) {
die "ERROR: Error from MPC, stopped";
}
$buildEnv->{'mpctype'} = $mpctype;

# If this is a target safety profile build
if (defined $opts{'no-opendds-safety-profile'}) {
# Generate ACE workspace separately, to exclude TAO
if (run_command([@mwccmd, "$buildEnv->{'ACE_ROOT'}/ace"])) {
if (run_command([@mwc, @mwc_common_args, "$buildEnv->{'ACE_ROOT'}/ace"])) {
die "ERROR: Error from MPC, stopped";
}
}
Expand Down Expand Up @@ -2530,8 +2535,8 @@ if ($cloned_build) {
}
}

push_path(\%targetEnv, $hostEnv{'DDS_ROOT'} . $slash . 'bin');
push_path(\%targetEnv, $hostEnv{'ACE_ROOT'} . $slash . 'bin');
push_path(\%targetEnv, $hostEnv{'DDS_ROOT'} . $slash . 'bin');

print "Cross-compile configuring host\n";

Expand Down Expand Up @@ -2567,8 +2572,8 @@ else { # does not require cloned builds
setEnv('HOST_DDS', $opts{'host-tools'});
}

push_path(\%targetEnv, $targetEnv{'DDS_ROOT'} . $slash . 'bin');
push_path(\%targetEnv, $targetEnv{'ACE_ROOT'} . $slash . 'bin');
push_path(\%targetEnv, $targetEnv{'DDS_ROOT'} . $slash . 'bin');

unless ($opts{'static'}) {
push_libpath(\%targetEnv, $targetEnv{'ACE_ROOT'} . $slash . 'lib');
Expand Down

0 comments on commit c0b7eeb

Please sign in to comment.