ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / scripts / mkconfigs
1 #!/bin/sh
2 #
3 # Copyright (C) 2002 Khalid Aziz <khalid_aziz@hp.com>
4 # Copyright (C) 2002 Randy Dunlap <rddunlap@osdl.org>
5 # Copyright (C) 2002 Al Stone <ahs3@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
23 # Rules to generate ikconfig.h from linux/.config:
24 #       - Retain lines that begin with "CONFIG_"
25 #       - Retain lines that begin with "# CONFIG_"
26 #       - lines that use double-quotes must \\-escape-quote them
27
28 if [ $# -lt 2 ]
29 then
30         echo "Usage: `basename $0` <configuration_file> <Makefile>"
31         exit 1
32 fi
33
34 config=$1
35 makefile=$2
36
37 echo "#ifndef _IKCONFIG_H"
38 echo "#define _IKCONFIG_H"
39 echo \
40 "/*
41  * 
42  * This program is free software; you can redistribute it and/or modify
43  * it under the terms of the GNU General Public License as published by
44  * the Free Software Foundation; either version 2 of the License, or (at
45  * your option) any later version.
46  *
47  * This program is distributed in the hope that it will be useful, but
48  * WITHOUT ANY WARRANTY; without even the implied warranty of
49  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
50  * NON INFRINGEMENT.  See the GNU General Public License for more
51  * details.
52  *
53  * You should have received a copy of the GNU General Public License
54  * along with this program; if not, write to the Free Software
55  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
56  *
57  *
58  * 
59  * This file is generated automatically by scripts/mkconfigs. Do not edit.
60  *
61  */"
62
63 echo "static char const ikconfig_config[] __attribute__((unused)) = "
64 echo "\"CONFIG_BEGIN=n\\n\\"
65 echo "`cat $config | sed 's/\"/\\\\\"/g' | grep "^#\? \?CONFIG_" | awk '{ print $0 "\\\\n\\\\" }' `"
66 echo "CONFIG_END=n\\n\";"
67 echo "#endif /* _IKCONFIG_H */"