URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [README.host] - Rev 786
Go to most recent revision | Compare with Previous | Blame | View Log
eCos Host-side Software=======================This README file only describes the eCos host-side software. Fordetails of the eCos target-side software or the required toolchains,please see other documentation. A good starting point ishttp://sources.redhat.com/ecosThere are two categories of host-side software. The host subdirectorycontains generic software, primarily related to the eCos configurationtechnology. All eCos users will need to use some of this technology toconfigure and build eCos, either using pre-built binaries or bybuilding the host-side software from source. The generic softwareshould be portable to a wide range of host platforms.There is also package-specific host-side software. Much of this is I/Orelated. For example the generic USB-slave package contains someprograms related to testing; a test application is run on a targetwith suitable USB slave-side hardware, and needs to interact withanother program running on the USB host; the latter ispackage-specific host-side software and can be found in thesubdirectory packages/io/usb/slave. Code like this may havesignificant platform dependencies and may only work on a singleplatform or on a small number of platforms. There may also bespecial requirements, for example it may be necessary to install someprograms suid root so that they have appropriate access to thehardware.The host subdirectory includes the following:infra/This is an implementation of the eCos infrastructure that can beused on the host-side, and provides assertion, tracing andtestcase support.NOTE: the eCos infrastructure facilities are not especiallywell-suited to host-side development, in particular they are notC++-oriented. There are plans to remove the current infrastructurecompletely and replace it with something more suitable. Peopleplanning new projects should be aware of this, and may wish toavoid using the current infrastructure.libcdl/The CDL library lies at the heart of the eCos configurationtechnology.tools/configtool/The sources to the various configuration tools can be found here.tools/configtool/common/common/Contains sources related to makefile generation, shared by thecommand line and graphical tools.tools/configtool/standalone/common/Contains the command line ecosconfig tool.tools/configtool/standalone/wxwin/Contains sources for the wxWindows-based, Linux and Windows graphicalconfiguration tool. The Windows version can currently only bebuilt with Visual C++, not with cygwin g++.tools/configtool/common/win32/tools/configtool/standalone/win32/Contains sources for the older, MFC-based, Windows-only graphicalconfiguration tool. Again this can currently only be built withVisual C++.The two graphical configuration tools have their own build procedures,described in tools/configtool/standalone/wxwin/ReadMe andtools/configtool/standalone/win32/ReadMe respectively.Package-specific host-side code lives in the host subdirectory of theappropriate package, for example packages/io/usb/slave/<version>/host.Most packages only provide target-side code and hence will not have ahost subdirectory. Users can install various packages from a varietyof sources, and where a package does have host-side software thepackage documentation should be consulted for further information.Installing on Linux, Other Unix Systems, and Cygwin---------------------------------------------------Both generic host-side software (infra, libcdl and ecosconfig) andpackage-specific software can be built with the conventional"configure/make/make install" sequence. However the code does notconform fully to GNU coding standards so some operations such as "makedist" are not supported. There is limited support for DejaGnu-basedtesting.Much of the host-side software has a dependency on Tcl. This is notsupplied with the sources since many users will already have asuitable installation, for example it is shipped as standard with allmajor Linux distributions. The generic host-side software should workwith any release of Tcl from 8.0 onwards. The package-specificsoftware requires a more recent version, 8.3 or later. If no suitableTcl installation is available then the configure step will stillsucceed but some of the package-specific software will not be built.There are two main approaches to building the host-side software:1) build the generic and the package-specific code in one build tree.This uses the top-level configure script. The script automaticallyinvokes the configure script in the main host subdirectory. Inaddition it searches the packages hierarchy for host subdirectoriescontaining their own configure scripts and will invoke those.Note: the search for host subdirectories happens during configuretime, not during the make. If new packages with host-side code areadded to the repository then it will be necessary to re-run thetoplevel configure script.2) build the generic code in one build tree, using the configurescript in the toplevel's host subdirectory. Then build some or allof the package-specific code in separate build trees, using theconfigure scripts in each package's host subdirectory.The first approach is generally simpler. However some of thepackage-specific code requires special installation, for example aprogram may have to be installed suid root so that it has the rightprivileges to access hardware, and hence the "make install" step hasto be run by the superuser. Also some of the package-specific code israther specialized and may be of no interest to many users. Forexample, the USB testing code is only useful when developingUSB-based applications. Hence some users may prefer the secondapproach, building just the generic code and a subset of thepackage-specific code.It is necessary to use a separate build tree rather than builddirectly in the source tree. This is enforced by the configure scripts.$ mkdir build$ cd buildThe next step is to run the desired configure script. To build allthe host-side software this means the toplevel configure script:$ <path>/configure <args>Alternatively to build just the generic host-side software, use theconfigure script in the host subdirectory.$ mkdir host$ cd host$ <path>/host/configure <args>Or, to build just one package's host-side code:$ mkdir -p packages/io/usb/slave/current/host$ cd packages/io/usb/slave/current/host$ <path>/packages/io/usb/slave/current/host/configure <args>(It is not actually necessary to use the same directory structure inthe build tree as in the source tree, but doing so can avoidconfusion).A list of all the command-line options can be obtained by running"configure --help". The most important ones are as follows:1) --prefix. This can be used to specify the location of the installtree, defaulting to /usr/local, so the ecosconfig program ends upin /usr/local/bin/ecosconfig and the CDL library ends up in/usr/local/lib/libcdl.a. If an alternative location is preferredthis can be specified with --prefix, for example:$ <path>/configure --prefix=/usr/local/ecos <args>2) --enable-debug. By default all assertions and tracing are disabled.When debugging any of the generic host-side software these shouldbe enabled. Some package-specific code may not have any extradebug support, in which case --enable-debug would be ignored.$ <path>/configure --enable-debugIt is also possible to control most of the assertion and tracingmacros at a finer grain. This is intended mainly for use by thedevelopers.--disable-asserts disable all assertions--disable-preconditions disable a subset of the assertions--disable-postconditions disable a subset of the assertions--disable-invariants disable a subset of the assertions--disable-loopinvariants disable a subset of the assertions--disable-tracing disable tracing--disable-fntracing disable function entry/exit tracing3) --with-tcl=<path>--with-tcl-version=<number>The host-side tools have a dependency on Tcl, which is not suppliedwith the sources because many people will already have a suitableinstallation. Specifically it is necessary to have the header filetcl.h and appropriate libraries such that -ltcl will work - thiscan involve either static or shared libraries. Some tools may requireTk as well as Tcl.Unfortunately there is considerable variation in Tcl installations.In theory all Tcl installations have a file tclConfig.sh whichdefines exactly how to compile and link code that uses Tcl, and Tkhas a similar file tkConfig.sh. The eCos configure scripts look forthese files, first in $(prefix)/lib, then in /usr/lib. If the systemalready has a Tcl installation in /usr then the configure script willautomatically find /usr/lib/tclConfig.sh and it is not necessaryto pass additional options when configuring the eCos host-sidesoftware. Alternatively, if for example you have installed a morerecent version of Tcl/Tk in the same place that you want to install theeCos software, e.g. /usr/local, then $(prefix)/lib/tclConfig.shwill be read in.It is also possible that a more recent version of Tcl has been installedin a different location. For example, you may wish to install the eCos hosttools in /opt/ecos but use a version of Tcl installed in /usr/local. TheeCos configure scripts need to be told explicitly where to look forthe Tcl:$ <path>/configure --with-tcl=/usr/local ...Some systems, for example Debian Linux 3.0, do not install tclConfig.shin /usr/lib because that makes it more difficult to have several differentversions of Tcl installed at the same time. Instead tclConfig.sh is foundin a versioned directory such as /usr/lib/tcl8.3. Since several versionsmay be installed the desired one must be specified explicitly.$ <path>/configure --with-tcl-version=8.3The --with-tcl and --with-tcl-version options are combined to give a search path:<with>/lib/tclConfig.sh<with>/lib/tcl<vsn>/tclConfig.sh<prefix>/lib/tclConfig.sh<prefix>/lib/tcl<vsn>/tclConfig.sh/usr/lib/tclConfig.sh/usr/lib/tcl<vsn>/tclConfig.shIf tclConfig.sh cannot be found in any of these places then it is assumedthat Tcl has not been properly installed and the eCos configure script willfail. The --with-tcl and --with-tcl-version are also used to give a searchpath for tkConfig.sh<with>/lib/tkConfig.sh<with>/lib/tk<vsn>/tkConfig.sh<prefix>/lib/tkConfig.sh<prefix>/lib/tk<vsn>/tkConfig.sh/usr/lib/tkConfig.sh/usr/lib/tk<vsn>/tkConfig.shAgain, the configure scripts must be able to find tkConfig.shOnce tclConfig.sh and tkConfig.sh have been found and read in, the eCosconfigure scripts should have all the information needed to compile andlink code that uses Tcl. First the location of key headers such as<tcl.h> is needed. A tclConfig.sh file may define TCL_INC_DIR to givea specific location, otherwise the header files should be in$(TCL_PREFIX)/include. If <tcl.h> cannot be found then the eCos configurescripts will fail.Next it is necessary to work out how to link applications with Tcl. Thisinformation should be provided by a tclConfig.sh variable TCL_LIB_SPEC.Unfortunately not all Tcl installations set this, for example the cygwinTcl 8.4 release. If TCL_LIB_SPEC is not defined then instead theconfigure script will look for a library libtcl<vsn>.a, where <vsn> isspecified using --with-tcl-version, then for a library libtcl.aFollowing the configure step the build tree should be set upcorrectly. All that remains is the actual build and install:$ make$ make installThis should result in an ecosconfig executable, plus appropriatelibraries and header files. If the install prefix is a systemlocation, for example /usr/local/, then "make install" will normallyrequire root privileges. Also some of the package-specific softwarehas special installation requirements, for example programs that needto be installed suid root, and this will also need root privileges.Installing with Visual C++--------------------------Under Windows it is possible to build the generic host-side software(infra, libcdl and ecosconfig) with Visual C++ but this is deprecated.Building with g++ under cygwin is preferred.It is still necessary to run the configure script and a suitable makeutility. That requires a shell and a Unix-like environment, asprovided by cygwin. The Visual C++ compiler cl.exe needs to be on theshell's search path, and some environment variables such as INCLUDEand LIB may need to be set to point at the Visual C++ installation -the details may vary depending on the version of the compiler. Thenthe configure command should be run like this:$ CC=cl CXX=cl <path>/host/configure <args>Note that the path should be a cygwin path: cygwin mount points areaccepted and forward slashes should be used. The various configurescripts now detect that Visual C++ should be used, and adaptaccordingly.Depending on what cygwin mount points are set up, /usr/local may ormay not be an appropriate install location for VC++ applications.If not, the install location should be specified with --prefix:$ CC=cl CXX=cl <path>/configure --prefix=<install-path> <args>It is also necessary to use the right version of Tcl. For a VC++ buildthe cygwin release of Tcl should not be used. Instead a suitableprebuilt Tcl package can be obtained from http://www.tcl.tk/.It is necessary to tell the configure script where this has beeninstalled, for example:$ CC=cl CXX=cl <path>/configure --prefix=<install-path> \--with-tcl=/cygdrive/d/local/scriptics/Tcl/tcl8.1 <args>The library name will be of the form tcl81.lib, and there will not bea symbolic link from tcl.lib to the appropriate version. It will benecessary to specify the Tcl version explicitly since the defaultversion is currently 8.0.$ CC=cl CXX=cl <path>/configure --prefix=<install-path> \--with-tcl=/d/local/scriptics/Tcl/tcl8.1 --with-tcl-version=81 <args>Following a successful configure, the tools can be built and installedin the normal fashion:$ make$ make installMore Information================Please see the eCos web site, http://sources.redhat.com/ecos/, forfurther details. This includes the FAQ, a form for reporting problems,and details of the various mailing lists(http://sources.redhat.com/ecos/intouch.html) At the time of writingthere are no separate mailing lists for the eCos host-side sources,the main mailing list ecos-discuss@sources.redhat.com should be usedinstead.//####COPYRIGHTBEGIN####////----------------------------------------------------------------------------// Copyright (C) 2002 Bart Veer// Copyright (C) 2000, 2001 Red Hat, Inc.//// This file is part of the eCos host tools.//// This program is free software; you can redistribute it and/or modify it// under the terms of the GNU General Public License as published by the Free// Software Foundation; either version 2 of the License, or (at your option)// any later version.//// This program is distributed in the hope that it will be useful, but WITHOUT// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for// more details.//// You should have received a copy of the GNU General Public License along with// this program; if not, write to the Free Software Foundation, Inc.,// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.//// ----------------------------------------------------------------------------////####COPYRIGHTEND####
Go to most recent revision | Compare with Previous | Blame | View Log
