From 5d4e58dcdb5d3b0a6dfc17071d845e7fc69ff071 Mon Sep 17 00:00:00 2001 From: Nicholas Clark Date: Fri, 25 Nov 2011 18:16:35 +0100 Subject: [PATCH] On AIX, avoid a shell pipepline by making makedef.pl sort case insenitively. 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 --- Makefile.SH | 2 +- makedef.pl | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Makefile.SH b/Makefile.SH index 37acd12..7b050fa 100755 --- a/Makefile.SH +++ b/Makefile.SH @@ -724,7 +724,7 @@ PERLEXPORT = perl.exp 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! ;; diff --git a/makedef.pl b/makedef.pl index 8d6148a..0994fd9 100644 --- a/makedef.pl +++ b/makedef.pl @@ -40,6 +40,8 @@ my %ARGS = (CCTYPE => 'MSVC', TARG_DIR => ''); my %define; +my $fold; + sub process_cc_flags { foreach (map {split /\s+/, $_} @_) { $define{$1} = $2 // 1 if /^-D(\w+)(?:=(.+))?/; @@ -52,6 +54,8 @@ while (@ARGV) { process_cc_flags($1); } elsif ($flag =~ /^(CCTYPE|FILETYPE|PLATFORM|TARG_DIR)=(.+)$/) { $ARGS{$1} = $2; + } elsif ($flag eq '--sort-fold') { + ++$fold; } } @@ -1347,7 +1351,8 @@ elsif ($ARGS{PLATFORM} eq 'netware') { # 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"; } -- 2.7.4