Patch: for 3.1: fix PR 6314
Tom Tromey
tromey@redhat.com
Fri Apr 19 22:27:00 GMT 2002
This patch fixes PR 6314.
The `-R' option is already in use by gcc on some platforms, though it
is not documented. We inadvertently made gcj conflict with this.
This patch changes the name of the option to -P.
I've also expanded the text in the manual a bit to clear up my own
confusion about how to use this option.
-P was chosen because apparently it is only used by cpp, and we
already use -C in a way that conflicts with cpp. Also, -P is somewhat
mnemonic since this will mostly be used for property files.
Ok to commit? I think this is important for the branch. This option
has never been in a release before, so now is the best time to change
it.
When this goes in I will also check in a change to update the relevant
web pages.
Tom
Index: java/ChangeLog
from Tom Tromey <tromey@redhat.com>
For PR java/6314:
* gcj.texi (Invoking gcj): Use -P, not -R. Expanded text a bit.
* jvspec.c (lang_specific_driver): Use -P, not -R.
Index: java/gcj.texi
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/gcj.texi,v
retrieving revision 1.22.2.8
diff -u -r1.22.2.8 gcj.texi
--- java/gcj.texi 10 Apr 2002 16:10:46 -0000 1.22.2.8
+++ java/gcj.texi 20 Apr 2002 05:24:05 -0000
@@ -150,7 +150,7 @@
[@option{--CLASSPATH}=@var{path}] [@option{--classpath}=@var{path}]
[@option{-f}@var{option}@dots{}] [@option{--encoding}=@var{name}]
[@option{--main}=@var{classname}] [@option{-D}@var{name}[=@var{value}]@dots{}]
- [@option{-C}] [@option{-R} @var{resource-name}] [@option{-d} @var{directory}]
+ [@option{-C}] [@option{-P} @var{resource-name}] [@option{-d} @var{directory}]
[@option{-W}@var{warn}@dots{}]
@var{sourcefile}@dots{}
@c man end
@@ -213,7 +213,7 @@
option, all the input files will be compiled together, producing a
single output file, named @var{FILENAME}.
This is allowed even when using @code{-S} or @code{-c},
-but not when using @code{-C} or @code{-R}.
+but not when using @code{-C} or @code{-P}.
(This is an extension beyond the what plain @command{gcc} allows.)
(If more than one input file is specified, all must currently
be @code{.java} files, though we hope to fix this.)
@@ -387,10 +387,14 @@
This option is used to tell @command{gcj} to generate bytecode
(@file{.class} files) rather than object code.
-@item -R @var{resource-name}
+@item -P @var{resource-name}
This option is used to tell @command{gcj} to compile the contents of a
given file to object code so it may be accessed at runtime with the core
-protocol handler as @var{core:/resource-name}.
+protocol handler as @samp{core:/@var{resource-name}}. Note that
+@var{resource-name} is the name of the resource as found at runtime; for
+instance, it could be used in a call to @code{ResourceBundle.getBundle}.
+The actual file name to be compiled this way must be specified
+separately.
@item -d @var{directory}
When used with @code{-C}, this causes all generated @file{.class} files
Index: java/jvspec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jvspec.c,v
retrieving revision 1.52.2.3
diff -u -r1.52.2.3 jvspec.c
--- java/jvspec.c 10 Apr 2002 13:09:02 -0000 1.52.2.3
+++ java/jvspec.c 20 Apr 2002 05:24:05 -0000
@@ -210,8 +210,8 @@
int saw_libgcj ATTRIBUTE_UNUSED = 0;
#endif
- /* Saw -R, -C or -o options, respectively. */
- int saw_R = 0;
+ /* Saw -P, -C or -o options, respectively. */
+ int saw_P = 0;
int saw_C = 0;
int saw_o = 0;
@@ -303,9 +303,9 @@
library = 0;
will_link = 0;
}
- else if (strcmp (argv[i], "-R") == 0)
+ else if (strcmp (argv[i], "-P") == 0)
{
- saw_R = 1;
+ saw_P = 1;
quote = argv[i];
want_spec_file = 0;
if (library != 0)
@@ -382,7 +382,7 @@
continue;
}
- if (saw_R)
+ if (saw_P)
{
args[i] |= RESOURCE_FILE_ARG;
last_input_index = i;
@@ -430,10 +430,10 @@
fatal ("`%s' is not a valid class name", main_class_name);
num_args = argc + added;
- if (saw_R)
+ if (saw_P)
{
if (! saw_o)
- fatal ("-R requires -o");
+ fatal ("-P requires -o");
}
if (saw_C)
{
@@ -514,7 +514,7 @@
arglist[j] = "-xnone";
}
- if (strcmp (argv[i], "-R") == 0)
+ if (strcmp (argv[i], "-P") == 0)
{
arglist[j] = concat ("-fcompile-resource=",
*argv[i+1] == '/' ? "" : "/",
More information about the Java-patches
mailing list