Skip to content

Commit 694c49a

Browse files
sravnborgmasahir0y
authored andcommitted
kconfig: drop localization support
The localization support is broken and appears unused. There is no google hits on the update-po-config target. And there is no recent (5 years) activity related to the localization. So lets just drop this as it is no longer used. Suggested-by: Ulf Magnusson <[email protected]> Suggested-by: Masahiro Yamada <[email protected]> Signed-off-by: Sam Ravnborg <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 1c5af5c commit 694c49a

File tree

21 files changed

+258
-610
lines changed

21 files changed

+258
-610
lines changed

scripts/kconfig/.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
# Generated files
33
#
44
*.moc
5-
gconf.glade.h
6-
*.pot
7-
*.mo
85

96
#
107
# configuration programs
@@ -14,4 +11,3 @@ mconf
1411
nconf
1512
qconf
1613
gconf
17-
kxgettext

scripts/kconfig/Makefile

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Kernel configuration targets
44
# These targets are used from top-level makefile
55

6-
PHONY += xconfig gconfig menuconfig config syncconfig update-po-config \
6+
PHONY += xconfig gconfig menuconfig config syncconfig \
77
localmodconfig localyesconfig
88

99
ifdef KBUILD_KCONFIG
@@ -55,29 +55,6 @@ localyesconfig localmodconfig: $(obj)/conf
5555
fi
5656
$(Q)rm -f .tmp.config
5757

58-
# Create new linux.pot file
59-
# Adjust charset to UTF-8 in .po file to accept UTF-8 in Kconfig files
60-
update-po-config: $(obj)/kxgettext $(obj)/gconf.glade.h
61-
$(Q)$(kecho) " GEN config.pot"
62-
$(Q)xgettext --default-domain=linux \
63-
--add-comments --keyword=_ --keyword=N_ \
64-
--from-code=UTF-8 \
65-
--files-from=$(srctree)/scripts/kconfig/POTFILES.in \
66-
--directory=$(srctree) --directory=$(objtree) \
67-
--output $(obj)/config.pot
68-
$(Q)sed -i s/CHARSET/UTF-8/ $(obj)/config.pot
69-
$(Q)(for i in `ls $(srctree)/arch/*/Kconfig \
70-
$(srctree)/arch/*/um/Kconfig`; \
71-
do \
72-
$(kecho) " GEN $$i"; \
73-
$(obj)/kxgettext $$i \
74-
>> $(obj)/config.pot; \
75-
done )
76-
$(Q)$(kecho) " GEN linux.pot"
77-
$(Q)msguniq --sort-by-file --to-code=UTF-8 $(obj)/config.pot \
78-
--output $(obj)/linux.pot
79-
$(Q)rm -f $(obj)/config.pot
80-
8158
# These targets map 1:1 to the commandline options of 'conf'
8259
simple-targets := oldconfig allnoconfig allyesconfig allmodconfig \
8360
alldefconfig randconfig listnewconfig olddefconfig
@@ -179,19 +156,11 @@ help:
179156
# object files used by all kconfig flavours
180157

181158
conf-objs := conf.o zconf.tab.o
182-
kxgettext-objs := kxgettext.o zconf.tab.o
183159

184-
hostprogs-y := conf kxgettext
160+
hostprogs-y := conf
185161

186162
targets += zconf.lex.c
187-
clean-files += gconf.glade.h
188-
clean-files += config.pot linux.pot
189-
190-
# Add environment specific flags
191-
HOST_EXTRACFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCC) $(HOSTCFLAGS)) \
192-
-DLOCALE
193-
HOST_EXTRACXXFLAGS += $(shell $(CONFIG_SHELL) $(srctree)/$(src)/check.sh $(HOSTCXX) $(HOSTCXXFLAGS)) \
194-
-DLOCALE
163+
195164
# generated files seem to need this to find local include files
196165
HOSTCFLAGS_zconf.lex.o := -I$(src)
197166
HOSTCFLAGS_zconf.tab.o := -I$(src)
@@ -244,11 +213,6 @@ $(obj)/gconf.o: $(obj)/.gconf-cfg
244213

245214
$(obj)/zconf.tab.o: $(obj)/zconf.lex.c
246215

247-
# Extract gconf menu items for i18n support
248-
$(obj)/gconf.glade.h: $(obj)/gconf.glade
249-
$(Q)intltool-extract --type=gettext/glade --srcdir=$(srctree) \
250-
$(obj)/gconf.glade
251-
252216
# check if necessary packages are available, and configure build flags
253217
define filechk_conf_cfg
254218
$(CONFIG_SHELL) $<

scripts/kconfig/POTFILES.in

Lines changed: 0 additions & 12 deletions
This file was deleted.

scripts/kconfig/check.sh

Lines changed: 0 additions & 14 deletions
This file was deleted.

scripts/kconfig/conf.c

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Released under the terms of the GNU GPL v2.0.
44
*/
55

6-
#include <locale.h>
76
#include <ctype.h>
87
#include <limits.h>
98
#include <stdio.h>
@@ -86,7 +85,7 @@ static int conf_askvalue(struct symbol *sym, const char *def)
8685
enum symbol_type type = sym_get_type(sym);
8786

8887
if (!sym_has_value(sym))
89-
printf(_("(NEW) "));
88+
printf("(NEW) ");
9089

9190
line[0] = '\n';
9291
line[1] = 0;
@@ -133,7 +132,7 @@ static int conf_string(struct menu *menu)
133132
const char *def;
134133

135134
while (1) {
136-
printf("%*s%s ", indent - 1, "", _(menu->prompt->text));
135+
printf("%*s%s ", indent - 1, "", menu->prompt->text);
137136
printf("(%s) ", sym->name);
138137
def = sym_get_string_value(sym);
139138
if (sym_get_string_value(sym))
@@ -166,7 +165,7 @@ static int conf_sym(struct menu *menu)
166165
tristate oldval, newval;
167166

168167
while (1) {
169-
printf("%*s%s ", indent - 1, "", _(menu->prompt->text));
168+
printf("%*s%s ", indent - 1, "", menu->prompt->text);
170169
if (sym->name)
171170
printf("(%s) ", sym->name);
172171
putchar('[');
@@ -251,7 +250,7 @@ static int conf_choice(struct menu *menu)
251250
case no:
252251
return 1;
253252
case mod:
254-
printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu)));
253+
printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
255254
return 0;
256255
case yes:
257256
break;
@@ -261,15 +260,15 @@ static int conf_choice(struct menu *menu)
261260
while (1) {
262261
int cnt, def;
263262

264-
printf("%*s%s\n", indent - 1, "", _(menu_get_prompt(menu)));
263+
printf("%*s%s\n", indent - 1, "", menu_get_prompt(menu));
265264
def_sym = sym_get_choice_value(sym);
266265
cnt = def = 0;
267266
line[0] = 0;
268267
for (child = menu->list; child; child = child->next) {
269268
if (!menu_is_visible(child))
270269
continue;
271270
if (!child->sym) {
272-
printf("%*c %s\n", indent, '*', _(menu_get_prompt(child)));
271+
printf("%*c %s\n", indent, '*', menu_get_prompt(child));
273272
continue;
274273
}
275274
cnt++;
@@ -278,14 +277,14 @@ static int conf_choice(struct menu *menu)
278277
printf("%*c", indent, '>');
279278
} else
280279
printf("%*c", indent, ' ');
281-
printf(" %d. %s", cnt, _(menu_get_prompt(child)));
280+
printf(" %d. %s", cnt, menu_get_prompt(child));
282281
if (child->sym->name)
283282
printf(" (%s)", child->sym->name);
284283
if (!sym_has_value(child->sym))
285-
printf(_(" (NEW)"));
284+
printf(" (NEW)");
286285
printf("\n");
287286
}
288-
printf(_("%*schoice"), indent - 1, "");
287+
printf("%*schoice", indent - 1, "");
289288
if (cnt == 1) {
290289
printf("[1]: 1\n");
291290
goto conf_childs;
@@ -372,7 +371,7 @@ static void conf(struct menu *menu)
372371
if (prompt)
373372
printf("%*c\n%*c %s\n%*c\n",
374373
indent, '*',
375-
indent, '*', _(prompt),
374+
indent, '*', prompt,
376375
indent, '*');
377376
default:
378377
;
@@ -437,7 +436,7 @@ static void check_conf(struct menu *menu)
437436
}
438437
} else {
439438
if (!conf_cnt++)
440-
printf(_("*\n* Restart config...\n*\n"));
439+
printf("*\n* Restart config...\n*\n");
441440
rootEntry = menu_get_parent_menu(menu);
442441
conf(rootEntry);
443442
}
@@ -498,10 +497,6 @@ int main(int ac, char **av)
498497
const char *name, *defconfig_file = NULL /* gcc uninit */;
499498
struct stat tmpstat;
500499

501-
setlocale(LC_ALL, "");
502-
bindtextdomain(PACKAGE, LOCALEDIR);
503-
textdomain(PACKAGE);
504-
505500
tty_stdio = isatty(0) && isatty(1);
506501

507502
while ((opt = getopt_long(ac, av, "s", long_opts, NULL)) != -1) {
@@ -559,7 +554,7 @@ int main(int ac, char **av)
559554
}
560555
}
561556
if (ac == optind) {
562-
fprintf(stderr, _("%s: Kconfig file missing\n"), av[0]);
557+
fprintf(stderr, "%s: Kconfig file missing\n", av[0]);
563558
conf_usage(progname);
564559
exit(1);
565560
}
@@ -569,12 +564,12 @@ int main(int ac, char **av)
569564
if (sync_kconfig) {
570565
name = conf_get_configname();
571566
if (stat(name, &tmpstat)) {
572-
fprintf(stderr, _("***\n"
567+
fprintf(stderr, "***\n"
573568
"*** Configuration file \"%s\" not found!\n"
574569
"***\n"
575570
"*** Please run some configurator (e.g. \"make oldconfig\" or\n"
576571
"*** \"make menuconfig\" or \"make xconfig\").\n"
577-
"***\n"), name);
572+
"***\n", name);
578573
exit(1);
579574
}
580575
}
@@ -585,9 +580,9 @@ int main(int ac, char **av)
585580
defconfig_file = conf_get_default_confname();
586581
if (conf_read(defconfig_file)) {
587582
fprintf(stderr,
588-
_("***\n"
583+
"***\n"
589584
"*** Can't find default configuration \"%s\"!\n"
590-
"***\n"),
585+
"***\n",
591586
defconfig_file);
592587
exit(1);
593588
}
@@ -611,7 +606,7 @@ int main(int ac, char **av)
611606
if ((strcmp(name, "") != 0) && (strcmp(name, "1") != 0)) {
612607
if (conf_read_simple(name, S_DEF_USER)) {
613608
fprintf(stderr,
614-
_("*** Can't read seed configuration \"%s\"!\n"),
609+
"*** Can't read seed configuration \"%s\"!\n",
615610
name);
616611
exit(1);
617612
}
@@ -628,7 +623,7 @@ int main(int ac, char **av)
628623
if (conf_read_simple(name, S_DEF_USER) &&
629624
conf_read_simple("all.config", S_DEF_USER)) {
630625
fprintf(stderr,
631-
_("*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n"),
626+
"*** KCONFIG_ALLCONFIG set, but no \"%s\" or \"all.config\" file found\n",
632627
name);
633628
exit(1);
634629
}
@@ -642,7 +637,7 @@ int main(int ac, char **av)
642637
name = getenv("KCONFIG_NOSILENTUPDATE");
643638
if (name && *name) {
644639
fprintf(stderr,
645-
_("\n*** The configuration requires explicit update.\n\n"));
640+
"\n*** The configuration requires explicit update.\n\n");
646641
return 1;
647642
}
648643
}
@@ -694,22 +689,22 @@ int main(int ac, char **av)
694689
* All other commands are only used to generate a config.
695690
*/
696691
if (conf_get_changed() && conf_write(NULL)) {
697-
fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
692+
fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
698693
exit(1);
699694
}
700695
if (conf_write_autoconf()) {
701-
fprintf(stderr, _("\n*** Error during update of the configuration.\n\n"));
696+
fprintf(stderr, "\n*** Error during update of the configuration.\n\n");
702697
return 1;
703698
}
704699
} else if (input_mode == savedefconfig) {
705700
if (conf_write_defconfig(defconfig_file)) {
706-
fprintf(stderr, _("n*** Error while saving defconfig to: %s\n\n"),
701+
fprintf(stderr, "n*** Error while saving defconfig to: %s\n\n",
707702
defconfig_file);
708703
return 1;
709704
}
710705
} else if (input_mode != listnewconfig) {
711706
if (conf_write(NULL)) {
712-
fprintf(stderr, _("\n*** Error during writing of the configuration.\n\n"));
707+
fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
713708
exit(1);
714709
}
715710
}

scripts/kconfig/confdata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ int conf_read_simple(const char *name, int def)
277277
name = conf_expand_value(prop->expr->left.sym->name);
278278
in = zconf_fopen(name);
279279
if (in) {
280-
conf_message(_("using defaults found in %s"),
280+
conf_message("using defaults found in %s",
281281
name);
282282
goto load;
283283
}
@@ -831,7 +831,7 @@ int conf_write(const char *name)
831831
return 1;
832832
}
833833

834-
conf_message(_("configuration written to %s"), newname);
834+
conf_message("configuration written to %s", newname);
835835

836836
sym_set_change_count(0);
837837

0 commit comments

Comments
 (0)