133965SjdpThis directory contains the -liberty library of free software.
233965SjdpIt is a collection of subroutines used by various GNU programs.
333965SjdpCurrent members include:
433965Sjdp
533965Sjdp	getopt -- get options from command line
633965Sjdp	obstack -- stacks of arbitrarily-sized objects
733965Sjdp	strerror -- error message strings corresponding to errno
833965Sjdp	strtol -- string-to-long conversion
933965Sjdp	strtoul -- string-to-unsigned-long conversion
1033965Sjdp
1133965SjdpWe expect many of the GNU subroutines that are floating around to
1233965Sjdpeventually arrive here.
1333965Sjdp
1438889SjdpThe library must be configured from the top source directory.  Don't
1538889Sjdptry to run configure in this directory.  Follow the configuration
1638889Sjdpinstructions in ../README.
1733965Sjdp
18130561SobrienPlease report bugs to "gcc-bugs@gcc.gnu.org" and send fixes to
19130561Sobrien"gcc-patches@gcc.gnu.org".  Thank you.
2033965Sjdp
2133965SjdpADDING A NEW FILE
2233965Sjdp=================
2333965Sjdp
2433965SjdpThere are two sets of files:  Those that are "required" will be
2533965Sjdpincluded in the library for all configurations, while those
2633965Sjdpthat are "optional" will be included in the library only if "needed."
2733965Sjdp
2833965SjdpTo add a new required file, edit Makefile to add the source file
2933965Sjdpname to CFILES and the object file to REQUIRED_OFILES.
3033965Sjdp
3160484SobrienTo add a new optional file, it must provide a single function, and the
3260484Sobrienname of the function must be the same as the name of the file.
3333965Sjdp
3460484Sobrien    * Add the source file name to CFILES.
3533965Sjdp
3660484Sobrien    * Add the function to name to the funcs shell variable in
37130561Sobrien      configure.ac.
3833965Sjdp
3960484Sobrien    * Add the function to the AC_CHECK_FUNCS lists just after the
4060484Sobrien      setting of the funcs shell variable.  These AC_CHECK_FUNCS calls
4160484Sobrien      are never executed; they are there to make autoheader work
4260484Sobrien      better.
4333965Sjdp
4460484Sobrien    * Consider the special cases of building libiberty; as of this
4560484Sobrien      writing, the special cases are newlib and VxWorks.  If a
4660484Sobrien      particular special case provides the function, you do not need
4760484Sobrien      to do anything.  If it does not provide the function, add the
4860484Sobrien      object file to LIBOBJS, and add the function name to the case
4960484Sobrien      controlling whether to define HAVE_func.
5033965Sjdp
5160484SobrienThe optional file you've added (e.g. getcwd.c) should compile and work
5260484Sobrienon all hosts where it is needed.  It does not have to work or even
5360484Sobriencompile on hosts where it is not needed.
5433965Sjdp
5533965SjdpADDING A NEW CONFIGURATION
5633965Sjdp==========================
5733965Sjdp
5833965SjdpOn most hosts you should be able to use the scheme for automatically
5933965Sjdpfiguring out which files are needed.  In that case, you probably
6033965Sjdpdon't need a special Makefile stub for that configuration.
6133965Sjdp
6233965SjdpIf the fully automatic scheme doesn't work, you may be able to get
6333965Sjdpby with defining EXTRA_OFILES in your Makefile stub.  This is
6433965Sjdpa list of object file names that should be treated as required
6533965Sjdpfor this configuration - they will be included in libiberty.a,
6660484Sobrienregardless of whatever might be in the C library.
67