Author: metze Date: 2006-09-07 10:25:55 +0000 (Thu, 07 Sep 2006) New Revision: 18214
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18214 Log: don't add empty elements metze Modified: branches/SAMBA_4_0/source/build/smb_build/output.pm Changeset: Modified: branches/SAMBA_4_0/source/build/smb_build/output.pm =================================================================== --- branches/SAMBA_4_0/source/build/smb_build/output.pm 2006-09-07 10:02:32 UTC (rev 18213) +++ branches/SAMBA_4_0/source/build/smb_build/output.pm 2006-09-07 10:25:55 UTC (rev 18214) @@ -132,8 +132,22 @@ my $elem = $depend->{$_}; next if $elem == $part; - push(@{$part->{PUBLIC_CFLAGS}}, @{$elem->{CPPFLAGS}}) if defined(@{$elem->{CPPFLAGS}}); - push(@{$part->{PUBLIC_CFLAGS}}, $elem->{CFLAGS}) if defined($elem->{CFLAGS}); + if (defined(@{$elem->{CPPFLAGS}})) { + my $count = 0; + foreach (@{$elem->{CPPFLAGS}}) { + $count++; + } + push(@{$part->{PUBLIC_CFLAGS}}, @{$elem->{CPPFLAGS}}) if ($count > 0); + } + + next if not defined($elem->{CFLAGS}); + next if $elem->{CFLAGS} eq ""; + my $found = 0; + foreach my $line (@{$part->{PUBLIC_CFLAGS}}) { + $found = 1 if ($line eq $elem->{CFLAGS}); + } + next if ($found == 1); + push(@{$part->{PUBLIC_CFLAGS}}, $elem->{CFLAGS}); }
