summaryrefslogtreecommitdiff
path: root/source4/script
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-11-24 16:31:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:30 -0500
commitf98b34d0f20e2c105f0a31c12a549d0ec29b48bb (patch)
tree6fa0b2bf28547302dbc74b6e38b95f49a1306f20 /source4/script
parente984a98c106dea20535c5a0bb0810b2268a940cd (diff)
downloadsamba-f98b34d0f20e2c105f0a31c12a549d0ec29b48bb.tar.gz
samba-f98b34d0f20e2c105f0a31c12a549d0ec29b48bb.tar.bz2
samba-f98b34d0f20e2c105f0a31c12a549d0ec29b48bb.zip
r19880: Eliminate duplicates in the output.
(This used to be commit 2a8c8e1f2de551f360271855f09d8ae6497fb326)
Diffstat (limited to 'source4/script')
-rwxr-xr-xsource4/script/pkg-config14
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/script/pkg-config b/source4/script/pkg-config
index 72a458b815..458cac6be2 100755
--- a/source4/script/pkg-config
+++ b/source4/script/pkg-config
@@ -124,7 +124,21 @@ foreach my $pkg (@ARGV)
push (@out, Cflags($pkg)) if ($opt_cflags);
}
+sub nub
+{
+ my @list = @_;
+ my @ret = ();
+ my %seen = ();
+ foreach (@list) {
+ next if (defined($seen{$_}));
+ push (@ret, $_);
+ $seen{$_} = 1;
+ }
+ return @ret;
+}
+
if ($#out >= 0) {
+ @out = nub(@out);
print join(' ', @out) . "\n";
}