jcf-dump.c (main): Updated for change to jcf_path_seal.
authorTom Tromey <tromey@redhat.com>
Thu, 16 Aug 2001 21:52:14 +0000 (21:52 +0000)
committerTom Tromey <tromey@gcc.gnu.org>
Thu, 16 Aug 2001 21:52:14 +0000 (21:52 +0000)
* 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

gcc/java/ChangeLog
gcc/java/gjavah.c
gcc/java/jcf-dump.c
gcc/java/jcf-path.c
gcc/java/jcf.h
gcc/java/lang.c

index c4589c3c26f5cb71a83f5441d245dfd272419bf1..9be2fce369349c33a11cc1fc070e36e0527ff48f 100644 (file)
@@ -1,3 +1,13 @@
+2001-08-16  Tom Tromey  <tromey@redhat.com>
+
+       * 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  <zackw@panix.com>
 
        * Make-lang.in (java/decl.o): Update dependencies.
index b56c0a61d83313ca59cb12b8d4080e3c6c7ff1d3..47617af5d414e69cd8369454212af9a4c24fab5c 100644 (file)
@@ -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)
     {
index de9758d4e169f563730e6b309a4ccbd46cc8820f..0f28ce940339cf0d82aa8b5fa6c0dfe8d38c12bf 100644 (file)
@@ -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)
     {
index a9e1bda70aa99dedfc77910475d5cb70d8017f04..079cb365411eed6e725f010be328f4f6bc4f80e9 100644 (file)
@@ -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 *
index fc3cedfe838dea18e4aaec4506101921098b8693..1feaaa8bccf04095a9ca8486f2e98a42b10fe5f5 100644 (file)
@@ -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 *));
index b9cb0fea7b6f64e609eb50c9a6c3cec681773ec2..dd997a50336a0a6e23ba002325980d2123577857 100644 (file)
@@ -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;