partially migrate coreutils to Config.src and Kbuild.src

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko 2010-06-04 19:59:49 +02:00
parent 6db1373295
commit e4070cb0d7
7 changed files with 114 additions and 104 deletions

View File

@ -5,13 +5,7 @@
menu "Coreutils" menu "Coreutils"
config BASENAME INSERT
bool "basename"
default n
help
basename is used to strip the directory and suffix from filenames,
leaving just the filename itself. Enable this option if you wish
to enable the 'basename' utility.
config CAL config CAL
bool "cal" bool "cal"
@ -19,13 +13,6 @@ config CAL
help help
cal is used to display a monthly calender. cal is used to display a monthly calender.
config CAT
bool "cat"
default n
help
cat is used to concatenate files and print them to the standard
output. Enable this option if you wish to enable the 'cat' utility.
config CATV config CATV
bool "catv" bool "catv"
default n default n
@ -100,44 +87,6 @@ config CUT
cut is used to print selected parts of lines from cut is used to print selected parts of lines from
each file to stdout. each file to stdout.
config DATE
bool "date"
default n
help
date is used to set the system date or display the
current time in the given format.
config FEATURE_DATE_ISOFMT
bool "Enable ISO date format output (-I)"
default y
depends on DATE
help
Enable option (-I) to output an ISO-8601 compliant
date/time string.
config FEATURE_DATE_NANO
bool "Support %[num]N nanosecond format specifier"
default y
depends on DATE
help
Support %[num]N format specifier. Adds ~250 bytes of code.
config FEATURE_DATE_COMPAT
bool "Support weird 'date MMDDhhmm[[YY]YY][.ss]' format"
default y
depends on DATE
help
System time can be set by 'date -s DATE' and simply 'date DATE',
but formats of DATE string are different. 'date DATE' accepts
a rather weird MMDDhhmm[[YY]YY][.ss] format with completely
unnatural placement of year between minutes and seconds.
date -s (and other commands like touch -d) use more sensible
formats (for one, ISO format YYYY-MM-DD hh:mm:ss.ssssss).
With this option off, 'date DATE' is 'date -s DATE' support
the same format. With it on, 'date DATE' additionally supports
MMDDhhmm[[YY]YY][.ss] format.
config DD config DD
bool "dd" bool "dd"
default n default n
@ -711,21 +660,6 @@ config FEATURE_TEE_USE_BLOCK_IO
help help
Enable this option for a faster tee, at expense of size. Enable this option for a faster tee, at expense of size.
config TEST
bool "test"
default n
help
test is used to check file types and compare values,
returning an appropriate exit code. The bash shell
has test built in, ash can build it in optionally.
config FEATURE_TEST_64
bool "Extend test to 64 bit"
default n
depends on TEST || ASH_BUILTIN_TEST || HUSH
help
Enable 64-bit support in test.
config TOUCH config TOUCH
bool "touch" bool "touch"
default n default n
@ -733,32 +667,6 @@ config TOUCH
touch is used to create or change the access and/or touch is used to create or change the access and/or
modification timestamp of specified files. modification timestamp of specified files.
config TR
bool "tr"
default n
help
tr is used to squeeze, and/or delete characters from standard
input, writing to standard output.
config FEATURE_TR_CLASSES
bool "Enable character classes (such as [:upper:])"
default n
depends on TR
help
Enable character classes, enabling commands such as:
tr [:upper:] [:lower:] to convert input into lowercase.
config FEATURE_TR_EQUIV
bool "Enable equivalence classes"
default n
depends on TR
help
Enable equivalence classes, which essentially add the enclosed
character to the current set. For instance, tr [=a=] xyz would
replace all instances of 'a' with 'xyz'. This option is mainly
useful for cases when no other way of expressing a character
is possible.
config TRUE config TRUE
bool "true" bool "true"
default n default n

View File

@ -7,12 +7,8 @@
libs-y += libcoreutils/ libs-y += libcoreutils/
lib-y:= lib-y:=
lib-$(CONFIG_BASENAME) += basename.o INSERT
lib-$(CONFIG_CAL) += cal.o lib-$(CONFIG_CAL) += cal.o
lib-$(CONFIG_CAT) += cat.o
lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty
lib-$(CONFIG_LESS) += cat.o # less too
lib-$(CONFIG_CRONTAB) += cat.o # crontab -l
lib-$(CONFIG_CATV) += catv.o lib-$(CONFIG_CATV) += catv.o
lib-$(CONFIG_CHGRP) += chgrp.o chown.o lib-$(CONFIG_CHGRP) += chgrp.o chown.o
lib-$(CONFIG_CHMOD) += chmod.o lib-$(CONFIG_CHMOD) += chmod.o
@ -24,7 +20,6 @@ lib-$(CONFIG_CKSUM) += cksum.o
lib-$(CONFIG_COMM) += comm.o lib-$(CONFIG_COMM) += comm.o
lib-$(CONFIG_CP) += cp.o lib-$(CONFIG_CP) += cp.o
lib-$(CONFIG_CUT) += cut.o lib-$(CONFIG_CUT) += cut.o
lib-$(CONFIG_DATE) += date.o
lib-$(CONFIG_DD) += dd.o lib-$(CONFIG_DD) += dd.o
lib-$(CONFIG_DF) += df.o lib-$(CONFIG_DF) += df.o
lib-$(CONFIG_DIRNAME) += dirname.o lib-$(CONFIG_DIRNAME) += dirname.o
@ -78,12 +73,7 @@ lib-$(CONFIG_SYNC) += sync.o
lib-$(CONFIG_TAC) += tac.o lib-$(CONFIG_TAC) += tac.o
lib-$(CONFIG_TAIL) += tail.o lib-$(CONFIG_TAIL) += tail.o
lib-$(CONFIG_TEE) += tee.o lib-$(CONFIG_TEE) += tee.o
lib-$(CONFIG_TEST) += test.o test_ptr_hack.o
lib-$(CONFIG_ASH) += test.o test_ptr_hack.o # used by ash
lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o # used by hush
lib-$(CONFIG_MSH) += test.o test_ptr_hack.o # used by msh
lib-$(CONFIG_TOUCH) += touch.o lib-$(CONFIG_TOUCH) += touch.o
lib-$(CONFIG_TR) += tr.o
lib-$(CONFIG_TRUE) += true.o lib-$(CONFIG_TRUE) += true.o
lib-$(CONFIG_TTY) += tty.o lib-$(CONFIG_TTY) += tty.o
lib-$(CONFIG_UNAME) += uname.o lib-$(CONFIG_UNAME) += uname.o

View File

@ -20,6 +20,16 @@
* 3) Save some space by using strcmp(). Calling strncmp() here was silly. * 3) Save some space by using strcmp(). Calling strncmp() here was silly.
*/ */
//kbuild:lib-$(CONFIG_BASENAME) += basename.o
//config:config BASENAME
//config: bool "basename"
//config: default n
//config: help
//config: basename is used to strip the directory and suffix from filenames,
//config: leaving just the filename itself. Enable this option if you wish
//config: to enable the 'basename' utility.
#include "libbb.h" #include "libbb.h"
/* This is a NOFORK applet. Be very careful! */ /* This is a NOFORK applet. Be very careful! */

View File

@ -10,6 +10,18 @@
/* BB_AUDIT SUSv3 compliant */ /* BB_AUDIT SUSv3 compliant */
/* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */ /* http://www.opengroup.org/onlinepubs/007904975/utilities/cat.html */
//kbuild:lib-$(CONFIG_CAT) += cat.o
//kbuild:lib-$(CONFIG_MORE) += cat.o # more uses it if stdout isn't a tty
//kbuild:lib-$(CONFIG_LESS) += cat.o # less too
//kbuild:lib-$(CONFIG_CRONTAB) += cat.o # crontab -l
//config:config CAT
//config: bool "cat"
//config: default n
//config: help
//config: cat is used to concatenate files and print them to the standard
//config: output. Enable this option if you wish to enable the 'cat' utility.
#include "libbb.h" #include "libbb.h"
/* This is a NOFORK applet. Be very careful! */ /* This is a NOFORK applet. Be very careful! */

View File

@ -51,6 +51,47 @@
* and does not support -Ins * and does not support -Ins
* -D FMT is a bbox extension for _input_ conversion of -d DATE * -D FMT is a bbox extension for _input_ conversion of -d DATE
*/ */
//kbuild:lib-$(CONFIG_DATE) += date.o
//config:config DATE
//config: bool "date"
//config: default n
//config: help
//config: date is used to set the system date or display the
//config: current time in the given format.
//config:
//config:config FEATURE_DATE_ISOFMT
//config: bool "Enable ISO date format output (-I)"
//config: default y
//config: depends on DATE
//config: help
//config: Enable option (-I) to output an ISO-8601 compliant
//config: date/time string.
//config:
//config:config FEATURE_DATE_NANO
//config: bool "Support %[num]N nanosecond format specifier"
//config: default y
//config: depends on DATE
//config: help
//config: Support %[num]N format specifier. Adds ~250 bytes of code.
//config:
//config:config FEATURE_DATE_COMPAT
//config: bool "Support weird 'date MMDDhhmm[[YY]YY][.ss]' format"
//config: default y
//config: depends on DATE
//config: help
//config: System time can be set by 'date -s DATE' and simply 'date DATE',
//config: but formats of DATE string are different. 'date DATE' accepts
//config: a rather weird MMDDhhmm[[YY]YY][.ss] format with completely
//config: unnatural placement of year between minutes and seconds.
//config: date -s (and other commands like touch -d) use more sensible
//config: formats (for one, ISO format YYYY-MM-DD hh:mm:ss.ssssss).
//config:
//config: With this option off, 'date DATE' is 'date -s DATE' support
//config: the same format. With it on, 'date DATE' additionally supports
//config: MMDDhhmm[[YY]YY][.ss] format.
#include "libbb.h" #include "libbb.h"
enum { enum {

View File

@ -19,6 +19,26 @@
* Original copyright notice states: * Original copyright notice states:
* "This program is in the Public Domain." * "This program is in the Public Domain."
*/ */
//kbuild:lib-$(CONFIG_TEST) += test.o test_ptr_hack.o
//kbuild:lib-$(CONFIG_ASH) += test.o test_ptr_hack.o
//kbuild:lib-$(CONFIG_HUSH) += test.o test_ptr_hack.o
//config:config TEST
//config: bool "test"
//config: default n
//config: help
//config: test is used to check file types and compare values,
//config: returning an appropriate exit code. The bash shell
//config: has test built in, ash can build it in optionally.
//config:
//config:config FEATURE_TEST_64
//config: bool "Extend test to 64 bit"
//config: default n
//config: depends on TEST || ASH_BUILTIN_TEST || HUSH
//config: help
//config: Enable 64-bit support in test.
#include "libbb.h" #include "libbb.h"
#include <setjmp.h> #include <setjmp.h>

View File

@ -18,6 +18,35 @@
/* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html /* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html
* TODO: graph, print * TODO: graph, print
*/ */
//kbuild:lib-$(CONFIG_TR) += tr.o
//config:config TR
//config: bool "tr"
//config: default n
//config: help
//config: tr is used to squeeze, and/or delete characters from standard
//config: input, writing to standard output.
config FEATURE_TR_CLASSES
bool "Enable character classes (such as [:upper:])"
default n
depends on TR
help
Enable character classes, enabling commands such as:
tr [:upper:] [:lower:] to convert input into lowercase.
config FEATURE_TR_EQUIV
bool "Enable equivalence classes"
default n
depends on TR
help
Enable equivalence classes, which essentially add the enclosed
character to the current set. For instance, tr [=a=] xyz would
replace all instances of 'a' with 'xyz'. This option is mainly
useful for cases when no other way of expressing a character
is possible.
#include "libbb.h" #include "libbb.h"
enum { enum {