OSDN Git Service

partially migrate coreutils to Config.src and Kbuild.src
authorDenys Vlasenko <vda.linux@googlemail.com>
Fri, 4 Jun 2010 17:59:49 +0000 (19:59 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Fri, 4 Jun 2010 17:59:49 +0000 (19:59 +0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
coreutils/Config.src [moved from coreutils/Config.in with 86% similarity]
coreutils/Kbuild.src [moved from coreutils/Kbuild with 84% similarity]
coreutils/basename.c
coreutils/cat.c
coreutils/date.c
coreutils/test.c
coreutils/tr.c

similarity index 86%
rename from coreutils/Config.in
rename to coreutils/Config.src
index 37e885c..99384e3 100644 (file)
@@ -5,13 +5,7 @@
 
 menu "Coreutils"
 
-config BASENAME
-       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.
+INSERT
 
 config CAL
        bool "cal"
@@ -19,13 +13,6 @@ config CAL
        help
          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
        bool "catv"
        default n
@@ -100,44 +87,6 @@ config CUT
          cut is used to print selected parts of lines from
          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
        bool "dd"
        default n
@@ -711,21 +660,6 @@ config FEATURE_TEE_USE_BLOCK_IO
        help
          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
        bool "touch"
        default n
@@ -733,32 +667,6 @@ config TOUCH
          touch is used to create or change the access and/or
          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
        bool "true"
        default n
similarity index 84%
rename from coreutils/Kbuild
rename to coreutils/Kbuild.src
index ee22a3f..57ea7d6 100644 (file)
@@ -7,12 +7,8 @@
 libs-y                 += libcoreutils/
 
 lib-y:=
-lib-$(CONFIG_BASENAME)  += basename.o
+INSERT
 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_CHGRP)     += chgrp.o chown.o
 lib-$(CONFIG_CHMOD)     += chmod.o
@@ -24,7 +20,6 @@ lib-$(CONFIG_CKSUM)     += cksum.o
 lib-$(CONFIG_COMM)      += comm.o
 lib-$(CONFIG_CP)        += cp.o
 lib-$(CONFIG_CUT)       += cut.o
-lib-$(CONFIG_DATE)      += date.o
 lib-$(CONFIG_DD)        += dd.o
 lib-$(CONFIG_DF)        += df.o
 lib-$(CONFIG_DIRNAME)   += dirname.o
@@ -78,12 +73,7 @@ lib-$(CONFIG_SYNC)      += sync.o
 lib-$(CONFIG_TAC)       += tac.o
 lib-$(CONFIG_TAIL)      += tail.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_TR)        += tr.o
 lib-$(CONFIG_TRUE)      += true.o
 lib-$(CONFIG_TTY)       += tty.o
 lib-$(CONFIG_UNAME)     += uname.o
index 8a5597e..f35bdf0 100644 (file)
  * 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"
 
 /* This is a NOFORK applet. Be very careful! */
index 0024eb8..dbb6246 100644 (file)
 /* BB_AUDIT SUSv3 compliant */
 /* 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"
 
 /* This is a NOFORK applet. Be very careful! */
index c1390be..2720a35 100644 (file)
  *    and does not support -Ins
  * -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"
 
 enum {
index a1d1645..cc4a132 100644 (file)
  * Original copyright notice states:
  *     "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 <setjmp.h>
 
index 6d4cb4a..12d0715 100644 (file)
 /* http://www.opengroup.org/onlinepubs/009695399/utilities/tr.html
  * 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"
 
 enum {