This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: RFA: fix PR java/15578 (not just a java patch)
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Cc: Java Patch List <java-patches at gcc dot gnu dot org>,Andrew Haley <aph at redhat dot com>
- Date: 23 Sep 2004 13:03:18 -0600
- Subject: Patch: RFA: fix PR java/15578 (not just a java patch)
- Reply-to: tromey at redhat dot com
This patch fixes PR 15578.
We want to accept "-extdirs" and "-encoding" (single dash) in addition
to the double-dash long forms. This is needed for compatibility with
javac. Also it seems to me that if we support "--option=value" we
should also support the "--option value" form.
This patch accomplishes this by modifications in a few places. It
occurred to me later that this could perhaps be cleaned up a bit by
moving the "--" forms out of gcc.c and handling it all purely in
jvspec.c. Is that preferable? I left it as is, following existing
code. If it is preferable to do it the other way I'll write a patch
that removes the java-specific bits from gcc.c:option_map.
Comments? Ok?
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
PR java/15578:
* gcc.c (option_map): Added --extdirs and --encoding.
Index: gcc.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gcc.c,v
retrieving revision 1.434
diff -u -r1.434 gcc.c
--- gcc.c 18 Sep 2004 19:47:09 -0000 1.434
+++ gcc.c 23 Sep 2004 18:57:09 -0000
@@ -1064,8 +1064,10 @@
{"--dependencies", "-M", 0},
{"--dump", "-d", "a"},
{"--dumpbase", "-dumpbase", "a"},
+ {"--encoding", "-fencoding=", "aj"},
{"--entry", "-e", 0},
{"--extra-warnings", "-W", 0},
+ {"--extdirs", "-fextdirs=", "aj"},
{"--for-assembler", "-Wa", "a"},
{"--for-linker", "-Xlinker", "a"},
{"--force-link", "-u", "a"},
Index: java/ChangeLog
from Tom Tromey <tromey@redhat.com>
PR java/15578:
* lang.opt (--extdirs): Document.
* jvspec.c (lang_specific_driver): Recognize -encoding and
-extdirs.
Index: java/jvspec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jvspec.c,v
retrieving revision 1.66
diff -u -r1.66 jvspec.c
--- java/jvspec.c 5 Oct 2003 02:52:33 -0000 1.66
+++ java/jvspec.c 23 Sep 2004 18:57:16 -0000
@@ -1,6 +1,6 @@
/* 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, 2002, 2003
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
Free Software Foundation, Inc.
This file is part of GCC.
@@ -324,9 +324,11 @@
saw_o = 1;
quote = argv[i];
}
- else if (strcmp(argv[i], "-classpath") == 0
- || strcmp(argv[i], "-bootclasspath") == 0
- || strcmp(argv[i], "-CLASSPATH") == 0)
+ else if (strcmp (argv[i], "-classpath") == 0
+ || strcmp (argv[i], "-bootclasspath") == 0
+ || strcmp (argv[i], "-CLASSPATH") == 0
+ || strcmp (argv[i], "-encoding") == 0
+ || strcmp (argv[i], "-extdirs") == 0)
{
quote = argv[i];
added -= 1;
@@ -507,7 +509,9 @@
if (strcmp (argv[i], "-classpath") == 0
|| strcmp (argv[i], "-bootclasspath") == 0
- || strcmp (argv[i], "-CLASSPATH") == 0)
+ || strcmp (argv[i], "-CLASSPATH") == 0
+ || strcmp (argv[i], "-encoding") == 0
+ || strcmp (argv[i], "-extdirs") == 0)
{
arglist[j] = concat ("-f", argv[i]+1, "=", argv[i+1], NULL);
i++;
Index: java/lang.opt
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/lang.opt,v
retrieving revision 1.10
diff -u -r1.10 lang.opt
--- java/lang.opt 10 Aug 2004 04:29:16 -0000 1.10
+++ java/lang.opt 23 Sep 2004 18:57:16 -0000
@@ -132,6 +132,7 @@
fextdirs=
Java Joined RejectNegative
+--extdirs=<path> Set the extension directory path
ffilelist-file
Java Var(flag_filelist_file)