diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-24 01:33:08 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-04-24 01:33:08 -0300 |
commit | 005392231f73c7f7781c04eebf5869c0174f503e (patch) | |
tree | a261d186361d85d130fe033cc63d575421800727 /v4l/scripts/make_config_compat.pl | |
parent | 59964b28e0205cdf0a4465194f40867b7c7f5aa6 (diff) | |
parent | 2da45c822154d03cd7db86ac11b52385f1fac384 (diff) | |
download | mediapointer-dvb-s2-005392231f73c7f7781c04eebf5869c0174f503e.tar.gz mediapointer-dvb-s2-005392231f73c7f7781c04eebf5869c0174f503e.tar.bz2 |
merge: http://jusst.de/hg/v4l-dvb/
From: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'v4l/scripts/make_config_compat.pl')
-rwxr-xr-x | v4l/scripts/make_config_compat.pl | 68 |
1 files changed, 58 insertions, 10 deletions
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 423dcff77..3c2b623ca 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -218,40 +218,86 @@ sub check_net_dev() sub check_usb_endpoint_type() { - my $file = "$kdir/include/linux/usb.h"; + my $nfiles = 0; + my @files = ( "$kdir/include/linux/usb.h", "$kdir/include/linux/usb/ch9.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or next; + $nfiles++; + while (<IN>) { + if (m/usb_endpoint_type/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + die "Usb headers not found" if (!$nfiles); + + # definition not found. This means that we need compat + $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; +} + +sub check_pci_ioremap_bar() +{ + my $file = "$kdir/include/linux/pci.h"; my $need_compat = 1; open INNET, "<$file" or die "File not found: $file"; while (<INNET>) { - if (m/usb_endpoint_type/) { + if (m/pci_ioremap_bar/) { $need_compat = 0; last; } } if ($need_compat) { - $out.= "\n#define NEED_USB_ENDPOINT_TYPE 1\n"; + $out.= "\n#define NEED_PCI_IOREMAP_BAR 1\n"; } close INNET; } -sub check_pci_ioremap_bar() +sub check_snd_card_create() { - my $file = "$kdir/include/linux/pci.h"; + my $file = "$kdir/include/sound/core.h"; my $need_compat = 1; - open INNET, "<$file" or die "File not found: $file"; - while (<INNET>) { - if (m/pci_ioremap_bar/) { + open IN, "<$file" or die "File not found: $file"; + while (<IN>) { + if (m/snd_card_create/) { $need_compat = 0; last; } } if ($need_compat) { - $out.= "\n#define NEED_PCI_IOREMAP_BAR 1\n"; + $out.= "\n#define NEED_SND_CARD_CREATE\n"; } - close INNET; + close IN; +} + +sub check_poll_schedule() +{ + + + my @files = ( "$kdir//include/linux/poll.h" ); + + foreach my $file ( @files ) { + open IN, "<$file" or die "File not found: $file"; + while (<IN>) { + if (m/poll_schedule/) { + close IN; + # definition found. No need for compat + return; + } + } + close IN; + } + + # definition not found. This means that we need compat + $out.= "\n#define NEED_POLL_SCHEDULE 1\n"; } sub check_other_dependencies() @@ -269,6 +315,8 @@ sub check_other_dependencies() check_net_dev(); check_usb_endpoint_type(); check_pci_ioremap_bar(); + check_snd_card_create(); + check_poll_schedule(); } # Do the basic rules |