2006-10-05 15:47:08 +05:30
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (C) 2002 Khalid Aziz <khalid_aziz at hp.com>
|
|
|
|
# Copyright (C) 2002 Randy Dunlap <rddunlap at osdl.org>
|
|
|
|
# Copyright (C) 2002 Al Stone <ahs3 at fc.hp.com>
|
|
|
|
# Copyright (C) 2002 Hewlett-Packard Company
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
#
|
|
|
|
# Busybox version by Matteo Croce <3297627799 at wind.it>
|
|
|
|
#
|
2007-02-04 08:08:21 +05:30
|
|
|
# Rules to generate bbconfigopts.h from .config:
|
2006-10-05 15:47:08 +05:30
|
|
|
# - Retain lines that begin with "CONFIG_"
|
|
|
|
# - Retain lines that begin with "# CONFIG_"
|
|
|
|
# - lines that use double-quotes must \\-escape-quote them
|
|
|
|
|
2010-08-29 18:06:11 +05:30
|
|
|
config=.config
|
2006-10-05 15:47:08 +05:30
|
|
|
|
2010-08-29 18:06:11 +05:30
|
|
|
{
|
2007-02-04 08:08:21 +05:30
|
|
|
echo "\
|
|
|
|
#ifndef _BBCONFIGOPTS_H
|
|
|
|
#define _BBCONFIGOPTS_H
|
|
|
|
/*
|
2006-10-05 15:47:08 +05:30
|
|
|
* busybox configuration settings.
|
|
|
|
*
|
2010-08-16 23:44:46 +05:30
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
2006-10-05 15:47:08 +05:30
|
|
|
*
|
2007-02-03 18:20:41 +05:30
|
|
|
* This file is generated automatically by scripts/mkconfigs.
|
2006-10-05 15:47:08 +05:30
|
|
|
* Do not edit.
|
2007-02-04 08:08:21 +05:30
|
|
|
*/
|
2010-08-29 18:06:11 +05:30
|
|
|
static const char bbconfig_config[] ALIGN1 ="
|
2007-02-04 08:08:21 +05:30
|
|
|
|
2011-02-09 06:03:41 +05:30
|
|
|
grep -e '^# CONFIG_' -e '^CONFIG_' "$config" \
|
2010-08-29 18:06:11 +05:30
|
|
|
| sed -e 's/\"/\\\"/g' -e 's/^/"/' -e 's/$/\\n"/'
|
2006-10-05 15:47:08 +05:30
|
|
|
|
|
|
|
echo ";"
|
2010-08-29 18:06:11 +05:30
|
|
|
echo "#endif"
|
|
|
|
} >"$1"
|
|
|
|
|
|
|
|
{
|
|
|
|
echo "\
|
|
|
|
#ifndef _BBCONFIGOPTS_BZ2_H
|
|
|
|
#define _BBCONFIGOPTS_BZ2_H
|
|
|
|
/*
|
|
|
|
* busybox configuration settings.
|
|
|
|
*
|
|
|
|
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
|
|
|
*
|
|
|
|
* This file is generated automatically by scripts/mkconfigs.
|
|
|
|
* Do not edit.
|
|
|
|
*/
|
|
|
|
static const char bbconfig_config_bz2[] ALIGN1 = {"
|
|
|
|
|
2011-04-16 23:15:33 +05:30
|
|
|
grep -e '^# CONFIG_' -e '^CONFIG_' "$config" \
|
2010-08-29 18:09:45 +05:30
|
|
|
| bzip2 -1 | dd bs=2 skip=1 2>/dev/null \
|
2013-11-26 19:26:29 +05:30
|
|
|
| od -v -b \
|
2010-08-29 18:06:11 +05:30
|
|
|
| sed -e 's/^[^ ]*//' \
|
|
|
|
-e 's/ //g' \
|
|
|
|
-e '/^$/d' \
|
2013-11-26 19:26:29 +05:30
|
|
|
-e 's/\(...\)/0\1,/g'
|
2010-08-29 18:06:11 +05:30
|
|
|
|
|
|
|
echo "};"
|
|
|
|
echo "#endif"
|
|
|
|
} >"$2"
|