~ubuntu-branches/ubuntu/karmic/linux-mvl-dove/karmic-proposed

« back to all changes in this revision

Viewing changes to ubuntu/ndiswrapper/mkexport.sh

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Bader
  • Date: 2010-03-10 22:24:12 UTC
  • mto: (15.1.2 karmic-security)
  • mto: This revision was merged to the branch mainline in revision 18.
  • Revision ID: james.westby@ubuntu.com-20100310222412-k86m3r53jw0je7x1
Tags: upstream-2.6.31
ImportĀ upstreamĀ versionĀ 2.6.31

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh
2
 
 
3
 
# Generate exports symbol table from C files
4
 
 
5
 
input="$1"
6
 
output="$2"
7
 
exports=$(basename "$output" .h)
8
 
exec >"$output"
9
 
 
10
 
echo "/* automatically generated from src */";
11
 
 
12
 
sed -n -e '/^\(wstdcall\|wfastcall\|noregparm\|__attribute__\)/{
13
 
:more
14
 
N
15
 
s/\([^{]\)$/\1/
16
 
t more
17
 
s/\n{$/;/
18
 
p
19
 
}' $input
20
 
 
21
 
echo "#ifdef CONFIG_X86_64";
22
 
 
23
 
sed -n \
24
 
        -e 's/.*WIN_FUNC(\([^\,]\+\) *\, *\([0-9]\+\)).*/'\
25
 
'WIN_FUNC_DECL(\1, \2)/p' \
26
 
        -e 's/.*WIN_FUNC_PTR(\([^\,]\+\) *\, *\([0-9]\+\)).*/'\
27
 
'WIN_FUNC_DECL(\1, \2)/p' $input | sort -u
28
 
 
29
 
echo "#endif"
30
 
echo "extern struct wrap_export $exports[];"
31
 
echo "struct wrap_export $exports[] = {"
32
 
 
33
 
sed -n \
34
 
        -e 's/.*WIN_FUNC(_win_\([^\,]\+\) *\, *\([0-9]\+\)).*/'\
35
 
'       WIN_WIN_SYMBOL(\1, \2),/p' \
36
 
        -e 's/.*WIN_FUNC(\([^\,]\+\) *\, *\([0-9]\+\)).*/'\
37
 
'       WIN_SYMBOL(\1, \2),/p' \
38
 
        -e 's/.*WIN_SYMBOL_MAP(\("[^"]\+"\)[ ,\n]\+\([^)]\+\)).*/'\
39
 
'       {\1, (generic_func)\2},/p' $input | sort -u
40
 
 
41
 
echo "  {NULL, NULL}"
42
 
echo "};"