Proposed PATCH: -classpath and -CLASSPATH options

Tom Tromey tromey@cygnus.com
Fri Oct 16 14:02:00 GMT 1998


Some background: for Java, we'd like `gcc -femit-class-files' to be
compatible with Sun's `javac'.  As a result we'd like a `-classpath'
option to gcc that takes an argument (the class path).

We also want a -CLASSPATH option that has a similar, but slightly
different, meaning.

There doesn't appear to be any way to specify a language-dependent
option which takes a separate argument.  Furthermore, a comment in
gcc.c leads me to believe that this is considered impossible.

Therefore I wrote the appended patch, which adds `classpath' and
`CLASSPATH' to DEFAULT_WORD_SWITCH_TAKES_ARG.

Here is a ChangeLog entry:

Fri Oct 16 12:26:09 1998  Tom Tromey  <tromey@cygnus.com>

	* gcc.c (DEFAULT_WORD_SWITCH_TAKES_ARG): Add classpath and
	CLASSPATH.

Tom

Index: gcc.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/gcc.c,v
retrieving revision 1.61
diff -u -r1.61 gcc.c
--- gcc.c	1998/10/14 10:36:47	1.61
+++ gcc.c	1998/10/16 20:46:52
@@ -557,7 +557,8 @@
   || !strcmp (STR, "imacros") || !strcmp (STR, "aux-info") \
   || !strcmp (STR, "idirafter") || !strcmp (STR, "iprefix") \
   || !strcmp (STR, "iwithprefix") || !strcmp (STR, "iwithprefixbefore") \
-  || !strcmp (STR, "isystem") || !strcmp (STR, "specs"))
+  || !strcmp (STR, "isystem") || !strcmp (STR, "specs") \
+  || !strcmp (STR, "classpath") || !strcmp (STR, "CLASSPATH"))
 
 #ifndef WORD_SWITCH_TAKES_ARG
 #define WORD_SWITCH_TAKES_ARG(STR) DEFAULT_WORD_SWITCH_TAKES_ARG (STR)



More information about the Gcc-patches mailing list