From 7c3206d14cea8962f79628f11cd3f582f2b9644d Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 18 Oct 2007 16:25:58 -0200 Subject: Fix compilation for distro kernels with newer -ALSA trees From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_config_compat.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) mode change 100644 => 100755 v4l/scripts/make_config_compat.pl (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl old mode 100644 new mode 100755 index 21dce0126..785f9ff72 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -26,6 +26,25 @@ sub check_spin_lock() close INNET; } +sub check_snd_pcm_rate_to_rate_bit() +{ + my $file = "$kdir/include/sound/pcm.h"; + my $old_syntax = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/snd_pcm_rate_to_rate_bit/) { + $old_syntax = 0; + last; + } + } + + if ($old_syntax) { + $out.= "\n#define COMPAT_PCM_TO_RATE_BIT 1\n"; + } + close INNET; +} + sub check_snd_ctl_boolean_mono_info() { my $file = "$kdir/include/sound/control.h"; @@ -49,6 +68,7 @@ sub check_other_dependencies() { check_spin_lock(); check_snd_ctl_boolean_mono_info(); + check_snd_pcm_rate_to_rate_bit(); } # Do the basic rules -- cgit v1.2.3