Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (C) 2002 Khalid Aziz <khalid_aziz at hp.com> |
| 4 | # Copyright (C) 2002 Randy Dunlap <rddunlap at osdl.org> |
| 5 | # Copyright (C) 2002 Al Stone <ahs3 at fc.hp.com> |
| 6 | # Copyright (C) 2002 Hewlett-Packard Company |
| 7 | # |
| 8 | # This program is free software; you can redistribute it and/or modify |
| 9 | # it under the terms of the GNU General Public License as published by |
| 10 | # the Free Software Foundation; either version 2 of the License, or |
| 11 | # (at your option) any later version. |
| 12 | # |
| 13 | # This program is distributed in the hope that it will be useful, |
| 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | # GNU General Public License for more details. |
| 17 | # |
| 18 | # You should have received a copy of the GNU General Public License |
| 19 | # along with this program; if not, write to the Free Software |
| 20 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 | # |
| 22 | # Busybox version by Matteo Croce <3297627799 at wind.it> |
| 23 | # |
Denis Vlasenko | 45854b5 | 2007-02-04 02:38:21 +0000 | [diff] [blame] | 24 | # Rules to generate bbconfigopts.h from .config: |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 25 | # - Retain lines that begin with "CONFIG_" |
| 26 | # - Retain lines that begin with "# CONFIG_" |
| 27 | # - lines that use double-quotes must \\-escape-quote them |
| 28 | |
Denys Vlasenko | 9ce07e7 | 2010-08-29 14:36:11 +0200 | [diff] [blame] | 29 | config=.config |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 30 | |
Denys Vlasenko | 9ce07e7 | 2010-08-29 14:36:11 +0200 | [diff] [blame] | 31 | { |
Denis Vlasenko | 45854b5 | 2007-02-04 02:38:21 +0000 | [diff] [blame] | 32 | echo "\ |
| 33 | #ifndef _BBCONFIGOPTS_H |
| 34 | #define _BBCONFIGOPTS_H |
| 35 | /* |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 36 | * busybox configuration settings. |
| 37 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 38 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 39 | * |
Denis Vlasenko | a5c5ae0 | 2007-02-03 12:50:41 +0000 | [diff] [blame] | 40 | * This file is generated automatically by scripts/mkconfigs. |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 41 | * Do not edit. |
Denis Vlasenko | 45854b5 | 2007-02-04 02:38:21 +0000 | [diff] [blame] | 42 | */ |
Denys Vlasenko | 9ce07e7 | 2010-08-29 14:36:11 +0200 | [diff] [blame] | 43 | static const char bbconfig_config[] ALIGN1 =" |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 44 | |
Denys Vlasenko | e7212a4 | 2011-02-09 01:33:41 +0100 | [diff] [blame^] | 45 | grep -e '^# CONFIG_' -e '^CONFIG_' "$config" \ |
Denys Vlasenko | 9ce07e7 | 2010-08-29 14:36:11 +0200 | [diff] [blame] | 46 | | sed -e 's/\"/\\\"/g' -e 's/^/"/' -e 's/$/\\n"/' |
Denis Vlasenko | 45854b5 | 2007-02-04 02:38:21 +0000 | [diff] [blame] | 47 | |
Denis Vlasenko | 7d219aa | 2006-10-05 10:17:08 +0000 | [diff] [blame] | 48 | echo ";" |
Denys Vlasenko | 9ce07e7 | 2010-08-29 14:36:11 +0200 | [diff] [blame] | 49 | echo "#endif" |
| 50 | } >"$1" |
| 51 | |
| 52 | { |
| 53 | echo "\ |
| 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 | */ |
| 64 | static const char bbconfig_config_bz2[] ALIGN1 = {" |
| 65 | |
| 66 | grep '^#\? \?CONFIG_' "$config" \ |
Denys Vlasenko | d493e93 | 2010-08-29 14:39:45 +0200 | [diff] [blame] | 67 | | bzip2 -1 | dd bs=2 skip=1 2>/dev/null \ |
| 68 | | od -v -t x1 \ |
Denys Vlasenko | 9ce07e7 | 2010-08-29 14:36:11 +0200 | [diff] [blame] | 69 | | sed -e 's/^[^ ]*//' \ |
| 70 | -e 's/ //g' \ |
| 71 | -e '/^$/d' \ |
| 72 | -e 's/\(..\)/0x\1,/g' |
| 73 | |
| 74 | echo "};" |
| 75 | echo "#endif" |
| 76 | } >"$2" |