aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/Makefile16
-rw-r--r--scripts/kconfig/kxgettext.c16
2 files changed, 25 insertions, 7 deletions
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 09abb891d11f..2fcb244a9e18 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -27,8 +27,20 @@ update-po-config: $(obj)/kxgettext
27 xgettext --default-domain=linux \ 27 xgettext --default-domain=linux \
28 --add-comments --keyword=_ --keyword=N_ \ 28 --add-comments --keyword=_ --keyword=N_ \
29 --files-from=scripts/kconfig/POTFILES.in \ 29 --files-from=scripts/kconfig/POTFILES.in \
30 -o scripts/kconfig/linux.pot 30 --output scripts/kconfig/config.pot
31 scripts/kconfig/kxgettext arch/$(ARCH)/Kconfig >> scripts/kconfig/linux.pot 31 $(Q)ln -fs Kconfig_i386 arch/um/Kconfig_arch
32 $(Q)for i in `ls arch/`; \
33 do \
34 scripts/kconfig/kxgettext arch/$$i/Kconfig \
35 | msguniq -o scripts/kconfig/linux_$${i}.pot; \
36 done
37 $(Q)msgcat scripts/kconfig/config.pot \
38 `find scripts/kconfig/ -type f -name linux_*.pot` \
39 --output scripts/kconfig/linux_raw.pot
40 $(Q)msguniq --sort-by-file scripts/kconfig/linux_raw.pot \
41 --output scripts/kconfig/linux.pot
42 $(Q)rm -f arch/um/Kconfig_arch
43 $(Q)rm -f scripts/kconfig/linux_*.pot scripts/kconfig/config.pot
32 44
33.PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig 45.PHONY: randconfig allyesconfig allnoconfig allmodconfig defconfig
34 46
diff --git a/scripts/kconfig/kxgettext.c b/scripts/kconfig/kxgettext.c
index 1c88d7c6d5a7..abee55ca6174 100644
--- a/scripts/kconfig/kxgettext.c
+++ b/scripts/kconfig/kxgettext.c
@@ -14,6 +14,11 @@ static char *escape(const char* text, char *bf, int len)
14{ 14{
15 char *bfp = bf; 15 char *bfp = bf;
16 int multiline = strchr(text, '\n') != NULL; 16 int multiline = strchr(text, '\n') != NULL;
17 int eol = 0;
18 int textlen = strlen(text);
19
20 if ((textlen > 0) && (text[textlen-1] == '\n'))
21 eol = 1;
17 22
18 *bfp++ = '"'; 23 *bfp++ = '"';
19 --len; 24 --len;
@@ -43,7 +48,7 @@ next:
43 --len; 48 --len;
44 } 49 }
45 50
46 if (multiline) 51 if (multiline && eol)
47 bfp -= 3; 52 bfp -= 3;
48 53
49 *bfp++ = '"'; 54 *bfp++ = '"';
@@ -179,7 +184,11 @@ static void message__print_file_lineno(struct message *self)
179{ 184{
180 struct file_line *fl = self->files; 185 struct file_line *fl = self->files;
181 186
182 printf("\n#: %s:%d", fl->file, fl->lineno); 187 putchar('\n');
188 if (self->option != NULL)
189 printf("# %s:00000\n", self->option);
190
191 printf("#: %s:%d", fl->file, fl->lineno);
183 fl = fl->next; 192 fl = fl->next;
184 193
185 while (fl != NULL) { 194 while (fl != NULL) {
@@ -187,9 +196,6 @@ static void message__print_file_lineno(struct message *self)
187 fl = fl->next; 196 fl = fl->next;
188 } 197 }
189 198
190 if (self->option != NULL)
191 printf(", %s:00000", self->option);
192
193 putchar('\n'); 199 putchar('\n');
194} 200}
195 201