diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2008-12-25 20:31:40 +0000 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2008-12-25 20:31:40 +0000 |
commit | dcb1782f4bb02f2e1173c68b46ac34c7c2ce80a6 (patch) | |
tree | d6b0821b4f0e5ff40e3ab7938fa4434bb7a497c6 /scripts | |
parent | 762fc23572d31e4a49e3b01bedbe7d116887bc80 (diff) | |
download | ptxdist-dcb1782f4bb02f2e1173c68b46ac34c7c2ce80a6.tar.gz ptxdist-dcb1782f4bb02f2e1173c68b46ac34c7c2ce80a6.tar.xz |
git-svn-id: https://svn.pengutronix.de/svn/ptxdist/trunks/ptxdist-trunk@9303 33e552b5-05e3-0310-8538-816dae2090ed
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/lib/ptxd_lib_import.awk | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_lib_import.awk b/scripts/lib/ptxd_lib_import.awk new file mode 100755 index 000000000..02735f4e2 --- /dev/null +++ b/scripts/lib/ptxd_lib_import.awk @@ -0,0 +1,38 @@ +#!/usr/bin/gawk -f + +BEGIN { + prefix = "BB_CONFIG_"; +} + +/^[[:space:]]*(mainmenu)[[:space:]]+/ { + gsub(/^.*$/, "# &"); +} + +/^[[:space:]]*(config|select|depends|default)[[:space:]]+/ { + $0 = add_prefix($0); +} + +/^[[:space:]]*source[[:space:]]+/ { + print "SOURCE:", $2 > "/dev/stderr"; + FILENAME = "platform-phyCORE-i.MX31/build-target/busybox-1.10.4/miscutils/Config.in"; +} + +{ + print $0; +} + +function add_prefix(IN, in_match) { +# depends on FOO && BAR +# +--------+ +-------+ +# | | +# in_match[1] | +# | +# in_match[4] + + match(IN, /^([[:space:]]*(config|select|default|depends([[:space:]]+on)?)[[:space:]]+)(.*)$/, in_match); + + return in_match[1] gensub(/(!)?([A-Z0-9][^[:space:]]*)/, "\\1" prefix "\\2", "g", in_match[4]); +} + +END { +} |