kbuild: Add __cc-option macro
authorMatthias Kaehlcke <mka@chromium.org>
Wed, 21 Jun 2017 23:28:03 +0000 (16:28 -0700)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 25 Jun 2017 03:47:55 +0000 (12:47 +0900)
commit9f3f1fd299768782465cb32cdf0dd4528d11f26b
tree844070b5fac455e1bad324587a3d02c55f9fdbcc
parent39a33ff80a259b2bddebb236549baee55f9b4f41
kbuild: Add __cc-option macro

cc-option uses KBUILD_CFLAGS and KBUILD_CPPFLAGS when it determines
whether an option is supported or not. This is fine for options used to
build the kernel itself, however some components like the x86 boot code
use a different set of flags.

Add the new macro __cc-option which is a more generic version of
cc-option with additional parameters. One parameter is the compiler
with which the check should be performed, the other the compiler options
to be used instead KBUILD_C*FLAGS.

Refactor cc-option and hostcc-option to use __cc-option and move
hostcc-option to scripts/Kbuild.include.

Suggested-by: Arnd Bergmann <arnd@arndb.de>
Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile
scripts/Kbuild.include
scripts/Makefile.host