die "Can't find 'dot'" if (! -x "$DotPath");
}
+if (defined($ENV{NM})) {
+ chomp($nmPath=$ENV{NM});
+}
+
if (!defined($nmPath) || $nmPath eq "") {
chomp($nmPath=`which nm`);
die "Can't find 'nm'" if (! -x "$nmPath");
# this strips both LF and CRLF.
$libdefs{$_} = $lib;
}
- close DEFS;
+ close DEFS or die "nm failed";
}
# Gather definitions from the object files.
# this strips both LF and CRLF.
$objdefs{$_} = $obj;
}
- close DEFS;
+ close DEFS or die "nm failed";
}
# Generate one entry in the <dl> list. This generates the <dt> and <dd> elements
print " <dt><b>$lib</b</dt><dd><ul>\n";
}
open UNDEFS,
- "$nmPath -g -u $Directory/$lib | sed -e 's/^[ 0]* U //' | sort | uniq |";
+ "$nmPath -u $Directory/$lib | sed -e 's/^[ 0]* U //' | sort | uniq |";
my %DepLibs;
while (<UNDEFS>) {
chomp;
}
}
}
- close UNDEFS;
+ close UNDEFS or die "nm failed";
unless(keys %DepLibs) {
# above failed
- open UNDEFS, "$nmPath -g -u $Directory/$lib |";
+ open UNDEFS, "$nmPath -u $Directory/$lib |";
while (<UNDEFS>) {
# to bypass non-working sed
if (' ' eq substr($_,0,2) and index($_,'U ')) {
}
}
}
+ close UNDEFS or die "nm failed";
}
for my $key (sort keys %DepLibs) {