blob: 1e69a317beb339e49edc0fa1a35fef85e88f2b91 [file] [log] [blame]
--- a/scripts/config/Makefile
+++ b/scripts/config/Makefile
@@ -90,6 +90,10 @@ quiet_cmd_moc = MOC $@
$(obj)/%.moc: $(src)/%.h $(obj)/qconf-cfg
$(call cmd,moc)
+# aconf: Used for defconfig merging and incremental subtraction
+hostprogs-y += aconf
+aconf-objs := aconf.o $(common-objs)
+
# check if necessary packages are available, and configure build flags
filechk_conf_cfg = $(CONFIG_SHELL) $<
@@ -138,3 +142,5 @@ nconf: nconf-cfg $(nconf-objs)
qconf: qconf-cfg $(qconf-cxxobjs) $(qconf-objs)
$(CXX) -o $@ $(filter-out qconf-cfg,$^) $(HOSTLDLIBS_qconf)
+
+aconf: $(aconf-objs)
--- a/scripts/config/confdata.c
+++ b/scripts/config/confdata.c
@@ -231,7 +231,7 @@ static const char *conf_get_autoconfig_name(void)
return name ? name : "include/config/auto.conf";
}
-static int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
+int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p)
{
char *p2;
@@ -313,7 +313,7 @@ static int add_byte(int c, char **lineptr, size_t slen, size_t *n)
return 0;
}
-static ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream)
+ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream)
{
char *line = *lineptr;
size_t slen = 0;
@@ -633,7 +633,7 @@ kconfig_print_comment(FILE *fp, const char *value, void *arg)
}
}
-static struct conf_printer kconfig_printer_cb =
+struct conf_printer kconfig_printer_cb =
{
.print_symbol = kconfig_print_symbol,
.print_comment = kconfig_print_comment,
@@ -713,8 +713,8 @@ static struct conf_printer header_printer_cb =
.print_comment = header_print_comment,
};
-static void conf_write_symbol(FILE *fp, struct symbol *sym,
- struct conf_printer *printer, void *printer_arg)
+void conf_write_symbol(FILE *fp, struct symbol *sym,
+ struct conf_printer *printer, void *printer_arg)
{
const char *str;
--- a/scripts/config/lkc.h
+++ b/scripts/config/lkc.h
@@ -51,12 +51,17 @@ const char *zconf_curname(void);
extern int recursive_is_error;
/* confdata.c */
+extern struct conf_printer kconfig_printer_cb;
const char *conf_get_configname(void);
void sym_set_change_count(int count);
void sym_add_change_count(int count);
bool conf_set_all_new_symbols(enum conf_def_mode mode);
void conf_rewrite_mod_or_yes(enum conf_def_mode mode);
void set_all_choice_values(struct symbol *csym);
+int conf_set_sym_val(struct symbol *sym, int def, int def_flags, char *p);
+ssize_t compat_getline(char **lineptr, size_t *n, FILE *stream);
+void conf_write_symbol(FILE *fp, struct symbol *sym,
+ struct conf_printer *printer, void *printer_arg);
/* confdata.c and expr.c */
static inline void xfwrite(const void *str, size_t len, size_t count, FILE *out)
@@ -118,6 +123,7 @@ struct property *sym_get_range_prop(struct symbol *sym);
const char *sym_get_string_default(struct symbol *sym);
struct symbol *sym_check_deps(struct symbol *sym);
struct symbol *prop_get_symbol(struct property *prop);
+unsigned strhash(const char *s);
static inline tristate sym_get_tristate_value(struct symbol *sym)
{
--- a/scripts/config/symbol.c
+++ b/scripts/config/symbol.c
@@ -770,7 +770,7 @@ bool sym_is_changeable(struct symbol *sym)
return sym->visible > sym->rev_dep.tri;
}
-static unsigned strhash(const char *s)
+unsigned strhash(const char *s)
{
/* fnv32 hash */
unsigned hash = 2166136261U;