⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maint.texi

📁 一个C源代码分析器
💻 TEXI
📖 第 1 页 / 共 3 页
字号:
@c \input /gd/gnu/doc/texinfo@c This is for making the `INSTALL' file for the distribution.@c Makeinfo ignores it when processing the file from the include.@setfilename INSTALL@node Maintenance, Copying, Library Summary, Top@appendix Library Maintenance@menu* Installation::          How to configure, compile and                             install the GNU C library.* Reporting Bugs::        How to report bugs (if you want to                             get them fixed) and other troubles                             you may have with the GNU C library.* Source Layout::         How to add new functions or header files                             to the GNU C library.* Porting::               How to port the GNU C library to                             a new machine or operating system.* Contributors::          Contributors to the GNU C Library.@end menu@node Installation@appendixsec How to Install the GNU C Library@cindex installing the libraryInstallation of the GNU C library is relatively simple.You need the latest version of GNU @code{make}.  Modifying the GNU CLibrary to work with other @code{make} programs would be so hard that werecommend you port GNU @code{make} instead.  @strong{Really.}@refillTo configure the GNU C library for your system, run the shell script@file{configure} with @code{sh}.  Use an argument which is theconventional GNU name for your system configuration---for example,@samp{sparc-sun-sunos4.1}, for a Sun 4 running Sunos 4.1.@xref{Installation, Installation, Installing GNU CC, gcc.info, Using andPorting GNU CC}, for a full description of standard GNU configurationnames.  If you omit the configuration name, @file{configure} will try toguess one for you by inspecting the system it is running on.  It may ormay not be able to come up with a guess, and the its guess might bewrong.  @file{configure} will tell you the canonical name of the chosenconfiguration before proceeding.The GNU C Library currently supports configurations that match thefollowing patterns:@smallexamplealpha-dec-osf1i386-@var{anything}-bsd4.3i386-@var{anything}-gnui386-@var{anything}-isc2.2i386-@var{anything}-isc3.@var{n}i386-@var{anything}-sco3.2i386-@var{anything}-sco3.2v4i386-@var{anything}-sysvi386-@var{anything}-sysv4i386-force_cpu386-nonei386-sequent-bsdi960-nindy960-nonem68k-hp-bsd4.3m68k-mvme135-nonem68k-mvme136-nonem68k-sony-newsos3m68k-sony-newsos4m68k-sun-sunos4.@var{n}mips-dec-ultrix4.@var{n}mips-sgi-irix4.@var{n}sparc-sun-solaris2.@var{n}sparc-sun-sunos4.@var{n}@end smallexampleWhile no other configurations are supported, there are handy aliases forthese few.  (These aliases work in other GNU software as well.)@smallexampledecstationhp320-bsd4.3 hp300bsdi386-scoi386-sco3.2v4i386-sequent-dynixi386-svr4newssun3-sunos4.@var{n} sun3sun4-solaris2.@var{n} sun4-sunos5.@var{n}sun4-sunos4.@var{n} sun4@end smallexampleHere are some options that you should specify (if appropriate) whenyou run @code{configure}:@table @samp@item --with-gnu-ldUse this option if you plan to use GNU @code{ld} to link programs withthe GNU C Library.  (We strongly recommend that you do.)  This optionenables use of features that exist only in GNU @code{ld}; so if youconfigure for GNU @code{ld} you must use GNU @code{ld} @emph{every time}you link with the GNU C Library, and when building it.@item --with-gnu-asUse this option if you plan to use the GNU assembler, @code{gas}, whenbuilding the GNU C Library.  On some systems, the library may not buildproperly if you do @emph{not} use @code{gas}.@c extra blank line makes it look better@item --nfpUse this option if your computer lacks hardware floating point support.@item --prefix=@var{directory}Install machine-independent data files in subdirectories of@file{@var{directory}}.  (You can also set this in @file{configparms};see below.)@item --exec-prefix=@var{directory}Install the library and other machine-dependent files in subdirectoriesof @file{@var{directory}}.  (You can also set this in@file{configparms}; see below.)@end tableThe simplest way to run @code{configure} is to do it in the directorythat contains the library sources.  This prepares to build the libraryin that very directory.You can prepare to build the library in some other directory by goingto that other directory to run @code{configure}.  In order to runconfigure, you will have to specify a directory for it, like this:@smallexamplemkdir sun4cd sun4../configure sparc-sun-sunos4.1@end smallexample@noindent@code{configure} looks for the sources in whatever directory youspecified for finding @code{configure} itself.  It does not matter wherein the file system the source and build directories are---as long as youspecify the source directory when you run @code{configure}, you will getthe proper results.This feature lets you keep sources and binaries in differentdirectories, and that makes it easy to build the library for severaldifferent machines from the same set of sources.  Simply create a build directory for each target machine, and run @code{configure} inthat directory specifying the target machine's configuration name.The library has a number of special-purpose configuration parameters.These are defined in the file @file{Makeconfig}; see the comments inthat file for the details.But don't edit the file @file{Makeconfig} yourself---instead, create afile @file{configparms} in the directory where you are building thelibrary, and define in that file the parameters you want to specify.@file{configparms} should @strong{not} be an edited copy of@file{Makeconfig}; specify only the parameters that you want tooverride.  To see how to set these parameters, find the section of@file{Makeconfig} that says ``These are the configuration variables.''Then for each parameter that you want to change, copy the definitionfrom @file{Makeconfig} to your new @file{configparms} file, and changethe value as appropriate for your system.It is easy to configure the GNU C library for cross-compilation bysetting a few variables in @file{configparms}.  Set @code{CC} to thecross-compiler for the target you configured the library for; it isimportant to use this same @code{CC} value when running@code{configure}, like this: @samp{CC=@var{target}-gcc configure@var{target}}.  Set @code{BUILD_CC} to the compiler to use for forprograms run on the build system as part of compiling the library.  Youmay need to set @code{AR} and @code{RANLIB} to cross-compiling versionsof @code{ar} and @code{ranlib} if the native tools are not configured towork with object files for the target you configured for.Some of the machine-dependent code for some machines uses extensions inthe GNU C compiler, so you may need to compile the library with GCC.(In fact, all of the existing complete ports require GCC.)The current release of the C library contains some header files that thecompiler normally provides: @file{stddef.h}, @file{stdarg.h}, andseveral files with names of the form @file{va-@var{machine}.h}.  Theversions of these files that came with older releases of GCC do not workproperly with the GNU C library.  The @file{stddef.h} file in release2.2 and later of GCC is correct.  If you have release 2.2 or later ofGCC, use its version of @file{stddef.h} instead of the C library's.  Todo this, put the line @w{@samp{override stddef.h =}} in@file{configparms}.  The other files are corrected in release 2.3 andlater of GCC.  @file{configure} will automatically detect whether theinstalled @file{stdarg.h} and @file{va-@var{machine}.h} files arecompatible with the C library, and use its own if not.There is a potential problem with the @code{size_t} type and versions ofGCC prior to release 2.4.  ANSI C requires that @code{size_t} always bean unsigned type.  For compatibility with existing systems' headerfiles, GCC defines @code{size_t} in @file{stddef.h} to be whatever typethe system's @file{sys/types.h} defines it to be.  Most Unix systemsthat define @code{size_t} in @file{sys/types.h}, define it to be asigned type.  Some code in the library depends on @code{size_t} being anunsigned type, and will not work correctly if it is signed.The GNU C library code which expects @code{size_t} to be unsigned iscorrect.  The definition of @code{size_t} as a signed type is incorrect.Versions 2.4 and later of GCC always define @code{size_t} as an unsignedtype, and GCC's @file{fixincludes} script massages the system's@file{sys/types.h} so as not to conflict with this.In the meantime, we work around this problem by telling GCC explicitlyto use an unsigned type for @code{size_t} when compiling the GNU Clibrary.  @file{configure} will automatically detect what type GCC usesfor @code{size_t} arrange to override it if necessary.To build the library, type @code{make lib}.  This will produce a lot ofoutput, some of which looks like errors from @code{make} (but isn't).Look for error messages from @code{make} containing @samp{***}.  Thoseindicate that something is really wrong.To build and run some test programs which exercise some of the libraryfacilities, type @code{make tests}.  This will produce several fileswith names like @file{@var{program}.out}.To format the @cite{GNU C Library Reference Manual} for printing, type@w{@code{make dvi}}.  To format the Info version of the manual for online reading with @kbd{C-h i} in Emacs or with the @code{info} program,type @w{@code{make info}}.To install the library and its header files, and the Info files of themanual, type @code{make install}, after setting the installationdirectories in @file{configparms}.  This will build things if necessary,before installing them.@refill@node Reporting Bugs@appendixsec Reporting Bugs@cindex reporting bugs@cindex bugs, reportingThere are probably bugs in the GNU C library.  There are certainlyerrors and omissions in this manual.  If you report them, they will getfixed.  If you don't, no one will ever know about them and they willremain unfixed for all eternity, if not longer.To report a bug, first you must find it.  Hopefully, this will be thehard part.  Once you've found a bug, make sure it's really a bug.  Agood way to do this is to see if the GNU C library behaves the same waysome other C library does.  If so, probably you are wrong and thelibraries are right (but not necessarily).  If not, one of the librariesis probably wrong.Once you're sure you've found a bug, try to narrow it down to thesmallest test case that reproduces the problem.  In the case of a Clibrary, you really only need to narrow it down to one libraryfunction call, if possible.  This should not be too difficult.The final step when you have a simple test case is to report the bug.When reporting a bug, send your test case, the results you got, theresults you expected, what you think the problem might be (if you'vethought of anything), your system type, and the version of the GNU Clibrary which you are using.  Also include the files@file{config.status} and @file{config.make} which are created by running@file{configure}; they will be in whatever directory was current whenyou ran @file{configure}.If you think you have found some way in which the GNU C library does notconform to the ANSI and POSIX standards (@pxref{Standards andPortability}), that is definitely a bug.  Report it!@refillSend bug reports to the Internet address@samp{bug-glibc@@prep.ai.mit.edu} or the UUCP path@samp{mit-eddie!prep.ai.mit.edu!bug-glibc}.  If you have other problemswith installation or use, please report those as well.@refillIf you are not sure how a function should behave, and this manualdoesn't tell you, that's a bug in the manual.  Report that too!  If thefunction's behavior disagrees with the manual, then either the libraryor the manual has a bug, so report the disagreement.  If you find anyerrors or omissions in this manual, please report them to the Internetaddress @samp{bug-glibc-manual@@prep.ai.mit.edu} or the UUCP path@samp{mit-eddie!prep.ai.mit.edu!bug-glibc-manual}.@node Source Layout@appendixsec Adding New FunctionsThe process of building the library is driven by the makefiles, whichmake heavy use of special features of GNU @code{make}.  The makefilesare very complex, and you probably don't want to try to understand them.But what they do is fairly straightforward, and only requires that youdefine a few variables in the right places.The library sources are divided into subdirectories, grouped by topic.The @file{string} subdirectory has all the string-manipulationfunctions, @file{stdio} has all the standard I/O functions, etc.Each subdirectory contains a simple makefile, called @file{Makefile},which defines a few @code{make} variables and then includes the globalmakefile @file{Rules} with a line like:@smallexampleinclude ../Rules@end smallexample@noindentThe basic variables that a subdirectory makefile defines are:@table @code@item subdirThe name of the subdirectory, for example @file{stdio}.This variable @strong{must} be defined.@item headersThe names of the header files in this section of the library,such as @file{stdio.h}.@item routines@itemx auxThe names of the modules (source files) in this section of the library.These should be simple names, such as @samp{strlen} (rather thancomplete file names, such as @file{strlen.c}).  Use @code{routines} formodules that define functions in the library, and @code{aux} forauxiliary modules containing things like data definitions.  But thevalues of @code{routines} and @code{aux} are just concatenated, so therereally is no practical difference.@refill@item testsThe names of test programs for this section of the library.  Theseshould be simple names, such as @samp{tester} (rather than complete filenames, such as @file{tester.c}).  @w{@samp{make tests}} will build and

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -