Previously the Makefile piped the output of makedef.pl to sort. This had the
side effect of ignoring the exit code from makedef.pl, as make could only
see the exit code of the last command in the pipeline. This concealed the
causes of the parallel make failure when makedef.pl was missing a dependency
on Config.pm
esac
$spitshell >>$Makefile <<'!NO!SUBS!'
perl.exp: $(MINIPERLEXP) makedef.pl $(CONFIGPM) $(SYM) $(SYMH)
- ./$(MINIPERLEXP) makedef.pl PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" | sort -u | sort -f > perl.exp
+ ./$(MINIPERLEXP) makedef.pl --sort-fold PLATFORM=aix CC_FLAGS="$(OPTIMIZE)" > perl.exp
!NO!SUBS!
;;
my %define;
+my $fold;
+
sub process_cc_flags {
foreach (map {split /\s+/, $_} @_) {
$define{$1} = $2 // 1 if /^-D(\w+)(?:=(.+))?/;
process_cc_flags($1);
} elsif ($flag =~ /^(CCTYPE|FILETYPE|PLATFORM|TARG_DIR)=(.+)$/) {
$ARGS{$1} = $2;
+ } elsif ($flag eq '--sort-fold') {
+ ++$fold;
}
}
# Then the symbols
-foreach my $symbol (sort keys %export) {
+my @symbols = $fold ? sort {lc $a cmp lc $b} keys %export : sort keys %export;
+foreach my $symbol (@symbols) {
if ($ARGS{PLATFORM} =~ /^win(?:32|ce)$/) {
print "\t$symbol\n";
}