~ubuntu-branches/ubuntu/jaunty/ndiswrapper/jaunty

« back to all changes in this revision

Viewing changes to driver/mkexport.sh

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2008-11-21 14:17:35 UTC
  • mfrom: (1.2.11 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20081121141735-hzymcfoy3up8hego
Tags: 1.53-2ubuntu1
* Merge with Debian; remaining changes:
  - Build for lpia.
  - debian/control:
    + Update description to point out that the kernel source package is
      not required with the standard Ubuntu kernel.
    + Change the Maintainer address.
  - debian/control:
    + Drop ndiswrapper-source.

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 "};"