summaryrefslogtreecommitdiff
path: root/v4l/scripts/make_config_compat.pl
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2009-08-30 18:56:14 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-08-30 18:56:14 -0300
commit502293205239f8ec860b4c33187cd7a3fc0f421c (patch)
tree3859aab46057cb3726731ca0ef65cd45c9e73660 /v4l/scripts/make_config_compat.pl
parent71911bc952f2394dede17c5713de0b0dfcb04fae (diff)
parent52ef68ff244a5cd4707558c9aa803ecb9c1342dc (diff)
downloadmediapointer-dvb-s2-502293205239f8ec860b4c33187cd7a3fc0f421c.tar.gz
mediapointer-dvb-s2-502293205239f8ec860b4c33187cd7a3fc0f421c.tar.bz2
merge: http://kernellabs.com/hg/~mkrufky/tda18271
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-xv4l/scripts/make_config_compat.pl129
1 files changed, 119 insertions, 10 deletions
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl
index 423dcff77..1f5b8bae6 100755
--- a/v4l/scripts/make_config_compat.pl
+++ b/v4l/scripts/make_config_compat.pl
@@ -218,40 +218,144 @@ 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_snd_BUG_ON()
+{
+ my @files = ( "$kdir/include/sound/core.h" );
+
+ foreach my $file ( @files ) {
+ open IN, "<$file" or die "File not found: $file";
+ while (<IN>) {
+ if (m/snd_BUG_ON/) {
+ close IN;
+ # definition found. No need for compat
+ return;
+ }
+ }
+ close IN;
+ }
+
+ # definition not found. This means that we need compat
+ $out.= "\n#define NEED_SND_BUG_ON 1\n";
+}
+
+sub check_bitops()
+{
+ my @files = ( "$kdir/include/linux/bitops.h" );
+
+ foreach my $file ( @files ) {
+ open IN, "<$file" or next;
+ while (<IN>) {
+ if (m/#define\s+BIT\(/) {
+ close IN;
+ # definition found. No need for compat
+ return;
+ }
+ }
+ close IN;
+ }
+
+ # definition not found. This means that we need compat
+ $out.= "\n#define NEED_BITOPS 1\n";
+}
+
+sub check_delayed_work()
+{
+ my @files = ( "$kdir//include/linux/workqueue.h" );
+
+ foreach my $file ( @files ) {
+ open IN, "<$file" or die "File not found: $file";
+ while (<IN>) {
+ if (m/struct\s+delayed_work/) {
+ close IN;
+ # definition found. No need for compat
+ return;
+ }
+ }
+ close IN;
+ }
+
+ # definition not found. This means that we need compat
+ $out.= "\n#define NEED_DELAYED_WORK 1\n";
}
sub check_other_dependencies()
@@ -269,6 +373,11 @@ sub check_other_dependencies()
check_net_dev();
check_usb_endpoint_type();
check_pci_ioremap_bar();
+ check_snd_card_create();
+ check_poll_schedule();
+ check_snd_BUG_ON();
+ check_bitops();
+ check_delayed_work();
}
# Do the basic rules