aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/lang.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@cygnus.com>1998-10-22 12:06:05 +0000
committerTom Tromey <tromey@gcc.gnu.org>1998-10-22 12:06:05 +0000
commit8603f9c5b022356e3993539be8c70358d935c710 (patch)
tree9b6b5425af73b8159f8c9b6dcf195daebe2e6914 /gcc/java/lang.c
parent8a829fd982378e9ae9f603e2df8d157e1f7c3d83 (diff)
downloadgcc-8603f9c5b022356e3993539be8c70358d935c710.zip
gcc-8603f9c5b022356e3993539be8c70358d935c710.tar.gz
gcc-8603f9c5b022356e3993539be8c70358d935c710.tar.bz2
jcf-io.c (find_class): Use saw_java_source to determine when to look for `.java' file.
* jcf-io.c (find_class): Use saw_java_source to determine when to look for `.java' file. * jcf-parse.c (saw_java_source): New global. (yyparse): Set it if `.java' file seen. * Make-lang.in (JAVA_SRCS): Added jcf-path.c. (GCJH_SOURCES): Likewise. * Makefile.in (datadir): New macro. (libjava_zip): Likewise. (JAVA_OBJS): Added jcf-path.o. (../jcf-dump$(exeext)): Depend on and link with jcf-depend.o. (../gcjh$(exeext)): Likewise. (jcf-path.o): New target. * java-tree.h (fix_classpath): Removed decl. * jcf-parse.c (fix_classpath): Removed. (load_class): Don't call fix_classpath. * parse.y (read_import_dir): Don't call fix_classpath. * lex.h: Don't mention classpath. * lex.c (java_init_lex): Don't initialize classpath. * jcf-io.c (classpath): Removed global. (find_class): Use jcf_path iteration functions. Correctly search class path for .java file. (open_in_zip): New argument `is_system'. * jcf-dump.c (main): Call jcf_path_init. Recognize all new classpath-related options. * lang.c (lang_decode_option): Handle -fclasspath, -fCLASSPATH, and -I. (lang_init): Call jcf_path_init. * lang-options.h: Mention -I, -fclasspath, and -fCLASSPATH. * lang-specs.h: Handle -I. Minor cleanup to -M options. Correctly put braces around second string in each entry. * gjavah.c (main): Call jcf_path_init. Recognize all the new classpath-related options. (help): Updated for new options. * jcf.h: Declare functions from jcf-path.c. Don't mention `classpath' global. * jcf-path.c: New file. * jcf-depend.c: Include jcf.h. * jcf-write.c (localvar_alloc): Returns `void'. (localvar_free): Removed unused variable. * lang.c (OBJECT_SUFFIX): Define if not already defined. (init_parse): Use OBJECT_SUFFIX, not ".o". From-SVN: r23219
Diffstat (limited to 'gcc/java/lang.c')
-rw-r--r--gcc/java/lang.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index df6c50d..b425b8b 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -33,6 +33,10 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#include "toplev.h"
#include "flags.h"
+#ifndef OBJECT_SUFFIX
+# define OBJECT_SUFFIX ".o"
+#endif
+
/* Table indexed by tree code giving a string containing a character
classifying the tree code. Possibilities are
t, d, s, c, r, <, 1 and 2. See java/java-tree.def for details. */
@@ -179,6 +183,26 @@ lang_decode_option (argc, argv)
return 1;
}
+#define CLARG "-fclasspath="
+ if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
+ {
+ jcf_path_classpath_arg (p + sizeof (CLARG));
+ return 1;
+ }
+#undef CLARG
+#define CLARG "-fCLASSPATH="
+ else if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0)
+ {
+ jcf_path_CLASSPATH_arg (p + sizeof (CLARG));
+ return 1;
+ }
+#undef CLARG
+ else if (strncmp (p, "-I", 2) == 0)
+ {
+ jcf_path_include_arg (p + 2);
+ return 1;
+ }
+
return 0;
}
@@ -207,7 +231,8 @@ init_parse (filename)
error ("couldn't determine target name for dependency tracking");
else
{
- char *buf = (char *) xmalloc (dot - filename + 3);
+ char *buf = (char *) xmalloc (dot - filename +
+ 3 + sizeof (OBJECT_SUFFIX));
strncpy (buf, filename, dot - filename);
/* If emitting class files, we might have multiple
@@ -218,7 +243,7 @@ init_parse (filename)
jcf_dependency_set_target (NULL);
else
{
- strcpy (buf + (dot - filename), ".o");
+ strcpy (buf + (dot - filename), OBJECT_SUFFIX);
jcf_dependency_set_target (buf);
}
@@ -421,6 +446,9 @@ lang_init ()
flag_minimal_debug = 0;
#endif
+ jcf_path_init ();
+ jcf_path_seal ();
+
decl_printable_name = lang_printable_name;
print_error_function = lang_print_error;
lang_expand_expr = java_lang_expand_expr;