[BusyBox-cvs] svn commit: trunk/busybox: include miscutils scripts/config
pgf at busybox.net
pgf at busybox.net
Mon Aug 1 16:04:42 UTC 2005
Author: pgf
Date: 2005-08-01 10:04:40 -0600 (Mon, 01 Aug 2005)
New Revision: 11006
Log:
new config display applet, from bug 46. i've changed the name
of the applet from "config" to "bbconfig", and renamed the
source filenames and symbols to match appropriately.
Added:
trunk/busybox/miscutils/bbconfig.c
trunk/busybox/scripts/config/mkconfigs
Modified:
trunk/busybox/Makefile
trunk/busybox/include/applets.h
trunk/busybox/include/usage.h
trunk/busybox/miscutils/Config.in
trunk/busybox/miscutils/Makefile.in
Changeset:
Modified: trunk/busybox/Makefile
===================================================================
--- trunk/busybox/Makefile 2005-08-01 14:31:13 UTC (rev 11005)
+++ trunk/busybox/Makefile 2005-08-01 16:04:40 UTC (rev 11006)
@@ -200,7 +200,7 @@
scripts/mkdep -I include -- \
`find $(top_srcdir) -name \*.h -print | sed -e "s,^./,,"` >> .hdepend;
-depend dep: .depend
+depend dep: .depend include/bbconfigopts.h
include/config/MARKER: depend scripts/split-include
scripts/split-include include/config.h include/config
@@ -219,6 +219,10 @@
< $< >> $@
echo "#endif" >> $@
+include/bbconfigopts.h: .config
+ scripts/config/mkconfigs >include/bbconfigopts.h
+
+
finished2:
$(SECHO)
$(SECHO) Finished installing...
Modified: trunk/busybox/include/applets.h
===================================================================
--- trunk/busybox/include/applets.h 2005-08-01 14:31:13 UTC (rev 11005)
+++ trunk/busybox/include/applets.h 2005-08-01 16:04:40 UTC (rev 11006)
@@ -76,6 +76,9 @@
#ifdef CONFIG_BASENAME
APPLET(basename, basename_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
+#ifdef CONFIG_BBCONFIG
+ APPLET(bbconfig, bbconfig_main, _BB_DIR_BIN, _BB_SUID_NEVER)
+#endif
#ifdef CONFIG_BUNZIP2
APPLET(bunzip2, bunzip2_main, _BB_DIR_USR_BIN, _BB_SUID_NEVER)
#endif
Modified: trunk/busybox/include/usage.h
===================================================================
--- trunk/busybox/include/usage.h 2005-08-01 14:31:13 UTC (rev 11005)
+++ trunk/busybox/include/usage.h 2005-08-01 16:04:40 UTC (rev 11006)
@@ -231,6 +231,11 @@
"\t-2\tSuppress lines unique to FILE2\n" \
"\t-3\tSuppress lines common to both files"
+#define bbconfig_trivial_usage \
+ ""
+#define bbconfig_full_usage \
+ "Print the config file which built busybox\n"
+
#define cp_trivial_usage \
"[OPTION]... SOURCE DEST"
#define cp_full_usage \
Modified: trunk/busybox/miscutils/Config.in
===================================================================
--- trunk/busybox/miscutils/Config.in 2005-08-01 14:31:13 UTC (rev 11005)
+++ trunk/busybox/miscutils/Config.in 2005-08-01 16:04:40 UTC (rev 11006)
@@ -34,6 +34,13 @@
help
Support calling /usr/sbin/sendmail for send cmd outputs.
+config CONFIG_BBCONFIG
+ bool "bbconfig"
+ default n
+ help
+ The bbconfig applet will print the config file with which
+ busybox was built.
+
config CONFIG_CRONTAB
bool "crontab"
default n
Modified: trunk/busybox/miscutils/Makefile.in
===================================================================
--- trunk/busybox/miscutils/Makefile.in 2005-08-01 14:31:13 UTC (rev 11005)
+++ trunk/busybox/miscutils/Makefile.in 2005-08-01 16:04:40 UTC (rev 11006)
@@ -27,6 +27,7 @@
MISCUTILS-$(CONFIG_ADJTIMEX) += adjtimex.o
MISCUTILS-$(CONFIG_CROND) += crond.o
MISCUTILS-$(CONFIG_CRONTAB) += crontab.o
+MISCUTILS-$(CONFIG_BBCONFIG) += bbconfig.o
MISCUTILS-$(CONFIG_DC) += dc.o
MISCUTILS-$(CONFIG_DEVFSD) += devfsd.o
MISCUTILS-$(CONFIG_EJECT) += eject.o
Added: trunk/busybox/miscutils/bbconfig.c
===================================================================
--- trunk/busybox/miscutils/bbconfig.c 2005-08-01 14:31:13 UTC (rev 11005)
+++ trunk/busybox/miscutils/bbconfig.c 2005-08-01 16:04:40 UTC (rev 11006)
@@ -0,0 +1,8 @@
+#include "busybox.h"
+#include "bbconfigopts.h"
+
+int bbconfig_main(int argc, char **argv)
+{
+ printf(bbconfig_config);
+ return 0;
+}
Added: trunk/busybox/scripts/config/mkconfigs
===================================================================
--- trunk/busybox/scripts/config/mkconfigs 2005-08-01 14:31:13 UTC (rev 11005)
+++ trunk/busybox/scripts/config/mkconfigs 2005-08-01 16:04:40 UTC (rev 11006)
@@ -0,0 +1,65 @@
+#!/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>
+#
+# Rules to generate bbconfig.h from .config:
+# - Retain lines that begin with "CONFIG_"
+# - Retain lines that begin with "# CONFIG_"
+# - lines that use double-quotes must \\-escape-quote them
+
+if [ $# -lt 1 ]
+then
+ config=.config
+else config=$1
+fi
+
+echo "#ifndef _BBCONFIG_H"
+echo "#define _BBCONFIG_H"
+echo \
+"/*
+ *
+ * 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, GOOD TITLE or
+ * NON INFRINGEMENT. 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.
+ *
+ *
+ *
+ * This file is generated automatically by scripts/config/mkconfigs. Do not edit.
+ *
+ */"
+
+echo "static char const bbconfig_config[] = "
+echo "\"CONFIG_BEGIN=n\\n\\"
+echo "`cat $config | sed 's/\"/\\\\\"/g' | grep "^#\? \?CONFIG_" | awk '{ print $0 "\\\\n\\\\" }' `"
+echo "CONFIG_END=n\\n\";"
+echo "#endif /* _BBCONFIG_H */"
Property changes on: trunk/busybox/scripts/config/mkconfigs
___________________________________________________________________
Name: svn:executable
+ *
More information about the busybox-cvs
mailing list