[U-Boot-Users] [PATCH: cmdcfg: 00/19] Introduce initial versions of new Command Config files.

Timur Tabi timur at freescale.com
Tue Jun 12 17:22:11 CEST 2007


Jon Loeliger wrote:

> This patch series implements a "temporary step" in
> which both the old and new configuration mechanism
> are still fully supported, but the old style using
> CFG_CMD_* is deprecated.  All references that used
> to exist with CFG_CMD_* are now duplicated to have
>     (CFG_CMD_x || CONFIG_CMD_x)

An alternative would have been to define CONFIG_COMMANDS based on the CONFIG_CMD_x values. 
   In cmd_confdefs.h, add something like this:

/* If CONFIG_COMMANDS is not defined, then assume we're using CONFIG_CMD_x */
#ifndef CONFIG_COMMANDS

#ifdef CONFIG_CMD_AUTOSCRIPT
#undef CONFIG_CMD_AUTOSCRIPT
#define CONFIG_CMD_AUTOSCRIPT CONFIG_CMD_AUTOSCRIPT
#else
#define CONFIG_CMD_AUTOSCRIPT 0
#endif

... ( repeat for each CONFIG_CMD_x )

#define CONFIG_COMMANDS \
	(CONFIG_CMD_AUTOSCRIPT | \
	CONFIG_CMD_x (repeat for each CONFIG_CMD_x)

#endif /* #ifndef CONFIG_COMMANDS */

With this technique, you won't need to modify all of the source files that use 
CONFIG_COMMANDS.

-- 
Timur Tabi
Linux Kernel Developer @ Freescale




More information about the U-Boot mailing list