xref: /dflybsd-src/contrib/gdb-7/libiberty/README (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn MarinoThis directory contains the -liberty library of free software.
286d7f5d3SJohn MarinoIt is a collection of subroutines used by various GNU programs.
386d7f5d3SJohn MarinoCurrent members include:
486d7f5d3SJohn Marino
586d7f5d3SJohn Marino	getopt -- get options from command line
686d7f5d3SJohn Marino	obstack -- stacks of arbitrarily-sized objects
786d7f5d3SJohn Marino	strerror -- error message strings corresponding to errno
886d7f5d3SJohn Marino	strtol -- string-to-long conversion
986d7f5d3SJohn Marino	strtoul -- string-to-unsigned-long conversion
1086d7f5d3SJohn Marino
1186d7f5d3SJohn MarinoWe expect many of the GNU subroutines that are floating around to
1286d7f5d3SJohn Marinoeventually arrive here.
1386d7f5d3SJohn Marino
1486d7f5d3SJohn MarinoThe library must be configured from the top source directory.  Don't
1586d7f5d3SJohn Marinotry to run configure in this directory.  Follow the configuration
1686d7f5d3SJohn Marinoinstructions in ../README.
1786d7f5d3SJohn Marino
1886d7f5d3SJohn MarinoPlease report bugs to "gcc-bugs@gcc.gnu.org" and send fixes to
1986d7f5d3SJohn Marino"gcc-patches@gcc.gnu.org".  Thank you.
2086d7f5d3SJohn Marino
2186d7f5d3SJohn MarinoADDING A NEW FILE
2286d7f5d3SJohn Marino=================
2386d7f5d3SJohn Marino
2486d7f5d3SJohn MarinoThere are two sets of files:  Those that are "required" will be
2586d7f5d3SJohn Marinoincluded in the library for all configurations, while those
2686d7f5d3SJohn Marinothat are "optional" will be included in the library only if "needed."
2786d7f5d3SJohn Marino
2886d7f5d3SJohn MarinoTo add a new required file, edit Makefile.in to add the source file
2986d7f5d3SJohn Marinoname to CFILES and the object file to REQUIRED_OFILES.
3086d7f5d3SJohn Marino
3186d7f5d3SJohn MarinoTo add a new optional file, it must provide a single function, and the
3286d7f5d3SJohn Marinoname of the function must be the same as the name of the file.
3386d7f5d3SJohn Marino
3486d7f5d3SJohn Marino    * Add the source file name to CFILES in Makefile.in and the object
3586d7f5d3SJohn Marino      file to CONFIGURED_OFILES.
3686d7f5d3SJohn Marino
3786d7f5d3SJohn Marino    * Add the function to name to the funcs shell variable in
3886d7f5d3SJohn Marino      configure.ac.
3986d7f5d3SJohn Marino
4086d7f5d3SJohn Marino    * Add the function to the AC_CHECK_FUNCS lists just after the
4186d7f5d3SJohn Marino      setting of the funcs shell variable.  These AC_CHECK_FUNCS calls
4286d7f5d3SJohn Marino      are never executed; they are there to make autoheader work
4386d7f5d3SJohn Marino      better.
4486d7f5d3SJohn Marino
4586d7f5d3SJohn Marino    * Consider the special cases of building libiberty; as of this
4686d7f5d3SJohn Marino      writing, the special cases are newlib and VxWorks.  If a
4786d7f5d3SJohn Marino      particular special case provides the function, you do not need
4886d7f5d3SJohn Marino      to do anything.  If it does not provide the function, add the
4986d7f5d3SJohn Marino      object file to LIBOBJS, and add the function name to the case
5086d7f5d3SJohn Marino      controlling whether to define HAVE_func.
5186d7f5d3SJohn Marino
5286d7f5d3SJohn MarinoFinally, in the build directory of libiberty, configure with
5386d7f5d3SJohn Marino"--enable-maintainer-mode", run "make maint-deps" to update
5486d7f5d3SJohn MarinoMakefile.in, and run 'make stamp-functions' to regenerate
5586d7f5d3SJohn Marinofunctions.texi.
5686d7f5d3SJohn Marino
5786d7f5d3SJohn MarinoThe optional file you've added (e.g. getcwd.c) should compile and work
5886d7f5d3SJohn Marinoon all hosts where it is needed.  It does not have to work or even
5986d7f5d3SJohn Marinocompile on hosts where it is not needed.
6086d7f5d3SJohn Marino
6186d7f5d3SJohn MarinoADDING A NEW CONFIGURATION
6286d7f5d3SJohn Marino==========================
6386d7f5d3SJohn Marino
6486d7f5d3SJohn MarinoOn most hosts you should be able to use the scheme for automatically
6586d7f5d3SJohn Marinofiguring out which files are needed.  In that case, you probably
6686d7f5d3SJohn Marinodon't need a special Makefile stub for that configuration.
6786d7f5d3SJohn Marino
6886d7f5d3SJohn MarinoIf the fully automatic scheme doesn't work, you may be able to get
6986d7f5d3SJohn Marinoby with defining EXTRA_OFILES in your Makefile stub.  This is
7086d7f5d3SJohn Marinoa list of object file names that should be treated as required
7186d7f5d3SJohn Marinofor this configuration - they will be included in libiberty.a,
7286d7f5d3SJohn Marinoregardless of whatever might be in the C library.
73