X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=scripts%2Fheaders_install.pl;h=c6ae4052ab43bb5b8a884c23923d59ebf49de8ec;hb=b2c0cea6b1cb210e962f07047df602875564069e;hp=68591cd0873127d2c00d2405f81975f2a37fafb8;hpb=db1bec4f5271d7799d481cd4d95fdc268bdd7614;p=safe%2Fjmp%2Flinux-2.6 diff --git a/scripts/headers_install.pl b/scripts/headers_install.pl index 68591cd..c6ae405 100644 --- a/scripts/headers_install.pl +++ b/scripts/headers_install.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # # headers_install prepare the listed header files for use in # user space and copy the files to their destination. @@ -17,28 +17,32 @@ # 3) Drop all sections defined out by __KERNEL__ (using unifdef) use strict; -use warnings; my ($readdir, $installdir, $arch, @files) = @ARGV; my $unifdef = "scripts/unifdef -U__KERNEL__"; foreach my $file (@files) { + local *INFILE; + local *OUTFILE; my $tmpfile = "$installdir/$file.tmp"; - open(my $infile, '<', "$readdir/$file") + open(INFILE, "<$readdir/$file") or die "$readdir/$file: $!\n"; - open(my $outfile, '>', "$tmpfile") or die "$tmpfile: $!\n"; - while (my $line = <$infile>) { + open(OUTFILE, ">$tmpfile") or die "$tmpfile: $!\n"; + while (my $line = ) { $line =~ s/([\s(])__user\s/$1/g; $line =~ s/([\s(])__force\s/$1/g; $line =~ s/([\s(])__iomem\s/$1/g; $line =~ s/\s__attribute_const__\s/ /g; $line =~ s/\s__attribute_const__$//g; $line =~ s/^#include //; - printf $outfile "%s", $line; + $line =~ s/(^|\s)(inline)\b/$1__$2__/g; + $line =~ s/(^|\s)(asm)\b(\s|[(]|$)/$1__$2__$3/g; + $line =~ s/(^|\s|[(])(volatile)\b(\s|[(]|$)/$1__$2__$3/g; + printf OUTFILE "%s", $line; } - close $outfile; - close $infile; + close OUTFILE; + close INFILE; system $unifdef . " $tmpfile > $installdir/$file"; unlink $tmpfile; }