OSDN Git Service

* verify.cc (_Jv_BytecodeVerifier::check_field_constant): Handle
[pf3gnuchains/gcc-fork.git] / gcc / f / g77spec.c
index 70d4fac..9b82620 100644 (file)
@@ -53,6 +53,10 @@ Boston, MA 02111-1307, USA.  */
 #define MATH_LIBRARY "-lm"
 #endif
 
+#ifndef FORTRAN_INIT
+#define FORTRAN_INIT "-lfrtbegin"
+#endif
+
 #ifndef FORTRAN_LIBRARY
 #define FORTRAN_LIBRARY "-lg2c"
 #endif
@@ -270,13 +274,6 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
      link in libf2c.  */
   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.
      1 => -xfoo in effect.  */
   int saw_speclang = 0;
@@ -327,14 +324,12 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
     {
       if ((argv[i][0] == '+') && (argv[i][1] == 'e'))
        {
-         add_version_magic = 0;
          continue;
        }
 
       if ((argv[i][0] != '-') || (argv[i][1] == '\0'))
        {
          ++n_infiles;
-         add_version_magic = 0;
          continue;
        }
 
@@ -352,23 +347,17 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
          /* These options disable linking entirely or linking of the
             standard libraries.  */
          library = 0;
-         add_version_magic = 0;
          break;
 
        case OPTION_l:
          ++n_infiles;
-         add_version_magic = 0;
          break;
 
        case OPTION_o:
          ++n_outfiles;
-         add_version_magic = 0;
          break;
 
        case OPTION_v:
-         if (! verbose)
-           fprintf (stderr, "g77 version %s (Fortran Frontend version %s)\n",
-                    version_string, ffe_version_string);
          verbose = 1;
          break;
 
@@ -383,18 +372,15 @@ lang_specific_driver (in_argc, in_argv, in_added_libraries)
 
        case OPTION_version:
          printf ("\
-GNU Fortran %s\n\
+GNU Fortran %s (Fortran Frontend version %s)\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\
 GNU Fortran comes with NO WARRANTY, to the extent permitted by law.\n\
 You may redistribute copies of GNU Fortran\n\
 under the terms of the GNU General Public License.\n\
 For more information about these matters, see the file named COPYING\n\
 or type the command `info -f g77 Copying'.\n\
-", ffe_version_string);
+", version_string, ffe_version_string);
          exit (0);
          break;
 
@@ -403,44 +389,11 @@ or type the command `info -f g77 Copying'.\n\
             cool facility for handling --help and --verbose --help.  */
          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:
          fatal ("--driver no longer supported");
          break;
 
        default:
-         add_version_magic = 0;
          break;
        }
 
@@ -456,6 +409,10 @@ For bug reporting instructions, please see:\n\
   if ((n_outfiles != 0) && (n_infiles == 0))
     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.  */
 
   append_arg (argv[0]);        /* Start with command name, of course. */
@@ -544,7 +501,7 @@ For bug reporting instructions, please see:\n\
 
   /* Append `-lg2c -lm' as necessary.  */
 
-  if (! add_version_magic && library)
+  if (library)
     {                          /* Doing a link and no -nostdlib. */
       if (saw_speclang)
        append_arg ("-xnone");
@@ -565,13 +522,6 @@ For bug reporting instructions, please see:\n\
          break;
        }
     }
-  else if (add_version_magic && verbose)
-    {
-      append_arg ("-c");
-      append_arg ("-xf77-version");
-      append_arg ("/dev/null");
-      append_arg ("-xnone");
-    }
 
   if (verbose
       && g77_newargv != g77_xargv)