aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/headers_install.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/headers_install.pl')
-rw-r--r--scripts/headers_install.pl8
1 files changed, 7 insertions, 1 deletions
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index efb3be10d42..0425f5fd19e 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -18,7 +18,9 @@
18 18
19use strict; 19use strict;
20 20
21my ($readdir, $installdir, $arch, @files) = @ARGV; 21my ($readdir, $installdir, $arch, $printdir, @files) = @ARGV;
22
23$printdir =~ s@^include/@@;
22 24
23my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__"; 25my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__";
24 26
@@ -30,6 +32,10 @@ foreach my $file (@files) {
30 open(my $out, '>', $tmpfile) 32 open(my $out, '>', $tmpfile)
31 or die "$tmpfile: $!\n"; 33 or die "$tmpfile: $!\n";
32 while (my $line = <$in>) { 34 while (my $line = <$in>) {
35 # Any #include which uses "" and does not have a path needs
36 # rewriting so that the resultant user space headers are
37 # safe against the use of -I-.
38 $line =~ s/^(\s*#\s*include\s+)"([^\/]*?)"/$1<$printdir\/$2>/;
33 $line =~ s/([\s(])__user\s/$1/g; 39 $line =~ s/([\s(])__user\s/$1/g;
34 $line =~ s/([\s(])__force\s/$1/g; 40 $line =~ s/([\s(])__force\s/$1/g;
35 $line =~ s/([\s(])__iomem\s/$1/g; 41 $line =~ s/([\s(])__iomem\s/$1/g;