2
# This perl script removes duplicate include paths left to the right
4
my @all_incl_paths = @ARGV;
5
my @cleaned_up_incl_paths;
6
foreach( @all_incl_paths ) {
7
$_ = remove_rel_paths($_);
9
push @cleaned_up_incl_paths, $_;
11
elsif( !entry_exists($_,\@cleaned_up_incl_paths) ) {
12
push @cleaned_up_incl_paths, $_;
15
print join( " ", @cleaned_up_incl_paths );
20
my $entry = shift; # String
21
my $list = shift; # Reference to an array
23
if( $entry eq $_ ) { return 1; }
28
sub remove_rel_paths {
30
if ($entry_in=~/-I\.\./) {
33
my @paths = split("/",$entry_in);
43
return join("/",@new_paths);