| 1 |
39 |
lampret |
README for newlib-1.8.1 release
|
| 2 |
|
|
(mostly cribbed from the README in the gdb-4.13 release)
|
| 3 |
|
|
|
| 4 |
|
|
This is `newlib', a simple ANSI C library, math library, and collection
|
| 5 |
|
|
of board support packages.
|
| 6 |
|
|
|
| 7 |
|
|
The newlib and libgloss subdirectories are a collection of software from
|
| 8 |
|
|
several sources, each with their own copyright. See the file COPYING.NEWLIB
|
| 9 |
|
|
for details. The rest of the release tree is under either the GNU GPL or
|
| 10 |
|
|
LPGL copyright.
|
| 11 |
|
|
|
| 12 |
|
|
THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
|
| 13 |
|
|
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
| 14 |
|
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
| 15 |
|
|
|
| 16 |
|
|
|
| 17 |
|
|
Unpacking and Installation -- quick overview
|
| 18 |
|
|
==========================
|
| 19 |
|
|
|
| 20 |
|
|
When you unpack the newlib-1.8.1.tar.gz file, you'll find a directory
|
| 21 |
|
|
called `newlib-1.8.1', which contains:
|
| 22 |
|
|
|
| 23 |
|
|
COPYING config/ install-sh* mpw-configure
|
| 24 |
|
|
COPYING.LIB config-ml.in libgloss/ mpw-install
|
| 25 |
|
|
COPYING.NEWLIB config.guess* mkinstalldirs* newlib/
|
| 26 |
|
|
CYGNUS config.sub* move-if-change* symlink-tree*
|
| 27 |
|
|
ChangeLog configure* mpw-README texinfo/
|
| 28 |
|
|
Makefile.in configure.in mpw-build.in
|
| 29 |
|
|
README etc/ mpw-config.in
|
| 30 |
|
|
|
| 31 |
|
|
To build NEWLIB, you can just do:
|
| 32 |
|
|
|
| 33 |
|
|
cd newlib-1.8.1
|
| 34 |
|
|
./configure --target=
|
| 35 |
|
|
make all install
|
| 36 |
|
|
|
| 37 |
|
|
This will configure and build all the libraries and crt0 (if one exists).
|
| 38 |
|
|
If `configure' can't determine your host system type, specify one as its
|
| 39 |
|
|
argument, e.g., sun4 or sun4sol2. NEWLIB is most often used in cross
|
| 40 |
|
|
environments.
|
| 41 |
|
|
|
| 42 |
|
|
NOTE THAT YOU MUST HAVE ALREADY BUILT AND INSTALLED GCC and BINUTILS.
|
| 43 |
|
|
|
| 44 |
|
|
|
| 45 |
|
|
More Documentation
|
| 46 |
|
|
==================
|
| 47 |
|
|
|
| 48 |
|
|
Newlib documentation is available on the net via:
|
| 49 |
|
|
http://www.cygnus.com/pubs/gnupro
|
| 50 |
|
|
|
| 51 |
|
|
All the documentation for NEWLIB comes as part of the machine-readable
|
| 52 |
|
|
distribution. The documentation is written in Texinfo format, which is
|
| 53 |
|
|
a documentation system that uses a single source file to produce both
|
| 54 |
|
|
on-line information and a printed manual. You can use one of the Info
|
| 55 |
|
|
formatting commands to create the on-line version of the documentation
|
| 56 |
|
|
and TeX (or `texi2roff') to typeset the printed version.
|
| 57 |
|
|
|
| 58 |
|
|
If you want to format these Info files yourself, you need one of the
|
| 59 |
|
|
Info formatting programs, such as `texinfo-format-buffer' or `makeinfo'.
|
| 60 |
|
|
|
| 61 |
|
|
If you want to typeset and print copies of this manual, you need TeX,
|
| 62 |
|
|
a program to print its DVI output files, and `texinfo.tex', the Texinfo
|
| 63 |
|
|
definitions file.
|
| 64 |
|
|
|
| 65 |
|
|
TeX is a typesetting program; it does not print files directly, but
|
| 66 |
|
|
produces output files called DVI files. To print a typeset document,
|
| 67 |
|
|
you need a program to print DVI files. If your system has TeX
|
| 68 |
|
|
installed, chances are it has such a program. The precise command to
|
| 69 |
|
|
use depends on your system; `lpr -d' is common; another (for PostScript
|
| 70 |
|
|
devices) is `dvips'. The DVI print command may require a file name
|
| 71 |
|
|
without any extension or a `.dvi' extension.
|
| 72 |
|
|
|
| 73 |
|
|
TeX also requires a macro definitions file called `texinfo.tex'.
|
| 74 |
|
|
This file tells TeX how to typeset a document written in Texinfo
|
| 75 |
|
|
format. On its own, TeX cannot read, much less typeset a Texinfo file.
|
| 76 |
|
|
`texinfo.tex' is distributed with NEWLIB and is located in the
|
| 77 |
|
|
`newlib-VERSION-NUMBER/texinfo' directory.
|
| 78 |
|
|
|
| 79 |
|
|
|
| 80 |
|
|
|
| 81 |
|
|
Compiling NEWLIB in another directory
|
| 82 |
|
|
=====================================
|
| 83 |
|
|
|
| 84 |
|
|
If you want to run NEWLIB versions for several host or target machines,
|
| 85 |
|
|
you need a different `newlib' compiled for each combination of host and
|
| 86 |
|
|
target. `configure' is designed to make this easy by allowing you to
|
| 87 |
|
|
generate each configuration in a separate subdirectory, rather than in
|
| 88 |
|
|
the source directory. If your `make' program handles the `VPATH'
|
| 89 |
|
|
feature correctly (like GNU `make') running `make' in each of these
|
| 90 |
|
|
directories builds the `newlib' libraries specified there.
|
| 91 |
|
|
|
| 92 |
|
|
To build `newlib' in a separate directory, run `configure' with the
|
| 93 |
|
|
`--srcdir' option to specify where to find the source. (You also need
|
| 94 |
|
|
to specify a path to find `configure' itself from your working
|
| 95 |
|
|
directory. If the path to `configure' would be the same as the
|
| 96 |
|
|
argument to `--srcdir', you can leave out the `--srcdir' option; it
|
| 97 |
|
|
will be assumed.)
|
| 98 |
|
|
|
| 99 |
|
|
For example, with version 1.8.1, you can build NEWLIB in a separate
|
| 100 |
|
|
directory for a Sun 4 cross m68k-aout environment like this:
|
| 101 |
|
|
|
| 102 |
|
|
cd newlib-1.8.1
|
| 103 |
|
|
mkdir ../newlib-m68k-aout
|
| 104 |
|
|
cd ../newlib-m68k-aout
|
| 105 |
|
|
../newlib-1.8.1/configure --host=sun4 --target=m68k-aout
|
| 106 |
|
|
make
|
| 107 |
|
|
|
| 108 |
|
|
When `configure' builds a configuration using a remote source
|
| 109 |
|
|
directory, it creates a tree for the binaries with the same structure
|
| 110 |
|
|
(and using the same names) as the tree under the source directory. In
|
| 111 |
|
|
the example, you'd find the Sun 4 library `libiberty.a' in the
|
| 112 |
|
|
directory `newlib-m68k-aout/libiberty', and NEWLIB itself in
|
| 113 |
|
|
`newlib-m68k-aout/newlib'.
|
| 114 |
|
|
|
| 115 |
|
|
When you run `make' to build a program or library, you must run it
|
| 116 |
|
|
in a configured directory--whatever directory you were in when you
|
| 117 |
|
|
called `configure' (or one of its subdirectories).
|
| 118 |
|
|
|
| 119 |
|
|
The `Makefile' that `configure' generates in each source directory
|
| 120 |
|
|
also runs recursively. If you type `make' in a source directory such
|
| 121 |
|
|
as `newlib-1.8.1' (or in a separate configured directory configured with
|
| 122 |
|
|
`--srcdir=PATH/newlib-1.8.1'), you will build all the required libraries.
|
| 123 |
|
|
|
| 124 |
|
|
When you have multiple hosts or targets configured in separate
|
| 125 |
|
|
directories, you can run `make' on them in parallel (for example, if
|
| 126 |
|
|
they are NFS-mounted on each of the hosts); they will not interfere
|
| 127 |
|
|
with each other.
|
| 128 |
|
|
|
| 129 |
|
|
|
| 130 |
|
|
Specifying names for hosts and targets
|
| 131 |
|
|
======================================
|
| 132 |
|
|
|
| 133 |
|
|
The specifications used for hosts and targets in the `configure'
|
| 134 |
|
|
script are based on a three-part naming scheme, but some short
|
| 135 |
|
|
predefined aliases are also supported. The full naming scheme encodes
|
| 136 |
|
|
three pieces of information in the following pattern:
|
| 137 |
|
|
|
| 138 |
|
|
ARCHITECTURE-VENDOR-OS
|
| 139 |
|
|
|
| 140 |
|
|
For example, you can use the alias `sun4' as a HOST argument or in a
|
| 141 |
|
|
`--target=TARGET' option. The equivalent full name is
|
| 142 |
|
|
`sparc-sun-sunos4'.
|
| 143 |
|
|
|
| 144 |
|
|
The `configure' script accompanying NEWLIB does not provide any query
|
| 145 |
|
|
facility to list all supported host and target names or aliases.
|
| 146 |
|
|
`configure' calls the Bourne shell script `config.sub' to map
|
| 147 |
|
|
abbreviations to full names; you can read the script, if you wish, or
|
| 148 |
|
|
you can use it to test your guesses on abbreviations--for example:
|
| 149 |
|
|
|
| 150 |
|
|
% sh config.sub sun4
|
| 151 |
|
|
sparc-sun-sunos4.1.1
|
| 152 |
|
|
% sh config.sub sun3
|
| 153 |
|
|
m68k-sun-sunos4.1.1
|
| 154 |
|
|
% sh config.sub decstation
|
| 155 |
|
|
mips-dec-ultrix4.2
|
| 156 |
|
|
% sh config.sub hp300bsd
|
| 157 |
|
|
m68k-hp-bsd
|
| 158 |
|
|
% sh config.sub i386v
|
| 159 |
|
|
i386-pc-sysv
|
| 160 |
|
|
% sh config.sub i786v
|
| 161 |
|
|
Invalid configuration `i786v': machine `i786v' not recognized
|
| 162 |
|
|
|
| 163 |
|
|
|
| 164 |
|
|
`configure' options
|
| 165 |
|
|
===================
|
| 166 |
|
|
|
| 167 |
|
|
Here is a summary of the `configure' options and arguments that are
|
| 168 |
|
|
most often useful for building NEWLIB. `configure' also has several other
|
| 169 |
|
|
options not listed here.
|
| 170 |
|
|
|
| 171 |
|
|
configure [--help]
|
| 172 |
|
|
[--prefix=DIR]
|
| 173 |
|
|
[--srcdir=PATH]
|
| 174 |
|
|
[--target=TARGET] HOST
|
| 175 |
|
|
|
| 176 |
|
|
You may introduce options with a single `-' rather than `--' if you
|
| 177 |
|
|
prefer; but you may abbreviate option names if you use `--'.
|
| 178 |
|
|
|
| 179 |
|
|
`--help'
|
| 180 |
|
|
Display a quick summary of how to invoke `configure'.
|
| 181 |
|
|
|
| 182 |
|
|
`--prefix=DIR'
|
| 183 |
|
|
Configure the source to install programs and files in directory
|
| 184 |
|
|
`DIR'.
|
| 185 |
|
|
|
| 186 |
|
|
`--exec-prefix=DIR'
|
| 187 |
|
|
Configure the source to install host-dependent files in directory
|
| 188 |
|
|
`DIR'.
|
| 189 |
|
|
|
| 190 |
|
|
`--srcdir=PATH'
|
| 191 |
|
|
*Warning: using this option requires GNU `make', or another `make'
|
| 192 |
|
|
that compatibly implements the `VPATH' feature.
|
| 193 |
|
|
Use this option to make configurations in directories separate
|
| 194 |
|
|
from the NEWLIB source directories. Among other things, you can use
|
| 195 |
|
|
this to build (or maintain) several configurations simultaneously,
|
| 196 |
|
|
in separate directories. `configure' writes configuration
|
| 197 |
|
|
specific files in the current directory, but arranges for them to
|
| 198 |
|
|
use the source in the directory PATH. `configure' will create
|
| 199 |
|
|
directories under the working directory in parallel to the source
|
| 200 |
|
|
directories below PATH.
|
| 201 |
|
|
|
| 202 |
|
|
`--norecursion'
|
| 203 |
|
|
Configure only the directory level where `configure' is executed;
|
| 204 |
|
|
do not propagate configuration to subdirectories.
|
| 205 |
|
|
|
| 206 |
|
|
`--target=TARGET'
|
| 207 |
|
|
Configure NEWLIB for running on the specified TARGET.
|
| 208 |
|
|
|
| 209 |
|
|
There is no convenient way to generate a list of all available
|
| 210 |
|
|
targets.
|
| 211 |
|
|
|
| 212 |
|
|
`HOST ...'
|
| 213 |
|
|
Configure NEWLIB to be built using a cross compiler running on
|
| 214 |
|
|
the specified HOST.
|
| 215 |
|
|
|
| 216 |
|
|
There is no convenient way to generate a list of all available
|
| 217 |
|
|
hosts.
|
| 218 |
|
|
|
| 219 |
|
|
|
| 220 |
|
|
Reporting Bugs
|
| 221 |
|
|
==============
|
| 222 |
|
|
|
| 223 |
|
|
The correct address for reporting bugs found in NEWLIB is "newlib@cygnus.com".
|
| 224 |
|
|
Please email all bug reports to that address. Please include the NEWLIB
|
| 225 |
|
|
version number (e.g., newlib-1.8.1), and how you configured it
|
| 226 |
|
|
(e.g., "sun4 host and m68k-aout target"). Since NEWLIB supports many
|
| 227 |
|
|
different configurations, it is important that you be precise about this.
|