From: Tom Tromey Date: Thu, 16 Aug 2001 21:52:14 +0000 (+0000) Subject: jcf-dump.c (main): Updated for change to jcf_path_seal. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4266d0b2722db521925be85f61ca1fa643afe409;p=gcc.git jcf-dump.c (main): Updated for change to jcf_path_seal. * jcf-dump.c (main): Updated for change to jcf_path_seal. * gjavah.c (main): Updated for change to jcf_path_seal. * lang.c (version_flag): New global. (java_decode_option): Recognize `-version'. (java_init): Update for change to jcf_path_seal. * jcf.h (jcf_path_seal): Added `print' argument. * jcf-path.c (jcf_path_seal): Added `print' argument. From-SVN: r44946 --- diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index c4589c3c26f..9be2fce3693 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,13 @@ +2001-08-16 Tom Tromey + + * jcf-dump.c (main): Updated for change to jcf_path_seal. + * gjavah.c (main): Updated for change to jcf_path_seal. + * lang.c (version_flag): New global. + (java_decode_option): Recognize `-version'. + (java_init): Update for change to jcf_path_seal. + * jcf.h (jcf_path_seal): Added `print' argument. + * jcf-path.c (jcf_path_seal): Added `print' argument. + 2001-08-13 Zack Weinberg * Make-lang.in (java/decl.o): Update dependencies. diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index b56c0a61d83..47617af5d41 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -1,7 +1,7 @@ /* Program to write C++-suitable header files from a Java(TM) .class file. This is similar to SUN's javah. -Copyright (C) 1996, 1998, 1999, 2000 Free Software Foundation, Inc. +Copyright (C) 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -2171,7 +2171,7 @@ DEFUN(main, (argc, argv), usage (); } - jcf_path_seal (); + jcf_path_seal (verbose); if (output_file && emit_dependencies) { diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c index de9758d4e16..0f28ce94033 100644 --- a/gcc/java/jcf-dump.c +++ b/gcc/java/jcf-dump.c @@ -1,7 +1,7 @@ /* Program to dump out a Java(TM) .class file. Functionally similar to Sun's javap. - Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -902,7 +902,7 @@ DEFUN(main, (argc, argv), usage (); } - jcf_path_seal (); + jcf_path_seal (verbose); if (flag_print_main) { diff --git a/gcc/java/jcf-path.c b/gcc/java/jcf-path.c index a9e1bda70aa..079cb365411 100644 --- a/gcc/java/jcf-path.c +++ b/gcc/java/jcf-path.c @@ -1,6 +1,6 @@ /* Handle CLASSPATH, -classpath, and path searching. - Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -311,9 +311,11 @@ jcf_path_include_arg (path) } /* We `seal' the path by linking everything into one big list. Then - we provide a way to iterate through the sealed list. */ + we provide a way to iterate through the sealed list. If PRINT is + true then we print the final class path to stderr. */ void -jcf_path_seal () +jcf_path_seal (print) + int print; { int do_system = 1; struct entry *secondary; @@ -351,6 +353,21 @@ jcf_path_seal () } else free_entry (&sys_dirs); + + if (print) + { + struct entry *ent; + fprintf (stderr, "Class path starts here:\n"); + for (ent = sealed; ent; ent = ent->next) + { + fprintf (stderr, " %s", ent->name); + if ((ent->flags & FLAG_SYSTEM)) + fprintf (stderr, " (system)"); + if ((ent->flags & FLAG_ZIP)) + fprintf (stderr, " (zip)"); + fprintf (stderr, "\n"); + } + } } void * diff --git a/gcc/java/jcf.h b/gcc/java/jcf.h index fc3cedfe838..1feaaa8bccf 100644 --- a/gcc/java/jcf.h +++ b/gcc/java/jcf.h @@ -1,6 +1,6 @@ /* Utility macros to read Java(TM) .class files and byte codes. - Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -273,7 +273,7 @@ extern void jcf_path_init PARAMS ((void)); extern void jcf_path_classpath_arg PARAMS ((const char *)); extern void jcf_path_CLASSPATH_arg PARAMS ((const char *)); extern void jcf_path_include_arg PARAMS ((const char *)); -extern void jcf_path_seal PARAMS ((void)); +extern void jcf_path_seal PARAMS ((int)); extern void *jcf_path_start PARAMS ((void)); extern void *jcf_path_next PARAMS ((void *)); extern char *jcf_path_name PARAMS ((void *)); diff --git a/gcc/java/lang.c b/gcc/java/lang.c index b9cb0fea7b6..dd997a50336 100644 --- a/gcc/java/lang.c +++ b/gcc/java/lang.c @@ -150,6 +150,9 @@ int flag_force_classes_archive_check; be tested alone, use STATIC_CLASS_INITIALIZATION_OPTIMIZATION_P instead. */ int flag_optimize_sci = 1; +/* When non zero, print extra version information. */ +static int version_flag = 0; + /* Table of language-dependent -f options. STRING is the option name. VARIABLE is the address of the variable. ON_VALUE is the value to store in VARIABLE @@ -236,6 +239,13 @@ java_decode_option (argc, argv) { char *p = argv[0]; + if (strcmp (p, "-version") == 0) + { + version_flag = 1; + /* We return 0 so that the caller can process this. */ + return 0; + } + #define CLARG "-fassume-compiled=" if (strncmp (p, CLARG, sizeof (CLARG) - 1) == 0) { @@ -655,7 +665,7 @@ java_init () #endif jcf_path_init (); - jcf_path_seal (); + jcf_path_seal (version_flag); decl_printable_name = lang_printable_name; print_error_function = lang_print_error;