This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
jvspec patch
- To: gcc-patches at gcc dot gnu dot org, java-patches at gcc dot gnu dot org
- Subject: jvspec patch
- From: Per Bothner <per at bothner dot com>
- Date: 15 Mar 2001 20:44:54 -0800
This is a follow-up to my February 16 patch, which supported
compiling multiple .java files in one jc1 invokaction, as well
as the @FILE command-line syntax.
This patches fixes -save-temps handling of the TMPFILE created
when 'gcj -c -o foo.o bar.java baz.java' is implemented like
'gcj -c -o foo.o @TMPFILE'.
It also fixes the case where -C got broken.
I checked this into the cvs trunk.
2001-03-13 Per Bothner <per@bothner.com>
* jvspec.c (lang_specific_driver): Fix -C handling.
Check -save-temps to see if temp @FILE should be deleted.
Follow-up to/fix for February 16 patch.
Index: jvspec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/jvspec.c,v
retrieving revision 1.36
diff -u -p -r1.36 jvspec.c
--- jvspec.c 2001/02/24 03:28:39 1.36
+++ jvspec.c 2001/03/16 04:19:15
@@ -101,6 +101,8 @@ lang_specific_driver (in_argc, in_argv,
/* If non-zero, the user gave us the `-v' flag. */
int saw_verbose_flag = 0;
+ int saw_save_temps = 0;
+
/* This will be 0 if we encounter a situation where we should not
link in libgcj. */
int library = 1;
@@ -302,6 +304,8 @@ lang_specific_driver (in_argc, in_argv,
will_link = 0;
continue;
}
+ else if (strcmp (argv[i], "-save-temps") == 0)
+ saw_save_temps = 1;
else if (strcmp (argv[i], "-static-libgcc") == 0
|| strcmp (argv[i], "-static") == 0)
shared_libgcc = 0;
@@ -363,7 +367,8 @@ lang_specific_driver (in_argc, in_argv,
if (saw_o)
fatal ("cannot specify both -C and -o");
}
- if (saw_o && java_files_count + (saw_C ? 0 : class_files_count) > 1)
+ if ((saw_o && java_files_count + class_files_count > 1)
+ || (saw_C && java_files_count > 1))
combine_inputs = 1;
if (class_files_count > 1)
combine_inputs = 1;
@@ -373,7 +378,7 @@ lang_specific_driver (in_argc, in_argv,
filelist_filename = make_temp_file ("jx");
if (filelist_filename == NULL)
fatal ("cannot create temporary file");
- record_temp_file (filelist_filename, 1, 0);
+ record_temp_file (filelist_filename, ! saw_save_temps, 0);
filelist_file = fopen (filelist_filename, "w");
if (filelist_file == NULL)
pfatal_with_name (filelist_filename);
--
--Per Bothner
per@bothner.com http://www.bothner.com/~per/