* RFA: next gettextization step
@ 2002-06-23 9:32 Tom Tromey
2002-06-23 9:47 ` Tom Tromey
` (3 more replies)
0 siblings, 4 replies; 12+ messages in thread
From: Tom Tromey @ 2002-06-23 9:32 UTC (permalink / raw)
To: gdb-patches
This patch is the next step in gettextization. It adds the gdb/po
directory and fills it in. It also marks up a single file (main.c) so
that the initial gdb.pot (master catalog) will have some contents.
This is exactly the same approach taken by the other tools in the src
tree.
Ok to commit?
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* main.c: Marked all strings with _().
* configure: Rebuilt.
* configure.in (PACKAGE): New subst.
(AC_OUTPUT): Create po/Makefile.in and po/Makefile.
(SUBDIRS): Added po.
* po/gdb.pot: New file.
* po/POTFILES.in: New file.
* po/.cvsignore: New file.
* po/Make-in: New file.
Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.88
diff -u -r1.88 configure.in
--- configure.in 21 Jun 2002 23:48:39 -0000 1.88
+++ configure.in 23 Jun 2002 16:29:09 -0000
@@ -36,8 +36,9 @@
dnl Set up for gettext. PACKAGE is used when we call bindtextdomain.
ALL_LINGUAS=
CY_GNU_GETTEXT
-AC_DEFINE(PACKAGE, "gdb", [Name of this package. ])
-
+PACKAGE=gdb
+AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of this package. ])
+AC_SUBST(PACKAGE)
dnl List of object files added by configure.
@@ -1293,7 +1294,7 @@
*) AC_MSG_ERROR("GDB: Unknown GDB_MULTI_ARCH value ${GDB_MULTI_ARCH}");;
esac
-SUBDIRS="doc testsuite nlm"
+SUBDIRS="doc po testsuite nlm"
if test "${enable_multi_ice}" = "yes"; then
SUBDIRS="${SUBDIRS} multi-ice"
fi
@@ -1360,7 +1361,7 @@
AC_EXEEXT
AC_CONFIG_SUBDIRS($configdirs)
-AC_OUTPUT(Makefile .gdbinit:gdbinit.in,
+AC_OUTPUT(Makefile .gdbinit:gdbinit.in po/Makefile.in:po/Make-in,
[
dnl Autoconf doesn't provide a mechanism for modifying definitions
dnl provided by makefile fragments.
@@ -1386,6 +1387,8 @@
xconfig.h:config.in)
echo > stamp-h ;;
esac
+
+sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile
],
[
gdb_host_cpu=$gdb_host_cpu
Index: main.c
===================================================================
RCS file: /cvs/src/src/gdb/main.c,v
retrieving revision 1.17
diff -u -r1.17 main.c
--- main.c 21 Jun 2002 23:48:41 -0000 1.17
+++ main.c 23 Jun 2002 16:29:10 -0000
@@ -347,7 +347,7 @@
extern int gdbtk_test (char *);
if (!gdbtk_test (optarg))
{
- fprintf_unfiltered (gdb_stderr, "%s: unable to load tclcommand file \"%s\"",
+ fprintf_unfiltered (gdb_stderr, _("%s: unable to load tclcommand file \"%s\""),
argv[0], optarg);
exit (1);
}
@@ -393,7 +393,7 @@
fprintf_unfiltered
(gdb_stderr,
- "warning: could not set baud rate to `%s'.\n", optarg);
+ _("warning: could not set baud rate to `%s'.\n"), optarg);
else
baud_rate = i;
}
@@ -410,7 +410,7 @@
fprintf_unfiltered
(gdb_stderr,
- "warning: could not set timeout limit to `%s'.\n", optarg);
+ _("warning: could not set timeout limit to `%s'.\n"), optarg);
else
remote_timeout = i;
}
@@ -421,7 +421,7 @@
#endif
case '?':
fprintf_unfiltered (gdb_stderr,
- "Use `%s --help' for a complete list of options.\n",
+ _("Use `%s --help' for a complete list of options.\n"),
argv[0]);
exit (1);
}
@@ -452,7 +452,7 @@
if (optind >= argc)
{
fprintf_unfiltered (gdb_stderr,
- "%s: `--args' specified but no program specified\n",
+ _("%s: `--args' specified but no program specified\n"),
argv[0]);
exit (1);
}
@@ -479,7 +479,7 @@
break;
case 3:
fprintf_unfiltered (gdb_stderr,
- "Excess command line arguments ignored. (%s%s)\n",
+ _("Excess command line arguments ignored. (%s%s)\n"),
argv[optind], (optind == argc - 1) ? "" : " ...");
break;
}
@@ -524,7 +524,7 @@
quit_pre_print = error_pre_print;
/* We may get more than one warning, don't double space all of them... */
- warning_pre_print = "\nwarning: ";
+ warning_pre_print = _("\nwarning: ");
/* Read and execute $HOME/.gdbinit file, if it exists. This is done
*before* all the command line arguments are processed; it sets
@@ -592,7 +592,7 @@
printf_filtered ("\n");
error_pre_print = "\n";
quit_pre_print = error_pre_print;
- warning_pre_print = "\nwarning: ";
+ warning_pre_print = _("\nwarning: ");
if (corearg != NULL)
{
@@ -622,7 +622,7 @@
/* Error messages should no longer be distinguished with extra output. */
error_pre_print = NULL;
quit_pre_print = NULL;
- warning_pre_print = "warning: ";
+ warning_pre_print = _("warning: ");
/* Read the .gdbinit file in the current directory, *if* it isn't
the same as the $HOME/.gdbinit file (it should exist, also). */
@@ -681,7 +681,7 @@
{
long init_time = get_run_time () - time_at_startup;
- printf_unfiltered ("Startup time: %ld.%06ld\n",
+ printf_unfiltered (_("Startup time: %ld.%06ld\n"),
init_time / 1000000, init_time % 1000000);
}
@@ -691,7 +691,7 @@
extern char **environ;
char *lim = (char *) sbrk (0);
- printf_unfiltered ("Startup size: data size %ld\n",
+ printf_unfiltered (_("Startup size: data size %ld\n"),
(long) (lim - (char *) &environ));
#endif
}
@@ -752,69 +752,69 @@
static void
print_gdb_help (struct ui_file *stream)
{
- fputs_unfiltered ("\
+ fputs_unfiltered (_("\
This is the GNU debugger. Usage:\n\n\
gdb [options] [executable-file [core-file or process-id]]\n\
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
Options:\n\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--args Arguments after executable-file are passed to inferior\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--[no]async Enable (disable) asynchronous version of CLI\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
-b BAUDRATE Set serial port baud rate used for remote debugging.\n\
--batch Exit after processing options.\n\
--cd=DIR Change current directory to DIR.\n\
--command=FILE Execute GDB commands from FILE.\n\
--core=COREFILE Analyze the core dump COREFILE.\n\
--pid=PID Attach to running process PID.\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--dbx DBX compatibility mode.\n\
--directory=DIR Search for source files in DIR.\n\
--epoch Output information used by epoch emacs-GDB interface.\n\
--exec=EXECFILE Use EXECFILE as the executable.\n\
--fullname Output information used by emacs-GDB interface.\n\
--help Print this message.\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--interpreter=INTERP\n\
Select a specific interpreter / user interface\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--mapped Use mapped symbol files if supported on this system.\n\
--nw Do not use a window interface.\n\
- --nx Do not read ", stream);
+ --nx Do not read "), stream);
fputs_unfiltered (gdbinit, stream);
- fputs_unfiltered (" file.\n\
+ fputs_unfiltered (_(" file.\n\
--quiet Do not print version number on startup.\n\
--readnow Fully read symbol files on first access.\n\
-", stream);
- fputs_unfiltered ("\
+"), stream);
+ fputs_unfiltered (_("\
--se=FILE Use FILE as symbol file and executable file.\n\
--symbols=SYMFILE Read symbols from SYMFILE.\n\
--tty=TTY Use TTY for input/output by the program being debugged.\n\
-", stream);
+"), stream);
#if defined(TUI)
- fputs_unfiltered ("\
+ fputs_unfiltered (_("\
--tui Use a terminal user interface.\n\
-", stream);
+"), stream);
#endif
- fputs_unfiltered ("\
+ fputs_unfiltered (_("\
--version Print version information and then exit.\n\
-w Use a window interface.\n\
--write Set writing into executable and core files.\n\
--xdb XDB compatibility mode.\n\
-", stream);
+"), stream);
#ifdef ADDITIONAL_OPTION_HELP
fputs_unfiltered (ADDITIONAL_OPTION_HELP, stream);
#endif
- fputs_unfiltered ("\n\
+ fputs_unfiltered (_("\n\
For more information, type \"help\" from within GDB, or consult the\n\
GDB manual (available as on-line info or a printed manual).\n\
Report bugs to \"bug-gdb@gnu.org\".\
-", stream);
+"), stream);
}
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-23 9:32 RFA: next gettextization step Tom Tromey
@ 2002-06-23 9:47 ` Tom Tromey
2002-06-24 10:05 ` Andrew Cagney
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2002-06-23 9:47 UTC (permalink / raw)
To: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> This patch is the next step in gettextization. It adds the
Tom> gdb/po directory and fills it in. It also marks up a single file
Tom> (main.c) so that the initial gdb.pot (master catalog) will have
Tom> some contents.
I forgot to to mention that the patch doesn't include the new files in
po/. gdb.pot is generated, POTFILES.in for now just lists main.c, and
the others are copies from gas/po. Still, I can send them if you want.
Tom
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-23 9:32 RFA: next gettextization step Tom Tromey
2002-06-23 9:47 ` Tom Tromey
@ 2002-06-24 10:05 ` Andrew Cagney
2002-06-24 13:58 ` Tom Tromey
2002-06-24 19:24 ` Andrew Cagney
2002-06-24 19:29 ` Andrew Cagney
3 siblings, 1 reply; 12+ messages in thread
From: Andrew Cagney @ 2002-06-24 10:05 UTC (permalink / raw)
To: tromey, Eli Zaretskii; +Cc: gdb-patches
> Index: ChangeLog
> from Tom Tromey <tromey@redhat.com>
>
> * main.c: Marked all strings with _().
> * configure: Rebuilt.
> * configure.in (PACKAGE): New subst.
> (AC_OUTPUT): Create po/Makefile.in and po/Makefile.
> (SUBDIRS): Added po.
> * po/gdb.pot: New file.
> * po/POTFILES.in: New file.
> * po/.cvsignore: New file.
> * po/Make-in: New file.
BTW, I've hit problems doing GDB releases in the past due to these files
and their makefile rules (unfortunatly I've lost the details) - from
memory a make clean was zapping the files and it tried to do strange
things when the source was on a read-only file system. I note H.J. is
currently raising what look like the problems I encountered on the
BINUTILS list.
Anyway, looking in the opcodes directory, the CVS repository appears to
contain the following generated files:
opcodes.pot (aka gdb.pot)
*.gmo
I'm wondering if it would be better to handle these generated files the
same wah as for LEX and YACC output - the release/snapshot process
generates those files.
thoughts?
Andrew
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-24 10:05 ` Andrew Cagney
@ 2002-06-24 13:58 ` Tom Tromey
2002-06-24 16:33 ` Andrew Cagney
0 siblings, 1 reply; 12+ messages in thread
From: Tom Tromey @ 2002-06-24 13:58 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Eli Zaretskii, gdb-patches
>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
Andrew> Anyway, looking in the opcodes directory, the CVS repository
Andrew> appears to contain the following generated files:
Andrew> opcodes.pot (aka gdb.pot)
Andrew> *.gmo
Andrew> I'm wondering if it would be better to handle these generated
Andrew> files the same wah as for LEX and YACC output - the
Andrew> release/snapshot process generates those files.
Actually, the gmo files aren't in the repository. They do end up in
the source tree though.
I don't know enough about how gdb releases are done to really comment
on this. Is there any documentation on the process?
Tom
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-24 13:58 ` Tom Tromey
@ 2002-06-24 16:33 ` Andrew Cagney
[not found] ` <mailpost.1024961614.24442@news-sj1-1>
2002-06-24 16:51 ` Tom Tromey
0 siblings, 2 replies; 12+ messages in thread
From: Andrew Cagney @ 2002-06-24 16:33 UTC (permalink / raw)
To: tromey; +Cc: Eli Zaretskii, gdb-patches
> Actually, the gmo files aren't in the repository. They do end up in
> the source tree though.
Sounds like they shouldn't?
> I don't know enough about how gdb releases are done to really comment
> on this. Is there any documentation on the process?
http://sources.redhat.com/gdb/current/onlinedocs/gdbint_15.html#SEC128
the short answer is:
cd src; make -f Makefile.in gdb.tar
Andrew
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
[not found] ` <mailpost.1024961614.24442@news-sj1-1>
@ 2002-06-24 16:37 ` cgd
0 siblings, 0 replies; 12+ messages in thread
From: cgd @ 2002-06-24 16:37 UTC (permalink / raw)
To: ac131313; +Cc: tromey, Eli Zaretskii, gdb-patches
At Mon, 24 Jun 2002 23:33:34 +0000 (UTC), "Andrew Cagney" wrote:
> > Actually, the gmo files aren't in the repository. They do end up in
> > the source tree though.
>
> Sounds like they shouldn't?
Personally, I'd agree with this (i.e., if they're going to be
generated, they should end up in the build dir).
However, note the thread over on binutils from a few days ago,
starting with:
http://sources.redhat.com/ml/binutils/2002-06/msg00634.html
which at least attempts to present a rationale for keeping them in the
source tree (which i don't happen to agree with 8-).
cgd
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-24 16:33 ` Andrew Cagney
[not found] ` <mailpost.1024961614.24442@news-sj1-1>
@ 2002-06-24 16:51 ` Tom Tromey
1 sibling, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2002-06-24 16:51 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Eli Zaretskii, gdb-patches
>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
>> Actually, the gmo files aren't in the repository. They do end up
>> in the source tree though.
Andrew> Sounds like they shouldn't?
Maybe. It's a toss-up since the files have to be in the distribution.
So on the one hand it is cleaner to put them in the build tree for
developers, but on the other hand it means that the build rules for
them won't ever be tested by maintainers.
I've thought about this some more today. I'd prefer to move forward
with my original patch. My reasoning is that similar code has been in
the src tree (in 7 places) for 4 years now, so we've already worked
out the problems with it.
Tom
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-23 9:32 RFA: next gettextization step Tom Tromey
2002-06-23 9:47 ` Tom Tromey
2002-06-24 10:05 ` Andrew Cagney
@ 2002-06-24 19:24 ` Andrew Cagney
2002-06-24 20:10 ` Tom Tromey
2002-06-25 1:26 ` Andreas Schwab
2002-06-24 19:29 ` Andrew Cagney
3 siblings, 2 replies; 12+ messages in thread
From: Andrew Cagney @ 2002-06-24 19:24 UTC (permalink / raw)
To: tromey; +Cc: gdb-patches
> - fprintf_unfiltered (gdb_stderr, "%s: unable to load tclcommand file \"%s\"",
> + fprintf_unfiltered (gdb_stderr, _("%s: unable to load tclcommand file \"%s\""),
> argv[0], optarg);
> exit (1);
BTW, what effect does this have on -Werror -Wprintf? Does GCC have
magic telling it to look through the gettext()?
Andrew
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-23 9:32 RFA: next gettextization step Tom Tromey
` (2 preceding siblings ...)
2002-06-24 19:24 ` Andrew Cagney
@ 2002-06-24 19:29 ` Andrew Cagney
2002-06-24 22:32 ` Tom Tromey
3 siblings, 1 reply; 12+ messages in thread
From: Andrew Cagney @ 2002-06-24 19:29 UTC (permalink / raw)
To: tromey; +Cc: gdb-patches
> Index: ChangeLog
> from Tom Tromey <tromey@redhat.com>
>
> * main.c: Marked all strings with _().
> * configure: Rebuilt.
> * configure.in (PACKAGE): New subst.
> (AC_OUTPUT): Create po/Makefile.in and po/Makefile.
> (SUBDIRS): Added po.
> * po/gdb.pot: New file.
> * po/POTFILES.in: New file.
> * po/.cvsignore: New file.
> * po/Make-in: New file.
>
Tom,
If I understand things correctly, the main.c change can go in without
the po/ change? The configure.in patch can also be split in two leaving
out the po/ part?
If this is correct then those parts are free to go in.
I'd like to see the po/ directory issues resolved (I've sent an e-mail
to binutils) before that is also created.
enjoy,
Andrew
PS: Every single printf_filtered() will need the change. printf() and
fprintfs() however should be considered illegal - they need to be
changed to printf_filtered()s.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-24 19:24 ` Andrew Cagney
@ 2002-06-24 20:10 ` Tom Tromey
2002-06-25 1:26 ` Andreas Schwab
1 sibling, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2002-06-24 20:10 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
Andrew> BTW, what effect does this have on -Werror -Wprintf? Does GCC
Andrew> have magic telling it to look through the gettext()?
On Linux boxes the installed libintl.h has such magic. On other
platforms I don't know. To be honest I haven't kept up with
developments in this area; perhaps importing a newer gettext into the
src repository would enable this capability for everybody using gcc.
I'm not certain. Such an import may not be entirely trivial; when I
did it the first time I had to make some changes to various configury
bits. I sent those upstream but I have never verified that they were
included in any subsequent release.
Tom
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-24 19:29 ` Andrew Cagney
@ 2002-06-24 22:32 ` Tom Tromey
0 siblings, 0 replies; 12+ messages in thread
From: Tom Tromey @ 2002-06-24 22:32 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
>>>>> "Andrew" == Andrew Cagney <ac131313@cygnus.com> writes:
Andrew> If I understand things correctly, the main.c change can go in
Andrew> without the po/ change? The configure.in patch can also be
Andrew> split in two leaving out the po/ part?
There's no point in splitting the configure.in patch. The PACKAGE
subst is only used by po/Make-in.
Andrew> If this is correct then those parts are free to go in.
Thanks, I'm checking in the main.c change.
Andrew> I'd like to see the po/ directory issues resolved (I've sent
Andrew> an e-mail to binutils) before that is also created.
Ok. Feel free to CC me on that discussion if you like.
Tom
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: RFA: next gettextization step
2002-06-24 19:24 ` Andrew Cagney
2002-06-24 20:10 ` Tom Tromey
@ 2002-06-25 1:26 ` Andreas Schwab
1 sibling, 0 replies; 12+ messages in thread
From: Andreas Schwab @ 2002-06-25 1:26 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches
Andrew Cagney <ac131313@cygnus.com> writes:
|> > - fprintf_unfiltered (gdb_stderr, "%s: unable to load tclcommand file \"%s\"",
|> > + fprintf_unfiltered (gdb_stderr, _("%s: unable to load tclcommand file \"%s\""),
|> > argv[0], optarg);
|> > exit (1);
|> BTW, what effect does this have on -Werror -Wprintf? Does GCC have magic
|> telling it to look through the gettext()?
Yes, through the format_arg attribute, which gettext has by default.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2002-06-25 8:26 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-23 9:32 RFA: next gettextization step Tom Tromey
2002-06-23 9:47 ` Tom Tromey
2002-06-24 10:05 ` Andrew Cagney
2002-06-24 13:58 ` Tom Tromey
2002-06-24 16:33 ` Andrew Cagney
[not found] ` <mailpost.1024961614.24442@news-sj1-1>
2002-06-24 16:37 ` cgd
2002-06-24 16:51 ` Tom Tromey
2002-06-24 19:24 ` Andrew Cagney
2002-06-24 20:10 ` Tom Tromey
2002-06-25 1:26 ` Andreas Schwab
2002-06-24 19:29 ` Andrew Cagney
2002-06-24 22:32 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox