From 76b6f5c5b37d1795e744a8f0347f7e80fd1cd434 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sat, 22 Nov 2008 11:39:10 -0200 Subject: Improve compatibility with RHEL kernels From: Mauro Carvalho Chehab Priority: normal Signed-off-by: Mauro Carvalho Chehab --- v4l/scripts/make_config_compat.pl | 60 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) (limited to 'v4l/scripts') diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index bd34e7193..f681baf3e 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -102,6 +102,63 @@ sub check_bool() close INDEP; } +sub check_is_singular() +{ + my $file = "$kdir/include/linux/list.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/list_is_singular/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_IS_SINGULAR 1\n"; + } + close INNET; +} + +sub check_clamp() +{ + my $file = "$kdir/include/linux/kernel.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/define\s+clamp/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_CLAMP 1\n"; + } + close INNET; +} + +sub check_proc_create() +{ + my $file = "$kdir/include/linux/proc_fs.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while () { + if (m/proc_create/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_PROC_FS 1\n"; + } + close INNET; +} + sub check_other_dependencies() { check_spin_lock(); @@ -109,6 +166,9 @@ sub check_other_dependencies() check_snd_ctl_boolean_mono_info(); check_snd_pcm_rate_to_rate_bit(); check_bool(); + check_is_singular(); + check_clamp(); + check_proc_create(); } # Do the basic rules -- cgit v1.2.3