OpenCloudOS-Kernel/arch
Masahiro Yamada 104daea149 kconfig: reference environment variables directly and remove 'option env='
To get access to environment variables, Kconfig needs to define a
symbol using "option env=" syntax.  It is tedious to add a symbol entry
for each environment variable given that we need to define much more
such as 'CC', 'AS', 'srctree' etc. to evaluate the compiler capability
in Kconfig.

Adding '$' for symbol references is grammatically inconsistent.
Looking at the code, the symbols prefixed with 'S' are expanded by:
 - conf_expand_value()
   This is used to expand 'arch/$ARCH/defconfig' and 'defconfig_list'
 - sym_expand_string_value()
   This is used to expand strings in 'source' and 'mainmenu'

All of them are fixed values independent of user configuration.  So,
they can be changed into the direct expansion instead of symbols.

This change makes the code much cleaner.  The bounce symbols 'SRCARCH',
'ARCH', 'SUBARCH', 'KERNELVERSION' are gone.

sym_init() hard-coding 'UNAME_RELEASE' is also gone.  'UNAME_RELEASE'
should be replaced with an environment variable.

ARCH_DEFCONFIG is a normal symbol, so it should be simply referenced
without '$' prefix.

The new syntax is addicted by Make.  The variable reference needs
parentheses, like $(FOO), but you can omit them for single-letter
variables, like $F.  Yet, in Makefiles, people tend to use the
parenthetical form for consistency / clarification.

At this moment, only the environment variable is supported, but I will
extend the concept of 'variable' later on.

The variables are expanded in the lexer so we can simplify the token
handling on the parser side.

For example, the following code works.

[Example code]

  config MY_TOOLCHAIN_LIST
          string
          default "My tools: CC=$(CC), AS=$(AS), CPP=$(CPP)"

[Result]

  $ make -s alldefconfig && tail -n 1 .config
  CONFIG_MY_TOOLCHAIN_LIST="My tools: CC=gcc, AS=as, CPP=gcc -E"

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
2018-05-29 03:28:58 +09:00
..
alpha alpha: io: reorder barriers to guarantee writeX() and iowriteX() ordering #2 2018-05-22 18:10:36 -07:00
arc kbuild: mark $(targets) as .SECONDARY and remove .PRECIOUS markers 2018-04-07 19:04:02 +09:00
arm ARM: SoC fixes for 4.17-rc 2018-05-26 14:05:16 -07:00
arm64 ARM: SoC fixes for 4.17-rc 2018-05-26 14:05:16 -07:00
c6x c6x: pass endianness info to sparse 2018-04-10 09:58:58 -04:00
h8300 h8300: remove extraneous __BIG_ENDIAN definition 2018-03-22 17:07:01 -07:00
hexagon hexagon: export csum_partial_copy_nocheck 2018-05-01 15:49:50 -05:00
ia64 pci-v4.17-changes 2018-04-06 18:31:06 -07:00
m68k Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gerg/m68knommu 2018-04-09 09:15:46 -07:00
microblaze Microblaze patches for 4.17-rc1 2018-04-12 10:18:02 -07:00
mips MIPS: Fix ptrace(2) PTRACE_PEEKUSR and PTRACE_POKEUSR accesses to o32 FGRs 2018-05-14 23:54:25 +01:00
nds32 page cache: use xa_lock 2018-04-11 10:28:39 -07:00
nios2 nios2 update for v4.17-rc1 2018-04-11 16:02:18 -07:00
openrisc OpenRISC updates for v4.17 2018-04-15 12:27:58 -07:00
parisc parisc: Move setup_profiling_timer() out of init section 2018-05-18 16:21:49 +02:00
powerpc KVM fixes for v4.17-rc7 2018-05-26 10:46:57 -07:00
riscv RISC-V: build vdso-dummy.o with -no-pie 2018-04-24 10:54:46 -07:00
s390 KVM fixes for v4.17-rc7 2018-05-26 10:46:57 -07:00
sh kconfig: reference environment variables directly and remove 'option env=' 2018-05-29 03:28:58 +09:00
sparc kconfig: reference environment variables directly and remove 'option env=' 2018-05-29 03:28:58 +09:00
um kconfig: reference environment variables directly and remove 'option env=' 2018-05-29 03:28:58 +09:00
unicore32 unicore32: turn flush_dcache_mmap_lock into a no-op 2018-04-11 10:28:39 -07:00
x86 kconfig: reference environment variables directly and remove 'option env=' 2018-05-29 03:28:58 +09:00
xtensa mm: introduce MAP_FIXED_NOREPLACE 2018-04-11 10:28:38 -07:00
.gitignore
Kconfig KASAN: prohibit KASAN+STRUCTLEAK combination 2018-05-11 17:28:45 -07:00