
Arcom Embedded Linux Technical Manual Developing software for AEL
Common open source build systems and cross compilation
The majority of open source software available uses configure scripts as part of the
build process. Passing the following on the command line in addition to your normal
options is often all that is required:
--host=SYSTEM-TYPE
Where SYSTEM-TYPE is the system type of the target, for example arm-linux.
‘Host’ in this context refers to the system that the final application is to run on (not to the
build system). For example:
$ ./configure --host=arm-linux [other options]
Some configure scripts accept a --target=SYSTEM-TYPE option ‘Target’ in this context
is only of relevance when building cross-compilers and similar tools, which run on one
system but produce something that runs on a different system (the target).
Not all configure scripts follow this behavior. In particular, build systems not
generated with the autoconf and automake tools are likely to not behave as
expected. Fortunately, a great many open source projects do use these tools.
Building libraries
Building libraries is similar to building applications. The libraries must be configured and
built to run on the target board. This means that the --prefix must be /usr, so that
libraries expect to be installed to /usr/lib/. However, the library and headers must also
be installed on the build system in /opt/arcom/SYSTEM-TYPE/lib and
/opt/arcom/SYSTEM-TYPE/include (where SYSTEM-TYPE is the system type, such as
arm-linux or i386-linux), so that the cross compiler and linker can use them.
With a standard automake and autoconf build system, this can be achieved by entering:
# make install prefix=/opt/arcom/arm-linux
Alternatively, you could install to /tmp/myapp-tmp and move the libraries and headers
into /opt/arcom/SYSTEM-TYPE by hand.
Installing applications and libraries on the target
Installing an application or library that uses the automake tool is normally achieved by
calling the install target, as follows:
$ make install
This causes the application or library to be installed into the host file system,
potentially causing enormous damage to the system.
Consider the consequences of replacing libc on an X86 system with a libc cross
compiled for an ARM system.
Perform the build and install of applications for the target as a non-root user on
the host system, as this can prevent the worst disasters.
© 2006 Arcom Issue G 38
Kommentare zu diesen Handbüchern