OSDN Git Service

* version.c: Bump version to "gcc-3.0.0 970802 experimental".
[pf3gnuchains/gcc-fork.git] / gcc / README.g77
1 1997-06-20
2
3 This directory contains the version 0.5.21 release of the GNU Fortran
4 compiler.  The GNU Fortran compiler is free software.  See the file
5 COPYING.g77 for copying permission.
6
7 * IMPORTANT: Things you _must_ do are marked with a * at the beginning of
8   the line in this file!!!
9
10 This README is for GNU Fortran, and describes the files in the f/
11 directory.  The f/ directory is intended to be a subdirectory of a
12 gcc source tree.  These directories are referred to below as gcc/,
13 which is the top-level directory containing the gcc back end, the
14 gcc C front end, and other non-Fortran files, and gcc/f/, which
15 contains all of the Fortran files.
16
17 * To build GNU Fortran, you must have a source distribution of gcc
18   version 2.7.2.2.  Do not attempt to use any other version
19   of gcc, because this version of g77 is designed to work only with
20   gcc version 2.7.2.2.
21
22 * Note that you must have source copies of these gcc distributions!!
23   You cannot build g77 just using binaries of gcc.  Also, unless you
24   are an expert, avoid using any distribution of gcc not identical to
25   the one distributed by the FSF -- for example, using a special version
26   modified to produce better code for the Pentium (sometimes labeled
27   gcc-i2.6.3 -- note the `i') will not work with this distribution of g77.
28
29 If you have just unpacked the g77 distribution, before proceeding,
30 you must merge the contents of the g77 distribution with the appropriate
31 gcc distribution on your system before proceeding.
32
33 * Read and follow the instructions in g77-0.5.21/f/INSTALL that
34   explain how to merge a g77 source directory into a gcc source
35   directory.  You can use Info to read the same installation
36   instructions via:
37
38     info -f g77-0.5.21/f/g77.info -n Unpacking
39
40 The resulting directory layout includes the following, where gcc/ might be
41 a link to, for example, gcc-2.7.2.2/:
42
43     gcc/                    Non-Fortran files in gcc (not part of g77*.tar)
44     gcc/README.g77          This file
45     gcc/f/                  GNU Fortran front end
46     gcc/f/gbe/              Patches required for gcc back end versions
47     gcc/f/runtime/          libf2c configuration and f2c.h file generation
48     gcc/f/runtime/libF77/   Non-I/O portion of libf2c
49     gcc/f/runtime/libI77/   I/O portion of libf2c
50     gcc/f/runtime/libU77/   Additional interfaces to libc for libf2c
51
52 gcc/f/ as a whole contains the program GNU Fortran (g77), plus a portion
53 of the separate program f2c, which is in gcc/f/runtime.  NOTE: The f2c
54 code is not part of the program g77, just distributed with it.
55
56 This directory is named gcc/f/ because it, along with its contents, is
57 designed to be a subdirectory of a GNU CC (gcc) development directory.  I.e.
58 when a gcc distribution is unpacked into a directory (named gcc/ for
59 example), it typically contains subdirectories like gcc/config/ and
60 gcc/cp/.  The latter is the subdirectory for the GNU C++ (g++) program.
61
62 Similarly, the g77 directory f/ is designed to be placed in gcc/ so that
63 it becomes the subdirectory gcc/f/.  g77 is distributed as g77-someversion/f/
64 so that unpacking the g77 distribution is done in the normal GNU way,
65 resulting in a directory having the version number in the name.  However,
66 to build g77, the g77 distribution must be merged with an appropriate gcc
67 distribution, normally in a gcc directory, before configuring, building,
68 and installing g77.
69
70 Applying g77 patches in the form of .diff files is done by typing
71 "patch -p1 -d gcc" (where gcc/f/ is the active version).  That is,
72 g77 patches are distributed in the same form, and at the same directory
73 level, as patches to the gcc distribution.
74
75 gcc/f/ has text files that document the Fortran compiler, source
76 files for the GNU Fortran Front End (FFE), and some other stuff.
77
78 gcc/f/gbe/ has patch files for various versions of gcc, primarily
79 needed to patch the GNU compiler Back End (GBE) to fix and improve it
80 for use with g77.  If a patch file exists for the version of gcc you
81 want to build along with g77, you MUST apply the patch before building
82 g77 with that version or g77 will not build or work properly.*
83
84 * Read gcc/f/gbe/README for more information.
85
86 gcc/f/runtime/ contains the run-time libraries for the f2c program, also used
87 by g77, and referred to as libf2c (though libf2c is really a combination of
88 two distinct libraries, libF77 and libI77 -- in g77, this distinction is
89 not made, and, further, Dave Love's implementation of libU77 is added
90 to the mix).  This separate subdirectory is not part of the program g77, just
91 distributed with it.  Some new files have been added to this subdirectory
92 and some minor changes made to the files contained therein, to fix some
93 bugs and facilitate automatic configuration, building, and installation of
94 libf2c for use by g77 users.  See gcc/f/runtime/README for more information.
95
96 gcc/f/BUGS lists some important bugs known to be in g77.  Or:
97
98   info -f gcc/f/g77.info -n "Actual Bugs"
99
100 gcc/f/ChangeLog lists recent changes to g77 internals.
101
102 gcc/f/INSTALL describes how to build and install GNU Fortran.  Or:
103
104   info -f gcc/f/g77.info -n Installation
105
106 gcc/f/NEWS contains the per-release changes (not just user-visible ones
107 seen in gcc/f/DOC) listed in the ~fortran/.plan file.  Or:
108
109   info -f gcc/f/g77.info -n News
110
111 * Read gcc/f/BUGS, gcc/f/INSTALL, and gcc/f/NEWS at the very least!
112   All users of g77 (not just installers) should read gcc/f/g77.info*
113   as well, using the "more" command if the "info" command is
114   unavailable or they aren't accustomed to using it.
115
116 If you want to get into the FFE code, which lives entirely in gcc/f/, here
117 are a few clues.  The file g77.c is the stand-alone source file for the
118 `g77' command driver only -- this just invokes the `gcc' command, so it has
119 nothing to do with the rest of the code in g77.  Most of the code
120 ends up in an executable named `f771', which does the actual compiling,
121 so it has the FFE merged with the gcc back end.
122
123 The file parse.c is the source file for main() for a stand-alone FFE and
124 yyparse() for f771.  (Stand-alone building of the FFE doesn't work these days.)
125 The file top.c contains the top-level FFE function ffe_file and it (along
126 with top.h) define all ffe_[a-z].*, ffe[A-Z].*, and FFE_[A-Za-z].* symbols.
127 The file fini.c is a main() program that is used when building the FFE to
128 generate C header and source files for recognizing keywords.  The files
129 malloc.c and malloc.h comprise a memory manager that defines all
130 malloc_[a-z].*, malloc[A-Z].*, and MALLOC_[A-Za-z].* symbols.  All other
131 modules named <xyz> are comprised of all files named <xyz>*.<ext> and
132 define all ffe<xyz>_[a-z].*, ffe<xyz>[A-Z].*, and FFE<XYZ>_[A-Za-z].* symbols.
133 If you understand all this, congratulations -- it's easier for me to remember
134 how it works than to type in these grep patterns (such as they are).  But it
135 does make it easy to find where a symbol is defined -- for example,
136 the symbol "ffexyz_set_something" would be defined in xyz.h and implemented
137 there (if it's a macro) or in xyz.c.
138
139 The "porting" files of note currently are: proj.h, which defines the
140 "language" used by all the other source files (the language being
141 Standard C plus some useful things like ARRAY_SIZE and such) -- change
142 this file when you find your system doesn't properly define a Standard C
143 macro or function, for example; target.h and target.c, which describe
144 the target machine in terms of what data types are supported, how they are
145 denoted (what C type does an INTEGER*8 map to, for example), how to convert
146 between them, and so on (though as of 0.5.3, more and more of this information
147 is being dynamically configured by ffecom_init_0); com.h and com.c, which
148 interface to the target back end (currently only FFE stand-alone and the GBE);
149 ste.c, which contains code for implementing recognized executable statements
150 in the target back end (again currently either FFE or GBE); src.h and src.c,
151 which describe information on the format(s) of source files (like whether
152 they are never to be processed as case-insensitive with regard to Fortran
153 keywords); and proj.c, which contains whatever code is needed to support
154 the language defined by proj.h.
155
156 If you want to debug the f771 executable, for example if it crashes,
157 note that the global variables "lineno" and "input_filename" are set
158 to reflect the current line being read by the lexer during the first-pass
159 analysis of a program unit and to reflect the current line being
160 processed during the second-pass compilation of a program unit.  If
161 an invocation of the function ffestd_exec_end() is on the stack,
162 the compiler is in the second pass, otherwise it is in the first.
163 (This information might help you reduce a test case and/or work around
164 a bug in g77 until a fix is available.)
165
166 Any questions or comments on these topics, email fortran@gnu.ai.mit.edu.