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

📄 readme

📁 早期freebsd实现
💻
字号:
This directory contains the -liberty library of free software.It is a collection of subroutines used by various GNU programs.Current members include:	getopt -- get options from command line	obstack -- stacks of arbitrarily-sized objects	strerror -- error message strings corresponding to errno	strtol -- string-to-long conversion	strtoul -- string-to-unsigned-long conversionWe expect many of the GNU subroutines that are floating around toeventually arrive here.To build the library, do:	./configure HOSTTYPE	makePlease report bugs and fixes to "bug-gnu-utils@prep.ai.mit.edu".  Thank you.ADDING A NEW FILE=================There are two sets of files:  Those that are "required" will beincluded in the library for all configurations, while thosethat are "optional" will be included in the library only if "needed."To add a new required file, edit Makefile to add the source filename to CFILES and the object file to REQUIRED_OFILES.Adding a new optional file is more fragile.  As a general rule,an optional file will be included in the library if it providesfunctionality missing in the "standard" C library.For most hosts, the Makefile automatically figures out whichfunctionality is missing by compiling and linking a dummy testprogram, and examining the error messages.So to get this to work, you should do the following:1) Select one function defined in the file you're adding.For example, the getcwd function.2) Add that function to the list in the file functions.def.3) The name of the new file must be the same as the functionyou've chosen with the .c suffix added.  E.g. getcwd() must bedefined in getcwd.c.  (The file can define other functions as well.)4) In Makefile.in, add the name of the source file (e.g. getcwd.c)to CFILES.The file you've added (e.g. getcwd.c) should compile and workon all hosts where it is needed (e.g. not found when linkingthe dummy.c program).  It does not have to work or evencompile on hosts where it is not needed.HOW THE AUTOMATIC CONFIGURATION WORKS=====================================The libiberty.a target (in RULE1) depends on $(DO_ALSO).For normal configurations, DO_ALSO=needed-list.So needed-list is first made.  The needed-list rule compilesdummy.c.  Because dummy.c includes functions.def, theresulting object file will contain a call to each of theoptional functions (for simplicity assume each optional filedefines a single function).  This object file will be linkedagainst the standard libraries (as defined by using $(CC)and various flags).  Any function missing will causes thelinker to emit an error message.  We assume the nameof the missing function(s) are in the error message(s).The awk script find-needed.awk has been generated fromfunctions.def.  It is used to search the linker outputmessages for words that match the functions listed infunctions.def.  The list of functions found is writtenon a single line to the file needed-list.After needed-list has been generated, the libiberty.atarget (in RULE1) just calls 'make' recursively.It passes the contents of needed-list using thedefinition (expanded) HOST_OFILES="`cat needed-list`".It also tells the inferior 'make' to use RULE2.The inferior 'make' is very conventional:  The mainrule is $(RULE2) (which is libiberty.a).  It dependson a list of object files: $(REQUIRED_OFILES) $(HOST_OFILES)(and $(EXTRA_OFILES), which is usually empty).  The superior'make' passes in $(HOST_OFILES); the others are fixedin the Makefile.ADDING A NEW CONFIGURATION==========================On most hosts you should be able to use the scheme for automaticallyfiguring out which files are needed.  In that case, you probablydon't need a special Makefile stub for that configuration.If the fully automatic scheme doesn't work, you may be able to getby with defining EXTRA_OFILES in your Makefile stub.  This isa list of object file names that should be treated as requiredfor this configuration - they will be included in libiberty.a,regardless of whatever might be in the C library.  Moreover,when the dummy.c program is linked, it will be linked with$(EXTRA_OFILES).  Therefore, if a function in functions.defis defined by one of the EXTRA_OFILES, it will not be listed as"needed".  Thus if your hal9000 host needs a special implementationof getcwd, you can just create hal9000-getcwd.c, and define:	EXTRA_OFILES=hal9000-getcwd.oOr if you want to use the libiberty version of strstr(),even though there is a version in the C library (it might bebuggy or slow), just define:	EXTRA_OFILES=strstr.oYou can create a "manual" host configuration FOO with a fileconfig/mh-FOO.  In it, the HOST_OFILES macro should explicitlylist that subset of the optional files that should be in thelibrary.  You should also set:	DO_ALSO =This overrides all of the magic needed to automaticallydetermine which files are "needed."  However, keeping that listup to date is another matter...HOW THE MANUAL CONFIGURATION WORKS==================================This also uses a recursive make, but the superior makedoes not do anything interesting - it just calls theinferior make with HOST_OFILES defined as $(HOST_OFILES),which is the list you created in your configuration.You probably don't want to depend on manual configuration,because keeping the HOST_OFILES list up-to-date will be a pain.

⌨️ 快捷键说明

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