xref: /openbsd/gnu/lib/libiberty/src/README (revision 20fce977)
100bf4279SespieThis directory contains the -liberty library of free software.
200bf4279SespieIt is a collection of subroutines used by various GNU programs.
300bf4279SespieCurrent members include:
400bf4279Sespie
500bf4279Sespie	getopt -- get options from command line
600bf4279Sespie	obstack -- stacks of arbitrarily-sized objects
700bf4279Sespie	strerror -- error message strings corresponding to errno
800bf4279Sespie	strtol -- string-to-long conversion
900bf4279Sespie	strtoul -- string-to-unsigned-long conversion
1000bf4279Sespie
1100bf4279SespieWe expect many of the GNU subroutines that are floating around to
1200bf4279Sespieeventually arrive here.
1300bf4279Sespie
1400bf4279SespieThe library must be configured from the top source directory.  Don't
1500bf4279Sespietry to run configure in this directory.  Follow the configuration
1600bf4279Sespieinstructions in ../README.
1700bf4279Sespie
189588ddcfSespiePlease report bugs to "gcc-bugs@gcc.gnu.org" and send fixes to
199588ddcfSespie"gcc-patches@gcc.gnu.org".  Thank you.
2000bf4279Sespie
2100bf4279SespieADDING A NEW FILE
2200bf4279Sespie=================
2300bf4279Sespie
2400bf4279SespieThere are two sets of files:  Those that are "required" will be
2500bf4279Sespieincluded in the library for all configurations, while those
2600bf4279Sespiethat are "optional" will be included in the library only if "needed."
2700bf4279Sespie
2800bf4279SespieTo add a new required file, edit Makefile to add the source file
2900bf4279Sespiename to CFILES and the object file to REQUIRED_OFILES.
3000bf4279Sespie
3100bf4279SespieTo add a new optional file, it must provide a single function, and the
3200bf4279Sespiename of the function must be the same as the name of the file.
3300bf4279Sespie
3400bf4279Sespie    * Add the source file name to CFILES.
3500bf4279Sespie
3600bf4279Sespie    * Add the function to name to the funcs shell variable in
37*20fce977Smiod      configure.ac.
3800bf4279Sespie
3900bf4279Sespie    * Add the function to the AC_CHECK_FUNCS lists just after the
4000bf4279Sespie      setting of the funcs shell variable.  These AC_CHECK_FUNCS calls
4100bf4279Sespie      are never executed; they are there to make autoheader work
4200bf4279Sespie      better.
4300bf4279Sespie
4400bf4279Sespie    * Consider the special cases of building libiberty; as of this
4500bf4279Sespie      writing, the special cases are newlib and VxWorks.  If a
4600bf4279Sespie      particular special case provides the function, you do not need
4700bf4279Sespie      to do anything.  If it does not provide the function, add the
4800bf4279Sespie      object file to LIBOBJS, and add the function name to the case
4900bf4279Sespie      controlling whether to define HAVE_func.
5000bf4279Sespie
5100bf4279SespieThe optional file you've added (e.g. getcwd.c) should compile and work
5200bf4279Sespieon all hosts where it is needed.  It does not have to work or even
5300bf4279Sespiecompile on hosts where it is not needed.
5400bf4279Sespie
5500bf4279SespieADDING A NEW CONFIGURATION
5600bf4279Sespie==========================
5700bf4279Sespie
5800bf4279SespieOn most hosts you should be able to use the scheme for automatically
5900bf4279Sespiefiguring out which files are needed.  In that case, you probably
6000bf4279Sespiedon't need a special Makefile stub for that configuration.
6100bf4279Sespie
6200bf4279SespieIf the fully automatic scheme doesn't work, you may be able to get
6300bf4279Sespieby with defining EXTRA_OFILES in your Makefile stub.  This is
6400bf4279Sespiea list of object file names that should be treated as required
6500bf4279Sespiefor this configuration - they will be included in libiberty.a,
6600bf4279Sespieregardless of whatever might be in the C library.
67