Skip to content

Commit

Permalink
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/mmarek/kbuild

Pull kconfig updates from Michal Marek:
 "Here is the kconfig stuff for v4.1-rc1:

   - fixes for mergeconfig (used by make kvmconfig/tinyconfig)

   - header cleanup

   - make -s *config is silent now"

* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  kconfig: Do not print status messages in make -s mode
  kconfig: Simplify Makefile
  kbuild: add generic mergeconfig target, %.config
  merge_config.sh: rename MAKE to RUNMAKE
  merge_config.sh: improve indentation
  kbuild: mergeconfig: remove redundant $(objtree)
  kbuild: mergeconfig: move an error check to merge_config.sh
  kbuild: mergeconfig: fix "jobserver unavailable" warning
  kconfig: Remove unnecessary prototypes from headers
  kconfig: Remove dead code
  kconfig: Get rid of the P() macro in headers
  kconfig: fix a misspelling in scripts/kconfig/merge_config.sh
  • Loading branch information
Linus Torvalds committed Apr 15, 2015
2 parents b422b75 + 0a1f00a commit c841e12
Show file tree
Hide file tree
Showing 15 changed files with 174 additions and 198 deletions.
80 changes: 39 additions & 41 deletions scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Kernel configuration targets
# These targets are used from top-level makefile

PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \
PHONY += xconfig gconfig menuconfig config silentoldconfig update-po-config \
localmodconfig localyesconfig

ifdef KBUILD_KCONFIG
Expand All @@ -11,30 +11,31 @@ else
Kconfig := Kconfig
endif

ifeq ($(quiet),silent_)
silent := -s
endif

# We need this, in case the user has it in its environment
unexport CONFIG_

xconfig: $(obj)/qconf
$< $(Kconfig)
$< $(silent) $(Kconfig)

gconfig: $(obj)/gconf
$< $(Kconfig)
$< $(silent) $(Kconfig)

menuconfig: $(obj)/mconf
$< $(Kconfig)
$< $(silent) $(Kconfig)

config: $(obj)/conf
$< --oldaskconfig $(Kconfig)
$< $(silent) --oldaskconfig $(Kconfig)

nconfig: $(obj)/nconf
$< $(Kconfig)

oldconfig: $(obj)/conf
$< --$@ $(Kconfig)
$< $(silent) $(Kconfig)

silentoldconfig: $(obj)/conf
$(Q)mkdir -p include/config include/generated
$< --$@ $(Kconfig)
$< $(silent) --$@ $(Kconfig)

localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
$(Q)mkdir -p include/config include/generated
Expand All @@ -43,18 +44,18 @@ localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
cmp -s .tmp.config .config || \
(mv -f .config .config.old.1; \
mv -f .tmp.config .config; \
$(obj)/conf --silentoldconfig $(Kconfig); \
$(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
mv -f .config.old.1 .config.old) \
else \
mv -f .tmp.config .config; \
$(obj)/conf --silentoldconfig $(Kconfig); \
$(obj)/conf $(silent) --silentoldconfig $(Kconfig); \
fi
$(Q)rm -f .tmp.config

# Create new linux.pot file
# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
$(Q)echo " GEN config.pot"
$(Q)$(kecho) " GEN config.pot"
$(Q)xgettext --default-domain=linux \
--add-comments --keyword=_ --keyword=N_ \
--from-code=UTF-8 \
Expand All @@ -65,61 +66,58 @@ update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
$(Q)(for i in `ls $(srctree)/arch/*/Kconfig \
$(srctree)/arch/*/um/Kconfig`; \
do \
echo " GEN $$i"; \
$(kecho) " GEN $$i"; \
$(obj)/kxgettext $$i \
>> $(obj)/config.pot; \
done )
$(Q)echo " GEN linux.pot"
$(Q)$(kecho) " GEN linux.pot"
$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
--output $(obj)/linux.pot
$(Q)rm -f $(obj)/config.pot

PHONY += allnoconfig allyesconfig allmodconfig alldefconfig randconfig

allnoconfig allyesconfig allmodconfig alldefconfig randconfig: $(obj)/conf
$< --$@ $(Kconfig)
# These targets map 1:1 to the commandline options of 'conf'
simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
alldefconfig randconfig listnewconfig olddefconfig
PHONY += $(simple-targets)

PHONY += listnewconfig olddefconfig oldnoconfig savedefconfig defconfig
$(simple-targets): $(obj)/conf
$< $(silent) --$@ $(Kconfig)

listnewconfig olddefconfig: $(obj)/conf
$< --$@ $(Kconfig)
PHONY += oldnoconfig savedefconfig defconfig

# oldnoconfig is an alias of olddefconfig, because people already are dependent
# on its behavior(sets new symbols to their default value but not 'n') with the
# counter-intuitive name.
oldnoconfig: $(obj)/conf
$< --olddefconfig $(Kconfig)
oldnoconfig: olddefconfig

savedefconfig: $(obj)/conf
$< --$@=defconfig $(Kconfig)
$< $(silent) --$@=defconfig $(Kconfig)

defconfig: $(obj)/conf
ifeq ($(KBUILD_DEFCONFIG),)
$< --defconfig $(Kconfig)
$< $(silent) --defconfig $(Kconfig)
else
@echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
@$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
endif

%_defconfig: $(obj)/conf
$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)
$(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$@ $(Kconfig)

configfiles=$(wildcard $(srctree)/kernel/configs/$(1).config $(srctree)/arch/$(SRCARCH)/configs/$(1).config)
configfiles=$(wildcard $(srctree)/kernel/configs/$@ $(srctree)/arch/$(SRCARCH)/configs/$@)

define mergeconfig
$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
$(if $(call configfiles,$(1)),, $(error No configuration exists for this target on this architecture))
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(call configfiles,$(1))
$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
endef
%.config: $(obj)/conf
$(if $(call configfiles),, $(error No configuration exists for this target on this architecture))
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m .config $(configfiles)
+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig

PHONY += kvmconfig
kvmconfig:
$(call mergeconfig,kvm_guest)
kvmconfig: kvm_guest.config
@:

PHONY += tinyconfig
tinyconfig: allnoconfig
$(call mergeconfig,tiny)
tinyconfig:
$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config

# Help text used by make help
help:
Expand Down Expand Up @@ -221,7 +219,7 @@ $(obj)/.tmp_qtcheck: $(src)/Makefile

# QT needs some extra effort...
$(obj)/.tmp_qtcheck:
@set -e; echo " CHECK qt"; dir=""; pkg=""; \
@set -e; $(kecho) " CHECK qt"; dir=""; pkg=""; \
if ! pkg-config --exists QtCore 2> /dev/null; then \
echo "* Unable to find the QT4 tool qmake. Trying to use QT3"; \
pkg-config --exists qt 2> /dev/null && pkg=qt; \
Expand Down
8 changes: 6 additions & 2 deletions scripts/kconfig/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ static struct option long_opts[] = {
static void conf_usage(const char *progname)
{

printf("Usage: %s [option] <kconfig-file>\n", progname);
printf("Usage: %s [-s] [option] <kconfig-file>\n", progname);
printf("[option] is _one_ of the following:\n");
printf(" --listnewconfig List new options\n");
printf(" --oldaskconfig Start a new configuration using a line-oriented program\n");
Expand Down Expand Up @@ -501,7 +501,11 @@ int main(int ac, char **av)

tty_stdio = isatty(0) && isatty(1) && isatty(2);

while ((opt = getopt_long(ac, av, "", long_opts, NULL)) != -1) {
while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
if (opt == 's') {
conf_set_message_callback(NULL);
continue;
}
input_mode = (enum input_mode)opt;
switch (opt) {
case silentoldconfig:
Expand Down
5 changes: 5 additions & 0 deletions scripts/kconfig/confdata.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@

#include "lkc.h"

struct conf_printer {
void (*print_symbol)(FILE *, struct symbol *, const char *, void *);
void (*print_comment)(FILE *, const char *, void *);
};

static void conf_warning(const char *fmt, ...)
__attribute__ ((format (printf, 1, 2)));

Expand Down
22 changes: 12 additions & 10 deletions scripts/kconfig/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@

#define DEBUG_EXPR 0

static int expr_eq(struct expr *e1, struct expr *e2);
static struct expr *expr_eliminate_yn(struct expr *e);
static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2);
static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2);
static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2);

struct expr *expr_alloc_symbol(struct symbol *sym)
{
struct expr *e = xcalloc(1, sizeof(*e));
Expand Down Expand Up @@ -186,7 +192,7 @@ void expr_eliminate_eq(struct expr **ep1, struct expr **ep2)
#undef e1
#undef e2

int expr_eq(struct expr *e1, struct expr *e2)
static int expr_eq(struct expr *e1, struct expr *e2)
{
int res, old_count;

Expand Down Expand Up @@ -228,7 +234,7 @@ int expr_eq(struct expr *e1, struct expr *e2)
return 0;
}

struct expr *expr_eliminate_yn(struct expr *e)
static struct expr *expr_eliminate_yn(struct expr *e)
{
struct expr *tmp;

Expand Down Expand Up @@ -823,7 +829,7 @@ bool expr_depends_symbol(struct expr *dep, struct symbol *sym)
return false;
}

struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
static struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
{
struct expr *tmp = NULL;
expr_extract_eq(E_AND, &tmp, ep1, ep2);
Expand All @@ -834,7 +840,7 @@ struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2)
return tmp;
}

struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
static struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
{
struct expr *tmp = NULL;
expr_extract_eq(E_OR, &tmp, ep1, ep2);
Expand All @@ -845,7 +851,7 @@ struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2)
return tmp;
}

void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2)
static void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2)
{
#define e1 (*ep1)
#define e2 (*ep2)
Expand Down Expand Up @@ -976,11 +982,8 @@ tristate expr_calc_value(struct expr *e)
}
}

int expr_compare_type(enum expr_type t1, enum expr_type t2)
static int expr_compare_type(enum expr_type t1, enum expr_type t2)
{
#if 0
return 1;
#else
if (t1 == t2)
return 0;
switch (t1) {
Expand All @@ -1005,7 +1008,6 @@ int expr_compare_type(enum expr_type t1, enum expr_type t2)
}
printf("[%dgt%d?]", t1, t2);
return 0;
#endif
}

static inline struct expr *
Expand Down
5 changes: 0 additions & 5 deletions scripts/kconfig/expr.h
Original file line number Diff line number Diff line change
Expand Up @@ -205,18 +205,13 @@ struct expr *expr_alloc_and(struct expr *e1, struct expr *e2);
struct expr *expr_alloc_or(struct expr *e1, struct expr *e2);
struct expr *expr_copy(const struct expr *org);
void expr_free(struct expr *e);
int expr_eq(struct expr *e1, struct expr *e2);
void expr_eliminate_eq(struct expr **ep1, struct expr **ep2);
tristate expr_calc_value(struct expr *e);
struct expr *expr_eliminate_yn(struct expr *e);
struct expr *expr_trans_bool(struct expr *e);
struct expr *expr_eliminate_dups(struct expr *e);
struct expr *expr_transform(struct expr *e);
int expr_contains_symbol(struct expr *dep, struct symbol *sym);
bool expr_depends_symbol(struct expr *dep, struct symbol *sym);
struct expr *expr_extract_eq_and(struct expr **ep1, struct expr **ep2);
struct expr *expr_extract_eq_or(struct expr **ep1, struct expr **ep2);
void expr_extract_eq(enum expr_type type, struct expr **ep, struct expr **ep1, struct expr **ep2);
struct expr *expr_trans_compare(struct expr *e, enum expr_type type, struct symbol *sym);
struct expr *expr_simplify_unmet_dep(struct expr *e1, struct expr *e2);

Expand Down
29 changes: 4 additions & 25 deletions scripts/kconfig/gconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,37 +169,13 @@ void init_main_window(const gchar * glade_file)
style = gtk_widget_get_style(main_wnd);
widget = glade_xml_get_widget(xml, "toolbar1");

#if 0 /* Use stock Gtk icons instead */
replace_button_icon(xml, main_wnd->window, style,
"button1", (gchar **) xpm_back);
replace_button_icon(xml, main_wnd->window, style,
"button2", (gchar **) xpm_load);
replace_button_icon(xml, main_wnd->window, style,
"button3", (gchar **) xpm_save);
#endif
replace_button_icon(xml, main_wnd->window, style,
"button4", (gchar **) xpm_single_view);
replace_button_icon(xml, main_wnd->window, style,
"button5", (gchar **) xpm_split_view);
replace_button_icon(xml, main_wnd->window, style,
"button6", (gchar **) xpm_tree_view);

#if 0
switch (view_mode) {
case SINGLE_VIEW:
widget = glade_xml_get_widget(xml, "button4");
g_signal_emit_by_name(widget, "clicked");
break;
case SPLIT_VIEW:
widget = glade_xml_get_widget(xml, "button5");
g_signal_emit_by_name(widget, "clicked");
break;
case FULL_VIEW:
widget = glade_xml_get_widget(xml, "button6");
g_signal_emit_by_name(widget, "clicked");
break;
}
#endif
txtbuf = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_w));
tag1 = gtk_text_buffer_create_tag(txtbuf, "mytag1",
"foreground", "red",
Expand Down Expand Up @@ -1498,9 +1474,12 @@ int main(int ac, char *av[])
case 'a':
//showAll = 1;
break;
case 's':
conf_set_message_callback(NULL);
break;
case 'h':
case '?':
printf("%s <config>\n", av[0]);
printf("%s [-s] <config>\n", av[0]);
exit(0);
}
name = av[2];
Expand Down
Loading

0 comments on commit c841e12

Please sign in to comment.