~ubuntu-branches/ubuntu/maverick/linux-backports-modules-2.6.32/maverick

« back to all changes in this revision

Viewing changes to updates/alsa-driver/utils/old/export-symbols.perl

  • Committer: Bazaar Package Importer
  • Author(s): Andy Whitcroft, Andy Whitcroft
  • Date: 2010-02-04 23:15:51 UTC
  • Revision ID: james.westby@ubuntu.com-20100204231551-vjz5pkvxclukjxm1
Tags: 2.6.32-12.1
[ Andy Whitcroft ]

* initial LBM for lucid
* drop generated files
* printchanges -- rebase tree does not have stable tags use changelog
* printenv -- add revisions to printenv output
* formally rename compat-wireless to linux-backports-modules-wireless
* Update to compat-wireless-2.6.33-rc5
* update nouveau to mainline 2.6.33-rc4
* add new LBM package for nouveau
* nouveau -- fix major numbers and proc entry names
* fix up firmware installs for -wireless
* clean up UPDATE-NOVEAU
* update Nouveau to v2.6.33-rc6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
use File::Basename;
 
3
 
 
4
die "Usage: $0 file.sym\n" unless (-r $ARGV[0]); 
 
5
 
 
6
$KERNEL=`uname -r`;
 
7
($KVERSION,$KPATCHLEVEL,$KSUBLEVEL)=split /\./, $KERNEL;
 
8
 
 
9
$SRC=$ARGV[0];
 
10
$BASE=basename($SRC,".sym");
 
11
$BASE1=$BASE;
 
12
$BASE1 =~ s/-/_/g;
 
13
 
 
14
$DEST= $BASE . ".c";
 
15
 
 
16
$XSYM1="unknown";
 
17
$XSYM2="unknown";
 
18
 
 
19
if ($KVERSION == 2) {
 
20
  if ($KPATCHLEVEL == 1) {
 
21
    $XSYM1="EXPORT_SYMBOL(";
 
22
    $XSYM2=");\n";
 
23
  }
 
24
  else {
 
25
    $XSYM1="X(";
 
26
    $XSYM2="),\n";
 
27
  }
 
28
}
 
29
 
 
30
die "$SRC = $DEST: Error (1)\n" if ($SRC eq $DEST);
 
31
 
 
32
print "generating $DEST from $SRC... ";
 
33
  
 
34
open (SRC, "<$SRC") or die "Cannot open >> $SRC <<\n";
 
35
@SRCtext=<SRC>;
 
36
 
 
37
open (DEST, ">$DEST") or die "Cannot write to >> $DEST <<\n";
 
38
 
 
39
print DEST qq(/*\n);
 
40
print DEST qq( *  File generated by script export-symbols from file $SRC...\n);
 
41
print DEST qq( *  Don\'t edit!!!\n);
 
42
print DEST qq( */\n);
 
43
print DEST qq(\n);
 
44
print DEST qq(\#define EXPORT_SYMTAB\n);
 
45
print DEST qq(\#include "driver.h"\n);
 
46
 
 
47
foreach $line (@SRCtext) {
 
48
  if ( substr($line,0,1) eq "+" ) { 
 
49
    print DEST substr($line , 2);
 
50
  }
 
51
}
 
52
 
 
53
print DEST qq(\#ifndef LINUX_2_1\n);
 
54
print DEST qq(struct symbol_table snd_symbol_table_$BASE1 = \{\n);
 
55
print DEST qq(\#include <linux/symtab_begin.h>\n);
 
56
print DEST qq(\#endif\n);
 
57
 
 
58
foreach $line (@SRCtext) {
 
59
  chomp($line);
 
60
  print DEST "  /* ", substr($line,2), "*/\n" 
 
61
    if ( substr($line,0,1) eq "\#" );
 
62
  print DEST $XSYM1, $line, $XSYM2 
 
63
    if ( substr($line,0,1) ne "\#" && substr($line,0,1) ne "+" );
 
64
}
 
65
 
 
66
print DEST qq(\#ifndef LINUX_2_1\n);
 
67
print DEST qq(\#include <linux/symtab_end.h>\n);
 
68
print DEST qq(}\;\n);
 
69
print DEST qq(\#endif\n);
 
70
 
 
71
print "done\n";