summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)