Increase dump length for a packet
[wave300.git] / support / make_cfg_header.awk
blob642db736a8308c5667f1a724a11ed975616b1880
1 # $Id: make_cfg_header.awk 10546 2011-02-08 14:21:07Z dmytrof $
3 # Script to build C header file based
4 # on .config generated by xconfig/menuconfig tools
6 # Part of Metalink Wlan project build system
9 BEGIN {
10 FS=" |=";
11 print "#ifndef __MTLK_DOT_CONFIG_H__";
12 print "#define __MTLK_DOT_CONFIG_H__";
13 print ""
16 # Empty lines to be preserved
17 /^$/ { print ""; next; }
19 # True boolean variables
20 /CONFIG_[A-Z0-9_]+=y$/ { sub(/^CONFIG_/, "MTCFG_", $1); print "#define " $1 " (1)"; next; }
22 # False boolean variables
23 /^\# CONFIG_[A-Z0-9_]+ is not set$/ { sub(/^CONFIG_/, "MTCFG_", $2); print "#undef " $2; next; }
25 # Text variables
26 /^CONFIG_[A-Z0-9_]+=\".*\"$/ { sub(/^CONFIG_/, "MTCFG_", $1); print "#define " $1 " " $2; next; }
28 # Int variables
29 /^CONFIG_[A-Z0-9_]+=[0-9]*$/ { sub(/^CONFIG_/, "MTCFG_", $1); print "#define " $1 " (" $2 ")"; next; }
31 # General comments to be converted into C-style comments
32 /^#.*/ {
33 if(!match($0, /.*CONFIG_.*/)) {
34 print "/* " $0 " */";
35 next;
39 # Any other line should lead to error because we don't know how to process it
41 print "#error Unknown .config entry \"" $0 "\" (line #" NR ")";
42 print "Failed to process line #" NR " of input data." > "/dev/stderr";
43 print "Contents of unrecognized entry \"" $0 "\"." > "/dev/stderr";
44 print "The script cannot continue." > "/dev/stderr";
45 exit 1;
48 END {
49 print ""
50 print "#endif /* __MTLK_DOT_CONFIG_H__ */"