This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: for 3.1: gcj --resource
- From: Tom Tromey <tromey at redhat dot com>
- To: Jeff Sturm <jsturm at one-point dot com>
- Cc: Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 22 Apr 2002 14:41:43 -0600
- Subject: Re: Patch: for 3.1: gcj --resource
- References: <Pine.LNX.4.10.10204221548570.12940-100000@mars.deadcafe.org>
- Reply-to: tromey at redhat dot com
>>>>> "Jeff" == Jeff Sturm <jsturm@one-point.com> writes:
>> - else if (strcmp (argv[i], "-R") == 0)
>> + else if (strcmp (argv[i], "-resource") == 0)
Jeff> Should the 2nd arg be "--resource"? Or am I missing something?
Oops. That code is actually dead. I just forgot to remove it.
Try this patch instead. Sorry about that.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* gcc.c: Added --resource. For PR java/6314.
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.296.2.11
diff -u -r1.296.2.11 gcc.c
--- gcc.c 15 Apr 2002 18:59:43 -0000 1.296.2.11
+++ gcc.c 22 Apr 2002 20:06:22 -0000
@@ -967,6 +967,7 @@
{"--profile", "-p", 0},
{"--profile-blocks", "-a", 0},
{"--quiet", "-q", 0},
+ {"--resource", "-fcompile-resource=", "aj"},
{"--save-temps", "-save-temps", 0},
{"--shared", "-shared", 0},
{"--silent", "-q", 0},
Index: java/ChangeLog
from Tom Tromey <tromey@redhat.com>
For PR java/6314:
* jvspec.c (lang_specific_driver): Use --resource, not -R. Also
recognize `-fcompile-resource='.
* gcj.texi (Invoking gcj): Use --resource, not -R. Expanded text
a bit.
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 22 Apr 2002 20:06:38 -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{--resource} @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{--resource}.
(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 --resource @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 22 Apr 2002 20:06:39 -0000
@@ -210,8 +210,8 @@
int saw_libgcj ATTRIBUTE_UNUSED = 0;
#endif
- /* Saw -R, -C or -o options, respectively. */
- int saw_R = 0;
+ /* Saw --resource, -C or -o options, respectively. */
+ int saw_resource = 0;
int saw_C = 0;
int saw_o = 0;
@@ -303,13 +303,12 @@
library = 0;
will_link = 0;
}
- else if (strcmp (argv[i], "-R") == 0)
+ else if (strncmp (argv[i], "-fcompile-resource=", 19) == 0)
{
- saw_R = 1;
- quote = argv[i];
+ saw_resource = 1;
want_spec_file = 0;
if (library != 0)
- added -= 2;
+ --added;
library = 0;
will_link = 0;
}
@@ -382,7 +381,7 @@
continue;
}
- if (saw_R)
+ if (saw_resource)
{
args[i] |= RESOURCE_FILE_ARG;
last_input_index = i;
@@ -430,10 +429,10 @@
fatal ("`%s' is not a valid class name", main_class_name);
num_args = argc + added;
- if (saw_R)
+ if (saw_resource)
{
if (! saw_o)
- fatal ("-R requires -o");
+ fatal ("--resource requires -o");
}
if (saw_C)
{
@@ -512,15 +511,6 @@
arglist[j++] = "-xjava";
arglist[j++] = argv[i];
arglist[j] = "-xnone";
- }
-
- if (strcmp (argv[i], "-R") == 0)
- {
- arglist[j] = concat ("-fcompile-resource=",
- *argv[i+1] == '/' ? "" : "/",
- argv[i+1], NULL);
- i++;
- continue;
}
if (strcmp (argv[i], "-classpath") == 0