Commit 8fbea508 by Zack Weinberg Committed by Zack Weinberg

g77spec.c (lang_specific_driver): Adjust behavior of -v and --version for…

g77spec.c (lang_specific_driver): Adjust behavior of -v and --version for consistency with other front ends.

	* g77spec.c (lang_specific_driver): Adjust behavior of -v and
	--version for consistency with other front ends.  Remove large
	#if 0 block.  Do not add libraries to argv if there are no
	input files.
	(add_version_magic): Delete all references and dependent code.
	* lang-options.h: Delete -fnull-version.
	* lang-specs.h: Delete f77-version spec.

	* lex.c: Delete logic conditional on ffe_is_null_version() and
	now-unused label.
	* top.c: Delete ffe_is_null_version_ variable.
	(ffe_decode_option): Delete -fnull-version case.
	* top.h: Delete declaration of ffe_is_null_version_ and
	ffe_is_null_version(), ffe_set_is_null_version() macros.

From-SVN: r46883
parent 75b17b74
2001-11-09 Zack Weinberg <zack@codesourcery.com>
* g77spec.c (lang_specific_driver): Adjust behavior of -v and
--version for consistency with other front ends. Remove large
#if 0 block. Do not add libraries to argv if there are no
input files.
(add_version_magic): Delete all references and dependent code.
* lang-options.h: Delete -fnull-version.
* lang-specs.h: Delete f77-version spec.
* lex.c: Delete logic conditional on ffe_is_null_version() and
now-unused label.
* top.c: Delete ffe_is_null_version_ variable.
(ffe_decode_option): Delete -fnull-version case.
* top.h: Delete declaration of ffe_is_null_version_ and
ffe_is_null_version(), ffe_set_is_null_version() macros.
Fri Nov 9 07:14:47 2001 Neil Booth <neil@daikokuya.demon.co.uk> Fri Nov 9 07:14:47 2001 Neil Booth <neil@daikokuya.demon.co.uk>
* com.c (language_string, lang_identify): Remove. * com.c (language_string, lang_identify): Remove.
......
...@@ -274,13 +274,6 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -274,13 +274,6 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
link in libf2c. */ link in libf2c. */
const char *library = FORTRAN_LIBRARY; const char *library = FORTRAN_LIBRARY;
/* This will become 0 if anything other than -v and kin (like -V)
is seen, meaning the user is trying to accomplish something.
If it remains nonzero, and the user wants version info, add stuff to
the command line to make gcc invoke all the appropriate phases
to get all the version info. */
int add_version_magic = 1;
/* 0 => -xnone in effect. /* 0 => -xnone in effect.
1 => -xfoo in effect. */ 1 => -xfoo in effect. */
int saw_speclang = 0; int saw_speclang = 0;
...@@ -331,14 +324,12 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -331,14 +324,12 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
{ {
if ((argv[i][0] == '+') && (argv[i][1] == 'e')) if ((argv[i][0] == '+') && (argv[i][1] == 'e'))
{ {
add_version_magic = 0;
continue; continue;
} }
if ((argv[i][0] != '-') || (argv[i][1] == '\0')) if ((argv[i][0] != '-') || (argv[i][1] == '\0'))
{ {
++n_infiles; ++n_infiles;
add_version_magic = 0;
continue; continue;
} }
...@@ -356,23 +347,17 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -356,23 +347,17 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
/* These options disable linking entirely or linking of the /* These options disable linking entirely or linking of the
standard libraries. */ standard libraries. */
library = 0; library = 0;
add_version_magic = 0;
break; break;
case OPTION_l: case OPTION_l:
++n_infiles; ++n_infiles;
add_version_magic = 0;
break; break;
case OPTION_o: case OPTION_o:
++n_outfiles; ++n_outfiles;
add_version_magic = 0;
break; break;
case OPTION_v: case OPTION_v:
if (! verbose)
fprintf (stderr, "g77 version %s (Fortran Frontend version %s)\n",
version_string, ffe_version_string);
verbose = 1; verbose = 1;
break; break;
...@@ -387,18 +372,15 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries) ...@@ -387,18 +372,15 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
case OPTION_version: case OPTION_version:
printf ("\ printf ("\
GNU Fortran %s\n\ GNU Fortran %s (Fortran Frontend version %s)\n\
Copyright (C) 2001 Free Software Foundation, Inc.\n\ Copyright (C) 2001 Free Software Foundation, Inc.\n\
For more version information on components of the GNU Fortran\n\
compilation system, especially useful when reporting bugs,\n\
type the command `g77 --verbose'.\n\
\n\ \n\
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.\n\ GNU Fortran comes with NO WARRANTY, to the extent permitted by law.\n\
You may redistribute copies of GNU Fortran\n\ You may redistribute copies of GNU Fortran\n\
under the terms of the GNU General Public License.\n\ under the terms of the GNU General Public License.\n\
For more information about these matters, see the file named COPYING\n\ For more information about these matters, see the file named COPYING\n\
or type the command `info -f g77 Copying'.\n\ or type the command `info -f g77 Copying'.\n\
", ffe_version_string); ", version_string, ffe_version_string);
exit (0); exit (0);
break; break;
...@@ -407,44 +389,11 @@ or type the command `info -f g77 Copying'.\n\ ...@@ -407,44 +389,11 @@ or type the command `info -f g77 Copying'.\n\
cool facility for handling --help and --verbose --help. */ cool facility for handling --help and --verbose --help. */
return; return;
#if 0
printf ("\
Usage: g77 [OPTION]... FORTRAN-SOURCE...\n\
\n\
Compile and link Fortran source code to produce an executable program,\n\
which by default is named `a.out', and can be invoked with the UNIX\n\
command `./a.out'.\n\
\n\
Options:\n\
--debug include debugging information in executable.\n\
--help display this help and exit.\n\
--optimize[=LEVEL] take extra time and memory to make generated\n\
executable run faster. LEVEL is 0 for no\n\
optimization, 1 for normal optimization, and\n\
increases through 3 for more optimization.\n\
--output=PROGRAM name the executable PROGRAM instead of a.out;\n\
invoke with the command `./PROGRAM'.\n\
--version display version information and exit.\n\
\n\
Many other options exist to tailor the compilation process, specify\n\
the dialect of the Fortran source code, specify details of the\n\
code-generation methodology, and so on.\n\
\n\
For more information on g77 and gcc, type the commands `info -f g77'\n\
and `info -f gcc' to read the Info documentation.\n\
\n\
For bug reporting instructions, please see:\n\
%s.\n", GCCBUGURL);
exit (0);
break;
#endif
case OPTION_driver: case OPTION_driver:
fatal ("--driver no longer supported"); fatal ("--driver no longer supported");
break; break;
default: default:
add_version_magic = 0;
break; break;
} }
...@@ -460,6 +409,10 @@ For bug reporting instructions, please see:\n\ ...@@ -460,6 +409,10 @@ For bug reporting instructions, please see:\n\
if ((n_outfiles != 0) && (n_infiles == 0)) if ((n_outfiles != 0) && (n_infiles == 0))
fatal ("No input files; unwilling to write output files"); fatal ("No input files; unwilling to write output files");
/* If there are no input files, no need for the library. */
if (n_infiles == 0)
library = 0;
/* Second pass through arglist, transforming arguments as appropriate. */ /* Second pass through arglist, transforming arguments as appropriate. */
append_arg (argv[0]); /* Start with command name, of course. */ append_arg (argv[0]); /* Start with command name, of course. */
...@@ -548,7 +501,7 @@ For bug reporting instructions, please see:\n\ ...@@ -548,7 +501,7 @@ For bug reporting instructions, please see:\n\
/* Append `-lg2c -lm' as necessary. */ /* Append `-lg2c -lm' as necessary. */
if (! add_version_magic && library) if (library)
{ /* Doing a link and no -nostdlib. */ { /* Doing a link and no -nostdlib. */
if (saw_speclang) if (saw_speclang)
append_arg ("-xnone"); append_arg ("-xnone");
...@@ -569,13 +522,6 @@ For bug reporting instructions, please see:\n\ ...@@ -569,13 +522,6 @@ For bug reporting instructions, please see:\n\
break; break;
} }
} }
else if (add_version_magic && verbose)
{
append_arg ("-c");
append_arg ("-xf77-version");
append_arg ("/dev/null");
append_arg ("-xnone");
}
if (verbose if (verbose
&& g77_newargv != g77_xargv) && g77_newargv != g77_xargv)
......
...@@ -31,7 +31,6 @@ DEFINE_LANG_NAME ("Fortran") ...@@ -31,7 +31,6 @@ DEFINE_LANG_NAME ("Fortran")
{ "-fversion", { "-fversion",
N_("Print g77-specific compiler version info, run internal tests") }, N_("Print g77-specific compiler version info, run internal tests") },
{ "-fnull-version", "" },
/*"-fident",*/ /*"-fident",*/
/*"-fno-ident",*/ /*"-fno-ident",*/
{ "-ff66", { "-ff66",
......
...@@ -41,19 +41,3 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA ...@@ -41,19 +41,3 @@ the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
{"@f77", {"@f77",
"%{!M:%{!MM:%{!E:f771 %i %(cc1_options) %{I*}\ "%{!M:%{!MM:%{!E:f771 %i %(cc1_options) %{I*}\
%{!fsyntax-only:%(invoke_as)}}}}", 0}, %{!fsyntax-only:%(invoke_as)}}}}", 0},
/* XXX This is perverse and should not be necessary. */
{"@f77-version",
"tradcpp0 -lang-fortran %(cpp_options) %j \n\
f771 -fnull-version %1 \
%{!Q:-quiet} -dumpbase g77-version.f %{d*} %{m*} %{a*} \
%{g*} %{O*} %{W*} %{w} %{pedantic*} \
-version -fversion %{f*} %{I*} -o %g.s %j \n\
as %a %Y -o %g%O %g.s %A \n\
ld %l %X -o %g %g%O %{A} %{d} %{e*} %{m} %{N} %{n} \
%{r} %{s} %{t} %{u*} %{x} %{z} %{Z} \
%{!A:%{!nostdlib:%{!nostartfiles:%S}}} \
%{static:} %{L*} %D -lg2c -lm \
%{!nostdlib:%{!nodefaultlibs:%G %L %G}} \
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} \
%{T*} \n\
%g \n", 0},
...@@ -1844,22 +1844,6 @@ ffelex_file_fixed (ffewhereFile wf, FILE *f) ...@@ -1844,22 +1844,6 @@ ffelex_file_fixed (ffewhereFile wf, FILE *f)
ffelex_current_wc_ = ffewhere_column_unknown (); ffelex_current_wc_ = ffewhere_column_unknown ();
latest_char_in_file = '\n'; latest_char_in_file = '\n';
if (ffe_is_null_version ())
{
/* Just substitute a "program" directly here. */
char line[] = " call g77__fvers;call g77__ivers;call g77__uvers;end";
char *p;
column = 0;
for (p = &line[0]; *p != '\0'; ++p)
column = ffelex_image_char_ (*p, column);
c = EOF;
goto have_line; /* :::::::::::::::::::: */
}
goto first_line; /* :::::::::::::::::::: */ goto first_line; /* :::::::::::::::::::: */
/* Come here to get a new line. */ /* Come here to get a new line. */
...@@ -2006,8 +1990,6 @@ ffelex_file_fixed (ffewhereFile wf, FILE *f) ...@@ -2006,8 +1990,6 @@ ffelex_file_fixed (ffewhereFile wf, FILE *f)
column = ffelex_final_nontab_column_; column = ffelex_final_nontab_column_;
} }
have_line: /* :::::::::::::::::::: */
ffelex_card_image_[column] = '\0'; ffelex_card_image_[column] = '\0';
ffelex_card_length_ = column; ffelex_card_length_ = column;
......
...@@ -78,7 +78,6 @@ bool ffe_is_globals_ = TRUE; ...@@ -78,7 +78,6 @@ bool ffe_is_globals_ = TRUE;
bool ffe_is_init_local_zero_ = FFETARGET_defaultIS_INIT_LOCAL_ZERO; bool ffe_is_init_local_zero_ = FFETARGET_defaultIS_INIT_LOCAL_ZERO;
bool ffe_is_mainprog_; /* TRUE if current prog unit known to be bool ffe_is_mainprog_; /* TRUE if current prog unit known to be
main. */ main. */
bool ffe_is_null_version_ = FALSE;
bool ffe_is_onetrip_ = FALSE; bool ffe_is_onetrip_ = FALSE;
bool ffe_is_silent_ = TRUE; bool ffe_is_silent_ = TRUE;
bool ffe_is_typeless_boz_ = FALSE; bool ffe_is_typeless_boz_ = FALSE;
...@@ -173,8 +172,6 @@ ffe_decode_option (argc, argv) ...@@ -173,8 +172,6 @@ ffe_decode_option (argc, argv)
ffe_set_is_version (TRUE); ffe_set_is_version (TRUE);
ffe_set_is_do_internal_checks (TRUE); ffe_set_is_do_internal_checks (TRUE);
} }
else if (strcmp (&opt[2], "null-version") == 0)
ffe_set_is_null_version (TRUE);
else if (strcmp (&opt[2], "f66") == 0) else if (strcmp (&opt[2], "f66") == 0)
{ {
ffe_set_is_onetrip (TRUE); ffe_set_is_onetrip (TRUE);
......
...@@ -95,7 +95,6 @@ extern bool ffe_is_free_form_; ...@@ -95,7 +95,6 @@ extern bool ffe_is_free_form_;
extern bool ffe_is_globals_; extern bool ffe_is_globals_;
extern bool ffe_is_init_local_zero_; extern bool ffe_is_init_local_zero_;
extern bool ffe_is_mainprog_; extern bool ffe_is_mainprog_;
extern bool ffe_is_null_version_;
extern bool ffe_is_onetrip_; extern bool ffe_is_onetrip_;
extern bool ffe_is_silent_; extern bool ffe_is_silent_;
extern bool ffe_is_typeless_boz_; extern bool ffe_is_typeless_boz_;
...@@ -183,7 +182,6 @@ void ffe_terminate_4 (void); ...@@ -183,7 +182,6 @@ void ffe_terminate_4 (void);
#define ffe_is_globals() ffe_is_globals_ #define ffe_is_globals() ffe_is_globals_
#define ffe_is_init_local_zero() ffe_is_init_local_zero_ #define ffe_is_init_local_zero() ffe_is_init_local_zero_
#define ffe_is_mainprog() ffe_is_mainprog_ #define ffe_is_mainprog() ffe_is_mainprog_
#define ffe_is_null_version() ffe_is_null_version_
#define ffe_is_onetrip() ffe_is_onetrip_ #define ffe_is_onetrip() ffe_is_onetrip_
#define ffe_is_pedantic() ffe_is_pedantic_ #define ffe_is_pedantic() ffe_is_pedantic_
#define ffe_is_pedantic_not_90() (ffe_is_pedantic_ && !ffe_is_90_) #define ffe_is_pedantic_not_90() (ffe_is_pedantic_ && !ffe_is_90_)
...@@ -235,7 +233,6 @@ void ffe_terminate_4 (void); ...@@ -235,7 +233,6 @@ void ffe_terminate_4 (void);
#define ffe_set_is_globals(f) (ffe_is_globals_ = (f)) #define ffe_set_is_globals(f) (ffe_is_globals_ = (f))
#define ffe_set_is_init_local_zero(f) (ffe_is_init_local_zero_ = (f)) #define ffe_set_is_init_local_zero(f) (ffe_is_init_local_zero_ = (f))
#define ffe_set_is_mainprog(f) (ffe_is_mainprog_ = (f)) #define ffe_set_is_mainprog(f) (ffe_is_mainprog_ = (f))
#define ffe_set_is_null_version(f) (ffe_is_null_version_ = (f))
#define ffe_set_is_onetrip(f) (ffe_is_onetrip_ = (f)) #define ffe_set_is_onetrip(f) (ffe_is_onetrip_ = (f))
#define ffe_set_is_pedantic(f) (ffe_is_pedantic_ = (f)) #define ffe_set_is_pedantic(f) (ffe_is_pedantic_ = (f))
#define ffe_set_is_saveall(f) (ffe_is_saveall_ = (f)) #define ffe_set_is_saveall(f) (ffe_is_saveall_ = (f))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment