1 |
786 |
skrzyp |
eCos Host-side Software
|
2 |
|
|
=======================
|
3 |
|
|
|
4 |
|
|
This README file only describes the eCos host-side software. For
|
5 |
|
|
details of the eCos target-side software or the required toolchains,
|
6 |
|
|
please see other documentation. A good starting point is
|
7 |
|
|
http://sourceware.com/ecos
|
8 |
|
|
|
9 |
|
|
There are two categories of host-side software. The host subdirectory
|
10 |
|
|
contains generic software, primarily related to the eCos configuration
|
11 |
|
|
technology. All eCos users will need to use some of this technology to
|
12 |
|
|
configure and build eCos, either using pre-built binaries or by
|
13 |
|
|
building the host-side software from source. The generic software
|
14 |
|
|
should be portable to a wide range of host platforms.
|
15 |
|
|
|
16 |
|
|
There is also package-specific host-side software. Much of this is I/O
|
17 |
|
|
related. For example the generic USB-slave package contains some
|
18 |
|
|
programs related to testing; a test application is run on a target
|
19 |
|
|
with suitable USB slave-side hardware, and needs to interact with
|
20 |
|
|
another program running on the USB host; the latter is
|
21 |
|
|
package-specific host-side software and can be found in the
|
22 |
|
|
subdirectory packages/io/usb/slave. Code like this may have
|
23 |
|
|
significant platform dependencies and may only work on a single
|
24 |
|
|
platform or on a small number of platforms. There may also be
|
25 |
|
|
special requirements, for example it may be necessary to install some
|
26 |
|
|
programs suid root so that they have appropriate access to the
|
27 |
|
|
hardware.
|
28 |
|
|
|
29 |
|
|
|
30 |
|
|
The host subdirectory includes the following:
|
31 |
|
|
|
32 |
|
|
infra/
|
33 |
|
|
This is an implementation of the eCos infrastructure that can be
|
34 |
|
|
used on the host-side, and provides assertion, tracing and
|
35 |
|
|
testcase support.
|
36 |
|
|
|
37 |
|
|
NOTE: the eCos infrastructure facilities are not especially
|
38 |
|
|
well-suited to host-side development, in particular they are not
|
39 |
|
|
C++-oriented. There are plans to remove the current infrastructure
|
40 |
|
|
completely and replace it with something more suitable. People
|
41 |
|
|
planning new projects should be aware of this, and may wish to
|
42 |
|
|
avoid using the current infrastructure.
|
43 |
|
|
|
44 |
|
|
libcdl/
|
45 |
|
|
The CDL library lies at the heart of the eCos configuration
|
46 |
|
|
technology.
|
47 |
|
|
|
48 |
|
|
tools/configtool/
|
49 |
|
|
The sources to the various configuration tools can be found here.
|
50 |
|
|
|
51 |
|
|
tools/configtool/common/common/
|
52 |
|
|
Contains sources related to makefile generation, shared by the
|
53 |
|
|
command line and graphical tools.
|
54 |
|
|
|
55 |
|
|
tools/configtool/standalone/common/
|
56 |
|
|
Contains the command line ecosconfig tool.
|
57 |
|
|
|
58 |
|
|
tools/configtool/standalone/wxwin/
|
59 |
|
|
Contains sources for the wxWindows-based, Linux and Windows graphical
|
60 |
|
|
configuration tool. The Windows version is built with cygwin g++.
|
61 |
|
|
|
62 |
|
|
tools/configtool/common/win32/
|
63 |
|
|
tools/configtool/standalone/win32/
|
64 |
|
|
Contains sources for the older, MFC-based, Windows-only graphical
|
65 |
|
|
configuration tool. This can only be built with Visual C++.
|
66 |
|
|
|
67 |
|
|
The two graphical configuration tools have their own build procedures,
|
68 |
|
|
described in tools/configtool/standalone/wxwin/README.txt and
|
69 |
|
|
tools/configtool/standalone/win32/ReadMe respectively.
|
70 |
|
|
|
71 |
|
|
Package-specific host-side code lives in the host subdirectory of the
|
72 |
|
|
appropriate package, for example packages/io/usb/slave//host.
|
73 |
|
|
Most packages only provide target-side code and hence will not have a
|
74 |
|
|
host subdirectory. Users can install various packages from a variety
|
75 |
|
|
of sources, and where a package does have host-side software the
|
76 |
|
|
package documentation should be consulted for further information.
|
77 |
|
|
|
78 |
|
|
|
79 |
|
|
Installing on Linux, Other Unix Systems, and Cygwin
|
80 |
|
|
---------------------------------------------------
|
81 |
|
|
|
82 |
|
|
Both generic host-side software (infra, libcdl and ecosconfig) and
|
83 |
|
|
package-specific software can be built with the conventional
|
84 |
|
|
"configure/make/make install" sequence. However the code does not
|
85 |
|
|
conform fully to GNU coding standards so some operations such as "make
|
86 |
|
|
dist" are not supported. There is limited support for DejaGnu-based
|
87 |
|
|
testing.
|
88 |
|
|
|
89 |
|
|
Much of the host-side software has a dependency on Tcl. This is not
|
90 |
|
|
supplied with the sources since many users will already have a
|
91 |
|
|
suitable installation, for example it is shipped as standard with all
|
92 |
|
|
major Linux distributions. The generic host-side software should work
|
93 |
|
|
with any release of Tcl from 8.0 onwards. The package-specific
|
94 |
|
|
software requires a more recent version, 8.3 or later. If no suitable
|
95 |
|
|
Tcl installation is available then the configure step will still
|
96 |
|
|
succeed but some of the package-specific software will not be built.
|
97 |
|
|
|
98 |
|
|
There are two main approaches to building the host-side software:
|
99 |
|
|
|
100 |
|
|
1) build the generic and the package-specific code in one build tree.
|
101 |
|
|
This uses the top-level configure script. The script automatically
|
102 |
|
|
invokes the configure script in the main host subdirectory. In
|
103 |
|
|
addition it searches the packages hierarchy for host subdirectories
|
104 |
|
|
containing their own configure scripts and will invoke those.
|
105 |
|
|
|
106 |
|
|
Note: the search for host subdirectories happens during configure
|
107 |
|
|
time, not during the make. If new packages with host-side code are
|
108 |
|
|
added to the repository then it will be necessary to re-run the
|
109 |
|
|
toplevel configure script.
|
110 |
|
|
|
111 |
|
|
2) build the generic code in one build tree, using the configure
|
112 |
|
|
script in the toplevel's host subdirectory. Then build some or all
|
113 |
|
|
of the package-specific code in separate build trees, using the
|
114 |
|
|
configure scripts in each package's host subdirectory.
|
115 |
|
|
|
116 |
|
|
The first approach is generally simpler. However some of the
|
117 |
|
|
package-specific code requires special installation, for example a
|
118 |
|
|
program may have to be installed suid root so that it has the right
|
119 |
|
|
privileges to access hardware, and hence the "make install" step has
|
120 |
|
|
to be run by the superuser. Also some of the package-specific code is
|
121 |
|
|
rather specialized and may be of no interest to many users. For
|
122 |
|
|
example, the USB testing code is only useful when developing
|
123 |
|
|
USB-based applications. Hence some users may prefer the second
|
124 |
|
|
approach, building just the generic code and a subset of the
|
125 |
|
|
package-specific code.
|
126 |
|
|
|
127 |
|
|
It is necessary to use a separate build tree rather than build
|
128 |
|
|
directly in the source tree. This is enforced by the configure scripts.
|
129 |
|
|
|
130 |
|
|
$ mkdir build
|
131 |
|
|
$ cd build
|
132 |
|
|
|
133 |
|
|
The next step is to run the desired configure script. To build all
|
134 |
|
|
the host-side software this means the toplevel configure script:
|
135 |
|
|
|
136 |
|
|
$ /configure
|
137 |
|
|
|
138 |
|
|
Alternatively to build just the generic host-side software, use the
|
139 |
|
|
configure script in the host subdirectory.
|
140 |
|
|
|
141 |
|
|
$ mkdir host
|
142 |
|
|
$ cd host
|
143 |
|
|
$ /host/configure
|
144 |
|
|
|
145 |
|
|
Or, to build just one package's host-side code:
|
146 |
|
|
|
147 |
|
|
$ mkdir -p packages/io/usb/slave/current/host
|
148 |
|
|
$ cd packages/io/usb/slave/current/host
|
149 |
|
|
$ /packages/io/usb/slave/current/host/configure
|
150 |
|
|
|
151 |
|
|
(It is not actually necessary to use the same directory structure in
|
152 |
|
|
the build tree as in the source tree, but doing so can avoid
|
153 |
|
|
confusion).
|
154 |
|
|
|
155 |
|
|
A list of all the command-line options can be obtained by running
|
156 |
|
|
"configure --help". The most important ones are as follows:
|
157 |
|
|
|
158 |
|
|
1) --prefix. This can be used to specify the location of the install
|
159 |
|
|
tree, defaulting to /usr/local, so the ecosconfig program ends up
|
160 |
|
|
in /usr/local/bin/ecosconfig and the CDL library ends up in
|
161 |
|
|
/usr/local/lib/libcdl.a. If an alternative location is preferred
|
162 |
|
|
this can be specified with --prefix, for example:
|
163 |
|
|
|
164 |
|
|
$ /configure --prefix=/usr/local/ecos
|
165 |
|
|
|
166 |
|
|
2) --enable-debug. By default all assertions and tracing are disabled.
|
167 |
|
|
When debugging any of the generic host-side software these should
|
168 |
|
|
be enabled. Some package-specific code may not have any extra
|
169 |
|
|
debug support, in which case --enable-debug would be ignored.
|
170 |
|
|
|
171 |
|
|
$ /configure --enable-debug
|
172 |
|
|
|
173 |
|
|
It is also possible to control most of the assertion and tracing
|
174 |
|
|
macros at a finer grain. This is intended mainly for use by the
|
175 |
|
|
developers.
|
176 |
|
|
|
177 |
|
|
--disable-asserts disable all assertions
|
178 |
|
|
--disable-preconditions disable a subset of the assertions
|
179 |
|
|
--disable-postconditions disable a subset of the assertions
|
180 |
|
|
--disable-invariants disable a subset of the assertions
|
181 |
|
|
--disable-loopinvariants disable a subset of the assertions
|
182 |
|
|
--disable-tracing disable tracing
|
183 |
|
|
--disable-fntracing disable function entry/exit tracing
|
184 |
|
|
|
185 |
|
|
3) --with-tcl=
|
186 |
|
|
--with-tcl-version=
|
187 |
|
|
--with-tk=
|
188 |
|
|
|
189 |
|
|
The host-side tools have a dependency on Tcl, which is not supplied
|
190 |
|
|
with the sources because many people will already have a suitable
|
191 |
|
|
installation. Specifically it is necessary to have the header file
|
192 |
|
|
tcl.h and appropriate libraries such that -ltcl will work - this
|
193 |
|
|
can involve either static or shared libraries. Some tools may require
|
194 |
|
|
Tk as well as Tcl.
|
195 |
|
|
|
196 |
|
|
Unfortunately there is considerable variation in Tcl installations.
|
197 |
|
|
In theory all Tcl installations have a file tclConfig.sh which
|
198 |
|
|
defines exactly how to compile and link code that uses Tcl, and Tk
|
199 |
|
|
has a similar file tkConfig.sh. The eCos configure scripts look for
|
200 |
|
|
these files, first in $(prefix)/lib, then in /usr/lib. If the system
|
201 |
|
|
already has a Tcl installation in /usr then the configure script will
|
202 |
|
|
automatically find /usr/lib/tclConfig.sh and it is not necessary
|
203 |
|
|
to pass additional options when configuring the eCos host-side
|
204 |
|
|
software. Alternatively, if for example you have installed a more
|
205 |
|
|
recent version of Tcl/Tk in the same place that you want to install the
|
206 |
|
|
eCos software, e.g. /usr/local, then $(prefix)/lib/tclConfig.sh
|
207 |
|
|
will be read in.
|
208 |
|
|
|
209 |
|
|
It is also possible that a more recent version of Tcl has been installed
|
210 |
|
|
in a different location. For example, you may wish to install the eCos host
|
211 |
|
|
tools in /opt/ecos but use a version of Tcl installed in /usr/local. The
|
212 |
|
|
eCos configure scripts need to be told explicitly where to look for
|
213 |
|
|
the Tcl:
|
214 |
|
|
|
215 |
|
|
$ /configure --with-tcl=/usr/local ...
|
216 |
|
|
|
217 |
|
|
Some systems, for example Debian Linux 3.0, do not install tclConfig.sh
|
218 |
|
|
in /usr/lib because that makes it more difficult to have several different
|
219 |
|
|
versions of Tcl installed at the same time. Instead tclConfig.sh is found
|
220 |
|
|
in a versioned directory such as /usr/lib/tcl8.3. Since several versions
|
221 |
|
|
may be installed the desired one must be specified explicitly.
|
222 |
|
|
|
223 |
|
|
$ /configure --with-tcl-version=8.3
|
224 |
|
|
|
225 |
|
|
The --with-tcl and --with-tcl-version options are combined to give a search path:
|
226 |
|
|
|
227 |
|
|
/lib/tclConfig.sh
|
228 |
|
|
/lib/tcl/tclConfig.sh
|
229 |
|
|
/lib/tclConfig.sh
|
230 |
|
|
/lib/tcl/tclConfig.sh
|
231 |
|
|
/usr/lib/tclConfig.sh
|
232 |
|
|
/usr/lib/tcl/tclConfig.sh
|
233 |
|
|
|
234 |
|
|
If tclConfig.sh cannot be found in any of these places then it is assumed
|
235 |
|
|
that Tcl has not been properly installed and the eCos configure script will
|
236 |
|
|
fail.
|
237 |
|
|
|
238 |
|
|
To search for Tk the configure scripts use much the same rules as
|
239 |
|
|
for Tcl. It is also possible to specify a path using the --with-tk
|
240 |
|
|
option, useful if for some reason Tk has been installed in a
|
241 |
|
|
different location from Tcl. There is no --with-tk-version: it is
|
242 |
|
|
assumed that the same version should be used for both Tcl and Tk.
|
243 |
|
|
|
244 |
|
|
Again, the configure scripts must be able to find tkConfig.sh
|
245 |
|
|
|
246 |
|
|
Once tclConfig.sh and tkConfig.sh have been found and read in, the eCos
|
247 |
|
|
configure scripts should have all the information needed to compile and
|
248 |
|
|
link code that uses Tcl. First the location of key headers such as
|
249 |
|
|
is needed. A tclConfig.sh file may define TCL_INCLUDE_SPEC
|
250 |
|
|
or TCL_INC_DIR to give a specific location, otherwise the header
|
251 |
|
|
files should be in $(TCL_PREFIX)/include. If cannot be
|
252 |
|
|
found then the eCos configure scripts will fail.
|
253 |
|
|
|
254 |
|
|
Next it is necessary to work out how to link applications with Tcl. This
|
255 |
|
|
information should be provided by a tclConfig.sh variable TCL_LIB_SPEC.
|
256 |
|
|
Unfortunately not all Tcl installations set this, for example the cygwin
|
257 |
|
|
Tcl 8.4 release. If TCL_LIB_SPEC is not defined then instead the
|
258 |
|
|
configure script will look for a library libtcl.a, where is
|
259 |
|
|
specified using --with-tcl-version, then for a library libtcl.a.
|
260 |
|
|
tclConfig.sh may also list additional libraries in TCL_LIBS and
|
261 |
|
|
additional linker flags in TCL_LD_FLAGS.
|
262 |
|
|
|
263 |
|
|
For Tk the relevant tkConfig.sh settings are TK_INCLUDE_SPEC or
|
264 |
|
|
TK_INC_DIR, TK_XINCLUDES, TK_LIB_SPEC, and TK_LIBS.
|
265 |
|
|
|
266 |
|
|
|
267 |
|
|
Following the configure step the build tree should be set up
|
268 |
|
|
correctly. All that remains is the actual build and install:
|
269 |
|
|
|
270 |
|
|
$ make
|
271 |
|
|
$ make install
|
272 |
|
|
|
273 |
|
|
This should result in an ecosconfig executable, plus appropriate
|
274 |
|
|
libraries and header files. If the install prefix is a system
|
275 |
|
|
location, for example /usr/local/, then "make install" will normally
|
276 |
|
|
require root privileges. Also some of the package-specific software
|
277 |
|
|
has special installation requirements, for example programs that need
|
278 |
|
|
to be installed suid root, and this will also need root privileges.
|
279 |
|
|
|
280 |
|
|
|
281 |
|
|
Installing with Visual C++
|
282 |
|
|
--------------------------
|
283 |
|
|
|
284 |
|
|
Under Windows it is possible to build the generic host-side software
|
285 |
|
|
(infra, libcdl and ecosconfig) with Visual C++ but this is deprecated.
|
286 |
|
|
Building with g++ under cygwin is preferred.
|
287 |
|
|
|
288 |
|
|
It is still necessary to run the configure script and a suitable make
|
289 |
|
|
utility. That requires a shell and a Unix-like environment, as
|
290 |
|
|
provided by cygwin. The Visual C++ compiler cl.exe needs to be on the
|
291 |
|
|
shell's search path, and some environment variables such as INCLUDE
|
292 |
|
|
and LIB may need to be set to point at the Visual C++ installation -
|
293 |
|
|
the details may vary depending on the version of the compiler. Then
|
294 |
|
|
the configure command should be run like this:
|
295 |
|
|
|
296 |
|
|
$ CC=cl CXX=cl /host/configure
|
297 |
|
|
|
298 |
|
|
Note that the path should be a cygwin path: cygwin mount points are
|
299 |
|
|
accepted and forward slashes should be used. The various configure
|
300 |
|
|
scripts now detect that Visual C++ should be used, and adapt
|
301 |
|
|
accordingly.
|
302 |
|
|
|
303 |
|
|
Depending on what cygwin mount points are set up, /usr/local may or
|
304 |
|
|
may not be an appropriate install location for VC++ applications.
|
305 |
|
|
If not, the install location should be specified with --prefix:
|
306 |
|
|
|
307 |
|
|
$ CC=cl CXX=cl /configure --prefix=
|
308 |
|
|
|
309 |
|
|
It is also necessary to use the right version of Tcl. For a VC++ build
|
310 |
|
|
the cygwin release of Tcl should not be used. Instead a suitable
|
311 |
|
|
prebuilt Tcl package can be obtained from http://www.tcl.tk/.
|
312 |
|
|
It is necessary to tell the configure script where this has been
|
313 |
|
|
installed, for example:
|
314 |
|
|
|
315 |
|
|
$ CC=cl CXX=cl /configure --prefix= \
|
316 |
|
|
--with-tcl=/cygdrive/d/local/scriptics/Tcl/tcl8.1
|
317 |
|
|
|
318 |
|
|
The library name will be of the form tcl81.lib, and there will not be
|
319 |
|
|
a symbolic link from tcl.lib to the appropriate version. It will be
|
320 |
|
|
necessary to specify the Tcl version explicitly since the default
|
321 |
|
|
version is currently 8.0.
|
322 |
|
|
|
323 |
|
|
$ CC=cl CXX=cl /configure --prefix= \
|
324 |
|
|
--with-tcl=/d/local/scriptics/Tcl/tcl8.1 --with-tcl-version=81
|
325 |
|
|
|
326 |
|
|
Following a successful configure, the tools can be built and installed
|
327 |
|
|
in the normal fashion:
|
328 |
|
|
|
329 |
|
|
$ make
|
330 |
|
|
$ make install
|
331 |
|
|
|
332 |
|
|
|
333 |
|
|
More Information
|
334 |
|
|
================
|
335 |
|
|
|
336 |
|
|
Please see the eCos web site, http://sourceware.com/ecos/, for
|
337 |
|
|
further details. This includes the FAQ, a form for reporting problems,
|
338 |
|
|
and details of the various mailing lists
|
339 |
|
|
(http://sources.redhat.com/ecos/intouch.html) At the time of writing
|
340 |
|
|
there are no separate mailing lists for the eCos host-side sources,
|
341 |
|
|
the main mailing list ecos-discuss@sourceware.com should be used
|
342 |
|
|
instead.
|
343 |
|
|
|
344 |
|
|
// ####ECOSDOCCOPYRIGHTBEGIN####
|
345 |
|
|
// ===============================================================
|
346 |
|
|
// Copyright (C) 2000, 2001, 2002, 2009 Free Software Foundation, Inc.
|
347 |
|
|
// This material may be distributed only subject to the terms
|
348 |
|
|
// and conditions set forth in the Open Publication License, v1.0
|
349 |
|
|
// or later (the latest version is presently available at
|
350 |
|
|
// http://www.opencontent.org/openpub/)
|
351 |
|
|
// Distribution of the work or derivative of the work in any
|
352 |
|
|
// standard (paper) book form is prohibited unless prior
|
353 |
|
|
// permission obtained from the copyright holder
|
354 |
|
|
// ===============================================================
|
355 |
|
|
// ####ECOSDOCCOPYRIGHTEND####
|