diff options
Diffstat (limited to 'v4l/scripts/make_config_compat.pl')
-rwxr-xr-x | v4l/scripts/make_config_compat.pl | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/v4l/scripts/make_config_compat.pl b/v4l/scripts/make_config_compat.pl index bd34e7193..3a8bdd81e 100755 --- a/v4l/scripts/make_config_compat.pl +++ b/v4l/scripts/make_config_compat.pl @@ -102,6 +102,101 @@ 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 (<INNET>) { + 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 (<INNET>) { + 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 (<INNET>) { + if (m/proc_create/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_PROC_CREATE 1\n"; + } + close INNET; +} + +sub check_pcm_lock() +{ + my $file = "$kdir/include/sound/pcm.h"; + my $need_compat = 1; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/pcm_stream_lock/) { + $need_compat = 0; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NO_PCM_LOCK 1\n"; + } + close INNET; +} + +sub check_algo_control() +{ + my $file = "$kdir/include/linux/i2c.h"; + my $need_compat = 0; + + open INNET, "<$file" or die "File not found: $file"; + while (<INNET>) { + if (m/algo_control/) { + $need_compat = 1; + last; + } + } + + if ($need_compat) { + $out.= "\n#define NEED_ALGO_CONTROL 1\n"; + } + close INNET; +} + sub check_other_dependencies() { check_spin_lock(); @@ -109,6 +204,11 @@ 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(); + check_pcm_lock(); + check_algo_control(); } # Do the basic rules |