README revision 130561
1181111SdesThis directory contains the -liberty library of free software.
292555SdesIt is a collection of subroutines used by various GNU programs.
357429SmarkmCurrent members include:
457429Smarkm
557429Smarkm	getopt -- get options from command line
657429Smarkm	obstack -- stacks of arbitrarily-sized objects
757429Smarkm	strerror -- error message strings corresponding to errno
860573Skris	strtol -- string-to-long conversion
965668Skris	strtoul -- string-to-unsigned-long conversion
1065668Skris
1165668SkrisWe expect many of the GNU subroutines that are floating around to
1265668Skriseventually arrive here.
1365668Skris
1457429SmarkmThe library must be configured from the top source directory.  Don't
1557429Smarkmtry to run configure in this directory.  Follow the configuration
1657429Smarkminstructions in ../README.
1757429Smarkm
1857429SmarkmPlease report bugs to "gcc-bugs@gcc.gnu.org" and send fixes to
1957429Smarkm"gcc-patches@gcc.gnu.org".  Thank you.
2092555Sdes
2192555SdesADDING A NEW FILE
2292555Sdes=================
2392555Sdes
2457429SmarkmThere are two sets of files:  Those that are "required" will be
2557429Smarkmincluded in the library for all configurations, while those
2692555Sdesthat are "optional" will be included in the library only if "needed."
2792555Sdes
2892555SdesTo add a new required file, edit Makefile to add the source file
2957429Smarkmname to CFILES and the object file to REQUIRED_OFILES.
3092555Sdes
3192555SdesTo add a new optional file, it must provide a single function, and the
3257429Smarkmname of the function must be the same as the name of the file.
3392555Sdes
3492555Sdes    * Add the source file name to CFILES.
3557429Smarkm
36162852Sdes    * Add the function to name to the funcs shell variable in
37162852Sdes      configure.ac.
3892555Sdes
3957429Smarkm    * Add the function to the AC_CHECK_FUNCS lists just after the
4092555Sdes      setting of the funcs shell variable.  These AC_CHECK_FUNCS calls
4192555Sdes      are never executed; they are there to make autoheader work
4257429Smarkm      better.
4392555Sdes
4457429Smarkm    * Consider the special cases of building libiberty; as of this
45146998Sdes      writing, the special cases are newlib and VxWorks.  If a
46146998Sdes      particular special case provides the function, you do not need
47146998Sdes      to do anything.  If it does not provide the function, add the
48146998Sdes      object file to LIBOBJS, and add the function name to the case
49162852Sdes      controlling whether to define HAVE_func.
50162852Sdes
51162852SdesThe optional file you've added (e.g. getcwd.c) should compile and work
52162852Sdeson all hosts where it is needed.  It does not have to work or even
53162852Sdescompile on hosts where it is not needed.
54162852Sdes
55162852SdesADDING A NEW CONFIGURATION
56162852Sdes==========================
57162852Sdes
58162852SdesOn most hosts you should be able to use the scheme for automatically
59162852Sdesfiguring out which files are needed.  In that case, you probably
60162852Sdesdon't need a special Makefile stub for that configuration.
61162852Sdes
62162852SdesIf the fully automatic scheme doesn't work, you may be able to get
63162852Sdesby with defining EXTRA_OFILES in your Makefile stub.  This is
64162852Sdesa list of object file names that should be treated as required
65162852Sdesfor this configuration - they will be included in libiberty.a,
66162852Sdesregardless of whatever might be in the C library.
67162852Sdes