aboutsummaryrefslogtreecommitdiff
path: root/package/pkg-kconfig.mk
Commit message (Collapse)AuthorAgeFilesLines
* core/pkg-kconfig: fix configuratorsGravatar Yann E. MORIN2015-08-251-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the configurators are using $($(2)_MAKE_ENV), often derived from $(TARGE_MAKE_ENV), as the environment to be set when calling the various configurators. This means that our host tools are used first, most notably pkg-config (from host-pkgconf). However, this is inherently flawed. Our pkg-config, when set for the host, only searches .pc files in $(HOST_DIR) and never ever uses the ones from the host. For example, since we do not build a host-qt, our pkg-config would not find the host's QtCore.pc et al. Consequently, on some systems (but not on others?) most of the configurators fail to build, especially the latest kernel versions, as they have been starting to use pkg-config two years ago. Fix that by filtering-out sensible values out of the environment, but only when calling the configurators. [Thomas: rewrap comment to appropriate length.] Reported-by: Mauro Condarelli <mc5686@mclink.it> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Mauro Condarelli <mc5686@mclink.it> Tested-by: Mauro Condarelli <mc5686@mclink.it> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* core/pkg-kconfig: do not override @DGravatar Yann E. MORIN2015-07-221-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we override @D for the kconfig configurators, so the fixup commands can use $(@D); otherwise @D would be simply '.' because it is not a real file in the package build dir. However, this breaks the soon-to-be-introduced linux-backports package, which needs to have a dependency on the linux package to be configured. The underlying reason is that @D is an automatic variable that is always set by make to the directory part of the target of the rule. However, automatic variables loose their "automatic" property when they are manually set. Furthermore, a variable that is defined for a rule is inherited by all dependencies of that rule, so our manually-set @D is inherited all the way down the dependency chain of linux-backports, down to the linux' own .config rule, which is thus run with @D pointing to linux-backports' build dir, not linux'. Fix that by using a "static pattern rule", redirecting the configurators to an intermediate stamp-like file which path is in the package build dir, so we get a valid @D from the onset, without having to manually fiddle with it. Thanks to Arnout for suggesting that in the first place. Sorry I did reject it as "too complex" when it was in fact the best solution. Suggested-by: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* core/pkg-kconfig: do not always silence oldconfigGravatar Yann E. MORIN2015-07-201-2/+2
| | | | | | | | | | | | | | | When debugging packages that use the pkg-kconfig infrastructure, it is sometime interesting to see the exact command line that is being executed when running oldconfig. But currently, those command lines are prefixed with '@' which makes them silent, always. Instead, use $(Q) so they are silent by default, and verbose with V=1. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* core/pkg-kconfig: don't enforce check for config file when not buildingGravatar Yann E. MORIN2015-07-141-0/+2
| | | | | | | | | | | | Currently, this is triggering the error message: make randconfig make source Only limit the check to enforce a config file being set to when we are actually building, like is done in the various kconfig-using packages. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* core/pkg-kconfig: allow saving config to a non-existing custom config fileGravatar Yann E. MORIN2015-06-281-5/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A very interesting use-case for a kconfig-based package is to create a custom (def)config file based on one bundled with the package itself, like described in PR-8156: make menuconfig -> enable kernel, use an in-tree defconfig, save and exit make linux-menuconfig -> enable/disable whatever option, save and exit make menuconfig -> change to use a custom defconfig file, set a path, save and exit make linux-update-config -> should save to the new custom defconfig file However, that is currently not possible, because the dependency chain when saving the configuration goes back up to the (newly-set!) custom (def)config file, which does not exist. So, we break the dependency chain so that saving the configuration does not depend on that file. Instead, we use a terminal rule that checks that the configuration has indeed been done, and fails if not. Closes #8156. Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* core/pkg-kconfig: run the kconfig fixups after exiting configuratorsGravatar Yann E. MORIN2015-06-281-0/+13
| | | | | | | | | | | | | | | | | | | | | After we exit the configurators, we need to re-run the kconfig fixups to ensure the user is not able to override them in the configurators. Currently, we schedule that "for later", by removing the corresponding stamp file, so make will run the fixups "later". This means the user has access to the un-fixed .config file, which he might decide to copy and use as a reference (not too bad, since we'd run the fixups anyway; but not clean either). Note that we still remove the stamp file before running the fixups, in case any one of those fixups breaks, so we don't want to believe the fixups have been applied; the fixup macro will touch that file anyway. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* core/pkg-kconfig: move the kconfig fixups to a macroGravatar Yann E. MORIN2015-06-281-2/+6
| | | | | | | | | | The same fixups will have to be done after leaving the configurators, so we want to commonalise that code. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* core/pkg-kconfig: ensure kconfig base and fragment files existGravatar Yann E. MORIN2015-06-281-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though we do have a dependency chain back to each of the kconfig base and fragment files: $$($(2)_DIR)/.config: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES) we can't rely on it to ensure they are all present, because they all have this rule: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES): | $(1)-patch but since this rule has no prerequisite (only build-order, but that does not count in this case) and no recipe, make will believe each missing file to be a PHONY target, and will always run targets that depend on it: https://www.gnu.org/software/make/manual/make.html#Force-Targets So, that means a missing kconfig base or fragment file would always cause the rule to generate .config to be run at each invocation, which in turn would cause a rebuild of the kernel, which is clearly not what we want. Since this is expected make behaviour, we can well end up with a missing Kconfig base or fragment. To avoid continuously rebuilding the kernel in that case, we must check those files exist by ourselves, and error out if any one of them is missing. One would expect we check for them right in their dependency rule, like so: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES): | $(1)-patch [ -f $(@) ] || {echo Missing $(@) >&2; exit 1; } but that does not work, as only the first target is tested for. That check msut be turned into a loop explicitly testing all files, like so: $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES): | $(1)-patch for f in $$($(2)_KCONFIG_FILE) $$($(2)_KCONFIG_FRAGMENT_FILES); do \ [ -f $(@) ] || {echo Missing $$$${f} >&2; exit 1; }; \ done Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Floris Bos <bos@je-eigen-domein.nl> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* core/pkg-kconfig: extract package before using kconfig fragmentsGravatar Yann E. MORIN2015-06-281-3/+3
| | | | | | | | | | | Kconfig fragments may be present in the package, so we need to extract and patch it before we can use the fragments. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Floris Bos <bos@je-eigen-domein.nl> Cc: Thomas De Schampheleire <patrickdepinguin@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* infra/pkg-kconfig: require an non-empty KCONFIG_FILEGravatar Yann E. MORIN2015-06-101-1/+1
| | | | | | | | | | | | | | | | Currently, we only check that the variable is defined, which is not enough since we really want it to be non-empty. We however can't check it points to an existing file, because the package might well not be extracted yet, and we may use an internal defconfig. If that file does not eventually exist, there will be a failure down the road at build time when we try to copy it... 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> Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* kconfig-package: add support for config fragmentsGravatar Floris Bos2015-05-211-4/+10
| | | | | | | | | | | | | | | | | | | | | | | Adds functionality to the kconfig infrastructure to merge additional configuration fragment files to the main configuration file of kconfig packages, using support/kconfig/merge_config.sh Typical use-case is when you want your configuration to be kept in sync with an upstream (def)config file, but do require some minor local modifications. Disables -update-config and -update-defconfig targets when fragment files are set. [Thomas: take into account comments made by Arnout: - Minor fixes in the documentation changes - Add @ before the tests done in the $(1)-update-config and $(1)-update-defconfig targets.] Signed-off-by: Floris Bos <bos@je-eigen-domein.nl> Tested-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Tested-by: Gergely Imreh <imrehg@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* pkg-kconfig: declare phony targets as suchGravatar Thomas Petazzoni2015-04-141-0/+6
| | | | | | | | | 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>
* infra/pkg-kconfig: don't require a kconfig file for disabled packagesGravatar Yann E. MORIN2015-04-081-5/+5
| | | | | | | | | | | | | | | | | | 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>
* kconfig infra: only provide foo-*config targets when the package is enabledGravatar Yann E. Morin2015-02-141-0/+8
| | | | | | 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>
* kconfig infra: remove all install stamp filesGravatar Thomas De Schampheleire2015-02-141-1/+1
| | | | | | | | | 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>
* kconfig infra: make update-config/defconfig handling symmetricalGravatar Thomas De Schampheleire2015-02-141-1/+4
| | | | | | | | | | 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>
* kconfig infra: add support for defconfig filesGravatar Thomas De Schampheleire2015-02-141-0/+17
| | | | | | | | | | 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>
* kconfig infra: support built-in config filesGravatar Thomas De Schampheleire2015-02-141-1/+5
| | | | | | | | | | 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>
* infra/pkg-kconfig: fix saving the config fileGravatar Yann E. MORIN2014-10-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* packages: rename FOO_KCONFIG_OPT into FOO_KCONFIG_OPTSGravatar Thomas De Schampheleire2014-10-041-3/+3
| | | | | | | | | | | | 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>
* infra/pkg-kconfig: incorporate oldconfig call to avoid endless rebuildsGravatar Thomas De Schampheleire2014-08-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* infra/pkg-kconfig: join comments to the related code-blockGravatar Yann E. MORIN2014-08-061-7/+0
| | | | | | | | | | | | 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>
* infra: introduce a kconfig-package infrastructureGravatar Thomas De Schampheleire2014-08-041-0/+82
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>