Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a84f6aa6 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild:
  scripts/kconfig/nconf: add KEY_HOME / KEY_END for dialog_inputbox
  scripts/kconfig/nconf: fix editing long strings
  scripts/kconfig/nconf: dynamically alloc dialog_input_result
  scripts/kconfig/nconf: fix memmove's length arg
  scripts/kconfig/nconf: fix typo: unknow => unknown
  kconfig: fix set but not used variables
  kconfig: handle SIGINT in menuconfig
  kconfig: fix __enabled_ macros definition for invisible and un-selected symbols
  kconfig: factor code in menu_get_ext_help()
  kbuild: Fix help text not displayed in choice option.
  kconfig/nconf: nuke unreferenced `nohelp_text'
  kconfig/streamline_config.pl: merge local{mod,yes}config
  kconfig/streamline_config.pl: use options to determine operating mode
  kconfig/streamline_config.pl: directly access LSMOD from the environment
parents dede6faa 93072c3e
Loading
Loading
Loading
Loading
+2 −26
Original line number Diff line number Diff line
@@ -33,33 +33,9 @@ silentoldconfig: $(obj)/conf
	$(Q)mkdir -p include/generated
	$< --$@ $(Kconfig)

# if no path is given, then use src directory to find file
ifdef LSMOD
LSMOD_F := $(LSMOD)
ifeq ($(findstring /,$(LSMOD)),)
  LSMOD_F := $(objtree)/$(LSMOD)
endif
endif

localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
	$(Q)mkdir -p include/generated
	$(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
	$(Q)if [ -f .config ]; then 					\
			cmp -s .tmp.config .config ||			\
			(mv -f .config .config.old.1;			\
			 mv -f .tmp.config .config;			\
			 $(obj)/conf --silentoldconfig $(Kconfig);	\
			 mv -f .config.old.1 .config.old)		\
	else								\
			mv -f .tmp.config .config;			\
			$(obj)/conf --silentoldconfig $(Kconfig);	\
	fi
	$(Q)rm -f .tmp.config

localyesconfig: $(obj)/streamline_config.pl $(obj)/conf
localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf
	$(Q)mkdir -p include/generated
	$(Q)perl $< $(srctree) $(Kconfig) $(LSMOD_F) > .tmp.config
	$(Q)sed -i s/=m/=y/ .tmp.config
	$(Q)perl $< --$@ $(srctree) $(Kconfig) > .tmp.config
	$(Q)if [ -f .config ]; then 					\
			cmp -s .tmp.config .config ||			\
			(mv -f .config .config.old.1;			\
+36 −13
Original line number Diff line number Diff line
@@ -503,17 +503,6 @@ header_print_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
			fprintf(fp, "#define %s%s%s 1\n",
			    CONFIG_, sym->name, suffix);
		}
		/*
		 * Generate the __enabled_CONFIG_* and
		 * __enabled_CONFIG_*_MODULE macros for use by the
		 * IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
		 * generated even for booleans so that the IS_ENABLED() macro
		 * works.
		 */
		fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
				sym->name, (*value == 'y'));
		fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
				sym->name, (*value == 'm'));
		break;
	}
	case S_HEX: {
@@ -564,6 +553,35 @@ static struct conf_printer header_printer_cb =
	.print_comment = header_print_comment,
};

/*
 * Generate the __enabled_CONFIG_* and __enabled_CONFIG_*_MODULE macros for
 * use by the IS_{ENABLED,BUILTIN,MODULE} macros. The _MODULE variant is
 * generated even for booleans so that the IS_ENABLED() macro works.
 */
static void
header_print__enabled_symbol(FILE *fp, struct symbol *sym, const char *value, void *arg)
{

	switch (sym->type) {
	case S_BOOLEAN:
	case S_TRISTATE: {
		fprintf(fp, "#define __enabled_" CONFIG_ "%s %d\n",
		    sym->name, (*value == 'y'));
		fprintf(fp, "#define __enabled_" CONFIG_ "%s_MODULE %d\n",
		    sym->name, (*value == 'm'));
		break;
	}
	default:
		break;
	}
}

static struct conf_printer header__enabled_printer_cb =
{
	.print_symbol = header_print__enabled_symbol,
	.print_comment = header_print_comment,
};

/*
 * Tristate printer
 *
@@ -945,11 +963,16 @@ int conf_write_autoconf(void)
	conf_write_heading(out_h, &header_printer_cb, NULL);

	for_all_symbols(i, sym) {
		if (!sym->name)
			continue;

		sym_calc_value(sym);
		if (!(sym->flags & SYMBOL_WRITE) || !sym->name)

		conf_write_symbol(out_h, sym, &header__enabled_printer_cb, NULL);

		if (!(sym->flags & SYMBOL_WRITE))
			continue;

		/* write symbol to auto.conf, tristate and header files */
		conf_write_symbol(out, sym, &kconfig_printer_cb, (void *)1);

		conf_write_symbol(tristate, sym, &tristate_printer_cb, (void *)1);
+1 −2
Original line number Diff line number Diff line
@@ -320,7 +320,6 @@ static void print_page(WINDOW * win, int height, int width)
 */
static void print_line(WINDOW * win, int row, int width)
{
	int y, x;
	char *line;

	line = get_line();
@@ -329,10 +328,10 @@ static void print_line(WINDOW * win, int row, int width)
	waddch(win, ' ');
	waddnstr(win, line, MIN(strlen(line), width - 2));

	getyx(win, y, x);
	/* Clear 'residue' of previous line */
#if OLD_NCURSES
	{
		int x = getcurx(win);
		int i;
		for (i = 0; i < width - x; i++)
			waddch(win, ' ');
+52 −34
Original line number Diff line number Diff line
@@ -15,6 +15,7 @@
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
#include <unistd.h>
#include <locale.h>

@@ -272,6 +273,7 @@ static struct menu *current_menu;
static int child_count;
static int single_menu_mode;
static int show_all_options;
static int saved_x, saved_y;

static void conf(struct menu *menu);
static void conf_choice(struct menu *menu);
@@ -792,47 +794,19 @@ static void conf_save(void)
	}
}

int main(int ac, char **av)
static int handle_exit(void)
{
	int saved_x, saved_y;
	char *mode;
	int res;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	conf_parse(av[1]);
	conf_read(NULL);

	mode = getenv("MENUCONFIG_MODE");
	if (mode) {
		if (!strcasecmp(mode, "single_menu"))
			single_menu_mode = 1;
	}

	initscr();

	getyx(stdscr, saved_y, saved_x);
	if (init_dialog(NULL)) {
		fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
		fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
		return 1;
	}

	set_config_filename(conf_get_configname());
	do {
		conf(&rootmenu);
	dialog_clear();
	if (conf_get_changed())
		res = dialog_yesno(NULL,
					   _("Do you wish to save your "
					     "new configuration?\n"
				   _("Do you wish to save your new configuration ?\n"
				     "<ESC><ESC> to continue."),
				   6, 60);
	else
		res = -1;
	} while (res == KEY_ESC);

	end_dialog(saved_x, saved_y);

	switch (res) {
@@ -850,6 +824,7 @@ int main(int ac, char **av)
			 "*** End of the configuration.\n"
			 "*** Execute 'make' to start the build or try 'make help'."
			 "\n\n"));
		res = 0;
		break;
	default:
		fprintf(stderr, _("\n\n"
@@ -857,6 +832,49 @@ int main(int ac, char **av)
				  "\n\n"));
	}

	return 0;
	return res;
}

static void sig_handler(int signo)
{
	exit(handle_exit());
}

int main(int ac, char **av)
{
	char *mode;
	int res;

	setlocale(LC_ALL, "");
	bindtextdomain(PACKAGE, LOCALEDIR);
	textdomain(PACKAGE);

	signal(SIGINT, sig_handler);

	conf_parse(av[1]);
	conf_read(NULL);

	mode = getenv("MENUCONFIG_MODE");
	if (mode) {
		if (!strcasecmp(mode, "single_menu"))
			single_menu_mode = 1;
	}

	initscr();

	getyx(stdscr, saved_y, saved_x);
	if (init_dialog(NULL)) {
		fprintf(stderr, N_("Your display is too small to run Menuconfig!\n"));
		fprintf(stderr, N_("It must be at least 19 lines by 80 columns.\n"));
		return 1;
	}

	set_config_filename(conf_get_configname());
	do {
		conf(&rootmenu);
		res = handle_exit();
	} while (res == KEY_ESC);

	return res;
}
+5 −8
Original line number Diff line number Diff line
@@ -10,8 +10,7 @@

#include "lkc.h"

static const char nohelp_text[] = N_(
	"There is no help available for this option.\n");
static const char nohelp_text[] = "There is no help available for this option.";

struct menu rootmenu;
static struct menu **last_entry_ptr;
@@ -595,16 +594,14 @@ struct gstr get_relations_str(struct symbol **sym_arr)
void menu_get_ext_help(struct menu *menu, struct gstr *help)
{
	struct symbol *sym = menu->sym;
	const char *help_text = nohelp_text;

	if (menu_has_help(menu)) {
		if (sym->name) {
		if (sym->name)
			str_printf(help, "%s%s:\n\n", CONFIG_, sym->name);
			str_append(help, _(menu_get_help(menu)));
			str_append(help, "\n");
		}
	} else {
		str_append(help, nohelp_text);
		help_text = menu_get_help(menu);
	}
	str_printf(help, "%s\n", _(help_text));
	if (sym)
		get_symbol_str(help, sym);
}
Loading