Commit Graph

5 Commits

Author SHA1 Message Date
Masahiro Yamada
cd51878e34 tools: fix define2mk.sed to not add quotes around negative integers
The sed script, tools/scripts/define2mk.sed, converts config defines
from C headers into include/autoconf.mk for the use in Makefiles.

I found the tool adds quotes around negative integer values.

For example, at the point of the v2016.07-rc1 tag,
include/configs/microblaze-generic.h defines
  #define CONFIG_BOOTDELAY         -1     /* -1 disables auto-boot */

Because it is an integer option, it should be converted to:
  CONFIG_BOOTDELAY=-1

But, the script actually converts it to:
  CONFIG_BOOTDELAY="-1"

This is a fatal problem for the tools/moveconfig.py because it parses
include/autoconf.mk for the config defines from the board headers.
CONFIG_BOOTDELAY="-1" is considered as a string type option and it
is dropped due to the type mismatch from the entry in Kconfig.

This commit fixes the script so that the tools/moveconfig.py can
correctly convert integer options with a negative value.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-06-13 07:46:29 +09:00
Benoît Thébaudeau
2979b26323 autoconfig.mk: Make it possible to define configs from other configs
Give more flexibility to define configs that can be interpreted by make, e.g. to
define fallback values of configs like in the example below.

Before this change, the config lines:
 #define CONFIG_SPL_MAX_SIZE	2048
 #define CONFIG_SPL_PAD_TO	CONFIG_SPL_MAX_SIZE
would have been changed in autoconfig.mk into:
 CONFIG_SPL_MAX_SIZE=2048
 CONFIG_SPL_PAD_TO="CONFIG_SPL_MAX_SIZE"

Hence, a make recipe using as an argument to $(OBJCOPY):
 --pad-to=$(CONFIG_SPL_PAD_TO)
would have issued:
 --pad-to="CONFIG_SPL_MAX_SIZE"
which means nothing for $(OBJCOPY) and makes it fail.

Thanks to this change, the config lines above are changed in autoconfig.mk into:
 CONFIG_SPL_MAX_SIZE=2048
 CONFIG_SPL_PAD_TO=$(CONFIG_SPL_MAX_SIZE)

Hence, the make recipe above now issues:
 --pad-to=2048
as expected from the defined config.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com>
Reviewed-by: Tom Rini <trini@ti.com>
2013-04-12 07:55:06 +02:00
Wolfgang Denk
2bad5df727 autoconfig.mk: avoid apostophes around hex values
When generating include/autoconfig.mk, hex numbers would be quoted.
This caused some false positives during automatic testing of the
builds, and is known to cause some real issues for some Blackfin
configurations. Don't use apostophes for decimal and hex numbers (nor
for octal numbers).

Signed-off-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2010-10-18 22:08:22 +02:00
Marcel Moolenaar
02409f8cf5 make define2mk.sed work on FreeBSD
In the thread "[1.3.2-rc1] MPC8548CDS/MPC8555CDS configs fails to link",
the define2mk.sed script was identified as the source of the link
failure on FreeBSD. The problem is that sed(1) does not always support
the '+' operator. It isn't on FreeBSD. The attach patch implements the
equivalent, using the '*' operator instead and should work everywhere.

Signed-off-by: Marcel Moolenaar <marcelm@juniper.net>
2008-02-22 21:27:01 +01:00
Grant Likely
2f155f6c0a [BUILD] Generate include/autoconf.mk from board config files
Use cpp and sed to postprocess config.h and import the defined values
into include/autoconf.mk.  autoconf.mk is then included by config.mk to
give 'make' access to the board configuration.

Doing this enables conditional compilation at the Makefile level instead
of by wrapping every .c file with #ifdef/#endif wrappers.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2007-11-20 22:33:38 -07:00