diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-04-03 20:01:38 +0200 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2015-04-06 23:52:57 +0200 |
commit | f78a09b60c4ce24e2455615722dd6ed8e2ba85e2 (patch) | |
tree | 6ba23110d3abe24443934686abe609caad6ffc1f /util/kconfig/zconf.l | |
parent | 1f5349e61d8aea950d6a197d11b0aa730aa80ee6 (diff) | |
download | coreboot-f78a09b60c4ce24e2455615722dd6ed8e2ba85e2.tar.xz |
kconfig: Add wildcard support for "source"
Kconfig's include directive "source" does not support
wildcards (e.g. source src/mainboard/*/Kconfig) which
makes automatic inclusion of all boards a tedious task
and prevents us from implementing "drop in" boards.
In our Makefile.inc files we already include mainboard
directories per wildcard, so let's add the infrastructure
to do the same with Kconfig.
Change-Id: I1988ff6ce3e167e86bb5cb65fc04a13748599dad
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: http://review.coreboot.org/9294
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
Diffstat (limited to 'util/kconfig/zconf.l')
-rw-r--r-- | util/kconfig/zconf.l | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/util/kconfig/zconf.l b/util/kconfig/zconf.l index 6c62d93b4f..b19e4de43c 100644 --- a/util/kconfig/zconf.l +++ b/util/kconfig/zconf.l @@ -13,6 +13,7 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> +#include <wordexp.h> #include "lkc.h" @@ -336,6 +337,21 @@ void zconf_nextfile(const char *name) current_file = file; } +void zconf_nextfiles(const char *wildcard) +{ + wordexp_t p; + char **w; + int i; + + wordexp(wildcard, &p, 0); + w = p.we_wordv; + + for (i = p.we_wordc - 1; i >= 0; i--) + zconf_nextfile(w[i]); + + wordfree(&p); +} + static void zconf_endfile(void) { struct buffer *parent; |