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