From 2a52f7f2f94985c85a91553a241c7650276487c3 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 20 Aug 2005 05:43:56 +0000 Subject: evaluate #ifdef MM_KERNEL based on existance of ($LINUX . "/.mm") Signed-off-by: Michael Krufky --- v4l/scripts/buildpatch | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'v4l/scripts/buildpatch') diff --git a/v4l/scripts/buildpatch b/v4l/scripts/buildpatch index 319c46cf0..beeba862a 100644 --- a/v4l/scripts/buildpatch +++ b/v4l/scripts/buildpatch @@ -48,7 +48,13 @@ sub kernel_version() { sub filter_source ($$) { my ($in,$out) = @_; - my ($line,$if,$state); + my ($line,$if,$state,$mmkernel); + + if (-e $LINUX . "/.mm") { + $mmkernel = 1; + } else { + $mmkernel = 0; + } open IN, "<$in"; open OUT, ">$out"; @@ -64,9 +70,8 @@ sub filter_source ($$) { } if ($line =~ /^#ifdef MM_KERNEL/) { chomp($line); - $line =~ s@^#if\s*@@; $state = "if"; - $if = eval $line; + $if = $mmkernel; print OUT "/* BP #if $if ($line) */\n" if $DEBUG; next; } -- cgit v1.2.3