URL
https://opencores.org/ocsvn/or1k/or1k/trunk
Subversion Repositories or1k
[/] [or1k/] [trunk/] [newlib-1.10.0/] [newlib/] [README] - Rev 1765
Compare with Previous | Blame | View Log
README for newlib-1.10.0 release(mostly cribbed from the README in the gdb-4.13 release)This is `newlib', a simple ANSI C library, math library, and collectionof board support packages.The newlib and libgloss subdirectories are a collection of software fromseveral sources, each with their own copyright. See the file COPYING.NEWLIBfor details. The rest of the release tree is under either the GNU GPL orLPGL copyright.THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS ORIMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.Unpacking and Installation -- quick overview==========================When you unpack the newlib-1.10.0.tar.gz file, you'll find a directorycalled `newlib-1.10.0', which contains:COPYING config/ install-sh* mpw-configureCOPYING.LIB config-ml.in libgloss/ mpw-installCOPYING.NEWLIB config.guess* mkinstalldirs* newlib/CYGNUS config.sub* move-if-change* symlink-tree*ChangeLog configure* mpw-README texinfo/Makefile.in configure.in mpw-build.inREADME etc/ mpw-config.inTo build NEWLIB, you must follow the instructions in the section entitled"Compiling NEWLIB".This will configure and build all the libraries and crt0 (if one exists).If `configure' can't determine your host system type, specify one as itsargument, e.g., sun4 or sun4sol2. NEWLIB is most often used in crossenvironments.NOTE THAT YOU MUST HAVE ALREADY BUILT AND INSTALLED GCC and BINUTILS.More Documentation==================Newlib documentation is available on the net via:http://www.cygnus.com/pubs/gnuproAll the documentation for NEWLIB comes as part of the machine-readabledistribution. The documentation is written in Texinfo format, which isa documentation system that uses a single source file to produce bothon-line information and a printed manual. You can use one of the Infoformatting commands to create the on-line version of the documentationand TeX (or `texi2roff') to typeset the printed version.If you want to format these Info files yourself, you need one of theInfo formatting programs, such as `texinfo-format-buffer' or `makeinfo'.If you want to typeset and print copies of this manual, you need TeX,a program to print its DVI output files, and `texinfo.tex', the Texinfodefinitions file.TeX is a typesetting program; it does not print files directly, butproduces output files called DVI files. To print a typeset document,you need a program to print DVI files. If your system has TeXinstalled, chances are it has such a program. The precise command touse depends on your system; `lpr -d' is common; another (for PostScriptdevices) is `dvips'. The DVI print command may require a file namewithout any extension or a `.dvi' extension.TeX also requires a macro definitions file called `texinfo.tex'.This file tells TeX how to typeset a document written in Texinfoformat. On its own, TeX cannot read, much less typeset a Texinfo file.`texinfo.tex' is distributed with NEWLIB and is located in the`newlib-VERSION-NUMBER/texinfo' directory.Compiling NEWLIB================To compile NEWLIB, you must build it in a directory separate fromthe source directory. If you want to run NEWLIB versions for several hostor target machines, you need a different `newlib' compiled for each combinationof host and target. `configure' is designed to make this easy by allowingyou to generate each configuration in a separate subdirectory.If your `make' program handles the `VPATH' feature correctly (like GNU `make')running `make' in each of these directories builds the `newlib' librariesspecified there.To build `newlib' in a specific directory, run `configure' with the`--srcdir' option to specify where to find the source. (You also needto specify a path to find `configure' itself from your workingdirectory. If the path to `configure' would be the same as theargument to `--srcdir', you can leave out the `--srcdir' option; itwill be assumed.)For example, with version 1.10.0, you can build NEWLIB in a separatedirectory for a Sun 4 cross m68k-aout environment like this:cd newlib-1.10.0mkdir ../newlib-m68k-aoutcd ../newlib-m68k-aout../newlib-1.10.0/configure --host=sun4 --target=m68k-aoutmakeWhen `configure' builds a configuration using a remote sourcedirectory, it creates a tree for the binaries with the same structure(and using the same names) as the tree under the source directory. Inthe example, you'd find the Sun 4 library `libiberty.a' in thedirectory `newlib-m68k-aout/libiberty', and NEWLIB itself in`newlib-m68k-aout/newlib'.When you run `make' to build a program or library, you must run itin a configured directory--whatever directory you were in when youcalled `configure' (or one of its subdirectories).The `Makefile' that `configure' generates in each source directoryalso runs recursively. If you type `make' in a source directory suchas `newlib-1.10.0' (or in a separate configured directory configured with`--srcdir=PATH/newlib-1.10.0'), you will build all the required libraries.When you have multiple hosts or targets configured in separatedirectories, you can run `make' on them in parallel (for example, ifthey are NFS-mounted on each of the hosts); they will not interferewith each other.Specifying names for hosts and targets======================================The specifications used for hosts and targets in the `configure'script are based on a three-part naming scheme, but some shortpredefined aliases are also supported. The full naming scheme encodesthree pieces of information in the following pattern:ARCHITECTURE-VENDOR-OSFor example, you can use the alias `sun4' as a HOST argument or in a`--target=TARGET' option. The equivalent full name is`sparc-sun-sunos4'.The `configure' script accompanying NEWLIB does not provide any queryfacility to list all supported host and target names or aliases.`configure' calls the Bourne shell script `config.sub' to mapabbreviations to full names; you can read the script, if you wish, oryou can use it to test your guesses on abbreviations--for example:% sh config.sub sun4sparc-sun-sunos4.1.1% sh config.sub sun3m68k-sun-sunos4.1.1% sh config.sub decstationmips-dec-ultrix4.2% sh config.sub hp300bsdm68k-hp-bsd% sh config.sub i386vi386-pc-sysv% sh config.sub i786vInvalid configuration `i786v': machine `i786v' not recognized`configure' options===================Here is a summary of the `configure' options and arguments that aremost often useful for building NEWLIB. `configure' also has several otheroptions not listed here.configure [--help][--prefix=DIR][--srcdir=PATH][--target=TARGET] HOSTYou may introduce options with a single `-' rather than `--' if youprefer; but you may abbreviate option names if you use `--'.`--help'Display a quick summary of how to invoke `configure'.`--prefix=DIR'Configure the source to install programs and files in directory`DIR'.`--exec-prefix=DIR'Configure the source to install host-dependent files in directory`DIR'.`--srcdir=PATH'*Warning: using this option requires GNU `make', or another `make'that compatibly implements the `VPATH' feature.Use this option to make configurations in directories separatefrom the NEWLIB source directories. Among other things, you can usethis to build (or maintain) several configurations simultaneously,in separate directories. `configure' writes configurationspecific files in the current directory, but arranges for them touse the source in the directory PATH. `configure' will createdirectories under the working directory in parallel to the sourcedirectories below PATH.`--norecursion'Configure only the directory level where `configure' is executed;do not propagate configuration to subdirectories.`--target=TARGET'Configure NEWLIB for running on the specified TARGET.There is no convenient way to generate a list of all availabletargets.`HOST ...'Configure NEWLIB to be built using a cross compiler running onthe specified HOST.There is no convenient way to generate a list of all availablehosts.Shared newlib=============newlib now uses libtool when it is being compiled natively (with--target=i[3456]86-pc-linux-gnu) on an i[3456]86-pc-linux-gnu host. Thisallows newlib to be compiled as a shared library.To configure newlib, do the following from your build directory:$(source_dir)/src/configure --with-newlib --prefix=$(install_dir)configure will recognize that host == target ==i[3456]86-pc-linux-gnu, so it will tell newlib to compile itself usinglibtool. By default, libtool will build shared and static versions ofnewlib.To compile a program against shared newlib, do the following (wheretarget_install_dir = $(install_dir)/i[3456]86-pc-linux-gnu):gcc -nostdlib $(target_install_dir)/lib/crt0.o progname.c -I $(target_install_dir)/include -L $(target_install_dir)/lib -lc -lm -lgccTo run the program, make sure that $(target_install_dir)/lib is listedin the LD_LIBRARY_PATH environment variable.To create a static binary linked against newlib, do the following:gcc -nostdlib -static $(target_install_dir)/lib/crt0.o progname.c -I $(target_install_dir)/include -L $(target_install_dir)/lib -lc -lmlibtool can be instructed to produce only static libraries. To buildnewlib as a static library only, do the following from your builddirectory:$(source_dir)/src/configure --with-newlib --prefix=$(install_dir) --disable-sharedReporting Bugs==============The correct address for reporting bugs found in NEWLIB is"newlib@sources.redhat.com". Please email all bug reports to thataddress. Please include the NEWLIB version number (e.g., newlib-1.10.0),and how you configured it (e.g., "sun4 host and m68k-aout target").Since NEWLIB supports many different configurations, it is importantthat you be precise about this.Archives of the newlib mailing list are on-line, seehttp://sources.redhat.com/ml/newlib/
