diff options
-rw-r--r-- | Makefile | 6 | ||||
-rw-r--r-- | include/applets.h | 3 | ||||
-rw-r--r-- | include/usage.h | 5 | ||||
-rw-r--r-- | miscutils/Config.in | 7 | ||||
-rw-r--r-- | miscutils/Makefile.in | 1 | ||||
-rw-r--r-- | miscutils/bbconfig.c | 8 | ||||
-rwxr-xr-x | scripts/config/mkconfigs | 65 |
7 files changed, 94 insertions, 1 deletions
@@ -200,7 +200,7 @@ scripts/split-include: $(top_srcdir)/scripts/split-include.c | |||
200 | scripts/mkdep -I include -- \ | 200 | scripts/mkdep -I include -- \ |
201 | `find $(top_srcdir) -name \*.h -print | sed -e "s,^./,,"` >> .hdepend; | 201 | `find $(top_srcdir) -name \*.h -print | sed -e "s,^./,,"` >> .hdepend; |
202 | 202 | ||
203 | depend dep: .depend | 203 | depend dep: .depend include/bbconfigopts.h |
204 | 204 | ||
205 | include/config/MARKER: depend scripts/split-include | 205 | include/config/MARKER: depend scripts/split-include |
206 | scripts/split-include include/config.h include/config | 206 | scripts/split-include include/config.h include/config |
@@ -219,6 +219,10 @@ include/bb_config.h: include/config.h | |||
219 | < $< >> $@ | 219 | < $< >> $@ |
220 | echo "#endif" >> $@ | 220 | echo "#endif" >> $@ |
221 | 221 | ||
222 | include/bbconfigopts.h: .config | ||
223 | scripts/config/mkconfigs >include/bbconfigopts.h | ||
224 | |||
225 | |||
222 | finished2: | 226 | finished2: |
223 | $(SECHO) | 227 | $(SECHO) |
224 | $(SECHO) Finished installing... | 228 | $(SECHO) Finished installing... |
diff --git a/include/applets.h b/include/applets.h index 6bce2ee75..8ef5f460f 100644 --- a/include/applets.h +++ b/include/applets.h | |||
@@ -76,6 +76,9 @@ | |||
76 | #ifdef CONFIG_BASENAME | 76 | #ifdef CONFIG_BASENAME |
77 | APPLET(basename, basename_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER) | 77 | APPLET(basename, basename_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER) |
78 | #endif | 78 | #endif |
79 | #ifdef CONFIG_BBCONFIG | ||
80 | APPLET(bbconfig, bbconfig_main, _BB_DIR_BIN, _BB_SUID_NEVER) | ||
81 | #endif | ||
79 | #ifdef CONFIG_BUNZIP2 | 82 | #ifdef CONFIG_BUNZIP2 |
80 | APPLET(bunzip2, bunzip2_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER) | 83 | APPLET(bunzip2, bunzip2_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER) |
81 | #endif | 84 | #endif |
diff --git a/include/usage.h b/include/usage.h index 21980eeba..291ccb91a 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -231,6 +231,11 @@ | |||
231 | "\t-2\tSuppress lines unique to FILE2\n" \ | 231 | "\t-2\tSuppress lines unique to FILE2\n" \ |
232 | "\t-3\tSuppress lines common to both files" | 232 | "\t-3\tSuppress lines common to both files" |
233 | 233 | ||
234 | #define bbconfig_trivial_usage \ | ||
235 | "" | ||
236 | #define bbconfig_full_usage \ | ||
237 | "Print the config file which built busybox\n" | ||
238 | |||
234 | #define cp_trivial_usage \ | 239 | #define cp_trivial_usage \ |
235 | "[OPTION]... SOURCE DEST" | 240 | "[OPTION]... SOURCE DEST" |
236 | #define cp_full_usage \ | 241 | #define cp_full_usage \ |
diff --git a/miscutils/Config.in b/miscutils/Config.in index 57afd32ed..69a330058 100644 --- a/miscutils/Config.in +++ b/miscutils/Config.in | |||
@@ -34,6 +34,13 @@ config CONFIG_FEATURE_CROND_CALL_SENDMAIL | |||
34 | help | 34 | help |
35 | Support calling /usr/sbin/sendmail for send cmd outputs. | 35 | Support calling /usr/sbin/sendmail for send cmd outputs. |
36 | 36 | ||
37 | config CONFIG_BBCONFIG | ||
38 | bool "bbconfig" | ||
39 | default n | ||
40 | help | ||
41 | The bbconfig applet will print the config file with which | ||
42 | busybox was built. | ||
43 | |||
37 | config CONFIG_CRONTAB | 44 | config CONFIG_CRONTAB |
38 | bool "crontab" | 45 | bool "crontab" |
39 | default n | 46 | default n |
diff --git a/miscutils/Makefile.in b/miscutils/Makefile.in index 5cff2fe69..d4c5ff76b 100644 --- a/miscutils/Makefile.in +++ b/miscutils/Makefile.in | |||
@@ -27,6 +27,7 @@ MISCUTILS-y:= | |||
27 | MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o | 27 | MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o |
28 | MISCUTILS-$(CONFIG_CROND) += crond.o | 28 | MISCUTILS-$(CONFIG_CROND) += crond.o |
29 | MISCUTILS-$(CONFIG_CRONTAB) += crontab.o | 29 | MISCUTILS-$(CONFIG_CRONTAB) += crontab.o |
30 | MISCUTILS-$(CONFIG_BBCONFIG) += bbconfig.o | ||
30 | MISCUTILS-$(CONFIG_DC) += dc.o | 31 | MISCUTILS-$(CONFIG_DC) += dc.o |
31 | MISCUTILS-$(CONFIG_DEVFSD) += devfsd.o | 32 | MISCUTILS-$(CONFIG_DEVFSD) += devfsd.o |
32 | MISCUTILS-$(CONFIG_EJECT) += eject.o | 33 | MISCUTILS-$(CONFIG_EJECT) += eject.o |
diff --git a/miscutils/bbconfig.c b/miscutils/bbconfig.c new file mode 100644 index 000000000..f2c692c9b --- /dev/null +++ b/miscutils/bbconfig.c | |||
@@ -0,0 +1,8 @@ | |||
1 | #include "busybox.h" | ||
2 | #include "bbconfigopts.h" | ||
3 | |||
4 | int bbconfig_main(int argc, char **argv) | ||
5 | { | ||
6 | printf(bbconfig_config); | ||
7 | return 0; | ||
8 | } | ||
diff --git a/scripts/config/mkconfigs b/scripts/config/mkconfigs new file mode 100755 index 000000000..f09c04ccd --- /dev/null +++ b/scripts/config/mkconfigs | |||
@@ -0,0 +1,65 @@ | |||
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 | # | ||
24 | # Rules to generate bbconfig.h from .config: | ||
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 | |||
29 | if [ $# -lt 1 ] | ||
30 | then | ||
31 | config=.config | ||
32 | else config=$1 | ||
33 | fi | ||
34 | |||
35 | echo "#ifndef _BBCONFIG_H" | ||
36 | echo "#define _BBCONFIG_H" | ||
37 | echo \ | ||
38 | "/* | ||
39 | * | ||
40 | * This program is free software; you can redistribute it and/or modify | ||
41 | * it under the terms of the GNU General Public License as published by | ||
42 | * the Free Software Foundation; either version 2 of the License, or (at | ||
43 | * your option) any later version. | ||
44 | * | ||
45 | * This program is distributed in the hope that it will be useful, but | ||
46 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
47 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | ||
48 | * NON INFRINGEMENT. See the GNU General Public License for more | ||
49 | * details. | ||
50 | * | ||
51 | * You should have received a copy of the GNU General Public License | ||
52 | * along with this program; if not, write to the Free Software | ||
53 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
54 | * | ||
55 | * | ||
56 | * | ||
57 | * This file is generated automatically by scripts/config/mkconfigs. Do not edit. | ||
58 | * | ||
59 | */" | ||
60 | |||
61 | echo "static char const bbconfig_config[] = " | ||
62 | echo "\"CONFIG_BEGIN=n\\n\\" | ||
63 | echo "`cat $config | sed 's/\"/\\\\\"/g' | grep "^#\? \?CONFIG_" | awk '{ print $0 "\\\\n\\\\" }' `" | ||
64 | echo "CONFIG_END=n\\n\";" | ||
65 | echo "#endif /* _BBCONFIG_H */" | ||