aboutsummaryrefslogtreecommitdiff
path: root/scripts/mkconfigs
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-08-29 14:36:11 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-08-29 14:36:11 +0200
commit9ce07e778f05719115f354d4907f51295fb3fd1a (patch)
tree1f204121b58c0a86904e376d2fc6b08f9c3ce881 /scripts/mkconfigs
parent7715b48c36a453b41f4555ee57c2f936e25f06f1 (diff)
downloadbusybox-w32-9ce07e778f05719115f354d4907f51295fb3fd1a.tar.gz
busybox-w32-9ce07e778f05719115f354d4907f51295fb3fd1a.tar.bz2
busybox-w32-9ce07e778f05719115f354d4907f51295fb3fd1a.zip
bbconfig: add COMPRESS_BBCONFIG option
function old new delta bbconfig_config_bz2 - 4905 +4905 bbconfig_main 13 70 +57 bbconfig_config 21811 - -21811 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/0 up/down: 4962/-21811) Total: -16849 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'scripts/mkconfigs')
-rwxr-xr-xscripts/mkconfigs40
1 files changed, 32 insertions, 8 deletions
diff --git a/scripts/mkconfigs b/scripts/mkconfigs
index 65dd44179..38d7ac054 100755
--- a/scripts/mkconfigs
+++ b/scripts/mkconfigs
@@ -26,12 +26,9 @@
26# - Retain lines that begin with "# CONFIG_" 26# - Retain lines that begin with "# CONFIG_"
27# - lines that use double-quotes must \\-escape-quote them 27# - lines that use double-quotes must \\-escape-quote them
28 28
29config="$1" 29config=.config
30if [ $# -lt 1 ]
31then
32 config=.config
33fi
34 30
31{
35echo "\ 32echo "\
36#ifndef _BBCONFIGOPTS_H 33#ifndef _BBCONFIGOPTS_H
37#define _BBCONFIGOPTS_H 34#define _BBCONFIGOPTS_H
@@ -43,9 +40,36 @@ echo "\
43 * This file is generated automatically by scripts/mkconfigs. 40 * This file is generated automatically by scripts/mkconfigs.
44 * Do not edit. 41 * Do not edit.
45 */ 42 */
46static const char bbconfig_config[] =" 43static const char bbconfig_config[] ALIGN1 ="
47 44
48sed 's/\"/\\\"/g' $config | grep "^#\? \?CONFIG_" | awk '{print "\"" $0 "\\n\"";}' 45grep '^#\? \?CONFIG_' "$config" \
46| sed -e 's/\"/\\\"/g' -e 's/^/"/' -e 's/$/\\n"/'
49 47
50echo ";" 48echo ";"
51echo "#endif /* _BBCONFIGOPTS_H */" 49echo "#endif"
50} >"$1"
51
52{
53echo "\
54#ifndef _BBCONFIGOPTS_BZ2_H
55#define _BBCONFIGOPTS_BZ2_H
56/*
57 * busybox configuration settings.
58 *
59 * Licensed under GPLv2 or later, see file LICENSE in this source tree.
60 *
61 * This file is generated automatically by scripts/mkconfigs.
62 * Do not edit.
63 */
64static const char bbconfig_config_bz2[] ALIGN1 = {"
65
66grep '^#\? \?CONFIG_' "$config" \
67| bzip2 -1 | tee z.bz2 | dd bs=2 skip=1 2>/dev/null | od -v -t x1 \
68| sed -e 's/^[^ ]*//' \
69 -e 's/ //g' \
70 -e '/^$/d' \
71 -e 's/\(..\)/0x\1,/g'
72
73echo "};"
74echo "#endif"
75} >"$2"