📄 sourcebuild.texi
字号:
@node Documentation@subsection Building DocumentationThe main GCC documentation is in the form of manuals in Texinfoformat. These are installed in Info format; DVI versions may begenerated by @samp{make dvi}, PDF versions by @samp{make pdf}, andHTML versions by @command{make html}. In addition, some man pages aregenerated from the Texinfo manuals, there are some other text fileswith miscellaneous documentation, and runtime libraries have their owndocumentation outside the @file{gcc} directory. FIXME: document thedocumentation for runtime libraries somewhere.@menu* Texinfo Manuals:: GCC manuals in Texinfo format.* Man Page Generation:: Generating man pages from Texinfo manuals.* Miscellaneous Docs:: Miscellaneous text files with documentation.@end menu@node Texinfo Manuals@subsubsection Texinfo ManualsThe manuals for GCC as a whole, and the C and C++ front ends, are infiles @file{doc/*.texi}. Other front ends have their own manuals infiles @file{@var{language}/*.texi}. Common files@file{doc/include/*.texi} are provided which may be included inmultiple manuals; the following files are in @file{doc/include}:@table @file@item fdl.texiThe GNU Free Documentation License.@item funding.texiThe section ``Funding Free Software''.@item gcc-common.texiCommon definitions for manuals.@item gpl.texi@itemx gpl_v3.texiThe GNU General Public License.@item texinfo.texA copy of @file{texinfo.tex} known to work with the GCC manuals.@end tableDVI-formatted manuals are generated by @samp{make dvi}, which uses@command{texi2dvi} (via the Makefile macro @code{$(TEXI2DVI)}). PDF-formatted manuals are generated by @samp{make pdf}, which uses@command{texi2pdf} (via the Makefile macro @code{$(TEXI2PDF)}). HTMLformatted manuals are generated by @command{make html}. Infomanuals are generated by @samp{make info} (which is run as part ofa bootstrap); this generates the manuals in the source directory,using @command{makeinfo} via the Makefile macro @code{$(MAKEINFO)},and they are included in release distributions.Manuals are also provided on the GCC web site, in both HTML andPostScript forms. This is done via the script@file{maintainer-scripts/update_web_docs}. Each manual to beprovided online must be listed in the definition of @code{MANUALS} inthat file; a file @file{@var{name}.texi} must only appear once in thesource tree, and the output manual must have the same name as thesource file. (However, other Texinfo files, included in manuals butnot themselves the root files of manuals, may have names that appearmore than once in the source tree.) The manual file@file{@var{name}.texi} should only include other files in its owndirectory or in @file{doc/include}. HTML manuals will be generated by@samp{makeinfo --html}, PostScript manuals by @command{texi2dvi}and @command{dvips}, and PDF manuals by @command{texi2pdf}.All Texinfo files that are parts of manuals mustbe checked into SVN, even if they are generated files, for thegeneration of online manuals to work.The installation manual, @file{doc/install.texi}, is also provided onthe GCC web site. The HTML version is generated by the script@file{doc/install.texi2html}.@node Man Page Generation@subsubsection Man Page GenerationBecause of user demand, in addition to full Texinfo manuals, man pagesare provided which contain extracts from those manuals. These manpages are generated from the Texinfo manuals using@file{contrib/texi2pod.pl} and @command{pod2man}. (The man page for@command{g++}, @file{cp/g++.1}, just contains a @samp{.so} referenceto @file{gcc.1}, but all the other man pages are generated fromTexinfo manuals.)Because many systems may not have the necessary tools installed togenerate the man pages, they are only generated if the@file{configure} script detects that recent enough tools areinstalled, and the Makefiles allow generating man pages to failwithout aborting the build. Man pages are also included in releasedistributions. They are generated in the source directory.Magic comments in Texinfo files starting @samp{@@c man} control whatparts of a Texinfo file go into a man page. Only a subset of Texinfois supported by @file{texi2pod.pl}, and it may be necessary to addsupport for more Texinfo features to this script when generating newman pages. To improve the man page output, some special Texinfomacros are provided in @file{doc/include/gcc-common.texi} which@file{texi2pod.pl} understands:@table @code@item @@gcctaboptUse in the form @samp{@@table @@gcctabopt} for tables of options,where for printed output the effect of @samp{@@code} is better thanthat of @samp{@@option} but for man page output a different effect iswanted.@item @@gccoptlistUse for summary lists of options in manuals.@item @@golUse at the end of each line inside @samp{@@gccoptlist}. This isnecessary to avoid problems with differences in how the@samp{@@gccoptlist} macro is handled by different Texinfo formatters.@end tableFIXME: describe the @file{texi2pod.pl} input language and magiccomments in more detail.@node Miscellaneous Docs@subsubsection Miscellaneous DocumentationIn addition to the formal documentation that is installed by GCC,there are several other text files with miscellaneous documentation:@table @file@item ABOUT-GCC-NLSNotes on GCC's Native Language Support. FIXME: this should be part ofthis manual rather than a separate file.@item ABOUT-NLSNotes on the Free Translation Project.@item COPYINGThe GNU General Public License.@item COPYING.LIBThe GNU Lesser General Public License.@item *ChangeLog*@itemx */ChangeLog*Change log files for various parts of GCC@.@item LANGUAGESDetails of a few changes to the GCC front-end interface. FIXME: theinformation in this file should be part of general documentation ofthe front-end interface in this manual.@item ONEWSInformation about new features in old versions of GCC@. (For recentversions, the information is on the GCC web site.)@item README.PortabilityInformation about portability issues when writing code in GCC@. FIXME:why isn't this part of this manual or of the GCC Coding Conventions?@end tableFIXME: document such files in subdirectories, at least @file{config},@file{cp}, @file{objc}, @file{testsuite}.@node Front End@subsection Anatomy of a Language Front EndA front end for a language in GCC has the following parts:@itemize @bullet@itemA directory @file{@var{language}} under @file{gcc} containing sourcefiles for that front end. @xref{Front End Directory, , The Front End@file{@var{language}} Directory}, for details.@itemA mention of the language in the list of supported languages in@file{gcc/doc/install.texi}.@itemA mention of the name under which the language's runtime library isrecognized by @option{--enable-shared=@var{package}} in thedocumentation of that option in @file{gcc/doc/install.texi}.@itemA mention of any special prerequisites for building the front end inthe documentation of prerequisites in @file{gcc/doc/install.texi}.@itemDetails of contributors to that front end in@file{gcc/doc/contrib.texi}. If the details are in that front end'sown manual then there should be a link to that manual's list in@file{contrib.texi}.@itemInformation about support for that language in@file{gcc/doc/frontends.texi}.@itemInformation about standards for that language, and the front end'ssupport for them, in @file{gcc/doc/standards.texi}. This may be alink to such information in the front end's own manual.@itemDetails of source file suffixes for that language and @option{-x@var{lang}} options supported, in @file{gcc/doc/invoke.texi}.@itemEntries in @code{default_compilers} in @file{gcc.c} for source filesuffixes for that language.@itemPreferably testsuites, which may be under @file{gcc/testsuite} orruntime library directories. FIXME: document somewhere how to writetestsuite harnesses.@itemProbably a runtime library for the language, outside the @file{gcc}directory. FIXME: document this further.@itemDetails of the directories of any runtime libraries in@file{gcc/doc/sourcebuild.texi}.@end itemizeIf the front end is added to the official GCC source repository, thefollowing are also necessary:@itemize @bullet@itemAt least one Bugzilla component for bugs in that front end and runtimelibraries. This category needs to be mentioned in@file{gcc/gccbug.in}, as well as being added to the Bugzilla database.@itemNormally, one or more maintainers of that front end listed in@file{MAINTAINERS}.@itemMentions on the GCC web site in @file{index.html} and@file{frontends.html}, with any relevant links on@file{readings.html}. (Front ends that are not an official part ofGCC may also be listed on @file{frontends.html}, with relevant links.)@itemA news item on @file{index.html}, and possibly an announcement on the@email{gcc-announce@@gcc.gnu.org} mailing list.@itemThe front end's manuals should be mentioned in@file{maintainer-scripts/update_web_docs} (@pxref{Texinfo Manuals})and the online manuals should be linked to from@file{onlinedocs/index.html}.@itemAny old releases or CVS repositories of the front end, before itsinclusion in GCC, should be made available on the GCC FTP site@uref{ftp://gcc.gnu.org/pub/gcc/old-releases/}.@itemThe release and snapshot script @file{maintainer-scripts/gcc_release}should be updated to generate appropriate tarballs for this front end.The associated @file{maintainer-scripts/snapshot-README} and@file{maintainer-scripts/snapshot-index.html} files should be updatedto list the tarballs and diffs for this front end.@itemIf this front end includes its own version files that include thecurrent date, @file{maintainer-scripts/update_version} should beupdated accordingly.@end itemize@menu* Front End Directory:: The front end @file{@var{language}} directory.* Front End Config:: The front end @file{config-lang.in} file.@end menu@node Front End Directory@subsubsection The Front End @file{@var{language}} DirectoryA front end @file{@var{language}} directory contains the source filesof that front end (but not of any runtime libraries, which should beoutside the @file{gcc} directory). This includes documentation, andpossibly some subsidiary programs build alongside the front end.Certain files are special and other parts of the compiler depend ontheir names:@table @file@item config-lang.inThis file is required in all language subdirectories. @xref{Front EndConfig, , The Front End @file{config-lang.in} File}, for details ofits contents@item Make-lang.inThis file is required in all language subdirectories. It containstargets @code{@var{lang}.@var{hook}} (where @code{@var{lang}} is thesetting of @code{language} in @file{config-lang.in}) for the followingvalues of @code{@var{hook}}, and any other Makefile rules required tobuild those targets (which may if necessary use other Makefilesspecified in @code{outputs} in @file{config-lang.in}, although this isdeprecated). It also adds any testsuite targets that can use thestandard rule in @file{gcc/Makefile.in} to the variable@code{lang_checks}.@table @code@itemx all.cross@itemx start.encap@itemx rest.encapFIXME: exactly what goes in each of these targets?@item tagsBuild an @command{etags} @file{TAGS} file in the language subdirectoryin the source tree.@item infoBuild info documentation for the front end, in the build directory.This target is only called by @samp{make bootstrap} if a suitableversion of @command{makeinfo} is available, so does not need to checkfor this, and should fail if an error occurs.@item dviBuild DVI documentation for the front end, in the build directory.This should be done using @code{$(TEXI2DVI)}, with appropriate@option{-I} arguments pointing to directories of included files.@item pdfBuild PDF documentation for the front end, in the build directory.This should be done using @code{$(TEXI2PDF)}, with appropriate@option{-I} arguments pointing to directories of included files.@item htmlBuild HTML documentation for the front end, in the build directory.@item manBuild generated man pages for the front end from Texinfo manuals(@pxref{Man Page Generation}), in the build directory. This targetis only called if the necessary tools are available, but should ignoreerrors so as not to stop the build if errors occur; man pages areoptional and the tools involved may be installed in a broken way.@item install-commonInstall everything that is part of the front end, apart from thecompiler executables listed in @code{compilers} in@file{config-lang.in}.@item install-infoInstall info documentation for the front end, if it is present in thesource directory. This target should have dependencies on info filesthat should be installed.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -