summaryrefslogtreecommitdiff
path: root/gcc/java/jvspec.c
diff options
context:
space:
mode:
authorgreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-06 22:22:44 +0000
committergreen <green@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-06 22:22:44 +0000
commit7ad6876a9f0dff76e33dab6c0b59102017e3531c (patch)
tree37aff30da6021cca7b3d351d0edb6a2570cbf393 /gcc/java/jvspec.c
parent2a9870bd4c21a53bb1fad26248764444e0d67585 (diff)
downloadgcc-7ad6876a9f0dff76e33dab6c0b59102017e3531c.tar.gz
* class.c (O_BINARY): Define if necessary.
(registerResource_libfunc): Declare. (init_class_processing): Initilize registerResource_libfunc. (compile_resource_file): New function. * java-tree.h (resource_name): Declare. (compile_resource_file): Declare. * jcf-parse.c (yyparse): Handle compiling java resource files. * lang.c (java_decode_option): Handle -fcompile-resource option. * jvspec.c (lang_specific_driver): Handle -R flag for compiling resource files. * gcj.texi (Code Generation): Add documentation for -R flag. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45448 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/jvspec.c')
-rw-r--r--gcc/java/jvspec.c47
1 files changed, 45 insertions, 2 deletions
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c
index 44342cf401a..fd6d08f58d3 100644
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -1,4 +1,4 @@
- /* Specific flags and argument handling of the front-end of the
+/* Specific flags and argument handling of the front-end of the
GNU compiler for the Java(TM) language.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
@@ -42,6 +42,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#define ZIP_FILE_ARG (1<<5)
/* True if this arg is @FILE - where FILE contains a list of filenames. */
#define INDIRECT_FILE_ARG (1<<6)
+/* True if this arg is a resource file. */
+#define RESOURCE_FILE_ARG (1<<7)
static char *find_spec_file PARAMS ((const char *));
@@ -59,6 +61,7 @@ const char jvgenmain_spec[] =
%{v:-version} %{pg:-p} %{p}\
%{<fbounds-check} %{<fno-bounds-check}\
%{<fassume-compiled} %{<fno-assume-compiled}\
+ %{<fcompile-resource*}\
%{<femit-class-file} %{<femit-class-files} %{<fencoding*}\
%{<fuse-boehm-gc} %{<fhash-synchronization} %{<fjni}\
%{<fclasspath*} %{<fCLASSPATH*} %{<foutput-class-dir}\
@@ -164,7 +167,8 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
int saw_libgcj ATTRIBUTE_UNUSED = 0;
#endif
- /* Saw -C or -o option, respectively. */
+ /* Saw -R, -C or -o options, respectively. */
+ int saw_R = 0;
int saw_C = 0;
int saw_o = 0;
@@ -256,6 +260,16 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
library = 0;
will_link = 0;
}
+ else if (strcmp (argv[i], "-R") == 0)
+ {
+ saw_R = 1;
+ quote = argv[i];
+ want_spec_file = 0;
+ if (library != 0)
+ added -= 2;
+ library = 0;
+ will_link = 0;
+ }
else if (argv[i][1] == 'D')
saw_D = 1;
else if (argv[i][1] == 'g')
@@ -324,6 +338,13 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
continue;
}
+ if (saw_R)
+ {
+ args[i] |= RESOURCE_FILE_ARG;
+ last_input_index = i;
+ added += 2; /* for -xjava and -xnone */
+ }
+
if (argv[i][0] == '@')
{
args[i] |= INDIRECT_FILE_ARG;
@@ -362,6 +383,11 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
fatal ("can't specify `-D' without `--main'\n");
num_args = argc + added;
+ if (saw_R)
+ {
+ if (! saw_o)
+ fatal ("-R requires -o");
+ }
if (saw_C)
{
num_args += 3;
@@ -434,6 +460,23 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
if ((args[i] & PARAM_ARG) || i == 0)
continue;
+ if ((args[i] & RESOURCE_FILE_ARG) != 0)
+ {
+ arglist[j++] = "-xjava";
+ arglist[j++] = argv[i];
+ arglist[j] = "-xnone";
+ }
+
+ if (strcmp (argv[i], "-R") == 0)
+ {
+ char *ptr = argv[i+i];
+ arglist[j] = concat ("-fcompile-resource=",
+ *argv[i+1] == '/' ? "" : "/",
+ argv[i+1], NULL);
+ i++;
+ continue;
+ }
+
if (strcmp (argv[i], "-classpath") == 0
|| strcmp (argv[i], "-CLASSPATH") == 0)
{