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