aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/headers_install.pl
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-06-01 11:55:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-01 11:55:52 -0400
commit1f73897861b8ef0be64ff4b801f8d6f830f683b5 (patch)
treeb4bae8f12e1422113910d8cb00a19d010dc4a52f /scripts/headers_install.pl
parentb904d7131d116900524bd36ec170dcd97846bfd3 (diff)
parent64ffc9ff424c65adcffe7d590018cc75e2d5d42a (diff)
Merge branch 'for-35' of git://repo.or.cz/linux-kbuild
* 'for-35' of git://repo.or.cz/linux-kbuild: (81 commits) kbuild: Revert part of e8d400a to resolve a conflict kbuild: Fix checking of scm-identifier variable gconfig: add support to show hidden options that have prompts menuconfig: add support to show hidden options which have prompts gconfig: remove show_debug option gconfig: remove dbg_print_ptype() and dbg_print_stype() kconfig: fix zconfdump() kconfig: some small fixes add random binaries to .gitignore kbuild: Include gen_initramfs_list.sh and the file list in the .d file kconfig: recalc symbol value before showing search results .gitignore: ignore *.lzo files headerdep: perlcritic warning scripts/Makefile.lib: Align the output of LZO kbuild: Generate modules.builtin in make modules_install Revert "kbuild: specify absolute paths for cscope" kbuild: Do not unnecessarily regenerate modules.builtin headers_install: use local file handles headers_check: fix perl warnings export_report: fix perl warnings ...
Diffstat (limited to 'scripts/headers_install.pl')
-rw-r--r--scripts/headers_install.pl19
1 files changed, 10 insertions, 9 deletions
diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl
index b89ca2c58fdb..4ca3be3b2e50 100644
--- a/scripts/headers_install.pl
+++ b/scripts/headers_install.pl
@@ -23,13 +23,13 @@ my ($readdir, $installdir, $arch, @files) = @ARGV;
23my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__"; 23my $unifdef = "scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__";
24 24
25foreach my $file (@files) { 25foreach my $file (@files) {
26 local *INFILE;
27 local *OUTFILE;
28 my $tmpfile = "$installdir/$file.tmp"; 26 my $tmpfile = "$installdir/$file.tmp";
29 open(INFILE, "<$readdir/$file") 27
30 or die "$readdir/$file: $!\n"; 28 open(my $in, '<', "$readdir/$file")
31 open(OUTFILE, ">$tmpfile") or die "$tmpfile: $!\n"; 29 or die "$readdir/$file: $!\n";
32 while (my $line = <INFILE>) { 30 open(my $out, '>', $tmpfile)
31 or die "$tmpfile: $!\n";
32 while (my $line = <$in>) {
33 $line =~ s/([\s(])__user\s/$1/g; 33 $line =~ s/([\s(])__user\s/$1/g;
34 $line =~ s/([\s(])__force\s/$1/g; 34 $line =~ s/([\s(])__force\s/$1/g;
35 $line =~ s/([\s(])__iomem\s/$1/g; 35 $line =~ s/([\s(])__iomem\s/$1/g;
@@ -39,10 +39,11 @@ foreach my $file (@files) {
39 $line =~ s/(^|\s)(inline)\b/$1__$2__/g; 39 $line =~ s/(^|\s)(inline)\b/$1__$2__/g;
40 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; 40 $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g;
41 $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g; 41 $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g;
42 printf OUTFILE "%s", $line; 42 printf {$out} "%s", $line;
43 } 43 }
44 close OUTFILE; 44 close $out;
45 close INFILE; 45 close $in;
46
46 system $unifdef . " $tmpfile > $installdir/$file"; 47 system $unifdef . " $tmpfile > $installdir/$file";
47 unlink $tmpfile; 48 unlink $tmpfile;
48} 49}