Commit graph

12 commits

Author SHA1 Message Date
Thomas Petazzoni f1e843864f pkg-kconfig: declare phony targets as such
Just like the previous commit did for the pkg-generic infrastructure,
this commit improves the pkg-kconfig infrastructure to declare its
custom <pkg>-<something> targets as PHONY.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
2015-04-14 10:12:24 +02:00
Yann E. MORIN b85bdae04d infra/pkg-kconfig: don't require a kconfig file for disabled packages
When a package is not enabled, we need not check that it provides
a .config/defconfig file.

So far, all our pkg-kconfig packages unconditionally set their
_KCONFIG_FILE, even to an empty value. But some packages (e.g.
at91bootstrap3) wanted to set it only when enabled, and broke.

So, only do the check when the package is enabled.

Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-08 22:29:58 +02:00
Yann E. Morin d1f94bf403 kconfig infra: only provide foo-*config targets when the package is enabled
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-14 16:37:11 +01:00
Thomas De Schampheleire d9fec0ad76 kconfig infra: remove all install stamp files
Some packages (like linux) may install things inside images/ as well, so
remove the associated stamp file after running the configuration editor.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-14 16:34:26 +01:00
Thomas De Schampheleire 1941386c3d kconfig infra: make update-config/defconfig handling symmetrical
Replace a 'cp --preserve' with a 'touch --reference' so that the code
for foo-update-config and foo-update-defconfig is symmetrical to ease
maintainability and increase clarity.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-14 16:34:04 +01:00
Thomas De Schampheleire 39867f3c8c kconfig infra: add support for defconfig files
This commit adds support for using a defconfig file instead of a full
.config. This is a precondition to migrate packages like linux and
barebox to the kconfig infrastructure.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-14 16:33:45 +01:00
Thomas De Schampheleire 23fd6e0e6a kconfig infra: support built-in config files
When the configuration file of a package is located inside of the
package sources, a make dependency can only be expressed after the
package has been extracted (and patched).

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: "Yann E. Morin" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-02-14 16:32:23 +01:00
Yann E. MORIN 8201c362d7 infra/pkg-kconfig: fix saving the config file
When saving (aka updating) the configuration file of a kconfig package,
a subsequent call to "make" would rebuild the package, even though the
configuration did not actually change.

It took quite a while to understand why. But the reason is so simple and
obvious, when you think about it:

  - $(@D)/.config depends on the config file $(BUSYBOX_CONFIG_FILE)
  - busybox-update-config then copies $(@D)/.config back to the config
    file $(BUSYBOX_CONFIG_FILE)
  - so the config file is newer than $(@D)/.config

So, in the next run, pkg-kconfig believes that it has to rebuild
busybox. Bummer... :-/

So, the fix is very trivial, and just requires asking "cp" to preserve
timestamps, so the dependency does not kick in at the next run.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com>
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-22 22:49:42 +02:00
Thomas De Schampheleire 146f7dc495 packages: rename FOO_KCONFIG_OPT into FOO_KCONFIG_OPTS
To be consistent with the recent change of FOO_MAKE_OPT into FOO_MAKE_OPTS,
make the same change for FOO_KCONFIG_OPT.

Sed command used:
   find * -type f | xargs sed -i 's#_KCONFIG_OPT\>#&S#g'

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-10-04 18:54:54 +02:00
Thomas De Schampheleire fdc5ad1588 infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuilds
The configure step of the busybox package performs 'make oldconfig', which
causes the .config file to be updated. Thus, the .config file is more recent
than our stamp file .stamp_kconfig_fixup_done. On a subsequent build, our
dependency rules would kick in, and run the config fixup again, thus
kicking in the package's configure, build and install steps yet once
more, that, ad infinitum.

One solution is to modify kconfig-package to introduce an explicit touch of
the .kconfig_fixup_config_done stamp file, as post-configure hook.

Another solution, implemented by this patch, is to move the oldconfig call
from the package's .mk file to the kconfig-package infrastructure and make
sure it is done as part of the fixup commands. This way, the stamp file will
only be touched once, after the full fixup (including oldconfig) and no
endless rebuilds will occur.

Reported-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Suggested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-06 19:57:22 +02:00
Yann E. MORIN 095f2e98b3 infra/pkg-kconfig: join comments to the related code-block
The current layout of comments wrt. to the related code-blocks is a bit
hard to handle visually.

Remove empty lines between the comments and their respective related
code-blocks.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-06 19:57:01 +02:00
Thomas De Schampheleire abb8a8dae4 infra: introduce a kconfig-package infrastructure
There are several packages that have a configuration file managed by
kconfig: uclibc, busybox, linux and barebox. All these packages need some
make targets to handle the kconfig specificities: creating a configuration
(menuconfig, ...) and saving it back (update-config, ...)

These targets should be the same for each of these packages, but
unfortunately they are not. Especially with respect to saving back the
configuration to the original config file, there are many differences.

A previous set of patches fixed these targets for the uclibc package.
This patch extracts these targets into a common kconfig-package
infrastructure, with the goals of:
- aligning the behavior of all kconfig-based packages
- removing code duplication

In order to use this infrastructure, a package should at a minimum specify
FOO_KCONFIG_FILE and eval the kconfig-package macro. The supported
configuration editors can be set with FOO_KCONFIG_EDITORS and defaults to
menuconfig only.
Additionally, a package can specify FOO_KCONFIG_OPT for extra options to
pass to the invocation of the kconfig editors, and FOO_KCONFIG_FIXUP_CMDS
for a list of shell commands used to fixup the .config file after a
configuration has been created/edited.

Signed-off-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
[yann.morin.1998@free.fr: add missing 4th argument when calling to
 inner-kconfig-package (namely, 'target']
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2014-08-04 09:53:30 +02:00