aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/headers_install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/headers_install.sh')
-rw-r--r--scripts/headers_install.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/headers_install.sh b/scripts/headers_install.sh
index 643764f53ea7..5de5660cb708 100644
--- a/scripts/headers_install.sh
+++ b/scripts/headers_install.sh
@@ -2,7 +2,7 @@
2 2
3if [ $# -lt 1 ] 3if [ $# -lt 1 ]
4then 4then
5 echo "Usage: headers_install.sh OUTDIR [FILES...] 5 echo "Usage: headers_install.sh OUTDIR SRCDIR [FILES...]
6 echo 6 echo
7 echo "Prepares kernel header files for use by user space, by removing" 7 echo "Prepares kernel header files for use by user space, by removing"
8 echo "all compiler.h definitions and #includes, removing any" 8 echo "all compiler.h definitions and #includes, removing any"
@@ -10,6 +10,7 @@ then
10 echo "asm/inline/volatile keywords." 10 echo "asm/inline/volatile keywords."
11 echo 11 echo
12 echo "OUTDIR: directory to write each userspace header FILE to." 12 echo "OUTDIR: directory to write each userspace header FILE to."
13 echo "SRCDIR: source directory where files are picked."
13 echo "FILES: list of header files to operate on." 14 echo "FILES: list of header files to operate on."
14 15
15 exit 1 16 exit 1
@@ -19,6 +20,8 @@ fi
19 20
20OUTDIR="$1" 21OUTDIR="$1"
21shift 22shift
23SRCDIR="$1"
24shift
22 25
23# Iterate through files listed on command line 26# Iterate through files listed on command line
24 27
@@ -34,7 +37,7 @@ do
34 -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \ 37 -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \
35 -e 's/(^|[ \t(])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \ 38 -e 's/(^|[ \t(])(inline|asm|volatile)([ \t(]|$)/\1__\2__\3/g' \
36 -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \ 39 -e 's@#(ifndef|define|endif[ \t]*/[*])[ \t]*_UAPI@#\1 @' \
37 "$i" > "$OUTDIR/$FILE.sed" || exit 1 40 "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || exit 1
38 scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \ 41 scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \
39 > "$OUTDIR/$FILE" 42 > "$OUTDIR/$FILE"
40 [ $? -gt 1 ] && exit 1 43 [ $? -gt 1 ] && exit 1