diff options
Diffstat (limited to 'v4l/scripts/make_config_compat.pl')
-rwxr-xr-x | v4l/scripts/make_config_compat.pl | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index 3c2b623ca..7c7841459 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -280,9 +280,7 @@ sub check_snd_card_create() sub check_poll_schedule() { - - - my @files = ( "$kdir//include/linux/poll.h" ); + my @files = ( "$kdir/include/linux/poll.h" ); foreach my $file ( @files ) { open IN, "<$file" or die "File not found: $file"; @@ -300,6 +298,46 @@ sub check_poll_schedule() $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_other_dependencies() { check_spin_lock(); @@ -317,6 +355,8 @@ sub check_other_dependencies() check_pci_ioremap_bar(); check_snd_card_create(); check_poll_schedule(); + check_snd_BUG_ON(); + check_bitops(); } # Do the basic rules |