summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/build/smb_build/output.pm18
1 files changed, 16 insertions, 2 deletions
diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm
index 7accad92da..d617598a7a 100644
--- a/source4/build/smb_build/output.pm
+++ b/source4/build/smb_build/output.pm
@@ -132,8 +132,22 @@ sub create_output($$)
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});
}