From d6f3e25616ac528ec4630545e5f5b7600f51c16f Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Fri, 23 Jun 2006 12:19:41 -0300 Subject: Have config-compat.h, undefine options turned off From: Trent Piepho Use a (make 3.81 safe!) in-line perl script to generate config-compat.h from .myconfig. The output will be more like the Kernel's output: Options set to 'm' will define CONFIG_WHATEVER_MODULE to 1, rather than define CONFIG_WHATEVER to m. Options set to 'y' to be defined to 1 instead of y. Options that are off will be #undef'ed, rather that omitted, so that they will override the settings from the kernel autoconf.h file. The last change will fix a problem where certain options, like CinergyT2 tuning and AV7110 firmware, wouldn't work properly if they were on in the kernel but off for v4l-dvb Hg. Signed-off-by: Trent Piepho Signed-off-by: Mauro Carvalho Chehab --- v4l/Makefile | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'v4l') diff --git a/v4l/Makefile b/v4l/Makefile index 0e90e13d8..b162ddcc3 100644 --- a/v4l/Makefile +++ b/v4l/Makefile @@ -177,20 +177,19 @@ links:: @find ../linux/sound -name '*.[ch]' -type f -exec ln -sf '{}' . \; config-compat.h:: .myconfig - @echo \#ifndef __CONFIG_COMPAT_H__ > config-compat.h - @echo \#define __CONFIG_COMPAT_H__ >> config-compat.h - @echo >> config-compat.h - @echo \#include \ >> config-compat.h - @echo >> config-compat.h - @grep "CONFIG\_" .myconfig | grep -v "\:\= n" | \ - sed s/"CONFIG\_"/"\#undef CONFIG\_"/1 | \ - sed s/"\:\= .*"/""/1 >> config-compat.h >> config-compat.h - @echo >> config-compat.h - @grep "CONFIG\_" .myconfig | grep -v "\:\= n" | \ - sed s/"CONFIG\_"/"\#define CONFIG\_"/1 | \ - sed s/"\:\="/""/1 >> config-compat.h >> config-compat.h - @echo >> config-compat.h - @echo \#endif >> config-compat.h + @perl \ + -e 'print "#ifndef __CONFIG_COMPAT_H__\n";' \ + -e 'print "#define __CONFIG_COMPAT_H__\n\n";' \ + -e 'print "#include \n\n";' \ + -e 'while(<>) {'\ + -e ' next unless /^(\S+)\s*:= (\S+)$$/;' \ + -e ' print "#undef $$1\n";' \ + -e ' if($$2 eq "n") { next; }' \ + -e ' elsif($$2 eq "m") { print "#define $$1_MODULE 1\n"; }' \ + -e ' elsif($$2 eq "y") { print "#define $$1 1\n"; }' \ + -e ' else { print "#define $$1 $$2\n"; }' \ + -e '} print "\n#endif\n";' \ + < .myconfig > config-compat.h kernel-links makelinks:: cd ..; v4l/scripts/makelinks.sh $(KDIR) -- cgit v1.2.3