This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix for CLASSPATH/classpath switch behaviour


The current classpath switches do the following:

-classpath X
sets X as the class path, overriding the system class path.

-CLASSPATH 
sets X as the class path, without overriding the system class path.


Unfortunately, this does not match what Sun's javac compiler
does. With javac the -classpath switch does NOT override the system
class path.

If GCJ uses different semantics for options then it's quite difficult
to just swap GCJ into a build environment, replacing javac (one has
to alter makefiles at least!)

The attached patch solves the problem. It simply swaps the meaning of
the two options.


Nic Ferrier


*** lang.c.~1.84.~	Tue Jan  1 01:42:15 2002
--- lang.c	Fri Feb  8 01:32:11 2002
***************
*** 299,312 ****
        return 1;
      }
  #undef CLARG
! #define CLARG "-fclasspath="
    if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
      {
        jcf_path_classpath_arg (p + sizeof (CLARG) - 1);
        return 1;
      }
  #undef CLARG
! #define CLARG "-fCLASSPATH="
    if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
      {
        jcf_path_CLASSPATH_arg (p + sizeof (CLARG) - 1);
--- 299,312 ----
        return 1;
      }
  #undef CLARG
! #define CLARG "-fCLASSPATH="
    if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
      {
        jcf_path_classpath_arg (p + sizeof (CLARG) - 1);
        return 1;
      }
  #undef CLARG
! #define CLARG "-fclasspath="
    if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
      {
        jcf_path_CLASSPATH_arg (p + sizeof (CLARG) - 1);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]