diff options
author | Tom Tromey <tromey@cygnus.com> | 1998-10-22 12:06:05 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 1998-10-22 12:06:05 +0000 |
commit | 8603f9c5b022356e3993539be8c70358d935c710 (patch) | |
tree | 9b6b5425af73b8159f8c9b6dcf195daebe2e6914 /gcc/java/gjavah.c | |
parent | 8a829fd982378e9ae9f603e2df8d157e1f7c3d83 (diff) | |
download | gcc-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/gjavah.c')
-rw-r--r-- | gcc/java/gjavah.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 4ad28db..c8a9fac 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -31,6 +31,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #endif #include <math.h> +#include <string.h> + /* The output file. */ FILE *out = NULL; @@ -877,6 +879,8 @@ help () printf ("Usage: gcjh [OPTION]... CLASS...\n\n"); printf ("Generate C++ header files from .class files\n\n"); printf (" --classpath PATH Set path to find .class files\n"); + printf (" --CLASSPATH PATH Set path to find .class files\n"); + printf (" -IDIR Append directory to class path\n"); printf (" -d DIRECTORY Set output directory name\n"); printf (" --help Print this help, then exit\n"); printf (" -o FILE Set output file name\n"); @@ -918,6 +922,8 @@ DEFUN(main, (argc, argv), if (argc <= 1) usage (); + jcf_path_init (); + for (argi = 1; argi < argc; argi++) { char *arg = argv[argi]; @@ -997,10 +1003,19 @@ DEFUN(main, (argc, argv), else if (strcmp (arg, "-classpath") == 0) { if (argi + 1 < argc) - classpath = argv[++argi]; + jcf_path_classpath_arg (argv[++argi]); else java_no_argument (argv[argi]); } + else if (strcmp (arg, "-CLASSPATH") == 0) + { + if (argi + 1 < argc) + jcf_path_CLASSPATH_arg (argv[++argi]); + else + java_no_argument (argv[argi]); + } + else if (strncmp (arg, "-I", 2) == 0) + jcf_path_include_arg (arg + 2); else if (strcmp (arg, "-verbose") == 0 || strcmp (arg, "-v") == 0) verbose++; else if (strcmp (arg, "-stubs") == 0) @@ -1046,19 +1061,14 @@ DEFUN(main, (argc, argv), if (argi == argc) usage (); + jcf_path_seal (); + if (output_file && emit_dependencies) { fprintf (stderr, "gcjh: can't specify both -o and -MD\n"); exit (1); } - if (classpath == NULL) - { - classpath = (char *) getenv ("CLASSPATH"); - if (classpath == NULL) - classpath = ""; - } - for (; argi < argc; argi++) { char *classname = argv[argi]; |