summaryrefslogtreecommitdiff
path: root/gcc/java/jvspec.c
diff options
context:
space:
mode:
authorro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-02 12:26:00 +0000
committerro <ro@138bc75d-0d04-0410-961f-82ee72b054a4>2001-08-02 12:26:00 +0000
commit19dcb05b64dac1b3f6b41b66fbf6335bfcaa4926 (patch)
tree9d31c155fc6533acc82d406f6aeb96eb7ad549f9 /gcc/java/jvspec.c
parenteaf45f93c4ee922dbe317b8b9d7e180641fc86a8 (diff)
downloadgcc-19dcb05b64dac1b3f6b41b66fbf6335bfcaa4926.tar.gz
* gcc.c (set_collect_gcc_options): New function, split out from
main. Ignore elided switches. (do_spec_1): Invoke before executing command. (set_input): Export. Move declaration ... * gcc.h (set_input): ... here. * config/alpha/osf.h (ASM_FINAL_SPEC): Use %U.s to refer to input file. java: * jvspec.c (jvgenmain_spec): Cannot use %umain, breaks ASM_FINAL_SPEC. (lang_specific_pre_link): Use set_input to set input_filename. Append `main' here. * jvgenmain.c (usage): Append literal `main' to CLASSNAME. (main): Fix definition. Strip `main' from classname. Fixes PR java/227. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44572 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/jvspec.c')
-rw-r--r--gcc/java/jvspec.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c
index 44342cf401a..761c580310d 100644
--- a/gcc/java/jvspec.c
+++ b/gcc/java/jvspec.c
@@ -52,8 +52,8 @@ int lang_specific_extra_outfiles = 0;
int shared_libgcc = 1;
const char jvgenmain_spec[] =
- "jvgenmain %{D*} %i %{!pipe:%umain.i} |\n\
- cc1 %{!pipe:%Umain.i} %1 \
+ "jvgenmain %{D*} %b %{!pipe:%u.i} |\n\
+ cc1 %{!pipe:%U.i} %1 \
%{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
%{g*} %{O*} \
%{v:-version} %{pg:-p} %{p}\
@@ -68,8 +68,8 @@ const char jvgenmain_spec[] =
%{f*} -fdollars-in-identifiers\
%{aux-info*}\
%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
- %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%Umain.s}} |\n\
- %{!S:as %a %Y -o %d%w%umain%O %{!pipe:%Umain.s} %A\n }";
+ %{S:%W{o*}%{!o*:-o %b.s}}%{!S:-o %{|!pipe:%U.s}} |\n\
+ %{!S:as %a %Y -o %d%w%u%O %{!pipe:%U.s} %A\n }";
/* Return full path name of spec file if it is in DIR, or NULL if
not. */
@@ -529,8 +529,14 @@ lang_specific_pre_link ()
int err;
if (main_class_name == NULL)
return 0;
- input_filename = main_class_name;
- input_filename_length = strlen (main_class_name);
+ /* Append `main' to make the filename unique and allow
+
+ gcj --main=hello -save-temps hello.java
+
+ to work. jvgenmain needs to strip this `main' to arrive at the correct
+ class name. Append dummy `.c' that can be stripped by set_input so %b
+ is correct. */
+ set_input (concat (main_class_name, "main.c", NULL));
err = do_spec (jvgenmain_spec);
if (err == 0)
{