summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-06-23 12:19:41 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-23 12:19:41 -0300
commitd6f3e25616ac528ec4630545e5f5b7600f51c16f (patch)
tree6278c5000dab2508405accc0c43b6dcced8a5d54 /v4l
parentbc5e79ddb91cd8d5073c4d4f73e4faa784a2b68a (diff)
downloadmediapointer-dvb-s2-d6f3e25616ac528ec4630545e5f5b7600f51c16f.tar.gz
mediapointer-dvb-s2-d6f3e25616ac528ec4630545e5f5b7600f51c16f.tar.bz2
Have config-compat.h, undefine options turned off
From: Trent Piepho <xyzzy@speakeasy.org> 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 <xyzzy@speakeasy.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l')
-rw-r--r--v4l/Makefile27
1 files changed, 13 insertions, 14 deletions
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 \<linux\/config\.h\> >> 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 <linux/config.h>\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)