compiles with KCONFIG_NOTIMESTAMP=1 fail

Denys Vlasenko vda.linux at googlemail.com
Fri Apr 25 18:56:42 UTC 2008


On Friday 25 April 2008 14:00, David Turgeon wrote:
> With Busybox 1.9.2 if you add option to disable timestamp in .config file
>  via the following change.
>  retrieving revision 1.2
>  diff -u -r1.2 Makefile
>  --- Makefile    15 Apr 2008 23:25:12 -0000      1.2
>  +++ Makefile    25 Apr 2008 11:36:58 -0000
>  @@ -4,6 +4,8 @@
>   EXTRAVERSION =
>   NAME = Unnamed
> 
>  +export KCONFIG_NOTIMESTAMP=1
>  +
>   # *DOCUMENTATION*
>   # To see a list of typical targets execute "make help"
>   # More info can be located in ./README
> 
>  $make will trigger this error
> 
>  CC      editors/vi.o
>  editors/vi.c: In function `colon':
>  editors/vi.c:1084: error: parse error before "AUTOCONF_TIMESTAMP"
>  make[3]: *** [editors/vi.o] Error 1
>  make[2]: *** [editors] Error 2
>  make[2]: Leaving directory
> 
>  Patch:
>  Disable timestamp as per above & add
>  @@ -130,6 +132,9 @@
>   _all: modules
>   endif
> 
>  +ifdef KCONFIG_NOTIMESTAMP
>  +    CFLAGS += -DAUTOCONF_TIMESTAMP=""
>  +endif
>   srctree                := $(if $(KBUILD_SRC),$(KBUILD_SRC),$(CURDIR))
>   TOPDIR         := $(srctree)
>   # FIXME - TOPDIR is obsolete, use srctree/objtree
> 
>  Using make 3.81, autoconf 2.61-4, gcc 3.3 and 4.1 both fail

I propose doing this instead in scripts/kconfig/confdata.c:

                if (use_timestamp) {
                        size_t ret = \
                                strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
                                        "\"%Y-%m-%d %H:%M:%S %Z\"\n", localtime(&now));
                        /* if user has Factory timezone or some other odd install, the
                         * %Z above will overflow the string leaving us with undefined
                         * results ... so let's try again without the timezone.
                         */
                        if (ret == 0)
                                strftime(buf, sizeof(buf), "#define AUTOCONF_TIMESTAMP "
                                        "\"%Y-%m-%d %H:%M:%S\"\n", localtime(&now));
                } else { /* bbox */
=====>                  strcpy(buf, "#define AUTOCONF_TIMESTAMP \"\"\n");
                }

because touching Makefile is the least pleasant way :(
--
vda



More information about the busybox mailing list