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