Author: mdiep
Date: Sat Jan 6 22:10:15 2007
New Revision: 16458
Modified:
trunk/config/gen/makefiles/dynoplibs_pl.in
Log:
Fix the dyopslibs test I broke earlier (while still allowing other .o files to
be linked in)
Modified: trunk/config/gen/makefiles/dynoplibs_pl.in
==============================================================================
--- trunk/config/gen/makefiles/dynoplibs_pl.in (original)
+++ trunk/config/gen/makefiles/dynoplibs_pl.in Sat Jan 6 22:10:15 2007
@@ -100,45 +100,49 @@
################### MAIN PROGRAM ################
-my ($mode, $oplib, @other) = @ARGV;
+my ($mode, @oplibs) = @ARGV;
if ($mode eq 'generate') {
# Convert X.ops -> ops_X.c, ops_X_cgp.c, ops_X_cg.c and ops_X_switch.c
my $core;
- generate_c($oplib);
+ generate_c($_) foreach (@oplibs);
}
elsif ($mode eq 'compile') {
# Convert X.c -> X.o for all X.c
my $core_suffix;
foreach $core_suffix (values %cores) {
- compile($oplib . "_ops$core_suffix");
+ compile($_ . "_ops$core_suffix") foreach (@oplibs);
}
}
elsif ($mode eq 'linklibs') {
+ my @objs = grep { /\.o$/} @oplibs;
+ @oplibs = grep {!/\.o$/} @oplibs;
+
# Convert X.o -> X.so
my $core_suffix;
foreach $core_suffix (values %cores) {
- partial_link({}, $oplib . "_ops$core_suffix");
+ partial_link({}, $_ . "_ops$core_suffix", @objs) foreach (@oplibs);
}
}
elsif ($mode eq 'copy') {
# Copy *.so -> destination, where destination is the first
# argument, given as --destination=DIRECTORY
- $oplib =~ /--destination=(.*)/
+ shift(@oplibs) =~ /--destination=(.*)/
or die "copy command requires destination";
my $dest = $1;
- $oplib = shift @other;
my $core_suffix;
foreach $core_suffix (values %cores) {
- my $src = $oplib . "_ops$core_suffix$LOAD_EXT";
- copy($src, $dest)
- or die "Copy $src failed ($?)\n";
-
- # Execute permissions on libraries is especially important on
- # some platforms
- if ($^O eq 'hpux' or $^O eq 'cygwin') {
- chmod 0755, "[EMAIL PROTECTED]@$src";
+ foreach (@oplibs) {
+ my $src = $_ . "_ops$core_suffix$LOAD_EXT";
+ copy($src, $dest)
+ or die "Copy $src failed ($?)\n";
+
+ # Execute permissions on libraries is especially important on
+ # some platforms
+ if ($^O eq 'hpux' or $^O eq 'cygwin') {
+ chmod 0755, "[EMAIL PROTECTED]@$src";
+ }
}
}
}
@@ -201,10 +205,10 @@
}
sub partial_link {
- my ($libs, $stem) = @_;
+ my ($libs, $stem, @objs) = @_;
- if (needs_build("$stem$LOAD_EXT", "$stem$O", @other)) {
- return run(partial_link_cmd("$stem$LOAD_EXT", $libs, [ "$stem$O",
@other ]))
+ if (needs_build("$stem$LOAD_EXT", "$stem$O", @objs)) {
+ return run(partial_link_cmd("$stem$LOAD_EXT", $libs, [ "$stem$O",
@objs ]))
or die "partial link $stem$LOAD_EXT failed ($?)\n";
}
else {