History log of /linux-master/scripts/kconfig/Makefile
Revision Date Author Comments
# ac14947c 05-Dec-2023 Markus Schneider-Pargmann <msp@baylibre.com>

kconfig: Use KCONFIG_CONFIG instead of .config

When using a custom location for kernel config files this merge config
command fails as it doesn't use the configuration set with
KCONFIG_CONFIG.

Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 6c07fd84 03-Dec-2023 Masahiro Yamada <masahiroy@kernel.org>

kconfig: factor out common code shared by mconf and nconf

Separate out the duplicated code to mnconf-common.c.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 92ef432f 23-Nov-2023 Masahiro Yamada <masahiroy@kernel.org>

kbuild: support W=c and W=e shorthands for Kconfig

KCONFIG_WARN_UNKNOWN_SYMBOLS=1 and KCONFIG_WERROR=1 are descriptive
and suitable in scripting, but typing them from the command line can
be tedious.

Associate them with KBUILD_EXTRA_WARN (and the W= shorthand).

Support a new letter 'c' to enable extra checks in Kconfig. You can
still manage compiler warnings (W=1) and Kconfig warnings (W=c)
independently.

Reuse the letter 'e' to turn Kconfig warnings into errors.

As usual, you can combine multiple letters in KCONFIG_EXTRA_WARN.

$ KCONFIG_WARN_UNKNOWN_SYMBOLS=1 KCONFIG_WERROR=1 make defconfig

can be shortened to:

$ KBUILD_EXTRA_WARN=ce make defconfig

or, even shorter:

$ make W=ce defconfig

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>


# feec5e1f 31-Aug-2023 Kees Cook <keescook@chromium.org>

kbuild: Show marked Kconfig fragments in "help"

Currently the Kconfig fragments in kernel/configs and arch/*/configs
that aren't used internally aren't discoverable through "make help",
which consists of hard-coded lists of config fragments. Instead, list
all the fragment targets that have a "# Help: " comment prefix so the
targets can be generated dynamically.

Add logic to the Makefile to search for and display the fragment and
comment. Add comments to fragments that are intended to be direct targets.

Signed-off-by: Kees Cook <keescook@chromium.org>
Co-developed-by: Masahiro Yamada <masahiroy@kernel.org>
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# aedee9e8 12-Jan-2023 Peter Foley <pefoley2@pefoley.com>

kconfig: Update all declared targets

Currently qconf-cfg.sh is the only script that touches the "-bin"
target, even though all of the conf_cfg rules declare that they do.
Make the recipe unconditionally touch all declared targets to avoid
incompatibilities with upcoming versions of GNU make:
https://lists.gnu.org/archive/html/info-gnu/2022-10/msg00008.html

e.g.
scripts/kconfig/Makefile:215: warning: pattern recipe did not update peer target 'scripts/kconfig/nconf-bin'.
scripts/kconfig/Makefile:215: warning: pattern recipe did not update peer target 'scripts/kconfig/mconf-bin'.
scripts/kconfig/Makefile:215: warning: pattern recipe did not update peer target 'scripts/kconfig/gconf-bin'.

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 3122c844 10-Dec-2022 Masahiro Yamada <masahiroy@kernel.org>

kconfig: refactor Makefile to reduce process forks

Refactor Makefile and use read-file macro. For Make >= 4.2, it can read
out a file by using the built-in function.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>


# c39afe62 17-Oct-2021 Josh Triplett <josh@joshtriplett.org>

kconfig: Add `make mod2noconfig` to disable module options

When converting a modular kernel to a monolithic kernel, once the kernel
works without loading any modules, this helps to quickly disable all the
modules before turning off module support entirely.

Refactor conf_rewrite_mod_or_yes to a more general
conf_rewrite_tristates that accepts an old and new state.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Tested-by: Björn Töpel <bjorn@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# a77a05dc 13-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: split menu.c out of parser.y

Compile menu.c as an independent compilation unit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# f02aa48d 10-Apr-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: use /boot/config-* etc. as DEFCONFIG_LIST only for native build

When the .config file is missing, 'make config', 'make menuconfig', etc.
uses a file listed in DEFCONFIG_LIST, if found, as base configuration.

Ususally, /boot/config-$(uname -r) exists, and is used as default.

However, when you are cross-compiling the kernel, it does not make
sense to use /boot/config-* on the build host. It should default to
arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG).

UML previously did not use DEFCONFIG_LIST at all, but it should be
able to use arch/um/configs/$(KBUILD_DEFCONFIG) as a base config file.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# f8f0d064 13-Mar-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: do not use allnoconfig_y option

allnoconfig_y is an ugly hack that sets a symbol to 'y' by allnoconfig.

allnoconfig does not mean a minimal set of CONFIG options because a
bunch of prompts are hidden by 'if EMBEDDED' or 'if EXPERT', but I do
not like to hack Kconfig this way.

Use the pre-existing feature, KCONFIG_ALLCONFIG, to provide a one
liner config fragment. CONFIG_EMBEDDED=y is still forced when
allnoconfig is invoked as a part of tinyconfig.

No change in the .config file produced by 'make tinyconfig'.

The output of 'make allnoconfig' will be changed; we will get
CONFIG_EMBEDDED=n because allnoconfig literally sets all symbols to n.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# dd465996 13-Mar-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: move default KBUILD_DEFCONFIG back to scripts/kconfig/Makefile

This is a partial revert of commit 2a86f6612164 ("kbuild: use
KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST").

Now that the reference to $(DEFCONFIG_LIST) was removed from
init/Kconfig, the default KBUILD_DEFCONFIG can go back home.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# b75b0a81 13-Mar-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: change defconfig_list option to environment variable

"defconfig_list" is a weird option that defines a static symbol that
declares the list of base config files in case the .config does not
exist yet.

This is quite different from other normal symbols; we just abused the
"string" type and the "default" properties to list out the input files.
They must be fixed values since these are searched for and loaded in
the parse stage.

It is an ugly hack, and should not exist in the first place. Providing
this feature as an environment variable is a saner approach.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# f91e46b1 21-Feb-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: unify rule of config, menuconfig, nconfig, gconfig, xconfig

Unify the similar build rules.

This supports 'make build_config', which builds scripts/kconfig/conf
but does not invoke it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# ae8da72b 21-Feb-2021 Masahiro Yamada <masahiroy@kernel.org>

kconfig: omit --oldaskconfig option for 'make config'

scripts/kconfig/conf.c line 39 defines the default of input_mode as
oldaskconfig. Hence, 'make config' works in the same way even without
the --oldaskconfig option given. Note this in the help message.

This will be helpful to unify build rules in Makefile in the next
commit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 9bba03d4 22-Dec-2020 Masahiro Yamada <masahiroy@kernel.org>

kconfig: remove 'kvmconfig' and 'xenconfig' shorthands

Linux 5.10 is out. Remove the 'kvmconfig' and 'xenconfig' shorthands
as previously announced.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 23cd88c9 20-Aug-2020 Masahiro Yamada <masahiroy@kernel.org>

kbuild: hide commands to run Kconfig, and show short log for syncconfig

Some targets (localyesconfig, localmodconfig, defconfig) hide the
command running, but the others do not.

Users know which Kconfig flavor they are running, so it is OK to hide
the command. Add $(Q) to all commands consistently. If you want to see
the full command running, pass V=1 from the command line.

syncconfig is the exceptional case, which occurs without explicit
command invocation by the user. Display the Kbuild-style log for it.
The ugly bare log will go away.

[Before]

scripts/kconfig/conf --syncconfig Kconfig

[After]

SYNC include/config/auto.conf

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 0e912c03 29-Jul-2020 Masahiro Yamada <masahiroy@kernel.org>

kconfig: qconf: compile moc object separately

Currently, qconf.moc is included from qconf.cc but they can be compiled
independently.

When you modify qconf.cc, qconf.moc does not need recompiling.

Rename qconf.moc to qconf-moc.cc, and split it out as an independent
compilation unit.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# c3cd7cfa 29-Jul-2020 Masahiro Yamada <masahiroy@kernel.org>

kconfig: qconf: use if_changed for qconf.moc rule

Regenerate qconf.moc when the moc command is changed.

This also allows 'make mrproper' to clean it up. Previously, it was
not cleaned up because 'clean-files += qconf.moc' was missing.
Now 'make mrproper' correctly cleans it up because files listed in
'targets' are cleaned.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# bcfefb61 30-Apr-2020 Masahiro Yamada <masahiroy@kernel.org>

kconfig: announce removal of 'kvmconfig' and 'xenconfig' shorthands

kvmconfig' is a shorthand for kvm_guest.config to save 7 character typing.

xenconfig' is a shorthand for xen.config to save 1 character typing.

There is nothing more than that.

There are more files in kernel/configs/, so it is not maintainable
to wire-up every config fragment to the Kconfig Makefile. Hence,
we should not do this at all.

These will be removed after Linux 5.10. Meanwhile, the following
warning message will be displayed if they are used.

WARNING: 'make kvmconfig' will be removed after Linux 5.10
Please use 'make kvm_guest.config' instead.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# c027b02d 12-May-2020 Changbin Du <changbin.du@intel.com>

streamline_config.pl: add LMC_KEEP to preserve some kconfigs

Sometimes it is useful to preserve batches of configs when making
localmodconfig. For example, I usually don't want any usb and fs
modules to be disabled. Now we can do it by:

$ make LMC_KEEP="drivers/usb:fs" localmodconfig

Signed-off-by: Changbin Du <changbin.du@gmail.com>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 2a86f661 27-Feb-2020 Masahiro Yamada <masahiroy@kernel.org>

kbuild: use KBUILD_DEFCONFIG as the fallback for DEFCONFIG_LIST

Most of the Kconfig commands (except defconfig and all*config) read
the .config file as a base set of CONFIG options.

When it does not exist, the files in DEFCONFIG_LIST are searched in
this order and loaded if found.

I do not see much sense in the last two lines in DEFCONFIG_LIST.

[1] ARCH_DEFCONFIG

The entry for DEFCONFIG_LIST is guarded by 'depends on !UML'. So, the
ARCH_DEFCONFIG definition in arch/x86/um/Kconfig is meaningless.

arch/{sh,sparc,x86}/Kconfig define ARCH_DEFCONFIG depending on 32 or
64 bit variant symbols. This is a little bit strange; ARCH_DEFCONFIG
should be a fixed string because the base config file is loaded before
the symbol evaluation stage.

Using KBUILD_DEFCONFIG makes more sense because it is fixed before
Kconfig is invoked. Fortunately, arch/{sh,sparc,x86}/Makefile define it
in the same way, and it works as expected. Hence, replace ARCH_DEFCONFIG
with "arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)".

[2] arch/$(ARCH)/defconfig

This file path is no longer valid. The defconfig files are always located
in the arch configs/ directories.

$ find arch -name defconfig | sort
arch/alpha/configs/defconfig
arch/arm64/configs/defconfig
arch/csky/configs/defconfig
arch/nds32/configs/defconfig
arch/riscv/configs/defconfig
arch/s390/configs/defconfig
arch/unicore32/configs/defconfig

The path arch/*/configs/defconfig is already covered by
"arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)". So, this file path is
not necessary.

I moved the default KBUILD_DEFCONFIG to the top Makefile. Otherwise,
the 7 architectures listed above would end up with endless loop of
syncconfig.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 5f2fb52f 01-Feb-2020 Masahiro Yamada <masahiroy@kernel.org>

kbuild: rename hostprogs-y/always to hostprogs/always-y

In old days, the "host-progs" syntax was used for specifying host
programs. It was renamed to the current "hostprogs-y" in 2004.

It is typically useful in scripts/Makefile because it allows Kbuild to
selectively compile host programs based on the kernel configuration.

This commit renames like follows:

always -> always-y
hostprogs-y -> hostprogs

So, scripts/Makefile will look like this:

always-$(CONFIG_BUILD_BIN2C) += ...
always-$(CONFIG_KALLSYMS) += ...
...
hostprogs := $(always-y) $(always-m)

I think this makes more sense because a host program is always a host
program, irrespective of the kernel configuration. We want to specify
which ones to compile by CONFIG options, so always-y will be handier.

The "always", "hostprogs-y", "hostprogs-m" will be kept for backward
compatibility for a while.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 89b90609 17-Dec-2019 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>

kconfig: Add yes2modconfig and mod2yesconfig targets.

Since kernel configs provided by syzbot are close to "make allyesconfig",
it takes long time to rebuild. This is especially waste of time when we
need to rebuild for many times (e.g. doing manual printk() inspection,
bisect operations).

We can save time if we can exclude modules which are irrelevant to each
problem. But "make localmodconfig" cannot exclude modules which are built
into vmlinux because /sbin/lsmod output is used as the source of modules.

Therefore, this patch adds "make yes2modconfig" which converts from =y
to =m if possible. After confirming that the interested problem is still
reproducible, we can try "make localmodconfig" (and/or manually tune
based on "Modules linked in:" line) in order to exclude modules which are
irrelevant to the interested problem. While we are at it, this patch also
adds "make mod2yesconfig" which converts from =m to =y in case someone
wants to convert from =m to =y after "make localmodconfig".

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# c8138a57 16-Dec-2019 Masahiro Yamada <masahiroy@kernel.org>

kconfig: use $(PERL) in Makefile

The top Makefile defines and exports the variable 'PERL'. Use it in
case somebody wants to specify a particular version of perl from the
command line.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 1d135237 16-Dec-2019 Masahiro Yamada <masahiroy@kernel.org>

kconfig: fix too deep indentation in Makefile

The indentation for if ... else ... fi is too deep. Fix it.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 5d8b42aa 04-Nov-2019 Laura Abbott <labbott@redhat.com>

kconfig: Add option to get the full help text with listnewconfig

make listnewconfig will list the individual options that need to be set.
This is useful but there's no easy way to get the help text associated
with the options at the same time. Introduce a new targe
'make helpnewconfig' which lists the full help text of all the
new options as well. This makes it easier to automatically generate
changes that are easy for humans to review. This command also adds
markers between each option for easier parsing.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# a64c0440 25-Oct-2019 Geert Uytterhoeven <geert+renesas@glider.be>

kbuild: Wrap long "make help" text lines

Some "make help" text lines extend beyond 80 characters.
Wrap them before an opening parenthesis, or before 80 characters.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 521b29b6 25-Aug-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: split util.c out of parser.y

util.c exists both in scripts/kconfig/ and scripts/kconfig/lxdialog.

Prior to commit 54b8ae66ae1a ("kbuild: change *FLAGS_<basetarget>.o
to take the path relative to $(obj)"), Kbuild could not pass different
flags to source files with the same basename. Now that this issue
was solved, you can split util.c out of parser.y and compile them
independently of each other.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 54b8ae66 29-Aug-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: change *FLAGS_<basetarget>.o to take the path relative to $(obj)

Kbuild provides per-file compiler flag addition/removal:

CFLAGS_<basetarget>.o
CFLAGS_REMOVE_<basetarget>.o
AFLAGS_<basetarget>.o
AFLAGS_REMOVE_<basetarget>.o
CPPFLAGS_<basetarget>.lds
HOSTCFLAGS_<basetarget>.o
HOSTCXXFLAGS_<basetarget>.o

The <basetarget> is the filename of the target with its directory and
suffix stripped.

This syntax comes into a trouble when two files with the same basename
appear in one Makefile, for example:

obj-y += foo.o
obj-y += dir/foo.o
CFLAGS_foo.o := <some-flags>

Here, the <some-flags> applies to both foo.o and dir/foo.o

The real world problem is:

scripts/kconfig/util.c
scripts/kconfig/lxdialog/util.c

Both files are compiled into scripts/kconfig/mconf, but only the
latter should be given with the ncurses flags.

It is more sensible to use the relative path to the Makefile, like this:

obj-y += foo.o
CFLAGS_foo.o := <some-flags>
obj-y += dir/foo.o
CFLAGS_dir/foo.o := <other-flags>

At first, I attempted to replace $(basetarget) with $*. The $* variable
is replaced with the stem ('%') part in a pattern rule. This works with
most of cases, but does not for explicit rules.

For example, arch/ia64/lib/Makefile reuses rule_as_o_S in its own
explicit rules, so $* will be empty, resulting in ignoring the per-file
AFLAGS.

I introduced a new variable, target-stem, which can be used also from
explicit rules.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Marc Zyngier <maz@kernel.org>


# 1634f2bf 24-Aug-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: remove clean-dirs syntax

The only the difference between clean-files and clean-dirs is the -r
option passed to the 'rm' command.

You can always pass -r, and then remove the clean-dirs syntax.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 3266c806 04-Jun-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: run olddefconfig instead of oldconfig after merging fragments

'make olddefconfig' is non-interactive, so we can drop 'yes'.
The behavior is equivalent.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# bd305f25 27-May-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: make arch/*/configs/defconfig the default of KBUILD_DEFCONFIG

Until recently, if KBUILD_DEFCONFIG was not set by the arch Makefile,
the default path arch/*/defconfig was used.

The last users of the default are gone by the following commits:

- Commit f3e20ad67b4c ("s390: move arch/s390/defconfig to
arch/s390/configs/defconfig")

- Commit 986a13769c4b ("alpha: move arch/alpha/defconfig to
arch/alpha/configs/defconfig")

Let's set arch/*/configs/defconfig as a new default. This saves
KBUILD_DEFCONFIG for some architectures.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>


# e0a26686 27-May-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: remove always false ifeq ($(KBUILD_DEFCONFIG,) conditional

With the following two commits applied, all the arch Makefiles
define KBUILD_DEFCONFIG.

- Commit f3e20ad67b4c ("s390: move arch/s390/defconfig to
arch/s390/configs/defconfig")

- Commit 986a13769c4b ("alpha: move arch/alpha/defconfig to
arch/alpha/configs/defconfig")

The first conditional in the defconfig rule is always false.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# fc2694ec 18-May-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: use 'else ifneq' for Makefile to improve readability

'ifeq ... else ifneq ... endif' notation is supported by GNU Make 3.81
or later, which is the requirement for building the kernel since
commit 37d69ee30808 ("docs: bump minimal GNU Make version to 3.81").

Use it to improve the readability.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 9cc342f6 13-May-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

treewide: prefix header search paths with $(srctree)/

Currently, the Kbuild core manipulates header search paths in a crazy
way [1].

To fix this mess, I want all Makefiles to add explicit $(srctree)/ to
the search paths in the srctree. Some Makefiles are already written in
that way, but not all. The goal of this work is to make the notation
consistent, and finally get rid of the gross hacks.

Having whitespaces after -I does not matter since commit 48f6e3cf5bc6
("kbuild: do not drop -I without parameter").

[1]: https://patchwork.kernel.org/patch/9632347/

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 769a1c02 24-Jan-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: rename zconf.y to parser.y

Use a more logical name.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 981e545a 24-Jan-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: rename zconf.l to lexer.l

Use a more logical name.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 2648ca18 10-Jan-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: clean generated *conf-cfg files

I accidentally dropped '*' in the previous renaming patch.

Revive it so that 'make mrproper' can clean the generated files.

Fixes: d86271af6460 ("kconfig: rename generated .*conf-cfg to *conf-cfg")
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# d86271af 04-Jan-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: rename generated .*conf-cfg to *conf-cfg

Remove the dot-prefixing since it is just a matter of the
.gitignore file.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# ba97df45 02-Jan-2019 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: use assignment instead of define ... endef for filechk_* rules

You do not have to use define ... endef for filechk_* rules.

For simple cases, the use of assignment looks cleaner, IMHO.

I updated the usage for scripts/Kbuild.include in case somebody
misunderstands the 'define ... endif' is the requirement.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com>


# 3b54197856 21-Dec-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: split images.c out of qconf.cc/gconf.c to fix gconf warnings

Currently, images.c is included by qconf.cc and gconf.c.
qconf.cc uses all of xpm_* arrays, but gconf.c only some of them.
Hence, lots of "... defined but not used" warnings are displayed
while compiling gconf.c

Splitting out images.c fixes the warnings.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# cbafbf7f 21-Dec-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: split the lexer out of zconf.y

Compile zconf.lex.c independently of the other files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 558e78e3 21-Dec-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: split some C files out of zconf.y

I want to compile each C file independently instead of including all
of them from zconf.y.

Split out confdata.c, expr.c, symbol.c, and preprocess.c .
These are low-hanging fruits.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 0085b419 29-Oct-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: remove silentoldconfig target

As commit 911a91c39cab ("kconfig: rename silentoldconfig to
syncconfig") announced, it is time for the removal.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>


# 04c459d2 29-Oct-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: remove oldnoconfig target

As commit 312ee68752fa ("kconfig: announce removal of oldnoconfig if
used") announced, it is time for the removal.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# fd65465b 31-Aug-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: do not require pkg-config on make {menu,n}config

Meelis Roos reported a {menu,n}config regression:
"I have libncurses devel package installed in the default system
location (as do 99%+ on actual developers probably) and in this
case, pkg-config is useless. pkg-config is needed only when
libraries and headers are installed in non-default locations but
it is bad to require installation of pkg-config on all the machines
where make menuconfig would be possibly run."

For {menu,n}config, do not use pkg-config if it is not installed.
For {g,x}config, keep checking pkg-config since we really rely on it
for finding the installation paths of the required packages.

Fixes: 4ab3b80159d4 ("kconfig: check for pkg-config on make {menu,n,g,x}config")
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Meelis Roos <mroos@linux.ee>
Tested-by: Randy Dunlap <rdunlap@infradead.org>


# 98a4afbf 15-Aug-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: fix "Can't open ..." in parallel build

If you run "make menuconfig" or "make nconfig" with -j<N> option in a
fresh source tree, you will see several "Can't open ..." messages:

$ make -j8 menuconfig
HOSTCC scripts/basic/fixdep
YACC scripts/kconfig/zconf.tab.c
LEX scripts/kconfig/zconf.lex.c
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: HOSTCC scripts/kconfig/lxdialog/checklist.o
Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
HOSTCC scripts/kconfig/lxdialog/inputbox.o
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
UPD scripts/kconfig/.mconf-cfg
/bin/sh: 1: .: Can't open scripts/kconfig/.mconf-cfg
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/mconf.o
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/mconf

Correct dependencies to fix this problem.

Fixes: 1c5af5cf9308 ("kconfig: refactor ncurses package checks for building mconf and nconf")
Cc: linux-stable <stable@vger.kernel.org> # v4.18
Reported-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Borislav Petkov <bp@suse.de>


# 4bf6a9af 14-Aug-2018 Randy Dunlap <rdunlap@infradead.org>

kconfig: add build-only configurator targets

Add build-only targets for build_menuconfig, build_nconfig,
build_xconfig, and build_gconfig.
(targets must end in "config" to qualify in top-level Makefile)

This allows these target to be built without execution (e.g., to
look for errors or warnings) and/or to be built and checked by sparse.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 79123b13 20-Jul-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: create directories needed for syncconfig by itself

'make syncconfig' creates some files such as include/config/auto.conf,
include/generate/autoconf.h, etc. but the necessary directory creation
relies on scripts/kconfig/Makefile.

To make Kconfig self-contained, create directories as needed in
conf_write_autoconf().

This change allows scripts/kconfig/Makefile cleanups; syncconfig can
be merged into simple-targets.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# adc18acf 20-Jul-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: remove unneeded directory generation from local*config

Commit 17263baf958b ("kconfig: Create include/generated for
localmodconfig") added the 'mkdir' line because local{yes,mod}config
ran streamline_config.pl followed by silentoldconfig at that time.

Since commit 81d2bc227305 ("kconfig: invoke oldconfig instead of
silentoldconfig from local*config"), no sub-directory is required.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 4ab3b801 28-Jun-2018 Randy Dunlap <rdunlap@infradead.org>

kconfig: check for pkg-config on make {menu,n,g,x}config

Each of 'make {menu,n,g,x}config' uses (needs) pkg-config to make sure
that other required files are present and to determine build flags
settings, but none of these check that pkg-config itself is present.
Add a check for all 4 of these targets and update
Documentation/process/changes.rst to mention 'pkg-config'.

Fixes kernel bugzilla #77511:
https://bugzilla.kernel.org/show_bug.cgi?id=77511

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Bjørn Forsman <bjorn.forsman@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 8377bd2b 09-Jul-2018 Laura Abbott <labbott@redhat.com>

kbuild: Rename HOST_LOADLIBES to KBUILD_HOSTLDLIBS

In preparation for enabling command line LDLIBS, re-name HOST_LOADLIBES
to KBUILD_HOSTLDLIBS as the internal use only flags. Also rename
existing usage to HOSTLDLIBS for consistency. This should not have any
visible effects.

Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# bb6d83dd 02-Jun-2018 Petr Vorel <pvorel@suse.cz>

kbuild: Move last word of nconfig help to the previous line

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# d6a0c8a1 02-Jun-2018 Petr Vorel <pvorel@suse.cz>

kconfig: Add testconfig into make help output

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 694c49a7 22-May-2018 Sam Ravnborg <sam@ravnborg.org>

kconfig: drop localization support

The localization support is broken and appears unused.
There is no google hits on the update-po-config target.
And there is no recent (5 years) activity related to the localization.

So lets just drop this as it is no longer used.

Suggested-by: Ulf Magnusson <ulfalizer@gmail.com>
Suggested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 1c5af5cf 22-May-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: refactor ncurses package checks for building mconf and nconf

The mconf (or its infrastructure, lxdiaglog) depends on the ncurses.
Move and rename check-lxdialog.sh to mconf-cfg.sh to make it work in
the same way as for qconf and gconf.

This commit fixes some more weirdnesses.

The nconf also needs ncurses packages. HOSTLOADLIBES_nconf is set
to the libraries needed for nconf, but the cflags is not explicitly
set. Actually, nconf relies on the check-lxdialog.sh for the proper
cflags:

HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(check-lxdialog) -ccflags) \
-DLOCALE

The code above passes the ncurses flags to all objects, even for conf,
qconf, gconf. Let's pass the ncurses flags only to mconf and nconf.

Currently, the presence of ncurses is not checked for nconf. Let's
show a prompt like the mconf case.

According to Randy's report, the shell scripts still need to carry
the fallback code in case the pkg-config fails to find the ncurses
packages.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>


# b464ef58 22-May-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: refactor GTK+ package checks for building gconf

Refactor the package checks for gconf in the same way as for qconf.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>


# 0b669a50 22-May-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: refactor Qt package checks for building qconf

Currently, the necessary package checks for building qconf is
surrounded by ifeq ($(MAKECMDGOALS),xconfig) ... endif.
Then, Make will restart when .tmp_qtcheck is generated.

To simplify the Makefile, move the scripting to a separate file,
and use filechk. The shell script is executed everytime xconfig
is run, but it is not a costly script.

In the old code, 'pkg-config --exists' only checked Qt5Core / QtCore,
but the set of necessary packages should be checked.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>


# b23d1a24 23-Mar-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: add %.lex.c and %.tab.[ch] to 'targets' automatically

Files generated by if_changed* must be added to 'targets' to include
*.cmd files. Otherwise, they would be regenerated every time.

The build system automatically adds objects to 'targets' where
appropriate, such as obj-y, extra-y, etc. but does nothing for
intermediate files. So, each Makefile needs to add them by itself.

There are some common cases where objects are generated by chained
rules. Lexers and parsers are compiled like follows:

%.lex.o <- %.lex.c <- %.l
%.tab.o <- %.tab.c <- %.y

They are common patterns, so it is reasonable to take care of them
in the core Makefile instead of requiring each Makefile to do so.

At this moment, you cannot delete 'target += zconf.lex.c' in the
Kconfig Makefile because zconf.lex.c is included from zconf.tab.c
instead of being compiled separately. It should be deleted after
Kconfig is more refactored.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Frank Rowand <frowand.list@gmail.com>


# 9a8dfb39 23-Mar-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: clean up *.lex.c and *.tab.[ch] patterns from top-level Makefile

Files suffixed by .lex.c, .tab.[ch] are generated lexers, parsers,
respectively. Clean them up globally from the top Makefile.

Some of the final host programs those lexer/parser are linked into
are necessary for building external modules, but the intermediates
are unneeded. They can be cleaned away by 'make clean' instead of
'make mrproper'.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Frank Rowand <frowand.list@gmail.com>


# 022a4bf6 13-Mar-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: tests: add framework for Kconfig unit testing

Many parts in Kconfig are so cryptic and need refactoring. However,
its complexity prevents us from moving forward. There are several
naive corner cases where it is difficult to notice breakage. If
those are covered by unit tests, we will be able to touch the code
with more confidence.

Here is a simple test framework based on pytest. The conftest.py
provides a fixture useful to run commands such as 'oldaskconfig' etc.
and to compare the resulted .config, stdout, stderr with expectations.

How to add test cases?
----------------------

For each test case, you should create a subdirectory under
scripts/kconfig/tests/ (so test cases are separated from each other).
Every test case directory should contain the following files:

- __init__.py: describes test functions
- Kconfig: the top level Kconfig file for the test

To do a useful job, test cases generally need additional data like
input .config and information about expected results.

How to run tests?
-----------------

You need python3 and pytest. Then, run "make testconfig". O= option
is supported. If V=1 is given, detailed logs captured during tests
are displayed.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>


# 2a616258 28-Feb-2018 Ulf Magnusson <ulfalizer@gmail.com>

kconfig: remove redundant streamline_config.pl prerequisite

The local{yes,mod}config targets currently have streamline_config.pl as
a prerequisite. This is redundant, because streamline_config.pl is a
checked-in file with no prerequisites.

Remove the prerequisite and reference streamline_config.pl directly in
the recipe of the rule instead.

Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 911a91c3 28-Feb-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: rename silentoldconfig to syncconfig

As commit cedd55d49dee ("kconfig: Remove silentoldconfig from help
and docs; fix kconfig/conf's help") mentioned, 'silentoldconfig' is a
historical misnomer. That commit removed it from help and docs since
it is an internal interface. If so, it should be allowed to rename
it to something more intuitive. 'syncconfig' is the one I came up
with because it updates the .config if necessary, then synchronize
include/generated/autoconf.h and include/config/* with it.

You should not manually invoke 'silentoldcofig'. Display warning if
used in case existing scripts are doing wrong.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>


# 81d2bc22 28-Feb-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: invoke oldconfig instead of silentoldconfig from local*config

The purpose of local{yes,mod}config is to arrange the .config file
based on actually loaded modules. It is unnecessary to update
include/generated/autoconf.h and include/config/* stuff here.
They will be updated as needed during the build.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>


# 07a422bb 16-Mar-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: restore autoksyms.h touch to the top Makefile

Commit d3fc425e819b ("kbuild: make sure autoksyms.h exists early")
moved the code that touches autoksyms.h to scripts/kconfig/Makefile
with obscure reason.

From Nicolas' comment [1], he did not seem to be sure about the root
cause.

I guess I figured it out, so here is a fix-up I think is more correct.
According to the error log in the original post [2], the build failed
in scripts/mod/devicetable-offsets.c

scripts/mod/Makefile is descended from scripts/Makefile, which is
invoked from the top-level Makefile by the 'scripts' target.

To build vmlinux and/or modules, Kbuild descend into $(vmlinux-dirs).
This depends on 'prepare' and 'scripts' as follows:

$(vmlinux-dirs): prepare scripts

Because there is no dependency between 'prepare' and 'scripts', the
parallel building can execute them simultaneously.

'prepare' depends on 'prepare1', which touched autoksyms.h, while
'scripts' descends into script/, then scripts/mod/, which needs
<generated/autoksyms.h> if CONFIG_TRIM_UNUSED_KSYMS. It was the
reason of the race.

I am not happy to have unrelated code in the Kconfig Makefile, so
getting it back to the top Makefile.

I removed the standalone test target because I want to use it to
create an empty autoksyms.h file. Here is a little improvement;
unnecessary autoksyms.h is not created when CONFIG_TRIM_UNUSED_KSYMS
is disabled.

[1] https://lkml.org/lkml/2016/11/30/734
[2] https://lkml.org/lkml/2016/11/30/531

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Nicolas Pitre <nico@linaro.org>


# cedd55d4 26-Jan-2018 Marc Herbert <marc.herbert@intel.com>

kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help

As explained by Michal Marek at https://lkml.org/lkml/2011/8/31/189
silentoldconfig has become a misnomer. It has become an internal interface
so remove it from "make help" and Documentation/ to stop confusing people
using it as seen for instance at
https://chromium-review.googlesource.com/835632 Don't remove it from
kconfig/Makefile yet not to break any (other) tool using it.

On the other hand, correct and expand its description in the help of
the (internal) scripts/kconfig/conf.c

Signed-off-by: Marc Herbert <marc.herbert@intel.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 312ee687 17-Jan-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: announce removal of oldnoconfig if used

The 'oldnoconfig' is really confusing due to its counter-intuitive name.
It was renamed by commit fb16d8912db5 ("kconfig: replace 'oldnoconfig'
with 'olddefconfig', and keep the old name as an alias").

The 'oldnoconfig' has been kept as an alias for enough period of time,
and finally I am planning to remove it. I will give people a little
more time for migration. Meanwhile, the following message will be
displayed if oldnoconfig is used.

WARNING: "oldnoconfig" target will be removed after Linux 4.19
Please use "olddefconfig" instead, which is an alias.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>


# d0fd0428 16-Jan-2018 Yaakov Selkowitz <yselkowi@redhat.com>

kconfig: fix make xconfig when gettext is missing

The C-based config programs are properly guarded from a missing (or,
currently, external) libintl.h by the HOST_EXTRACFLAGS check, but
this does not help the C++-based qconf.

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# 765f4cde 11-Jan-2018 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: use default 'yy' prefix for lexer and parser

Flex and Bison provide an option to change the prefix of globally-
visible symbols. This is useful to link multiple lexers and/or
parsers into the same executable. However, Kconfig (and any other
host programs in kernel) uses a single lexer and parser. I do not
see a good reason to change the default 'yy' prefix.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Ulf Magnusson <ulfalizer@gmail.com>


# 29c83306 09-Dec-2017 Masahiro Yamada <yamada.masahiro@socionext.com>

kconfig: generate lexer and parser during build instead of shipping

zconf.lex.c is generated by flex, zconf.tab.c by bison. Instead of
running flex and bison during the kernel building, we conventionally
version-control those artifacts with _shipped suffix.

It is tedious to manually regenerate them every time we change the
real sources, zconf.l and zconf.y.

Remove the _shipped files and switch over to build-time generation
of the intermediate C files.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# b2441318 01-Nov-2017 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

License cleanup: add SPDX GPL-2.0 license identifier to files with no license

Many source files in the tree are missing licensing information, which
makes it harder for compliance tools to determine the correct license.

By default all files without license information are under the default
license of the kernel, which is GPL version 2.

Update the files which contain no license information with the 'GPL-2.0'
SPDX license identifier. The SPDX identifier is a legally binding
shorthand, which can be used instead of the full boiler plate text.

This patch is based on work done by Thomas Gleixner and Kate Stewart and
Philippe Ombredanne.

How this work was done:

Patches were generated and checked against linux-4.14-rc6 for a subset of
the use cases:
- file had no licensing information it it.
- file was a */uapi/* one with no licensing information in it,
- file was a */uapi/* one with existing licensing information,

Further patches will be generated in subsequent months to fix up cases
where non-standard license headers were used, and references to license
had to be inferred by heuristics based on keywords.

The analysis to determine which SPDX License Identifier to be applied to
a file was done in a spreadsheet of side by side results from of the
output of two independent scanners (ScanCode & Windriver) producing SPDX
tag:value files created by Philippe Ombredanne. Philippe prepared the
base worksheet, and did an initial spot review of a few 1000 files.

The 4.13 kernel was the starting point of the analysis with 60,537 files
assessed. Kate Stewart did a file by file comparison of the scanner
results in the spreadsheet to determine which SPDX license identifier(s)
to be applied to the file. She confirmed any determination that was not
immediately clear with lawyers working with the Linux Foundation.

Criteria used to select files for SPDX license identifier tagging was:
- Files considered eligible had to be source code files.
- Make and config files were included as candidates if they contained >5
lines of source
- File already had some variant of a license header in it (even if <5
lines).

All documentation files were explicitly excluded.

The following heuristics were used to determine which SPDX license
identifiers to apply.

- when both scanners couldn't find any license traces, file was
considered to have no license information in it, and the top level
COPYING file license applied.

For non */uapi/* files that summary was:

SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 11139

and resulted in the first patch in this series.

If that file was a */uapi/* path one, it was "GPL-2.0 WITH
Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was:

SPDX license identifier # files
---------------------------------------------------|-------
GPL-2.0 WITH Linux-syscall-note 930

and resulted in the second patch in this series.

- if a file had some form of licensing information in it, and was one
of the */uapi/* ones, it was denoted with the Linux-syscall-note if
any GPL family license was found in the file or had no licensing in
it (per prior point). Results summary:

SPDX license identifier # files
---------------------------------------------------|------
GPL-2.0 WITH Linux-syscall-note 270
GPL-2.0+ WITH Linux-syscall-note 169
((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21
((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17
LGPL-2.1+ WITH Linux-syscall-note 15
GPL-1.0+ WITH Linux-syscall-note 14
((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5
LGPL-2.0+ WITH Linux-syscall-note 4
LGPL-2.1 WITH Linux-syscall-note 3
((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3
((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1

and that resulted in the third patch in this series.

- when the two scanners agreed on the detected license(s), that became
the concluded license(s).

- when there was disagreement between the two scanners (one detected a
license but the other didn't, or they both detected different
licenses) a manual inspection of the file occurred.

- In most cases a manual inspection of the information in the file
resulted in a clear resolution of the license that should apply (and
which scanner probably needed to revisit its heuristics).

- When it was not immediately clear, the license identifier was
confirmed with lawyers working with the Linux Foundation.

- If there was any question as to the appropriate license identifier,
the file was flagged for further research and to be revisited later
in time.

In total, over 70 hours of logged manual review was done on the
spreadsheet to determine the SPDX license identifiers to apply to the
source files by Kate, Philippe, Thomas and, in some cases, confirmation
by lawyers working with the Linux Foundation.

Kate also obtained a third independent scan of the 4.13 code base from
FOSSology, and compared selected files where the other two scanners
disagreed against that SPDX file, to see if there was new insights. The
Windriver scanner is based on an older version of FOSSology in part, so
they are related.

Thomas did random spot checks in about 500 files from the spreadsheets
for the uapi headers and agreed with SPDX license identifier in the
files he inspected. For the non-uapi files Thomas did random spot checks
in about 15000 files.

In initial set of patches against 4.14-rc6, 3 files were found to have
copy/paste license identifier errors, and have been fixed to reflect the
correct identifier.

Additionally Philippe spent 10 hours this week doing a detailed manual
inspection and review of the 12,461 patched files from the initial patch
version early this week with:
- a full scancode scan run, collecting the matched texts, detected
license ids and scores
- reviewing anything where there was a license detected (about 500+
files) to ensure that the applied SPDX license was correct
- reviewing anything where there was no detection but the patch license
was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
SPDX license was correct

This produced a worksheet with 20 files needing minor correction. This
worksheet was then exported into 3 different .csv files for the
different types of files to be modified.

These .csv files were then reviewed by Greg. Thomas wrote a script to
parse the csv files and add the proper SPDX tag to the file, in the
format that the file expected. This script was further refined by Greg
based on the output to detect more types of files automatically and to
distinguish between header and source .c files (which need different
comment types.) Finally Greg ran the script using the .csv files to
generate the patches.

Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org>
Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bb3290d9 19-Aug-2017 Linus Torvalds <torvalds@linux-foundation.org>

Remove gperf usage from toolchain

It turns out that gperf-3.1 changed types in the generated code in ways
that aren't even trivially detectable without having to generate a test-file.

It's just not worth using tools and libraries from clowns that don't
understand or care about compatibility. So get rid of gperf.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# ff85a1a8 21-May-2017 Borislav Petkov <bp@suse.de>

kconfig: Check for libncurses before menuconfig

There is a check and a nice user-friendly message when the curses
library is not present on the system and the user wants to do "make
menuconfig". It doesn't get issued, though. Instead, we fail the build
when mconf.c doesn't find the curses.h header:

HOSTCC scripts/kconfig/mconf.o
In file included from scripts/kconfig/mconf.c:23:0:
scripts/kconfig/lxdialog/dialog.h:38:20: fatal error: curses.h: No such file or directory
#include CURSES_LOC
^
compilation terminated.

Make that check a prerequisite to mconf so that the user sees the error
message instead:

$ make menuconfig
*** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
scripts/kconfig/Makefile:203: recipe for target 'scripts/kconfig/dochecklxdialog' failed
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
Makefile:548: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2

Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>


# d3fc425e 30-Nov-2016 Nicolas Pitre <nico@fluxnic.net>

kbuild: make sure autoksyms.h exists early

Some people are able to trigger a race where autoksyms.h is used before
its empty version is even created. Let's create it at the same time as
the directory holding it is created.

Signed-off-by: Nicolas Pitre <nico@linaro.org>
Tested-by: Prarit Bhargava <prarit@redhat.com>
Tested-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 42f9d3c6 25-Jan-2016 Jan Beulich <JBeulich@suse.com>

scripts/kconfig: allow building with make 3.80 again

Documentation/Changes still lists this as the minimal required version,
so it ought to remain usable for the time being.

Fixes: d2036f30cf ("scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target")
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Michal Marek <mmarek@suse.com>


# 588446a8 01-Nov-2015 Thiago Macieira <thiago.macieira@intel.com>

Use pkg-config to find Qt 4 and 5 instead of direct qmake

The Qt Project recommendation is that there should always be a "qmake"
binary and it should never be renamed. If it's necessary to handle
multiple Qt versions, the Qt Project recommends using qtchooser.

Unfortunately, some distros do not follow the recommendation, so we
would need to check qmake-qt4, qmake-qt5, etc. So, instead, let's try
pkg-config.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Reported-by: Alexey Brodkin <abrodkin@synopsys.com>
Acked-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Michal Marek <mmarek@suse.com>


# bd960f09 14-Oct-2015 Michael Ellerman <mpe@ellerman.id.au>

scripts/kconfig/Makefile: Fix KBUILD_DEFCONFIG check when building with O=

My recent commit d2036f30cfe1 ("scripts/kconfig/Makefile: Allow
KBUILD_DEFCONFIG to be a target"), contained a bug in that when it
checks if KBUILD_DEFCONFIG is a file it forgets to prepend $(srctree) to
the path.

This causes the build to fail when building out of tree (with O=), and
when the value of KBUILD_DEFCONFIG is 'defconfig'. In that case we will
fail to find the 'defconfig' file, because we look in the build
directory not $(srctree), and so we will call Make again with
'defconfig' as the target. From there we loop infinitely calling 'make
defconfig' again and again.

The fix is simple, we need to look for the file under $(srctree).

Fixes: d2036f30cfe1 ("scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target")
Reported-by: Olof Johansson <olof@lixom.net>
Acked-by: Michal Marek <mmarek@suse.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>


# d1b0dc90 22-Sep-2015 Thiago Macieira <thiago.macieira@intel.com>

Update the buildsystem for KConfig finding Qt

The buildsystem will now only search for Qt 4 and Qt 5. Support for Qt 2
and 3 was dropped in the previous commits (Qt 3 was EOL'ed in 2010 or
so...).

For Qt 5, to be future-proof with the future direction notice appearing
in the 5.5 release, C++11 support is automatically enabled.

Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Signed-off-by: Michal Marek <mmarek@suse.com>


# 9bfda0ab 22-Sep-2015 Boris Barbulovski <bbarbulovski@gmail.com>

Port xconfig to Qt5 - Remove Qt3Support from Makefile.

Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com>
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Signed-off-by: Michal Marek <mmarek@suse.com>


# d2036f30 22-Sep-2015 Michael Ellerman <mpe@ellerman.id.au>

scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target

Arch Makefiles can set KBUILD_DEFCONFIG to tell kbuild the name of the
defconfig that should be built by default.

However currently there is an assumption that KBUILD_DEFCONFIG points to
a file at arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG).

We would like to use a target, using merge_config, as our defconfig, so
adapt the logic in scripts/kconfig/Makefile to allow that.

To minimise the chance of breaking anything, we first check if
KBUILD_DEFCONFIG is a file, and if so we do the old logic. If it's not a
file, then we call the top-level Makefile with KBUILD_DEFCONFIG as the
target.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Acked-by: Michal Marek <mmarek@suse.com>


# 6c668505 20-May-2015 Luis R. Rodriguez <mcgrof@suse.com>

kconfig: add xenconfig defconfig helper

This lets you build a kernel which can support xen dom0
or xen guests on i386, x86-64 and arm64 by just using:

make xenconfig

You can start from an allnoconfig and then switch to xenconfig.
This also splits out the options which are available currently
to be built with x86 and 'make ARCH=arm64' under a shared config.

Technically xen supports a dom0 kernel and also a guest
kernel configuration but upon review with the xen team
since we don't have many dom0 options its best to just
combine these two into one.

A few generic notes: we enable both of these:

CONFIG_INET=y
CONFIG_BINFMT_ELF=y

although technically not required given you likely will
end up with a pretty useless system otherwise.

A few architectural differences worth noting:

$ make allnoconfig; make xenconfig > /dev/null ; \
grep XEN .config > 64-bit-config
$ make ARCH=i386 allnoconfig; make ARCH=i386 xenconfig > /dev/null; \
grep XEN .config > 32-bit-config
$ make ARCH=arm64 allnoconfig; make ARCH=arm64 xenconfig > /dev/null; \
grep XEN .config > arm64-config

Since the options are already split up with a generic config and
architecture specific configs you anything on the x86 configs
are known to only work right now on x86. For instance arm64 doesn't
support MEMORY_HOTPLUG yet as such although we try to enabe it
generically arm64 doesn't have it yet, so we leave the xen
specific kconfig option XEN_BALLOON_MEMORY_HOTPLUG on x86's config
file to set expecations correctly.

Then on x86 we have differences between i386 and x86-64. The difference
between 64-bit-config and 32-bit-config is you don't get XEN_MCE_LOG as
this is only supported on 64-bit. You also do not get on i386
XEN_BALLOON_MEMORY_HOTPLUG, there does not seem to be any technical
reasons to not allow this but I gave up after a few attempts.

Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: penberg@kernel.org
Cc: levinsasha928@gmail.com
Cc: mtosatti@redhat.com
Cc: fengguang.wu@intel.com
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Julien Grall <julien.grall@linaro.org>
Acked-by: Michal Marek <mmarek@suse.cz>
Acked-by: David Rientjes <rientjes@google.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>


# 9bcd776d 20-May-2015 Luis R. Rodriguez <mcgrof@suse.com>

kconfig: clarify kvmconfig is for kvm

We'll be adding options for xen as well.

Cc: Josh Triplett <josh@joshtriplett.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: penberg@kernel.org
Cc: levinsasha928@gmail.com
Cc: mtosatti@redhat.com
Cc: fengguang.wu@intel.com
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Ian Campbell <Ian.Campbell@citrix.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: xen-devel@lists.xenproject.org
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Acked-by: David Rientjes <rientjes@google.com>
Acked-by: Borislav Petkov <bp@suse.de>
Acked-by: Michal Marek <mmarek@suse.cz>
Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>


# fa75a727 26-May-2015 Geert Uytterhoeven <geert+renesas@glider.be>

kconfig: Wrap long "make help" text lines

Some "make help" text lines extend beyond 80 characters. Wrap them at 79
characters.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 39c3f1ba 31-May-2015 Diego Viola <diego.viola@gmail.com>

scripts/kconfig/Makefile: Cosmetic fixes

Signed-off-by: Diego Viola <diego.viola@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 092373c2 06-Apr-2015 Diego Viola <diego.viola@gmail.com>

scripts/kconfig/Makefile: Fix spelling of Qt

Signed-off-by: Diego Viola <diego.viola@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 0a1f00a1 08-Apr-2015 Michal Marek <mmarek@suse.cz>

kconfig: Do not print status messages in make -s mode

Add an -s option to the various frontends and pass it when make -s is
used. Also, use $(kecho) instead of @echo in the Makefile.

Signed-off-by: Michal Marek <mmarek@suse.cz>


# 1cba0c30 08-Apr-2015 Michal Marek <mmarek@suse.cz>

kconfig: Simplify Makefile

Use a single rule for targets handled directly by the conf program.

Signed-off-by: Michal Marek <mmarek@suse.cz>


# 63a91033 13-Mar-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: add generic mergeconfig target, %.config

"scripts/kconfig/merge_config.sh && make oldconfig" works well
enough for merging local config fragments, but Kbuild currently has
the entry points only for "kvmconfig" and "tinyconfig".

This commit provides the generic target for mergeconfig, so we can
manage our own config fragments easily:
put "foo.config" in arch/$(SRCARCH)/configs/ or kernel/configs/,
and then run "make foo.config".

Now "make kvmconfig" is just a shorthand of "make kvm_guest.config".
Likewise, "make tinyconfig" is equivalent to
"make allnoconfig tiny.config".

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 371cfd4f 13-Mar-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: mergeconfig: remove redundant $(objtree)

Kbuild always runs in $(objtree). Actually, $(objtree) is always
set to "." by the top-level Makefile.

We can omit "-O $(objtree)" and "$(objtree)/".

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# b9fe99c5 13-Mar-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: mergeconfig: move an error check to merge_config.sh

Currently, "make tinyconfig" does not work with "-j" option.

$ make mrproper
$ make -j8 tinyconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTLD scripts/kconfig/conf
scripts/kconfig/conf --allnoconfig Kconfig
#
# configuration written to .config
#
scripts/kconfig/Makefile:122: *** You need an existing .config
for this target. Stop.
make: *** [tinyconfig] Error 2

As shown above, "allnoconfig" has created the .config file before
mergeconfig is called, but Make still raises a false alarm because
of some sort of race condition.

We can fix this issue by moving the error check to the shell script.

Anyway, scripts/kconfig/merge_config.sh always requires an existing
.config as a base file. It is reasonable to check its existence in
the shell script.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# de461993 13-Mar-2015 Masahiro Yamada <yamada.masahiro@socionext.com>

kbuild: mergeconfig: fix "jobserver unavailable" warning

If "make kvmconfig" is run with "-j" option, a warning message,
"jobserver unavailable: using -j1. Add `+' to parent make rule.",
is displayed.

$ make -s defconfig
*** Default configuration is based on 'x86_64_defconfig'
#
# configuration written to .config
#
$ make -j8 kvmconfig
Using ./.config as base
Merging ./arch/x86/configs/kvm_guest.config
[ snip ]
#
# merged configuration written to ./.config (needs make)
#
make[2]: warning: jobserver unavailable: using -j1. Add `+' to
parent make rule.
scripts/kconfig/conf --oldconfig Kconfig
[ snip ]
#
# configuration written to .config
#

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 7285996a 04-Jun-2014 Brian Norris <computersforpeace@gmail.com>

kconfig: nconfig: fix multi-byte UTF handling

Currently, Kconfig descriptions that use multi-byte UTF-8 characters
(such as MTD_NAND_CAFE) will have their menu entries dropped from the
'make nconfig' ncurses menu, and all subsequent entries in the same
window will be omitted. This seems to be due to the ncurses 'menu'
library, which does not traditionally handle UTF-8 >8-bit characters
properly.

The ncursesw library ('w' is for "wide") is written to handle these
UTF-8 characters, and is practically a drop-in replacement at the source
level. Use it by default, if available.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=43067
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Cc: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Martin Walch <walch.martin@web.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 221ecca6 19-Aug-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kbuild: remove redundant clean-files from scripts/kconfig/Makefile

Now mconf, qconf, gconf, nconf are always added to hostprogs-y.
Files added to hostprogs-y are removed by "make clean".

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 022af62d 19-Aug-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kbuild: refactor script/kconfig/Makefile

Now it is harmless to add all host programs to hostprogs-y.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 0da1d4a0 08-Aug-2014 Josh Triplett <josh@joshtriplett.org>

x86: Add "make tinyconfig" to configure the tiniest possible kernel

Since commit 5d2acfc7b974bbd3858b4dd3f2cdc6362dd8843a ("kconfig: make
allnoconfig disable options behind EMBEDDED and EXPERT") in 3.15-rc1,
"make allnoconfig" disables every possible config option.

However, a few configuration options (CC_OPTIMIZE_FOR_SIZE,
OPTIMIZE_INLINING) produce a smaller kernel when turned on, and a few
choices exist (compression, highmem, allocator) for which a non-default
option produces a smaller kernel.

Add a "tinyconfig" option, which starts from allnoconfig and then sets
these options to configure the tiniest possible kernel. This provides a
better baseline for embedded systems or efforts to reduce kernel size.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>


# 3aaefce1 06-Aug-2014 Josh Triplett <josh@joshtriplett.org>

x86, platform, kconfig: move kvmconfig functionality to a helper

The new mergeconfig helper makes it easier to add other partial
configurations similar to kvmconfig. Architecture-independent portions
of those partial configurations should go in
kernel/configs/${name}.config, and architecture-dependent portions
should go in arch/${arch}/configs/${name}.config.

Based on a patch by Luis R. Rodriguez <mcgrof@suse.com>.
Originally-Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com>

Modified to make the helper name more general than just virtualization,
support architecture-dependent and architecture-independent partial
configurations, move the helper and kvmconfig to
scripts/kconfig/Makefile, and factor out more of the common file path.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>


# 9815594a 28-May-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kbuild: create include/config directory in scripts/kconfig/Makefile

The directory include/config is used only for
silentoldconfig, localmodconfig, localyesconfig.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 7eb6e340 28-May-2014 Masahiro Yamada <yamada.m@jp.panasonic.com>

kbuild: trivial - remove trailing empty lines

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>


# 544e7e54 06-Mar-2013 Justin Lecher <jlec@gentoo.org>

kconfig: optionally use pkg-config to detect ncurses libs

When building ncurses with --with-termlib several symbols get moved from
libncurses.so to libtinfo.so. Thus when linking with libncurses.so, one
additionally needs to link with libtinfo.so.

The ncurses pkg-config module will be used to detect the necessary libs for
linking. If not available the old way of directly specifying libs will be
used.

Signed-off-by: Justin Lecher <jlec@gentoo.org>
[yann.morin.1998@free.fr: fix typo: '-ncurses' --> '-lncurses']
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>


# c2838e6e 21-Nov-2012 Yann E. MORIN <yann.morin.1998@free.fr>

scripts/kconfig: ensure we use proper CONFIG_ prefix

Now that we get the CONFIG_ prefix from the environment, we must
ensure we use the proper prefix in case the user has it set in
the environment.

Simply unexport CONFIG_ to fallback to our hard-coded default.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# fb16d891 31-Aug-2012 Adam Lee <adam8157@gmail.com>

kconfig: replace 'oldnoconfig' with 'olddefconfig', and keep the old name as an alias

As 67d34a6a391369269a2e5dba8a5f42cc4cd50231 said, 'oldnoconfig' doesn't
set new symbols to 'n', but instead sets it to their default values.

So, this patch replaces 'oldnoconfig' with 'olddefconfig', stop making
people confused, and keep the old name 'oldnoconfig' as an alias,
because people already are dependent on its behavior with the
counter-intuitive name.

Signed-off-by: Adam Lee <adam8157@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 67d34a6a 15-Jun-2012 Steven Rostedt <rostedt@goodmis.org>

kconfig: Document oldnoconfig to what it really does

The make target 'oldnoconfig' is a misnomer. It doesn't set new symbols
to 'n', but instead sets it to their default values.

Unfortunately, assuming that it actually did this, broke ktest in some
of its tests. For example, the tests to create a minimum config and even
a config bisect, depends on removing various configs and using
oldnoconfig to get rid of other configs that may have depended on it.

But because some configs that it was trying to disable, were in fact
default enabled, this caused those configs to re-enable and corrupt the
test.

I thought about fixing oldnoconfig, but I'm afraid that people are
already dependent on its current behavior. Instead, I'm just updating
the documentation to state that it sets the new symbols to their default
values and not to 'n'.

Ideally, this would be called, 'olddefconfig' and we have an
'oldnoconfig' that actually disables the new symbols. But it's useless
for me now. If it changed, ktest would need to be consistent between
each version, and that would be to difficult to detect. I'll handle this
issue with ktest with other means.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 5b580fa6 07-Jul-2012 Michal Marek <mmarek@suse.cz>

kconfig: Print errors to stderr in the Makefile

Signed-off-by: Michal Marek <mmarek@suse.cz>


# ebca026a 04-Jul-2012 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>

xconfig: add quiet rule for moc

Also add a dependency on .tmp_qtcheck for KC_QT_MOC.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 48485949 04-Jul-2012 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>

xconfig: use pkgconfig to find moc

Various schemes exist to allow parallel installations of multiple major
versions of Qt (4.x with the previous 3.x and/or the upcoming 5.x).
QtCore.pc includes a moc_location variable which should be a more reliable
way to find moc.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# e2aef4d3 18-Dec-2011 Peter Foley <pefoley2@verizon.net>

Improve update-po-config output

Make the V=0 output from update-po-config be aligned correctly.
Also remove an outdated comment and add a "GEN" statement.

Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# fa0ad657 04-Nov-2011 Paul Bolle <pebolle@tiscali.nl>

kconfig: adapt update-po-config to new UML layout

Commit 5c48b108 ("um: take arch/um/sys-x86 to arch/x86/um") broke the
make target update-po-config, as its symlink trick (again) fails.
(Previous breakage was fixed with commit bdc69ca4 ("kconfig: change
update-po-config to reflect new layout of arch/um").)

The new UML layout allows to drop the symlick trick entirely. And if,
one day, another architecture supports UML too, that should now work
without again breaking this make target.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 50bce3e8 01-Jul-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig/streamline_config.pl: merge local{mod,yes}config

The two targets `localmodconfig' and `localyesconfig' only differs from the
sed(1) ran on the result of `streamline_config.pl' to convert symbols set to
`modules' to `yes'. This conversion can be made directly from the perl script,
and thus avoid duplicating the command to generate the configuration.

Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>


# 22d550ae 19-Jul-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig/streamline_config.pl: use options to determine operating mode

The options introduced are --localmodconfig (default) and --localyesconfig.
They match the Makefile target behavior.

Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>


# f597a718 01-Jul-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig/streamline_config.pl: directly access LSMOD from the environment

Cc: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>


# 2f76b358 22-May-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig: regen parser

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>


# 378dbb2c 23-May-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig: migrate parser to implicit rules

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>


# 61f956f5 04-May-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig: constify `kconf_id_lookup'

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>


# 1ea3ad4e 05-Jun-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig/gconf: silent missing prototype warnings

As the `gconf' frontend is un-maintained, go the easy way by silencing
the "warning: no previous prototype for '<fn>'" warnings.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>


# 5a6f8d2b 01-Jun-2011 Arnaud Lacombe <lacombar@gmail.com>

kconfig: nuke LKC_DIRECT_LINK cruft

This interface is not (and has never been ?) used by any frontend, just get rid
of it.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>


# 2d80eb0f 26-Apr-2011 Peter Foley <pefoley2@verizon.net>

kconfig: quiet commands when V=0

Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# bdc69ca4 26-Apr-2011 Peter Foley <pefoley2@verizon.net>

kconfig: change update-po-config to reflect new layout of arch/um

Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# a24a1b8e 26-Apr-2011 Peter Foley <pefoley2@verizon.net>

kconfig: make update-po-config work in KBUILD_OUTPUT

Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# b24d7d7b 26-Apr-2011 Peter Foley <pefoley2@verizon.net>

kconfig: rearrange clean-files

Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# d02ab886 26-Apr-2011 Peter Foley <pefoley2@verizon.net>

kconfig: change gconf to modify hostprogs-y like nconf and mconf

Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# f1943049 26-Apr-2011 Peter Foley <pefoley2@verizon.net>

kconfig: change qconf to modify hostprogs-y like nconf and mconf

Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 1f594715 26-Apr-2011 Peter Foley <pefoley2@verizon.net>

kconfig: only build kxgettext when needed

Signed-off-by: Peter Foley <pefoley2@verizon.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 838a2e55 04-Sep-2010 Arnaud Lacombe <lacombar@gmail.com>

kbuild: migrate all arch to the kconfig mainmenu upgrade

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Michal Marek <mmarek@suse.cz>


# 458452f4 13-Sep-2010 Michal Marek <mmarek@suse.cz>

kconfig: Simplify Makefile for xconfig

Signed-off-by: Michal Marek <mmarek@suse.cz>


# 20f4ad8a 10-Sep-2010 Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>

Fix QT4 moc, cflags libs detection on dual QT3/Qt4 systems

On system with QT3 and QT4 qmake in PATH may be from QT3. So we use
pkg-config for proper QT4 detection.
By reqesting cflags and libs for either QtCore, QtGui and QtSupport include
dirs and libs get listed several times, but so we won't mis anything

Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 133c5f7c 31-Aug-2010 Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>

kconfig qconf: port to QT4

A straight forward port to QT4 using qt3to4 and compiling against
qt3support

* Use pkg-config to detect QT4 which is hopefully portable enough
* If no QT4, QT3 will by tried instead
* Classes renamed using qt3to4
* If build using QT3 renamed to QT3 class names using defines
* ConfigInfoView::menu has to be renamed as QT4 moc strips struct from
struct menu and creates a name conflict
* QT2 support has been dropped
* The hidden options inserted in 39a4897c1bb66e8a36043c105d7fd73d8b32b480
are use in native API

Signed-off-by: Alexander Stein <alexander.stein@informatik.tu-chemnitz.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 9ba95682 22-Aug-2010 Arnaud Lacombe <lacombar@gmail.com>

kbuild: don't overwrite HOST_EXTRACFLAGS

This might be used by the user to specify extra arguments for the host
compiler.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 7080e47b 15-Aug-2010 Arnaud Lacombe <lacombar@gmail.com>

kbuild: don't include `check-lxdialog' ldflags in global HOST_LOADLIBES

On BSD systems, `check-lxdialog' would select -lcurses as the default
curses library which would conflict with -lncurses at runtime: curses'
compatible symbols are getting handled by the system's curses library while the
ncurses-specific symbols are getting handled by the ports' ncurses.

This fixes `nconf' segmentation fault on these systems.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 7cf3d73b 31-Jul-2010 Sam Ravnborg <sam@ravnborg.org>

kconfig: add savedefconfig

savedefconfig will save a minimal config to a file
named "defconfig".

The config symbols are saved in the same order as
they appear in the menu structure so it should
be possible to map them to the relevant menus
if desired.

The implementation was tested against several minimal
configs for arm which was created using brute-force.

There was one regression related to default numbers
which had their valid range further limited by another symbol.

Sample:

config FOO
int "foo"
default 4

config BAR
int "bar"
range 0 FOO

If FOO is set to 3 then BAR cannot take a value higher than 3.
But the current implementation will set BAR equal to 4.

This is seldomly used and the final configuration is OK,
and the fix was non-trivial.
So it was documented in the code and left as is.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 0748cb3e 31-Jul-2010 Sam Ravnborg <sam@ravnborg.org>

kconfig: add alldefconfig

alldefconfig create a configuration with all values set
to their default value (form the Kconfig files).

This may be useful when we try to use more sensible default
values and may also be used in combination with
the minimal defconfigs.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 861b4ea4 31-Jul-2010 Sam Ravnborg <sam@ravnborg.org>

kconfig: change nonint_oldconfig to listnewconfig

Rename to a name that better match the other kconfig targets.

listnewconfig shall read as:

- list new options compared to current configuration

New options are now written to stdout so one can redirect the output.

Do not exit with an error code if there is new options.

These are feature changes compared to the original
nonint_oldconfig - but as this feature has not yet been in a
released kernel it should not matter.

It is still possible to do:

make listnewconfig
lookup new config options in Kconfig*
edit .config

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Aristeu Rozanski <aris@redhat.com>
Acked-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# ef61ca88 31-Jul-2010 Sam Ravnborg <sam@ravnborg.org>

kconfig: rename loose_nonint_oldconfig => oldnoconfig

Rename target to something that fall more in line
with the other kconfig targets.

oldnoconfig shall read as:

- read the old configuration and set all new options to no

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 4062f1a4 31-Jul-2010 Sam Ravnborg <sam@ravnborg.org>

kconfig: use long options in conf

The list of options supported by conf is growing
and their abbreviation did not resemble anything usefull.

So drop the single letter options in favour of long options.

The long options are named equal to what we know from
the make target.
The internal implmentation was changed to match this,
resulting in much more readable code.

Support for short options is dropped - no one is supposed
to call this program direct anyway.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# cbab05f0 27-May-2010 Richard Kennedy <richard@rsk.demon.co.uk>

gconfig: fix build failure on fedora 13

Making gconfig fails on fedora 13 as the linker cannot resolve dlsym.

Adding libdl to the link command fixes this.

make shows this error :-
/usr/bin/ld: scripts/kconfig/kconfig_load.o: undefined reference to symbol 'dlsym@@GLIBC_2.2.5'
/usr/bin/ld: note: 'dlsym@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 so try adding it to the linker command line
/lib64/libdl.so.2: could not read symbols: Invalid operation

tested on x86_64 fedora 13.

Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk>
Reviewed-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# f0778c8c 05-May-2010 Aristeu Rozanski <aris@redhat.com>

kconfig: introduce nonint_oldconfig and loose_nonint_oldconfig

This patch has been around for a long time in Fedora and Red Hat Enterprise
Linux kernels and it may be useful for others. The nonint_oldconfig target
will fail and print the unset config options while loose_nonint_oldconfig will
simply let the config option unset. They're useful in distro kernel packages
where the config files are built using a combination of smaller config files.

Arjan van de Ven wrote the initial nonint_config and Roland McGrath added the
loose_nonint_oldconfig.

Signed-off-by: Arjan van de Ven <arjan@redhat.com> [defunct email]
Whatevered-by: Kyle McMartin <kyle@redhat.com>
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
Acked-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Aristeu Rozanski <aris@redhat.com>
[mmarek: whitespace fixes]
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 3cebbb81 03-Feb-2010 Michal Marek <mmarek@suse.cz>

kconfig: Simplify LSMOD= handling

Signed-off-by: Michal Marek <mmarek@suse.cz>
LKML-Reference: <20100203162014.GA10956@sepie.suse.cz>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 615f0833 02-Feb-2010 Steven Rostedt <srostedt@redhat.com>

kconfig: Add LSMOD=file to override the lsmod for localmodconfig

Doing the following:

make LSMOD=file localmodconfig

Will make the streamline-config code use the given file instead of
lsmod. If the file is an executable, it will execute it, otherwise
it will read it as text.

make LSMOD=/my/local/path/lsmod localmodconfig

The above will execute the lsmod in /my/local/path instead of the
lsmods that may be located elsewhere.

make LSMOD=embedded_board_lsmod localmodconfig

The above will read the "embedded_board_lsmod" as a text file. This
is useful if you are doing a cross compile and need to run the
config against modules that exist on an embedded device.

Note, if the LSMOD= file does is not a path, it will add the
path to the object directory. That is, the above example will look
for "embedded_board_lsmod" in the directory that the binary will
be built in (the O=dir directory).

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>

On branch config/linus


# 692d97c3 24-Nov-2009 nir.tzachar@gmail.com <nir.tzachar@gmail.com>

kconfig: new configuration interface (nconfig)

This patch was inspired by the kernel projects page, where an ncurses
replacement for menuconfig was mentioned (by Sam Ravnborg).

Building on menuconfig, this patch implements a more modern look
interface using ncurses and ncurses' satellite libraries (menu, panel,
form). The implementation does not depend on lxdialog, which is
currently distributed with the kernel.

Signed-off-by: Nir Tzachar <nir.tzachar@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>


# 17263baf 06-Jan-2010 Steven Rostedt <srostedt@redhat.com>

kconfig: Create include/generated for localmodconfig

If someone downloads a brand new kernel and runs localmodconfig or
localyesconfig, the ending result will report:

*** Error during update of the kernel configuration.

This is because localmodconfig and localyesconfig must create the
include/generated directory to place the autoconf.h file.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 32197c7f 25-Nov-2009 Michal Marek <mmarek@suse.cz>

kbuild: create include/generated in silentoldconfig

The toplevel Makefile creates the directory if it runs silentoldconfig
automatically, but if run manually, it fails:

$ make mrproper
$ make defconfig && make silentoldconfig
*** Default configuration is based on 'x86_64_defconfig'
#
# configuration written to .config
#
scripts/kconfig/conf -s arch/x86/Kconfig

*** Error during update of the kernel configuration.
...

Move the mkdir command to the silentoldconfig target to make it work.

Signed-off-by: Michal Marek <mmarek@suse.cz>


# 463bf900 20-Nov-2009 Steven Rostedt <srostedt@redhat.com>

kconfig: Fix make O=<dir> local{mod,yes}config

When the output directory is something other than the kernel source,
the streamline_config script gets confused. This patch passes in the
source directory to the script so that it can find the proper files.

Reported-by: Peter Zijlstra <peterz@infradead.org>
Tested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 48586218 20-Aug-2009 Steven Rostedt <srostedt@redhat.com>

kconfig: add missing dependency of conf to localyesconfig

There's a dependency missing.

$ make localyesconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
using config: '/boot/config-2.6.27.25-78.2.56.fc9.x86_64'
/bin/sh: line 8: scripts/kconfig/conf: No such file or directory
make[1]: *** [localyesconfig] Error 127
make: *** [localyesconfig] Error 2

Thus the script failed to run. But the sed command that converts the '=m'
to '=y' still ran. This gives us a distro config with all modules
converted to built in!

The missing dependency was for conf for localyesconfig. This
dependency was already set for localmodconfig.

Reported-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# a7c02602 07-May-2009 Steven Rostedt <srostedt@redhat.com>

kconfig: test if a .config already exists

If one were to run localmodconfig or localyesconfig without having
a .config already in the file, then the end of the process would give
a warning when it tries to move the old .config to .config.old.

This patch adds a test to check if .config exists and avoid the moves
if it does not.

[ Impact: remove warning after make localmodconfig ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 281c9dad 29-Apr-2009 Steven Rostedt <srostedt@redhat.com>

kconfig: add make localyesconfig option

This adds the option localyesconfig to make. This is similar to
localmodconfig, but after it removes unnecessary modules it runs

sed -i s/=m/=y/

on the .config file. It then runs "make silentoldconfig" to fix any
wholes that were created by the conversion of modules to core.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 03fa25da 29-Apr-2009 Steven Rostedt <srostedt@redhat.com>

kconfig: make localmodconfig to run streamline_config.pl

Running the streamline_config.pl script manually can still be confusing
for some users. This patch adds the localmodconfig option. This will
automatically run streamline_config.pl on the current .config and
then run "make silentoldconfig" to fix any wholes that might have been
created.

$ make localmodconfig

This will remove any module configurations in .config that are not needed
to compile the modules that are loaded.

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>


# 590a5857 17-May-2009 Markus Heidelberg <markus.heidelberg@web.de>

kconfig: add a note about the deps to the 'silentoldconfig' help

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 6f26e5e4 17-May-2009 Markus Heidelberg <markus.heidelberg@web.de>

kconfig: fix typo "mconfig" to "menuconfig" in a comment

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 61bee204 25-Aug-2008 Al Viro <viro@zeniv.linux.org.uk>

x86, um: get rid of arch/um/Kconfig.arch

Teach scripts/kconfig/Makefile and top-level Makefile that arch/*/Makefile
is allowed to say Kconfig := <whatever I want instead of arch/blah/Kconfig>.
Rewrite arch/um/Kconfig and arch/um/Kconfig.<subarch> so that the latter
would be top-level one (and include the pieces of the former).

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>


# 4217516e 25-Apr-2008 Sam Ravnborg <sam@uranus.ravnborg.org>

kconfig: fix broken target update-po-config

Massimo Maiurana reported:
In the latest kernel "make update-po-config" fails because it tries
to open arch/Kconfig/Kconfig, since the ls command doesn't
distinguish between files and directories.

Cc: Massimo Maiurana <maiurana@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 46d26319 11-Jan-2008 EGRY Gabor <gaboregry1@t-online.hu>

kconfig: gettext support for gconfig

Gettext support for menu and toolbar.

Signed-off-by: Egry Gabor <gaboregry1@t-online.hu>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>


# 1020026f 11-Jan-2008 EGRY Gabor <gaboregry1@t-online.hu>

kconfig: update-po-config info

This patch adds tracking messages.

Signed-off-by: Egry Gabor <gaboregry1@t-online.hu>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Roman Zippel <zippel@linux-m68k.org>


# 6e588f6d 09-Dec-2007 Sam Ravnborg <sam@ravnborg.org>

kconfig: if ncurses-devel is missing then say so

With this patch when ncurses-devel (or whatever it is named)
is missing trying to run menuconfig will result in this:

$ make menuconfig
HOSTCC scripts/kconfig/conf.o
HOSTCC scripts/kconfig/kxgettext.o
*** Unable to find the ncurses libraries or the
*** required header files.
*** 'make menuconfig' requires the ncurses libraries.
***
*** Install ncurses (ncurses-devel) and try again.
***
make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1
make: *** [menuconfig] Error 2

Much better than before where we just listed some build errors.
The other *config targets will work indepenednt on ncurses
being present or not.

Includes improvements suggested by: Frans Pop <elendil@planet.nl>

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Frans Pop <elendil@planet.nl>


# daa93fab 12-Nov-2007 Sam Ravnborg <sam@ravnborg.org>

x86: enable "make ARCH=x86"

After unification of the Kconfig files and
introducing K64BIT support in kconfig
it required only trivial changes to enable
"make ARCH=x86".

With this patch you can build for x86_64 in several ways:
1) make ARCH=x86_64
2) make ARCH=x86 K64BIT=y
3) make ARCH=x86 menuconfig
=> select 64-bit

Likewise for i386 with the addition that
i386 is default is you say ARCH=x86.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>


# 47572387 25-Oct-2007 Sam Ravnborg <sam@ravnborg.org>

x86: move i386 and x86_64 Kconfig files to x86 directory

After a small change in kconfig Makefile we could
move all x86 Kconfig files to x86 directory.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# e703f75d 25-Oct-2007 Sam Ravnborg <sam@ravnborg.org>

kconfig: small code refactoring in kconfig Makefile

Do not hardcode the arch/$(ARCH)/Kconfig name all over

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 2266cfd5 25-Oct-2007 Sam Ravnborg <sam@ravnborg.org>

x86: move defconfig files for i386 and x86_64 to x86

With some small changes to kconfig makefile we can now
locate the defconfig files for i386 and x86_64 in
the configs/ subdirectory under x86.
make ARCH=i386 defconfig and make defconfig
works as expected also after this change.
But arch maintainers shall now update a defconfig file in
the configs/ directory.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# e9e40e14 15-Oct-2007 Rob Landley <rob@landley.net>

kconfig: comment typo in scripts/kconfig/Makefile.

Typo in comment in scripts/kconfig/Makefile.

Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# aa1e5ef5 12-Aug-2007 Sam Ravnborg <sam@ravnborg.org>

kbuild: check if we can link gettext not just compile

cygwin provides the header file but the lib file needs
to be added manually. A generic fix is to check if
we can compile and link a program that uses gettext()
and if it fails fall back to NO_NLS.

International users of cygwin may have to specify
HOST_LOADLIBES := "-lintl" on the make command line.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# b70e325c 10-Jun-2007 Sam Ravnborg <sam@ravnborg.org>

kconfig: fix update-po-config

Massimo Maiurana <maiurana@gmail.com> reported that
update-po-config was broken:
1) spelling errors in Makefile so arch/um failed
2) UTF-8 was not supported

The following patch address the above problems.
kxgettext now append the output to the .pot file
generated by xgettext - so we have a header.
In all places UFT-8 is specifed so we now flawlessly
support UTF-8.
The Kconfig files had an empty string in a few cases -
these are now supressed in kxgettext.

With this the translators can now pick up where they left
and get it all translated.
There are ~11000 strings to be translated...

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Massimo Maiurana <maiurana@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>


# 9ae57004 29-Apr-2007 Sam Ravnborg <sam@ravnborg.org>

kconfig: refer to qt3 if we cannot find qt libraries

We do not support qt4 (yet) so the simple fix was to warn
that qt3 are missing.
The better fix would have been to implment qt4 support
but that has failed so far.

This solves http://bugzilla.kernel.org/show_bug.cgi?id=8277

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 145c9047 01-Apr-2007 Sam Ravnborg <sam@neptun.ravnborg.org>

kbuild: remove kconfig binaries during make mrproper

Nigel Cunningham <nigel@nigel.suspend2.net> noticed
that 'make mrproper' did not remove mconf.
Fixed so we now remove all relevant binaries.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Nigel Cunningham <nigel@nigel.suspend2.net>


# c29121b7 02-Sep-2006 Sam Ravnborg <sam@neptun.ravnborg.org>

kbuild: do not build mconf & lxdialog unless needed

Due to a limitation in kbuild all objects referred
by xxx-y or xxx-objs will be build when one of
the targets needs to e build.

This caused lxdialog to be build pulling in ncurses
that is not always available.
So avoid building mconf & lxdialog unless really needed.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 903947d2 30-Jul-2006 Sam Ravnborg <sam@mars.ravnborg.org>

kconfig/lxdialog: fix make mrproper

No Makefile in scripts/kconfig/lxdialog anymore, so do not
go there during make mrproper.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 2982de69 27-Jul-2006 Sam Ravnborg <sam@mars.ravnborg.org>

kconfig/menuconfig: lxdialog is now built-in

lxdialog was previously called as an external program causing screen
to flicker when used. With this patch lxdialog is now built-in.
It is loosly based om previous work by: Petr Baudis <pasky@ucw.cz>

Following is a list of changes:
o Moved build of dialog routings to kconfig Makefile
o menubox + checklist uses a new item list to hold all menu items
o in util.c implmented helper function to deal with item list
o menubox now uses parameters to save scroll state (avoids temp file)
o textbox now get text to be displayed as parameter and not a file
o make sure to properly delete subwin's before main windows
o killed unused files: lxdialog.c msgbox.c
o modified return value for ESC to match direct calling
o in a few places the code has been adjusted to 80 char wide
o in textbox a small refactoring was made to make code remotely readable
o in mconf removed all unused stuff (functions/variables)

Following is a list of know short comings:
a) pressing ESC twice will be interpreted as two ESC presses
b) resize does not work. menuconfig needs to be restarted to be adjusted

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# b32c8268 10-Sep-2006 Robert P. J. Day <rpjday@mindspring.com>

kbuild: update help in top level Makefile

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 4f193362 05-Mar-2006 Paul Smith <psmith@gnu.org>

kbuild: change kbuild to not rely on incorrect GNU make behavior

The kbuild system takes advantage of an incorrect behavior in GNU make.
Once this behavior is fixed, all files in the kernel rebuild every time,
even if nothing has changed. This patch ensures kbuild works with both
the incorrect and correct behaviors of GNU make.

For more details on the incorrect behavior, see:

http://lists.gnu.org/archive/html/bug-make/2006-03/msg00003.html

Changes in this patch:
- Keep all targets that are to be marked .PHONY in a variable, PHONY.
- Add .PHONY: $(PHONY) to mark them properly.
- Remove any $(PHONY) files from the $? list when determining whether
targets are up-to-date or not.

Signed-off-by: Paul Smith <psmith@gnu.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# e11f0496 25-Feb-2006 Jesper Juhl <jesper.juhl@gmail.com>

kbuild: small update of allnoconfig description

'allnoconfig' is described by 'make help' as a "minimal config", that's not
strictly correct. To be pedantic, a minimal config would be one where
EMBEDDED was set to Y and most things therein disabled etc. Simply
answering 'no' to all options does not give a minimal config.
A better description of allnoconfig is that it answers all options with 'no'.

This patch updates the description.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 15508d22 09-Feb-2006 Linus Torvalds <torvalds@g5.osdl.org>

Revert "[PATCH] kconfig: detect if -lintl is needed when linking conf,mconf"

This reverts commit 5e375bc7d586e0df971734a5a5f1f080ffd89b68.

Kyle McMartin steps on his soap-box:

"Sigh. Can everyone please stop assuming gcc can output to /dev/null?
On several platforms, ld tries to lseek in the output file, and fails
if it can't."

Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 5e375bc7 05-Feb-2006 Robb, Sam <sam.robb@timesys.com>

[PATCH] kconfig: detect if -lintl is needed when linking conf,mconf

On a system where libintl.h is present, but the NLS functionality is
supplied by a separate library instead of the system C library, an attempt
to "make config" or "make menuconfig" will fail with link errors, ex:

scripts/kconfig/mconf.o:mconf.c:(.text+0xf63): undefined reference to
`_libintl_gettext'

This patch attempts to correct the problem by detecting whether or not NLS
support requires linking with libintl.

Signed-off-by: Samuel J Robb <sam.robb@timesys.com>
Cc: Roman Zippel <zippel@linux-m68k.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 37193147 02-Jan-2006 Adrian Bunk <bunk@stusta.de>

kconfig: fix gconfig with POSIXLY_CORRECT=1

This patch fixed "make gconfig" with POSIXLY_CORRECT=1 set.

This issue was reported by Jens Elkner <elkner@linofee.org> in kernel
Bugzilla #2919.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 6f6046cf 16-Dec-2005 Sam Ravnborg <sam@mars.ravnborg.org>

kconfig: move lxdialog to scripts/kconfig/lxdialog

The only lxdialog user i kconfig - for menuconfig.
So move it to reflect this.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# b3a5225f 21-Nov-2005 Roman Zippel <zippel@linux-m68k.org>

[PATCH] prefer pkg-config for the QT check

This makes pkg-config now the prefered way to configure QT and properly
fixes the recent Fedora breakage and leaves the old QT detection as
fallback mechanism.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 7a88488b 08-Nov-2005 Roman Zippel <zippel@linux-m68k.org>

[PATCH] kconfig: use gperf for kconfig keywords

Use gperf to generate a hash for the kconfig keywords. This greatly reduces
the size of the generated scanner and makes it easier to extend kconfig.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 491d7110 08-Nov-2005 Roman Zippel <zippel@linux-m68k.org>

[PATCH] kconfig: update kconfig Makefile

Remove the long obsolete zconf.tab.h and fix kconfig make rules to generate
the correct output files. Setting LKC_GENPARSER will now also update the
shipped files.

Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 4ecc65e4 07-Nov-2005 Yuri Vasilevski <yvasilev@imap.cc>

[PATCH] typo correction for fix-build-on-nls-free-systems

A typo fix for fix-build-on-nls-free-systems.patch that caused all systems
to be detected as not having NLS.

Signed-off-by: Yuri Vasilevski <yvasilev@duke.math.cinvestav.mx>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# ab919c06 06-Nov-2005 Sam Ravnborg <sam@mars.ravnborg.org>

kconfig: fix xconfig on fedora 2 & 3 (x86_64)

From: Than Ngo <than@redhat.com>
qt as installed on fedora core (2 and 3) does not work with vanilla
kernel. The linker fails to locate the qt lib:

Actual Results: # make xconfig
HOSTLD scripts/kconfig/qconf
/usr/bin/ld: cannot find -lqt
collect2: ld returned 1 exit status

Than Ngo has provided following fix for the bug.

Cc: Than Ngo <than@redhat.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>


# 70a6a0cb 30-Oct-2005 Yuri Vasilevski <yvasilev@duke.math.cinvestav.mx>

[PATCH] fix build on nls free systems

I made a patch that detects if libintl.h (needed for nls) is present on the
host system and if it's not, it nls support is disabled by providing
dummies for the used nls functions.

This way if there is nls support on the host system the *config targets
will build according to Arnaldo Carvalho de Melo's i18n modifications, else
it just uses the original English messages.

I have also made a bug report at kernel's bugzilla:
http://bugzilla.kernel.org/show_bug.cgi?id=5501
And there is a discussion about this problem in Gentoo's bugzilla:
http://bugs.gentoo.org/show_bug.cgi?id=99810

Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 720d6c29 03-Sep-2005 Egry Gabor <gaboregry@t-online.hu>

[PATCH] kconfig: linux.pot for all arch

The 'make update-po-config' creates the .pot file for the default arch. This
patch enhances it with all arch.

Signed-off-by: Egry Gabor <gaboregry@t-online.hu>
Cc: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Cc: Roman Zippel <zippel@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 3b9fa093 05-May-2005 Arnaldo Carvalho de Melo <acme@ghostprotocols.net>

[PATCH] Kconfig i18n support

This patch adds i18n support for make *config, allowing users to have the
config process in their own language.

No printk was harmed in the process, don't worry, so all the bug reports,
kernel messages, etc, remain in english, just the user tools to configure
the kernel are internationalized.

Users not interested in translations can just unset the related LANG,
LC_ALL, etc env variables and have the config process in plain english,
something like:

LANG= make menuconfig

is enough for having the whole config process in english. Or just don't
install any translation file.

Translations for brazilian portuguese are being done by a team of
volunteers at:

http://www.visionflex.inf.br/kernel_ptbr/pmwiki.php/Principal/Traducoes

To start the translation process:

make update-po-config

This will generate the pot template named scripts/kconfig/linux.pot,
copy it to, say, ~/es.po, to start the translation for spanish.

To test your translation, as root issue this command:

msgfmt -o /usr/share/locale/es/LC_MESSAGES/linux.mo ~/es.po

Replace "es" with your language code.

Then execute, for instance:

make menuconfig

The current patch doesn't use any optimization to reduce the size of the
generated .mo file, it is possible to use the config option as a key, but
this doesn't prevent the current patch from being used or the translations
done under the current scheme to be in any way lost if we chose to do any
kind of keying.

Thanks to Fabricio Vaccari for starting the pt_BR (brazilian portuguese)
translation effort, Thiago Maciera for helping me with the gconf.cc (QT
frontent) i18n coding and to all the volunteers that are already working on
the first translation, to pt_BR.

I left the question on whether to ship the translations with the stock kernel
sources to be discussed here, please share your suggestions.

Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org
Signed-off-by: Andrew Morton <akpm@osdl.org>


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!