xref: /dflybsd-src/contrib/gdb-7/libiberty/README (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
1*86d7f5d3SJohn MarinoThis directory contains the -liberty library of free software.
2*86d7f5d3SJohn MarinoIt is a collection of subroutines used by various GNU programs.
3*86d7f5d3SJohn MarinoCurrent members include:
4*86d7f5d3SJohn Marino
5*86d7f5d3SJohn Marino	getopt -- get options from command line
6*86d7f5d3SJohn Marino	obstack -- stacks of arbitrarily-sized objects
7*86d7f5d3SJohn Marino	strerror -- error message strings corresponding to errno
8*86d7f5d3SJohn Marino	strtol -- string-to-long conversion
9*86d7f5d3SJohn Marino	strtoul -- string-to-unsigned-long conversion
10*86d7f5d3SJohn Marino
11*86d7f5d3SJohn MarinoWe expect many of the GNU subroutines that are floating around to
12*86d7f5d3SJohn Marinoeventually arrive here.
13*86d7f5d3SJohn Marino
14*86d7f5d3SJohn MarinoThe library must be configured from the top source directory.  Don't
15*86d7f5d3SJohn Marinotry to run configure in this directory.  Follow the configuration
16*86d7f5d3SJohn Marinoinstructions in ../README.
17*86d7f5d3SJohn Marino
18*86d7f5d3SJohn MarinoPlease report bugs to "gcc-bugs@gcc.gnu.org" and send fixes to
19*86d7f5d3SJohn Marino"gcc-patches@gcc.gnu.org".  Thank you.
20*86d7f5d3SJohn Marino
21*86d7f5d3SJohn MarinoADDING A NEW FILE
22*86d7f5d3SJohn Marino=================
23*86d7f5d3SJohn Marino
24*86d7f5d3SJohn MarinoThere are two sets of files:  Those that are "required" will be
25*86d7f5d3SJohn Marinoincluded in the library for all configurations, while those
26*86d7f5d3SJohn Marinothat are "optional" will be included in the library only if "needed."
27*86d7f5d3SJohn Marino
28*86d7f5d3SJohn MarinoTo add a new required file, edit Makefile.in to add the source file
29*86d7f5d3SJohn Marinoname to CFILES and the object file to REQUIRED_OFILES.
30*86d7f5d3SJohn Marino
31*86d7f5d3SJohn MarinoTo add a new optional file, it must provide a single function, and the
32*86d7f5d3SJohn Marinoname of the function must be the same as the name of the file.
33*86d7f5d3SJohn Marino
34*86d7f5d3SJohn Marino    * Add the source file name to CFILES in Makefile.in and the object
35*86d7f5d3SJohn Marino      file to CONFIGURED_OFILES.
36*86d7f5d3SJohn Marino
37*86d7f5d3SJohn Marino    * Add the function to name to the funcs shell variable in
38*86d7f5d3SJohn Marino      configure.ac.
39*86d7f5d3SJohn Marino
40*86d7f5d3SJohn Marino    * Add the function to the AC_CHECK_FUNCS lists just after the
41*86d7f5d3SJohn Marino      setting of the funcs shell variable.  These AC_CHECK_FUNCS calls
42*86d7f5d3SJohn Marino      are never executed; they are there to make autoheader work
43*86d7f5d3SJohn Marino      better.
44*86d7f5d3SJohn Marino
45*86d7f5d3SJohn Marino    * Consider the special cases of building libiberty; as of this
46*86d7f5d3SJohn Marino      writing, the special cases are newlib and VxWorks.  If a
47*86d7f5d3SJohn Marino      particular special case provides the function, you do not need
48*86d7f5d3SJohn Marino      to do anything.  If it does not provide the function, add the
49*86d7f5d3SJohn Marino      object file to LIBOBJS, and add the function name to the case
50*86d7f5d3SJohn Marino      controlling whether to define HAVE_func.
51*86d7f5d3SJohn Marino
52*86d7f5d3SJohn MarinoFinally, in the build directory of libiberty, configure with
53*86d7f5d3SJohn Marino"--enable-maintainer-mode", run "make maint-deps" to update
54*86d7f5d3SJohn MarinoMakefile.in, and run 'make stamp-functions' to regenerate
55*86d7f5d3SJohn Marinofunctions.texi.
56*86d7f5d3SJohn Marino
57*86d7f5d3SJohn MarinoThe optional file you've added (e.g. getcwd.c) should compile and work
58*86d7f5d3SJohn Marinoon all hosts where it is needed.  It does not have to work or even
59*86d7f5d3SJohn Marinocompile on hosts where it is not needed.
60*86d7f5d3SJohn Marino
61*86d7f5d3SJohn MarinoADDING A NEW CONFIGURATION
62*86d7f5d3SJohn Marino==========================
63*86d7f5d3SJohn Marino
64*86d7f5d3SJohn MarinoOn most hosts you should be able to use the scheme for automatically
65*86d7f5d3SJohn Marinofiguring out which files are needed.  In that case, you probably
66*86d7f5d3SJohn Marinodon't need a special Makefile stub for that configuration.
67*86d7f5d3SJohn Marino
68*86d7f5d3SJohn MarinoIf the fully automatic scheme doesn't work, you may be able to get
69*86d7f5d3SJohn Marinoby with defining EXTRA_OFILES in your Makefile stub.  This is
70*86d7f5d3SJohn Marinoa list of object file names that should be treated as required
71*86d7f5d3SJohn Marinofor this configuration - they will be included in libiberty.a,
72*86d7f5d3SJohn Marinoregardless of whatever might be in the C library.
73