core/pkg-kconfig: use olddefconfig when available
Using 'yes "" | make oldconfig' to regenerate a .config file from an
existing defconfig does not work reliably in all cases. Specifically, it
does not work well with tristate choice entries.
The correct way to do it is to use 'make olddefconfig', but this target
is not supported in projects that use an old version of kconfig. As
most projects do not use tristate entries, there is no need for them to
upgrade.
'oldnoconfig' is an alias for 'olddefconfig', but it also is the only
name for this target between Linux versions 2.6.36 and 3.6.
Check which targets are supported by the current project, and use the
appropriate method to regenerate the .config file.
Signed-off-by: Romain Izard <romain.izard.pro@gmail.com>
[yann.morin.1998@free.fr: use a shell construct instead of makefile code]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Thomas: fix minor typos.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>